A way to reduce the number of points to describe graphical shapes and to get nice, smooth lines.
Implements Lang Simplification and McMaster’s Slide Averaging Algorithm.
Try the demo:
Line Generalization AS2
(developed and published originally in 2005)
Update: AS3 version of the core classes (without Demo-Editor):
Line Generalization AS3
8 Comments
1 Fred3d wrote:
hi andreas,
i have seen your small master of pieces, like this one and the gradient tool !
i’m the author of flashpaint, and i’m studying some good stuff around for a newer version of the application in as2 or 3.
i have also a tool to generate code from any flashpaint drawing, i have to publish that once.
this line tool could be very suitable to generate less data to send to the server !
where did you find informations for these algorithms ?
CGI books ?
bye.
2 admin wrote:
@Fred3d
Thanks for your kind words!
The purpose and principle of Lang Simplification and McMaster’s Slide Averaging Algorithm are perfectly explained in this tutorial:
http://www.sli.unimelb.edu.au/gisweb/LGmodule/LGSelect.htm (thanks to Jim Cheng for pointing this out).
As I’m not at all a Math guy that’s exactly the kind of explanation – visual, common sense – I needed to be able to recreate it in ActionScript.
I find flashpaint.com impressive – keep up the good work!
3 Martin Urbanek wrote:
Hi Andreas!
Thanks a lot for this script that implement the simplification and averaging algorithms. Since i’ve been trying to make it work in Actionscript 3 for two days now and i still fail:
Is there any possibility that you post a – AS3-version of LineGeneralization?
4 Andreas Weber wrote:
@Martin
Sure, find the Link to the AS3 source in the updated post above. Cheers!
5 Martin Urbanek wrote:
Just fantastic! That will definitely improve my AS3-drawing-experiment! Thanks!!!
6 robi hammerle wrote:
Hello, really cool work, i`m playing around with some drawing stuff, this class is really helpful for me. I´m getting an error when compiling, because the vars are not strongtyped
example: var len = points.length;
Am i doing wrong, or should i strongtype them anyway?
Thanks for sharing your stuff
Greetings from Vienna
Robi
7 Andreas Weber wrote:
Hi Robi
Thanks for your comment. Don’t have the time right now to look into it, sorry! Please let me know what you find out – thanks!
8 Horacio Cantu wrote:
You really have this style down! You really optimized the techniques used to make great art! With this kind of crisp enjoyable art you can go far on DA
5 Trackbacks