vtkAngularPeriodicFilter vtkCutter 2

Hi,

I have a 3D VTK dataset (on the form of a 45° wedge) and I want to post-process it in a Python script (using pvbatch). I apply the following filters:

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

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

Here is the definition of the functions used above:

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

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

The output from angularPeriodic_vtk seems fine (a vtkMultiBlockDataSet comprised of 8 children), but the output from cut_vtk is just None (i.e. all data arrays are gone)… Could you help me figure out what is going on?

Thanks a lot,

Hi Rigel,

a similar problem is described in https://discourse.vtk.org/t/vtkthreshold-not-working-with-vtkmultiblockdataset/5406 - It obviously has to do with the GetOuput() method supposed to serve a vtkUnstructuredGrid. I managed to access the cut vtkMultiBlockDataSet by using the method cutter.GetOutputDataObject(0)

1 Like