Hi,
A while ago I asked the Inkscape list whether there was interest in an implementation of my curve sketching algorithm (see the thread at http://sourceforge.net/mailarchive/message.php?msg_id=24902605). There seemed to be interest and I wrote a cleaner (and much faster) version, although this took longer than I anticipated. There are still a bunch of improvements possible, but at this point it's quite usable. The code and a windows installer for a demo binary are available at http://code.google.com/p/cornucopia-lib/ and there's some documentation.
I am completely unfamiliar with Inkscape's codebase, so the integration would need to be done by one of the Inkscape devs. As a proof-of-concept, however, I wrote a very crude replacement of the bezier_fit_cubic_r call with a call to Cornucopia in the pencil tool (patch attached--of course, you have to build and link to Cornucopia to try it). For the real thing, I'd need to find a better mapping from the "smoothness" slider in Inkscape to my myriad of parameters.
Is someone interested in working on this? I would, of course, help in what way I can (although I'm pretty busy these days and my response latency may be high occasionally).
Thanks,
-Ilya
On Mon, Apr 25, 2011 at 12:25 PM, Ilya Baran wrote:
Hi,
A while ago I asked the Inkscape list whether there was interest in an implementation of my curve sketching algorithm (see the thread at http://sourceforge.net/mailarchive/message.php?msg_id=24902605). There seemed to be interest and I wrote a cleaner (and much faster) version, although this took longer than I anticipated. There are still a bunch of improvements possible, but at this point it's quite usable. The code and a windows installer for a demo binary are available at http://code.google.com/p/cornucopia-lib/ and there's some documentation.
I like the fact that, judging by video, the testing app more or less allows to see the final curve as you draw, but I'm afraid that LPE based implementation will ruin half the fun.
P.S. Sadly, the app for testing doesn't build on Ubuntu 10.04 (both Qt and eigen dev packages installed, but the app is still missing some eigen related things).
Alexandre Prokoudine http://libregraphicsworld.org
Hi, Alexandre,
On Mon, Apr 25, 2011 at 11:33 AM, Alexandre Prokoudine <alexandre.prokoudine@...400...> wrote:
On Mon, Apr 25, 2011 at 12:25 PM, Ilya Baran wrote:
Hi,
A while ago I asked the Inkscape list whether there was interest in an implementation of my curve sketching algorithm (see the thread at http://sourceforge.net/mailarchive/message.php?msg_id=24902605). There seemed to be interest and I wrote a cleaner (and much faster) version, although this took longer than I anticipated. There are still a bunch of improvements possible, but at this point it's quite usable. The code and a windows installer for a demo binary are available at http://code.google.com/p/cornucopia-lib/ and there's some documentation.
I like the fact that, judging by video, the testing app more or less allows to see the final curve as you draw, but I'm afraid that LPE based implementation will ruin half the fun.
Unfortunately, it doesn't let you see the final curve as you draw--the fit is a global optimization, which requires the whole curve. It may be possible to get an incremental fitting by using the oversketching capability--I'll look into that. BTW, what would be the advantage of an LPE-based implementation?
P.S. Sadly, the app for testing doesn't build on Ubuntu 10.04 (both Qt and eigen dev packages installed, but the app is still missing some eigen related things).
You need Eigen 3--I expect there aren't packages for that yet, but it's super-easy to install, as it's header-only. If it doesn't build, please email me the error off-list and I may be able to help.
-Ilya
Alexandre Prokoudine http://libregraphicsworld.org
Fulfilling the Lean Software Promise Lean software platforms are now widely adopted and the benefits have been demonstrated beyond question. Learn why your peers are replacing JEE containers with lightweight application servers - and what you can gain from the move. http://p.sf.net/sfu/vmware-sfemails _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Mon, Apr 25, 2011 at 1:50 PM, Ilya Baran wrote:
I like the fact that, judging by video, the testing app more or less allows to see the final curve as you draw, but I'm afraid that LPE based implementation will ruin half the fun.
Unfortunately, it doesn't let you see the final curve as you draw
Oh, in comparison to current implementaton in Inkscape it actually _does_ let you see it, because the solver in libspiro does really crazy stuff at times :) From the video I do see that the approximation is very close to what you draw first.
BTW, what would be the advantage of an LPE-based implementation?
Apart from being able to render it anywhere? None, I'm afraid. LPE is _very_ simplistic. There has been talk about implementing advanced curves in SVG v2, but this is where Tav could provide some input, not me.
P.S. Sadly, the app for testing doesn't build on Ubuntu 10.04 (both Qt and eigen dev packages installed, but the app is still missing some eigen related things).
You need Eigen 3--I expect there aren't packages for that yet, but it's super-easy to install, as it's header-only. If it doesn't build, please email me the error off-list and I may be able to help.
I actually do have Eigen 3, fetched today as tarball from Mercurial or wherever it is they keep the dev tree :)
Alexandre Prokoudine http://libregraphicsworld.org
On 25-4-2011 11:58, Alexandre Prokoudine wrote:
On Mon, Apr 25, 2011 at 1:50 PM, Ilya Baran wrote:
I like the fact that, judging by video, the testing app more or less allows to see the final curve as you draw, but I'm afraid that LPE based implementation will ruin half the fun.
Unfortunately, it doesn't let you see the final curve as you draw
Oh, in comparison to current implementaton in Inkscape it actually _does_ let you see it, because the solver in libspiro does really crazy stuff at times :) From the video I do see that the approximation is very close to what you draw first.
BTW, what would be the advantage of an LPE-based implementation?
Apart from being able to render it anywhere? None, I'm afraid. LPE is _very_ simplistic. There has been talk about implementing advanced curves in SVG v2, but this is where Tav could provide some input, not me.
Regarding an LPE-based implementation, an advantage is that the original sketch is stored, so you can tweak the curve fit parameters afterwards and see what it does to the curve. A clear disadvantage is that it is inherently slower, as it has to do the refitting everytime you move/transform/etc the path. Morever as LPE, you cannot tweak the end result with the normal node-tool; you would have to tweak the original path, which is probably cumbersome as it has many more nodes, etc.
So, I would not implement this as an LPE only, but as a replacement for the curvefitting in the pencil-tool (just like you did :).
( The LPE talk is somewhat interesting, because right now we don't have a 'smoothing/fitting' LPE! )
Ciao, Johan
On Mon, 2011-04-25 at 13:58 +0400, Alexandre Prokoudine wrote:
Apart from being able to render it anywhere? None, I'm afraid. LPE is _very_ simplistic. There has been talk about implementing advanced curves in SVG v2, but this is where Tav could provide some input, not me.
There is a desire by some in the SVG working group to be add the ability to specify a number of points and have a curve automatically fitted through the points. The motivation is mostly for plotting data. I haven't heard much talk about this lately.
Tav
On Mon, 2011-04-25 at 13:33 +0400, Alexandre Prokoudine wrote:
On Mon, Apr 25, 2011 at 12:25 PM, Ilya Baran wrote:
I like the fact that, judging by video, the testing app more or less allows to see the final curve as you draw, but I'm afraid that LPE based implementation will ruin half the fun.
P.S. Sadly, the app for testing doesn't build on Ubuntu 10.04 (both Qt and eigen dev packages installed, but the app is still missing some eigen related things).
Alexandre, I'm not sure if you want to see something more complex, but for preview/testing purpose demo app runs quite fine under wine 1.3. Worked for me on Ubuntu 11.04.
Vlada
Alexandre Prokoudine http://libregraphicsworld.org
On Mon, Apr 25, 2011 at 5:07 PM, Vladimir Savic wrote:
On Mon, 2011-04-25 at 13:33 +0400, Alexandre Prokoudine wrote:
On Mon, Apr 25, 2011 at 12:25 PM, Ilya Baran wrote:
I like the fact that, judging by video, the testing app more or less allows to see the final curve as you draw, but I'm afraid that LPE based implementation will ruin half the fun.
P.S. Sadly, the app for testing doesn't build on Ubuntu 10.04 (both Qt and eigen dev packages installed, but the app is still missing some eigen related things).
Alexandre, I'm not sure if you want to see something more complex, but for preview/testing purpose demo app runs quite fine under wine 1.3. Worked for me on Ubuntu 11.04.
Ilya already fixed build env today, so it builds on Linux now :)
Alexandre Prokoudine http://libregraphicsworld.org
On 25-4-2011 10:25, Ilya Baran wrote:
... For the real thing, I'd need to find a better mapping from the "smoothness" slider in Inkscape to my myriad of parameters.
What would be the minimal amount of parameters for your fitting? If we decide to replace the current fitting with yours, it is easy to add parameters to the toolbar.
Ciao, Johan
participants (5)
-
Alexandre Prokoudine
-
Ilya Baran
-
Johan Engelen
-
Tavmjong Bah
-
Vladimir Savic