VTK PolyData To ImageData

Dear All,

I am trying to create voxel mesh (*.vtu) from stl geometry; they all form an assembly.
I have 3 stls and each of them are being converted to *.vtu separately but when I am bringing them
all together in multi block data set it shows that the voxel of one component is overlapping with voxel
of other component, which is not the desired result.

I want to create a voxel mesh of assembly with unique cell scalar for each component (stl) but I cant
do it all together in one assembly because VTK can create one scalar cell per polydata.

Please help me on this.

Kind Regards,

You need to use a volumetric mesh generator, such as Cleaver or TetGen.

If you want to experiment with them without writing code, you can try them in 3D Slicer: install 3D Slicer, install Segment Mesher extension, load your STL files into Slicer as segmentation, use Segment mesher module to generate volumetric meshes, save volumetric mesh as .vtu file. You may need to tune mesh generation parameters (e.g., increase scale parameter for Cleaver to get higher-resolution mesh) and regenerate mesh until you are satisfied with mesh quality.

Hi Andras,
Many thanks for your reply. I tried importing stls in 3D slicer as per the instructions you mentioned but I am getting this error message when i click apply button.

Mesh generation using Cleaver is started in working directory: /tmp/Slicer-tarun/SegmentMesher/20190430_130934_055

Error: ‘NoneType’ object has no attribute ‘GetColorNode’

We can help with any Slicer related questions at https://discourse.slicer.org.

Thanks for your reply. I have posted my question there. Please help me