Mobile app version of vmapp.org
Login or Join
Angela777

: Create and Edit parallel "bus" lines in Inkscape Of course I've seen Create and Edit Parallel Paths in Inkscape - Graphic Design Stack Exchange, but the "Stroke to Path" answer there doesn't

@Angela777

Posted in: #Diagram #Inkscape

Of course I've seen Create and Edit Parallel Paths in Inkscape - Graphic Design Stack Exchange, but the "Stroke to Path" answer there doesn't cut it for me - because I want to draw "parallel lines" as "bus connections" in technical diagrams, like this poor fellow:

Inkscape-User - Parallel lines brush?



I would like to have a sort of "hatched" parallel line brush (useful for representing busses in diagrams). This is what I could get to:
* Draw three parallel lines [...]


Can you show a sample image of what you want? Your description is
somewhat confusing.


Well, here is an image then (using inkscape 0.48.1 on Ubuntu):



I basically want a single path (stroke), which is "styled" with parallel lines (strokes), and which still allows for editing through the nodes; as it can be seen on the image, I'm almost there - except the "styling" lines are not parallel, as there is a distortion (widening towards the ends of the master path). This distortion is a known issue, apparently:

InkscapeForum.com • View topic - Non-destructive Pattern Along Path ?


Both Pattern Along Path, and its LPE version, skew the objects/paths after aligning them to each node. While this is desirable in maintaining continuity when applying a single shape to a curve, it results in distorting repeated objects at corners.


OK, here is a step by step of what I've tried so far (for full size of the images, copy their imgur link, open it in another tab, and then remove the last m from the filename, so e.g. wHTbjm.png becomes wHTbj.png):


Draw a simple line with pen tool - a horizontal path:

Copy this line three times - that is my "parallel" pattern:

Select all three lines, and choose Path / Combine:

Now all three lines are considered as a single path with 6 nodes:

Start drawing a "master" line with the Pen tool:

The final "master" line, that I want to make a "parallel bus", is now made of three segments with right angle corners:

Select the "parallel pattern" path, and then Object / Raise to Top:

Then choose Extensions / Generate from path / Pattern along Path:

Having set up the resulting window as shown below, I simply cannot get anything resembling the parallel line styling of the master line I had in mind:

So, dropping that approach - and trying the other Pattern along Path; for this, we need to copy the "parallel pattern" first:

Then choose Path / Path effect editor:

Then from the Path effect editor window, choose Pattern along path from the Apply new effect dropdown, and click Add:

Once the effect is added, click on Link to path button in the Pattern source row (the link refers to the object currently in clipboard, which is the parallel pattern that we copied previously)

There we go - almost parallel lines styling of the master line, if there wasn't for the distortion towards the ends:

At least the nodes of the master line are still editable, and the effect follows:



Actually, since here the "parallel pattern" path is linked - you can edit that one too (with the pen tool), and the master line style will update accordingly; and I tried turning the parallel pattern lines into curves (so as to compensate for the distortion manually) - needless to say, that works very poorly...

Well - anyone know how to get proper parallel "bus" lines in Inkscape?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Angela777

1 Comments

Sorted by latest first Latest Oldest Best

 

@Angela777

OK, here's one way (a bit tedious though) - thanks to Bug #493318 “Clone behavior is broken with style inheritance” : Bugs : Inkscape:


Using pen tool, draw an outline of the "master" line
Select the master line, Alt-D to "clone" it
Select the cloned line, set a different stroke color - you will notice it has no effect at that time
Select the master line again, open the Fill & Stroke menu (Shift+Ctrl+F); on the Stroke paint tab, choose ? to unset the stroke (NB: this is different from the x option, which means "set - but no paint")
You should instantly see the cloned line get the stroke color you set previously
You can now Ctrl-D (Duplicate) the cloned line (don't clone the cloned line :))
Make one of the clones' stroke 8 px wide and black; and the other 4 px wide and white
Select all (the master and the clone lines) - choose Align, and align vertically and horizontally, so all lines have the same positions
From the XML editor (Shift+Ctrl+X - as there is no other "object list" in Inkscape), select the master line - and then Object / Raise to top
Select all (the master and the clone lines) again - and group them


So right now:


the master line is invisible, and on top - and it has nodes to edit
the clones lie below the master line, are visible - but do not have nodes to edit


Thus, if you select the pen tool, you can actually manipulate/edit the nodes of the master line - and since there are no nodes on the clones (and they must follow the nodes of the master), there is the effect of editable "parallel style" line:



Unfortunately, it's a bit difficult to select the master line (given it's in a group), so one must use the XML editor to select it, before one can edit the nodes with the pen tool (easy enough for a simple example - but I can imagine, a bit tedious in a big document)...

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme