title: Javascript Voronoi points from polygons
body: <p>I'm using <a href="https://github.com/gorhill/Javascript-Voronoi" rel="nofollow noreferrer">R. Hill's Voronoi implementation</a> to create polygons using an array of points:</p>
  
  <pre><code>sites=[{x:23, y:33},  {...}] 
  </code></pre>
  
  <p>and also using an array with the canvas size:</p>
  
  <pre><code>box = {xl: 0, xr: 800, yt: 0, yb: 600}
  </code></pre>
  
  <p>Vornoi is generated with:</p>
  
  <pre><code>var diagram = voronoi.compute(sites, bbox);
  </code></pre>
  
  <p>The returned 'diagram' variable is a Javascript object with the following properties:</p>
  
  <pre><code>diagram.edges, diagram.cells, diagram.vertices
  </code></pre>
  
  <p>The object diagram.cells contains multiple cells each with 4 half-edges. Each half-edge has a lSite, rSite, va and vb objects containing x and y values.</p>
  
  <p>However I am interested in obtaining an array of points (x,y) that form each polygon in the voronoi diagram and I have no idea how to do it. </p>
  
  <p>Can anyone help please?</p>