Fix not rescaling some balls in 2D protection with non-zero minimal weight

The code break'd but did not restart if a special ball was encountered
This commit is contained in:
Mael Rouxel-Labbé 2023-07-12 10:03:14 +02:00
parent 6f65ecf246
commit 49bb14b6d2
1 changed files with 15 additions and 23 deletions

View File

@ -854,33 +854,25 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index,
else // tr.dimension() <= 2 else // tr.dimension() <= 2
{ {
// change size of existing balls which include p // change size of existing balls which include p
bool restart = true; for ( typename Tr::Finite_vertices_iterator it = tr.finite_vertices_begin(),
while ( restart ) end = tr.finite_vertices_end() ; it != end ; ++it )
{ {
restart = false; const Weighted_point& it_wp = tr.point(it);
for ( typename Tr::Finite_vertices_iterator it = tr.finite_vertices_begin(), FT sq_d = tr.min_squared_distance(p, cp(it_wp));
end = tr.finite_vertices_end() ; it != end ; ++it ) if ( cwsr(it_wp, - sq_d) == CGAL::SMALLER )
{ {
const Weighted_point& it_wp = tr.point(it); bool special_ball = false;
FT sq_d = tr.min_squared_distance(p, cp(it_wp)); if(minimal_weight_ != Weight() && sq_d < minimal_weight_)
if ( cwsr(it_wp, - sq_d) == CGAL::SMALLER )
{ {
bool special_ball = false; sq_d = minimal_weight_;
if(minimal_weight_ != Weight() && sq_d < minimal_weight_) w = minimal_weight_;
{ special_ball = true;
sq_d = minimal_weight_; insert_a_special_ball = true;
w = minimal_weight_; }
special_ball = true;
insert_a_special_ball = true;
}
if( ! is_special(it) ) { if( ! is_special(it) ) {
*out++ = it; *out++ = it;
change_ball_size(it, sq_d, special_ball); change_ball_size(it, sq_d, special_ball);
restart = true;
}
break;
} }
} }
} }