Renderables
Polygon
A closed shape through a list of vertices.
Object type renderable pins
A polygon joins its vertices in order and closes the outline back to the
first one. The vertices are relative to the polygon's 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 |
| vertices | Array<Point> | |
| worldVertices | Array<Point> | read-only |
| segments | Array<Segment> | read-only |
Nodes
Break Polygon
Node id break/Polygon
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| object | Polygon | type default |
Outputs
Make Polygon
Node id make/Polygon
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" } | |
| vertices | Array<Point> | [{ x: 0, y: 0 }, { x: 100, y: 0 }, { x: 120, y: 100 }, { x: 0, y: 70 }] |
Outputs
| Name | Type | Notes |
|---|---|---|
| object | Polygon |
Set Polygon
Node id set/Polygon
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| object | Polygon | type default | |
| position | Point | — | |
| rotation | number | — | |
| scale | number | — | |
| fill | Paint | — | |
| stroke | Stroke | — | |
| vertices | Array<Point> | — |
Outputs
| Name | Type | Notes |
|---|---|---|
| object | Polygon |
Lerp Polygon
Node id lerp/Polygon
Inputs
Outputs
| Name | Type | Notes |
|---|---|---|
| result | Polygon |
Notes
- Default. Make Polygon gives a four-sided shape with vertices (0, 0), (100, 0), (120, 100) and (0, 70).
- At least three vertices. With fewer, the polygon has no area to fill.
- From other nodes.
verticesis anArray<Point>: it can come from Make Array, a lattice or Sample, for instance. - Local and world vertices. Break Polygon's
verticesare the same relative points Make Polygon takes, so a polygon broken and made again from itsposition,rotation,scaleandverticesis unchanged.worldVertices(read-only) are the points as drawn on the page, with the position, rotation and scale applied.segments(read-only) are the sides as drawn, too.
Lerp
Lerp Polygon blends each vertex with the vertex at the same index, plus the
transform, fill and stroke. Both polygons must have the same number of
vertices, else it's a node error. t is clamped to 0, 1.
Related types
- RegularPolygon, for equal sides and angles.
- Polyline, the open version, without a fill.
- ClosedSpline, a smooth outline through the same points.