fix: prevent PushBoundingBox from making obstacles invisible to geometry push
PushBoundingBox left exactly partSpacing between bounding boxes, but the geometry push inflates offset lines by halfSpacing + chordTolerance per side (totaling partSpacing + 2*chordTolerance). The 0.002 overlap caused RayEdgeDistance to return MaxValue for negative t, making the nearest obstacle invisible and allowing the part to push through it. Subtract 2*ChordTolerance from the BB push distance so the gap is wide enough for the offset geometry lines to remain non-overlapping. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -157,7 +157,7 @@ namespace OpenNest.Engine.Fill
|
||||
continue;
|
||||
|
||||
var gap = SpatialQuery.DirectionalGap(movingBox, obstacleBoxes[i], direction);
|
||||
var d = gap - partSpacing;
|
||||
var d = gap - partSpacing - 2 * ChordTolerance;
|
||||
if (d < 0) d = 0;
|
||||
if (d < distance)
|
||||
distance = d;
|
||||
|
||||
Reference in New Issue
Block a user