我已经使用这段代码在Java和Graphics2D中实现了一个徒手绘图工具。 所以我有一个由很多点组成的Path2D。 有没有算法来平滑这条线? 我不是指抗锯齿,我的意思是将路径转换为贝塞尔曲线的路径。 像这样的东西,但有一个Path2D作为输入。 我认为这是一个反复出现的问题,但我真的找不到有用的东西。
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.
最满意答案
我找到了我需要的东西: http : //javagraphics.blogspot.com/2010/06/shapes-implementing-freehand-pencil.html
编辑:因为我现在知道这个问题的确切术语(曲线拟合)我可以更好地谷歌它也发现这篇文章: Java曲线拟合库
编辑:另请参阅http://johnsogg.blogspot.com/2010/01/cardinal-splines-and-catmull-rom.html
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
更多推荐
发布评论