BoundingBox

class BoundingBox(x_min: float, x_max: float, y_min: float, y_max: float)

Dataclass that represents an axis-aligned bounding box.

Attributes

height

width

x_min

x_max

y_min

y_max

Methods

from_shape

Returns a BoundingBox of a given Shape .

is_valid

Returns True if the bounding box has possible dimensions.

new

numpy

to_shape

Create a Shape from this BoundingBox.

update_arc

Update this BoundingBox from an Arc.

update_line

Update this BoundingBox from a Line.

update_point

Update this BoundingBox from a Point.

update_shape

Update this BoundingBox from a Shape.

update_vec

Update this BoundingBox from a numpy array.

update_xy

Update this BoundingBox from a single (x, y) point.

classmethod from_shape(shape: Shape) → BoundingBox

Returns a BoundingBox of a given Shape .

is_valid() → bool

Returns True if the bounding box has possible dimensions.

classmethod new() → BoundingBox
numpy() → ndarray
to_shape(attr: ElementAttributes) → Shape

Create a Shape from this BoundingBox.

update_arc(arc: Arc) → None

Update this BoundingBox from an Arc.

update_line(line: Line) → None

Update this BoundingBox from a Line.

update_point(point: Point) → None

Update this BoundingBox from a Point.

update_shape(shape: Shape) → None

Update this BoundingBox from a Shape.

update_vec(v: ndarray[3]) → None

Update this BoundingBox from a numpy array.

update_xy(x: float, y: float) → None

Update this BoundingBox from a single (x, y) point.

property height: float
property width: float
x_max: float
x_min: float
y_max: float
y_min: float