diff --git a/OpenNest.Core/Geometry/CollisionResult.cs b/OpenNest.Core/Geometry/CollisionResult.cs new file mode 100644 index 0000000..095613f --- /dev/null +++ b/OpenNest.Core/Geometry/CollisionResult.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using System.Linq; + +namespace OpenNest.Geometry +{ + public class CollisionResult + { + public static readonly CollisionResult None = new(false, new List(), new List()); + + public CollisionResult(bool overlaps, List overlapRegions, List intersectionPoints) + { + Overlaps = overlaps; + OverlapRegions = overlapRegions; + IntersectionPoints = intersectionPoints; + OverlapArea = overlapRegions.Sum(r => r.Area()); + } + + public bool Overlaps { get; } + public List OverlapRegions { get; } + public List IntersectionPoints { get; } + public double OverlapArea { get; } + } +}