diff --git a/src/ifcgeom_schema_agnostic/wire_utils.cpp b/src/ifcgeom_schema_agnostic/wire_utils.cpp index 11876e2aa9..5c53233012 100644 --- a/src/ifcgeom_schema_agnostic/wire_utils.cpp +++ b/src/ifcgeom_schema_agnostic/wire_utils.cpp @@ -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()) {