diff --git a/src/ifcgeom/AbstractKernel.cpp b/src/ifcgeom/AbstractKernel.cpp index 80b7eb63c9..78c10939c2 100644 --- a/src/ifcgeom/AbstractKernel.cpp +++ b/src/ifcgeom/AbstractKernel.cpp @@ -212,6 +212,7 @@ ifcopenshell::geometry::kernels::AbstractKernel* ifcopenshell::geometry::kernels for (auto it = kernels.begin(); it != kernels.end(); ++it) { (**it).propagate_exceptions = it == kernels.begin(); + (**it).partial_success_is_success = it == kernels.end() - 1; } if (!kernels.empty()) { @@ -225,7 +226,9 @@ ifcopenshell::geometry::kernels::AbstractKernel* ifcopenshell::geometry::kernels bool ifcopenshell::geometry::kernels::AbstractKernel::convert_impl(const taxonomy::collection::ptr collection, IfcGeom::ConversionResults& r) { auto s = r.size(); for (auto& c : collection->children) { - convert(c, r); + if (!partial_success_is_success && !convert(c, r)) { + return false; + } } for (auto i = s; i < r.size(); ++i) { if (collection->matrix) { diff --git a/src/ifcgeom/AbstractKernel.h b/src/ifcgeom/AbstractKernel.h index 58b78fcb2a..3246f6ad5c 100644 --- a/src/ifcgeom/AbstractKernel.h +++ b/src/ifcgeom/AbstractKernel.h @@ -39,6 +39,7 @@ namespace ifcopenshell { Settings settings_; public: bool propagate_exceptions = false; + bool partial_success_is_success = true; AbstractKernel(const std::string& geometry_library, const Settings& settings) : geometry_library_(geometry_library)