curve-intersection
Bezier curve intersection algorithm and utilities.
Extracted from the Paper.js implementation of bezier clipping.
Installation
npm install --save curve-intersection
Usage
If your platform doesn't support es6 yet, you can require('curve-intersection/es3')
.
; // coordinates of the control pointslet curves = 253 214 -934 -1805 909 1772 -31 -158 269 -226 -1963 48300000000000004 1934 -52 -218 24 ; let intersections = ; let canvas = document;canvaswidth = 200;canvasheight = 200;documentbody;let ctx = canvas;ctx; for let curve of curves ctx; ctx; ctx; ctx; ctx; for let intersection of intersections let t1 p1 t2 p2 = intersection; ctx; ctx; ctx; ctx;