mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 11:20:21 +00:00
#671 check for zero magnitude vector in newells method
This commit is contained in:
@@ -74,7 +74,13 @@ bool IfcGeom::util::approximate_plane_through_wire(const TopoDS_Wire& wire, gp_P
|
|||||||
return false;
|
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);
|
exp.Init(wire);
|
||||||
for (; exp.More(); exp.Next()) {
|
for (; exp.More(); exp.Next()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user