@roboshoes/bezier
TypeScript icon, indicating that this package has built-in type declarations

0.3.2 • Public • Published

bezierTo

Draws bezier curves with arbitrary anchor points.

Utility function that allows to draw bezier curves with arbitrary anchor points using consecutive quadratic curves.

This utility does not plot. It simply draws the lines using the canvas context. Calls to .stroke() or .fill() are necessary.

Example

import { bezierTo } from "@roboshoes/bezier";

context.moveTo( 10, 10 );

bezierTo( context, [
    { x: 30, y: 30 },
    { x: 100, y: 200 },
    { x: 23, y: 56 },
    { x: 1344, y: 57 },
] );

context.stroke();

Package Sidebar

Install

npm i @roboshoes/bezier

Weekly Downloads

0

Version

0.3.2

License

MIT

Unpacked Size

1.76 kB

Total Files

4

Last publish

Collaborators

  • roboshoes