From 78f235ea7c372b11f59cb3ef888b3256b7209618 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Thu, 28 Mar 2024 09:06:41 +0100 Subject: [PATCH] #4273 ignore degenerate triangles in mesher output --- src/ifcgeom_schema_agnostic/IfcGeomRepresentation.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ifcgeom_schema_agnostic/IfcGeomRepresentation.cpp b/src/ifcgeom_schema_agnostic/IfcGeomRepresentation.cpp index 7672eb381f..e30b9a3560 100644 --- a/src/ifcgeom_schema_agnostic/IfcGeomRepresentation.cpp +++ b/src/ifcgeom_schema_agnostic/IfcGeomRepresentation.cpp @@ -371,6 +371,11 @@ IfcGeom::Representation::Triangulation::Triangulation(const BRep& shape_model) triangles(i).Get(n3, n2, n1); else triangles(i).Get(n1, n2, n3); + if (dict[n1] == dict[n2] || dict[n2] == dict[n3] || dict[n3] == dict[n1]) { + Logger::Warning("Mesher generated a degenerate triangle, ignoring"); + continue; + } + /* An alternative would be to calculate normals based * on the coordinates of the mesh vertices */ /*