From 8c2dcdffe8d8542541973b31f9a3fef6202ce23b Mon Sep 17 00:00:00 2001 From: nico Date: Mon, 23 Jan 2017 16:17:19 +0100 Subject: [PATCH] added VertexQualityTaubin function --- vcg/complex/algorithms/smooth.h | 44 ++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/vcg/complex/algorithms/smooth.h b/vcg/complex/algorithms/smooth.h index b87a371d..bae8d95d 100644 --- a/vcg/complex/algorithms/smooth.h +++ b/vcg/complex/algorithms/smooth.h @@ -401,6 +401,44 @@ static void VertexCoordTaubin(MeshType &m, int step, float lambda, float mu, boo } // end for step } +static void VertexQualityTaubin(MeshType &m, int step, float lambda, float mu, bool SmoothSelected=false, vcg::CallBackPos * cb=0) +{ + SimpleTempData OldQ(m.vert,0); + + VertexIterator vi; + for(int i=0;iQ(); @@ -701,7 +739,7 @@ static void VertexQualityLaplacian(MeshType &m, int step=1, bool SmoothSelected= // si azzaera i dati per i vertici di bordo for(fi=m.face.begin();fi!=m.face.end();++fi) if(!(*fi).IsD()) - for(int j=0;j<3;++j) + for(int j=0;j<(*fi).VN();++j) if((*fi).IsB(j)) { TD[(*fi).V(j)]=lpz; @@ -711,7 +749,7 @@ static void VertexQualityLaplacian(MeshType &m, int step=1, bool SmoothSelected= // se l'edge j e' di bordo si deve mediare solo con gli adiacenti for(fi=m.face.begin();fi!=m.face.end();++fi) if(!(*fi).IsD()) - for(int j=0;j<3;++j) + for(int j=0;j<(*fi).VN();++j) if((*fi).IsB(j)) { TD[(*fi).V(j)].sum+=(*fi).V1(j)->Q();