On Wed, Mar 31, 2010 at 5:21 PM, Ilya Baran <ibaran@...1007...> wrote:
The strokes in the paper are somewhat more complicated than what a non-Chuck-Norris artist would be able to draw in one second. For quick strokes that are well-approximated by three or fewer segments, the current implementation has a delay of about 0.2 seconds. I am not an artist, so I don't know if such a delay is acceptable.
Well, let's just try it then :) As I remember it's just a single function call from pen-context.cpp to run the fitting. You just need to adapt your algorithm to use our path representation structure (currently it's lib2geom almost everywhere) and you will have no problems plugging it in.
I currently have a tradeoff parameter that determines how important simplicity is versus accuracy, but I can binary search on it to turn it into a hard constraint on the number of segments (at a performance cost that I can't predict without running tests).
Actually we don't have a guarantee of a number of nodes in our current simplify algorithm either, and it often happens than a slight simplify produces more nodes than before. So it would be unfair to request this guarantee from you :) However, you need some way to estimate, given an arbitrary path, how high should the tradeoff parameter to be in order to make the result simpler (less nodes) in a reasonable majority of cases.