Skip to main content

Module gpu_voxel

Module gpu_voxel 

Source
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§

GpuVoxelGrid
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.