Commit 1e3adfdd by Wendy Merks-Swolfs

Instead of updating ichoice unless the edge swapping was successful, just try…

Instead of updating ichoice unless the edge swapping was successful, just try from the start to see whether an edge could be swapped. This will fix the new test "unable_to_recover_edge-2.geo" and will keep the previous test "unable_to_recover_edge.geo" fixed as well.
parent d04d70bd
Pipeline #1411 failed with stage
in 15 minutes 43 seconds
......@@ -381,14 +381,21 @@ BDS_Edge *BDS_Mesh::recover_edge(int num1, int num2, bool &_fatal,
return eee;
}
int ichoice = ix++ % intersected.size();
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());
int ichoice = 0;
bool success = false;
while (!success && ichoice < intersected.size())
{
success = swap_edge(intersected[ichoice++], BDS_SwapEdgeTestQuality(false, false));
}
if (!success)
{
Msg::Debug("edge %d %d cannot be recovered at all\n", num1, num2);
_fatal = true;
return 0;
}
ix++;
}
return 0;
}
......
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