Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/liu115/mesh2color_voxel

This is a tool for voxelizing ply mesh with color informations.
https://github.com/liu115/mesh2color_voxel

3d computational-geometry mesh voxel

Last synced: 4 months ago
JSON representation

This is a tool for voxelizing ply mesh with color informations.

Awesome Lists containing this project

README

        

# Convert Mesh to Color Voxel

Take `.ply` mesh format as input, convert it into voxel with color (rgba).

## Requirement

- c++11: for the package **tinyply**.
- numpy

## Usage

### Take the largest face inside the cube (voxel) to represent to color.
```
make MAX
./mesh2vox_max [input ply file] // output file is .dat
```
### Take weighted mean (by area size of faces) for the color of the voxel.
```
make MEAN
./mesh2vox_mean [input ply file] // output file is .dat
```
### Visualization

```
python3 read_buffer.py // generate .ply point cloud for visualization
```
Use tools like meshlab to open the `.ply` file.

## References

- 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