bezier-subdivide
v0.0.2
Published
Bezier curve subdivision
Downloads
40
Readme
bezier-subdivide
Bezier curve subdivision in JavaScript
Based on Anti-Grain Geometry bezier subdivision
Usage
Points are represented by 2-element arrays.
var subdivide = require("bezier-subdivide");
var curve = [
[100, 200],
[200, 50],
[50, 100],
[200, 200],
];
var points = subdivide(curve); // subdivided points
subdivide(points[, options])
points
: Array of points (start, control point 1, control point 2, end)
Types
type Point = [number, number];
interface Options {
approximationScale?: number;
angleTolerance?: number;
cuspLimit?: number;
}
declare function subdivide(
bezierPoints: [Point, Point, Point, Point],
options?: Options
): Point[];
export default subdivide;