From 1ffe90489266340c76abc40d48d86eb9832db2e7 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Tue, 24 Mar 2026 23:17:33 -0400 Subject: [PATCH] fix: exclude BEND layer entities from DXF geometry import BEND layer lines were being imported as cut geometry alongside the separate Bend object detection, causing duplicate dark lines in nests. Skip BEND layer entities in DxfImporter since bend detection reads directly from the raw CadDocument. Co-Authored-By: Claude Opus 4.6 (1M context) --- OpenNest.IO/DxfImporter.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OpenNest.IO/DxfImporter.cs b/OpenNest.IO/DxfImporter.cs index 96bdb7c..8bc8741 100644 --- a/OpenNest.IO/DxfImporter.cs +++ b/OpenNest.IO/DxfImporter.cs @@ -24,6 +24,11 @@ namespace OpenNest.IO foreach (var entity in doc.Entities) { + // Skip bend line entities — they are converted to Bend objects + // separately via bend detection, not cut geometry. + if (IsBendLayer(entity.Layer?.Name)) + continue; + switch (entity) { case ACadSharp.Entities.Line line: @@ -131,5 +136,10 @@ namespace OpenNest.IO return success; } + + private static bool IsBendLayer(string layerName) + { + return string.Equals(layerName, "BEND", System.StringComparison.OrdinalIgnoreCase); + } } }