#2260 correct init order

This commit is contained in:
Thomas Krijnen
2022-07-05 10:27:44 +02:00
parent 2ab4e44248
commit 952719f19b
+9 -9
View File
@@ -483,6 +483,15 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
}
}
if (!ifc_representation) {
if (reps->size()) {
// Return a random representation
ifc_representation = *reps->begin();
} else {
throw IfcParse::IfcException("No suitable IfcRepresentation found");
}
}
// Read precision for found representation's context
auto context = ifc_representation->ContextOfItems();
if (context->template as<typename Schema::IfcGeometricRepresentationSubContext>()) {
@@ -499,15 +508,6 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
kernel.setValue(IfcGeom::Kernel::GV_PRECISION, p);
}
if (!ifc_representation) {
if (reps->size()) {
// Return a random representation
ifc_representation = *reps->begin();
} else {
throw IfcParse::IfcException("No suitable IfcRepresentation found");
}
}
IfcGeom::BRepElement* brep = kernel.convert(settings, ifc_representation, product);
if (!brep) {
throw IfcParse::IfcException("Failed to process shape");