CGAL surface mesh - removing face

会有一股神秘感。 提交于 2019-12-08 05:20:57

问题


  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.


回答1:


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().



来源:https://stackoverflow.com/questions/45875622/cgal-surface-mesh-removing-face

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!