Hello,
When I using this program bellow to draw a line, I find that the code ‘simple.Show(trivialProducer)’ has spent amost 0.04s. In other examples, such as draw a clone, or simple polydata wrote by myself, also spent amost 0.04s. And when the polydata is bigger, the show time will increase. So is there any good way to replase this method to get a much better speed?
Thank you a lot.
from vtkmodules.vtkCommonDataModel import vtkPolyData, vtkCellArray
from vtkmodules.vtkCommonCore import vtkPoints, vtkFloatArray
from paraview import simple
polyData = vtkPolyData()
polyData.SetPoints(vtkPoints())
polyData.SetLines(vtkCellArray())
points = polyData.GetPoints()
lines = polyData.GetLines()
points.InsertNextPoint(0, 1, 0) # id: 0
points.InsertNextPoint(0, 2, 0) # id: 1
points.InsertNextPoint(0, 3, 0) # id: 2
points.InsertNextPoint(0, 4, 0) # id: 3
points.InsertNextPoint(0, 5, 0) # id: 4
lines.InsertNextCell(points.GetNumberOfPoints())
lines.InsertCellPoint(0)
lines.InsertCellPoint(1)
lines.InsertCellPoint(2)
lines.InsertCellPoint(3)
lines.InsertCellPoint(4)
trivialProducer = simple.TrivialProducer()
trivialProducer.GetClientSideObject().SetOutput(polyData)
simple.Show(trivialProducer)
simple.Render()