fix: invert offset side for cutouts in Shape.OffsetEntity

Cutouts wind opposite to the perimeter, so using the same OffsetSide
expands holes instead of shrinking them. Invert the side for cutouts
so the offset buffer correctly contracts holes inward.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 19:40:08 -05:00
parent 30429ab955
commit af00fa36eb

View File

@@ -459,8 +459,10 @@ namespace OpenNest.Geometry
lastEntity = entity;
}
var cutoutSide = side == OffsetSide.Left ? OffsetSide.Right : OffsetSide.Left;
foreach (var cutout in definedShape.Cutouts)
offsetShape.Entities.AddRange(((Shape)cutout.OffsetEntity(distance, side)).Entities);
offsetShape.Entities.AddRange(((Shape)cutout.OffsetEntity(distance, cutoutSide)).Entities);
return offsetShape;
}