[binvox] 3D mesh voxelizer
binvox thinvox viewvox meshconv
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 1024x1024x1024 (if you have enough memory...)
Downloadversion 1.26, added 22 October 2017
- Linux 64 bit executable
compiled under CentOS 6.7, 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). This increases the maximum dimension of the voxel grid from 1024 to 4096, depending of course on how much memory your system has (the memory use is dominated by the voxel grid, 1 byte per voxel).
- Mac OS X 10.10 executable
compiled under Yosemite, using the Xcode tools
Note that for newer versions of OS X, X11 has disappeared. You'll have to install XQuartz before you can run binvox
- Windows 64 bit executable
compiled using a cross compiler. This executable also runs under Linux using Wine.
- ARM (aarch64) 64 bit executable
compiled under Ubuntu 4.4.38, 64-bit
(thanks to the Link Campus University in Rome for providing an ARM server)
(the binaries have been compressed to about 300K using the UPX executable compressor)(they are self-decompressing)
UsageRun 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:
- 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
- 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)
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.
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
- reader/writer/visualizer for .binvox files written in Matlab by Anastasia Dubrovina
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.
- vxt, by Milos Sramek, is a tool for anti-aliased voxelization.
- 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.