eradiate.scenes.core.BoundingBox#

class eradiate.scenes.core.BoundingBox(min, max)[source]#

Bases: object

A basic data class representing an axis-aligned bounding box with unit-valued corners.

Parameters:
Fields:

Notes

Instances are immutable.

contains(p, strict=False)[source]#

Test whether a point lies within the bounding box.

Parameters:
  • p (quantity or array-like) – An array of shape (3,) (resp. (N, 3)) representing one (resp. N) points. If a unitless value is passed, it is interpreted as ucc['length'].

  • strict (bool) – If True, comparison is done using strict inequalities (<, >).

Returns:

result (array of bool or bool) – True iff p in within the bounding box.

classmethod convert(value)[source]#

Attempt conversion of a value to a BoundingBox.

Parameters:

value – Value to convert.

Returns:

any – If value is an array-like, a quantity or a mapping, conversion will be attempted. Otherwise, value is returned unmodified.

property extents#

Extent in all dimensions.

Type:

pint.Quantity

property shape#

Shape of min and max arrays.

Type:

tuple

property units#

Units of min and max arrays.

Type:

pint.Unit