c++ - CGAL::Delaunay_triangulation_3 期间无限循环

标签 c++ infinite-loop triangulation cgal delaunay

我正在使用 CGAL 库对 3D 点云进行三角测量。有时应用程序运行良好,但大多数时候它会卡住。它在三角剖分中插入新的 3D 点时进入无限循环。这个问题我只在 Windows 上遇到,在 Linux 上它总是工作正常。我在 Windows 8.1 x64 上使用 CGAL 4.6 x64 内核 Exact_predicates_inexact_constructions_kernel Visual Studio 2012/2015,在 Ubuntu 14.04 x64 上使用 GCC。

关于如何在 Windows 版本上解决这个问题有什么建议吗?

更新:点击此链接找到重现问题的最少代码和示例数据集:https://drive.google.com/file/d/0B8bb0qT4PvT8V2hqUEt0RUstLTg 问题似乎出在搜索最近点和插入新点的优化过程中(编译前确定的两段代码是等价的,但第二段优化有两种方式:只使用一个locate() 而不是两个,并且不为每个点分配/使用 std::vector

最佳答案

我认为错误在你的 struct adjacent_vertex_back_inserter_t operator= 应该如下所示:

    inline void operator=(const vertex_handle_t& w) {
      assert(! delaunay.is_infinite(v))
        if ( !delaunay.is_infinite(w) && (delaunay.geom_traits().compare_distance_3_object()(p, w->point(), v->point()) == CGAL::SMALLER)){
          v = w;
      }

关于c++ - CGAL::Delaunay_triangulation_3 期间无限循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30648926/

相关文章:

c++ - 为什么 std::fill(0) 比 std::fill(1) 慢?

c++ - OpenMP 通过 std::set 使用迭代器

java - java.util.HashMap 中的无限循环

haskell - Haskell 中的递归排列

algorithm - 德劳内 : Triangulate two point sets with the best fitting mesh

c++ - 需要一个好的方法来在 Google Test 中测试工厂类

c++ - C++ 期望数组下标是什么类型?

javascript - 为什么我不能有两个互相执行的 .js 脚本?

从一组相邻三角形创建多边形的算法

android - Android 中基于 CelID 的位置?