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


###
Box
###

.. js:class:: wv.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:`~wv.Box.constructor`
   
   .. rubric:: Properties
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:data:`~wv.Box.max`
   * :js:data:`~wv.Box.min`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~static wv.Box.fromJson`
   * :js:meth:`~static wv.Box.invalid`
   * :js:meth:`~wv.Box.addBox`
   * :js:meth:`~wv.Box.addPoint`
   * :js:meth:`~wv.Box.center`
   * :js:meth:`~wv.Box.containsPoint`
   * :js:meth:`~wv.Box.copy`
   * :js:meth:`~wv.Box.equals`
   * :js:meth:`~wv.Box.extents`
   * :js:meth:`~wv.Box.getCorners`
   * :js:meth:`~wv.Box.isDegenerate`
   * :js:meth:`~wv.Box.toJson`
   
   



.. rst-class:: kind-group kind-constructors

.. rubric:: Constructors
   :class: kind-group-title


.. js:method:: wv.Box.constructor

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



.. rst-class:: kind-group kind-properties

.. rubric:: Properties
   :class: kind-group-title


.. js:data:: wv.Box.max

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



.. js:data:: wv.Box.min

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



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


.. js:method:: static wv.Box.fromJson

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



.. js:method:: static wv.Box.invalid

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



.. js:method:: wv.Box.addBox

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



.. js:method:: wv.Box.addPoint

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



.. js:method:: wv.Box.center

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



.. js:method:: wv.Box.containsPoint

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



.. js:method:: wv.Box.copy

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



.. js:method:: wv.Box.equals

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



.. js:method:: wv.Box.extents

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



.. js:method:: wv.Box.getCorners

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



.. js:method:: wv.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:: wv.Box.toJson

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




