title: Wrapping Voronoi Diagram
body: <p>I'm working on creating a procedurally generated fantasy-style map using the cells of a Voronoi diagram to determine terrain. </p>
  
  <p>During the tectonic plate generation I realized that it's really important to have wrapping edges during generation to prevent plates from spreading against the edges of the map. On subsequent seeds, without border wrapping, the logic of the map goes out the window.</p>
  
  <p><strong>Tectonic Plates</strong>: No wrapping, plate borders indicated by black dots...
  <img src="https://i.stack.imgur.com/8JXn3.png" /></p>
  
  <p>Part of determining the plates is identifying 70% of the world's area as "oceanic" and the other 30% as "continental". </p>
  
  <p>Basically: <br>
  The borders of the map don't have to wrap as long as they can be thematically incorporated.</p>
  
  <p>I've thought about adding predefined uniform points all around the edge and forcibly linking them to each other, but there has to be a better way. I've stripped out the border points because they don't link up well with their neighbors in the library I'm using.</p>
  
  <p><a href="http://nodename.github.io/as3delaunay/" rel="nofollow noreferrer">Library I'm using</a></p>
  
  <p><a href="https://github.com/olinkirkland/Worlds/blob/master/src/Map.as" rel="nofollow noreferrer">My code repository</a> Specifically, the <code>makePoints()</code> function @line 236</p>
  
  <p>I'm using <strong>Poisson Disk Sampling</strong> to generate the points.  I'm programming in AS3 but I'm fine with answers in any programming language or pseudo code.</p>
  
  <p><strong>Question</strong>: <br>
  How do I wrap the Voronoi diagram so the cells at the bottom refer to the cells on the top and the cells on the left refer to the cells on the right (and vice versa)?</p>
  
  <p>Edit:
  The desired result would be an image similar to this one of the real world's tectonic plates. See how the plates lap over the sides of the map? That's what I'm going for, though only East/West.</p>
  
  <p><a href="https://i.stack.imgur.com/ua90f.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ua90f.gif" alt="Real World Tectonic Plates"></a></p>