mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-02 13:04:49 +00:00
Fix #4307
This commit is contained in:
@@ -28,7 +28,23 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcDerivedProfileDef* inst) {
|
|||||||
}
|
}
|
||||||
// @todo we mutate it so we need to clone otherwise we alter the cached item.
|
// @todo we mutate it so we need to clone otherwise we alter the cached item.
|
||||||
it = taxonomy::item::ptr(it->clone_());
|
it = taxonomy::item::ptr(it->clone_());
|
||||||
taxonomy::matrix4::ptr m = taxonomy::cast<taxonomy::matrix4>(map(inst->Operator()));
|
|
||||||
|
taxonomy::matrix4::ptr m;
|
||||||
|
bool is_mirror = false;
|
||||||
|
#ifdef SCHEMA_HAS_IfcMirroredProfileDef
|
||||||
|
if (inst->as<IfcSchema::IfcMirroredProfileDef>()) {
|
||||||
|
m = taxonomy::make<taxonomy::matrix4>();
|
||||||
|
// @todo test
|
||||||
|
m->components().col(0) *= -1.;
|
||||||
|
is_mirror = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (!is_mirror) {
|
||||||
|
m = taxonomy::cast<taxonomy::matrix4>(map(inst->Operator()));
|
||||||
|
if (!m) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!taxonomy::cast<taxonomy::geom_item>(it)->matrix) {
|
if (!taxonomy::cast<taxonomy::geom_item>(it)->matrix) {
|
||||||
// @todo should this not be initialized by default? matrix4 already has a 'lazy identity' mechanism.
|
// @todo should this not be initialized by default? matrix4 already has a 'lazy identity' mechanism.
|
||||||
taxonomy::cast<taxonomy::geom_item>(it)->matrix = taxonomy::make<taxonomy::matrix4>();
|
taxonomy::cast<taxonomy::geom_item>(it)->matrix = taxonomy::make<taxonomy::matrix4>();
|
||||||
|
|||||||
Reference in New Issue
Block a user