Make a Clip filter with Cylinder Clip Type follow a data set

I have a SPH(Smoothed Particle Hydrodynamics) simulation of planetary gearset lubrication. In this simulation both fluid and solids are represented as particles. Since I want to make analysis of how much oil is there in which region in order to better estimate heat transfer coefficient, I am using Cylinder Clip to define a region and then to count how many fluid particles are there. Since all particles together are imported, I separate them using Threshold filter based on there phaseID (e.g. oil has phaseID 1, each of the gears have their on unique phaseID). I adopted the script already posted here for use with cylinder type of clip but the results are not satisfactory. The problem is that the clip does not follow the planet gear properly (it is lagging behind). The script is written as follows:

from paraview.simple import FindSource

def start_cue(self): pass

def tick(self):
s = FindSource(‘Threshold1’)
bounds = s.GetDataInformation().GetBounds()
center = [0.5*(bounds[0]+bounds[1]), 0.5*(bounds[2]+bounds[3]), 0.5*(bounds[4]+bounds[5])]
c = FindSource(‘Clip1’)
c.ClipType.Center = center

def end_cue(self): pass

Here it can be seen on the screenshots.



I hope someone has experience with such approach and can help.