Polygon
Generates a regular polygon with a configurable number of sides and optional rounded corners.
Category: Shapes Menu path: Shapes > Polygon
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
out | shape | output | Polygon shape data |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
radius | scalar | 100 | Circumscribed radius in pixels (center to vertex) |
sides | scalar | 6 | Number of sides (3 = triangle, 4 = diamond, 5 = pentagon, 6 = hexagon, etc.) |
cornerRadius | scalar | 0 | Corner rounding radius in pixels (0 = sharp vertices) |
Expose Channels
When enabled (E button on node header), adds input ports that override params via edge connections:
| Port | Type | Overrides |
|---|---|---|
radius_in | scalar | radius |
sides_in | scalar | sides |
cornerRadius_in | scalar | cornerRadius |
How It Works
Generates a closed regular polygon centered at the origin in local space. Vertices are evenly distributed around a circle of the given radius. When cornerRadius is greater than zero, each vertex is replaced with a circular arc, softening the corners. 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 hexagon
Polygon -> Transform2D -> DrawShape -> Output. Default settings produce a hexagon with radius 100.
Triangle
Set sides to 3 for an equilateral triangle. Increase cornerRadius for a rounded triangle.
Animated morphing
Keyframe sides from 3 to 12 (or connect a Time-driven expression to sides_in) for a shape that smoothly gains vertices over time.
Star base
Use a low side count (5-6) with high cornerRadius as a starting point, then feed into ShapeDeform for star-like variations.
Tips
- Press P to activate the Polygon shelf tool for click-drag creation in the viewport.
sidesis treated as a float internally -- fractional values blend between whole-number shapes.- Shapes are centered at the origin. Use Transform2D for all positioning and rotation.
- A polygon with 4 sides is oriented as a diamond. For a square, use Rectangle instead.
Related Nodes
- Rectangle -- axis-aligned rectangle (better for squares and cards)
- Circle -- perfect circle
- ShapeDeform -- per-vertex deformation for more complex shapes
- Transform2D -- positions and scales the shape in the composition
- DrawShape -- rasterizes shapes to pixels with fill/stroke