I'm trying to work with voxels. I have a closed mesh object, but here I'll use the supplied example mesh. What I would like to do is convert the mesh to a filled voxel grid.
The below code takes a mesh and turns it into a voxel grid using pyvista, however internally the voxel grid is hollow.
import numpy as np
import pyvista as pv
from pyvista import examples
# Load a surface to voxelize
surface = examples.download_foot_bones()
surface
voxels = pv.voxelize(surface, density=surface.length / 500)
voxels.plot(opacity=1.00)
Is there a way to fill the internal hollows with cells? If not I assume there would be a numpy way to fill in the array and then convert that to a filled voxel grid?