#671 check for zero magnitude vector in newells method

This commit is contained in:
Thomas Krijnen
2022-10-13 09:34:14 +02:00
parent 153c5a06e7
commit 4cccfd08d3
+7 -1
View File
@@ -74,7 +74,13 @@ bool IfcGeom::util::approximate_plane_through_wire(const TopoDS_Wire& wire, gp_P
return false;
}
plane = gp_Pln(center / n, gp_Dir(x, y, z));
gp_Vec v(x, y, z);
if (v.SquareMagnitude() < eps_ * eps_) {
Logger::Warning("Degenerate face boundary in normal estimation");
return false;
}
plane = gp_Pln(center / n, v);
exp.Init(wire);
for (; exp.More(); exp.Next()) {