vtkStripper does not join contiguous segments

Not to confuse with this (This is not an issue of duplicate points.)

vtkStripper does not join contiguous segments when more than 2 polylines are chained.
Most of the polylines can be joined, but they’re not.
Reality:


Expectation:
Cell8—>Cell6—>Cell 4—>Cell 2—>Cell 0
Cell7—>Cell5—>Cell3—>Cell1
Cell 9
Cell 10

    pdi = self.GetInputDataObject(0, 0)
    pdo = self.GetOutputDataObject(0)
    stripIt = vtk.vtkStripper()
    stripIt.SetMaximumLength(vtk.VTK_INT_MAX)
    stripIt.JoinContiguousSegmentsOn();
    stripIt.SetInputData(pdi)
    stripIt.Update()
    pdo.ShallowCopy(stripIt.GetOutput())

In the attached state file, see vtkConnectivity filter’s output which has 4 regions, but a programmable filter with that script has 11 polylines in the output instead of 4.

stripperIssue.zip (57.3 KB)

Edit: Expected output

MR that fixes this bug.