Change stroke width along path?

Post questions on how to use or achieve an effect in Inkscape.
4Tens
Posts: 3
Joined: Mon May 09, 2011 10:43 am

Change stroke width along path?

Postby 4Tens » Mon May 09, 2011 10:46 am

How do you change stroke width along a path so it looks like the stroke is fading? For example make the width of a path change from 5 to 4 between two nodes, and then 4 and 3 between the next two nodes, etc.

User avatar
tomh
Posts: 218
Joined: Sat Feb 14, 2009 10:14 pm

Re: Change stroke width along path?

Postby tomh » Tue May 10, 2011 9:12 pm

There is a way of doing this, however the controls are not as fine grained as you may like.

Basically, the method is to use the "pattern along path" live path effect.

First, using the rectangle tool, create a long and thin rectangle, do object->object to path, and add nodes along the long sides. Copy this to the clipboard

Next, using either :tool_pencil: or :tool_pen: tools, Under "Use Shape"; select "from clipboard" and then draw your path.

This will give you your path with a uniform width. To edit the width, open the path effect editor (path->path effect editor). This should bring up a panel. Under "Current Effect", select Edit on canvas. Now you can edit the rectangle you created and change its width by selecting it's nodes and using the mouse or select pares of nodes and use shift+< or shift+> to change the distance between them...

4Tens
Posts: 3
Joined: Mon May 09, 2011 10:43 am

Re: Change stroke width along path?

Postby 4Tens » Wed May 11, 2011 4:06 am

Yeah, that is a little different than what I was looking for. It takes too much work to achieve the amount of control I want.

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: Change stroke width along path?

Postby prkos » Wed May 11, 2011 5:03 am

You can also try playing with the Tweak tool as suggested in one of the feature requests:

https://bugs.launchpad.net/inkscape/+bug/170683
https://bugs.launchpad.net/inkscape/+bug/171973
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

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

Re: Change stroke width along path?

Postby brynn » Wed May 11, 2011 8:41 am

Welcome to the forum, 4Tens!

If it's a straight line, it would be pretty easy to use Stroke to Path. This would essentially create a very long, very thin rectangle. Then you could adjust the nodes as needed (overlap 2 of the nodes to create a point, if needed)(use Snap and/or a grid for precision). If it's a curved path, this would be much trickier.

But if it's a curved path, and similar to tomh's suggestion, a spiro spline (with "triangle in") might work, and be pretty quick to draw. Although it's quite hard to control or adjust spiro splines. You might have to try several times to get close to the right curve, then use Object to Path to be able to sort of "fine tune" it. In the "fine-tuning" stage, you could use node sculpting (Alt + drag selected nodes)(select all the nodes, but drag by the pointed tip) to keep the curve smooth.

I'm speaking in generalities, but if you need instructions, or step-by-step, just let me know. (Although if I'm not available, because we're about to finish painting my apartment, anyone who knows about these things, please feel free to share the instructions :D)

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Change stroke width along path?

Postby druban » Wed May 11, 2011 4:49 pm

All of the suggestions here are good but i think the problem is the requirement that any solution should not involve much work.
It takes too much work to achieve the amount of control I want.


This is always the "dealbreaker" and I just can't come up with answers that give the user a lot of control but don't require a lot of work. The control part and the work part seem to be the same thing when I try to come up with a solution.
Your mind is what you think it is.

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

Re: Change stroke width along path?

Postby brynn » Fri May 13, 2011 6:08 am

All of the suggestions here are good but i think the problem is the requirement that any solution should not involve much work.
It takes too much work to achieve the amount of control I want.

This is always the "dealbreaker" and I just can't come up with answers that give the user a lot of control but don't require a lot of work. The control part and the work part seem to be the same thing when I try to come up with a solution.

Well yes, if you're looking for a new feature, because there does not currently exist, a way to do this automatically. But for a one-time project, some of the steps mentioned might work.

User avatar
RobA
Posts: 335
Joined: Fri Aug 10, 2007 1:22 am

Re: Change stroke width along path?

Postby RobA » Fri May 13, 2011 8:53 am

The calligraphy tool :tool_calligraphic: with a tablet would do what you want.

-Rob A>

4Tens
Posts: 3
Joined: Mon May 09, 2011 10:43 am

Re: Change stroke width along path?

Postby 4Tens » Sat May 14, 2011 1:33 am

RobA wrote:The calligraphy tool :tool_calligraphic: with a tablet would do what you want.

-Rob A>


There are two problems with that.

1: I don't have a tablet.
2: I want to use simple paths that are only constructed from a few nodes / Bezier curves, I like that style.

But yes, that is essentially what I want, to be able to have tapered lines as if they were hand drawn.

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Change stroke width along path?

Postby druban » Sat May 14, 2011 3:06 am

Well yes, if you're looking for a new feature, because there does not currently exist, a way to do this automatically.


I was just being ironic.
Your mind is what you think it is.

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

Re: Change stroke width along path?

Postby brynn » Sun May 15, 2011 5:43 am

Oh, sorry druban. I missed your tone on that one :oops:

Kein
Posts: 3
Joined: Tue Jul 10, 2012 9:22 pm

Re: Change stroke width along path?

Postby Kein » Tue Jul 10, 2012 9:35 pm

No update on this subject? No custom extension for the program were made that allows to do such kind of trick? Or may be there is some custom stroke styles available somewhere, like in Illustrator?

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

Re: Change stroke width along path?

Postby brynn » Wed Jul 11, 2012 12:10 am

No, nothing new, that hasn't already been mentioned in this topic. Calligraphy tool, or pattern along path LPE would be your best options :D

User avatar
heathenx
Posts: 388
Joined: Thu Jun 07, 2007 11:51 pm
Location: USA
Contact:

Re: Change stroke width along path?

Postby heathenx » Wed Jul 11, 2012 1:56 am

Get yourself a dev. version (R11359) and try the unstable powerstroke LPE.

https://skydrive.live.com/?cid=09706D11 ... A52A%21128

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Change stroke width along path?

Postby druban » Wed Jul 11, 2012 8:28 am

I notice that noone, including my own self suggested to the OP that the triangle in and triangle out options on the control bar might work for him/her. This is still the pattern on path LPE (except in my recent build, where it has now become the Powerstroke LPE, very cool, and quite stable!) but it's a lot less work to use.
Of course now that the Powerstroke LPE is automatically applied, well, you have the best of both worlds - automatically applied, and afterward editable!
This was done without ever opening the Path effects dialog.
g4043.png
g4043.png (19.62 KiB) Viewed 18323 times
Your mind is what you think it is.

User avatar
Maestral
Posts: 982
Joined: Sat Aug 27, 2011 7:10 am

Re: Change stroke width along path?

Postby Maestral » Wed Jul 11, 2012 9:17 am

Am I missing something? I`ve just tried r11359 and r11550... and all I got was additional "node" at the end of the Triangle in/out!? ?That node helped me change the width of that stroke but other nodes along that stroke/path were not editable.

@ druban
Am I misinterpreting your example or you have more that 3 strokes in it?
:tool_zoom: <<< click! - but, those with a cheaper tickets should go this way >>> :!:

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Change stroke width along path?

Postby druban » Wed Jul 11, 2012 1:22 pm

Maestral wrote:Am I missing something? I`ve just tried r11359 and r11550... and all I got was additional "node" at the end of the Triangle in/out!? ?That node helped me change the width of that stroke but other nodes along that stroke/path were not editable.

Ctrl-click the purple node to create a new node on top. you can then drag one of them to any location. ctrl-alt-click to remove extra ones. You can keep doing this for as many times as it takes to get your path outline the way you like it. Hint:You don't have to drag it along the path, just pull it right to where you want it. The interpolation method and smoothness determines the shape of the path between the nodes.
Hint:Try the spiro path for extra fun, everything still editable on canvas with :tool_node:
Maestral wrote:Am I misinterpreting your example or you have more that 3 strokes in it?

Yes and No! I duplicated the path three times and adjusted the powerstroke nodes to different widths! Then I blurred one fill. I did duplicate the bottom path one more time to clip the others, so that's why it's yes and no.... Took just seconds BTW.
Your mind is what you think it is.

User avatar
Maestral
Posts: 982
Joined: Sat Aug 27, 2011 7:10 am

Re: Change stroke width along path?

Postby Maestral » Wed Jul 11, 2012 7:57 pm

Whole `nother ball game ,)
:tool_zoom: <<< click! - but, those with a cheaper tickets should go this way >>> :!:

Kein
Posts: 3
Joined: Tue Jul 10, 2012 9:22 pm

Re: Change stroke width along path?

Postby Kein » Thu Jul 12, 2012 7:13 pm

heathenx wrote:try the unstable powerstroke LPE.

Latest revision compiled for Windows here - can't find it. Am I missing something?

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Change stroke width along path?

Postby druban » Fri Jul 13, 2012 2:36 am

The feature has to be specifically switced on at the time of compilation AFAIK, and not all compilers (bless their hearts) do it. The windows builds at this location https://skydrive.live.com/?cid=09706D11303FA52A&id=9706D11303FA52A%21128seem to have all the LPEs enabled, even the ones that are completely buggy, so watch out. Powerstroke and clone original seem to be fairly smoothed out. Read about them in the link from Inkscape's menu 'new in this version'.
Whole `nother ball game ,)
Is that approval, M? :lol: I agree! A great piece of coding!
Last edited by druban on Fri Jul 13, 2012 2:40 am, edited 1 time in total.
Your mind is what you think it is.

User avatar
Maestral
Posts: 982
Joined: Sat Aug 27, 2011 7:10 am

Re: Change stroke width along path?

Postby Maestral » Fri Jul 13, 2012 2:38 am

... also, Powerstroke is available only for :tool_pencil: and :tool_pen: while having Triangle in/out shape activated. I`ll be more happier if Ellipse shape is included, but for now it`s fine. I have not tried yet with shape from clipboard but I believe it would work as well.
:tool_zoom: <<< click! - but, those with a cheaper tickets should go this way >>> :!:

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Change stroke width along path?

Postby druban » Fri Jul 13, 2012 2:57 am

Maestral wrote:... also, Powerstroke is available only for :tool_pencil: and :tool_pen: while having Triangle in/out shape activated. I`ll be more happier if Ellipse shape is included, but for now it`s fine. I have not tried yet with shape from clipboard but I believe it would work as well.

I see what you mean but of course you saw that Powerstroke can be applied to ANY path using the LPE dialog, right? You also get more control points right away if you apply it to a regular stroked path, and then the round ends option gets you pretty close to the ellipse pattern... But when I tried applying to a path that had some other pattern on path besides triangle in/out already applied it froze. So some parts are still buggy :( .
Your mind is what you think it is.

User avatar
Maestral
Posts: 982
Joined: Sat Aug 27, 2011 7:10 am

Re: Change stroke width along path?

Postby Maestral » Fri Jul 13, 2012 10:36 am

Khm, khm... how shall I put it? Well, no I didn`t :oops:

Mostly cause I missed Powerstroke while drawing with Pen or Path tools (by pen and tablet), but now after I went trough the LPE dialog - it`s not just nother ball game, it`s a whole nother sport ,) I made just a swift look with these two tools, and another one now trough LPE dialog, but soon I`ll give it a try in some new drawings. After all, perhaps there`s someone else not so careful, like me, and these few posts could point out Powerstroke`s capabilities.

Many thanks to developers, I`ve waited for this to work.
:tool_zoom: <<< click! - but, those with a cheaper tickets should go this way >>> :!:

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

Re: Change stroke width along path?

Postby ~suv » Fri Jul 13, 2012 4:58 pm

Maestral wrote:After all, perhaps there`s someone else not so careful, like me, and these few posts could point out Powerstroke`s capabilities.

I had posted links to currently available documentation for Powerstroke LPE earlier (1, 2):


Return to “Help with using Inkscape”