feat(ui): render DXF text annotations in CAD converter preview
Extract MText and TextEntity from the CadDocument during DXF import and render them in the EntityView. Handles text alignment (left/center/ right via InsertPoint vs AlignmentPoint) and replaces AutoCAD control codes (%%p → ±, %%d → °, %%c → ⌀). MText formatting codes are stripped before display. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using ACadSharp;
|
||||
using OpenNest.Bending;
|
||||
using OpenNest.Geometry;
|
||||
|
||||
@@ -38,5 +39,11 @@ namespace OpenNest.IO
|
||||
/// 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; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace OpenNest.IO
|
||||
Bounds = dxf.Entities.GetBoundingBox(),
|
||||
SourcePath = path,
|
||||
Name = options.Name ?? Path.GetFileNameWithoutExtension(path),
|
||||
Document = dxf.Document,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user