Dear all,
I have the following situation:
- I am running simulations of a propeller with an arbitrary rotation center and axis,
- I can read the current simulation time as field data from my vtk dataset,
- with given rotation rate and time I can calculate the rotation angle.
Based on the given data I would like to automatically rotate my dataset back to the initial propeller position to emulate a body fixed point of view. This allows me to position my camera once at interesting locations on the propeller blade and inspect them over the entire simulation without adjusting the camera.
Is there a way to achieve this in ParaView, e.g. with a programmable filter?
My ParaView information:
- Version: 5.10.1
Here is example data:
Iterations.zip (2.4 MB)
And here is a programmable annotation to show the current angle, rotation and time
import vtk
Index = 0
Data = inputs[0].GetFieldData().GetArray(Index);
Name = inputs[0].GetFieldData().GetArrayName(Index)
RotationRate = 1.745
Period = 1.0 / RotationRate
Time = Data[0]
Rotations = Time / Period
Angle = Rotations * 360.0
Message = "\n".join([
f"Time: {Time:.5f}",
f"Angle: {Angle:.5f}",
f"Rotations: {Rotations:.5f}"
])
TableOutput = self.GetTableOutput()
Array = vtk.vtkStringArray()
Array.SetName("CurrentTime")
Array.SetNumberOfComponents(1)
Array.InsertNextValue(Message)
TableOutput.AddColumn(Array)