I am trying to partition a space into a set of polygons, where each polygon is approximately a voroni cell for one of a set of input points.
I was trying to use Boost::Voroni for this purpose, but the output of use of this library is complicated, requiring a lot of extra effort to get what I want.
I was wondering if anyone knows the best way to get what I want out of a BOOST::voroni diagram, or if someone knows of a simpler library than can get me what I'm looking for directly?
Here is some code showing what I am trying to do,
voronoi_diagram< float > vd;
construct_voronoi( gridPointPos.begin(), gridPointPos.end(), &vd );
int index = 0;
for (voronoi_diagram<float>::const_cell_iterator it = vd.cells().begin();
it != vd.cells().end(); ++it, ++index ) {
// if the voroni cell has infinite edges,
// then clip them to a finite length
// extract the voroni vertices of this cell
// create a boost polygon from the extracted edges
}
Because boost is overly general and complicated for my needs, I would prefer a library or algorithm that simply does all of this, returning only sets of polygons. What are my options?
You can try my implementation of the bowyer-watson incremental algorithm for a delaunay triangulation in PHP it also finds the voronoi diagram. You can download it at codeplex.com (http://voronoi.codeplex.com/).