I've just started playing with Nef polyhedrons on the plane - the simple program below creates a halfplane, defined by a line y=0, and then this halfplane is explored by the CGAL Explorer.
#include <iostream>
#include <CGAL/Exact_integer.h>
#include <CGAL/Extended_cartesian.h>
#include <CGAL/Nef_polyhedron_2.h>
using Kernel = CGAL::Extended_cartesian<CGAL::Exact_integer>;
using Polyhedron = CGAL::Nef_polyhedron_2<Kernel>;
using Line = Polyhedron::Line;
using std::cout;
using std::endl;
int main()
{
const Polyhedron p(Line(0, 1, 0), Polyhedron::INCLUDED);
const auto ex = p.explorer();
for (auto it = ex.vertices_begin(); it != ex.vertices_end(); ++it)
{
if (ex.is_standard(it))
{
cout << "Point: " << ex.point(it) << endl;
}
else
{
cout << "Ray: " << ex.ray(it) << endl;
}
}
}
The program output:
Ray: 0 0 -1 -1
Ray: 0 0 -1 0
Ray: 0 0 -1 1
Ray: 0 0 1 -1
Ray: 0 0 1 0
Ray: 0 0 1 1
Why these six rays?
