Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simplifying a cubic bezier path?

I'm trying to achieve something close to what Adobe Illustrator does with the brush tool. It correctly analyzes and simplifies the path, including its bezier handles. I implemented the Ramer–Douglas–Peucker_algorithm however, it wound up not really being what I needed. It works very well for line segments, but doesn't factor in bezier handles. Is there an algorithm that can do like this algorithm, but take into consideration cubic bezier handles? The problem with this one is that a curve could be at an angle but the algorithm only sees a straight line.

Thanks

like image 304
jmasterx Avatar asked Aug 16 '10 21:08

jmasterx


1 Answers

You probably want to explore least squares fitting for Bezier curves. Here's one thread and a pdf that may be helpful.. I did this sort of thing several years ago, and found one of Gerald Farin's books helpful, but I can't remember which one.

like image 145
brainjam Avatar answered Sep 27 '22 01:09

brainjam