Files
OpenNest/OpenNest.IO/CadImportResult.cs
T
ajandClaude Opus 5.5 c8ba250adc feat(cad-converter): separate a file that draws several parts
A file such as a sheet of ornaments imported as one drawing, with every
part but the largest treated as a cutout. PartBodies (Core) now finds the
separate parts by contour nesting, and the CAD Converter offers a
Separate (N) button plus Separate This Part / Separate All Parts in the
entity menu. Each part keeps its entity IDs, so roles, exclusions,
breakoffs, tabbed cutouts and dimensions follow it; separation is refused
when a breakoff or tabbed cutout spans parts.

SVG import keeps element titles as labeled regions, which name the
separated parts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:53:08 -05:00

71 lines
2.7 KiB
C#

using System.Collections.Generic;
using ACadSharp;
using OpenNest.Bending;
using OpenNest.Geometry;
namespace OpenNest.IO
{
/// <summary>
/// Intermediate result of <see cref="CadImporter.Import"/>. Holds raw loaded
/// geometry and detected bends. Callers may mutate <see cref="Entities"/> and
/// <see cref="Bends"/> before passing to <see cref="CadImporter.BuildDrawing"/>.
/// </summary>
public class CadImportResult
{
/// <summary>
/// All entities loaded from the source file, including promoted bend
/// source entities. Mutable.
/// </summary>
public List<Entity> Entities { get; set; } = new List<Entity>();
/// <summary>
/// The source file's geometry on every layer, before any import cleanup, for
/// comparing against <see cref="Entities"/>. Display only: these share no instances
/// with <see cref="Entities"/> and their IDs key nothing.
/// </summary>
public List<Entity> RawEntities { get; set; } = new List<Entity>();
/// <summary>
/// Bends detected during import. Mutable — callers may add, remove,
/// or replace entries before building the drawing.
/// </summary>
public List<Bend> Bends { get; set; } = new List<Bend>();
/// <summary>
/// Names the file gives to regions of its geometry, such as SVG element titles; used to
/// name the parts when a file holding several is separated. Empty when the file has none.
/// </summary>
public List<LabeledRegion> Labels { get; set; } = new List<LabeledRegion>();
public List<Bending.BendRepairReport> BendRepairReports { get; set; } =
new List<Bending.BendRepairReport>();
/// <summary>
/// Bounding box of <see cref="Entities"/> at import time. May be stale
/// if callers mutate <see cref="Entities"/>; recompute if needed.
/// </summary>
public Box Bounds { get; set; }
/// <summary>
/// Absolute path to the source file.
/// </summary>
public string SourcePath { get; set; }
/// <summary>
/// Default drawing name (filename without extension, unless overridden).
/// </summary>
public string Name { get; set; }
/// <summary>
/// The raw CAD document from the source file. Available for callers
/// that need access to non-geometry entities (e.g., text annotations).
/// </summary>
public CadDocument Document { get; set; }
/// <summary>
/// Source content the import left out, worded for the user.
/// </summary>
public List<string> Warnings { get; set; } = new List<string>();
}
}