Expand description
GPU voxel grid operations (CPU mock implementation).
Provides a binary occupancy grid and a Signed Distance Field (SDF) built from it, plus morphological dilation/erosion and a marching-cubes triangle count estimate. All routines are CPU references for the GPU backend.
Structs§
- GpuVoxel
Grid - A 3-D voxel grid storing binary occupancy and an SDF.
Functions§
- gpu_
march_ cubes_ count - Count the estimated number of triangles that would be produced by marching cubes on the current occupancy field.
- gpu_
sdf_ from_ voxels - Compute an approximate SDF from the binary occupancy grid using BFS.
- gpu_
voxel_ dilate - Morphological dilation: mark a voxel as occupied if any 6-connected neighbour is occupied.
- gpu_
voxel_ erode - Morphological erosion: clear a voxel if any 6-connected neighbour is empty.
- gpu_
voxelize_ mesh - Rasterize a triangle soup into the voxel grid.