Renderables
RegularPolygon
A polygon with equal sides and angles, around its position.
Object type renderable pins
A regular polygon has sides equal sides, with its corners at radius
from its position. Like every Shape, it has a fill
and a stroke.
Hierarchy
- Parents
Shape→Renderable- Subtypes
- None
Properties
| Name | Type | Notes |
|---|---|---|
| position | Point | from Renderable |
| rotation | number | from Renderable |
| scale | number | from Renderable |
| opacity | number | read-only from Renderable |
| blendMode | BlendMode | read-only from Renderable |
| fill | Paint | from Shape |
| stroke | Stroke | from Shape |
| sides | number | |
| radius | number | |
| vertices | Array<Point> | read-only |
| worldVertices | Array<Point> | read-only |
| segments | Array<Segment> | read-only |
Nodes
Break RegularPolygon
Node id break/RegularPolygon
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| object | RegularPolygon | type default |
Outputs
Make RegularPolygon
Node id make/RegularPolygon
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| position | Point | { x: 0, y: 0 } | |
| rotation | number | 0 | |
| scale | number | 1 | |
| fill | Paint | { r: 128, g: 128, b: 128, a: 1 } | |
| stroke | Stroke | { width: 1, color: { r: 0, g: 0, b: 0, a: 1 }, dashStyle: "SOLID", caps: "round" } | |
| sides | number | 6 | |
| radius | number | 100 |
Outputs
| Name | Type | Notes |
|---|---|---|
| object | RegularPolygon |
Set RegularPolygon
Node id set/RegularPolygon
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| object | RegularPolygon | type default | |
| position | Point | — | |
| rotation | number | — | |
| scale | number | — | |
| fill | Paint | — | |
| stroke | Stroke | — | |
| sides | number | — | |
| radius | number | — |
Outputs
| Name | Type | Notes |
|---|---|---|
| object | RegularPolygon |
Lerp RegularPolygon
Node id lerp/RegularPolygon
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| a | RegularPolygon | type default | |
| b | RegularPolygon | type default | |
| t | number | 0.5 |
Outputs
| Name | Type | Notes |
|---|---|---|
| result | RegularPolygon |
Notes
- Default. Make RegularPolygon gives a hexagon (6 sides) of radius 100.
- Read-only vertices. The vertices follow from
sidesandradius, so RegularPolygon isn't a subtype of Polygon: usesidesandradiusto change it. Break RegularPolygon givesverticesrelative to the position, andworldVerticesandsegmentsas drawn on the page.
Lerp
Lerp RegularPolygon blends the radius, the transform, fill and stroke.
Both must have the same number of sides, else it's a node error. t is
clamped to 0, 1.