I’ve gotten stuck trying to use the RuledSurfaceFilter inside one of my python plugins.
I have been writing standalone code using import vtk
based on this example:
RuledSurfaceFilter.py (2.5 KB). This works great.
Now, I’m trying to create a python plugin that does something similar. However, since I’m using vtkmodules, I don’t have access to all the same classes that come with vtk, but when I try to import vtk
, paraview crashes. For example, I have an array of vtkPolyLineSource()
created inside my class like this
def compute_orbits(self):
self.orbits = []
y0 = self.initial_conditions()
for i in range(self.N):
self.orbits.append(vtkPolyLineSource())
y, t = self.integrate(y0[i]) # integrates an ODE with initial conditions y0[i]
n = y.shape[1]
self.orbits[i].SetNumberOfPoints(n)
for j in range(n):
self.orbits[i].SetPoint(j,y[0,j],y[1,j],y[2,j])
self.orbits[i].Update()
Later, I try to create a vtkRuledSurfaceFilter()
object like this
self.surface = vtkRuledSurfaceFilter()
for i in range(len(self.orbits)):
self.surface.SetInputData(self.orbits[i].GetOutput())
But when I try to generate an output in the RequestData
function, I get nothing
output = vtkMultiBlockDataSet.GetData(outInfo, 0)
output.SetBlock(0,self.surface.GetOutput())
Any tips here for working with vtkPolyLineSource()
instead of vtkPolyLine()
?
I’m running Paraview 5.8.0 on Ubuntu 20.04