I want to extract edge points (points lie on an edge of the boundary of the convex hull) using Voronoi diagram. I know that an unbounded cell contains a boundary site point, but how can I access to that information using iterators?
Solution
VD vd;
//initialise your voronoi diagram
VD::Face_iterator it = vd.faces_begin(), beyond = vd.faces_end();
for (int f = 0; it != beyond; ++f, ++it)
{
std::cout << "Face " << f << ": \n";
if (it->is_unbounded())
{
// it's a boundary point
}
}
Read CGAL 2D Delaunay Triangulation: How to get edges as vertex id pairs, and having in mind the relation between Voronoi and Delaunay check this example:
If this doesn't answer your question, then get inspired by it and play around.