UNPKG

@remotion/paths

Version:

Utilities for working with SVG paths

15 lines (14 loc) 568 B
/** * de Casteljau's algorithm for drawing and splitting bezier curves. * Inspired by https://pomax.github.io/bezierinfo/ * * @param {Number[][]} points Array of [x,y] points: [start, control1, control2, ..., end] * The original segment to split. * @param {Number} t Where to split the curve (value between [0, 1]) * @return {Object} An object { left, right } where left is the segment from 0..t and * right is the segment from t..1. */ export declare function decasteljau(points: number[][], t: number): { left: number[][]; right: number[][]; };