[vtkusers] Streamlines in an Unstructured Grid

E Anderson eranders at sci.utah.edu
Wed Aug 1 09:21:26 EDT 2007


Berk,
    I think your last question may have cleared everything up.  The 
Unstructured Grid is basically just a container for a point cloud.  
Basically, I have no connectivity at all; I have only a collection of 
points with a vector and a couple scalars attached to them (in 
vtkDataArrays).  If I need connectivity to get streamlines into this 
visualization, can you recommend a method to form the connectivity?  For 
another part of the visualization, I'm using Shepard's method to embed 
the entire volume in a rectilinear grid (for some contouring) but I 
couldn't see a way to get vectors onto each data point.

Any help would be awesome, and thanks for the fast reply!
Erik

Berk Geveci wrote:
> Your script looks fine. Is the streamline algorithm producing nothing
> at all? Can you check the output's number of points? Can you try
> vtkStreamTracer instead? If you are still not getting results, there
> may be something wrong with the unstructured grid. Maybe the
> connectivity is wrong?
>
> -berk
>
> On 7/31/07, Erik Anderson <eranders at sci.utah.edu> wrote:
>   
>> 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
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>     




More information about the vtkusers mailing list