[vtkusers] get coordinates from unstructured grid file

flyaway flyaway1212 at gmail.com
Fri Apr 10 03:02:04 EDT 2009


Hi.
I have the following problem. I have a legacy vtk file that contains an
unstructured grid. I need to define a vector field (magnetic field in my
case) on this grid and then plot some streamlines (field lines). The field
is a function of coordinates.
I think I know how to do the streamlines part, but I am getting stuck on the
very first step of this. 
In Python I do:

reader = vtk.vtkUnstructuredGridReader()
reader.SetFileName("mesh.vtk")

and then I have no idea how to extract coordinates from this. That is, I've
found one way to do it through vtkArrayCalculator, but the expression for my
vector field is quite complex and includes a Taylor series so I prefer to
set values via a loop, and using character expressions for the function is a
really undesirable option.

Does anyone have any idea how to do this?

Sincerely
Victor.
-- 
View this message in context: http://www.nabble.com/get-coordinates-from-unstructured-grid-file-tp22984055p22984055.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list