forked from 1b-agent/opencadstudio-upstream
fix: Polyline3D spline vertex flags and AttributeEntity/Definition DXF rotation
Polyline3D tessellation now separates spline-fit curve vertices (flag 8) from frame control points (flag 16): the curve vertices form the rendered wire while control points are exposed as key_vertices for snap. Polylines without spline flags are unchanged. DXF post-load fixup now also converts AttributeEntity and AttributeDefinition rotation from degrees to radians (group code 50 bug), matching the existing LinearDimension fix. Attribute text rendered from DXF files now has correct orientation. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
5216c247c2
commit
c7a7022293
2 files changed
+35
-14
No files matched your search
+14
-5
@@ -170,13 +170,22 @@ pub fn save_dxf(doc: &CadDocument, path: &Path) -> Result<(), String> {
|
||||
|
||||
// ── DXF post-load fixups ──────────────────────────────────────────────────
|
||||
|
||||
/// The acadrust DXF reader stores LinearDimension.rotation directly from DXF
|
||||
/// group code 50, which is in degrees. DWG and our own dimension-creation code
|
||||
/// store it in radians. Convert so tessellation can call cos/sin uniformly.
|
||||
/// The acadrust DXF reader stores several rotation fields directly from DXF
|
||||
/// group code 50 in degrees, while DWG and our own creation code store radians.
|
||||
/// Apply to_radians() on load so tessellation can call cos/sin uniformly.
|
||||
fn fix_dxf_dimension_rotations(doc: &mut CadDocument) {
|
||||
for entity in doc.entities_mut() {
|
||||
if let EntityType::Dimension(Dimension::Linear(d)) = entity {
|
||||
d.rotation = d.rotation.to_radians();
|
||||
match entity {
|
||||
EntityType::Dimension(Dimension::Linear(d)) => {
|
||||
d.rotation = d.rotation.to_radians();
|
||||
}
|
||||
EntityType::AttributeDefinition(a) => {
|
||||
a.rotation = a.rotation.to_radians();
|
||||
}
|
||||
EntityType::AttributeEntity(a) => {
|
||||
a.rotation = a.rotation.to_radians();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user