offset¶
- photonforge.offset(operand, distance, round_joins=False)¶
Dilate or erode a set of polygons.
- Parameters:
operand – Polygon, Path, Reference, Component or sequence of those. All polygons are joined before the operation.
distance – Amount to dilate (positive) or erode (negative).
round_joins – If set, substitute convex angles with round joins.
- Returns:
List of resulting polygons.
Examples
>>> horizontal = Rectangle(center=(0, 0), size=(11, 2)) >>> vertical = Rectangle(center=(0, 0), size=(2, 11)) >>> outer_cross = offset([horizontal, vertical], 1, round_joins=True) >>> inner_cross = offset([horizontal, vertical], -0.5) >>> len(outer_cross), len(inner_cross) (1, 1)