From f83bdf081554c3b6ac77a7a1cfd9d31040b3d8b6 Mon Sep 17 00:00:00 2001 From: Luigi Malomo Date: Tue, 23 Mar 2021 01:06:28 +0100 Subject: [PATCH] quick and dirty fix for polygon import from trimesh --- vcg/complex/algorithms/polygon_support.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vcg/complex/algorithms/polygon_support.h b/vcg/complex/algorithms/polygon_support.h index c6df0d8e..bce0d219 100644 --- a/vcg/complex/algorithms/polygon_support.h +++ b/vcg/complex/algorithms/polygon_support.h @@ -141,7 +141,8 @@ namespace tri { { std::vector vs;// vertices of the polygon ExtractPolygon(&*tfi,vs); - std::reverse(vs.begin(),vs.end()); + if (vs.size() > 3) + std::reverse(vs.begin(), vs.end()); //now vs contains all the vertices of the polygon (still in the trimesh) if (vs.size()==0)continue; typename PolyMeshType::FaceIterator pfi = tri::Allocator::AddFaces(pm,1);