fix: use offset geometry for moving part in FillLinear spacing

Offset the moving shape's geometry by PartSpacing instead of adding
spacing linearly to the copy distance. This guarantees minimum clearance
in all directions for curved/complex shapes, not just along the slide axis.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 14:10:48 -05:00
parent 54cdf21264
commit bc411949b8

View File

@@ -61,7 +61,7 @@ namespace OpenNest
if (slideDistance >= double.MaxValue || slideDistance < 0)
return bboxDim + PartSpacing;
return bboxDim - slideDistance + PartSpacing;
return bboxDim - slideDistance;
}
/// <summary>
@@ -76,7 +76,7 @@ namespace OpenNest
partB.Offset(MakeOffset(direction, bboxDim));
var opposite = Helper.OppositeDirection(pushDir);
var movingLines = Helper.GetPartLines(partB, pushDir);
var movingLines = Helper.GetOffsetPartLines(partB, PartSpacing, pushDir);
var stationaryLines = Helper.GetPartLines(partA, opposite);
var slideDistance = Helper.DirectionalDistance(movingLines, stationaryLines, pushDir);
@@ -94,7 +94,7 @@ namespace OpenNest
var patternB = patternA.Clone(MakeOffset(direction, bboxDim));
var opposite = Helper.OppositeDirection(pushDir);
var movingLines = patternB.GetLines(pushDir);
var movingLines = patternB.GetOffsetLines(PartSpacing, pushDir);
var stationaryLines = patternA.GetLines(opposite);
var slideDistance = Helper.DirectionalDistance(movingLines, stationaryLines, pushDir);