mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-21 15:47:40 -05:00
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:
1 parent
30429ab955
commit
af00fa36eb
1 file changed
+3
-1
@@ -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