pyboxbuilder.box.features.polygon_grid_position

pyboxbuilder.box.features.polygon_grid_position(row: int, col: int, sides: int, apothem: float, spacing: float = 0.0, origin: tuple[float, float] = (0.0, 0.0)) → tuple[float, float][source]

Calculate the (x, y) world position for regular polygon cells in a tessellated grid (FR-102).

Parameters:
row: int

Row index in the grid (0-indexed).

col: int

Column index in the grid (0-indexed).

sides: int

Polygon sides (currently 3, 4, 6 supported).

apothem: float

Polygon apothem (half flat-to-flat distance) in mm.

spacing: float = 0.0

Gap between adjacent polygon edges in mm (0.0 = touching faces).

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

Base (x0, y0) translation offset.

Returns:

(x, y) coordinates of the bounding box origin (min_x, min_y).

Return type:

tuple[float, float]