fix: ShapeProfile selects perimeter by largest bounding box area

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-22 22:29:00 -04:00
parent f79df4d426
commit 48b4849a88
2 changed files with 360 additions and 2 deletions

View File

@@ -21,9 +21,12 @@ namespace OpenNest.Geometry
Perimeter = shapes[0];
Cutouts = new List<Shape>();
for (int i = 1; i < shapes.Count; i++)
for (var i = 1; i < shapes.Count; i++)
{
if (shapes[i].Left < Perimeter.Left)
var bb = shapes[i].BoundingBox;
var perimBB = Perimeter.BoundingBox;
if (bb.Width * bb.Length > perimBB.Width * perimBB.Length)
{
Cutouts.Add(Perimeter);
Perimeter = shapes[i];