fibomat.linalg.boundingboxes.dim_boundingbox module#
- class fibomat.linalg.boundingboxes.dim_boundingbox.DimBoundingBox(lower_left: ndarray, upper_right: ndarray)[source]#
Bases:
BoundingBoxBase[DimVector,Quantity]- classmethod from_points(points: Iterable[DimVector]) DimBoundingBox[source]#
Constructs rectangular bounding box containing all points
- Args:
points (VectorArrayLike): points which should be included in bounding box
- Returns:
(BoundingBox): new BoundingBox
- property area: ScalarT#
float: area of bounding box
- Access:
get
- property center: VectorT#
Vector: center bounding box
- Access:
get
- clone() SelfT#
Clones the bounding box
- Returns:
(BoundingBox): cloned box
- contains(other: BoundingBoxBase | 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: BoundingBoxBase | VectorT | Iterable[VectorT]) SelfT#
Return a extended bounding box so that self and other are contained
- Args:
other (BoundingBox): other box
- property height: ScalarT#
float: with of bounding box
- Access:
get
- property lower_left: VectorT#
Vector: lower left coordinate
- Access:
get
- overlaps_with(other: 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) SelfT#
Return a scaled version of the BoundingBox.
- Args:
val: scale factor
- Returns:
BoundingBox
- property upper_right: VectorT#
Vector: upper richt coordinate
- Access:
get
- property width: ScalarT#
float: with of bounding box
- Access:
get