Subdivde a rectangle into 2 rectangles, by row or by column
Group of 2 Pts representing a Rectangle
a value between 0 to 1 to indicate the split ratio
if true
, split into 2 rows. Default is false
which splits into 2 columns.
an array of 2 Groups of rectangles
Check if a rectangle is within the bounds of another rectangle
a Group of 2 Pts representing a rectangle
a Group of 2 Pts representing a rectangle
if true
, reset the bounding box. Default is false
which assumes the rect's first Pt at is its top-left corner.
Quick way to check rectangle intersection.
For more optimized implementation, store the rectangle's sides separately (eg, Rectangle.sides()
) and use Polygon.intersectPolygon2D()
.
a Group of 2 Pts representing a rectangle
a Group of 2 Pts representing a rectangle
Generated using TypeDoc
Rectangle class provides static functions to create and operate on rectangles. A rectangle is usually represented as a Group of 2 Pts, marking the top-left and bottom-right corners of the rectangle. You can use the static function as-is, or apply the
op
method in Group or Pt to many of these functions. See Op guide for details.