【发布时间】:2014-06-06 15:35:25
【问题描述】:
我正在尝试使用未记录的函数 CGAL::triangulate_polyhedron。但我收到很多错误。这是我的简单代码:
#include <CGAL/Exact_predicates_exact_constructions_kernel_with_sqrt.h>
#include <CGAL/point_generators_3.h>
#include <CGAL/algorithm.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/convex_hull_3.h>
#include <CGAL/triangulate_polyhedron.h>
#include <vector>
typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt K;
typedef CGAL::Polyhedron_3<K> Polyhedron_3;
typedef K::Segment_3 Segment_3;
// define point creator
typedef K::Point_3 Point_3;
typedef CGAL::Creator_uniform_3<double, Point_3> PointCreator;
int main() {
CGAL::Random_points_in_sphere_3<Point_3, PointCreator> gen(100.0);
// generate 250 points randomly on a sphere of radius 100.0
// and copy them to a vector
std::vector<Point_3> points;
CGAL::cpp11::copy_n(gen, 250, std::back_inserter(points));
// define polyhedron to hold convex hull
Polyhedron_3 poly;
// compute convex hull of non-colinear points
CGAL::convex_hull_3(points.begin(), points.end(), poly);
CGAL::triangulate_polyhedron<Polyhedron_3>(poly);
return 0;
}
这里是(示例)错误:
/CGALtest/include/CGAL/Triangulation_2_filtered_projection_traits_3.h:38:36: 错误:‘CGAL::Triangulation_2_filtered_projection_traits_3 >::K {aka struct CGAL::Simple_cartesian}’中没有名为‘Exact_kernel’的类型 typedef typename K::Exact_kernel Exact_kernel; ^ /CGALtest/include/CGAL/Triangulation_2_filtered_projection_traits_3.h:39:42:错误:“CGAL::Triangulation_2_filtered_projection_traits_3 >::K {aka struct CGAL::Simple_cartesian}”中没有名为“Approximate_kernel”的类型 typedef typename K::Approximate_kernel Approximate_kernel; ^ /CGALtest/include/CGAL/Triangulation_2_filtered_projection_traits_3.h:40:27:错误:'CGAL::Triangulation_2_filtered_projection_traits_3 >::K {aka struct CGAL::Simple_cartesian}'中没有名为'C2E'的类型 typedef typename K::C2E C2E;
...还有很多类似上面的......
加上这个:
/usr/include/c++/4.8/cmath:494:5:注意:模板参数推导/替换失败: ... /usr/include/c++/4.8/cmath:494:5: 错误:‘struct __gnu_cxx::__enable_if’中没有名为‘__type’的类型 在 /home/hamed/workspace/CGALtest/include/CGAL/triangulate_polyhedron.h:32:0 包含的文件中,
任何帮助将不胜感激!
【问题讨论】:
-
供参考,convex_hull_3 的输出已经三角化了