mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 19:07:57 +00:00
Reintroduce --model-offset/-rotation MODEL_OFFSET/_ROTATION setting #5231
This commit is contained in:
@@ -65,16 +65,21 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcObjectPlacement* inst) {
|
||||
}
|
||||
}
|
||||
|
||||
taxonomy::ptr result;
|
||||
taxonomy::matrix4::ptr result;
|
||||
if (!parent_placement_ignored && relative_to) {
|
||||
result = taxonomy::make<taxonomy::matrix4>(
|
||||
// @nb this is a bit silly, in 0.7 we didn't have a recursive function
|
||||
// but a while loop to apply the hierarchical placements, so after the
|
||||
// loop we could apply the global offset. Since we have a recursive
|
||||
// function now we need to undo the global offset when recursing.
|
||||
offset_and_rotation_.inverse() *
|
||||
taxonomy::cast<taxonomy::matrix4>(map(relative_to))->ccomponents() *
|
||||
taxonomy::cast<taxonomy::matrix4>(map(transform))->ccomponents()
|
||||
);
|
||||
} else {
|
||||
// The parent placement of the current is a placement for a type that is
|
||||
// being ignored (Site or Building) or it is the host element of an opening.
|
||||
result = map(transform);
|
||||
result = taxonomy::cast<taxonomy::matrix4>(map(transform));
|
||||
}
|
||||
|
||||
if (fallback) {
|
||||
@@ -84,10 +89,9 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcObjectPlacement* inst) {
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
result->components() = offset_and_rotation_ * result->ccomponents();
|
||||
|
||||
// @todo
|
||||
// m4->components() = offset_and_rotation_ * m4->components();
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user