Stateless collision geometry math: Sutherland-Hodgman polygon clipping for polygon-rectangle overlap, plus shoelace area and point/intersection tests. Clipping handles both convex and concave polygons. The polygon clips against the four rectangle boundaries in turn; the area of the result decides whether the overlap meets the threshold. Default thresholds: 0.01 edge epsilon and 0.05 minimum overlap ratio, so sub-5% micro-overlaps are ignored. All clipping methods are public for unit testing.
Source: addons/grid_placement/placement/manager/components/collision_geometry_calculator.gd
Syntax
class CollisionGeometryCalculator extends RefCounted