Prevent infinite loop in Advancing front surface reconstruction. In some cases K can become really large but doesn't get to infinity and instead gets into a situation where K + epsilon == K and the the while loop never exits. So we check for the case where K stops changing and exits.

This commit is contained in:
dangerski 2019-03-12 10:49:43 -06:00
parent e32637fa7c
commit cf4a809457
1 changed files with 3 additions and 2 deletions

View File

@ -2005,6 +2005,7 @@ namespace CGAL {
{
// initilisation de la variable globale K: qualite d'echantillonnage requise
K = K_init; // valeur d'initialisation de K pour commencer prudemment...
coord_type K_prev = K;
Vertex_handle v1, v2;
if (_ordered_border.empty()){
@ -2069,12 +2070,12 @@ namespace CGAL {
}
while((!_ordered_border.empty())&&
(_ordered_border.begin()->first < STANDBY_CANDIDATE_BIS));
K_prev = K;
K += (std::max)(K_step, min_K - K + eps);
// on augmente progressivement le K mais on a deja rempli sans
// faire des betises auparavant...
}
while((!_ordered_border.empty())&&(K <= K)&&(min_K != infinity()));
while((!_ordered_border.empty())&&(K <= K)&&(min_K != infinity())&&(K!=K_prev));
#ifdef VERBOSE
if ((min_K < infinity())&&(!_ordered_border.empty())) {