intersections between bezier curves of order 2, 3 and lines and rectangles
npm install bezier-intersectSet of functions to find intersections between lines and rectangles and Bezier curves of order 2 and 3. Based on thelonious/js-intersections, but with the abstractions removed and some performance tweaking.
```
npm i -S bezier-intersect
`js`
import {
quadBezierLine,
cubicBezierLine,
quadBezierAABB,
cubicBezierAABB
} from 'bezier-intersect';
`html`
Calculates the intersection points between the quadratic Bezier curve and line segment. If result is passed, returns the exact number of intersections, and stores them in result as [x, y, x, y]. If not - stops at the first intersection and returns 1 or 0 if there are no intersections.
Calculates the intersection points between the quadratic Bezier curve and axis-aligned box. If result is passed, returns the exact number of intersections, and stores them in result as [x, y, x, y]. If not - stops at the first intersection and returns 1 or 0 if there are no intersections.
Calculates the intersection points between the cubic Bezier curve and line segment. If result is passed, returns the exact number of intersections, and stores them in result as [x, y, x, y]. If not - stops at the first intersection and returns 1 or 0 if there are no intersections.
Calculates the intersection points between the cubic Bezier curve and axis-aligned box. If result is passed, returns the exact number of intersections, and stores them in result as [x, y, x, y]. If not - stops at the first intersection and returns 1 or 0` if there are no intersections.
- [ ] More tests
- [ ] Bezier/Polygon
- [ ] Bezier/Ellipse/Circle
MIT