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:
min (array-like or
quantity
) – Min corner.max (array-like or
quantity
) – Max corner.
- 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 asucc['length']
.strict (
bool
) – IfTrue
, comparison is done using strict inequalities (<, >).
- Returns:
result (array of
bool
orbool
) –True
iffp
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: