fix: prevent etch line layers from defaulting to layer 0 after split

DxfImporter now filters ETCH entities (like BEND) since etch marks are
generated from bends during export, not cut geometry. GeometryOptimizer
no longer merges lines/arcs across different layers and preserves layer
and color on merged entities. EntityView draws etch marks directly from
the Bends list so they remain visible without relying on imported ETCH
entities.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 22:31:28 -04:00
parent cbabf5e9d1
commit 12173204d1
4 changed files with 277 additions and 8 deletions
+7 -5
View File
@@ -24,9 +24,10 @@ 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))
// Skip bend/etch entities — bends are converted to Bend objects
// separately via bend detection, and etch marks are generated from
// bends during DXF export. Neither should be treated as cut geometry.
if (IsNonCutLayer(entity.Layer?.Name))
continue;
switch (entity)
@@ -137,9 +138,10 @@ namespace OpenNest.IO
return success;
}
private static bool IsBendLayer(string layerName)
private static bool IsNonCutLayer(string layerName)
{
return string.Equals(layerName, "BEND", System.StringComparison.OrdinalIgnoreCase);
return string.Equals(layerName, "BEND", System.StringComparison.OrdinalIgnoreCase)
|| string.Equals(layerName, "ETCH", System.StringComparison.OrdinalIgnoreCase);
}
}
}