# Generate a 'natural' path through a set of 3D points

I have a set $P=\{p_0,\ldots,p_n\}$ of 3D points, such that a curve (spline) passes through each point in order. The curve is well-defined (in this case a cubic spline) and for each point $p_i$ I have a tangent $T_i$.

For $p_0$ I have, besides $T_0$, also $N_0$ and $B_0$, 3 mutually orthogonal axes which define a 3D orientation.

What I need is to a way to generate a 'natural 'or 'least torque' way to calculate $N$ & $B$ along the curve, so that at any point I have a local coordinate space. To qualify 'natural', imagine pushing a flexible, frictionless hose over a steel rod bent into the shape of the curve.

I do not need a mathematically exact solution, in fact probably calculating $N_i$ & $B_i$ only might be sufficient since $T$ is mathematically defined along the curve.

Note, this is different from more common ways to generate a moving coordinate system along a curve; in those kind of approaches an 'S' shape means the coordinate system will rotate 180 degrees. Clearly, we have to 'walk' along the curve rather than calculating $B/N$ purely based on $T$ and its derivatives in this case.

-
Best of luck with your 'natural path'. – r4. Jan 30 '12 at 18:40
((John asked a similar question on stackoverflow a couple of days ago I noted)). stackoverflow.com/questions/8907536/… – r4. Jan 30 '12 at 18:41
Indeed: but that took a turn down Frenet frames (see my other Q: math.stackexchange.com/questions/103924/…), and that is a solution to a different problem. – Mr. Boy Jan 30 '12 at 18:45