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) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 23:17:33 -04:00
parent 4cc8b8f9b7
commit 1ffe904892

View File

@@ -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);
}
}
}