Repo-wide sweep with the pinned CSharpier 1.3.0 tool. Whitespace and line-wrapping only; OpenNest.Engine.Tests (109) and OpenNest.IO.Tests pass after reformat, full solution builds 0 errors. Added .csharpierignore so csproj/config XML keeps its existing layout (CSharpier's XML wrapping churns attributes with zero benefit). Formatting is now enforceable: dotnet csharpier check . passes.
32 lines
861 B
C#
32 lines
861 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace OpenNest.Geometry
|
|
{
|
|
public class CollisionResult
|
|
{
|
|
public static readonly CollisionResult None = new(
|
|
false,
|
|
new List<Polygon>(),
|
|
new List<Vector>()
|
|
);
|
|
|
|
public CollisionResult(
|
|
bool overlaps,
|
|
List<Polygon> overlapRegions,
|
|
List<Vector> intersectionPoints
|
|
)
|
|
{
|
|
Overlaps = overlaps;
|
|
OverlapRegions = overlapRegions;
|
|
IntersectionPoints = intersectionPoints;
|
|
OverlapArea = overlapRegions.Sum(r => r.Area());
|
|
}
|
|
|
|
public bool Overlaps { get; }
|
|
public IReadOnlyList<Polygon> OverlapRegions { get; }
|
|
public IReadOnlyList<Vector> IntersectionPoints { get; }
|
|
public double OverlapArea { get; }
|
|
}
|
|
}
|