.. role:: ts-api-decorator

################
MeshIndexedLines
################

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

.. container:: ts-api-section

   .. js:class:: MeshIndexedLines

      This class implements a ``Mesh`` for indexed lines.

      Rather than defining each line directly as an array of vertices, an array containing each
      unique vertex in the part is defined. Then lines are defined by arrays of indices that refer to
      elements of this vertex array. This allows lines to share vertices, thus reducing the number of
      vertices.



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~cee.geo.MeshIndexedLines.constructor`



.. container:: api-index-section

   .. rubric:: Accessors

   .. rst-class:: api-index-list-item api-kind-accessor api-parent-kind-class

   * :js:attr:`~cee.geo.MeshIndexedLines.boundingBox`
   * :js:attr:`~cee.geo.MeshIndexedLines.indexArray`
   * :js:attr:`~cee.geo.MeshIndexedLines.primitiveCount`
   * :js:attr:`~cee.geo.MeshIndexedLines.primitiveType`
   * :js:attr:`~cee.geo.MeshIndexedLines.textureCoordinates`
   * :js:attr:`~cee.geo.MeshIndexedLines.vertexArray`
   * :js:attr:`~cee.geo.MeshIndexedLines.vertexCount`



.. container:: api-index-section

   .. rubric:: Methods

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

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





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

Constructors
============

.. container:: ts-api-section

   .. js:function:: MeshIndexedLines.constructor( vertices, indices[, optionalVertexData])

      :param vertices: None
      :type vertices: ArrayLike <number>
      :param indices: None
      :type indices: ArrayLike <number>
      :param optionalVertexData: :ts-api-decorator:`optional` None
      :type optionalVertexData: OptionalIndexedLinesVertexData


      Creates an indexed lines mesh with the given vertices and indices.


      :rtype: MeshIndexedLines



Accessors
=========

.. container:: ts-api-section

   .. js:function:: MeshIndexedLines.boundingBox()



      Returns a copy of the ``BoundingBox`` of the mesh


      :rtype: BoundingBox



.. container:: ts-api-section

   .. js:function:: MeshIndexedLines.indexArray()



      A readonly array containing the indices of the mesh


      :rtype: ArrayLike <number>



.. container:: ts-api-section

   .. js:function:: MeshIndexedLines.primitiveCount()



      The number of primitives in the mesh.


      :rtype: number



.. container:: ts-api-section

   .. js:function:: MeshIndexedLines.primitiveType()



      The type of primitives that are used in the mesh.


      :rtype: MeshPrimitiveType



.. container:: ts-api-section

   .. js:function:: MeshIndexedLines.textureCoordinates()



      A readonly array containing the 2d texture coordinates of the mesh


      :rtype: ArrayLike <number>



.. container:: ts-api-section

   .. js:function:: MeshIndexedLines.vertexArray()



      A readonly array containing the vertices of the mesh


      :rtype: ArrayLike <number>



.. container:: ts-api-section

   .. js:function:: MeshIndexedLines.vertexCount()



      The number of vertices in the mesh.


      :rtype: number



Methods
=======

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

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

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

   :param primitiveIndex: None
   :type primitiveIndex: number


   Returns a copy of the vertex indices of a given primitive.


   :rtype: [Vec3]

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

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

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

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


   Performs picking on the mesh.

   If a primitive was hit, the function returns true and populates the passed hitItem object with
   information about this primitive. It nothing was hit, returns false.


   :rtype: boolean

