Skip to content

Rectangle ​

Generates a rectangular shape with optional rounded corners.

Category: Shapes Menu path: Shapes > Rectangle

Ports ​

PortTypeDirectionDescription
outshapeoutputRectangle shape data

Parameters ​

ParamTypeDefaultDescription
widthscalar200Width in pixels
heightscalar200Height in pixels
cornerRadiusscalar0Corner rounding radius in pixels (0 = sharp corners)

Expose Channels ​

When enabled (E button on node header), adds input ports that override params via edge connections:

PortTypeOverrides
width_inscalarwidth
height_inscalarheight
cornerRadius_inscalarcornerRadius

How It Works ​

Generates a closed rectangular path centered at the origin in local space. When cornerRadius is greater than zero, the corners are replaced with circular arcs. The shape is pure geometry data (no GPU allocation) and must be rasterized via DrawShape to produce a visible image.

Usage Examples ​

Basic: Draw a rectangle ​

Rectangle -> Transform2D -> DrawShape -> Output. Set width and height to define size. Use Transform2D to position it in the composition.

Rounded UI element ​

Set cornerRadius to 20-40 for a pill-like or card shape. Combine with DrawShape's fill and stroke for panel-style graphics.

Procedural sizing ​

Connect a Math or Time node to width_in / height_in expose channels for animated or expression-driven dimensions.

Tips ​

  • Press R to activate the Rectangle shelf tool, which lets you click-drag in the viewport to draw a rectangle. This auto-creates the full Rectangle -> T2D -> DrawShape -> Output chain.
  • Shapes are centered at the origin. Use Transform2D for all positioning and scaling.
  • All params are keyframeable for animation.
  • Corner radius is clamped to half the shorter side (a 200x100 rectangle caps at 50).
  • Circle -- single-radius circular shape
  • Polygon -- regular polygon with configurable sides
  • Transform2D -- positions and scales the shape in the composition
  • DrawShape -- rasterizes shapes to pixels with fill/stroke