From 8147097df8f9bded3528deb64f7d6e1f334f0c55 Mon Sep 17 00:00:00 2001 From: nico Date: Wed, 15 May 2019 11:53:12 +1000 Subject: [PATCH] avoided computing curvature if not needed --- wrap/igl/smooth_field.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/wrap/igl/smooth_field.h b/wrap/igl/smooth_field.h index e507ceb9..8c17e4a1 100644 --- a/wrap/igl/smooth_field.h +++ b/wrap/igl/smooth_field.h @@ -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::PropagateFromSelF(mesh); + } + - InitByCurvature(mesh,SParam.curvRing); - SelectConstraints(mesh,SParam); //then do the actual smooth SmoothDirections(mesh,SParam.Ndir,SParam.SmoothM,true,SParam.alpha_curv); }