Added a implicit parameter and corrected a bug in the management of selection in remeshing

This commit is contained in:
Paolo Cignoni 2017-04-12 07:44:28 +02:00
parent db0a01af70
commit cc447ec73f
1 changed files with 5 additions and 3 deletions

View File

@ -65,6 +65,7 @@ public:
ScalarType minLength; // minimal admitted length: no edge should be shorter than this value (used when collapsing) 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 maxLength; // maximal admitted length: no edge should be longer than this value (used when refining)
ScalarType lengthThr; ScalarType lengthThr;
ScalarType creaseAngleRadThr= math::ToRad(10.0) ;
ScalarType creaseAngleCosThr= cos(math::ToRad(10.0)) ; ScalarType creaseAngleCosThr= cos(math::ToRad(10.0)) ;
bool splitFlag = true; bool splitFlag = true;
bool swapFlag = true; bool swapFlag = true;
@ -83,7 +84,8 @@ public:
} }
void SetFeatureAngleDeg(ScalarType angle) void SetFeatureAngleDeg(ScalarType angle)
{ {
creaseAngleCosThr= cos(math::ToRad(angle)); creaseAngleRadThr = math::ToRad(angle);
creaseAngleCosThr= cos(creaseAngleRadThr);
} }
@ -654,8 +656,8 @@ private:
tri::UpdateSelection<MeshType>::VertexFromBorderFlag(m); tri::UpdateSelection<MeshType>::VertexFromBorderFlag(m);
selectVertexFromCrease(m, params.creaseAngleCosThr); selectVertexFromCrease(m, params.creaseAngleCosThr);
tri::UpdateSelection<MeshType>::VertexInvert(m); tri::UpdateSelection<MeshType>::VertexInvert(m);
tri::Smooth<MeshType>::VertexCoordPlanarLaplacian(m,1,math::ToRad(10.f),true); tri::Smooth<MeshType>::VertexCoordPlanarLaplacian(m,1,params.creaseAngleRadThr,true);
tri::UpdateSelection<MeshType>::Clear(m); tri::UpdateSelection<MeshType>::VertexClear(m);
} }
/* /*
Reprojection step, this method reprojects each vertex on the original surface Reprojection step, this method reprojects each vertex on the original surface