Skip to main content

Module shell

Module shell 

Source
Expand description

Point-in-solid containment via ray casting against a shell’s vertices, edges, and faces in 3-D — the 3-D analog of super::face::face_contains.

Coincidence with the boundary is checked first (vertex, then edge, then face — each a full pass, so a higher-priority coincidence is never shadowed by iteration order). Otherwise a ray is cast from the query point in a random direction (drawn from a seeded PRNG, see super::rng::Rng), retried with a fresh direction whenever it grazes a vertex or an edge (both ambiguous to count reliably — an edge is shared by two faces, a vertex by several edges), until one is found whose only crossings are clean face-interior hits. The even/odd parity of that crossing count then gives inside/outside — this needs no consistently oriented face normal, only a clean ray.

Enums§

PointClassification
Result of classifying a query point against a shell’s boundary.

Functions§

shell_contains
Classify point against shell_id’s boundary: PointClassification::OnVertex / PointClassification::OnEdge / PointClassification::OnFace if the query point itself coincides with the boundary, else PointClassification::Inside/PointClassification::Outside via ray casting.