For each point p(t)
on your helix you need to create a circle of vertices. Compute the tangent to the curve by finding p(t+d)
, for some small value of d
. Normalise the vector p(t)->p(t+d)
- this is the normal of the plane on which the vertices of your pipe will lie.
Project the vector from p(t)
to the origin onto this plane. The first vertex in the circle should lie on this projection, with the rest advancing in rotation around the plane normal. This will provide a consistent direction for each circle so that you can stitch the vertices together into triangles.