pyboxbuilder.compartments.element.elements_footprint

pyboxbuilder.compartments.element.elements_footprint(elements: Sequence[CompartmentElement], margin: float = 0.0) → tuple[float, float][source]

Size of the rectangular compartment that holds this element pack (FR-004b).

Offsets are measured from the compartment’s own lower-left corner, so the footprint spans from that corner out to the furthest element — authored offsets are preserved rather than collapsed against the origin. Use normalize_elements first if you want the pack shrink-wrapped instead.

Parameters:
elements: Sequence[CompartmentElement]

The elements in the pack, positioned in the compartment frame.

margin: float = 0.0

Extra clearance added past the furthest element, in mm.

Returns:

(width, length) of the compartment needed to hold the pack, in mm.