diff --git a/src/ifcgeom/mapping/IfcDerivedProfileDef.cpp b/src/ifcgeom/mapping/IfcDerivedProfileDef.cpp
index 18091d3d2c..663680e29d 100644
--- a/src/ifcgeom/mapping/IfcDerivedProfileDef.cpp
+++ b/src/ifcgeom/mapping/IfcDerivedProfileDef.cpp
@@ -1,20 +1,20 @@
/********************************************************************************
- * *
- * This file is part of IfcOpenShell. *
- * *
- * IfcOpenShell is free software: you can redistribute it and/or modify *
+ * *
+ * This file is part of IfcOpenShell. *
+ * *
+ * IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
- * the Free Software Foundation, either version 3.0 of the License, or *
- * (at your option) any later version. *
- * *
- * IfcOpenShell is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * Lesser GNU General Public License for more details. *
- * *
- * You should have received a copy of the Lesser GNU General Public License *
- * along with this program. If not, see . *
- * *
+ * the Free Software Foundation, either version 3.0 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * IfcOpenShell is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * Lesser GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the Lesser GNU General Public License *
+ * along with this program. If not, see . *
+ * *
********************************************************************************/
#include "mapping.h"
@@ -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.
it = taxonomy::item::ptr(it->clone_());
- taxonomy::matrix4::ptr m = taxonomy::cast(map(inst->Operator()));
+
+ taxonomy::matrix4::ptr m;
+ bool is_mirror = false;
+#ifdef SCHEMA_HAS_IfcMirroredProfileDef
+ if (inst->as()) {
+ m = taxonomy::make();
+ // @todo test
+ m->components().col(0) *= -1.;
+ is_mirror = true;
+ }
+#endif
+ if (!is_mirror) {
+ m = taxonomy::cast(map(inst->Operator()));
+ if (!m) {
+ return nullptr;
+ }
+ }
if (!taxonomy::cast(it)->matrix) {
// @todo should this not be initialized by default? matrix4 already has a 'lazy identity' mechanism.
taxonomy::cast(it)->matrix = taxonomy::make();