Skip to main content

split-by-length

function splitByLength(ps: number[][], maxLength: number): number[]

Defined in transformation/split/split-by-length.ts:17

Split the given bezier curve into pieces (given as an array of parameter t values) such that the longest curve length is guaranteed to be lower than the given max length.

Note!
Green circles are draggable!
0

Parameters:

NameTypeDescription
psnumber[][]an order 0,1,2 or 3 bezier curve given as an ordered array of its control point coordinates, e.g. [[0,0], [1,1], [2,1], [2,0]]
maxLengthnumber