Module retriangulate

Source
Expand description

Retriangulating a face against the intersection curve crossing it.

§What this produces

A face cut by the intersection curve is replaced by triangles whose edges follow that curve. Every output triangle then lies wholly inside or wholly outside the other solid, so classification becomes a per-triangle question with no further geometry – which is what makes an exact boolean possible.

§Why the work happens in 2D

All points involved lie in the face’s plane by construction: the face’s own corners, and curve nodes that were computed as crossings OF that plane. Projecting along the plane’s dominant axis is therefore exact in the sense that matters – it drops a coordinate that carries no information, rather than approximating one that does.

The dominant axis is chosen from the largest normal component so the projection never collapses: picking a near-perpendicular axis would squash the triangle to a sliver and lose the orientation the triangulation depends on.

§Honest limits

This handles the case the intersection curve actually produces for the operands ScalarBoolean supports: a face crossed by a chain of segments that enters and leaves through its boundary. A curve forming a closed loop strictly INSIDE one face is refused – it needs a hole-aware triangulation, and inventing a bridge edge to fake it would produce a mesh whose topology no longer matches the geometry.

Structs§

FacePatch
A face’s corners plus the curve nodes lying on it, ready to triangulate.

Functions§

retriangulate_face
Retriangulate one face against the curve segments lying on it.