mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 18:21:59 +00:00
Don't leave MakeFace in an invalid state when one of the face boundaries cannot be processed or is not planar
This commit is contained in:
@@ -164,7 +164,11 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& face) {
|
|||||||
if (is_interior == !process_interior) continue;
|
if (is_interior == !process_interior) continue;
|
||||||
|
|
||||||
TopoDS_Wire wire;
|
TopoDS_Wire wire;
|
||||||
if (!convert_wire(loop, wire)) break;
|
if (!convert_wire(loop, wire)) {
|
||||||
|
Logger::Message(Logger::LOG_ERROR, "Failed to process face boundary loop", loop->entity);
|
||||||
|
delete mf;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The approach below does not result in a significant speed-up
|
The approach below does not result in a significant speed-up
|
||||||
@@ -252,13 +256,16 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& face) {
|
|||||||
// Reinitialize the builder to the outer face
|
// Reinitialize the builder to the outer face
|
||||||
// bound in order to add holes more robustly.
|
// bound in order to add holes more robustly.
|
||||||
delete mf;
|
delete mf;
|
||||||
|
// TODO: What about the face_surface?
|
||||||
mf = new BRepBuilderAPI_MakeFace(outer_face_bound);
|
mf = new BRepBuilderAPI_MakeFace(outer_face_bound);
|
||||||
} else {
|
} else {
|
||||||
face = outer_face_bound;
|
face = outer_face_bound;
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
break;
|
Logger::Message(Logger::LOG_ERROR, "Failed to process face boundary", bound->entity);
|
||||||
|
delete mf;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user