1
  1. Does the remove_face method change the mesh indices?

I get a segmentation fault with this code:

        auto face_iterator = m.faces_around_target(m.halfedge(v3));

            for (auto i=face_iterator.begin(); i!=face_iterator.end(); i++) {
                m.remove_face(*i);
            }

According to my understanding of the documentation, as long as I don't call collect_garbage the faces are only marked as removed., therefore no changes to indices. What is happening?

  1. Does remove_face, also remove the face halfedges\ makes them point to null_face? It does not seem to do so, and I don't understand why not..

Thank you.

AmirB
  • 133
  • 6

1 Answers1

2

The face is indeed simply marked as removed but its iterator is invalidated by the removal (remember that iterator goes only over non-removed elements).

As stated in the doc: removes face f from the halfedge data structure without adjusting anything. You need to use a higher level function such as CGAL::Euler::remove_face().

sloriot
  • 6,070
  • 18
  • 27
  • Thank you! CGAL::Euler is exactly what I needed. ended up using CGAL::Euler::remove_center_vertex(), which worked perfectly! – AmirB Aug 25 '17 at 11:47