Rectangle

A Rectangle is a quadrilateral with four right angles.

Constructor

new Rectangle(bbox, rotationopt)

Creates a new Rectangle from a BoundingBox and an optional rotation.

Parameters:
NameTypeAttributesDescription
bboxBoundingBox

The BoundingBox of the rectangle.

rotationnumber | null<optional>

The rotation of the rectangle, if any.

Classes

Rectangle

Members

area

Returns the area of the rectangle.

bbox

Returns the size of the rectangle.

bottom

Returns the bottom of the rectangle as a Point2D.

bottom_left

Returns the bottom left corner of the rectangle as a Point2D.

bottom_right

Returns the bottom right corner of the rectangle as a Point2D.

center

Returns the center of the rectangle as a Point2D.

left

Returns the left of the rectangle as a Point2D.

position

Returns the position of the rectangle.

Returns the right of the rectangle as a Point2D.

rotation

Returns the rotation of the rectangle.

top

Returns the top of the rectangle as a Point2D.

top_left

Returns the top left corner of the rectangle as a Point2D.

top_right

Returns the top right corner of the rectangle as a Point2D.

vector_object_builder

Gets a VectorObjectBuilder with the rectangle's points.