Skip to content
Projects

Cone

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

Cone

classsource

A frustum with radius start_radius at start and end_radius at end.

inside
p∈S  ⟺  ∣s∣≤L,  ρ≤r1+(r2−r1) s+L2Lp \in S \iff |s| \le L,\; \rho \le r_1 + (r_2 - r_1)\,\frac{s + L}{2L}
level set
ϕ=±min⁡(∣(ρ−min⁡(ρ,rcap), ∣s∣−L)∣, ∣(ρ,s)−q∣),q=(r2,L)+clip⁡(τ,0,1) (r1−r2,−2L)\phi = \pm \min\Big(\big|(\rho - \min(\rho, r_\mathrm{cap}),\ |s| - L)\big|,\ \big|(\rho, s) - q\big|\Big), \qquad q = (r_2, L) + \operatorname{clip}(\tau, 0, 1)\,(r_1 - r_2, -2L)
slant
τ=(ρ−r2)(r1−r2)−2L (s−L)(r1−r2)2+4L2\tau = \frac{(\rho - r_2)(r_1 - r_2) - 2L\,(s - L)}{(r_1 - r_2)^2 + 4L^2}
Assumes
  • radius r1r_1 at s=−Ls = -L (start), r2r_2 at s=Ls = L (end), one of them may be zero; frame (s,ρ)(s, \rho) of AxisymmetricShape
  • rcapr_\mathrm{cap} is the radius of the nearer cap; the minus sign where the point is on the inner side of the slant and ∣s∣<L|s| < L
  • ϕ\phi is the exact signed distance
References
Built from