From a60c31845c9ce7ac7d48ef0b874ecb98bf7909a6 Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Wed, 14 Oct 2009 13:56:06 +0000 Subject: [PATCH] added function HasConsistentEdges --- vcg/complex/trimesh/clean.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/vcg/complex/trimesh/clean.h b/vcg/complex/trimesh/clean.h index dad74b53..60e381b1 100644 --- a/vcg/complex/trimesh/clean.h +++ b/vcg/complex/trimesh/clean.h @@ -879,7 +879,23 @@ private: return true; } - + static bool HasConsistentEdges(const MeshType &m) + { + assert(m.HasPerFaceFlags()); + + for (ConstFaceIterator fi = m.face.begin(); fi != m.face.end(); ++fi) + if(!(*fi).IsD()) + for (int k=0; k<3; k++) + { + VertexType *v0=(*fi).V(0); + VertexType *v1=(*fi).V(1); + VertexType *v2=(*fi).V(2); + if ((v0==v1)||(v0==v2)||(v1==v2)) + return false; + } + + return true; + } static int CountNonManifoldVertexFF( MeshType & m, bool select = true ) { assert(tri::HasFFAdjacency(m));