pyboxbuilder.compartments.sizing

Compartment row-width distribution (T052a / FR-004).

The shelf packer in layout.py places compartments at their requested size and leaves whatever is left over as dead space at the end of each row. This module takes a finished row and grows its members so the row fills the interior width exactly, which is what you want for card wells and token trays that should butt up against the box walls.

Classes

RowItem

One compartment in a row, as seen by the distributor.

Functions

distribute_row_width

Grow the growable items in a row so the row fills available_width.

distribute_rows

Apply distribute_row_width to every row of a shelf layout.

rows_from_placements

Group CompartmentPlacement instances into rows by their y coordinate.