Corrected bug in the Laplacian on multiple iteration (missing re-init of temporary data)
Completed the scale dependent laplacian
This commit is contained in:
parent
bd784fabaa
commit
53ac17e6bb
|
@ -194,7 +194,7 @@ static void VertexCoordLaplacianAngleWeighted(MeshType &m, int step, ScalarType
|
||||||
// REQUIREMENTS: Border Flags.
|
// REQUIREMENTS: Border Flags.
|
||||||
//
|
//
|
||||||
// Note the delta parameter is in a absolute unit
|
// Note the delta parameter is in a absolute unit
|
||||||
// it should be a small percentage of the shortest edge.
|
// to get stability it should be a small percentage of the shortest edge.
|
||||||
|
|
||||||
static void VertexCoordScaleDependentLaplacian_Fujiwara(MeshType &m, int step, ScalarType delta)
|
static void VertexCoordScaleDependentLaplacian_Fujiwara(MeshType &m, int step, ScalarType delta)
|
||||||
{
|
{
|
||||||
|
@ -202,7 +202,6 @@ static void VertexCoordScaleDependentLaplacian_Fujiwara(MeshType &m, int step, S
|
||||||
ScaleLaplacianInfo lpz;
|
ScaleLaplacianInfo lpz;
|
||||||
lpz.PntSum=CoordType(0,0,0);
|
lpz.PntSum=CoordType(0,0,0);
|
||||||
lpz.LenSum=0;
|
lpz.LenSum=0;
|
||||||
TD.Start(lpz);
|
|
||||||
FaceIterator fi;
|
FaceIterator fi;
|
||||||
for(int i=0;i<step;++i)
|
for(int i=0;i<step;++i)
|
||||||
{
|
{
|
||||||
|
@ -255,7 +254,6 @@ static void VertexCoordScaleDependentLaplacian_Fujiwara(MeshType &m, int step, S
|
||||||
if(!(*vi).IsD() && TD[*vi].LenSum>0 )
|
if(!(*vi).IsD() && TD[*vi].LenSum>0 )
|
||||||
(*vi).P() = (*vi).P() + (TD[*vi].PntSum/TD[*vi].LenSum)*delta;
|
(*vi).P() = (*vi).P() + (TD[*vi].PntSum/TD[*vi].LenSum)*delta;
|
||||||
}
|
}
|
||||||
TD.Stop();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -280,8 +278,10 @@ static void VertexCoordLaplacian(MeshType &m, int step, bool SmoothSelected=fals
|
||||||
{
|
{
|
||||||
VertexIterator vi;
|
VertexIterator vi;
|
||||||
for(vi=m.vert.begin();vi!=m.vert.end();++vi)
|
for(vi=m.vert.begin();vi!=m.vert.end();++vi)
|
||||||
TD[*vi].sum=(*vi).P();
|
{
|
||||||
|
TD[*vi].cnt=1;
|
||||||
|
TD[*vi].sum=(*vi).P();
|
||||||
|
}
|
||||||
FaceIterator fi;
|
FaceIterator fi;
|
||||||
for(fi=m.face.begin();fi!=m.face.end();++fi)
|
for(fi=m.face.begin();fi!=m.face.end();++fi)
|
||||||
if(!(*fi).IsD())
|
if(!(*fi).IsD())
|
||||||
|
@ -496,7 +496,7 @@ static void VertexColorLaplacian(MeshType &m, int step, bool SmoothSelected=fals
|
||||||
(*vi).C()[2] = (unsigned int) ceil((double) (TD[*vi].b / TD[*vi].cnt));
|
(*vi).C()[2] = (unsigned int) ceil((double) (TD[*vi].b / TD[*vi].cnt));
|
||||||
(*vi).C()[3] = (unsigned int) ceil((double) (TD[*vi].a / TD[*vi].cnt));
|
(*vi).C()[3] = (unsigned int) ceil((double) (TD[*vi].a / TD[*vi].cnt));
|
||||||
}
|
}
|
||||||
}
|
} // end for step
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue