Tuesday, April 7, 2009

Creating Voronoi Sphere (2)

Second part of the description of how this voronoi sphere was created.

At the end of the previous post we ended with a thin surface representing a sphere holed with a voronoi pattern.

  1. convert the paper-thin surface to a solid structure.
    This can be done by exploiting the offsetting capabilities of MeshLab. The filter "Remeshing->Uniform Mesh Resampling". In this filter a mesh is re-sampled by building a uniform distance-field volumetric representation where each voxel contains the signed distance from the original surface. The surface is then reconstructed using the marching cube algorithm over this volume. Resolution of the volume obviously affects the resolution (and the processing time!) of the final mesh. The distance field representation allows to easily create offset surfaces. There are various options for building offset surfaces, I will discuss them deeply in another post, for now just set the "Precision" parameter to 1.0%, and the offset value to 53.0% and check the "Absolute Distance" flag. After a few tens of secs you should get something like the side figure.

  2. simplify a bit to get rid of the bad triangulation quality of a Marching Cube (there are a lot of thin bad shaped triangles around), a percentage reduction of .75 is usually enough to both reduce a bit the size of the mesh and to improve its quality without affecting in a significant way the precision of the result.

  3. Apply a few times the Filter Remeshing->Curvature flipping optimization, that improves how the triangles adapt to the shape of the curvature without increasing their number.

  4. Refine and smooth up to a mesh of approx 1.000.000 triangles.
    A rather overtessellated mesh is needed here to guarantee a good approximation of the geodesic distance.

  5. At this point we repeat no this dense mesh the same steps we did on the original sphere. E.g. all the steps described in the previous post:

    1. Generate 1000 poisson samples over the surface (it takes a bit of time this time...)

    2. Color the mesh according to the back distance from these samples (voronoi coloring filter)

    3. select the faces with quality in the range 0..epsilon

    4. invert selection and delete

    5. offset the thin surface to convert it into a watertight solid object. This final offsetting obviously require an higher precision (and higher processing times).

    6. Some iteration of simplify-optimize-refine-smooth just to beautify the final mesh.

And that's all! Varying a bit the parameters in the middle of the whole process greatly affect the final result. For example you can easily get a fat donut style by increasing the offsetting value. Below a high res snap done with meshlab with ambient occlusion, and thin antialiased wire frame lines. A real, touchable 3D print of the object can be obtained on Shapeways.