------------------------------------------------------------------------------- binvox Downloaded from http://www.patrickmin.com/binvox/ Binary saved into ~/bin/geom3d 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, typically "binvox" or "minecraft" schematic (stone and air) Input formats: nearly 100% VRML 2.0 support Wavefront OBJ, Geomview OFF, Autocad DXF, PLY and STL, if they contain polygons only VRML 1.0 support added in version 1.08 Unigrafix UG, VTK, XGL, PovRay POV, BREP, and JOT (disabled) Output formats: .binvox, HIPS, MIRA, VTK, a "raw" file format, minecraft .schematic format, Gmsh .msh format, and nrrd format Runs fast if you have a current graphics card Rasterizes to a cube grid of up to 1024x1024x1024 (if you have enough memory...) 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: Use a persistent display server To start a virtual screen, run: Xvfb :99 -screen 0 640x480x24 & export DISPLAY=:99 binvox -pb ... Or one time instance xvfb-run -s "-screen 0 640x480x24" ./binvox -pb my_model.stl (thanks to @vineet7kumar for figuring this out) Example: Convert Skull to a minecraft schematic binvox -cb -d 49 -t schematic skullsolid.stl 49 is the cube the object is fited into and thus the total number of voxels to generate. --- Add -rotx or -rotz to rotate model (so it slices the right way when looked at in viewvox (bee below) WARNING: if both -rotx and -rotz the X rotate is always done first! No -roty option is provided! This means you cannot rotate an object to get correctly orientated slicing! Arrrggghhhh..... --- Two render modes... * If you use solid mode... Binvox finds the voxels visible in each of the 6 orthogonal directions. This means if you have a 'diagonal cave' then the cave will NOT be visible but gets 'filled in'. * If however you render surfaces... The object will be hollow, with walls that may be extra thick! and no clear inside or outside. This means you need to fill in all air, and then use 3D morphology to decide what parts are outside, and what parts are inside the object. ------------------------------------------------------------------------------- viewvox The viewvox program can also be used to generate 'layer' images First generate 'binvox' file binvox -cb -d 49 -rotx -rotx -rotx skullsolid.stl The view using... viewvox skullsolid.binvox Get a 'slice' using keys a y p s Then use j and k keys to move slice up and down. ------------------------------------------------------------------------------- Also see vxt, by Milos Sramek -------------------------------------------------------------------------------