feat: add Collision static class with Sutherland-Hodgman clipping and tests

Polygon-polygon collision detection using convex decomposition (ear-clipping
triangulation) followed by Sutherland-Hodgman clipping on each triangle pair.
Handles overlapping, non-overlapping, edge-touching, containment, and concave
polygons. Includes hole subtraction support for future use.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 09:32:56 -04:00
parent 230a11d32e
commit 8f2fbee02c
3 changed files with 431 additions and 2 deletions

View File

@@ -16,8 +16,8 @@ namespace OpenNest.Geometry
}
public bool Overlaps { get; }
public List<Polygon> OverlapRegions { get; }
public List<Vector> IntersectionPoints { get; }
public IReadOnlyList<Polygon> OverlapRegions { get; }
public IReadOnlyList<Vector> IntersectionPoints { get; }
public double OverlapArea { get; }
}
}