intersects

photonforge.intersects(operand1, operand2)

Check whether 2 sets of polygons share any point.

Overlapping area, a shared stretch of edge, and a single shared vertex all count. A hole is a void, so a polygon nested in a hole of the other does not intersect it. The test runs on the integer database grid, without floating-point conversions.

Parameters:
Returns:

Whether any polygon in operand1 intersects any polygon in operand2.

Return type:

bool

Examples

>>> square = pf.Rectangle(center=(0, 0), size=(2, 2))
>>> pf.intersects(square, pf.Rectangle(center=(2, 0), size=(2, 2)))
True
>>> pf.intersects(square, pf.Rectangle(center=(3, 0), size=(2, 2)))
False