forked from 1b-agent/opencadstudio-upstream
Add AttributeDefinition host model support
This commit is contained in:
1 parent
54322e00e3
commit
5b854bd121
5 files changed
+326
-12
No files matched your search
+4
-9
@@ -2174,21 +2174,16 @@ fn fix_viewport_status_flags(doc: &mut CadDocument) {
|
||||
}
|
||||
}
|
||||
|
||||
/// 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.
|
||||
/// The acadrust DXF reader still stores Shape rotation directly from group code
|
||||
/// 50 in degrees, while DWG and our own creation code store radians. Attribute
|
||||
/// entities and definitions are converted by the reader itself and must not be
|
||||
/// converted a second time here.
|
||||
fn fix_dxf_dimension_rotations(doc: &mut CadDocument) {
|
||||
for entity in doc.entities_mut() {
|
||||
match entity {
|
||||
// Dimension angles (rotation / text / oblique) are converted
|
||||
// degrees->radians inside the acadrust DXF reader now, so a
|
||||
// dimension arm here would double-convert.
|
||||
EntityType::AttributeDefinition(a) => {
|
||||
a.rotation = a.rotation.to_radians();
|
||||
}
|
||||
EntityType::AttributeEntity(a) => {
|
||||
a.rotation = a.rotation.to_radians();
|
||||
}
|
||||
EntityType::Shape(s) => {
|
||||
s.rotation = s.rotation.to_radians();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user