Friday, March 27, 2009

Creating Voronoi Sphere


MeshLab is quite useful for a lot of classical mesh processing tasks, but sometimes it can be used for more weird things. A few weeks ago, after stumbling upon the cool Shapeways 3D printing service I uploaded there a few artsy mathematical sculptures that I created with MeshLab. Here is how I did this one, called Voronoi sphere.
It is a double Voronoi diagram, in the sense that there is a coarse Voronoi diagram over the sphere surface but also the surface that creates the edges of this diagram has been carved to create another finer Voronoi diagram. Such a shape is really very light and thin but much more robust that you could imagine.



  1. Start from a sphere (file->new->Sphere),




  2. Refine it using Filter>Remeshing>Loop Subdivision surfaces. repeat without shame (lowering the edge threshold parameter) until it becomes reasonably well tessellated. 300k faces are enough.




  3. Create some well distributed samples over the surface using
    Filter>Sampling>Poisson Disk Sampling. 50 points are a good choice. Apparently the filters does nothing, but if you reveal the layer panel (guess the icon in the toolbar :)), you can see that there are two layers. Make invisible the first layer and switch the rendering mode to points: you will see the well distributed Poisson samples (hint: alt+mouse wheel change the drawn size of the points).


  4. Create the actual Voronoi diagram by simply choosing the filter
    Color>Voronoi Vertex Coloring. As reported in the top of the parameter window, this filter, given a mesh M and a point-set P, project the points of P over M and color each vertex of M according to the geodesic distance from these projected points. Marking the backdistance flag in the parameter window the filter computes the distance from the borders of the Voronoi diagram instead of the projected sites itself. This filter, beside coloring the mesh, writes on each vertex of the mesh the distance value itself, in the all-purpose attribute named 'quality'.



  5. Make the mesh layer active, and start the Select by vertex Quality filter. enable the preview option and enable visualization of selected faces. Play with the slider until you get something similar to the image on the right; in practice, exploiting the quality value stored onto the vertices that code the distance from the border of the Voronoi diagram we have just selected the faces very near to these borders.





  6. Apply the Filter>Selection>Invert Selection and then delete the selected faces. Edges are probably quite jaggy, so apply a couple of times the simplest of all the smoothing filter, the old classical laplacian filter (Filter>Smoothing>Laplacian Smoothing).

Now stop and save the mesh. Next post will show you how to continue by transforming the current mesh, that is a surface, into a solid object ready to be printed. In the meantime if you like the sculpture, you can buy a small (10 cm) and cheap (less than 20$) copy of this sculpture here.

10 comments:

Chad said...

Great information! I just discovered this site (have been using meshlab for a couple months); I now have quite a backlog of articles to read...which is a good thing. The ambient occlusion to remove interior polys should prove super useful. Thanks!

TastyPaper said...

I like the final model in your tutorial, any chance of uploading that to Shapeways? :) I'm a huge Voronoi pattern/shape fan. Keep it up!

froland said...

Great tutorial, thanks! How about the 3D qhull filters in meshlab? They repeatably crash on my windows machine. Could you give me a hint on how to use them? Thanks!

tomot said...

What a disaster! I upgraded from the last beta to the newer v1.2.3 (Apr 30 2010) Most of the remeshing algorithms don't work, and now the one that actually did work, is missing.

What happened to "Loop Subdivision surfaces" ?

And like an Idiot, I deleted the beta. I should have known better.

Rick said...
This comment has been removed by a blog administrator.
Josh said...

I'd like to recommend the blog, buy I can't do it, because you're forgetting something in the blogroll... I'm talking about Generic Viagra for bloggers. You must be try on it.

J. Siefer said...

I realize this is a pretty old post, but I just came across it, and am currently trying to follow it with the new version of Meshlab that just came out. Some of the things just aren't lining up. Is there any chance that you might be able to revise it to match? Any help would be TREMENDOUSLY appreciated.

Thank you so much!

Sergio said...

Hello,
I would love to create such a voronoi sphere. Unfortunately following the steps on my new iMac, the software always crashes... Any help would be apreciated.
Sergio

deskwarrior said...
This comment has been removed by the author.
deskwarrior said...

With version 1.3.2 (the latest) I can't get this to work. It works (with adjustments for moved menu items) as far as the coloring step, and the coloring shows, but the next step is impossible - select by quality, select by color, transfer color vertex to face, all of these fail because it claims the mesh does not have the particular property. I'm pretty sure it has 'vertex color' because that's an available render mode. Will file a bug report.