From cc447ec73fb2a2e40509e5e96d3236bd6e467c8a Mon Sep 17 00:00:00 2001 From: Paolo Cignoni Date: Wed, 12 Apr 2017 07:44:28 +0200 Subject: [PATCH] Added a implicit parameter and corrected a bug in the management of selection in remeshing --- vcg/complex/algorithms/isotropic_remeshing.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vcg/complex/algorithms/isotropic_remeshing.h b/vcg/complex/algorithms/isotropic_remeshing.h index a5d3b6dc..7a762651 100644 --- a/vcg/complex/algorithms/isotropic_remeshing.h +++ b/vcg/complex/algorithms/isotropic_remeshing.h @@ -65,6 +65,7 @@ public: ScalarType minLength; // minimal admitted length: no edge should be shorter than this value (used when collapsing) ScalarType maxLength; // maximal admitted length: no edge should be longer than this value (used when refining) ScalarType lengthThr; + ScalarType creaseAngleRadThr= math::ToRad(10.0) ; ScalarType creaseAngleCosThr= cos(math::ToRad(10.0)) ; bool splitFlag = true; bool swapFlag = true; @@ -83,7 +84,8 @@ public: } void SetFeatureAngleDeg(ScalarType angle) { - creaseAngleCosThr= cos(math::ToRad(angle)); + creaseAngleRadThr = math::ToRad(angle); + creaseAngleCosThr= cos(creaseAngleRadThr); } @@ -654,8 +656,8 @@ private: tri::UpdateSelection::VertexFromBorderFlag(m); selectVertexFromCrease(m, params.creaseAngleCosThr); tri::UpdateSelection::VertexInvert(m); - tri::Smooth::VertexCoordPlanarLaplacian(m,1,math::ToRad(10.f),true); - tri::UpdateSelection::Clear(m); + tri::Smooth::VertexCoordPlanarLaplacian(m,1,params.creaseAngleRadThr,true); + tri::UpdateSelection::VertexClear(m); } /* Reprojection step, this method reprojects each vertex on the original surface