Home

Awesome

svo_tools

This repository contains tools for working with the SVO file format, the format used in the alpha-stage virtual world developed by Hifi (Hifi repo).

Currently, this repository contains:

All methods are based on Out-of-core Sparse Voxel Octree Builder. Still very much in active development.

Binaries

I put up some precompiled binaries for Windows, Linux and OSX on the releases page

svo_convert

svo_convert Building

The only dependencies for building is TriMesh2 (used for model file I/O). The Trimesh2 distribution comes with pre-built binaries for all platforms, so just go ahead and download it, and unzip it to a location you remember. OpenMP support is optional, and is disabled for OSX.

Windows

Build using src/svo_tools/svo_tools.sln VS2012 on Win 64-bit. 32-bit building is not encouraged, but should work. You can grab a free version of Visual Studio Express here. The TriMesh2 libraries are built against MinGW, so when you're using the VS compiler, you have to rebuild the TriMesh2 library. This can be easily done using the MSVC project here.

Linux

Build using gcc and cmake. Make sure you specify the environment variable TRIMESH2_ROOT.

A typical compile on Linux would go like this:

<pre> git clone https://github.com/Forceflow/svo_tools export TRIMESH2_ROOT=/home/jeroen/development/trimesh2/ cd svo_tools cmake . make </pre>

OSX

We'll be using some tools which are available in the Apple-provided Command Line Tools for Xcode, which can be downloaded from within Xcode (like described [here](http://stackoverflow.com/questions/9353444/how-to-use-install-gcc-on-mac-os-x-10-8-xcode-4-4 here)) or as a stand-alone download.

Compiling TriMesh2 with clang

In order to be able to use TriMesh2 with the default Apple clang compiler, we have to recompile the GCC-built binaries that came with it. To do this, we have to disable OpenMP support, because clang doesn't have it.

The following steps are required:

This should recompile TriMesh2 with clang. If you cannot complete the steps in this paragraph, I've prepared a clang-compiled TriMesh2 version for download here.

Compiling

The only thing left to do is to set the TRIMESH2_ROOT environment variable to point to your local TriMesh2 folder.

A typical compile on OSX would go like this:

<pre> git clone https://github.com/Forceflow/svo_tools export TRIMESH2_ROOT=/Users/jeroen/development/trimesh2/ cd svo_tools cmake . make </pre>

svo_convert Usage

<pre> svo_convert -f /path/to/file.ply -s (gridsize) -c (color mode) </pre>

Full option list:

svo_convert Examples

<pre> svo_convert -f /home/jeroen/models/bunny.ply -s 512 </pre>

Will generate a file named bunny.svo in the same folder, with an SVO of gridsize 512x512x512. It will use the default color mode, trying to fetch colors from the vertices, and failing that, will color the model white.

<pre> svo_convert -f /home/jeroen/models/horse.ply -s 256 -c normal </pre>

Will generate a file named horse.svo in the same folder, with an SVO of gridsize 256x256x256. It will use the normal-based color mode, in which each voxel gets colored according to the mesh face normal.

#octree2svo

octree2svo Building

Dependencies for building are Trimesh2 and OpenMP support. You can specify the location of the Trimesh2 library in both the VS solution file and the linux build script.

octree2svo Usage

Full option list:

octree2svo Examples

So the full pipeline (including tools from ooc_svo_builder) to get from a model file in .ply, obj or .3ds format to an .svo file might look like this if you want a bunny with fixed colors:

And if you want a bunny with voxel colors from the sampled normals:

Each of these tools has more configuration options, please refer to the documentation.