Tag Archives: cargo cult

Joining the Voronoi Cargo Cult

WTF is a cargo cult?

If you are like me, you do not want to become an expert in Meshlab. You do not really care about learning the interface, because you’ve already learned fifty other interfaces and you do not want to be an expert in every Tom-Dick-and-Harry Open Source 3D application.

You want an easy-to-follow, step-by-step, hand-holding process that pretty much guarantees you a Voronoi surface.

You want to join the Voronoi cargo cult.

Voronizing isn’t rocket science, but other tutorials I have seen online have skipped one crucial step that makes it all but impossible for cargo cultists like me to get a Voronized surface out of Meshlab. I beat my head against the wall for hours until I stumbled upon the solution.

Now that my bruises have yellowed and my rage has mellowed, I’ve written my own tutorial at the Voronoi-bloxen inspired request of Seej player, maker, and all around nice guy AndyP.

Ok, here we go.

Step 1: Download, install, and launch Meshlab. It’s free. I’m running Meshlab 1.3.2 on OSX, but I imagine the UI will be mostly the same no matter what OS you’re on.

Step 2: We’re going to Voronize a sphere. Go to Filters->Create New Mesh Layer->Sphere.

Sphere! Woot.

The process of Voronizing involves creating lots of vertices on the target mesh and then creating some voodoo connection between them to make the Voronoi pattern. So first we need more vertices on the sphere.

Step 3: Go to Filters->Remeshing, Simplification, and Reconstruction->Subdivision Surfaces: Loop. I just accepted the defaults. When it’s done, you’ll see that the default sphere looks a lot smoother.

Step 4: Sampling the new vertices. Choose Filters->Sampling->Poission-disk sampling. I have no idea what Poission-disk sampling is, but a value of 250 seems to work for this tutorial. Depending on how many verts you created in Step 3, you’ll adjust this number up and down.

I think this just picks a subset of the group of vertices you just created with the Loop subdivision. Remember: you’re in the cargo cult now. Doesn’t matter why this works.

If you click on the POINTS view icon, you’ll see your points. You can click on the SMOOTH view icon to make the model look solid again.

Step 5: Apply Voronoi Vertex Coloring. This is where the magic happens. Select Filters->Sampling->Voronoi Vertex Coloring and make sure the Back Distance checkbox is checked.

After you click Apply, you should have something Voronoi-ish. We haven’t actually made the holes in the mesh that give shapes their cool Voronoi webbing. All we’ve done is color the sampled vertices.

Step 6: This is the step that took me forever to figure out. I’m sharing my process with you because I hope it will help alleviate my MeshLab post-traumatic stress disorder.

Before you do anything else, you must collapse the mesh layer stack. While you’ve been following these instructions, MeshLab has been quietly building a construction history for your sphere in the background.

If you don’t merge the mesh layers, you’ll be stuck at this step forever.

Click on the LAYERS icon.

This will bring up the Layers sidebar. Right-click on the Poisson-disk Samples layer and choose “Flatten Visible Layers” from the contextual menu. Make sure you click “Apply” in the windoid that pops up.

Step 7: Now you just need to remove the interior faces from the sphere. This is easy. Go to Filters->Selection->Select Faces by Vertex Quality.

What is vertex quality? I don’t care. Cargo cult.

Check the Preview checkbox and fiddle with the sliders until the selection looks the way you want it to. Click apply and then close the selection windoid.

Click the Delete Faces button. It’s on the upper right, just above the layers sidebar. You’ll get a single-sided Voronoi webbed mesh.

Step 8: Refine the mesh. This mesh is a little chunky, but Meshlab has a number of smoothing algorithms. Select Filters->Smoothing, Fairing, and Deformation->Laplacian Smooth, click the Preview checkbox, and smooth the mesh as many times as you like. Click apply and close the windoid.

Step 9: Extrude the mesh. Your sphere is still a one-sided surface with no volume. In theory you can fix that by going to Filters->Remeshing, Simplification, and Reconstruction->Uniform Surface Resampling (Who writes these menu items?) and fiddling with the values until you get a surface with a thickness you like.

Or you can do what I did, and export the single-sided mesh and bring it into Maya, or 3DSMax, or whatever the kids are using these days to extrude their geometry.

Slightly more advanced Voronoi cargo cult behavior

We’ve Voronized a sphere, which is like the “Hello, world” of Voronizing.

BUT. Unless you’ve got a stereolithography printer like the Form1, you’ll be hard pressed to print your sphere on your Replicator or your RepRap without support.

(See this Twitter conversation in which I attempt to dupe Formlabs into printing my Voronoi bloxen, but they don’t, because they are too clever. Or perhaps because they are CHICKEN. bock bock bock @bvicarious is collateral damage in this exchange.)

Besides, you didn’t come here to learn how to Voronize spheres. You want to Voronize something you made or downloaded elsewhere. Something with some detail.

Let’s say you want to apply this process to a model with edges, like a cube. You’ll find yourself stymied after step 3 when the Loop Subdivision turns your cube into a rounded globule.

You’ll need more detail at the edges of your model. I have no idea how to do this in MeshLab, but I can make a cube in Maya pretty fast. Here’s a cube with beveled edges. Download it here if you want to try this yourself.

Import the cube into Meshlab and Loop Subdivide it a few times and you’ll see that the edges stay fairly defined. Go through steps 3-7 as before and you’ll wind up with this:

Welcome to the Voronoi Cargo Cult! We have guavas and beer every Wednesday after work.