Skip to content
Projects

Cylinder

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

Cylinder

classsource

A solid circular cylinder with its axis from start to end.

inside
p∈S  ⟺  ∣s∣≤L,  ρ2≤R2(f=0),p∈S  ⟺  ϕ(p)≤0(f>0)p \in S \iff |s| \le L,\; \rho^2 \le R^2 \quad (f = 0), \qquad p \in S \iff \phi(p) \le 0 \quad (f > 0)
level set
ϕ=ϕrect(ρ,s; R−f,L−f)−f,ϕrect(x,y;hx,hy)=∣max⁡(d,0)∣+min⁡(max⁡(dx,dy),0),d=(∣x∣−hx,∣y∣−hy)\phi = \phi_\mathrm{rect}(\rho, s;\ R - f, L - f) - f, \qquad \phi_\mathrm{rect}(x, y; h_x, h_y) = \big|\max(d, 0)\big| + \min(\max(d_x, d_y), 0), \quad d = (|x| - h_x, |y| - h_y)
Assumes
  • half length LL, radius RR, in the frame (s,ρ)(s, \rho) of AxisymmetricShape
  • the fillet f≤min⁡(R,L)f \le \min(R, L) rounds the two circular edges
  • ϕ\phi is the exact signed distance, negative inside
Built from