mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-21 12:17:42 -05:00
The witness-probe overlap test missed small corner intersections: its candidate points (crossing-edge midpoints and vertex-centroid midpoints) can all land on a part boundary or outside the intersection, so two 10x10 parts at (0,0) and (9,9) with zero spacing were accepted despite sharing a 1x1 unit of material. Route the overlap decision through Collision, which clips triangulated polygons and keeps only positive-area regions, catching corner overlaps, containment, and coincident poses while legal edge/corner contact stays legal. Collision's hole subtraction was conservative (partially-clipped triangles were kept whole), so a part inside another part's cutout could false-positive depending on triangulation alignment; subtract holes exactly instead: a piece outside a convex hole triangle is the union of its clips against each edge's outside half-space.