
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
curve-intersection
Advanced tools
Bezier curve intersection algorithm and utilities.
Extracted from the Paper.js implementation of bezier clipping.
npm install --save curve-intersection
If your platform doesn't support es6 yet, you can require('curve-intersection/es3')
.
import {curveIntersections} from 'curve-intersection';
// coordinates of the control points
let curves = [
[ 25.3, 21.4, -93.4, -180.5, 90.9, 177.2, -31, -15.8 ],
[ 26.9, -22.6, -196.3, 48.300000000000004, 193.4, -52, -21.8, 24 ]
];
let intersections = curveIntersections(curves[0], curves[1]);
let canvas = document.createElement('canvas');
canvas.width = 200;
canvas.height = 200;
document.body.appendChild(canvas);
let ctx = canvas.getContext('2d');
ctx.translate(100, 100);
for (let curve of curves) {
ctx.beginPath();
ctx.moveTo(curve[0], curve[1]);
ctx.bezierCurveTo(curve[2], curve[3], curve[4], curve[5], curve[6], curve[7]);
ctx.closePath();
ctx.stroke();
}
for (let intersection of intersections) {
let [t1, p1, t2, p2] = intersection;
ctx.beginPath();
ctx.arc(p1[0], p1[1], 5, 0, 2 * Math.PI, false);
ctx.closePath();
ctx.fill();
}
FAQs
Bezier curve intersection algorithm and utilities
The npm package curve-intersection receives a total of 4 weekly downloads. As such, curve-intersection popularity was classified as not popular.
We found that curve-intersection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.