tapering lines

Post questions on how to use or achieve an effect in Inkscape.
fizzcat
Posts: 46
Joined: Fri Jul 15, 2011 7:26 pm

tapering lines

Postby fizzcat » Mon Aug 01, 2011 6:37 pm

I know this subject has been discussed before, but I cannot find any definitive list of the ways of tapering lines in Inkscape, and I'd like to check that I haven't missed anything.

I have lots of lines that I would like to taper out, either to a point or to a thinner line thickness. The tapering part can be of varying length, the parallel part of the line can be of any length, and the starting thickness varies. This rules out using a pattern along a path (I would have to make a new pattern for each taper - I don't have that much time).

I could break the path at the point where I want the taper to start and then apply a taper to one of the paths - but is there a way of doing this without making a new pattern for each line thickness? I would be happy to just have the line taper from the starting thickness to zero linearly along the lenth of the path. I may need to be able to put a round end on the thick end, or there may be a gap if the two paths are not tangential at the join (most of the paths are polylines so the break is usually at a "corner").

I have a kludge that works at the reproduction size, but I'd like something quicker and smoother.

[edit: I'm using Inkscape 0.48.1 on Windows Vista
My kludge is to break the tapering part of the polyline into multiple paths and reduce the thickness of sucessive paths. Since I'm working about 6 or 8 up, this works OK when printed, but there are lots of keystrokes for each taper.]

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

Re: tapering lines

Postby brynn » Mon Aug 01, 2011 7:58 pm

I'm not clear what you're asking. What do you mean by "polyline"?

fizzcat
Posts: 46
Joined: Fri Jul 15, 2011 7:26 pm

Re: tapering lines

Postby fizzcat » Mon Aug 01, 2011 9:03 pm

brynn wrote:I'm not clear what you're asking. What do you mean by "polyline"?


Sorry. CAD terminology. My tech illustration background showing. polyline = path made up of multiple straight line segments.

The fact that it is a path made up from straight line segments is not that significant, except that when I break the path apart at a node it is usual for the adjacent ends of the two new paths to be non-tangential. Hence some tapering solutions (like triangle in/out) could sometimes leave gaps to be filled on the outside of the corner.



[edit: I think I am confusing the matter by adding too much secondary information to show I have done some research before asking this question.... Put simply, what I want to know is: How can you taper lines in Inkscape?]

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

Re: tapering lines

Postby brynn » Mon Aug 01, 2011 9:43 pm

I'm sorry, I just can't follow what you're doing. Would you be able to put up a quick illustration?

I'm not clear if you want to taper a stroke? If so, you would need to use Stroke to path, which will basically create a long and really skinny rectangular shaped path (ie - your polyline). But it sounds like you might have already done that, with the polyline thing. But an illustration would help a lot, if you can?

fizzcat
Posts: 46
Joined: Fri Jul 15, 2011 7:26 pm

Re: tapering lines

Postby fizzcat » Mon Aug 01, 2011 10:11 pm

here is a bitmap that shows the problem

http://www.flickr.com/photos/clivecatterall/

The lines where the fingers meet the hand and where the base of the thumb meets the hand need to be tapered off. At this scale you can see my kludge.

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

Re: tapering lines

Postby brynn » Tue Aug 02, 2011 12:06 am

And those lines are currently a stroke or open path? Or are they actually rectangular shaped closed (or nearly closed) paths (very skinny rectangle)?

It's not possible to taper a stroke. A stroke is the same width everywhere. But you can convert a stroke to a path (making the aforementioned really skinny rectangular shaped path. Then you can remove one of the corner nodes and adjust the node handle to make as much of a point as you want at the end.

I understand what you're saying about breaking up a path into smaller paths, and then making each segment less wide. And I also understand that it's far from ideal.

(I see from your link that the image was made in GIMP, which probably means that it was originally in a raster format. So I'm wondering if you've used Trace Bitmap? If that's that case, then the lines you've shown should be the very skinny rectangular path. So to taper it, you would just remove one of the corner nodes, and use the node handle to adjust the taper. But I'm only guessing that you used Trace Bitmap, at this point.)

EDIT
...when I break the path apart at a node it is usual for the adjacent ends of the two new paths to be non-tangential.

Tangential to what?? Or non-tangential to what? When you break a path at a node, the 2 new nodes are on top of each other.

fizzcat
Posts: 46
Joined: Fri Jul 15, 2011 7:26 pm

Re: tapering lines

Postby fizzcat » Tue Aug 02, 2011 1:26 am

brynn wrote:And those lines are currently a stroke or open path? Or are they actually rectangular shaped closed (or nearly closed) paths (very skinny rectangle)?

It's not possible to taper a stroke. A stroke is the same width everywhere. But you can convert a stroke to a path (making the aforementioned really skinny rectangular shaped path. Then you can remove one of the corner nodes and adjust the node handle to make as much of a point as you want at the end.


OK that answers one question. You can't change the width of a stroke. All of the lines you see are strokes. That's how I broke the lines into segments to thin them down.

(I see from your link that the image was made in GIMP, which probably means that it was originally in a raster format. So I'm wondering if you've used Trace Bitmap? If that's that case, then the lines you've shown should be the very skinny rectangular path. So to taper it, you would just remove one of the corner nodes, and use the node handle to adjust the taper. But I'm only guessing that you used Trace Bitmap, at this point.)


No. I did not use autotrace. The image was created from new using Inkscape. The only reason to use GIMP was to crop the picture to just have the hand and none of the other detail in the picture. I find the cropping and windowing tools in GIMP are easier to use. (Hmmm ... maybe I just haven't explored how to do this properly in Inkscape).

Converting the stroke to a path certainly works, but it takes too long, as the stroke is almost always wiggly. I need to maintain a very high throughput to hit my deadlines!

EDIT
...when I break the path apart at a node it is usual for the adjacent ends of the two new paths to be non-tangential. Tangential to what?? Or non-tangential to what? When you break a path at a node, the 2 new nodes are on top of each other.


I was thinking that the short side of the triangle in "triangle in" (stroke shape) is placed across the node at 90 degrees to the path segment as it leaves the node. Threre would be a problem joining the remaining part of the stroke.

Try this and you'll see what I mean. Draw a path with straight line segments and three nodes. The nodes should form a corner - not a straight line. Give it a good fat stroke width and set the cap to butt. Now break the path apart at the centre node. You will get a gap at the outside of the corner.

I just thought that you'd get the same effect if you had a long thin triangle used as pattern-along-path (to get a tapering line effect). This is one of the suggestions I have seen to get a tapered line.

It's a pity you can't have "start thickness %" and "end thickness %" on the fill & stroke dialog. And even better - if you could have the line thickness completely offset to one side or the other from the skeleton path ... now that would be clever - you could have heavy outlines around small objects ... and changing the outline thickness would not alter the shape of the object ...

Oh well. I'm getting the feeling that Inkscape won't do exactly what I want. It looks like I'll have to stick with my kludge. Mind you, it still knocks spots off doing this stuff by hand!

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

Re: tapering lines

Postby brynn » Tue Aug 02, 2011 6:35 am

If I'm not mistaken, it has been requested as a new feature.
Someone else may have a better solution. Now that it's Monday, you may get more replies :D

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

Re: tapering lines

Postby druban » Tue Aug 02, 2011 5:21 pm

Well, although from time to time this request does come up, IMO it's a contradiction of sorts, in that as soon as you have a stroke that is not a uniform width it takes the same amount information to describe it as a filled object of the same shape... a little like asking for a, "rectangle, only one that doesn't have straight sides," if you see the analogy.

But of course the graphic value of tapered lines is indusputable, and it's just a matter of how you get them into your drawing.

Inkscape has the pattern to path path effect (LPE) that does this, it remains editable, and for all purposes should deliver what you want. Two ways to access it:

Using the bezier pen or pencil tool, choose from the drop down menu anything but "none" which is the default.

On an already drawn path, apply the path effect 'pattern on path'; this method allows you far more control over the exact shape and taper of the line, but also requires more input from you.
rect3137.png
rect3137.png (108.78 KiB) Viewed 2367 times

If you have a drawing tablet, the calligraphy tool offers tapering options, too.
Your mind is what you think it is.

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

Re: tapering lines

Postby brynn » Wed Aug 03, 2011 12:38 am

Off topic:
Love your smiley face background, druban. I might have to make one of those for myself, lol!

fizzcat
Posts: 46
Joined: Fri Jul 15, 2011 7:26 pm

Re: tapering lines

Postby fizzcat » Wed Aug 03, 2011 5:11 am

druban wrote:Well, although from time to time this request does come up, IMO it's a contradiction of sorts, in that as soon as you have a stroke that is not a uniform width it takes the same amount information to describe it as a filled object of the same shape


Not really - I want a simple linear taper on a complex multi-segment path. But even if it did, surely it is better to have multiple ways of doing a graphic task rather than force the artist to work in an uncomfortable way? (assuming there are enough people who want the feature)


Inkscape has the pattern to path path effect (LPE) that does this, it remains editable, and for all purposes should deliver what you want.



pattern to path path effect (LPE) is indeed very powerful, and would do the job admirably. It just takes too long to do this very simple job. I work almost exclusively in line, and have twenty or thirty lines to taper on each drawing, and I work on around five drawings a day, five days a week. pattern to path path effect (LPE) is TOO POWERFUL! All I want is to be able to apply a triangular taper - just like the triangle in/out shape in the pen tool - to lines that have been already drawn. That would fix 90% of my troubles!

Is there a way of making a list of pre-drawn shapes that I can have as a "palette" that travels from draing to drawing? That could work. If I could pick a taper from the list, adjust the width of the pattern and just apply it that could be the answer.


Hmmm ..... I need to think about this ..... I need to experiment with pattern to path path effect (LPE) a bit more. Maybe I could just copy a taper pattern to each drawing. ....

Off to do some reading

fizzcat
Posts: 46
Joined: Fri Jul 15, 2011 7:26 pm

Re: tapering lines

Postby fizzcat » Wed Aug 03, 2011 5:34 am

bear with me here. Things are looking good. I didn't realise that you could specify the thickness of the pattern in mm (I think you can - not quite finished working things through - it says pattern width in units of length - but which units???).

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

Re: tapering lines

Postby druban » Wed Aug 03, 2011 6:58 am

Absolutely reasonable, and I hope you don't think I am giving you a hard time here, I hope that the developers come up with a tool for you.
In the meantime, you wrote,
fizzcat wrote:All I want is to be able to apply a triangular taper - just like the triangle in/out shape in the pen tool - to lines that have been already drawn.

I too often need to do this, and since my system has not cut an edge for very long indeed (i.e. it's old) I find it faster to get my drawing to a certain point before starting to finish the lines with tapers etc. Therefore I use the ctrl+7 (paste path effect) shortcut after copying a path to the clipboard that has the taper style I want to apply, this goes very fast indeed. You can even pick ALL the paths that you want to apply the taper to, and then with one keystroke taper them at once. If your paths are several short paths combined into compound paths, as sometimes results from autotraced pictures, the paste path effect will apply the pattern to each distinct sub path... And none of this alters the colors or styles of the target path(s), which might have been a problem....
Last edited by druban on Wed Aug 03, 2011 7:38 am, edited 1 time in total.
Your mind is what you think it is.

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

Re: tapering lines

Postby druban » Wed Aug 03, 2011 7:26 am

fizzcat wrote:it says pattern width in units of length - but which units???

This checkbox means that if the pattern you are applying to the path is longer -or shorter- than the path itself, you want -or don't want -the width to be scaled. E.g. in the attached graphic the black triangle is copied to the clipboard as the pattern. The object on the left has the LPE applied WITHOUT the box checked, i.e. the height of the original triangle is the maximum width of the final object, no matter how long the target path (dashed overlay) is.
The large object is the same triangle applied to a path (dashed overlay) but with the box checked. since the target is several times the LENGTH of the original triangle, the height is scaled by that same factor. If the path had been shorter, the final height would have been less, as in the smallest object.

rect4006.png
rect4006.png (14.53 KiB) Viewed 2339 times


If, for example, you want all your lines to be exactly 2 mm at their widest, you draw a triangle - or trapezoid, ellipse, etc. exactly 2 mm high. You can even use the :tool_selector: control bar to enter the height numerically to thousandths of a mm.

If you combine all your paths and apply/paste the path effect, you can change the dimensions (width, e.g.) of the pattern path (using the edit on canvas button) and all the subpaths will update instantly, as you might expect. BUT! if you break the combined path into individual paths, they remain linked to the same pattern! that means you can colour them differently but update their pattern sumultaneously. if you use this feature a lot - and who doesn't? - this can be very handy....
Last edited by druban on Wed Aug 03, 2011 8:01 am, edited 1 time in total.
Your mind is what you think it is.

fizzcat
Posts: 46
Joined: Fri Jul 15, 2011 7:26 pm

Re: tapering lines

Postby fizzcat » Wed Aug 03, 2011 7:55 am

OK. I think I have it. If I make an isociles triangle with black fill, no stroke and the base 1mm wide, I can paste it into a single stretched Pattern Along Path (LPE) and use the width box to set the start thickness of the taper in mm (because the pattern starts out at 1mm wide). Cool. Reverse the path if the taper goes the wrong way.

I've tried it and it is very quick. Nice. Looks good too. This is exactly what I wanted, but just using a different dialog box (plus a little fiddling with a pattern - but I can copy that from drawing to drawing).

Could we have a triangle and ellipse as a pull-down for the Pattern Along Path (LPE) editing box? (I'm never satisfied).


Utterly utterly brilliant.

EDIT:
Want to get even more finicky? If you combine all your paths and apply/paste the path effect, you can change the dimensions (width, e.g.) of the pattern path (using the edit on canvas button) and all the subpaths will update instantly, as you might expect. BUT! if you break the combined path into individual paths, they remain linked to the same pattern! that means you can colour them differently but update their pattern sumultaneously. if you use this feature a lot - and who doesn't? - this can be very handy....


UuuUgh. I think I understand that. You are saying that If I gather all of the paths together and combine them before I apply the LPE they all point to the same master pattern. Breaking the combined path apart does not alter this, but allows the separate paths to be coloured/filled individually. OK. I don't think I'll be using that anytime soon, but I'll store that away for future reference.

fizzcat
Posts: 46
Joined: Fri Jul 15, 2011 7:26 pm

Re: tapering lines

Postby fizzcat » Wed Aug 03, 2011 8:12 am

druban wrote:Absolutely reasonable, and I hope you don't think I am giving you a hard time here, I hope that the developers come up with a tool for you.


I think that the problem is that you are forcing me to think, which is always uncomfortable!

I too often need to do this, and since my system has not cut an edge for very long indeed (i.e. it's old) I find it faster to get my drawing to a certain point before starting to finish the lines with tapers etc. Therefore I use the ctrl+7 (paste path effect) shortcut after copying a path to the clipboard that has the taper style I want to apply, this goes very fast indeed. You can even pick ALL the paths that you want to apply the taper to, and then with one keystroke taper them at once. If your paths are several short paths combined into compound paths, as sometimes results from autotraced pictures, the paste path effect will apply the pattern to each distinct sub path... And none of this alters the colors or styles of the target path(s), which might have been a problem....


EeeeEEeeeEEEeee

That's Incredible! I love it!

That will save me so much time! (Yeah, and my 'pooter's pretty slow too ...)

I don't use autotrace. We don't get on.


Return to “Help with using Inkscape”

Who is online

Users browsing this forum: No registered users and 3 guests