[Numpy-discussion] vtkStructuredPoints
Pearu Peterson
pearu at cens.ioc.ee
Thu Jun 7 04:06:27 EDT 2001
On Wed, 6 Jun 2001, Karshi Hasanov wrote:
> I wanna build *.vtk structured data file from an array A[i,j,k] which has
> a vector attributes. What's the right( or best) way of doing it using python?
> I do have the VTK User's Guide Book, but it didn't tell me much.
> Thanks
Check out PyVTK:
http://cens.ioc.ee/projects/pyvtk/
Using PyVTK you can create the data file as follows:
from pyvtk import *
VtkData(StructuredPoints([n1,n2,n3]),PointData(Vectors(A))).tofile('arr.vtk')
where A is n1 x n2 x n3 arrays of 3-sequences.
Pearu
More information about the NumPy-Discussion
mailing list