From bf5548f8f65fdb0ee25b359559a279a08d0b1919 Mon Sep 17 00:00:00 2001 From: Petru Conduraru Date: Mon, 20 Jul 2026 15:06:07 +0300 Subject: [PATCH] ifcgeom: keep unopened geometry when opening subtraction throws a non-std::exception (#6391) OCCT's Standard_Failure hierarchy does not derive from std::exception, so any raw OCCT exception escaping convert_openings() lands in the generic catch (...) handler rather than catch (const std::exception&). That handler logged the error but never set caught_error, so the safety check right after (which exists precisely to keep the product's unopened geometry when opening processing fails) was bypassed and the incomplete/empty opened_shapes silently replaced the product's solid geometry. The element ends up with zero faces and disappears entirely from the viewport, matching "walls disappear when a project is opened" (recalculating the wall regenerates a clean representation that doesn't hit the same exception, which is why that "fixes" it for the reporter). Generated with the assistance of an AI coding tool. --- src/ifcgeom/Converter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ifcgeom/Converter.cpp b/src/ifcgeom/Converter.cpp index 15a4584088..d489c1115c 100644 --- a/src/ifcgeom/Converter.cpp +++ b/src/ifcgeom/Converter.cpp @@ -212,7 +212,9 @@ IfcGeom::BRepElement* ifcopenshell::geometry::Converter::create_brep_for_represe logger_.Message(Logger::LOG_ERROR, "GEO", 33, std::string("Error processing openings for: ") + e.what() + ":", product); caught_error = true; } catch (...) { + // Non-std::exception (e.g. OCCT's Standard_Failure) also counts as caught_error. logger_.Message(Logger::LOG_ERROR, "GEO", 34, "Error processing openings for:", product); + caught_error = true; } if (!(caught_error && opened_shapes.size() < shapes.size())) {