.. role:: ts-api-decorator

###
Box
###

.. container:: ts-api-section

   .. js:class:: Box

      Represents an axis-aligned bounding box.
      A box is represented by a minimum and maximum point which describe the extents of the box.



.. container:: api-index-section

   .. rubric:: Constructors

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

   * :js:meth:`~Box.constructor`



.. container:: api-index-section

   .. rubric:: Properties

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

   * :js:attr:`~Box.max`
   * :js:attr:`~Box.min`



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~Box.addBox`
   * :js:meth:`~Box.addPoint`
   * :js:meth:`~Box.center`
   * :js:meth:`~Box.copy`
   * :js:meth:`~Box.equals`
   * :js:meth:`~Box.extents`
   * :js:meth:`~Box.getCorners`
   * :js:meth:`~Box.isDegenerate`
   * :js:meth:`~Box.toJson`
   * :js:meth:`~Box.fromJson`
   * :js:meth:`~Box.invalid`





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

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

.. container:: ts-api-section

   .. js:function:: Box.constructor( min, max)

      :param min: The minimum extent of the box. Defaults to the origin.
      :type min: Point3
      :param max: The maximum extent of the box. Defaults to the origin.
      :type max: Point3


      Creates a new box.


      :rtype: Box



Properties
==========

.. container:: ts-api-section

   .. js:attribute:: Box.max

      :type: Point3

      The point of maximum extent for the box.



.. container:: ts-api-section

   .. js:attribute:: Box.min

      :type: Point3

      The point of minimum extent for the box.



Methods
=======

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

addBox
------

.. js:method:: Box.addBox( box)

   :param box: The box to add.
   :type box: Box


   Expands the extents of the box so that it will contain another box.


   :rtype: void

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

addPoint
--------

.. js:method:: Box.addPoint( point)

   :param point: The point to add.
   :type point: Point3


   Expands the extents of the box so that it will contain a particular point.


   :rtype: void

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

center
------

.. js:method:: Box.center()



   Gets the center point for the box.

   :returns: The center point of this box.


   :rtype: Point3

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

copy
----

.. js:method:: Box.copy()



   Creates a copy of the box.

   :returns: A copy of this box.


   :rtype: Box

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

equals
------

.. js:method:: Box.equals( box)

   :param box: Box to compare with.
   :type box: Box


   Strictly compares this box with another box.

   :returns: True if the values of this box equals the other. False otherwise.


   :rtype: boolean

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

extents
-------

.. js:method:: Box.extents()



   Gets the extents of the box.

   :returns: A point with members set to extent values for each corresponding axis.


   :rtype: Point3

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

getCorners
----------

.. js:method:: Box.getCorners()



   Gets all eight corner points for the box.

   :returns: The corner points of this box.


   :rtype: [Point3]

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

isDegenerate
------------

.. js:method:: Box.isDegenerate()



   Returns whether or not the box is degenerate.

   :returns: whether or not the box is degenerate.


   :rtype: boolean

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

toJson
------

.. js:method:: Box.toJson()



   Creates an object ready for JSON serialization.

   :returns: The prepared object.


   :rtype: object

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

:ts-api-decorator:`static` fromJson
-----------------------------------

.. js:method:: Box.fromJson( objData)

   :param objData: An object given by [[toJson]].
   :type objData: unknown


   Creates a new [[Box]] from an object given by [[toJson]].

   :returns: The prepared object.


   :rtype: Box

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

:ts-api-decorator:`static` invalid
----------------------------------

.. js:method:: Box.invalid()



   Creates and returns an invalid bounding box.

   :returns: an invalid bounding box.


   :rtype: Box

