Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/karimnaaji/voxelizer
Header only mesh voxelizer in c99
https://github.com/karimnaaji/voxelizer
c99 computer-graphics geometry-processing voxelizer
Last synced: about 2 months ago
JSON representation
Header only mesh voxelizer in c99
- Host: GitHub
- URL: https://github.com/karimnaaji/voxelizer
- Owner: karimnaaji
- Created: 2016-01-05T16:18:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-03T20:52:52.000Z (over 2 years ago)
- Last Synced: 2024-01-11T17:46:39.401Z (6 months ago)
- Topics: c99, computer-graphics, geometry-processing, voxelizer
- Language: C
- Homepage: http://karim.naaji.fr/voxelizer.html
- Size: 2.27 MB
- Stars: 603
- Watchers: 31
- Forks: 62
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Lists
- awesome-hpp - voxelizer
- awesome-voxel - Voxelizer
- awesome-stars - karimnaaji/voxelizer - Header only mesh voxelizer in c99 (C)
README
# Mesh voxelizer
_Header only mesh voxelizer in ANSI C_![](images/capture.png)
**About**
Converts meshes and performs triangle-cube intersection to output a voxelized mesh.
**How to use**
Include the header only file as following once:
```c
#define VOXELIZER_IMPLEMENTATION
#include "voxelizer.h"
```To generate a voxelized mesh, create an instance of `vx_mesh_t` and initialize its
vertices and indices like this:```c
vx_mesh_t* mesh;
vx_mesh_t* result;mesh = vx_mesh_alloc(nvertices, nindices);
// Add vertices and indices from the original mesh you want to voxelize
// [...]// Precision factor to reduce "holes" artifact
float precision = 0.01;// Run voxelization
result = vx_voxelize(mesh, 0.025, 0.025, 0.025, precision);vx_mesh_free(result);
vx_mesh_free(mesh);
```