Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I derive a Voronoi diagram given its point set and its Delaunay triangulation?

I'm working on a game where I create a random map of provinces (a la Risk or Diplomacy). To create that map, I'm first generating a series of semi-random points, then figuring the Delaunay triangulations of those points.

With that done, I am now looking to create a Voronoi diagram of the points to serve as a starting point for the province borders. My data at this point (no pun intended) consists of the original series of points and a collection of the Delaunay triangles.

I've seen a number of ways to do this on the web, but most of them are tied up with how the Delaunay was derived. I'd love to find something that doesn't need to be integrated to the Delaunay, but can work based off the data alone. Failing that, I'm looking for something comprehensible to a relative geometry newbie, as opposed to optimal speed. Thanks!

like image 406
CommanderTso Avatar asked Sep 17 '08 16:09

CommanderTso


People also ask

How does a Delaunay triangulation relate to a Voronoi diagram?

The red vertices and edges are the Voronoi diagram. The black points and edges are the Delaunay triangulation. The Delaunay triangulation only involves edges between existing points, while the Voronoi diagram creates new vertices and needs a way to represent edges going infinitely in one direction.

How do I get from Delaunay to Voronoi?

The Voronoi diagram is just the dual graph of the Delaunay triangulation. So, the edges of the Voronoi diagram are along the perpendicular bisectors of the edges of the Delaunay triangulation, so compute those lines. Then, compute the vertices of the Voronoi diagram by finding the intersections of adjacent edges.

How do you find the Voronoi diagram?

We start by joining each pair of vertices by a line. We then draw the perpendicular bisectors to each of these lines. These three bisectors must intersect, since any three points in the plane define a circle. We then remove the portions of each line beyond the intersection and the diagram is complete.

What is the Voronoi diagram for a set of three points?

 The set with three or more nearest neighbors make up the vertices of the diagram. The points �� are called the sites of the Voronoi diagram. The three bisectors intersect at a point The intersection can be outside the triangle. The point of intersection is center of the circle passing through the three points.


1 Answers

The Voronoi diagram is just the dual graph of the Delaunay triangulation.

  • So, the edges of the Voronoi diagram are along the perpendicular bisectors of the edges of the Delaunay triangulation, so compute those lines.
  • Then, compute the vertices of the Voronoi diagram by finding the intersections of adjacent edges.
  • Finally, the edges are then the subsets of the lines you computed which lie between the corresponding vertices.

Note that the exact code depends on the internal representation you're using for the two diagrams.

like image 142
Adam Rosenfield Avatar answered Nov 23 '22 22:11

Adam Rosenfield