2

ポイントを使用して平面を作成し、交点をとって多面体を形成し、それらの多面体を使用してネフ多面体を構築しています。およそ 2500 の多面体のうち、1 つがセグメンテーション違反を引き起こしているようです。

同じ入力を使用したレプリケーションを次に示します。

#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);
}
4

0 に答える 0