diff --git a/vcg/complex/algorithms/polygon_support.h b/vcg/complex/algorithms/polygon_support.h index a058118f..c3dcfc17 100644 --- a/vcg/complex/algorithms/polygon_support.h +++ b/vcg/complex/algorithms/polygon_support.h @@ -148,9 +148,12 @@ namespace tri { // around the polygonal face determined by the current FAUX-EDGE markings // It assumes that the mesh is 2Manifold and has FF adjacency already computed // NOTE: All the faces touched are marked as visited. (so for example you can avoid to get twice the same polygon) - static void ExtractPolygon(typename TriMeshType::FacePointer tfp, std::vector &vs) + static void ExtractPolygon(typename TriMeshType::FacePointer tfp, + std::vector &vs, + std::vector &fs) { vs.clear(); + fs.clear(); // find a non tagged edge int se = -1; for(int i=0; i<3; i++) if (!( tfp->IsF(i))) { se = i; break;} @@ -172,6 +175,7 @@ namespace tri { while( p.F()->IsF(p.E()) ) { + if(!p.F()->IsV()) fs.push_back(p.F()); p.F()->SetV(); p.FlipF(); p.FlipE(); @@ -179,7 +183,11 @@ namespace tri { p.FlipV(); } while(p!=start); } - + static void ExtractPolygon(typename TriMeshType::FacePointer tfp, std::vector &vs) + { + std::vector fs; + ExtractPolygon(tfp,vs,fs); + } }; // end of struct }} // end namespace vcg::tri