Path Effects

Post questions on how to use or achieve an effect in Inkscape.
pelle
Posts: 53
Joined: Wed Mar 05, 2008 8:23 am

Path Effects

Postby pelle » Tue Jun 09, 2009 5:17 am

Hello,

There are two things I'd like to do to paths I have drawn, but I'm not sure if there is some clever trick I could use, or maybe use some of the advanced path features or included effects that I can't see... (I'm currently trying to build the latest snapshot release, if there is anything in 0.47 that will help maybe that will work for me as well.)

1. Zig-zags. Alternating left and right sharp turns along the path. A triangle wave with configurable frequency and amplitude sort of. I don't want the original path itself to be visible in the end, but it's much easier to first draw a curve and then.

2. Outlined path. Path in say red with black along both sides. The best thing would be to be able to treat the line as if it was an object I could set fill and stroke color for.

Ideas?

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: Path Effects

Postby microUgly » Tue Jun 09, 2009 8:34 pm

pelle wrote:I'm currently trying to build the latest snapshot release

There are precompiled builds for Windows, but perhaps you're on Linux.
pelle wrote:Zig-zags. Alternating left and right sharp turns along the path. A triangle wave with configurable frequency and amplitude sort of.

I think "Pattern along path" will do what you want.
pelle wrote:Outlined path. Path in say red with black along both sides. The best thing would be to be able to treat the line as if it was an object I could set fill and stroke color for.

Can you provide an example? Without an example I would suggest path offsets, or stroke, but I'm not sure exactly what you need.

pelle
Posts: 53
Joined: Wed Mar 05, 2008 8:23 am

Re: Path Effects

Postby pelle » Sun Jun 14, 2009 3:04 pm

microUgly wrote:
pelle wrote:I'm currently trying to build the latest snapshot release

There are precompiled builds for Windows, but perhaps you're on Linux.


FreeBSD actually. I ran into a problem, found an old bug report on the same problem, and commented on the bug with more info.

microUgly wrote:
pelle wrote:Zig-zags. Alternating left and right sharp turns along the path. A triangle wave with configurable frequency and amplitude sort of.

I think "Pattern along path" will do what you want.


I can't figure out how. Can you make the pattern repeat along the path, or would I have to first create a straight zig-zag line of the exact length I need? Can have a look at the pattern along path tutorials again. Never had much luck with them in the past.

microUgly wrote:
pelle wrote:Outlined path. Path in say red with black along both sides. The best thing would be to be able to treat the line as if it was an object I could set fill and stroke color for.

Can you provide an example? Without an example I would suggest path offsets, or stroke, but I'm not sure exactly what you need.


Sure!

Image

Path offsets sounds right, but also like it would require lots of clicking in the ui if there are many paths to fix, especially if they change often and you need to manually recreate the outlines. On the other hand it should be trivial to make an effect to solve this problem.

pelle
Posts: 53
Joined: Wed Mar 05, 2008 8:23 am

Re: Path Effects

Postby pelle » Sun Jun 14, 2009 3:13 pm

OK, I figured out the Pattern along pattern thing. I had it confused with the Path Effects. But I wasn't able to get a non-deformed zig-zag pattern. Of course it has to be deformed to follow a path, but I would prefer if the 'amplitude' of the zig-zag stayed constant, only the peaks becoming closer or more further away. I tried all combinations of settings in the effect I think. Maybe there is some trick?

pelle
Posts: 53
Joined: Wed Mar 05, 2008 8:23 am

Re: Path Effects

Postby pelle » Sun Jun 14, 2009 3:28 pm

The outlined path thing (shown in the image below) would be absolutely trivial (and very nice to work with) if there was a way to have a cloned path that could have its own Stroke, but it seems like editing the Stroke on a cloned object have no effect.

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: Path Effects

Postby microUgly » Mon Jun 15, 2009 6:13 pm

Path effects are what Pattern along path will be replaced with in 0.47.

I think this screenshot should illustrate what you want to know in regards to the green line with blue borders - http://www.inkscape.org/screenshots/gal ... ngpath.png

I don't think there's a way to vary the frequency of a zig-zag line as it travels a path--I can't imagine how you would control the frequency (perhaps distance between nodes!?)

User avatar
kelan
Posts: 178
Joined: Thu Sep 06, 2007 12:55 am
Location: Unicorn of Open Source
Contact:

Re: Path Effects

Postby kelan » Wed Jun 17, 2009 1:34 am

pelle wrote:The outlined path thing (shown in the image below) would be absolutely trivial (and very nice to work with) if there was a way to have a cloned path that could have its own Stroke, but it seems like editing the Stroke on a cloned object have no effect.


The visual attributes of clones (fill color, stroke type and color) can be edited independently, but only if the original has the attribute specified as Unset. So for a curve, you'd leave fill to be None, which the clones would inherit, and then set stroke to be Unset. Then you can set the color and width and other attributes of the clone's stroke. So really you'd need two clones, because the original won't display at all with a stroke of Unset. Then you set one of the clones to be the "inside" one, and the other to be the "outside" one, placing the outside clone below the inside one, and giving it a larger stroke width so it peeks around the edges of the inside one.

Editing is made a bit difficult since the original is invisible. Makes it hard to tweak because you don't get immediate visual feedback. When the original is selected and you switch to the :tool_node: Node tool, the nodes still appear, so that is something. Another work around is to switch to Outline mode (Ctrl+KP_5), where the original will be visible.

Guest

Re: Path Effects

Postby Guest » Tue Jun 23, 2009 12:31 am

The kind of path effects described on that effect sounds like exactly like what I was looking for for the zig-zags. I wasn't aware of that feature when I came up with the title of this thread, it was just a coincident I called it "Path Effects". :)

Thanks kelan for the description of the clone attributes! It sounded very promising, and indeed I can independently configure the stroke of the clones as you say, when the original is unset. However I can't come up with a way to make the clones visible. Maybe there was a bug in the old release version.

Guest

Re: Path Effects

Postby Guest » Tue Jun 23, 2009 12:43 am

Ooops. I did a bit of RTFM and learned that there is a difference between no stroke and unset. Now it works. Thanks! It seems to be exactly what I was looking for! 8-)


Return to “Help with using Inkscape”