Skip to main content

classify_in_solid_exact

Function classify_in_solid_exact 

Source
pub fn classify_in_solid_exact(
    model: &Model,
    solid: &Shape,
    point: Point,
    tol: Tolerances,
) -> OgeomResult<Containment>
Expand description

Where a point sits relative to a closed shell or solid, decided against the true surfaces.

This is the promise the tessellated classifier’s documentation makes on behalf of “a later layer”, kept: rays are cast against each face’s actual geometry through the curve/surface intersector, so the band where the answer is On rather than a side is the tolerance, not the deflection. A point a micron off a sphere’s wall classifies as the side it is on; classify_in_solid at any practical deflection could only say On.

The crossing-parity argument is the same as the tessellated one, and so is the discipline about degenerate hits. A ray that grazes a surface tangentially, meets a face too near its boundary to be sure which side of the trim it crossed, lies in a face’s surface, or passes through a pole or an apex, is not patched into a count; the ray is abandoned and the next direction tried. Six directions, deterministic, none axis-aligned.

§Errors

OgeomError::Construction if the shape is not a solid or a shell, or its boundary is not closed; OgeomError::NotDone if every ray met a degeneracy, which a handful of deliberately skew directions makes an engineered case rather than an encountered one.