我正在使用 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/