pyboxbuilder.layout.arrange

pyboxbuilder.layout.arrange(node: Group | PolygonGrid | str, sizes: dict[str, tuple[float, float, float]], origin: Sequence[float] = (0.0, 0.0, 0.0)) → Arrangement[source]

Resolve a layout tree into a position per box.

Parameters:
node: Group | PolygonGrid | str

The root group, or a single box label.

sizes: dict[str, tuple[float, float, float]]

{label: (width, length, height)} for every box named in the tree.

origin: Sequence[float] = (0.0, 0.0, 0.0)

Where the arrangement’s minimum corner goes.

Returns:

The positions and the overall extent.

Raises:

LayoutError – If the tree names an unknown box, or names one twice.