Take .ply
mesh format as input, convert it into voxel with color (rgba).
- c++11: for the package tinyply.
- numpy
make MAX
./mesh2vox_max [input ply file] // output file is .dat
make MEAN
./mesh2vox_mean [input ply file] // output file is .dat
python3 read_buffer.py // generate .ply point cloud for visualization
Use tools like meshlab to open the .ply
file.
- tinyply: https://github.com/ddiakopoulos/tinyply
- 3d polygon area: http://geomalgorithms.com/a01-_area.html
- triangle test: http://blackpawn.com/texts/pointinpoly/
- triangle cube intersect test: http://www.realtimerendering.com/resources/GraphicsGems/gemsiii/triangleCube.c