perfume-dev/VoxelEditor — pull request #1 by yllan (2014-09-20 06:23:25+00:00)
Title: Import OBJ file

![Screen Capture](http://f.cl.ly/items/0N2R2e1u1h3d0V2y0n3q/VoxelEditor.gif)

## Abstract
Add `*.obj` file import ability. It voxelizes the `*.obj` file with `*.mtl` textures. The voxelization algorithm is basically the same as my three.js [voxelizer](https://github.com/yllan/voxelizer), which was explained in the slide: [Incarnation: Turning Real World Objects into Perfume World](http://www.slideshare.net/yungluen/incarnation-turning-real-world-objects-into-perfume-world). The only difference is: with the speed of C++, I could actually check if each voxel has intersection with a given triangle face.

## Dependencies
- [ofxAssimpModelLoader](https://github.com/jeremyabel/ofxAssimpModelLoader)
- Routine to check if a triangle has intersection with a box from [Tomas_Akenine-Möller](http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/code/tribox3.txt).

## Example OBJ File
- [Perfume 3D scan data](http://wt2.perfume-global.com/)
- [Laocoon Figure](http://cl.ly/3b1v3w3P3013)

## Hack
[`assimp`](https://github.com/assimp/assimp) seems have a bug that will crash while parsing `obj` file without a newline at the last line (The Perfume 3D scan data don't have the last newline). To workaround this, it appends a newline to a copy of the original `obj` file.