.. role:: clio-static
   :class: clio-flag clio-flag-static


###
Box
###

.. 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.
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~Box.constructor`
   
   .. rubric:: Properties
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:data:`~Box.max`
   * :js:data:`~Box.min`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~Box.addBox`
   * :js:meth:`~Box.addPoint`
   * :js:meth:`~Box.center`
   * :js:meth:`~Box.containsPoint`
   * :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:`~static Box.fromJson`
   * :js:meth:`~static Box.invalid`
   
   




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

.. js:method:: Box.constructor

   .. rst-class:: sig-pretty-signature
   
      | Box(**min**\ : :js:class:`~Point3`\ ?, **max**\ : :js:class:`~Point3`\ ?): :js:class:`~Box`
   
   Creates a new box.
   
   **Parameters**
   
      **min**\ : :js:class:`~Point3` = ...
   
         The minimum extent of the box. Defaults to the origin.
   
   
      **max**\ : :js:class:`~Point3` = ...
   
         The maximum extent of the box. Defaults to the origin.
   
   
   
   **Returns**\ : :js:class:`~Box`
   





Properties
==========

.. js:data:: Box.max

   .. rst-class:: sig-pretty-signature
   
      | max: :js:class:`~Point3`
   
   The point of maximum extent for the box.
   



.. js:data:: Box.min

   .. rst-class:: sig-pretty-signature
   
      | min: :js:class:`~Point3`
   
   The point of minimum extent for the box.
   





Methods
=======

.. js:method:: Box.addBox

   .. rst-class:: sig-pretty-signature
   
      | addBox(**box**\ : :js:class:`~Box`\ ): *void*
   
   Expands the extents of the box so that it will contain another box.
   
   **Parameters**
   
      **box**\ : :js:class:`~Box`
   
         The box to add.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Box.addPoint

   .. rst-class:: sig-pretty-signature
   
      | addPoint(**point**\ : :js:class:`~Point3`\ ): *void*
   
   Expands the extents of the box so that it will contain a particular point.
   
   **Parameters**
   
      **point**\ : :js:class:`~Point3`
   
         The point to add.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Box.center

   .. rst-class:: sig-pretty-signature
   
      | center(): :js:class:`~Point3`
   
   Gets the center point for the box.
   
   **Returns**\ : :js:class:`~Point3`
   
      The center point of this box.
   
   



.. js:method:: Box.containsPoint

   .. rst-class:: sig-pretty-signature
   
      | containsPoint(**point**\ : :js:class:`~Point3`\ ): *boolean*
   
   Returns whether a point is contained within the box
   
   **Parameters**
   
      **point**\ : :js:class:`~Point3`
   
   
   **Returns**\ : *boolean*
   
      whether a point is contained within the box
   
   



.. js:method:: Box.copy

   .. rst-class:: sig-pretty-signature
   
      | copy(): :js:class:`~Box`
   
   Creates a copy of the box.
   
   **Returns**\ : :js:class:`~Box`
   
      A copy of this box.
   
   



.. js:method:: Box.equals

   .. rst-class:: sig-pretty-signature
   
      | equals(**box**\ : :js:class:`~Box`\ ): *boolean*
   
   Strictly compares this box with another box.
   
   **Parameters**
   
      **box**\ : :js:class:`~Box`
   
         Box to compare with.
   
   
   
   **Returns**\ : *boolean*
   
      True if the values of this box equals the other. False otherwise.
   
   



.. js:method:: Box.extents

   .. rst-class:: sig-pretty-signature
   
      | extents(): :js:class:`~Point3`
   
   Gets the extents of the box.
   
   **Returns**\ : :js:class:`~Point3`
   
      A point with members set to extent values for each corresponding axis.
   
   



.. js:method:: Box.getCorners

   .. rst-class:: sig-pretty-signature
   
      | getCorners(): :js:class:`~Point3`\ []
   
   Gets all eight corner points for the box.
   
   **Returns**\ : :js:class:`~Point3`\ []
   
      The corner points of this box.
   
   



.. js:method:: Box.isDegenerate

   .. rst-class:: sig-pretty-signature
   
      | isDegenerate(): *boolean*
   
   Returns whether or not the box is degenerate.
   
   **Returns**\ : *boolean*
   
      whether or not the box is degenerate.
   
   



.. js:method:: Box.toJson

   .. rst-class:: sig-pretty-signature
   
      | toJson(): *object*
   
   Creates an object ready for JSON serialization.
   
   **Returns**\ : *object*
   
      The prepared object.
   
   



.. js:method:: static Box.fromJson

   .. rst-class:: clio-flags
   
      :clio-static:`static`
   
   .. rst-class:: sig-pretty-signature
   
      | fromJson(**objData**\ : *unknown*\ ): :js:class:`~Box`
   
   Creates a new [[Box]] from an object given by [[toJson]].
   
   **Parameters**
   
      **objData**\ : *unknown*
   
         An object given by [[toJson]].
   
   
   
   **Returns**\ : :js:class:`~Box`
   
      The prepared object.
   
   



.. js:method:: static Box.invalid

   .. rst-class:: clio-flags
   
      :clio-static:`static`
   
   .. rst-class:: sig-pretty-signature
   
      | invalid(): :js:class:`~Box`
   
   Creates and returns an invalid bounding box.
   
   **Returns**\ : :js:class:`~Box`
   
      an invalid bounding box.
   
   





