From 30429ab9559294190ce1cce527c2366c2cba3277 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Fri, 6 Mar 2026 19:37:58 -0500 Subject: [PATCH] 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 --- OpenNest.Core/Helper.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenNest.Core/Helper.cs b/OpenNest.Core/Helper.cs index 8a1a0b8..385379e 100644 --- a/OpenNest.Core/Helper.cs +++ b/OpenNest.Core/Helper.cs @@ -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 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;