Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/liu115/mesh2color_voxel
- Owner: liu115
- Created: 2018-05-10T02:45:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-07T02:58:55.000Z (over 6 years ago)
- Last Synced: 2024-08-01T03:22:25.014Z (7 months ago)
- Topics: 3d, computational-geometry, mesh, voxel
- Language: C++
- Homepage:
- Size: 72.3 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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