Expand description
Exact boolean over general planar-faced solids (#77).
§Why this is not a BSP tree
A BSP boolean constructs split points recursively, so each generation of cuts is computed from coordinates that were themselves computed. Error compounds with depth and the exactness claim decays silently.
Here every fragment is carried as a polygon whose plane is one of the ORIGINAL input planes, never a derived one. A face is split only against input planes, so a vertex is at worst one intersection away from input data. Classification then asks a certified predicate which side of the other solid a fragment lies on.
§Split points are correctly rounded
Split points are stored in f64 (ADR 0045, plane_crossing), each
coordinate the double NEAREST to the exact crossing. The earlier f64
formula rounded twice, so after many operations a vertex two operands
should share landed a few ULPs apart, and a split through it emitted a
fragment enclosing no area (#199). Correct rounding is a function of the
exact point alone, so that drift cannot arise, and a crossing that is a
double – every cut of an axis-aligned edge by an axis-aligned plane –
is returned exactly.
§Thin fragments are classified exactly
The input’s own coordinates can put two planes one ULP apart (2/3
computed two ways), so a correct result may contain fragments one ULP
wide. No double lies strictly inside such a fragment, so it is
classified at an exact dyadic interior point (Probe); a fragment that
encloses no area has no interior and is refused by name.
§Collapsed fragments are not dropped
Deleting zero-area fragments was tried and reverted (40b5069): the
chain then completes, but the holes it leaves make the shell integrate to
a plausibly wrong volume. A refusal is actionable; a wrong volume is
silent. Do not reintroduce a drop-based fix (#199).
Structs§
- Polyhedron
- A closed solid bounded by planar polygonal faces.
Enums§
- Boolean
Op - Which boolean to evaluate.
Functions§
- boolean_
polyhedra_ exact - Exact boolean over two planar-faced solids.
- triangulate
- Triangulate a polyhedron for measurement and diagnosis.