From c16cfc8afdd3720af3d60b3fb18d45e31ef1cdb3 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sun, 21 Jul 2024 11:52:48 +0200 Subject: [PATCH] Support extrusion over composite profile --- src/ifcgeom/mapping/IfcExtrudedAreaSolid.cpp | 30 ++++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/ifcgeom/mapping/IfcExtrudedAreaSolid.cpp b/src/ifcgeom/mapping/IfcExtrudedAreaSolid.cpp index fcdff6952f..77fbe846d4 100644 --- a/src/ifcgeom/mapping/IfcExtrudedAreaSolid.cpp +++ b/src/ifcgeom/mapping/IfcExtrudedAreaSolid.cpp @@ -49,10 +49,28 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcExtrudedAreaSolid* inst) { } #endif - return taxonomy::make( - matrix, - taxonomy::cast(map(inst->SweptArea())), - taxonomy::cast(map(inst->ExtrudedDirection())), - height - ); + auto basis = map(inst->SweptArea()); + if (auto bases = taxonomy::dcast(basis)) { + // @todo this requires a unified approach for all sweeps + auto c = taxonomy::make(); + for (auto& f : bases->children) { + c->children.push_back( + taxonomy::make( + matrix, + taxonomy::cast(f), + taxonomy::cast(map(inst->ExtrudedDirection())), + height + ) + ); + c->children.back()->instance = inst; + } + return c; + } else { + return taxonomy::make( + matrix, + taxonomy::cast(basis), + taxonomy::cast(map(inst->ExtrudedDirection())), + height + ); + } }