Do clippers in vtk merge or remove duplicate points?

Wondering if using any of the vtk clippers (poly data clipper, generic dataset clippers, table based data set clipper) remove or merge duplicate points?

All of vtkClipPolyData, vtkClipDataSet, and vtkGenericClip use vtkMergePoints internally and they will therefore merge duplicate points. I’m not certain about vtkTableBasedClipDataSet, but I suspect that it also merges duplicate points.

If you need something that does not merge duplicate points, you can try my vtkClipClosedSurface filter, though it has its own set of limitations as described on the linked wiki page.

As a vaguely related aside, some of the newer clip filters (meaning they are threaded) dispense with the locator altogether. This includes vtkPolyDataPlaneClipper and vtkDiscreteFlyingEdgesClipper2D. I’m hoping in the future to remove locators because they tend to be slow and consume a lot of memory, plus they are a bottleneck for threaded computation.

Note also that vtkMergePoints can be replaced by vtkNonMergingPointLocator. This will produce an output consisting of non-merged points - it’s a little faster. Then later if you want to merge the points, you can use vtkCleanPolyData or vtkStaticCleanPolyData (much faster, threaded).

Hey David, Will

Thanks for your responses!

I did look into your vtkClipClosedSurface class and I think it could work but it might not fit my use case.

What I have tried is subclassing vtkPointLocator and overriding the InsertUniquePoint method with a custom one, this doesn’t merge points (which is what I need for now). This seems to work ok, not sure if this is the best solution. Only thing is that there are a lot of ghost points left over from the outside the clipped bounds so I gotta get rid of those in the custom locator class…

Thanks for your help!

  • Waqas

I guess to add a little background, what I intend to do is to export these models to the b3dm format developed by Cesium, which uses gltf internally. What we were thinking of doing was adding these properties on the cellular level (triangles) in the gltf body but not too sure if this is possible (this would be the best solution).