pyboxbuilder.packing.spacer¶
Spacer tray generation — fill leftover space with minimal, hole-free, supported trays.
Four stages (FR-014, FR-014a/b/c, FR-018):
Sweep the game box for empty volume using an axis-unbiased 3D histogram maximal-empty-cuboid DP ($O(N_x N_y N_z^2)$), extracting the globally largest empty cuboid at every step regardless of axis orientation.
Merge adjacent cuboids whose union is itself a cuboid via indexed face matching to a deterministic fixed point.
Rectilinear polygon merge of coplanar same-Z neighbors into L/T/U PathBox footprints, automatically splitting genus >= 1 ring/donut frames around interior boxes so no spacer ever swallows an enclosed box.
Support & clearance filter shrinking footprints by clearance and verifying both vertical support from below and minimum printable thickness.
Classes
Configuration for a single spacer tray. |
|
An empty region: a box, or a prism over a non-rectangular footprint. |
Functions
Shrink a void by slack on every horizontal side so the tray lifts out freely. |
|
generate_spacer_voids as Placement`s named `spacer_1..spacer_N. |
|
Sweep, merge, split holes, verify support, shrink and filter — the whole spacer pass. |
|
Generate spacer tray specs for gaps left at the end of 2D rows. |
|
Fuse coplanar same-Z neighbours into polygon-footprint trays, splitting holes (FR-018). |
|
Fuse mergeable voids deterministically using orthogonal face-bucket indexing (FR-014b). |
|
Decompose the space no placement occupies into disjoint boxes, largest first. |
|
Trace the single genus-0 outline of a union of axis-aligned footprints. |