multiple polylines after vtkStripper

#1

I’m using vtkCutter followed by vtkStripper to get the intersection of a mesh with a plane, and it always returns multiple segments. I can easily ignore the very tiny ones (1-3 points), but sometimes it produces longer polylines, like in this image:
stripper
The blue and green segments are clearly contiguous (in fact there are bigger gaps in the green one), so why isn’t the stripper returning a single segment? Are there any settings that I can change in vtkStripper? And if the issue is the mesh, is there any preprocessing that I could apply to avoid the problem?
If it is any help, the green segment is in an area where I have applied vtkClipClosedSurface.

#2

I upgraded to vtk 8.9 (from 6.2, which is the version that ubuntu 16.04 installs), so now there is an option JoinContiguousSegments, but even with it enabled, I still get 2 segments.

(Andras Lasso) #3

Increasing MaximumLength may help, but for correct intersection computation (especially if you need to know what is inside and outside) you probably need to replace vtkStripper by vtkContourTriangulator.