bpmn-io / path-intersection

Computes the intersection between two SVG paths.
https://www.npmjs.com/package/path-intersection
MIT License
106 stars 9 forks source link

Use improved bezier curve intersection detection algorithm #5

Closed nikku closed 4 years ago

nikku commented 4 years ago

According @barmac we use an overly complex algorithm to compute our quadratic and cubic bezier curve intersections.

We could consider incorporating the bezier.js intersection logic and see if it improves our library in terms of speed, complexity, and/or bundle size.

barmac commented 4 years ago

We use Beziér clipping and according to this article it is

...marginally slower than an algorithm based on implicitization (...) for curves of degree four and less...

Beziér curves in SVG path are either degree two or three.

nikku commented 4 years ago

Open for external contributions.