boolean

photonforge.boolean(operand1, operand2, operation)

Compute the boolean operation between 2 sets of polygons.

Parameters:
Returns:

Resulting polygons.

Return type:

list[Polygon]

Examples

>>> horizontal = Rectangle(center=(0, 0), size=(11, 2))
>>> vertical = Rectangle(center=(0, 0), size=(2, 11))
>>> donut = Circle(5, inner_radius=3)
>>> union = boolean(donut, [horizontal, vertical], "+")
>>> len(union)
1
>>> difference = boolean(donut, [horizontal, vertical], "-")
>>> len(difference)
4