vtkAngularPeriodicFilter vtkCutter

Hi,

I have a 3D VTK dataset and I want to post-process it in a Python script (using pvbatch). Everything works well up to the application of the vtkAngularPeriodicFilter:

# Loop through snapshots
for i in range(valid_iterations_id[0], len(iterations)):
    print("Processing iteration", i, "out of", len(iterations))

    # Read the VTK data
    data = vtkutils.read_vtk(folder + fileName[i])
    print(data.GetOutput())

    # Don't try using clip: too slow
    #data = vtkutils.clip_vtk(data,Zmin)

    # Remove part of data before Zmin
    data = vtkutils.extractGeometry_vtk(data,Zmin)
    print(data.GetOutput())

    # Remove part of data after Zmax
    data = vtkutils.extractGeometry_vtk(data,Zmax)
    print(data.GetOutput())

    # Remove part of data beyond cylinder radius
    data = vtkutils.extractGeometry_vtk(data,cyl)
    print(data.GetOutput())

    # Apply angular periodic filter
    data = vtkutils.angularPeriodic_vtk(data, 45., 2, [0., 0., 0.])
    print(data.GetOutput())

    # Slice through data
    data = vtkutils.cut_vtk(data, cut)
    print(data.GetOutput())

Then the code crashes when attempting to execute the vtkCutter with the following error message:

( 332.150s) [pvbatch ]vtkGenericDataArray.txx:268 ERR| 27vtkAngularPeriodicDataArrayIfE (0x10d227d0): GetVoidPointer is not supported by this class.

Could you help me figure out what is going on?

Thanks a lot,

Which filter is behind this ? if it is actual vtkCutter, then it should be fixed to not rely on GetVoidPointer. In any case, you can work around this by using SetComputeRotationsOnTheFly (bool)

Thanks Mathieu for your reply. Here is the definition of cut_vtk:

def cut_vtk(data,plane):
    cutter = vtk.vtkCutter()
    cutter.SetCutFunction(plane)
    cutter.SetInputConnection(data.GetOutputPort())
    cutter.Update()
    return cutter

It is indeed using vtkCutter. Here is, on its turn, the definition of angularPeriodic_vtk:

def angularPeriodic_vtk(data, rotationAngle, rotationAxis, center):
    angularPeriodic = vtk.vtkAngularPeriodicFilter()
    angularPeriodic.SetInputConnection(data.GetOutputPort())
    angularPeriodic.SetRotationAngle(rotationAngle)
    angularPeriodic.SetRotationAxis(rotationAxis)
    angularPeriodic.SetCenter(center)
    angularPeriodic.Update()
    return angularPeriodic

As far as I understand the documentation, compute rotations on the fly is the default behaviour for vtkAngularPeriodicFilter, isn’t it?

Yes, that is correct, you should set it to false.

Mathieu, I managed to pass by the crash, but the following filter (vtkCutter) is still not working… Would you mind taking a look at my new topic?

https://discourse.paraview.org/t/vtkangularperiodicfilter-vtkcutter-2/

Thanks a lot,

However, I must say that setting compute rotations on the fly to false kills the performance of your code (it is much slower) and may become prohibitive for large datasets…