Fixed stack order in non recursive conflict walking

Edges must be output in a CCW order, which is achieved by walking ccw-ly first.
In the recursive function, we correctly call 'propagate(..., ccw(j))' first.
For the non-recursive version which uses a stack, then we must add 'ccw(j)'
last since the stack is a LIFO structure.
This commit is contained in:
Mael Rouxel-Labbé 2019-01-11 12:29:40 +01:00
parent 3b713d4d09
commit 28ce2a5240
1 changed files with 4 additions and 1 deletions

View File

@ -503,8 +503,11 @@ private:
} else {
*(pit.first)++ = fn;
int j = fn->index(fh);
stack.push(std::make_pair(fn,ccw(j)));
// In the non-recursive version, we walk via 'ccw(j)' first. Here, we are filling the stack
// and the order is thus the opposite (we want the last element of the stack to be 'ccw(j)')
stack.push(std::make_pair(fn,cw(j)));
stack.push(std::make_pair(fn,ccw(j)));
}
}
return pit;