.. role:: ts-api-decorator

############
BoxGenerator
############

.. js:module:: cee.utils
   :noindex:

.. container:: ts-api-section

   .. js:class:: BoxGenerator

      Helper class to tesselate a box with 6 faces

      Useful when result values need to be mapped onto a set of 3D points defining a box. 
      See the method ``createCuttingSolid`` in the example in Examples/DemoAppUg on how to do that.



.. container:: api-index-section

   .. rubric:: Constructors

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

   * :js:meth:`~cee.utils.BoxGenerator.constructor`



.. container:: api-index-section

   .. rubric:: Properties

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

   * :js:attr:`~cee.utils.BoxGenerator.m_indices`
   * :js:attr:`~cee.utils.BoxGenerator.m_vertices`



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~cee.utils.BoxGenerator.fillVerticesIndices`
   * :js:meth:`~cee.utils.BoxGenerator.generate`
   * :js:meth:`~cee.utils.BoxGenerator.getIndices`
   * :js:meth:`~cee.utils.BoxGenerator.getVertices`
   * :js:meth:`~cee.utils.BoxGenerator.getVerticesNumber`
   * :js:meth:`~cee.utils.BoxGenerator.setCenterAndExtent`
   * :js:meth:`~cee.utils.BoxGenerator.setNumSegments`
   * :js:meth:`~cee.utils.BoxGenerator.setOrientation`
   * :js:meth:`~cee.utils.BoxGenerator.setOriginAndExtent`





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

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

.. container:: ts-api-section

   .. js:function:: BoxGenerator.constructor()



      :rtype: BoxGenerator



Properties
==========

.. container:: ts-api-section

   .. js:attribute:: BoxGenerator.m_indices

      :type: [number]





.. container:: ts-api-section

   .. js:attribute:: BoxGenerator.m_vertices

      :type: [Vec3]





Methods
=======

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

fillVerticesIndices
-------------------

.. js:method:: BoxGenerator.fillVerticesIndices( vertices, indices)

   :param vertices: The vertices in the format x,y,z,x,y,z,...
   :type vertices: Float32Array
   :param indices: The indices for the vertices
   :type indices: [number]


   Fills the members ``m_vertices`` and ``m_indices`` of this class.


   :rtype: void

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

generate
--------

.. js:method:: BoxGenerator.generate()



   Generate the box


   :rtype: void

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

getIndices
----------

.. js:method:: BoxGenerator.getIndices()



   Get the indices of triangles needed to render the solid object


   :rtype: [number]

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

getVertices
-----------

.. js:method:: BoxGenerator.getVertices()



   Get the vertices of the solid object as Vec3


   :rtype: [Vec3]

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

getVerticesNumber
-----------------

.. js:method:: BoxGenerator.getVerticesNumber()



   Get the vertices of the solid object as a number array with <x,y,z,x,y,z,...>


   :rtype: [number]

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

setCenterAndExtent
------------------

.. js:method:: BoxGenerator.setCenterAndExtent( center, extent)

   :param center: None
   :type center: Vec3
   :param extent: None
   :type extent: Vec3


   Specify the box by providing the center of the box and the extent in x,y, and z direction.


   :rtype: void

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

setNumSegments
--------------

.. js:method:: BoxGenerator.setNumSegments( numX, numY, numZ)

   :param numX: None
   :type numX: number
   :param numY: None
   :type numY: number
   :param numZ: None
   :type numZ: number


   Sets the number of segments of the box per axis.


   :rtype: void

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

setOrientation
--------------

.. js:method:: BoxGenerator.setOrientation( rightDir, upDir)

   :param rightDir: None
   :type rightDir: Vec3
   :param upDir: None
   :type upDir: Vec3


   Set the orientation of the box by giing the right direction (local x axis) and the up direction 
   (local z axis).


   :rtype: void

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

setOriginAndExtent
------------------

.. js:method:: BoxGenerator.setOriginAndExtent( origin, extent)

   :param origin: None
   :type origin: Vec3
   :param extent: None
   :type extent: Vec3


   Specify the box by providing an origin (min x,y,z of the box) and the extent in x,y and z direction.


   :rtype: void

