.. role:: ts-api-decorator

####
Mesh
####

.. js:module:: cee.geo
   :noindex:

.. container:: ts-api-section

   .. js:class:: Mesh

      A Mesh defines the geometry (primitives) of a Part.

      Common interface for all Mesh classes.



.. container:: api-index-section

   .. rubric:: Properties

   .. rst-class:: api-index-list-item api-kind-property api-parent-kind-interface

   * :js:attr:`~cee.geo.Mesh.boundingBox`
   * :js:attr:`~cee.geo.Mesh.primitiveCount`
   * :js:attr:`~cee.geo.Mesh.primitiveType`
   * :js:attr:`~cee.geo.Mesh.vertexCount`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-interface

   * :js:meth:`~cee.geo.Mesh.getPrimitiveVertices`
   * :js:meth:`~cee.geo.Mesh.rayIntersect`





------------

Properties
==========

.. container:: ts-api-section

   .. js:attribute:: Mesh.boundingBox

      :type: BoundingBox

      The ``BoundingBox`` of the mesh.



.. container:: ts-api-section

   .. js:attribute:: Mesh.primitiveCount

      :type: number

      The number of primitives in the mesh.



.. container:: ts-api-section

   .. js:attribute:: Mesh.primitiveType

      :type: MeshPrimitiveType

      The type of primitives that are used in the mesh.



.. container:: ts-api-section

   .. js:attribute:: Mesh.vertexCount

      :type: number

      The number of vertices in the mesh.



Methods
=======

.. rst-class:: ts-api-section

getPrimitiveVertices
--------------------

.. js:method:: Mesh.getPrimitiveVertices( primitiveIndex)

   :param primitiveIndex: None
   :type primitiveIndex: number


   Returns the vertex indices of a given primitive.


   :rtype: [Vec3]

.. rst-class:: ts-api-section

rayIntersect
------------

.. js:method:: Mesh.rayIntersect( ray[, hitItem])

   :param ray: None
   :type ray: Ray
   :param hitItem: :ts-api-decorator:`optional` None
   :type hitItem: MeshHitItem


   Performs picking on the mesh.


   :rtype: boolean

