avoided computing curvature if not needed

This commit is contained in:
nico 2019-05-15 11:53:12 +10:00
parent b81e2e98bc
commit 8147097df8
1 changed files with 14 additions and 6 deletions

View File

@ -492,13 +492,21 @@ public:
{
//for the moment only cross and line field
//initialize direction by curvature if needed
// if ((SParam.alpha_curv>0)||
// (SParam.sharp_thr>0)||
// (SParam.curv_thr>0))
// //initialize direction by curvature if needed
if ((SParam.alpha_curv>0)||
(SParam.sharp_thr>0)||
(SParam.curv_thr>0))
{
InitByCurvature(mesh,SParam.curvRing);
SelectConstraints(mesh,SParam);
}
else
{
SelectConstraints(mesh,SParam);
vcg::tri::CrossField<MeshType>::PropagateFromSelF(mesh);
}
InitByCurvature(mesh,SParam.curvRing);
SelectConstraints(mesh,SParam);
//then do the actual smooth
SmoothDirections(mesh,SParam.Ndir,SParam.SmoothM,true,SParam.alpha_curv);
}