I have spent a great deal of time now trying to obtain edges from the scipy.spatial.Voronoi diagram to no avail. Here is the main documentation: http://docs.scipy.org/doc/scipy-dev/reference/generated/scipy.spatial.Voronoi.html
If you create a Voronoi Diagram like so:
points = np.array([[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2],
[2, 0], [2, 1], [2, 2]]) //Or feel free to use any set of points
then you have access to the following object properties:
vor.regions
vor.max_bound
vor.ndim
vor.ridge_dict
vor.ridge_points
vor.ridge_vertices
vor.npoints
vor.point_region
vor.points
But is unclear how to combine these to get edges in the form (point1, point2) for 2d voronoi diagrams? I know edges exist because you can plot the voronoi diagram and its edgres and vertices because you can do the following:
voronoi_plot_2d(vor)
plt.show()
which clearly depicts voronoi edgres - how to get a list of them and their starting and endpoints? Its okay if I only get the solid edges (not the dotted ones which go unbounded off the plot)
vor.ridge_vertices
provides the indices into thevor.vertices
array to get the edges. – cgnorthcutt