corrected bug in the face laplacian normal smoothing
This commit is contained in:
parent
4778217ec5
commit
64d7f31279
|
|
@ -71,7 +71,7 @@ public:
|
||||||
// This is precisely what curvature flow does.
|
// This is precisely what curvature flow does.
|
||||||
// Curvature flow smoothes the surface by moving along the surface
|
// Curvature flow smoothes the surface by moving along the surface
|
||||||
// normal n with a speed equal to the mean curvature
|
// 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 )
|
static void FaceNormalLaplacianFF(MeshType &m, int step=1, bool SmoothSelected=false )
|
||||||
{
|
{
|
||||||
PDFaceInfo lpzf;
|
PDFaceInfo lpzf;
|
||||||
lpzf.m=CoordType(0,0,0);
|
lpzf.m=CoordType(0,0,0);
|
||||||
SimpleTempData<typename MeshType::FaceContainer, PDFaceInfo> TDF(m.face,lpzf);
|
SimpleTempData<typename MeshType::FaceContainer, PDFaceInfo> TDF(m.face,lpzf);
|
||||||
assert(tri::HasFFAdjacency(m));
|
assert(tri::HasFFAdjacency(m));
|
||||||
|
|
||||||
FaceIterator fi;
|
FaceIterator fi;
|
||||||
tri::UpdateNormals<MeshType>::AreaNormalizeFace(m);
|
tri::UpdateNormals<MeshType>::AreaNormalizeFace(m);
|
||||||
for(int i=0;i<step;++i)
|
for(int iStep=0;iStep<step;++iStep)
|
||||||
{
|
{
|
||||||
for(fi=m.face.begin();fi!=m.face.end();++fi) if(!(*fi).IsD())
|
for(fi=m.face.begin();fi!=m.face.end();++fi) if(!(*fi).IsD())
|
||||||
{
|
{
|
||||||
CoordType normalSum=(*fi).N();
|
CoordType normalSum=(*fi).N();
|
||||||
|
|
||||||
for(i=0;i<3;++i)
|
for(int i=0;i<3;++i)
|
||||||
normalSum+=(*fi).FFp(i)->N();
|
normalSum+=(*fi).FFp(i)->N();
|
||||||
|
|
||||||
TDF[*fi].m=normalSum;
|
TDF[*fi].m=normalSum;
|
||||||
}
|
}
|
||||||
for(fi=m.face.begin();fi!=m.face.end();++fi)
|
for(fi=m.face.begin();fi!=m.face.end();++fi)
|
||||||
if(!SmoothSelected || (*fi).IsS())
|
if(!SmoothSelected || (*fi).IsS())
|
||||||
(*fi).N()=TDF[*fi].m;
|
(*fi).N()=TDF[*fi].m;
|
||||||
|
|
||||||
tri::UpdateNormals<MeshType>::NormalizeFace(m);
|
tri::UpdateNormals<MeshType>::NormalizeFace(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue