feat: add SplitDxfWriter for split DXF output with bend data

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-24 20:43:40 -04:00
parent a7f8972722
commit e1bcb7498f
2 changed files with 185 additions and 6 deletions
+8 -6
View File
@@ -249,17 +249,19 @@ namespace OpenNest.Forms
var index = fileList.SelectedIndex;
var newItems = new List<string>();
var splitWriter = new SplitDxfWriter();
for (var i = 0; i < form.ResultDrawings.Count; i++)
{
var splitDrawing = form.ResultDrawings[i];
// Assign bends from the source item — spatial filtering is a future enhancement
splitDrawing.Bends.AddRange(item.Bends);
var splitName = $"{baseName}_split{i + 1}.dxf";
var splitPath = GetUniquePath(Path.Combine(writableDir, splitName));
// TODO: Use SplitDxfWriter when implemented
// For now, export via DxfExporter
var exporter = new DxfExporter();
using var stream = new FileStream(splitPath, FileMode.Create);
exporter.ExportProgram(form.ResultDrawings[i].Program, stream);
splitWriter.Write(splitPath, splitDrawing);
newItems.Add(splitPath);
}