.. _group__a3d__tessellation__module:

###################
Tessellation Module
###################

Creates and accesses tessellation entities.

This module describes how to access and encode tessellation for a variety of entities. It also provides information about tessellations, associated textures, and markup representations.


Usage
=====

Tessellation entities can appear in the ``pTessBase`` member of all types of representation items, except :c:type:`~A3DRiCoordinateSystem` and :c:type:`~A3DRiPointSet`\ .

If your application parses PRC content, you must develop dedicated functions to parse the base tessellation data and to parse each type of tessellation entity. The following sample code demonstrates the following basic steps:


1. Use the :c:func:`~A3DTessBaseGet` function to get the tessellation base data. 
2. Use the :c:func:`~A3DEntityGetType` function to determine the specific tessellation type. 
3. Invoke a custom function to parse the entity contents. 



See Also
========



- :c:type:`~A3DTess3D`


- :c:type:`~A3DTess3DWire`


- :c:type:`~A3DTessMarkup`




Sample Code
===========

.. code-block:: c

   A3DRiRepresentationItemData sRiData;
   // Call the A3DRiRepresentationItemGet function to get the A3DRiRepresentationItemData
   if ( sRiData.m_pTessBase != A3D_NULL_HANDLE )
   {
       A3DEEntityType eType;
       if ( A3DEntityGetType( sRiData.m_pTessBase, &eType) == A3D_SUCCESS )
       {
           switch(eType)
           {
               case kA3DTypeTess3D:
               {
                   A3DTess3D* pTess3D = (A3DTess3D*)sRiData.m_pTessBase;
                   // Call corresponding function...
                   break;
               }
               case kA3DTypeTess3DWire:
               {
                   A3DTess3DWire* pTess3DWire = (A3DTess3DWire*)sRiData.m_pTessBase;
                   // Call corresponding function... 
                   break;
               }
               case kA3DTypeTessMarkup:
               {
                   A3DTessMarkup* pTessMarkup = (A3DTessMarkup*)sRiData.m_pTessBase;
                   // Call corresponding function... 
                   break;
               }
               default:
                   // Nothing else 
                   break;
           }
       }
   }


.. rst-class:: kind-group kind-enumeration

.. rubric:: Enumerations
   :class: kind-group-title


.. rst-class:: api-xref-list


* :c:enum:`~A3DETessellationAlgorithm`

.. rst-class:: kind-group kind-enumerator

.. rubric:: Enumerators
   :class: kind-group-title


.. rst-class:: api-xref-list


* :c:enumerator:`~kA3DTessellationAccurate`
* :c:enumerator:`~kA3DTessellationExperimental`
* :c:enumerator:`~kA3DTessellationStandard`

.. rst-class:: kind-group kind-function

.. rubric:: Functions
   :class: kind-group-title


.. rst-class:: api-xref-list


* :c:func:`~A3DAsmModelFileComputeTessellation2`
* :c:func:`~A3DRiRepresentationItemComputeTessellation2`


