CUDA Mesh Voxelization is a C++/CUDA library and CLI for 3D mesh voxelization, CSG operations, and Signed Distance Field (SDF) computation on the GPU.
The project is designed for benchmarking, visualization, and manipulation of volumetric 3D data, with a particular focus on performance and extensibility.
- Mesh Voxelization: Converts 3D triangle meshes into solid or surface voxel grids.
- CSG Operations: Supports union, intersection, and difference operations between voxelized meshes.
- SDF Calculation: Computes the signed distance field using the Jump Flooding Algorithm (JFA).
- CLI Application: Command-line interface for batch processing and benchmarking.
- Benchmarking: Comparative analysis between sequential, OpenMP, and CUDA implementations.
- Visualization: Exports voxel grids for analysis and plotting.
- Fast Parallel Surface and Solid Voxelization on GPUs by Michael Schwarz and Hans-Peter Seidel (2010)
- Out-of-Core Construction of Sparse Voxel Octrees
- Jump Flooding in GPU with Applications to Voronoi Diagram and Distance Transform
- cxxopts for CLI parsing
- CMake as the build system
- C++: >= C++23
- CUDA Toolkit: >= 12.0
- CMake: >= 3.20
- Compiler: GCC/Clang/MSVC with C++23 support
git clone https://github.com/<your-username>/cuda-mesh-voxelization.git
cd cuda-mesh-voxelization
git submodule update --init --recursive
cmake -S . -B build
cmake --build build --config ReleaseVoxelize a mesh and export the result:
./build/Release/apps/cli/cli assets/bunny.obj -n 128 -e -t 2 -p 1 -sMain options:
-nnumber of voxels per grid side-eenable export-talgorithm type (0 = sequential, 1 = naive, 2 = tiled, 3 = OpenMP)-pCSG operation type (1 = union, 2 = intersection, 3 = difference)-scompute SDF
For all available options:
./build/Release/apps/cli/cli -h![]() |
![]() |
![]() |
|
Stanford Armadillo 64 voxels/side |
Stanford Dragon 256 voxels/side |
Stanford Bunny 128 voxels/side |
![]() |
![]() |
| Armadillo section (128 voxels), colored by SDF value. | CSG section (Bimba ∪ Bunny, 64 voxels), colored by SDF value. |












