Is this script idea possible?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
DK
Posts: 2895
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Hi Rasheed,
I only used it on some text and using it's default settings it selected a lot of the extra points that were not needed. There were a couple of corner points selected but I Ctrl Clicked them out and added a couple of extras and then hit delete. Worked fine. I must admit, I don't know what i'm doing when I alter the numeric values, so I leave it as is.

D.K
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

Ah, well it seems to work for text curves. Sort of. The disadvantage of selecting points is that you still need to check if the curve hasn't changed to much.

What I want is consecutive points being welded into a new point, while the curvature of the new points and its neighbors is recalculated. If that is done, you don't need to check all changes in your artwork.

Concerning the user interface, I only want one parameter in there: smoothness, and thee options: work on selected points only, do multiple passes, and show totals. That is the UI of Flash, and it always worked very well for me.

It isn't too difficult to calculate the smoothness of a selection of points. If the average curvature is equal to the curvature of a Peaked point (0.001), the smoothness is zero percent. If the average curvature is equal to the curvature of a Smoothed point (0.3), the smoothness is 100 percent.

The script should try to come as close to the smoothness as possible, by the process I've described earlier (weld points, adjust curvature). The amount of smoothness you specify as an user, is the relative amount of change in curvature value for each selected curve. The approximation of the average curvature value of all selected curves can't be done in one pass, most of the times, so there should be a multiple pass option. Although the point count can be done visually in AS, it is always useful to have a number value, and a percentage of point reduction, so you can see how effective the script was.

And, of course, the script should work for straight lines as well.
Post Reply