Skip to content
Snippets Groups Projects
Commit f439516e authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

bug in smoothing

parent 365a8c12
Branches
Tags
No related merge requests found
...@@ -2305,14 +2305,16 @@ void _relocateVertex(GFace *gf, MVertex *ver, ...@@ -2305,14 +2305,16 @@ void _relocateVertex(GFace *gf, MVertex *ver,
after *= (1.0/COUNT); after *= (1.0/COUNT);
double FACTOR = 1.0; double FACTOR = 1.0;
const int MAXITER = 5; const int MAXITER = 5;
SPoint2 actual = before;
for (int ITER = 0;ITER < MAXITER; ITER ++){ for (int ITER = 0;ITER < MAXITER; ITER ++){
SPoint2 trial = after * FACTOR + before * (1.-FACTOR); SPoint2 trial = after * FACTOR + before * (1.-FACTOR);
bool success = _isItAGoodIdeaToMoveThatVertex (gf, lt, ver,before,trial); bool success = _isItAGoodIdeaToMoveThatVertex (gf, lt, ver,actual,trial);
if (success){ if (success){
ver->setParameter(0, trial.x());
ver->setParameter(1, trial.y());
GPoint pt = gf->point(trial); GPoint pt = gf->point(trial);
if(pt.succeeded()){ if(pt.succeeded()){
actual = trial;
ver->setParameter(0, trial.x());
ver->setParameter(1, trial.y());
ver->x() = pt.x(); ver->x() = pt.x();
ver->y() = pt.y(); ver->y() = pt.y();
ver->z() = pt.z(); ver->z() = pt.z();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment