From ab3292caa09d60d3e399f3329500e4078e2a4edb Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 10 Jun 2016 14:05:36 +0200 Subject: [PATCH] ignore triangles with 2 or 3 identical vertices --- Polyhedron_IO/include/CGAL/IO/STL_reader.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Polyhedron_IO/include/CGAL/IO/STL_reader.h b/Polyhedron_IO/include/CGAL/IO/STL_reader.h index 04eae64ca04..eae9cd164f7 100644 --- a/Polyhedron_IO/include/CGAL/IO/STL_reader.h +++ b/Polyhedron_IO/include/CGAL/IO/STL_reader.h @@ -80,7 +80,15 @@ namespace CGAL{ ijk[j] = iti->second; } } - facets.push_back(ijk); + if((ijk[0] != ijk[1]) && + (ijk[0] != ijk[2]) && + (ijk[1] != ijk[2])){ + facets.push_back(ijk); + }else{ + if(verbose){ + std::cerr << "ignore degenerate face" << std::endl; + } + } char c; input.read(reinterpret_cast(&c), sizeof(c)); input.read(reinterpret_cast(&c), sizeof(c));