From 64d7f31279b3afc2161237514121fc656de9f67f Mon Sep 17 00:00:00 2001 From: cignoni Date: Sun, 6 May 2012 15:31:07 +0000 Subject: [PATCH] corrected bug in the face laplacian normal smoothing --- vcg/complex/algorithms/smooth.h | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/vcg/complex/algorithms/smooth.h b/vcg/complex/algorithms/smooth.h index 96fcbe2f..646ff166 100644 --- a/vcg/complex/algorithms/smooth.h +++ b/vcg/complex/algorithms/smooth.h @@ -71,7 +71,7 @@ public: // This is precisely what curvature flow does. // Curvature flow smoothes the surface by moving along the surface // normal n with a speed equal to the mean curvature -void VertexCoordLaplacianCurvatureFlow(MeshType &m, int step, ScalarType delta) +void VertexCoordLaplacianCurvatureFlow(MeshType &/*m*/, int /*step*/, ScalarType /*delta*/) { } @@ -955,30 +955,30 @@ static void FaceNormalLaplacianVF(MeshType &m) static void FaceNormalLaplacianFF(MeshType &m, int step=1, bool SmoothSelected=false ) { - PDFaceInfo lpzf; - lpzf.m=CoordType(0,0,0); - SimpleTempData TDF(m.face,lpzf); - assert(tri::HasFFAdjacency(m)); + PDFaceInfo lpzf; + lpzf.m=CoordType(0,0,0); + SimpleTempData TDF(m.face,lpzf); + assert(tri::HasFFAdjacency(m)); FaceIterator fi; - tri::UpdateNormals::AreaNormalizeFace(m); - for(int i=0;i::AreaNormalizeFace(m); + for(int iStep=0;iStepN(); + for(int i=0;i<3;++i) + normalSum+=(*fi).FFp(i)->N(); - TDF[*fi].m=normalSum; - } - for(fi=m.face.begin();fi!=m.face.end();++fi) - if(!SmoothSelected || (*fi).IsS()) - (*fi).N()=TDF[*fi].m; + TDF[*fi].m=normalSum; + } + for(fi=m.face.begin();fi!=m.face.end();++fi) + if(!SmoothSelected || (*fi).IsS()) + (*fi).N()=TDF[*fi].m; - tri::UpdateNormals::NormalizeFace(m); - } + tri::UpdateNormals::NormalizeFace(m); + } }