Handle missing placement location gracefully #5528

This commit is contained in:
Thomas Krijnen
2024-10-03 10:27:45 +02:00
parent 040aec3e52
commit 3b9c1d88c8
3 changed files with 12 additions and 6 deletions
+4 -2
View File
@@ -24,10 +24,12 @@
using namespace ifcopenshell::geometry;
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcAxis2Placement2D* inst) {
Eigen::Vector3d P, axis(0, 0, 1), V(1, 0, 0);
{
Eigen::Vector3d P(0, 0, 0), axis(0, 0, 1), V(1, 0, 0);
try {
taxonomy::point3::ptr v = taxonomy::cast<taxonomy::point3>(map(inst->Location()));
P = *v->components_;
} catch (const std::runtime_error&) {
Logger::Warning("Placement with invalid Location:", inst);
}
const bool hasRef = !!inst->RefDirection();
if (hasRef) {