How to convert a surface mesh to voxels?


I have a surface mesh file (.stl) and I was wondering if there exists a filter in Paraview to convert it to volumetric voxels and visualize it?


Could you give some details on the expected results ?

I would like to convert a closed surface mesh (.stl) to vtkImageData or unstructuregrid to have volume rendering, i.e., the inside of surface mesh is rendered as voxels. I am currently looking into implicit model. What is the general approach to solve this problem?

This can be done in VTK with vtkPolyDataToImageStencil. Maybe in paraview you can use a programmable filter to implement vtkPolyDataToImageStencil?

What data do you expect inside the volume ? There will be none.

In any case, to get a vtkImageData use GaussianRessampling, to get a vtkUnstructuredGrid use Delaunay3D.

1 Like