I would like to merge two vtkpolydata if it is possible, but I want to know at the end which point comes from which dataset. Also, I want to be sure that BuildLinks() will work and be able to find the correct neighbor points at the end.
I am not sure which is the best approach and if it is feasible.
You could identify each PolyData with a scalar point data array (PolyDataIdx). There might be a filter to do this, I’m not sure there is.
Setup a pipeline with vtkAppendPolyData---->vtkCleanPolyData. Add inputs to Append and Update(). Call BuildLinks() on pipeline’s output after clean up.
Boolean mesh operations in VTK do not work reliably (may provide invalid outputs for completely valid inputs, randomly). vtkBool is supposed to work much better.
Are the polys 2D or 3D? Last I checked, the Boolean filters didn’t work for polydata with 2D cells. Straight up outputs an empty polydata. What I mean is the BooleanOperation filters will work only when your polydata has a surface that encloses some volume.