# Pipeline to create Voronoi Meshes

I would like to implement a Maya plugin (this question is independent from Maya) to create 3D Voronoi patterns, Something like

I just know that I have to start from point sampling (I implemented the adaptive poisson sampling algorithm described in this paper).

I thought that, from those points, I should create the 3D wire of the mesh applying Voronoi (I tried to use (Python) scipy.spatial.Voronoi but the result was something different from what I expected).

I am missing something? Can anyone suggest the proper pipeline and algorithms I have to implement to create such patterns?

[EDIT] Here are a few example of what I get handling the result i get from scipy.spatial.Voronoi like this (as suggested here):

vor = Voronoi(points)
for vpair in vor.ridge_vertices:
for i in range(len(vpair) - 1):
if all(x >= 0 for x in vpair):
v0 = vor.vertices[vpair[i]]
v1 = vor.vertices[vpair[i+1]]
create_line(v0.tolist(), v1.tolist())


The grey vertices are the sampled points (the original shape was a simple sphere):

Here is a more complex shape (an arm)

• Thank you for the reply. I am going to replicate what I did and post a screen as suggested. Anyway the final intent of this question isn't to debug my code, but to understand if what I am doing is right or there are others steps that I am missing in between! – Jiloc Oct 20 '15 at 15:55
• added examples as suggested! – Jiloc Oct 21 '15 at 11:38
• The points from the poisson sampling are right. The algorithm that generates them is fully unit tested and the ones you see in the screens are spheres with the center in the sampled point which i programmatically created before calling Voronoi(points)! I am worried that I am not following the proper path or I am handling the Voronoi result in a wrong way – Jiloc Oct 21 '15 at 20:10
• The images you show have done the voronoi on the 2d function. – joojaa Oct 22 '15 at 3:57
• @joojaa From the example images I expected that the Voronoi cell edges on the 2D surface were what was required (to give a collection of line segments connecting points on the sphere surface, rather than the collection of plane sections that would be given in 3D). However, scipy.spatial.Voronoi seems to be designed for N dimensional spaces rather than surfaces embedded in them. I can't immediately see how it would be used for 3D points constrained to a 2D surface. – trichoplax Oct 22 '15 at 10:07