mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 16:29:57 +00:00
#1290 Consider dimensionality in geometricset processing
This commit is contained in:
@@ -873,6 +873,12 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcRepresentation* l, IfcRepresen
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IfcGeom::Kernel::convert(const IfcSchema::IfcGeometricSet* l, IfcRepresentationShapeItems& shapes) {
|
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();
|
IfcEntityList::ptr elements = l->Elements();
|
||||||
if ( !elements->size() ) return false;
|
if ( !elements->size() ) return false;
|
||||||
bool part_succes = 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))) {
|
if (!(convert_shapes(element, items) && flatten_shape_list(items, s, false))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if (shape_type(element) == ST_SHAPE) {
|
} else if (shape_type(element) == ST_SHAPE && include_solids_and_surfaces) {
|
||||||
if (!convert_shape(element, s)) {
|
if (!convert_shape(element, s)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if (shape_type(element) == ST_WIRE) {
|
} else if (shape_type(element) == ST_WIRE && include_curves) {
|
||||||
TopoDS_Wire w;
|
TopoDS_Wire w;
|
||||||
if (!convert_wire(element, w)) {
|
if (!convert_wire(element, w)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
s = w;
|
s = w;
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
part_succes = true;
|
part_succes = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user