pyboxbuilder.export.geometry¶
Mesh geometry — bounding box and volume — for comparing exported pieces.
The 3MF bytes are not a stable signal: OpenSCAD’s solver retriangulates a CSG tree differently between runs, so an identical piece can produce different bytes. Its geometry is stable, though — the vertices land on the same surface and the volume is invariant to how that surface is triangulated. So the “is this actually different” test measures the bounding box and the volume of the geometry already on disk and of what would be written, and skips the write when they agree.
A bounding box on its own is not enough: two pieces can share a box but differ inside it (a card slot cut 5 mm deeper changes no wall). Volume catches that, and the pair is exact where the file bytes are not.
Classes
A piece's bounding box and volume, measured in its own frame. |
Functions
Mesh a payload and measure its bounding box and volume. |
|
Measure the geometry inside an existing 3MF, or None when unreadable. |
|
Measure the geometry inside an existing STL, or None when unreadable. |
|
Return True when two measured geometries agree. |