how to combine 2 paths without having to reposition gradient

Post questions on how to use or achieve an effect in Inkscape.
User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

how to combine 2 paths without having to reposition gradient

Postby brynn » Sun Jul 17, 2011 5:31 pm

Hi Friends,
I have a closed path/object with a gradient, that represents either shading or highlighting in my image. Now fairly late in the game, I've decided that I want to jitter nodes along one side of the path. (And it happens that 5 or 6 objects share this same side, so I'll be doing this 5 or 6 times....maybe more, as I get into it) There's no way to add and jitter nodes for a path segment, right, only for the whole path? So I've created a new path for that side, set up the jitter as I want it, and my plan was to remove the original segment, and replace it with the jittery one. But when I combine the new path with the original one, I lose the gradient that belonged to the original path/object.

It's not so hard to check out the gradient number beforehand, and replace the gradient once the 2 path are combined and joined. But the placement of that gradient (linear in this case) is very specific and very important. I've thought of using Ctrl + click with the Pencil (or Pen) tool, to put a dot where it begins and ends. But I'm wondering if anyone knows of another way to accomplish this, without making dots to guide the replacement of the gradient?

Looking forward to what I might learn here!
Thanks for your help :D

PS - I can put up an illustration if necessary, just lmk :D

chriswww
Posts: 383
Joined: Fri Nov 19, 2010 3:04 pm

Re: how to combine 2 paths without having to reposition grad

Postby chriswww » Mon Jul 18, 2011 2:02 am

you can jitter just the nodes you want. use the node select tool and control click the nodes you want to jitter and apply it. you'll need to do it object by object though

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: how to combine 2 paths without having to reposition grad

Postby ~suv » Mon Jul 18, 2011 3:17 am

brynn wrote:So I've created a new path for that side, set up the jitter as I want it, and my plan was to remove the original segment, and replace it with the jittery one. But when I combine the new path with the original one, I lose the gradient that belonged to the original path/object.

'Path > Combine' always uses the fill & stroke style of the top-most (in z-order) of the selected paths. To keep the original gradient after combining:
  1. Jitter the nodes of the newly created path
  2. select the original path with the positioned gradient and move it on top of the jittered path (menu 'Object > Raise')
  3. add the jittered path to the current selection (shift+click [1]) and combine the two paths
Alternatively, lower the jittered path below the original one with the positioned gradient before selecting them both and combining.

[1] or drag a selection window to select the two restacked paths: use whatever selection method is easier (depending on the complexity of the paths in that region of your drawing) …

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: how to combine 2 paths without having to reposition grad

Postby brynn » Mon Jul 18, 2011 8:57 am

~suv wrote:'Path > Combine' always uses the fill & stroke style of the top-most (in z-order) of the selected paths.

Oh yay! I thought it took the style of the last drawn path. But of course, the last drawn item IS always on top!
Thank you so much ~suv, now I can continue with my plan, by just changing the z order of the paths, and not lose the gradient placement!

chriswww wrote:you can jitter just the nodes you want. use the node select tool and control click the nodes you want to jitter and apply it. you'll need to do it object by object though

Oh, I did not know that either! Can I also use the Add Nodes extension in the same way, by selecting the 2 nodes between which I want to add nodes?

Ok wait, Ctrl + click turns the nodes auto-smooth. And applying the Jitter Nodes extension affects all the nodes, not just the auto-smooth ones. Maybe I misunderstood you? Are you talking about making the jitter by moving each node one at a time?

chriswww
Posts: 383
Joined: Fri Nov 19, 2010 3:04 pm

Re: how to combine 2 paths without having to reposition grad

Postby chriswww » Mon Jul 18, 2011 10:33 am

maybe you've got some other key bindings...anyway, with the object selected click the node select tool. and from there (whatever the key modifier) you can select any number of nodes. without the key modifier, you will just select one node each time. the gui shows which nodes are selected anyhow. once you have that sorted, you should be able to do what you want without the long workaround altogether.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: how to combine 2 paths without having to reposition grad

Postby brynn » Mon Jul 18, 2011 12:44 pm

Yeah, I don't use the keyboard as much as some Inkscapers :? . But you're saying to select the nodes that I want jittered, and then apply the extension? I've tried that, but it applies to the whole path, not just the selected nodes.

Plus, I can't just apply to the original nodes, because there are only 2. I had to add nodes (using Add Nodes extension), then jitter them. And I couldn't add nodes to a portion of a path. That's why I had to draw a new path, add nodes, then jitter, then replace the original segment. But ~suv's comments did the trick. I'm actually already finished with this task, and thinking about jittering some other areas :D

chriswww
Posts: 383
Joined: Fri Nov 19, 2010 3:04 pm

Re: how to combine 2 paths without having to reposition grad

Postby chriswww » Tue Jul 19, 2011 11:42 am

when i converted a rectangle stroke to path and jittered nodes...it didn't work well.
when i created a rectangle by drawing with the bezier tool, then selected two of the nodes (shift key is the modifier to select multiple), then used the add nodes button (not the extension) to add additional nodes between those selected. then used the jitter extension and it jittered just the nodes selected.
but anyways, you've got this done now.
you could also achieve this effect by directly editing the xml in inkscape...changing the coordinates of the desired nodes by hand...add a bit here, take away a bit there, from the nodes of interest coordinates.
hope it's going good.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: how to combine 2 paths without having to reposition grad

Postby brynn » Tue Jul 19, 2011 12:22 pm

Well, even though I've finished, I still would like to sort this out.

when i converted a rectangle stroke to path and jittered nodes...it didn't work well

Maybe because the nodes are only at the corners of the original rectangle??

then used the jitter extension and it jittered just the nodes selected.

Interesting! I wonder what I could be doing wrong?? I just tried again, and instead used Add Nodes from the tool control bar this time. But it still jittered the whole path. After I select the nodes, and before I apply the jitter, should I be holding a modifier key down?

Oh no, in this case, jittering the nodes by hand, whether on the canvas or in the XML Editor, would have taken too much time (probably 50 nodes, on each of 4 objects).

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: how to combine 2 paths without having to reposition grad

Postby ~suv » Tue Jul 19, 2011 2:31 pm

chriswww wrote:when i created a rectangle by drawing with the bezier tool, then selected two of the nodes (shift key is the modifier to select multiple), then used the add nodes button (not the extension) to add additional nodes between those selected. then used the jitter extension and it jittered just the nodes selected.

Extensions do not work on a selection of nodes (they only receive the IDs of selected objects, not of nodes - i.e. no extension knows which nodes had been selected when it was called). Your results might have been due to some random settings preventing the cusp nodes at the corners to be moved.

chriswww
Posts: 383
Joined: Fri Nov 19, 2010 3:04 pm

Re: how to combine 2 paths without having to reposition grad

Postby chriswww » Tue Jul 19, 2011 3:25 pm

you're right Suv. So it worked because of a quirk. darn it, it's a shame extensions can't get to selected nodes. so it's more of a "jitter all nodes, except possibly cusp, in an object".
then to quickly do it i guess just select a (random) set of nodes and move them with cursor keys, then select another set and do likewise, and maybe once more for good measure...to make a pseudo jitter effect.
hmmmm....from memory (not good lately;) the latest stable has some smackering of javascript possibilities via dom?..still only 0.47 at work. check later.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: how to combine 2 paths without having to reposition grad

Postby brynn » Tue Jul 19, 2011 9:52 pm

Thanks ~suv! :D


Return to “Help with using Inkscape”