[vtkusers] VTK 3D Structured Grid Problem
Prabhu Ramachandran
prabhu at aero.iitm.ernet.in
Wed Jul 7 14:46:49 EDT 2004
>>>>> "AG" == Andrea Gavana <andrea.gavana at polymtl.ca> writes:
AG> Hello NG,
AG> I'm working with a 3D structured grid in VTK, using
AG> Python and the
AG> wrapping vtkpython. What I do is as follows:
AG> 1) Using Fortran, via a Python-Fortran interface, I read a 3D
AG> grid coming from
AG> another application. This 3D grid is now on a matrix with
AG> shape (8,nx*ny*nz), every cell is identified by 8 coordinates
AG> (first index of the matrix) and I have globally nx*ny*nz cells
AG> (second index of the matrix);
[...]
You might want to get your data into a Numeric Array and then use the
SetVoidArray method of the VTK data arrays to set the data without
looping in Python. This thread might help:
http://public.kitware.com/pipermail/vtkusers/2002-December/064496.html
These examples may also help (although they use MayaVi the way they
setup the data should be useful to look at):
http://sourceforge.net/mailarchive/forum.php?thread_id=4943164&forum_id=1824
http://sourceforge.net/mailarchive/forum.php?thread_id=4793280&forum_id=1824
cheers,
prabhu
More information about the vtkusers
mailing list