File: example_simple_structured_grid.rst

package info (click to toggle)
mayavi2 4.8.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 21,892 kB
  • sloc: python: 49,447; javascript: 32,885; makefile: 129; fortran: 60
file content (33 lines) | stat: -rw-r--r-- 934 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33


.. _example_simple_structured_grid:

Simple structured grid example
--------------------------------------------------------------------


An example creating a structured grid data set from numpy arrays using TVTK
and visualizing it using mlab.

In this example, we create a structured-grid data set: we describe
data, both scalar and vector, lying on a structured-grid, ie a grid where
each vertex has 6 neighbors. For this we directly create a
StructuredGrid tvtk object, rather than using the mlab.pipeline source
functions, as it gives us more control.

To visualize the resulting dataset, we apply several modules, using the
mlab.pipeline interface (see :ref:`controlling-the-pipeline-with-mlab-scripts`)


.. image:: ../generated_images/example_simple_structured_grid.jpg
    :align: center



**Python source code:** :download:`simple_structured_grid.py`

.. literalinclude:: simple_structured_grid.py
    :lines: 14-