本文介绍了CGAL表面网格-去除面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. remove_face方法是否会更改网格索引?

使用此代码我遇到了细分错误:

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);
            }

根据我对文档的理解,只要不调用collect_garbage,这些面孔就会被标记标记为已删除.因此,索引不会发生变化.发生什么事了?

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. remove_face是否也删除了脸部的半边距\,使其指向null_face?它似乎没有这样做,而且我不明白为什么不这样做.

谢谢.

推荐答案

确实确实将面部标记为已移除,但是其迭代器因移除而无效(请记住,迭代器仅遍历未移除的元素).

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

doc 中所述:去除面部f来自半边数据结构,无需进行任何调整.您需要使用更高级别的函数,例如 CGAL::Euler::remove_face() .

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

这篇关于CGAL表面网格-去除面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 00:09