How to return list containing all points in Unstructured Grid vtk file

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to return list containing all points in Unstructured Grid vtk file

awa5114
This post has NOT been accepted by the mailing list yet.
I am currently using this example which goes through using the vtk library to extract information from an unstructured grid file and rendering it in Python.

The file is available on this link. It is called uGridEx.vtk.

I would like to create my own variation which must extract all the X,Y,Z points in the vtk and send them to a Python list. So far I have gone through the following commands:

from vtk import *
reader = vtkUnstructuredGridReader()
reader.SetFileName(filename)
reader.Update()
output = reader.GetOutput()
type(output)
vars(output)
dir(output)

Which has output all the attributes and methods associated with the output instance of the vtkUnstructuredGridReader.GetOutput() object. The list is long and extensive and most of its methods and attributes return vtkObjects. I just need a simple list. How would I go about doing this? Thanks