BoundingBox
===========

.. py:module:: rhino3dm

.. py:class:: BoundingBox

   .. py:method:: BoundingBox(min, max)

      Constructs a new bounding box from two corner points.

      :param rhino3dm.Point3d min: Point containing all the minimum coordinates.
      :param rhino3dm.Point3d max: Point containing all the maximum coordinates.

   .. py:method:: BoundingBox(minX, minY, minZ, maxX, maxY, maxZ)

      Constructs a bounding box from numeric extremes.

      :param float minX: Lower extreme for box X size.
      :param float minY: Lower extreme for box Y size.
      :param float minZ: Lower extreme for box Z size.
      :param float maxX: Upper extreme for box X size.
      :param float maxY: Upper extreme for box Y size.
      :param float maxZ: Upper extreme for box Z size.

   .. py:attribute:: IsValid

      bool: Gets a value that indicates whether or not this bounding box is valid.
      Empty boxes are not valid, and neither are boxes with unset points.

   .. py:attribute:: Min

      rhino3dm.Point3d: Gets or sets the point in the minimal corner.

   .. py:attribute:: Max

      rhino3dm.Point3d: Gets or sets the point in the maximal corner.

   .. py:attribute:: Center

      rhino3dm.Point3d: Gets the point in the center of the bounding box.

   .. py:attribute:: Area

      float: Gets the area of this BoundingBox.

   .. py:attribute:: Volume

      float: Gets the volume of this BoundingBox.

   .. py:attribute:: Diagonal

      rhino3dm.Vector3d: Gets the diagonal vector of this BoundingBox.
      The diagonal connects the Min and Max points.

   .. py:method:: ClosestPoint(point)

      Finds the closest point on or in the bounding box.

      :param rhino3dm.Point3d point: Sample point.

      :return: The point on or in the box that is closest to the sample point.

      :rtype: rhino3dm.Point3d

   .. py:method:: Inflate(amount)

      Inflates the box with equal amounts in all directions.
      Inflating with negative amounts may result in decreasing boxes.
      Invalid boxes can not be inflated.

      :param float amount: Amount (in model units) to inflate this box in all directions.


      :rtype: void

   .. py:method:: Inflate(xAmount, yAmount, zAmount)

      Inflates the box with equal amounts in all directions.
      Inflating with negative amounts may result in decreasing boxes.
      Invalid boxes can not be inflated.


      :rtype: void

   .. py:method:: Contains(point)

      Tests a point for bounding box inclusion. This is the same as calling Contains(point, false)

      :param rhino3dm.Point3d point: Point to test.

      :return: True if the point is on the inside of or coincident with this bounding box; otherwise false.

      :rtype: bool

   .. py:method:: IsDegenerate(tolerance)

      Determines whether a bounding box is degenerate (flat) in one or more directions.

      :param float tolerance: Distances <= tolerance will be considered to be zero.  If tolerance \
         is negative (default), then a scale invariant tolerance is used.

      :return: 0 = box is not degenerate \
         1 = box is a rectangle (degenerate in one direction). \
         2 = box is a line (degenerate in two directions). \
         3 = box is a point (degenerate in three directions) \
         4 = box is not valid.

      :rtype: int

   .. py:method:: Transform(xform)

      Updates this bounding box to be the smallest axis aligned
      bounding box that contains the transformed result of its 8 original corner
      points.

      :param Transform xform: A transform.

      :return: True if this operation is successful; otherwise false.

      :rtype: bool

   .. py:method:: ToBrep()

      Constructs a  representation of this bounding box.

      :return: If this operation is successful, a Brep representation of this box; otherwise null.

      :rtype: rhino3dm.Brep

   .. py:staticmethod:: Union(a, b)

      Updates this BoundingBox to represent the union of itself and another box.


      :rtype: void

   .. py:method:: Encode()

      [todo] add documentation

   .. py:staticmethod:: Decode(jsonObject)

      [todo] add documentation
