title: Generating a Voronoi Diagram around 2D Polygons
body: <p>I'm trying to create a Voronoi diagram around 2D holes (preferably in PyGame or scipy, but not necessary) and save the edges. It should look something like this: <a href="https://i.stack.imgur.com/SNFiF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SNFiF.jpg" alt="enter image description here"></a></p>
  
  <p>I have been able to use <a href="https://scipy.github.io/devdocs/generated/scipy.spatial.Voronoi.html" rel="nofollow noreferrer">scipy's Voronoi</a> to generate a diagram around points, but I'm not sure how to proceed with 2D obstacles.</p>
  
  <p>My code for working with points is:</p>
  
  <pre><code>self.vor = Voronoi(POINTS)
  
  # iterate over voronoi graph and save edges
  for vpair in self.vor.ridge_vertices:
      if vpair[0] &gt;= 0 and vpair[1] &gt;= 0:
          # vertices
          v0 = self.vor.vertices[vpair[0]]
          v1 = self.vor.vertices[vpair[1]]
  
          # edge endpoints
          start_point = (v0[0], v0[1])  # start point
          end_point = (v1[0], v1[1])
  </code></pre>
  
  <p>Basically, I want to input 2D obstacles (which could also be adjacent/touching so as to form a larger obstacle) and generate a set of lines which are equidistant from those obstacles.</p>