I've used this code to implement a freehand drawing tool in Java and Graphics2D. So I have a Path2D made up of a lot points. Is there an algorithm to smooth this line? I don't mean anti-aliasing, I mean something like converting the path to a path of bezier curves. Something like this, but with a Path2D as input. I would think this a recurring problem but I couldn't really find something useful.
I've found what I needed at: http://javagraphics.blogspot.com/2010/06/shapes-implementing-freehand-pencil.html
Edit: and since I now know the exact term for this problem (curve fitting) I can google it better and also found this post: Java curve fitting library
Edit: also look at http://johnsogg.blogspot.com/2010/01/cardinal-splines-and-catmull-rom.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With