import {CubicBezier2D} from "kld-contours";
import {Intersection, Point2D} from "../index.js";
// create beziers
const b1 = new CubicBezier2D(
new Point2D(203, 140),
new Point2D(206, 359),
new Point2D(245, 6),
new Point2D(248, 212)
);
const b2 = new CubicBezier2D(
new Point2D(177, 204),
new Point2D(441, 204),
new Point2D(8, 149),
new Point2D(265, 154)
);
// create polylines
const p1 = b1.toPolygon2D();
const p2 = b2.toPolygon2D();
// find intersections
const result = Intersection.intersectPolylinePolyline(p1.points, p2.points);
// build SVG file showing beziers, polylines, and intersection points
const intersectionSVG = result.points.map(p => {
return ``;
}).join("\n ");
const svg = ``;
console.log(svg);