offset

photonforge.offset(operand, distance, round_joins=False)

Dilate or erode a set of polygons.

Parameters:
Returns:

Resulting polygons.

Return type:

list[Polygon]

Examples

>>> horizontal = pf.Rectangle(center=(0, 0), size=(11, 2))
>>> vertical = pf.Rectangle(center=(0, 0), size=(2, 11))
>>> outer_cross = pf.offset(
...     [horizontal, vertical], 1, round_joins=True
... )
>>> inner_cross = pf.offset([horizontal, vertical], -0.5)
>>> len(outer_cross), len(inner_cross)
(1, 1)