diff --git a/src/ifcgeom/mapping/IfcRepresentation.cpp b/src/ifcgeom/mapping/IfcRepresentation.cpp index 0d87f13e64..733b3d71a8 100644 --- a/src/ifcgeom/mapping/IfcRepresentation.cpp +++ b/src/ifcgeom/mapping/IfcRepresentation.cpp @@ -42,10 +42,16 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcRepresentation* inst) { // @todo // if (s.ShapeType() == TopAbs_COMPOUND && TopoDS_Iterator(s).More() && TopoDS_Iterator(s).Value().ShapeType() == TopAbs_SOLID) { - return filter_in_place(items, [&use_body](taxonomy::ptr i) { + auto filtered = filter_in_place(items, [&use_body](taxonomy::ptr i) { // @todo just filter loops for now. - return (i->kind() != taxonomy::LOOP) == use_body; + return (i->kind() != taxonomy::LOOP && i->kind() != taxonomy::PIECEWISE_FUNCTION) == use_body; }); + + if (filtered->children.empty()) { + return nullptr; + } + + return filtered; } /* diff --git a/src/ifcgeom/mapping/mapping.cpp b/src/ifcgeom/mapping/mapping.cpp index d33ac0c0db..1f05206e45 100644 --- a/src/ifcgeom/mapping/mapping.cpp +++ b/src/ifcgeom/mapping/mapping.cpp @@ -236,14 +236,12 @@ void mapping::get_representations(std::vector& tasks, } // @todo, fix this properly by considering the mapped geometry types in the representation. - if (representation->RepresentationIdentifier() && *representation->RepresentationIdentifier() == "Body") { - geometry_conversion_task task; - task.index = task_index++; - task.representation = representation; - task.products = ifcproducts->generalize(); + geometry_conversion_task task; + task.index = task_index++; + task.representation = representation; + task.products = ifcproducts->generalize(); - tasks.emplace_back(task); - } + tasks.emplace_back(task); } }