Voxel Filling a Mesh

Voxel Filling a Mesh

A colleague asked me about a basic voxelizing script he had run across.  (Voxels are the 3-d equivalent of pixels — building blocks of a larger shape).  It was rudimentary, but it got the job done most of the time.  It made good use of the MFnMesh::allIntersections to determine where voxels should go on the surface.

Then we started discussing ways to fill a mesh shape with voxels instead of just putting voxels on the surface of the shape, which is what they’re usually used for.  I’ve been modifying the original script to create the surface voxels, then walk to their “inside” neighborhood to get a layer of voxels that are all inside the mesh surface.  This seems to work fairly well.  When I do this with multiple sizes of voxel blocks, I get a nifty filling of the mesh

bunny_blocks_v3.01 bunny_blocks_v3.02 bunny_blocks_v3.03 bunny_blocks_v3.04 bunny_blocks_v3.05 bunny_blocks_v3.06

 

And a wallpaper 1920×1080

bunny_blocksBW1920.3

Leave a reply