#3429 Fix b operand non-planar face check

This commit is contained in:
Thomas Krijnen
2023-08-17 11:28:02 +02:00
parent 008f953b6c
commit f4971da42e
@@ -467,13 +467,19 @@ int IfcGeom::util::eliminate_touching_operands(double prec, const TopoDS_Shape &
// Check if any of the faces in b are non-planar, which is // Check if any of the faces in b are non-planar, which is
// not supported by this quick check. // not supported by this quick check.
bool non_planar = false;
for (int i = 1; i <= b_faces.Extent(); ++i) { for (int i = 1; i <= b_faces.Extent(); ++i) {
auto surf = BRep_Tool::Surface(TopoDS::Face(b_faces(i))); auto surf = BRep_Tool::Surface(TopoDS::Face(b_faces(i)));
if (surf->DynamicType() != STANDARD_TYPE(Geom_Plane)) { if (surf->DynamicType() != STANDARD_TYPE(Geom_Plane)) {
continue; non_planar = true;
break;
} }
} }
if (non_planar) {
continue;
}
TopTools_IndexedMapOfShape b_vertices; TopTools_IndexedMapOfShape b_vertices;
TopExp::MapShapes(b, TopAbs_VERTEX, b_vertices); TopExp::MapShapes(b, TopAbs_VERTEX, b_vertices);