

.. _example_polydata:

Polydata example
--------------------------------------------

An example of how to generate a polydata dataset using numpy arrays.

The example is similar to tvtk/examples/tiny_mesh.py.  Also shown is a
way to visualize this data with mayavi2.  The script can be run like so::

  $ mayavi2 -x polydata.py

It can be alternatively run as::

  $ python polydata.py

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



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

.. literalinclude:: polydata.py
    :lines: 14-


    