[vtkusers] StreamTracer Source from Vtk ASCII File?
Stewart Dickson
dicksonsp at ornl.gov
Fri Sep 24 10:51:37 EDT 2004
Hello,
I have a Tcl script which very nicely generates streamlines in a vector
field
when the vtkStreamTracer SetSource is taking the output from a
vtkPointSource
random spatial seed generator.
Suppose I now have a Vtk ASCII data file which specifies the integration
starting points I wish to use. What format file should this be to get
this to work
and which reader should I use to read it?
I have tried the following, which generates no errors, but produces no
output:
<file: probe_line.vtk>
# vtk DataFile Version 2.0
Flow line seed points
ASCII
DATASET UNSTRUCTURED_GRID
POINTS 100 float
0.1383307E+01 0.0000000E+00 0.0000000E+00
...
[skipping 98 lines]
...
0.1383307E+01 0.8898221E-15 0.1907777E-15
<end probe_line.vtk>
<file: vtk_streamtracer.tcl>
...
vtkStructuredGridReader gridreader
gridreader SetFileName "vector1.vtk"
vtkUnstructuredGridReader pointsreader
pointsreader SetFileName "probe_line.vtk"
# Convert the unstructured grid to point data
vtkGeometryFilter pointsfilter
pointsfilter SetInput [pointsreader GetOutput]
vtkRungeKutta45 integ
vtkStreamTracer streamer
streamer SetInput [gridreader GetOutput]
streamer SetSource [pointsfilter GetOutput]
...
<end vtk_streamtracer.tcl>
Again, the visualization works properly when I:
vtkPointSource seeds
seeds SetRadius [expr $length / 2.0]
eval seeds SetCenter [[gridreader GetOutput] GetCenter]
seeds SetNumberOfPoints 6000
and
vtkRungeKutta45 integ
vtkStreamTracer streamer
streamer SetInput [gridreader GetOutput]
streamer SetSource [seeds GetOutput]
So, I'm thinking that either the type of dataset I am defining in
probe_line.vtk is wrong,
the kind of reader I am using to read the file is wrong (the two must be
comatible with
each other -- and with vtkStreamTracer::SetSource) and/or the way I am
using vtkGeometryFilter is wrong -- or all of the above.
Can anyone please provide the correct combination of parameters to get
this to work?
Thanks,
-Stewart Dickson, Visualization Researcher
Computer Science and Mathematics Division
Oak Ridge National Laboratory
http://www.csm.ornl.gov/~dickson
More information about the vtkusers
mailing list