Is it possible to convert a mesh into a voxel image?

This operation would make white voxels inside the mesh, and black voxels outside the mesh, and would either:

  1. write a standard 3D image file format, or just a raw voxel dump; or
  2. create a stack of 2D images in each axis
  • $\begingroup$ a script would be the better solution but you can use dynamic paint : animate a plane ( the canvas with high dry speed) to go through the mesh ( the brush ) then bake the image sequence $\endgroup$
    – Chebhou
    Jun 29 '15 at 15:58
  • $\begingroup$ I'm fluent in Python but have never made the dive into learning bpy. This is just a once off operation for me, so I'd rather not spend the time scripting. I'll see if I can figure out your dynamic paint suggestion. $\endgroup$
    – ajwood
    Jun 29 '15 at 16:00
  • $\begingroup$ I didn't try, but there is this thread (though OP there asked about .obj, but still maybe some general usage) $\endgroup$
    – Mr Zak
    Jun 29 '15 at 16:03
  • $\begingroup$ @Chebhou the dynamic paint solution worked well. Want me to add it as an answer? $\endgroup$
    – ajwood
    Jun 29 '15 at 16:43
  • $\begingroup$ @ajwood of course, go ahead $\endgroup$
    – Chebhou
    Jun 29 '15 at 16:46

As Chebhou suggested in the comments, the 2D image stack can be achieved with dynamic painting an animated plane.

  1. Add a plane, and animate it to pass through the main mesh

  2. In the physics panel of the main mesh, enable Dynamic Paint and make it a brush

  3. In the physics panel of the plane, enable Dynamic Paint and make it a canvas with these settings:

    • Format: Image Sequence
    • Dry time: 1
    • Dissolve time: 1
  4. In the Dynamic Paint Output panel, click "Bake Image Sequence" to write out the plane/mesh intersection at each frame of the animation.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.