mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
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.
This commit is contained in:
@@ -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())) {
|
||||
|
||||
Reference in New Issue
Block a user