diff --git a/src/ifcgeom/IfcGeomShapes.cpp b/src/ifcgeom/IfcGeomShapes.cpp index 23e471a36a..2d89460422 100644 --- a/src/ifcgeom/IfcGeomShapes.cpp +++ b/src/ifcgeom/IfcGeomShapes.cpp @@ -873,6 +873,12 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcRepresentation* l, IfcRepresen } bool IfcGeom::Kernel::convert(const IfcSchema::IfcGeometricSet* l, IfcRepresentationShapeItems& shapes) { + // @nb the selection is partly duplicated from convert_curves() but it's needed as a + // geometric set by it's static class definition does not inform us of the type of elements. + // @todo handle this better so that this doesn't log an error. + const bool include_curves = getValue(GV_DIMENSIONALITY) != +1; + const bool include_solids_and_surfaces = getValue(GV_DIMENSIONALITY) != -1; + IfcEntityList::ptr elements = l->Elements(); if ( !elements->size() ) return false; bool part_succes = false; @@ -885,16 +891,18 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcGeometricSet* l, IfcRepresenta if (!(convert_shapes(element, items) && flatten_shape_list(items, s, false))) { continue; } - } else if (shape_type(element) == ST_SHAPE) { + } else if (shape_type(element) == ST_SHAPE && include_solids_and_surfaces) { if (!convert_shape(element, s)) { continue; } - } else if (shape_type(element) == ST_WIRE) { + } else if (shape_type(element) == ST_WIRE && include_curves) { TopoDS_Wire w; if (!convert_wire(element, w)) { continue; } s = w; + } else { + continue; } part_succes = true;