[vtkusers] vtkstreamline

Mohammad Nazrul Islam int64380 at stud.uni-stuttgart.de
Wed Feb 13 11:51:57 EST 2008


Hi all,
I am writing a program to plot a streamline from position vector file which is in text format  and I have written the following code but not getting the expected output. I found that there is always defaults bounds of x, y and z of streamlineActor. could you help me pls

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

slineGrid=vtk.vtkStructuredGrid()
slineGrid.GetPointData().SetScalars(scalars)
slineGrid.GetPointData().SetVectors(vector)
slineGrid.GetPointData().AddArray
slineGrid.SetPoints(points)

  
delny = vtk.vtkDelaunay3D()
delny.SetInput(slineGrid)
delny.SetTolerance(1)
delny.SetAlpha(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)

mapstreamline=vtk.vtkPolyDataMapper()
mapstreamline.SetInputConnection(streamline.GetOutputPort())
streamlineActor=vtk.vtkActor()
streamlineActor.SetMapper(mapstreamline)

and then the rendering stuff.

Thanks in advance

Nazrul 



More information about the vtkusers mailing list