Efficient self-collision detection on smoothly discretized