refactor: merge DxfImporter and DxfExporter into single static Dxf class

Consolidated two stateless classes into one unified API: Dxf.Import(),
Dxf.GetGeometry(), Dxf.ExportPlate(), Dxf.ExportProgram(). Export
state moved into a private ExportContext. Removed bool+out pattern
from GetGeometry in favor of returning empty list on failure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 08:17:49 -04:00
parent e92208b8c0
commit 250fdefaea
20 changed files with 405 additions and 505 deletions

View File

@@ -104,7 +104,6 @@ int RunDataCollection(string dir, string dbPath, string saveDir, double s, strin
if (backfilled > 0)
Console.WriteLine($"Backfilled PerimeterToAreaRatio for {backfilled} existing parts");
var importer = new DxfImporter();
var colorIndex = 0;
var processed = 0;
var skippedGeometry = 0;
@@ -129,7 +128,8 @@ int RunDataCollection(string dir, string dbPath, string saveDir, double s, strin
continue;
}
if (!importer.GetGeometry(file, out var entities))
var entities = Dxf.GetGeometry(file);
if (entities.Count == 0)
{
Console.WriteLine(" - SKIP (no geometry)");
skippedGeometry++;