CGAL Nef多面体在从多面体创建时导致段错误

时间:2016-10-19 02:40:06

标签: c++ computational-geometry cgal polyhedra

我正在使用点来创建平面,然后使用交点形成多面体,并使用这些多面体来构造nef多面体。在我的大约2500个多面体中,一个似乎导致了一个段落错误。

这是具有相同输入的复制:

#include <iostream>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Convex_hull_3/dual/halfspace_intersection_3.h>
#include <CGAL/Nef_polyhedron_3.h>

typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef K::Plane_3 Plane_3;
typedef K::Point_3 Point_3;
typedef CGAL::Polyhedron_3<K> Polyhedron_3;
typedef CGAL::Nef_polyhedron_3<K> Nef_polyhedron;

int main()
{

    Plane_3 planes[5];


    planes[0] = Plane_3(Point_3(-1024, 1192, -80),
                        Point_3(-1024, 1192, -88),
                        Point_3(-1152, 1216, -88));

    planes[1] = Plane_3(Point_3(-1152, 1216, -88),
                        Point_3(-1152, 1200, -88),
                        Point_3(-1152, 1200, -80));

    planes[2] = Plane_3(Point_3(-1024, 1192, -88),
                        Point_3(-1152, 1200, -88),
                        Point_3(-1152, 1216, -88));

    planes[3] = Plane_3(Point_3(-1024, 1192, -80),
                        Point_3(-1152, 1200, -80),
                        Point_3(-1024, 1192, -88));

    planes[4] = Plane_3(Point_3(-1152, 1216, -88),
                        Point_3(-1152, 1200, -80),
                        Point_3(-1024, 1192, -80));


    CGAL::halfspace_intersection_3(std::begin(planes), std::end(planes), P);
    assert(P.is_closed());

    for (Polyhedron_3::Point_iterator pIt = P.points_begin(); pIt != P.points_end(); ++pIt)
    {
        std::cout << *pIt << std::endl;
    }

    std::cout << '\n';

    Nef_polyhedron newNef(P);
}

0 个答案:

没有答案