Commit 3ba674de authored by Wendy Merks-Swolfs's avatar Wendy Merks-Swolfs

Decrease value of ix to avoid that possible swap is skipped. If e.g. ix = 0,…

Decrease value of ix to avoid that possible swap is skipped. If e.g. ix = 0, ichoice will be 0 as well. If the edge swapping succeeds, the new intersected[0] will be the old intersected[1]. However, as ix is now 1 and so ichoice will be 1 as well, it will now check the new intersected[1], which is the old intersected[2]. Old intersected[1] is now skipped. In test "unable_to_recover_edge.geo", there are 5 edges intersected, but as one possible edge is skipped all the time and 2 other edges cannot be swapped, the other two edges keep on going from one configuration to another configuration and back again. With this fix, the test will now succeed.
parent 0ac3efa4
Pipeline #1398 passed with stage
in 17 minutes and 39 seconds
......@@ -382,8 +382,10 @@ BDS_Edge *BDS_Mesh::recover_edge(int num1, int num2, bool &_fatal,
int ichoice = ix++ % intersected.size();
//bool success =
bool success =
swap_edge(intersected[ichoice], BDS_SwapEdgeTestQuality(false, false));
if(success && ichoice < intersected.size() - 1) --ix; // To avoid that a possible swap is skipped
// printf("trying to swop %d %d = %d (%d %d)\n", intersected[ichoice]->p1->iD,
// intersected[ichoice]->p2->iD, success, intersected[ichoice]->deleted,
// intersected[ichoice]->numfaces());
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment