Skip to main content

rect()

Draws a rectangle with the given width and optional height.

Returns: Rect

tip

See the guide for detailed usage examples.

Signatures

rect(width: NumberParam, height?: NumberParam): Rect

Draws a rectangle with the given width and optional height.

ParameterTypeDescription
widthNumberParamThe rectangle width
heightNumberParamThe rectangle height (defaults to width) (optional)

rect(start: Point2DLike, width: NumberParam, height?: NumberParam): Rect

Draws a rectangle at a given start point.

ParameterTypeDescription
startPoint2DLikeThe start point (bottom-left corner)
widthNumberParamThe rectangle width
heightNumberParamThe rectangle height (defaults to width) (optional)

rect(targetPlane: SceneObject | PlaneLike, width: NumberParam, height: NumberParam): Rect

Draws a rectangle with given dimensions on a specific plane.

ParameterTypeDescription
targetPlaneSceneObject | PlaneLikeThe plane to draw on
widthNumberParamThe rectangle width
heightNumberParamThe rectangle height