fibomat.linalg.boundingboxes.boundingbox module

class fibomat.linalg.boundingboxes.boundingbox.BoundingBox(lower_left: numpy.ndarray, upper_right: numpy.ndarray)[source]

Bases: fibomat.linalg.boundingboxes.boundingbox_base.BoundingBoxBase[fibomat.linalg.vectors.vector.Vector, float]

classmethod from_points(points: Iterable[Union[fibomat.linalg.vectors.vector.Vector, Iterable[float]]]) fibomat.linalg.boundingboxes.boundingbox.BoundingBox[source]

Constructs rectangular bounding box containing all points

Args:

points (VectorArrayLike): points which should be included in bounding box

Returns:

(BoundingBox): new BoundingBox

__init__(lower_left: numpy.ndarray, upper_right: numpy.ndarray)
property center: fibomat.linalg.boundingboxes.boundingbox_base.VectorT

Vector: center bounding box

Access:

get

clone() fibomat.linalg.boundingboxes.boundingbox_base.SelfT

Clones the bounding box

Returns:

(BoundingBox): cloned box

close_to(other: object) bool
contains(other: Union[fibomat.linalg.boundingboxes.boundingbox_base.BoundingBoxBase, fibomat.linalg.boundingboxes.boundingbox_base.VectorT]) bool

Checks if this bounding box contains other. Alternatively, you can use in syntax. Note, that a box is contains always itself.

box_1 = BoundingBox([1, 2], [3, 4])
box_2 = BoundingBox([1, 3], [0, 4])

print(box_1.contains(box_2)
# or
print(box_2 in box_1)
Args:

other (BoundingBox): other box

Returns:

(bool): True if self contains other

extended(other: Union[fibomat.linalg.boundingboxes.boundingbox_base.BoundingBoxBase, fibomat.linalg.boundingboxes.boundingbox_base.VectorT, Iterable[fibomat.linalg.boundingboxes.boundingbox_base.VectorT]]) fibomat.linalg.boundingboxes.boundingbox_base.SelfT

Return a extended bounding box so that self and other are contained

Args:

other (BoundingBox): other box

property height: fibomat.linalg.boundingboxes.boundingbox_base.ScalarT

float: with of bounding box

Access:

get

property lower_left: fibomat.linalg.boundingboxes.boundingbox_base.VectorT

Vector: lower left coordinate

Access:

get

overlaps_with(other: fibomat.linalg.boundingboxes.boundingbox_base.BoundingBoxBase) bool

Checks if this bounding box overlaps with other.

Args:

other: other bounding box

Returns:

bool: True if self and other overlap

scaled(val: float) fibomat.linalg.boundingboxes.boundingbox_base.SelfT

Return a scaled version of the BoundingBox.

Args:

val: scale factor

Returns:

BoundingBox

property upper_right: fibomat.linalg.boundingboxes.boundingbox_base.VectorT

Vector: upper richt coordinate

Access:

get

property width: fibomat.linalg.boundingboxes.boundingbox_base.ScalarT

float: with of bounding box

Access:

get