Solidifying a 3D parametric curve

36 Views Asked by At

I have an arbitrary parametric 3D curve which I need to solidify, that is, give it a circular thickness. I have a circle lying in the XY-plane, and for every point (x0, y0) of my curve, the circle will need to be rotated around the X and Y axes, and moved, so that its center is at (x0, y0), and its plane is perpendicular to the direction vector of the curve in that point.

So the curve is defined as follows:

x = x(t)
y = y(t)
z = z(t)

and its derivatives are x'(t), y'(t) and z'(t) which define the direction vector in each point.

I have worked out the rotation angles around X and Y axes as follows:

$Alpha_x(t) = -arctan\frac{y'(t)}{\sqrt{(x'(t))^2 + (z'(t))^2}}$
$Alpha_y(t) = -arctan\frac{x'(t)}{z'(t)}$

This kind of works but it does not look great. For the simple Lissajous curve defined as

x = cos(t)
y = sin(2t)
z = sin(3t)

The result is as follows:

enter image description here

and here is a section of a bend zoomed in:

enter image description here

enter image description here

As you can see, there is a noticeable twist. I want to get rid of it. I am guessing, my rotation formulas must include the 2nd derivatives too. Can anyone please help?

Thanks.