Skip to content
Projects

Helix

The equations of simgeometry.objects.helix, declared on the code that implements them and checked by the tests.

Helix

classsource

A helical wire of round cross-section: the points within wire_radius of a helix.

centreline
c(t)=p0+R (cos⁡t u+sin⁡t v)+p t2π a,0≤t≤2πN\mathbf c(t) = \mathbf p_0 + R\,(\cos t\,\mathbf u + \sin t\,\mathbf v) + \frac{p\,t}{2\pi}\,\mathbf a, \qquad 0 \le t \le 2\pi N
level set
ϕ(x)=min⁡0≤t≤2πN∣x−c(t)∣−rw\phi(\mathbf x) = \min_{0 \le t \le 2\pi N} |\mathbf x - \mathbf c(t)| - r_w
descent
t←t−f′(t)f′′(t) or 2ρR+2b2,f(t)=ρ2+R2−2ρRcos⁡(t−φ)+(s−bt)2,b=p2πt \leftarrow t - \frac{f'(t)}{f''(t) \text{ or } 2\rho R + 2b^2}, \qquad f(t) = \rho^2 + R^2 - 2\rho R\cos(t - \varphi) + (s - b t)^2, \quad b = \frac{p}{2\pi}
bound
∣x−c(t)∣≥(ρ−R)2+max⁡(−s,s−pN,0)2|\mathbf x - \mathbf c(t)| \ge \sqrt{(\rho - R)^2 + \max(-s, s - pN, 0)^2}
Assumes
  • a\mathbf a the unit axis, u\mathbf u the direction of the start point from the axis, v=±a×u\mathbf v = \pm\mathbf a\times\mathbf u (right- or left-handed); (s,ρ,φ)(s, \rho, \varphi) the point's cylindrical coordinates in that frame
  • the wire's ends are hemispheres (the points within rwr_w of the end points of the centreline)
  • within 2rw2 r_w of the cylinder the centreline lies on: the minimum over tt from four starts, the two ends and the linearised minima of the two turns around s/bs / b, by six Newton steps (descent steps on the majorant f′′≤2ρR+2b2f'' \le 2\rho R + 2b^2 where f′′f'' is not clearly positive), clipped to [0,2πN][0, 2\pi N]; exact there (tested against dense sampling)
  • farther away ϕ\phi is the bound (the distance from the cylinder, minus rwr_w): a level set that never exceeds the distance