c++ - 具有 exact_constructions 内核的 3D 凸包 CGAL::halfspace_intersection_3

标签 c++ cgal

我想将 CGAL Exact_predicates_exact_constructions_kernel 与 3D Convex Hulls 函数 CGAL::halfspace_intersection_3(CGAL Vers. 4.6.1)一起使用,这是我的简单测试:

#include "CGAL/Exact_predicates_exact_constructions_kernel.h"
#include "CGAL/Convex_hull_3/dual/halfspace_intersection_3.h"

typedef CGAL::Exact_predicates_exact_constructions_kernel  K;
typedef K::Plane_3                                         Plane;
typedef K::Point_3                                         Point;
typedef CGAL::Polyhedron_3<K>                              Polyhedron_3;

int main (void) {

    std::list<Plane> planes;
    Polyhedron_3 P;

    CGAL::halfspace_intersection_3(planes.begin(),
                                   planes.end(),
                                   P,
                                   boost::make_optional(Point(0, 0, 0)) );

    return 0;
}

但是我在编译时遇到这个错误:

In file included from /CGAL-4.6.1/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h:27:0,
                 from /test/halfspace_intersection_3.cpp:2:
/CGAL-4.6.1/include/CGAL/Convex_hull_3/dual/Convex_hull_traits_dual_3.h: In instantiation of ‘class CGAL::Convex_hull_3::Convex_hull_filtered_traits_dual_3<CGAL::Epeck>’:
/CGAL-4.6.1/include/CGAL/Convex_hull_3/dual/Convex_hull_traits_dual_3.h:266:15:   required from ‘class CGAL::Convex_hull_3::Convex_hull_traits_dual_3<CGAL::Epeck, true>’
/CGAL-4.6.1/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h:259:32:   required from ‘void CGAL::halfspace_intersection_3(PlaneIterator, PlaneIterator, Polyhedron&, const boost::optional<typename Polyhedron::Vertex::Point_3>&) [with PlaneIterator = std::_List_iterator<CGAL::Plane_3<CGAL::Epeck> >; Polyhedron = CGAL::Polyhedron_3<CGAL::Epeck>; typename Polyhedron::Vertex::Point_3 = CGAL::Point_3<CGAL::Epeck>]’
/test/halfspace_intersection_3.cpp:18:73:   required from here
/CGAL-4.6.1/include/CGAL/Convex_hull_3/dual/Convex_hull_traits_dual_3.h:193:21: error: no type named ‘Exact_kernel_rt’ in ‘class CGAL::Epeck’
                     Exact_traits;
                     ^
/CGAL-4.6.1/include/CGAL/Convex_hull_3/dual/Convex_hull_traits_dual_3.h:201:21: error: no type named ‘Exact_kernel_rt’ in ‘class CGAL::Epeck’
                     Converter_exact_dual;
                     ^
/CGAL-4.6.1/include/CGAL/Convex_hull_3/dual/Convex_hull_traits_dual_3.h:210:45: error: no type named ‘Exact_kernel_rt’ in ‘class CGAL::Epeck’
                     Converter_approx_dual > Equal_3;
                                             ^
/CGAL-4.6.1/include/CGAL/Convex_hull_3/dual/Convex_hull_traits_dual_3.h:216:45: error: no type named ‘Exact_kernel_rt’ in ‘class CGAL::Epeck’
                     Converter_approx_dual > Collinear_3;
                                             ^
/CGAL-4.6.1/include/CGAL/Convex_hull_3/dual/Convex_hull_traits_dual_3.h:222:45: error: no type named ‘Exact_kernel_rt’ in ‘class CGAL::Epeck’
                     Converter_approx_dual > Coplanar_3;
                                             ^
/CGAL-4.6.1/include/CGAL/Convex_hull_3/dual/Convex_hull_traits_dual_3.h:228:45: error: no type named ‘Exact_kernel_rt’ in ‘class CGAL::Epeck’
                     Converter_approx_dual > Less_distance_to_point_3;
                                             ^
/CGAL-4.6.1/include/CGAL/Convex_hull_3/dual/Convex_hull_traits_dual_3.h:234:45: error: no type named ‘Exact_kernel_rt’ in ‘class CGAL::Epeck’
                     Converter_approx_dual > Has_on_positive_side_3;
                                             ^
/CGAL-4.6.1/include/CGAL/Convex_hull_3/dual/Convex_hull_traits_dual_3.h:240:45: error: no type named ‘Exact_kernel_rt’ in ‘class CGAL::Epeck’
                     Converter_approx_dual > Less_signed_distance_to_plane_3;
                                             ^
make[2]: *** [CMakeFiles/TestCGAL.dir/halfspace_intersection_3.cpp.o] Error 1

是否可以将精确的构造内核与 3D 凸包 CGAL::halfspace_intersection_3 一起使用?请给我一个线索吗?非常感谢

最佳答案

这个版本的CGAL确实有bug。修复在 this commit 中.

请注意,由于您希望使用具有精确构造的内核,因此最好使用 CGAL::halfspace_intersection_with_constructions_3哪个应该更快。

关于c++ - 具有 exact_constructions 内核的 3D 凸包 CGAL::halfspace_intersection_3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31575266/

相关文章:

c++ - 在 C++ 代码中使用枚举类型时出错

C++ 抽象一个模板化类型,保留 T(虚拟)

c++ - 无法在 Visual Studio 中编译 Win32 应用程序

c++ - 遍历CGAL生成的子域中的四面体和顶点

c++ - CGAL 库 Vertex_visibility_graph_2.h 的问题

c++ - 查找线段的交点和每个交点的相交线段列表

c++ - 如何获取某些点的Voronoi图在QT中显示?

c++ - vector 的迭代器---测试结束

c++ - QMetaType 和继承

c++ - 如何将三角孔补丁转换为表面网格?