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.

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. Where all six are abandoned, the point’s winding number against the faces’ meshes answers, where the point stands clear of the band between each face and its mesh and the number is within a hundredth of zero or one.

§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 and the winding number could not be read: the point stands within a curved face’s mesh band at the finest chord tried, or the boundary does not wind zero or one times about it.