fix: allow line-on-line contact and remove extra spacing gap

- Part.Intersects: filter intersection points at a vertex of either
  shape (was both), so edge-touching parts are not flagged as overlapping
- NestEngineBase.HasOverlaps: use epsilon-based bounding box pre-filter
  consistent with FillExtents and Plate.HasOverlappingParts
- PartGeometry.GetOffsetPartLines: remove extra chordTolerance added to
  spacing offset — was causing 0.002" gap beyond the intended part spacing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-28 15:36:35 -04:00
parent 61b917c398
commit abc707f1d9
3 changed files with 14 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ using OpenNest.Engine;
using OpenNest.Engine.Fill;
using OpenNest.Engine.Strategies;
using OpenNest.Geometry;
using OpenNest.Math;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -275,8 +276,12 @@ namespace OpenNest
{
var box2 = parts[j].BoundingBox;
if (box1.Right < box2.Left || box2.Right < box1.Left ||
box1.Top < box2.Bottom || box2.Top < box1.Bottom)
var overlapX = System.Math.Min(box1.Right, box2.Right)
- System.Math.Max(box1.Left, box2.Left);
var overlapY = System.Math.Min(box1.Top, box2.Top)
- System.Math.Max(box1.Bottom, box2.Bottom);
if (overlapX <= Tolerance.Epsilon || overlapY <= Tolerance.Epsilon)
continue;
List<Vector> pts;