Different results between VTK versions when clipping a PolyData

Hello everyone! This is my first post here.

I am using vtkImplicitPolyDataDistance with clipPolyData, and I am getting different results when using VTK 8.2.0 and VTK 9.2.5. When using the latter I obtain “holes” in my mesh, and I don’t know why. It happens in a few cases with 8.2, but only some triangles are missing, not huge holes as it happens with the 9.2.5 version. What could be causing this?

I uploaded an example of this issue. As you can see, there are no holes in the 8.2 version. The clip was performed in the place shown in the first two figures, with another polydata (used to calculate the implicit distance).




Clipping should never cause holes like that, where entire triangles that are far from the clipping site are removed. And I’ve never heard of such a thing happening when clipping is done with a simple function (e.g. a plane or a sphere), so I wonder if the use of vtkImplicitPolyDataDistance is at the core of the problem. Perhaps there have been some changes that are causing numerical instabilities. You mentioned that you also saw this happening (to a lesser degree) in 8.2, so perhaps the problem already existed but has been made worse by a change in tolerances or in numerical precision somewhere in the code.

Does your data use triangle strips or individual triangles? Since many adjacent triangles are missing, I’m guessing that you use strips. So I suggest passing your data through vtkTriangleFilter before clipping. That will help us ascertain whether strips are somehow involved.

Also, any information that you can give about the data you use as input to vtkImplicitPolyDataDistance would be useful. Is it simply one large polygon, or is it many small polygons? Flat or curved? If you could provide the data and a simple program that demonstrates the missing triangles, then someone here can investigate further.