===============================
Tutorial of sphere tessellation
===============================

A sphere is tessellated by multiple trinagle: This is tessellation.

Instance the class :class:`irfpy.util.tessellatedsphere.TessellatedSphere`
You can specify the number of the dimension, *ndim*, as an argument.

If *ndim* is 0, the sphere is tessellated by icosahedron, and with
one incrementation of *ndim* each triangle is splitted into 4.

>>> from irfpy.util.tessellatedsphere import TessellatedSphere
>>> sphere = TessellatedSphere(ndim=4)

Each triangle can be get by

>>> tris = sphere.getTriangles()

*tris* is a ``tuple`` of :class:`irfpy.util.triangle.Triangle`.

A sample script file can be downloaded from
:download:`scripts/tessellate_plot.py <../../../src/scripts/tessellate_plot.py>`.

With this script, you can get image like

.. image::  ../images/tessellation_ndim4.png

See also :mod:`irfpy.util.tessellatedsphere`.