pub struct SolidClassifier<'a> { /* private fields */ }Expand description
Point-in-solid classification with per-solid precomputation: face bounds, the solid box, and a face BVH are built once so repeated queries (boolean fragment selection asks once per fragment) prune to the few faces a probe point or ray can actually touch.
Implementations§
Source§impl<'a> SolidClassifier<'a>
impl<'a> SolidClassifier<'a>
pub fn new(solid: &'a BrepSolid, tolerance: f64) -> Result<Self, String>
Sourcepub fn near_surface(&self, point: Vec3) -> Result<bool, String>
pub fn near_surface(&self, point: Vec3) -> Result<bool, String>
Cheap On-band probe: is the point within the classifier’s On tolerance of ANY face carrier (trim not checked — conservative)? Used to guard adjacency propagation: fragments near the other solid’s surface need the full normal-based On decision, everything else can inherit its fate from a neighbor.
Sourcepub fn within_band(&self, point: Vec3, band: f64) -> Result<bool, String>
pub fn within_band(&self, point: Vec3, band: f64) -> Result<bool, String>
Conservative carrier-proximity probe: is point within band of ANY
face’s carrier surface (trim NOT checked)? A strict superset of the
On verdict (which additionally requires the point to fall in a face’s
trim), so callers that want to skip every point that might be on or
near the boundary — the semantic oracle’s On-skip — can rely on a true
here to mean “not safely In/Out”. band is taken explicitly so the
caller can widen it to a size-relative width and absorb near-coincidence
gaps (Golovanov §4.13 derived tolerances).
pub fn classify(&self, point: Vec3) -> Result<PointClassification, String>
Sourcepub fn coincident_on_normal(&self, point: Vec3) -> Result<Option<Vec3>, String>
pub fn coincident_on_normal(&self, point: Vec3) -> Result<Option<Vec3>, String>
Wider-band On probe for near-coincident faces. A model built from
noisy input carries faces that are geometrically coincident with the
other solid’s boundary yet separated by a gap that scales with the
model (a few microns), not with the absolute model tolerance. Such a
gap slips a face fragment’s interior test point past the fixed On band
(classify), so it reads as a stray In/Out. This probe re-checks
whether point sits in the trim INTERIOR of a coincident boundary
face within a band derived from the solid’s size (Golovanov §4.13
derived tolerances), returning the mean outward normal of the
coincident faces when it does. It only ever RESCUES an On verdict —
callers keep the tight-band In/Out otherwise — so the general
classification path is unchanged. Interior-only (boundary hits are
ignored) so it fires only on a genuine surface overlap, never on mere
proximity to an edge.