From cd6967cf2b4fd7ad178b5e47d65662a03e00eceb Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 31 Mar 2023 12:28:08 +0200 Subject: [PATCH] Return axis rep even when assigned to model context --- src/ifcgeom/mapping/mapping.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ifcgeom/mapping/mapping.cpp b/src/ifcgeom/mapping/mapping.cpp index 1be778309a..5b8ed835a5 100644 --- a/src/ifcgeom/mapping/mapping.cpp +++ b/src/ifcgeom/mapping/mapping.cpp @@ -1078,6 +1078,14 @@ IfcUtil::IfcBaseEntity* mapping::representation_of(const IfcUtil::IfcBaseEntity* } } + if (intersection->size() == 0 && settings_.context_ids().empty() && settings_.get(IfcGeom::IteratorSettings::INCLUDE_CURVES) && settings_.get(IfcGeom::IteratorSettings::EXCLUDE_SOLIDS_AND_SURFACES)) { + for (auto& r : *of_product) { + if (r->RepresentationIdentifier() && *r->RepresentationIdentifier() == "Axis") { + intersection->push(r); + } + } + } + if (intersection->size() == 0) { return nullptr; } else { @@ -1087,8 +1095,8 @@ IfcUtil::IfcBaseEntity* mapping::representation_of(const IfcUtil::IfcBaseEntity* } intersection_no_box->push(r); } - if (intersection->size() > 1) { - Logger::Warning("Multiple applicable representations found for opening, selecting arbitrary"); + if (intersection_no_box->size() > 1) { + Logger::Warning("Multiple applicable representations found for element, selecting arbitrary"); } if (intersection_no_box->size()) { return (*intersection_no_box->begin())->as();