A few years back I wrote a basic bezier curve library with boolean operations in C/C++. Bezier curves are fantastic when you get started, they're easy to deal with and the math is well documented online.<p>However the edge cases are nightmares to deal with. Intersection (and similar operations) typically work by approximating via subdivision, so you'll never get an accurate answer, which is important when dealing with boolean operations. You'll wind up piling on hacks. One edge case I wound up being due to a floating point arithmetic error, which was fun because my computer science degree finally wound up coming in handy.<p>It makes me appreciate the work that the guys who made paper.js. They've done some outstanding work, and it's by far the most superior open source vector graphics framework out there.
For a technical analysis of Hobby splines I recommend HN raphlinus's PhD thesis Section 4.7 [0] referenced just yesterday in the submission on Google Font Analytics [1].<p>[0] <a href="https://levien.com/phd/thesis.pdf" rel="nofollow">https://levien.com/phd/thesis.pdf</a><p>[1] <a href="https://news.ycombinator.com/item?id=22369500" rel="nofollow">https://news.ycombinator.com/item?id=22369500</a>
I really prefer Catmull-Rom splines (<a href="https://en.wikipedia.org/wiki/Centripetal_Catmull–Rom_spline" rel="nofollow">https://en.wikipedia.org/wiki/Centripetal_Catmull–Rom_spline</a>). They’re not as attractive as Bézier curves, but the curve passes <i>through</i> the control points, which makes them a ton easier to draw.
> Because they are perfectly compatible with industry-standard Béziers, there is very little disadvantage to be had.<p>Anyone know what "compatible" means as used here?<p>As an aside, I personally prefer NURBS, they feel much more "pure" if that makes any sense. Plus they can produce real circles, which is a pretty nice feature of a curve-system.
Much better curves for editing are k-curves (see <a href="http://faculty.cs.tamu.edu/schaefer/research/kcurves.pdf" rel="nofollow">http://faculty.cs.tamu.edu/schaefer/research/kcurves.pdf</a>) which are starting to pop up in all new Adobe tools also.
When I was fighting some splines at work I found this website very good and very interactive when explaining how Bezier curves work under the hood, a great resource!<p><a href="https://pomax.github.io/bezierinfo/" rel="nofollow">https://pomax.github.io/bezierinfo/</a>
I always found Bezier curves strange - they seem awful as a way to approximate curves. When you "draw" with a Bezier curve in Illustrator (or Inkscape), the lines tend to fly all over the place - they can be an OK approximation but they're often very unstable. The problem, I think, is that any polynomial or equivalent higher order is going to have this instability property.