How to make vtkPolyDataBooleanFilter or CombineModels Faster?

when i use CombineModels Module to Substract Model A to Model B,it may take a long time to do the task , i find that the CPU and Memory usage is not high , is there a way to speed up the process using multi process or other solutions?

vtkPolyDataBooleanFilter does not work - generates wrong output for completely clean, valid, simple inputs - so it is not worth discussing.

CombineModels can be made faster by reducing the number of elements in the meshes. You can use decimation or uniform remesh tools in Surface Toolbox extension for this. In meshes generated by image segmentation, you typically you can remove 90-95% of the mesh points without losing and significant details or having any visible changes in the mesh. After the mesh is properly processed, Boolean operation should not take more than a second.

1 Like

thank you @lassoan ,it’s very helpful
if I want to crop model using small sphere like the picture below


What is your suggestion on how to do this kind of hollowing out work?

You can uniformly remesh the solid plate to get it represented by a few thousand points. Then you can create many tubes using vtkTubeFilter, append them into a single polydata, and subtract from the plate using Combine Models module.

1 Like

thank you @lassoan , it’s a very good solution!

1 Like