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:
aothms
2015-09-04 11:48:53 +02:00
parent 4385f3b14d
commit 22a8d9a17b
+9 -2
View File
@@ -164,7 +164,11 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& face) {
if (is_interior == !process_interior) continue;
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
@@ -252,13 +256,16 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& face) {
// Reinitialize the builder to the outer face
// bound in order to add holes more robustly.
delete mf;
// TODO: What about the face_surface?
mf = new BRepBuilderAPI_MakeFace(outer_face_bound);
} else {
face = outer_face_bound;
success = true;
}
} else {
break;
Logger::Message(Logger::LOG_ERROR, "Failed to process face boundary", bound->entity);
delete mf;
return false;
}
} else {