catmullRom
import { catmullRom } from 'pixi-silk';
function catmullRom(
flat: number[],
closed?: boolean,
step?: number,
alpha?: number
): number[];
Samples a centripetal Catmull-Rom spline through flat points. It has no cusps or self-loops
within a segment. closed adds the segment back to the first point. step is the target sample
spacing in local units, at most 64 per segment. alpha 0.5 is centripetal (0 uniform, 1
chordal). Fewer than 3 points come back as a copy.
Parameters#
| Parameter | Type | Default value |
|---|---|---|
flat | number[] | undefined |
closed | boolean | false |
step | number | 2 |
alpha | number | 0.5 |
Returns#
number[]