Split
Split a point, line or curve into many smaller points.
const p = new Point({radius: 100})
let points = p.split(4)
Lines and curves share one split(count, options) signature:
// both ends included
curve.split(20)
// ends excluded
curve.split(20, { inner: true })
// equal arc-length spacing
curve.split(20, { even: true })
// a point every 10 units
curve.split({ every: 10 })
// lerp radius/rotation a -> b
curve.split(20, { hinted: true })
// face a point
curve.split(20, { lookAt: point })
// rotate each point (radians)
curve.split(20, { angle: Math.PI / 2 })
A bare number as the second argument is treated as angle.
Meta Data
| title | Split |
| dependencies | () |
| unused_keys | () |
| unknown_keys | ('files',) |
| files | ['', 'functions/clamp.js'] |
| filepath_exists | True |
| path | split-v2 |
| filepath | split-v2.js |
| clean_files | ('functions/clamp.js',) |
-
ClassDeclarationclass
BezierArcTable
extends Noneclass comments:Cumulative chord lengths at
samplesevenly spacedtvalues, used to map an arc-length distance back tot. Reused across frames;update()only resamples when the control points or sample count change.-
dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])
Cumulative chord lengths at
samplesevenly spacedtvalues, used to map an arc-length distance back tot. Reused across frames;update()only resamples when the control points or sample count change.
ClassDeclarationclassPointListSplit
extends Noneclass comments:Buildin split functionality for a pointlist.
ExpressionStatement:
dict_keys(['type', 'expression', 'pos'])ExpressionStatement:
dict_keys(['type', 'expression', 'pos'])ExpressionStatement:
dict_keys(['type', 'expression', 'pos']) -
splitToPointList(point, count).pen.indicators(ctx)
p1.rotation = rotation || point.rotation