Ok, I made some tests, here is a stack with the results.
1. To avoid to remove edges the stack splits every polygon in different segments (e.g an N is split in 3 segments), processes individually each segment and then re-compose the segments before to assign the points to the graphic.
2. The external dimension of the polygon (the rectangle), is preserved by restoring the original rect after the process. In this way I try to avoid to change the dimensions of the polygons created by the user.
4. Straight lines (for example the bars of a T) are not processed by excluding graphics with a certain wide or height of the rect. Maybe here would be better to use some proportional algorithm I think, or more better a way to distinguish a line from a curve.
All this can be improved a lot, if you have ideas or solutions please modify the stack.
thank you. What I'm trying to do is an app for write and draw with the finger. Unfortunately to date I haven't find a way to have smooth polygons. All the project are interesting in theory but I can't find a way to implement these ideas in my project, probably because this requires knowledge of mathematics that I don't have. For example, the stack with the Bezier lines is very nice, but I don't know how to implement it in a project where the user draws with the finger.
For this reason, I said that if someone finds a working solution, even professional (with the meaning that the programmer realizes it for work, so for a fee), I'd be willing to consider pay for it or fund the project.
Hi, Mag. If you look in the LiveCode user samples for "Air Traffic Control", you'll find an example of some smoothing as lines are drawn with the mouse. It's not great, but does work - and can be improved if you really need it
Also have a look at the Doodle Cards app (created with LC for iOS). It doesn't use any smoothing, but works fine for drawing with fingers - I've got a LOT of examples created with it, as a few of us were using the same drawing code in a 'draw something' style game.
Hi splash21, thank you for the tip, I will study the stack.
Hi [-hh], I tried the stack but unfortunately it seems that 5 becomes a S, 3 becomes a kind of snake... maybe there is something to set that I don't understand
Rounding that you have achieved is very good but has a problem: forces the user to draw what they wrote in different segments. If the process of separating a polygon in segments it were made by the code you would have a really great tool.