Hi,
I have just checked in to my private Coons Patch Mesh Gradient branch, code that allows the ability to create and edit mesh gradients. Warning: This code is a real Hack. It is known to segfault and eat kittens for lunch. It will need lots of reworking by real experts before one can hope to see it in Inkscape trunk (as well as dealing with the issue that meshes are not part of the SVG 1.2 standard... they have been accepted as part of SVG 2.0 but that standard is along way from being appearing even in a draft form).
What you can do with the code:
1. Create a simple one patch square mesh the size of an objects bounding box. (Select the third button on the Gradient Tool-Tool Bar and the double click the object.)
2. Drag corner nodes (diamonds).
3. Change color of corner nodes.
4. Drag handles (circles). There is no indication of what handle belongs with which corner node or path so it can be confusing.
5. Divide a row or column of patches into two rows or columns. (Double click on the lines connecting corner nodes. Double clicking elsewhere may lead to a crash.) At the moment, the row or column is split down the middle.
6. Save the mesh. The mesh is saved in the proposed SVG standard format (highly likely to change).
7. Read in saved meshes.
Some of what is missing:
1. Ability to undo node moves/color changes.
2. Ability to merge two rows or columns into one or delete edge rows or columns.
3. Ability to change paths between straight lines and Bezier curves. Handles are shown even for straight lines.
4. Display of Bezier curves (they are shown as straight lines).
5. Stability (I did tell you it will segfault, didn't I?).
6. Sane coding.
7. Properly handling of gradient copying.
8. Auto-creation of conical gradients or other non-square gradient types.
9. Output to PS/PDF/PNG(?)
10. Update to current trunk.
You can check out the code at:
https://code.launchpad.net/~tavmjong-free/inkscape/mesh
Tav
On Thu, Sep 22, 2011 at 5:14 PM, Tavmjong Bah <tavmjong@...8...> wrote:
You can check out the code at:
Awesome, started building it here :)
The predictable question is whether you are targeting for 0.49, since we seem to not be in a hurry for it anyway.
Alexandre Prokoudine http://libregraphicsworld.org
On Thu, Sep 22, 2011 at 5:14 PM, Tavmjong Bah wrote:
You can check out the code at:
Alas,
CXX sp-gradient.o sp-gradient.cpp: In function ‘cairo_pattern_t* sp_meshgradient_create_pattern(SPPaintServer*, cairo_t*, const NRRect*, double)’: sp-gradient.cpp:2355:53: error: ‘cairo_pattern_create_mesh’ was not declared in this scope sp-gradient.cpp:2363:48: error: ‘cairo_mesh_pattern_begin_patch’ was not declared in this scope sp-gradient.cpp:2364:102: error: ‘cairo_mesh_pattern_move_to’ was not declared in this scope sp-gradient.cpp:2391:114: error: ‘cairo_mesh_pattern_line_to’ was not declared in this scope sp-gradient.cpp:2398:111: error: ‘cairo_mesh_pattern_curve_to’ was not declared in this scope sp-gradient.cpp:2410:62: error: ‘cairo_mesh_pattern_set_corner_color_rgba’ was not declared in this scope sp-gradient.cpp:2413:46: error: ‘cairo_mesh_pattern_end_patch’ was not declared in this scope sp-gradient.cpp:2345:21: warning: unused variable ‘mg’ [-Wunused-variable] make[3]: *** [sp-gradient.o] Error 1
So I need Cairo from Git master?
Alexandre Prokoudine http://libregraphicsworld.org
On Thu, 2011-09-22 at 18:09 +0400, Alexandre Prokoudine wrote:
On Thu, Sep 22, 2011 at 5:14 PM, Tavmjong Bah wrote:
You can check out the code at:
Alas,
CXX sp-gradient.o sp-gradient.cpp: In function ‘cairo_pattern_t* sp_meshgradient_create_pattern(SPPaintServer*, cairo_t*, const NRRect*, double)’: sp-gradient.cpp:2355:53: error: ‘cairo_pattern_create_mesh’ was not declared in this scope sp-gradient.cpp:2363:48: error: ‘cairo_mesh_pattern_begin_patch’ was not declared in this scope sp-gradient.cpp:2364:102: error: ‘cairo_mesh_pattern_move_to’ was not declared in this scope sp-gradient.cpp:2391:114: error: ‘cairo_mesh_pattern_line_to’ was not declared in this scope sp-gradient.cpp:2398:111: error: ‘cairo_mesh_pattern_curve_to’ was not declared in this scope sp-gradient.cpp:2410:62: error: ‘cairo_mesh_pattern_set_corner_color_rgba’ was not declared in this scope sp-gradient.cpp:2413:46: error: ‘cairo_mesh_pattern_end_patch’ was not declared in this scope sp-gradient.cpp:2345:21: warning: unused variable ‘mg’ [-Wunused-variable] make[3]: *** [sp-gradient.o] Error 1
So I need Cairo from Git master?
Yes, sorry I forgot to mention that.
Tav
On Thu, Sep 22, 2011 at 6:39 PM, Tavmjong Bah wrote:
So I need Cairo from Git master?
Yes, sorry I forgot to mention that.
OK, got it to compile, but it crashes whenever I try to do anything about meshes.
E.g. double-click in gradient mesh mode:
sp_gradient_drag: New Mesh Gradient! No Draggers to Add /usr/local/bin/inkscape: symbol lookup error: /usr/local/bin/inkscape: undefined symbol: cairo_pattern_create_mesh
It also crashes when I try loading any of your samples from http://tavmjong.free.fr/SVG/MESH/Mesh_Inkscape.html.
I'm not sure whether you need a backtrace at this point, but if you want one, I'll be glad to help as soon as I figure out why > bt says there is no stack :)
Alexandre Prokoudine http://libregraphicsworld.org
Are you using Cairo stable by chance? On Sep 22, 2011 9:56 AM, "Alexandre Prokoudine" < alexandre.prokoudine@...400...> wrote:
On Thu, Sep 22, 2011 at 6:39 PM, Tavmjong Bah wrote:
So I need Cairo from Git master?
Yes, sorry I forgot to mention that.
OK, got it to compile, but it crashes whenever I try to do anything about meshes.
E.g. double-click in gradient mesh mode:
sp_gradient_drag: New Mesh Gradient! No Draggers to Add /usr/local/bin/inkscape: symbol lookup error: /usr/local/bin/inkscape: undefined symbol: cairo_pattern_create_mesh
It also crashes when I try loading any of your samples from http://tavmjong.free.fr/SVG/MESH/Mesh_Inkscape.html.
I'm not sure whether you need a backtrace at this point, but if you want one, I'll be glad to help as soon as I figure out why > bt says there is no stack :)
Alexandre Prokoudine http://libregraphicsworld.org
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Thu, 2011-09-22 at 20:54 +0400, Alexandre Prokoudine wrote:
On Thu, Sep 22, 2011 at 6:39 PM, Tavmjong Bah wrote:
So I need Cairo from Git master?
Yes, sorry I forgot to mention that.
OK, got it to compile, but it crashes whenever I try to do anything about meshes.
E.g. double-click in gradient mesh mode:
sp_gradient_drag: New Mesh Gradient! No Draggers to Add /usr/local/bin/inkscape: symbol lookup error: /usr/local/bin/inkscape: undefined symbol: cairo_pattern_create_mesh
It also crashes when I try loading any of your samples from http://tavmjong.free.fr/SVG/MESH/Mesh_Inkscape.html.
I'm not sure whether you need a backtrace at this point, but if you want one, I'll be glad to help as soon as I figure out why > bt says there is no stack :)
Looks like to me that while you got it to compile it's not finding the proper Cairo library at run time. At one point I had a similar problem. Tav
On Thu, Sep 22, 2011 at 9:50 PM, Tavmjong Bah <tavmjong@...8...> wrote:
Looks like to me that while you got it to compile it's not finding the proper Cairo library at run time. At one point I had a similar problem.
Yes, it's very likely to be the case. Sorry about a noob question, but how does one tell inkscape which path the right Cairo installation is in?
Alexandre Prokoudine http://libregraphicsworld.org
On 9/22/2011 8:37 PM, Alexandre Prokoudine wrote:
On Thu, Sep 22, 2011 at 9:50 PM, Tavmjong Bah <tavmjong@...8...> wrote:
Looks like to me that while you got it to compile it's not finding the proper Cairo library at run time. At one point I had a similar problem.
Yes, it's very likely to be the case. Sorry about a noob question, but how does one tell inkscape which path the right Cairo installation is in?
I consider this an advanced hacker question. ;-)
try LD_LIBRARY_PATH
http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN77
Aaron Spike
2011/9/23 Alexandre Prokoudine <alexandre.prokoudine@...400...>:
On Thu, Sep 22, 2011 at 9:50 PM, Tavmjong Bah <tavmjong@...8...> wrote:
Looks like to me that while you got it to compile it's not finding the proper Cairo library at run time. At one point I had a similar problem.
Yes, it's very likely to be the case. Sorry about a noob question, but how does one tell inkscape which path the right Cairo installation is in?
If you installed the master from source via make install, it's in /usr/local. You need to run "sudo ldconfig" in order for the dynamic loader to pick up the new library.
Regards, Krzysztof
2011/11/9 Krzysztof Kosiński <tweenk.pl@...400...>:
If you installed the master from source via make install, it's in /usr/local. You need to run "sudo ldconfig" in order for the dynamic loader to pick up the new library.
Thanks, but it's been solved for quite a while :)
Alexandre Prokoudine http://libregraphicsworld.org
Just updated my mesh branch. Changes:
1. Moved much of the mesh handling code into one file.
2. Handles move when corners are moved. Currently angle between handle and corner is preserved with length between handle and corner changing proportional to change in length of side. Eventually this behavior and keeping length constant will be selectable.
3. Patch edges are now shown as Beziers.
4. Alt-B switches toggles selected side (those with both corner points selected) between Beziers and Lines.
5. Synced with trunk.
Note, there is a bug where color changes to corners aren't saved if a point is not moved afterwards.
Also, this version, like the previous, is unstable.
https://code.launchpad.net/~tavmjong-free/inkscape/mesh
Tav
On Thu, 2011-09-22 at 15:14 +0200, Tavmjong Bah wrote:
Hi,
I have just checked in to my private Coons Patch Mesh Gradient branch, code that allows the ability to create and edit mesh gradients. Warning: This code is a real Hack. It is known to segfault and eat kittens for lunch. It will need lots of reworking by real experts before one can hope to see it in Inkscape trunk (as well as dealing with the issue that meshes are not part of the SVG 1.2 standard... they have been accepted as part of SVG 2.0 but that standard is along way from being appearing even in a draft form).
What you can do with the code:
- Create a simple one patch square mesh the size of an objects bounding
box. (Select the third button on the Gradient Tool-Tool Bar and the double click the object.)
Drag corner nodes (diamonds).
Change color of corner nodes.
Drag handles (circles). There is no indication of what handle belongs
with which corner node or path so it can be confusing.
- Divide a row or column of patches into two rows or columns. (Double
click on the lines connecting corner nodes. Double clicking elsewhere may lead to a crash.) At the moment, the row or column is split down the middle.
- Save the mesh. The mesh is saved in the proposed SVG standard format
(highly likely to change).
- Read in saved meshes.
Some of what is missing:
Ability to undo node moves/color changes.
Ability to merge two rows or columns into one or delete edge rows or
columns.
- Ability to change paths between straight lines and Bezier curves.
Handles are shown even for straight lines.
Display of Bezier curves (they are shown as straight lines).
Stability (I did tell you it will segfault, didn't I?).
Sane coding.
Properly handling of gradient copying.
Auto-creation of conical gradients or other non-square gradient
types.
Output to PS/PDF/PNG(?)
Update to current trunk.
You can check out the code at:
https://code.launchpad.net/~tavmjong-free/inkscape/mesh
Tav
All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
participants (5)
-
Aaron Spike
-
Alexandre Prokoudine
-
Josh Andler
-
Krzysztof Kosiński
-
Tavmjong Bah