mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-18 18:37:42 -05:00
The CAD Converter's Export button only wrote DXF (or SVG) with every entity on layer 0 and no bends, so a re-imported export lost its bends and turned the bend etch marks into cut geometry. Exporting now goes through a new OpenNest.IO CadExporter: - DXF R14-2018, DWG 2004-2018 or SVG. ACadSharp cannot write DWG 2007, and its DWG 2000/R14 output loses entities and layers, so those are not offered. - Entities keep their layers; etch marks land on ETCH, which import drops and regenerates from the bends. A line picked as a bend is written only as it. - DXF/DWG bends are BEND-layer CENTER lines with an "UP 90° R 0.06" MText note, the form SolidWorksBendDetector reads. Pre-2007 files escape non-ASCII note text as \U+XXXX, since ACadSharp reads raw non-ASCII back mangled. - SVG bends are lines in a BEND group with data-bend-* attributes; the SVG reader now returns them as bends (scaled with the drawing units) instead of dropping the layer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
832 B
C#
27 lines
832 B
C#
using System.Collections.Generic;
|
|
using ACadSharp;
|
|
using OpenNest.Bending;
|
|
using OpenNest.Geometry;
|
|
|
|
namespace OpenNest.IO
|
|
{
|
|
public class DxfImportResult
|
|
{
|
|
public List<Entity> Entities { get; set; } = new();
|
|
|
|
/// <summary>
|
|
/// The file's geometry on every layer, before any cleanup. These are separate
|
|
/// instances from <see cref="Entities"/>.
|
|
/// </summary>
|
|
public List<Entity> RawEntities { get; set; } = new();
|
|
public CadDocument Document { get; set; }
|
|
|
|
/// <summary>
|
|
/// Bends the file states outright, as an SVG's BEND layer does; null when bends are
|
|
/// detected from <see cref="Document"/> instead.
|
|
/// </summary>
|
|
public List<Bend> Bends { get; set; }
|
|
public List<string> Warnings { get; set; } = new();
|
|
}
|
|
}
|