[binvox]   3D mesh voxelizer

binvox     thinvox     viewvox     meshconv    


binvox is a straight-forward program that reads a 3D model file, rasterizes it into a binary 3D voxel grid, and writes the resulting voxel file.



version 1.22, added 6 March 2016

(the binaries have been compressed to about 300K using the UPX executable compressor)(they are self-decompressing)


Run binvox without parameters for a usage summary.

Normally you'd run binvox on your own PC, where it will use your installed graphics card.

To run binvox on a headless server instead, either:

  1. use a persistent display server
    To start a virtual screen, run:
    Xvfb :99 -screen 0 640x480x24 &
    setenv DISPLAY :99 (or, if you're running bash, do: export DISPLAY=:99)
    Then run binvox with the -pb option
  2. use a one time display server instance
    xvfb-run -s "-screen 0 640x480x24" ./binvox -pb my_model.stl

(thanks to @vineet7kumar for figuring this out)


If you use binvox for your (published) work, please add a reference to me, to this site (as a link, you could use http://www.google.com/search?q=binvox), and to the paper by F. Nooruddin and G. Turk (see next paragraph). Unfortunately I've already seen one recent scientific paper using my software without proper credit. I'd love to hear what you use binvox for as well.

Note that binvox is free to download and use (in any environment). However, you are not allowed to charge others for the program. Type binvox -license for more information.

Eric Haines contributed the code for the exact voxelization method.

Qingnan Zhou wrote the code for the Gmsh .msh output.

binvox uses the lib3ds library for reading .3ds files.

Related Software


binvox uses the parity count method and (a slight variation of) the ray stabbing method described by Fakir Nooruddin and Greg Turk in Simplification and Repair of Polygonal Models Using Volumetric Techniques, GVU technical report 99-37 (later published in IEEE Trans. on Visualization and Computer Graphics, vol. 9, nr. 2, April 2003, pages 191-205). To speed up the parity counting, a hardware z-buffer "slicing" method is used, based on an idea originally by Emil Praun.

Other references:


Please send me e-mail (to patrick.n.min at gmail dot com) with your questions/comments/suggestions/bug reports. I'm also interested to hear about what you use binvox for.

Note that because of differences in hardware and software (drivers, the OpenGL implementation on your OS, etc.) the resulting voxel model will probably differ slightly from one setup to another.

Feature requests


1.22: added -mb parameter for when voxelizing from .obj to .schematic (using the exact method) to specify block IDs in material names
1.21: Windows 64 bit version
1.20: static linking of the lib3ds library
1.19: added support for .3ds files, thanks to the lib3ds library
1.18: fixed dimension ordering issue with .vtk output
1.17: fixed bug with -e method for triangles completely at max x/y/z
1.16: added support for writing .nrrd files
1.15: many fixes for large size (dimension > 1290) voxelizations (many thanks to Michelle Heller for debugging help)
1.14: Linux only: print information about maximum pbuffer size
1.13: added mesh memory usage info
1.12: added -ary parameter (for arbitary rotation around the y-axis)
1.11: fixed odd Windows-only memory allocation bug. Improved some error messages
1.10: fixed bug with -rotz parameter
1.09: fixed bug that limited voxel dimension to 1290
1.08: fixed hang on OBJ files with unterminated last line. Added VRML 1.0 support (still in alpha)
1.07: added support for writing Gmsh .msh files, code written by Qingnan Zhou
1.06: fixed handling of groups with empty names in OBJ files
1.05: use OpenGL custom clip planes for the -bb parameter (original implementation was buggy)
1.04: voxelizing inside entire unit cube now, to fix symmetry issues
1.03: bugfix for the .obj reader
1.02: bugfix for -e option in combination with fix for dimensions below the Windows minimum window size bug
1.01: bugfix for the -e option (triangles were voxelized too thick)
1.0: bumped version number to 1.0 :-). Workaround for Windows minimum window size bug. -aw re-enabled. Exact voxelization option -e added (written by Eric Haines, using triangle overlap code by Tomas Akenine-Möller)
0.48: carve voxelization rendering bug fix. -aw temporarily disabled.
0.47: added support for negative vertex indices in .obj files
0.46: added -bi parameter, for specifying .schematic block ID, fixed voxel ordering for .schematic files
0.45: fix for bug when using -fit together with -t schematic
0.44: support for writing of minecraft .schematic files. For doing the gzip compression, binvox uses the zlib library, version 1.2.5, © 1995-2010 Jean-loup Gailly and Mark Adler
0.43: -fit option, which crops the voxel model to its bounding box
0.42: the voxel bounding box (i.e. the filled area) is printed
0.41: added -aw option ("add wireframe"), which also renders the model in wireframe (useful for thin parts), and -dc option ("dilated carving") which stops carving in each direction 1 voxel before the intersection point.
0.4: added -rotx and -rotz options, to rotate object before voxelizing (useful for changing the up axis).
0.38: a bug fix of the .obj file reader.
0.37: the -bb parameter, which allows you to force a specific bounding box for the mesh.
0.35: the PLY reading code from the PLY tools was modified slightly to be able to handle Unix/Windows differences.

Patrick Min
Last modified: Tue Feb 7 18:04:46 CET 2017