Calculate the spiral around a curve

calculusgeometryvector-spacesvectors

I have a curve given by a set of points and want to build a spiral around it (like this).

enter image description here

I tried it by

STEP 1:
calculated the vector of each step by

$$v_n = \left<x_n,y_n,z_n\right> – \left<x_{n-1},y_{n-1},z_{n-1}\right>$$

STEP 2:
I assumed a vector/plane of the rotating trajectory as
$$ w_n = \left<\cos(i),1,\sin(i)\right>$$

where $i$ represents the intervals and increases by the point number.

And calculated the perpendicular vector to find the spiral points by

$$X = v_y \cdot w_z – v_z \cdot w_y $$
$$Y = v_z \cdot w_x – v_x \cdot w_z $$
$$Z = v_x \cdot w_y – v_y \cdot w_x $$

And, of course, I normalized the scale.

The spiral is formed, but I have discontinuity or deformation at sharp angles (probably because the vector direction is changed). It is not a matter of smoothness, as the spiral changes its direction to rotate in the opposite direction.

Where did I do wrong?

Best Answer

spiral will evolve according to helical angle $$\phi_n=\phi_{n-1}+2 \pi \frac{|\vec{x}_n-\vec{x}_{n-1}|}{\lambda}$$ where $\lambda$ is the pitch of the helix and is measured relative to an "up" orientation normal vector $\vec{u}$ which is the component of the acceleration vector $\vec{a}_n$ perpendicular to the velocity vector $\vec{v}_n$ $$\vec{u}_n=\hat{a}_n-(\hat{a}_n \cdot \hat{v}_n ) \hat{v}_n$$ where $$ \vec{v}_n=\vec{x}_n-\vec{x}_{n-1}$$ and $$\vec{a}_n=\vec{v}_n-\vec{v}_{n-1}$$ the location of the helix is then given by $$\vec{h}_n=\vec{x}_n+\hat{u}_nR\cos \phi_n+(\hat{u}_n\times\hat{v}_n)R\sin \phi_n$$ where $R$ is the radius of the helix

Related Question