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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user