[vtkusers] Streamlines in an Unstructured Grid
Erik Anderson
eranders at sci.utah.edu
Tue Jul 31 13:01:03 EDT 2007
Hi all,
I've been having some problems getting streamlines to
work for me with an unstructured grid. The Unstructured
grid has points (x,y,z) and velocities contained in a
vtkFloatArray named "velocity" per point. The general
pipeline I'm trying to use is as follows:
vtkUnstructuredGridReader reader
vtkAssignAttribute a
a.SetInput(reader.GetOutput())
a.Assign("velocity", vtkDataSetAttribute::VECTORS,
vtkDataSetAttribute::VECTORS)
vtkPointSource seeds
seeds.SetCenter(50, 50, 50)
seeds.SetRadius(50)
seeds.SetNumberOfPoints(50)
vtkRungeKutta4 integrate
vtkStreamLine streamer
streamer.SetIntegrationDirectionToIntegrateBothDirections
streamer.SetIntegrator(integrate)
streamer.SetStepLength(0.1)
streamer.SetIntegrationStepLength(0.1)
streamer.SpeedScalarsOn()
vtkPolyDataMapper map
map.SetInput(streamer.GetOutput())
# standard pipeline below forr rendering
I am left with a blank screen (nothing rendered). When I
render the seed points, I see them in reasonable places
within the volume. Am I do ing something wrong? Please
note that the above code is more pseudo-code than a real
implementation.
Erik
More information about the vtkusers
mailing list