rect()
Draws a rectangle with the given width and optional height.
Returns: Rect
tip
See the guide for detailed usage examples.
Signatures
rect(width: number, height?: number): Rect
Draws a rectangle with the given width and optional height.
| Parameter | Type | Description |
|---|---|---|
width | number | The rectangle width |
height | number | The rectangle height (defaults to width) (optional) |
rect(start: Point2DLike, width: number, height?: number): Rect
Draws a rectangle at a given start point.
| Parameter | Type | Description |
|---|---|---|
start | Point2DLike | The start point (bottom-left corner) |
width | number | The rectangle width |
height | number | The rectangle height (defaults to width) (optional) |
note
All signatures also accept an optional targetPlane parameter as the last argument to draw on a specific plane.