Author Topic: Creating Parallel Lines/Offset Paths  (Read 2308 times)

June 08, 2019, 06:31:32 AM
Read 2308 times

the13thsense

  • Sr. Newbie

  • Offline
  • **

  • 6
Hey Everyone,

Recent novice to the inkscape community. I've been starting to draw my own metro maps, but am starting to have trouble when I have 2 metro lines that curve at a same path. I've found some illustrator tutorials () and (https://www.youtube.com/watch?v=J9V9tQUBRE4); however, I am having trouble trying to figure out if Inkscape has these options. I've learned that I can do a stroke to path but when I have my path set with a rounded corner it messes up how they look, and the line in the middle throws off the width of the rest of that specific path when I connect it to the other ones.

I'd greatly appreciate if anyone here has some tips or tricks to figure out how to make paths look like the ones in the videos above with illustrator.
  • 0.92

June 08, 2019, 10:05:17 AM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

Tools, techniques and concepts for using Illustrator don't always transfer equally over to Inkscape.

Typically you'll want to use Pattern Along Path for road maps.  Inkscape has 2 ways to do this, and in the case where you have 2 different colors of paths following the same route, you'll want to use the extension.  (Extensions menu > Generate from Path > Pattern Along Path).  There is also a PAP LPE, which allows live editing.  But for the dual colors you'll need to use a group for the pattern, and only the extension allows groups.

Here's the manual info on this:  http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Extensions-GenerateFromPath.html#Extensions-PatternAlongPath

The best instructions I know of for the LPE would be this:  http://fullcirclemagazine.org/issue-106/  (Open the PDF.  Usually the 2nd page is the table of contents, then click on the Inkscape article.  It's a series of Inkscape tutorials, and this is the issue that includes the pap lpe.)

If you really want to do exactly what's shown in the video, in Inkscape, we could explain that for you.  But for roadmaps, PAP is a good solution.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 08, 2019, 11:41:36 AM
Reply #2

the13thsense

  • Sr. Newbie

  • Offline
  • **

  • 6
I seem to be having trouble figuring it out using the methods you sent me. Is there any way you can provide me with a step by step of the way the video did it? I like how multiple lines end up looking uniform next to one another.
  • 0.92

June 08, 2019, 12:31:32 PM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
For your first video, and the first half of the 2nd video, Inkscape does have offset path tools, but they don't work the same way that they work in Illustrator.  So I would not recommend using them for this purpose.

For the 2nd half of the 2nd video, yes, Inkscape does have a comparable tool, and that's exactly what I suggested already -- the Pattern Along Path extension.  However, how in Illustrator you can later separate the ends, Inkscape can't do that.  Well, it could do it, but not nearly as easily.  But as long as all the separate colors stay together, it works the same way.

Tell me where you're getting stuck, and I can help.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 08, 2019, 01:10:02 PM
Reply #4

the13thsense

  • Sr. Newbie

  • Offline
  • **

  • 6
Hmmm I think it would be easier for me to explain to you exactly what I want my paths to look like. It's possible that I mistook what I was saying before and that it caused confusion. Pretty much what I want to do is have a bunch of paths go together and then split off. The best example I could find is the DC Metro Map (see link below). Essentially I want to create paths like the orange, grey, and blue metro lines that run together but at corners are able to wrap around each other and not bleed into each line (this was the issue I was having before where I was trying to do it manually but everything was coming out all funky, especially when I was using the rounded corners extension, which threw everything off even more. I don't a picture of this but what ended up happening was that at certain points everything would line up but as soon as I came across a corner, one of the metro lines would start bleeding into the one right next to it.)

With the generate path tool, what I am doing is creating one path (let's call it the Red Line Metro) that starts as a straight line, then curves at a 45 degree angle followed by a 0 degree angle, and then a 90 degree angle. Then I create another line that serves as the 2nd path (let's call it the blue line metro). Then I go to the generate path tool. What ends up happening is that nothing ends up on a path and Inkscape ends up creating some weird triangle looking shape. That's the problem I've been coming across and why I have been having trouble with the path.

Sorry about any confusion before, it's been only a week since I started using the program! :)

https://cdn.vox-cdn.com/thumbor/I2FuycR9vGEzsHzmnVPN9O3aDCc=/0x157:950x974/1200x800/filters:focal(399x411:551x563)/cdn.vox-cdn.com/uploads/chorus_image/image/56805661/x1412199569492.png.pagespeed.ic.6jWHmXTuti.0.png
  • 0.92

June 08, 2019, 01:22:43 PM
Reply #5

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
Well, as I was writing, the OP posted a note, lol. so new note.  I was literally mentioning our local metro line as an example - the DC one (same one you are referring to, we're by the red line!).  Anyway, trying to figure out what 'bleeding is'.  Can you show us the file or png of it?  You can manually layer the lines (red, blue, yellow) and put a circle/spoke on top of it where the intersection is. If bleeding (which I can't figure out), you could do path>difference  or prob path>clipping would be better to hide the bleeding.  Don't use blurring or it will bleed.
 
edit.  For making say a red line - in inkscape I personally would not make it a continuous line, that might be what is tripping you up.  Manually, you could make the line go to the spoke and stop there, then start again beyond the spoke until you hit the next spoke. So it would appear as a continuous line but really isn't. 

June 08, 2019, 01:48:47 PM
Reply #6

the13thsense

  • Sr. Newbie

  • Offline
  • **

  • 6
Ok so I am attaching a picture of the two issues I am having, it's a bit zoomed in but hopefully you can see what I'm saying with my issue. The paths I drew were fairly basic. A black line (rounded corner at 1.7 pts) and a yellow line with the same rounded corners. Once I create the rounded corners on the both metro lines, it (A) leaves a gap that I cannot figure out how to fill in. The second issue is the "bleeding" I am referring to which is where the yellow metro line starts mixing into the black line. The intersections aren't a concern so much because I can always cover that up with a metro station if there is in fact a metro station. The issue I am having is where the the parallel metro lines actually curve without a station. If we look at the DC Metro map, what I am trying to figure out how to do is have the metro lines that are both smooth, equivalent in width, and do not "bleed" into each other. The best example I can point to is where the orange, silver, and blue lines cross over the anacostia river in a 90 degree angle between Foggy Bottom and Roslyn. What I have been trying to do is make it so that my lines run parallel with each other, bend where there is a corner, but not start to inaccurately overlap onto another line.

I am also sending another link, which is the Melbourne tram map. In this map, if we look at the left where lines 35 (grey), 70 (orange) and 86 (green) start, they are all "hugging" each other even through corners without bleeding into one another. That's essentially what I am trying to accomplish which is to have multiple parallel metro lines run along each other.

https://maps.philipmallis.com/wp-content/uploads/2018/01/Melbourne-Tram-Route-Map-Schematic-Version-0.4.png

I hope this is starting to help clarify the issues I am having and that the pictures help you visualize what my goal is!
  • 0.92

June 08, 2019, 02:44:17 PM
Reply #7

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
ok, that helps.  The issue with the gap is that you have an almost right angle on the inside of the black line.  You would need to draw a bend on the inside of each line.  So instead of having a cusp node which makes a line, change it to an auto smooth node and the line will bend, you may need to put in a few of those nodes by the bend, and you may need to adjust the bend in the green line so the two metro lines meet.  (hope this makes sense). If you need to understand the nodes, you can click on the help button in inkscape and click on the manual, then in the index you can look up the nodes to give a better explanation.

There shouldn't be any 'blurriness', as inkscape is a vector pgm, so as long as you aren't importing a raster file to work on, it should be fine. (IE if you are creating the line yourself it shouldn't blue), so I'm still a little stumped on that.  However, if you are exporting to get a png, then that can cause blurriness, but that's a different issue.  Would need to see the svg to see what you mean about that. 

June 08, 2019, 03:57:05 PM
Reply #8

the13thsense

  • Sr. Newbie

  • Offline
  • **

  • 6
Ok thanks! So how would I go about in general creating paths that line up parallel like the ones in the melbourne map?
« Last Edit: June 08, 2019, 04:28:27 PM by the13thsense »
  • 0.92

June 08, 2019, 06:05:25 PM
Reply #9

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
Does the attached file help you any?  or are you looking for something else.  I drew a line, did stroke to path, moved the nodes, changed the nodes to auto smooth.  Then I duplicated it twice and changed the color - and finagled the cusps so they fit inside each other.  Please note, there are many ways to accomplish what you want, some like the LPE extensions, etc.,  but they tend to frustrate me.  At least this will give you an idea.  It's very basic but do-able.  You can use this as a baseline if it works for you, prob need to re-size.

June 08, 2019, 07:30:34 PM
Reply #10

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
I understand what you're asking.  Except for doing what flamingolady suggested, which is manually adjusting each path, I still would suggest the same thing, which is pattern along path.

With Inkscape, it's not as easy (as it appears to be in Illustrator) to have the paths later diverge from each other.  But it can be done.  You just have to put separate paths on top (overlapping very slightly).  I'll make an example file, give me a few minutes.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 08, 2019, 08:37:29 PM
Reply #11

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Ok, I'm having some trouble with pattern along path.  I don't know if this is a bug with current versions, or not.  But I can't seem to create a smooth curve with it.  In the past, adding more nodes would make the curve smooth, but it doesn't seem to fix it now.  (I'm using 0.92.3, but shortly I'll test with 0.92.4 or maybe even 1.0 alpha.)

In any case, I've made a couple of examples.  The lower example is using pattern along path.  The upper example is using the Scatter extension.  Note that for both extensions, the pattern object must be on top in z-order.  For the Scatter extension, I used -15 for Space Between Copies, to make the curves meet.  The Scatter extension typically is used for repeating an object along a path, but with the negative space setting, it can be used for a pattern along path type of use.

With the PAP example, I used separate paths, with PAP to make the spaghetti string type of effect at the ends.

I have in the back of my mind, a technique I saw once for doing something similar to this, which I think might be your best solution.  But at the moment I can't remember enough about it, to be able to search it out.  But I'll dig in and start searching to find it.  I know it's there, it's just finding it.  (It's been a few years ago, which is why it doesn't come immediately to mind.)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 08, 2019, 08:50:34 PM
Reply #12

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Omg, I can't believe I found it!

http://www.inkscapeforum.com/viewtopic.php?f=5&t=19220

Now, I'll investigate why I can't get smooth curves with pap.  As you can see in the linked message, smooth curves should be easily possible.  But this is not something I use on a regular basis, so I'm not sure when the problem started.  But I'll try and figure it out now.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 08, 2019, 09:31:43 PM
Reply #13

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
Brynn, wow, you did find that thread!  by the time I read thru it my eyes were crossed, lol.  I would need to see a visual tut in order to even try to duplicate what they did on that thread... I did find it interesting that they used interpolation and also a white stroke for the fill in, I thought it was just a white background that had been clipped or path>diff. 

I tried duplicating your LPE but can't get it, maybe I shouldn't be trying this past midnight!  Might try tomorrow. Did you use Path Effects or go to Extensions>generate from path>PAP?   I copied the pattern to the clipboard and applied it to the path but it was wonky, not sure what I did wrong that this point.  I'm not a huge fan of PAP, seems I waste a lot of time getting it to work right.

June 08, 2019, 10:10:19 PM
Reply #14

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Well, I can't test in 1.0 alpha because it seems that extensions don't work.

0.92.4 has the same trouble making smooth curves as 0.92.3.  I'm not sure if I should make a bug report of this, or if maybe something has changed recently, and there actually is a way to make the smooth curves.  I do remember in versions long past (0.48 or 0.49) that the curves could be made perfectly smooth by adding extra nodes.  But that doesn't seem to work anymore, for some reason.

If I add so many nodes that they are literally touching each other, that can make the curves smooth.  But it's not realistic to use that many nodes.

Anyone else can test and give an opinion?

Flamingolady, I used the PAP extension.  The LPE doesn't allow using groups.  Yes, there's a non-intuitive trick to using the extension, and that is the pattern object has to be on top in z-order.  That trick is now documented on the Help tab of the dialog, so at least I don't have to look it up in the manual every time anymore.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 09, 2019, 06:22:36 AM
Reply #15

the13thsense

  • Sr. Newbie

  • Offline
  • **

  • 6
Oh my god this is amazing!!! Best way to wake up is with the help you guys have given! For now I can use this but if you end up figuring out why it's not smoothing out let me know!
  • 0.92

June 09, 2019, 03:46:17 PM
Reply #16

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
Ah, must be the bug that won't allow it to round, though just tried again and couldn't get ANY curves whatsoever, totally went to a straight line, that was unexpected; and my path was basically a sideways S.  I tried using snake and ribbon, tried clicking on 'pattern is vertical', tried flipping the pattern, to no avail.  Don't see how you even got the bend.  Hopefully the13thsense will have better luck with it than me. 

My suggestion might be, if you really want to use PAP, you 'could' install and use the last version of inkscape that it worked correctly in (install in a separate folder of it's own).  Guess it depends on how bad you want to use that extension. 

I thought at one time you could use combine vs group and it would work on the LPE, maybe that was just wishful thinking.

June 09, 2019, 04:56:11 PM
Reply #17

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
By George I think I've got it! here's secret #1, it IS the number of nodes, that's why my S turned into a line -  add a whole bunch of nodes to the pattern BEFORE you apply the extension, not after!  I kept using Brynn's pattern and then it just dawned on me to look at how many nodes there are, only 4, that's way too small, also, secret #2, on the pattern, ensure the nodes are auto smooth.  Take a look at the attached.  note, I didn't spend a lot of time in making my path real smooth, that's why it isn't totally smooth, but I think you get the idea!  well, for one, I'm happy.   :)

June 10, 2019, 05:19:48 AM
Reply #18

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Interesting.  I didn't think of adding new nodes to the pattern.  I was talking about adding nodes to the path.

Yes, that does seem to work.  And I only had to add one extra node between original nodes, to make it smooth.  So the original group had the 3 rectangles, with 4 nodes each.  I added one extra node in between, making 6 nodes each.  And the result is perfectly smooth!  I didn't use autosmooth nodes, in  either pattern or path.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 10, 2019, 07:50:25 AM
Reply #19

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
Yeah I know you were adding to the path, but that gave me the 'aha' moment, why not to the pattern! So you still get credit! 

I did try it with only a few added nodes and reg cusp nodes and it was still a little wonky, not bad, but the more you add, depending on how curvy your path is, the more smooth it gets.  I wasn't entirely sure about the auto smooth, but it did look a little bit better in a really S'y path I did, every little bit you can do helps, so I'm going with that from now.
I'm wondering if you would want to put in to whomever/wherever to add the hint about adding more (auto sooth) nodes into it's help screen, that would save folks a lot of headaches - would have immensely helped me.

Hope the OP pops in before going too far into the map...

June 10, 2019, 08:54:07 AM
Reply #20

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
I haven't tried using auto smooth nodes.  I got good results with  cusp/corner nodes.  Oh, I just looked at your file again.  You mean using auto smooth nodes on the path, and not on the pattern, right?

I don't think autosmooth nodes would have any effect on it.  Although I don't know that for sure.  I tried using 2 identical V shaped paths, where I switched the middle node to smooth on one and autosmooth on the other.  But I don't see any difference.  Maybe a slight difference in the curve (I assume because they calculate the curve a little differently).  But they are both equally smooth.

But if enough people would test and see that it makes a difference, we could probably get it on the Help tab.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 10, 2019, 09:04:54 AM
Reply #21

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
Well you have a good point, auto smooth on the path vs pattern.  I meant the pattern, but it would make sense to use auto smooth on both, just to be sure.  Wish I had of kept the path that was wonky for more testing.   Yes, we need testers, and the paths should be very curvy.  Brynn, can you try a double S type path vs a V?

Edit, meant to mention - I keep getting a strange result where the PATH was changed! Instead of a stroke of 1.0 px it changed the stroke to 4.790 - made it fat.  Can't figure that one out for the life of me.

June 10, 2019, 10:34:52 AM
Reply #22

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
ok, Here's a little testing reesults (see attached svg). 

Conclusion, add a lot of nodes to your PATTERN to begin with, that makes a huge difference.  While I haven't tested if increasing number of nodes on your path makes a difference, (and until it's tested), I suggest adding extra nodes there too, may as well. 
While not a dramatic difference to the end result, I would advise using auto smooth nodes on everything. 

Oddly, the extension does turn the auto smooth nodes into reg cusp ones on the path, but keeps them smooth on the end result. 

Tip, to get the best result, if your design is not real smooth - enlarge it before applying the extension (use the ctrl key to keep the proportions the same), apply the extension, then resize it back down, and the smooth curves will keep. 

June 10, 2019, 11:32:43 AM
Reply #23

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
I think some of your strange results are from using single stretched.  I was always using repeated stretched.  Possibly the extra nodes and/or autosmooth nodes are helping to compensate for that?

Also, and I'm guilty of this too, using a much shorter pattern helps too, I think.  I could have made mine shorter.  And maybe the extra nodes on the pattern would not be needed?  For example, instead of using 3 rectangles, I used 3 lines?  There wouldn't even be room for extra nodes.  I mean, instead of a pattern like on the left, it was like on the right.

papp.png
*papp.png
(1.12 kB . 298x182)
(viewed 398 times)


Together with repeated stretched, I'll bet the extra nodes wouldn't even be needed.

I'm not sure what you're doing with the wider path.

I can't test it right now, but I'll do it as soon as I get a chance.

  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 10, 2019, 12:03:30 PM
Reply #24

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
I didn't get good results with repeated on some paths, though in general the repeated stretched had the same output as the single stretched. 
As time allows, will try to experiment more.  I just made the pattern larger to add the nodes easier.  Should have mentioned that I did try a few sizes of the pattern, can't figure out how you can get a wide end result if just using a stroke for the path.  So that's why I used a large pattern.
« Last Edit: June 10, 2019, 01:29:16 PM by flamingolady »