pyboxbuilder.compartments.element¶
Compartment elements — individual game components nested inside a compartment.
A CompartmentElement is one physical piece (a worker meeple, a hero standee, a hex tile, a wooden marker) with its own silhouette, its own local (x, y) offset inside the owning compartment, its own rotation and its own depth. A compartment that carries elements is an element pack: the elements are positioned in a local frame and the pack’s bounding box is what the box-level layout engine sees, so the pack behaves exactly like one ordinary rectangular compartment (FR-004b).
Geometry generation delegates to pybosl2 and is only imported when a cutout is actually built, so the layout maths stays importable without PythonSCAD.
Classes
A physical game component nested inside a compartment's bounding box. |
Functions
Build the cutout solid for one element, in the compartment's local frame. |
|
Union every element cutout in a pack. |
|
Build the coloured positive inserts of a pack, one per coloured element. |
|
Union every pull-out scoop in a pack, using area cutouts for thick groups and deep bays for thin tokens. |
|
Return the finger dish that lets a piece be lifted out of its slot. |
|
Return a CompartmentElement centered at the given coordinate. |
|
Return a CompartmentElement centered exactly in a box's interior frame. |
|
Compute per-box |
|
Return |
|
Return (min_x, min_y, max_x, max_y) covering every element in the pack. |
|
Size of the rectangular compartment that holds this element pack (FR-004b). |
|
Return the pairs of elements whose bounding boxes intersect. |
|
Repeat one element count times along a straight line (FR-004b). |
|
Shift a pack so its bounding box starts at (margin, margin). |
|
Auto-pack loose |
|
Auto-lay out elements inside a fixed-size compartment interior. |
|
Extrude an SVG outline and scale it to fill width x length x depth. |
|
Union a list of solids with a balanced fold. |