Have you considered providing a func (m *Mesh) ToVoxels(box Box, nx, ny, nz int) []Voxel
where nx, ny, and nz are the number of voxels in the X, Y, and Z directions (enclosed by the provided bounding box)?
That way, a mesh could be voxelized at any desired resolution by subdividing the conversion into smaller boxes and recombining them later.
Have you considered providing a
func (m *Mesh) ToVoxels(box Box, nx, ny, nz int) []Voxelwhere
nx,ny, andnzare the number of voxels in theX,Y, andZdirections (enclosed by the provided boundingbox)?That way, a mesh could be voxelized at any desired resolution by subdividing the conversion into smaller boxes and recombining them later.