[vtkusers] vtkstreamline

Mohammad Nazrul Islam int64380 at stud.uni-stuttgart.de
Tue Feb 12 07:52:33 EST 2008


Hi all;
Could anybody  help me to find the problem of the following code?I am getting the input of vtkStreamLine always the default value means the bounds of x, y and z is always the default one.So I guess the problem is with the proper input of vtkStreamLine.

First i am reading x,y and z coordinates as vtkpoints and then making a grid using vtkUnstructuredGrid and then...

vector=vtk.vtkFloatArray()
vector.SetNumberOfComponents(3)
vector.SetNumberOfTuples(lines)

slineGrid=vtk.vtkUnstructuredGrid()
slineGrid.SetPoints(points)
slineGrid.GetPointData().SetVectors(vector)

delny = vtk.vtkDelaunay3D()
delny.SetInput(slineGrid)
delny.SetTolerance(0.1)
delny.SetAlpha(0.5)
delny.BoundingTriangulationOff()

line=vtk.vtkLineSource()
line.SetResolution(25)

integ=vtk.vtkRungeKutta4()
streamline=vtk.vtkStreamTracer()
streamline.SetInputConnection(delny.GetOutputPort())
streamline.SetSource(line.GetOutput())
streamline.SetMaximumPropagation(500)
streamline.SetMaximumPropagationUnitToTimeUnit()
streamline.SetInitialIntegrationStep(0.5)
streamline.SetInitialIntegrationStepUnitToCellLengthUnit()
streamline.SetIntegrationDirectionToBoth()
streamline.SetIntegrator(integ)

streamlinemapper=vtk.vtkPolyDataMapper()
streamlinemapper.SetInputConnection(streamline.GetOutputPort())

streamlineActor=vtk.vtkActor()
streamlineActor.SetInput(streamlinemapper)

and then the rendering stuff.

Thanks and br,
Nazrul




More information about the vtkusers mailing list