fix: compensate for inscribed polygon in offset distance
Polygon chords are always inside the actual arc, making the offset boundary smaller than intended. Add PushChordTolerance to the offset distance so the polygon conservatively overestimates, ensuring the real offset geometry never overlaps stationary parts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -739,7 +739,7 @@ namespace OpenNest
|
||||
return pts.Count > 0;
|
||||
}
|
||||
|
||||
private const double PushChordTolerance = 0.08;
|
||||
private const double PushChordTolerance = 0.03;
|
||||
|
||||
public static List<Line> GetPartLines(Part part)
|
||||
{
|
||||
@@ -765,7 +765,9 @@ namespace OpenNest
|
||||
|
||||
foreach (var shape in shapes)
|
||||
{
|
||||
var offsetEntity = shape.OffsetEntity(spacing, OffsetSide.Left) as Shape;
|
||||
// Add chord tolerance to compensate for inscribed polygon chords
|
||||
// being inside the actual offset arcs.
|
||||
var offsetEntity = shape.OffsetEntity(spacing + PushChordTolerance, OffsetSide.Left) as Shape;
|
||||
|
||||
if (offsetEntity == null)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user