From e120ece0146b41d850a6613a9439f9c374a1bbb3 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Fri, 10 Apr 2026 12:28:17 -0400 Subject: [PATCH] feat: add CadImportResult data object for CadImporter --- OpenNest.IO/CadImportResult.cs | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 OpenNest.IO/CadImportResult.cs diff --git a/OpenNest.IO/CadImportResult.cs b/OpenNest.IO/CadImportResult.cs new file mode 100644 index 0000000..d040ecd --- /dev/null +++ b/OpenNest.IO/CadImportResult.cs @@ -0,0 +1,49 @@ +using System.Collections.Generic; +using ACadSharp; +using OpenNest.Bending; +using OpenNest.Geometry; + +namespace OpenNest.IO +{ + /// + /// Intermediate result of . Holds raw loaded + /// geometry and detected bends. Callers may mutate and + /// before passing to . + /// + public class CadImportResult + { + /// + /// All entities loaded from the source file, including promoted bend + /// source entities. Mutable. + /// + public List Entities { get; set; } = new List(); + + /// + /// Bends detected during import. Mutable — callers may add, remove, + /// or replace entries before building the drawing. + /// + public List Bends { get; set; } = new List(); + + /// + /// Bounding box of at import time. May be stale + /// if callers mutate ; recompute if needed. + /// + public Box Bounds { get; set; } + + /// + /// Underlying CAD document for callers that need to run additional + /// analysis (e.g., MText extraction). May be null for stream imports. + /// + public CadDocument Document { get; set; } + + /// + /// Absolute path to the source file. + /// + public string SourcePath { get; set; } + + /// + /// Default drawing name (filename without extension, unless overridden). + /// + public string Name { get; set; } + } +}