do no iterate on a container you modify

This commit is contained in:
Sébastien Loriot 2024-02-26 17:20:22 +01:00
parent 124f2b1eff
commit 67b330bd5a
1 changed files with 6 additions and 5 deletions

View File

@ -342,12 +342,13 @@ namespace CGAL {
if(!dont_triangulate) if(!dont_triangulate)
{ {
for (auto h : halfedges(bbox_mesh)) std::size_t k=0;
std::array<typename boost::graph_traits<PolygonMesh>::halfedge_descriptor, 8> hfaces;
for (auto f : faces(bbox_mesh))
hfaces[k++]=halfedge(f, bbox_mesh);
for (auto h : hfaces)
{ {
if (is_quad(h, bbox_mesh)) CGAL::Euler::split_face(h, next(next(h, bbox_mesh), bbox_mesh), bbox_mesh);
CGAL::Euler::split_face(h, next(next(h, bbox_mesh), bbox_mesh), bbox_mesh);
else
CGAL_assertion(is_triangle(h, bbox_mesh));
} }
} }
CGAL::copy_face_graph(bbox_mesh, pmesh, CGAL::copy_face_graph(bbox_mesh, pmesh,