Skip to content
Projects

Cuboid

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

Cuboid

classsource

Represent a cuboid geometry object.

inside
p∈S  ⟺  l≤p≤u(f=0),p∈S  ⟺  ϕ(p)≤0(f>0)p \in S \iff l \le p \le u \quad (f = 0), \qquad p \in S \iff \phi(p) \le 0 \quad (f > 0)
level set
ϕ(p)=∣max⁡(d,0)∣+min⁡(max⁡kdk,0)−f,d=∣p−c∣−(h−f)\phi(p) = \big|\max(d, 0)\big| + \min\big(\max_k d_k, 0\big) - f, \qquad d = |p - c| - (h - f)
Assumes
  • axis-aligned, centre cc, half sides hh; ∣⋅∣|\cdot| and max⁡(⋅,0)\max(\cdot, 0) of dd componentwise
  • the fillet f≤min⁡khkf \le \min_k h_k rounds the edges and corners: the box shrunk by ff, widened by a ball of radius ff
  • closed: points on the faces are inside
  • ϕ\phi is the exact signed distance, negative inside
References