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 IReadOnlyList OverlapRegions { get; } public IReadOnlyList IntersectionPoints { get; } public double OverlapArea { get; } } }