From 8fe2d7e633ff470d35eba7c7aaf722c6cb722761 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Mon, 17 Sep 2018 14:11:03 +0200 Subject: [PATCH] Emit unopened shapes in case of exceptions during subtraction --- src/ifcgeom/IfcGeomFunctions.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ifcgeom/IfcGeomFunctions.cpp b/src/ifcgeom/IfcGeomFunctions.cpp index 54421f1b7e..a344d03526 100644 --- a/src/ifcgeom/IfcGeomFunctions.cpp +++ b/src/ifcgeom/IfcGeomFunctions.cpp @@ -1316,6 +1316,7 @@ IfcGeom::BRepElement

* IfcGeom::Kernel::create_brep_for_representation_and_pro } IfcGeom::IfcRepresentationShapeItems opened_shapes; + bool caught_error = false; try { #if OCC_VERSION_HEX < 0x60900 const bool faster_booleans = settings.get(IteratorSettings::FASTER_BOOLEANS); @@ -1337,9 +1338,16 @@ IfcGeom::BRepElement

* IfcGeom::Kernel::create_brep_for_representation_and_pro } } catch (const std::exception& e) { Logger::Message(Logger::LOG_ERROR, std::string("Error processing openings for: ") + e.what() + ":", product->entity); + caught_error = true; } catch(...) { Logger::Message(Logger::LOG_ERROR,"Error processing openings for:",product->entity); + caught_error = true; } + + if (caught_error && opened_shapes.size() < shapes.size()) { + opened_shapes = shapes; + } + if (settings.get(IteratorSettings::USE_WORLD_COORDS)) { for ( IfcGeom::IfcRepresentationShapeItems::iterator it = opened_shapes.begin(); it != opened_shapes.end(); ++ it ) { it->prepend(trsf);