mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-05 16:01:37 -05:00
Customers and design tools hand over SVGs, and getting them in meant a trip through another CAD tool. CadImporter now reads them like any other drawing, and plates, programs and converter entities can be written out. An SVG's numbers are not drawing units, so import converts to the nest's units and never guesses: only an absolute width or height counts as a stated size, since px means 1/96 in to browsers but 1/72 in to Illustrator. Without one the desktop asks, showing the size each choice gives, and headless callers must pass the scale or the import fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58 lines
2.0 KiB
C#
58 lines
2.0 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>
|
|
/// 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>();
|
|
|
|
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>();
|
|
}
|
|
}
|