pyboxbuilder.compartments.hex_grid.compute_hex_layout

pyboxbuilder.compartments.hex_grid.compute_hex_layout(spec: HexGridSpec) → list[HexCell][source]

Compute the (x, y) center of every hex cell in a rows×cols grid.

Hex grids use a staggered (pointy-top) layout: odd rows are offset horizontally by half a cell width.

Parameters:
spec: HexGridSpec

The hex grid specification.

Returns:

List of HexCell with computed center coordinates.