Renderables
ClosedSpline
A smooth closed shape through a list of points.
Object type renderable pins
A closed spline draws a smooth outline through its points, in order, and
back to the first one, smooth there too. It's the rounded version of a
Polygon through the same points. The points are
relative to 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 |
| points | Array<Point> | |
| tension | number |
Nodes
Break ClosedSpline
Node id break/ClosedSpline
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| object | ClosedSpline | type default |
Outputs
Make ClosedSpline
Node id make/ClosedSpline
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" } | |
| points | Array<Point> | [{ x: -100, y: 0 }, { x: 0, y: -75 }, { x: 100, y: 0 }, { x: 0, y: 75 }] | |
| tension | number | 0 |
Outputs
| Name | Type | Notes |
|---|---|---|
| object | ClosedSpline |
Set ClosedSpline
Node id set/ClosedSpline
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| object | ClosedSpline | type default | |
| position | Point | — | |
| rotation | number | — | |
| scale | number | — | |
| fill | Paint | — | |
| stroke | Stroke | — | |
| points | Array<Point> | — | |
| tension | number | — |
Outputs
| Name | Type | Notes |
|---|---|---|
| object | ClosedSpline |
Lerp ClosedSpline
Node id lerp/ClosedSpline
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| a | ClosedSpline | type default | |
| b | ClosedSpline | type default | |
| t | number | 0.5 |
Outputs
| Name | Type | Notes |
|---|---|---|
| result | ClosedSpline |
Notes
- The curve. Between each pair of neighbouring points the outline is one cubic Bézier curve, shaped by the points around it (a centripetal Catmull-Rom spline). Unevenly spaced points don't make it loop or form sharp kinks, and exported SVG files keep the exact curves. The outline can bulge a little past the points.
- Tension.
tension, from 0 to 1, straightens the outline: 0 (the default) is the roundest, 1 gives the polygon through the points. Values outside 0 to 1 are a node error. - Few points. With fewer than 3 different points, nothing is drawn (no error). A point repeated right after itself, or the first point repeated at the end, counts once.
- Default. Make ClosedSpline gives a rounded blob through (-100, 0), (0, -75), (100, 0) and (0, 75).
- Blobs. Points from Sample on a circle, moved by Jitter, make organic, pebble-like shapes.
- Path nodes. Point At and Sample give
each piece an equal share of
t, whatever its length;t= 0 and 1 are the first point. Segments doesn't work on closed splines.
Lerp
Lerp ClosedSpline blends each point with the point at the same index, the
tension, the transform, fill and stroke. Both must have the same number of
points, else it's a node error. t is clamped to 0, 1.