From 802e3a0ea1b6c068fa8b9d251f19ba462f284b3c Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sun, 15 Jan 2023 14:42:14 +0100 Subject: [PATCH] #2688 fix non-planar face triangulation --- src/ifcgeom_schema_agnostic/wire_utils.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom_schema_agnostic/wire_utils.cpp b/src/ifcgeom_schema_agnostic/wire_utils.cpp index ba53a7c05f..ab12ea76f2 100644 --- a/src/ifcgeom_schema_agnostic/wire_utils.cpp +++ b/src/ifcgeom_schema_agnostic/wire_utils.cpp @@ -80,7 +80,11 @@ bool IfcGeom::util::approximate_plane_through_wire(const TopoDS_Wire& wire, gp_P } gp_Vec v(x, y, z); - if (v.SquareMagnitude() < eps_ * eps_) { + // @todo the epsilon passed to us here is the maximum allowed deviation of + // the given points to the constructed plane. When doing triangulation and + // obtaining a 2d points for the Delaunay, infinity is passed here, so this + // can't for assessing degenerativeness. + if (v.SquareMagnitude() < 1.e-7) { Logger::Warning("Degenerate face boundary in normal estimation"); return false; }