Skip to content
Projects

SlantedTube

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

SlantedTube

classsource

A tube from start to end whose end at end is cut by a slanted plane.

frame
w=p−pstart,s=w⋅a,ρ=∣w−s a∣,η=w⋅n−L (n⋅a)w = p - p_\mathrm{start}, \qquad s = w\cdot a, \qquad \rho = |w - s\,a|, \qquad \eta = w\cdot n - L\,(n\cdot a)
inside
p∈S  ⟺  s≥0,  η≤0,  ri≤ρ≤rop \in S \iff s \ge 0,\; \eta \le 0,\; r_i \le \rho \le r_o
level set
ϕ=max⁡(ϕtube,η),ϕtube=∣(max⁡(ϱ,0),max⁡(−s,0))∣+min⁡(max⁡(ϱ,−s),0),ϱ=max⁡(ri−ρ,ρ−ro)\phi = \max(\phi_\mathrm{tube}, \eta), \qquad \phi_\mathrm{tube} = \big|(\max(\varrho, 0), \max(-s, 0))\big| + \min(\max(\varrho, -s), 0), \qquad \varrho = \max(r_i - \rho, \rho - r_o)
Assumes
  • unit axis aa from start, length LL to the centre of the cut; cut plane through end with unit outward normal nn, n⋅a>0n\cdot a > 0
  • the cut misses the start face: rotan⁡θ<Lr_o \tan\theta < L; a rod (ri=0r_i = 0) has ϱ=ρ−ro\varrho = \rho - r_o
  • ϕ\phi, the larger of the distances to the half-infinite tube and to the cut plane, is exact away from the rim of the cut and a bound near it