From b6abb24858e9e6d2306b75dc31332829f4c30f27 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 23 Sep 2025 11:08:42 +0200 Subject: [PATCH] Support single circ/elip compcurves #7149 --- src/ifcgeom/mapping/IfcCompositeCurve.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ifcgeom/mapping/IfcCompositeCurve.cpp b/src/ifcgeom/mapping/IfcCompositeCurve.cpp index 16f7f4f14e..0bc5294aff 100644 --- a/src/ifcgeom/mapping/IfcCompositeCurve.cpp +++ b/src/ifcgeom/mapping/IfcCompositeCurve.cpp @@ -58,11 +58,20 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcCompositeCurve* inst) { if (crv->kind() == taxonomy::EDGE) { auto ecrv = taxonomy::cast(crv); loop->children.push_back(ecrv); - } - else if (crv->kind() == taxonomy::LOOP) { + } else if (crv->kind() == taxonomy::LOOP) { for (auto& s : taxonomy::cast(crv)->children) { loop->children.push_back(s); } + } else if ((crv->kind() == taxonomy::CIRCLE || crv->kind() == taxonomy::ELLIPSE) && segments->size() == 1) { + // A circle or ellipse segment is a full circle/ellipse, only possible when it is the only segment + std::shared_ptr e = std::make_shared(); + e->basis = crv; + e->start = 0.0; + e->end = 2.0 * boost::math::constants::pi(); + loop->children.push_back(e); + } else { + Logger::Warning("Unexpected segment type", segment); + return nullptr; } } }