[binvox] 3D mesh voxelizer
binvox thinvox viewvox meshconv — binvox wiki
Introductionbinvox 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.
It's a "spin-off" program of software I wrote while a graduate student at Princeton.
- input formats:
- nearly 100% VRML 2.0 support
- will parse Wavefront OBJ, Geomview OFF, Autocad DXF,
PLY and STL, if they contain polygons only
VRML 1.0 support added in version 1.08 (still in alpha) (Unigrafix UG, VTK, XGL, PovRay POV, BREP, and JOT support temporarily disabled, let me know if you really need this)
- output formats:
- runs fast if you have a current graphics card
- rasterizes to a cube grid of up to 512×512×512.
You can support development by buying binvox:
the paid version supports grids up to 4096×4096×4096.
Downloadversion 1.34, added 11 July 2021
- Linux 64 bit executable
compiled under CentOS 7.9, 64-bit, let me know if it doesn't work for you
In the Linux version: you can make binvox render to an offscreen buffer instead of to an onscreen window (if available).
- Mac OS X 10.11.6 executable
compiled under El Capitan, using the Xcode tools
Note that for newer versions of OS X, X11 has disappeared. See below for more info.
- Windows 64 bit executable
compiled using a cross compiler.
UsageRun binvox without parameters for a usage summary.
After installing, run XQuartz, select Applications → Terminal, and work from there, for example:
mv binvox.dms binvox (if Safari renamed the file)
chmod 755 binvox
./binvox <model filename>
CreditsIf 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).
Click here for a BibTeX file with these references. 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. You can support development by buying binvox: the paid version supports grids up to 4096×4096×4096.
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.
- .binvox to .pcd (PCL Point Cloud Data) converter written in C++ by David Butterworth
- reader/writer of .binvox files written in Python by Daniel Maturana
- vxt, a tool for anti-aliased voxelization, by Miloš Šrámek
- reader/writer/visualizer for .binvox files written in Matlab by Anastasia Dubrovina
- .binvox to .stl (mesh) converter written in Python by Mihai Andries
- very fast voxelizer that uses CUDA and writes to the .binvox format, written in C++ by Jeroen Baert
Referencesbinvox 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.
- Volumetric Model Repair for Virtual Reality Applications, by Andreas Kolb and Lars John, Eurographics 2001. They describe an implementation of Nooruddin and Turk's method, and convert the resulting voxel models back to 3D meshes.
- A Fast Depth-Buffer-Based Voxelization Algorithm, by Evaggelia-Aggeliki Karabassi, Georgios Papaioannou and Theoharis Theoharis, Journal of Graphics Tools, vol. 4, nr. 4, 1999. Simple z-buffer based carving (as also supported in binvox), and a surface voxelization method.
- Hardware Accelerated Voxelization, by Shiaofen Fang and Hongsheng Chen, Computers and Graphics, vol. 24, nr. 3, pages 433-442, June 2000.
- Complete Polygonal Scene Voxelization, by D. Haumont and N. Warzèe, Journal of Graphics Tools, vol. 7, nr. 3, pages 27-41, 2002.
- Single-pass GPU solid voxelization for real-time applications, by Elmar Eisemann and Xavier Décoret. They present a very fast method for voxelizing watertight models.
FeedbackPlease 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.
- add -binary flag to force STL binary load (at the moment binvox assumes an STL file is ASCII if it starts with the word "solid")
- add -roty parameter
- option to specify output directory
- support voxelizing to a box with different width, height, and depth
- .schematic writer to support writing of attributes
- document .raw file format, and put dimension in filename
- for exact voxelization, voxelize in stages to enable very high resolutions
- add STEP reader
- write tutorial about voxelizing model with separate components into voxel model with differently "coloured" parts: in general, how to separately voxelize objects so they end up in the same coordinate system
Changelog1.34: fixed bug that caused operations that came after downsampling to break (11 July 2021)
1.33: fixed several bugs related to grid dimensions over 1024 (24 March 2021)
1.32: fixed orientation and alignment issues for the NRRD format (7 March 2021)
1.31: fixed a bug when downsampling large voxel models (19 June 2020)
1.30: compiled a version that does not need the Xmu and Xxf86vm libraries (6 June 2020)
1.29: fixed bug with the -ignore parameter (26 January 2020)
1.28: intermediate version used for testing offscreen rendering (13 July 2019)
1.27: minor text updates (10 May 2019)
1.26: changed .vtk writer voxel ordering to conform to VTK standard (22 October 2017)
1.25: added -swapyz option, to support z, y, x voxel ordering (8 October 2017)
1.24: fix static linking of the lib3ds library under Linux (as done for 1.20)(September 6, 2017)
1.23: fixed bug that caused a crash when loading an .obj file missing a line terminator on the last line (August 20, 2017)
1.22: added -mb parameter for when voxelizing from .obj to .schematic (using the exact method) to specify block IDs in material names (March 6, 2016)
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.