Skip to content

Commit 326c2c3

Browse files
authored
Mesh_3 - fix protecting balls placement (#9218)
## Summary of Changes Here, `p` corresponds to a point on a feature, with dimension 1. We must use `curve_index` and not `p_index`, which may be a corner index for `p` corresponding to a vertex with `in_dimension=0`. The risk is to compare a `Corner_index` and a `Curve_index` which have the same types (`int` by default) and same values though they correspond to corner of index `i` and curve of index `i` ## Release Management * Affected package(s): Mesh_3 * Issue(s) solved (if any): fix ? * License and copyright ownership: unchanged
2 parents 67c9b67 + a8f76df commit 326c2c3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
# include <boost/math/special_functions/next.hpp> // for float_prior
5555
#endif
5656
#include <optional>
57-
#include <boost/tuple/tuple.hpp>
5857
#include <boost/unordered_map.hpp>
5958
#include <boost/unordered_set.hpp>
6059

@@ -1050,7 +1049,7 @@ insert_balls_on_edges()
10501049
// if 'p' is not a corner, find out a second point 'q' on the
10511050
// curve, "far" from 'p', and limit the radius of the ball of 'p'
10521051
// with the third of the distance from 'p' to 'q'.
1053-
FT p_size = query_size(p, 1, p_index);
1052+
FT p_size = query_size(p, 1, curve_index);
10541053

10551054
FT curve_length = domain_.curve_length(curve_index);
10561055

@@ -1063,7 +1062,7 @@ insert_balls_on_edges()
10631062
vp = smart_insert_point(p,
10641063
CGAL::square(p_size),
10651064
1 /*dim*/,
1066-
p_index,
1065+
curve_index,
10671066
Vertex_handle(),
10681067
CGAL::Emptyset_iterator()).first;
10691068
}
@@ -1106,6 +1105,7 @@ get_vertex_corner_from_point(const Bare_point& p, const Index&) const
11061105
c3t3_.triangulation().is_vertex(cwp(p), v);
11071106

11081107
CGAL_assertion( q_found );
1108+
CGAL_assertion(v->in_dimension() == 0);
11091109
return v;
11101110
}
11111111

@@ -2190,6 +2190,9 @@ repopulate_edges_around_corner(const Vertex_handle& v, ErasedVeOutIt out)
21902190
const Vertex_handle& next = vit->first;
21912191
const Curve_index& curve_index = vit->second;
21922192

2193+
CGAL_assertion_code(const Curve_index cid = c3t3_.curve_index(v, next));
2194+
CGAL_assertion(cid == curve_index);
2195+
21932196
// if `v` is incident to a cycle, it might be that the full cycle,
21942197
// including the edge `[next, v]`, has already been processed by
21952198
// `analyze_and_repopulate()` walking in the other direction.

0 commit comments

Comments
 (0)