Need help drawing parallel lines with a pattern between them.

Post questions on how to use or achieve an effect in Inkscape.
slackert
Posts: 2
Joined: Thu Feb 25, 2016 2:40 am

Need help drawing parallel lines with a pattern between them.

Postby slackert » Sat Aug 12, 2017 6:34 am

I'm completely green when it comes to graphics...I can usually hack my way through, but am completely lost when it comes to how to accomplish the most rudimentary things. I want to draw two parallel lines (bezier curve?) that have the same spacing between them throughout their length. I then want to fill the spaces between them with perpendicular lines that actually form trapezoids, not blocks per se. The angle of the intersecting line on the inside apex of a curve to the "curve" line will be greater than that of the same on the outside of the apex. I'd like to fill these blocks with different colors...I think I can figure the color fill part out :)

Here's a link to a horrible, rough, paint version of what I want to be able to do:
Image

I need this to be much more precise than I can do freehand. Can someone lead me through the steps and tools I need to use? I can get so far as to draw two parallel lines...and that's about it. I tried the PAP thing, but am really clueless there. Help!

Thanks in advance.

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

Re: Need help drawing parallel lines with a pattern between them.

Postby brynn » Sat Aug 12, 2017 7:46 am

You're on the right track with PAP.

1 - Draw the path (just 1)
2 - Draw the rectangle or square (use the Rectangle tool, and then do Path menu > Object to Path; or draw it with Pen or Pencil tool, making sure that the path is closed, by clicking in the tiny square when you come back around to the beginning of the path)
3 - With the rectangle or square selected, click Edit menu > Copy (or Ctrl C or the button on the command bar)
4 - Select the path from step #1
5 - Path menu > Path Effects > click the + sign and choose Pattern Along Path
6 - In the Pattern Copies dropdown menu, choose Repeated
7 - Click the far right button just above that same dropdown menu (that will allow you to edit the rectangle or square, and the object will be edited live; if you don't want that live edit ability, just click the plain Paste button.

Note that you can even edit the base path (step #1) after you've applied the pattern, by clicking the icon on the left (just above the same dropdown menu).

Polygon
Posts: 393
Joined: Thu Dec 19, 2013 3:27 am

Re: Need help drawing parallel lines with a pattern between them.

Postby Polygon » Sat Aug 12, 2017 7:44 pm

@brynn. Is a single rectangle all it needs? I thought he wants an outline too:
Pattern.png
Pattern.png (42.49 KiB) Viewed 2204 times


Cheers
P.

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

Re: Need help drawing parallel lines with a pattern between them.

Postby brynn » Sun Aug 13, 2017 1:31 am

I didn't put any spacing between the squares, so they are touching each other. As long as you leave the stroke in place it will seem to be outlined.

pap1.png
pap1.png (24.09 KiB) Viewed 2181 times

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

Re: Need help drawing parallel lines with a pattern between them.

Postby brynn » Sun Aug 13, 2017 1:36 am

Since he said he could handle the fill, I didn't include that part. But as we often see in Inkscape, there are often a few or even several ways to accomplish a particular goal with Inkscape. Your way works just as well.

slackert
Posts: 2
Joined: Thu Feb 25, 2016 2:40 am

Re: Need help drawing parallel lines with a pattern between them.

Postby slackert » Tue Aug 15, 2017 5:57 am

Excellent! That worked perfectly! Thanks so much!

I'm not clear on how to remove the lines between the patterns...is that possible?

Polygon
Posts: 393
Joined: Thu Dec 19, 2013 3:27 am

Re: Need help drawing parallel lines with a pattern between them.

Postby Polygon » Tue Aug 15, 2017 9:44 pm

slackert wrote:Excellent! That worked perfectly! Thanks so much!

I'm not clear on how to remove the lines between the patterns...is that possible?

Use a higher value at the "Distance"-property in the "pattern-along-path"-LPE.

Cheers
P.

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

Re: Need help drawing parallel lines with a pattern between them.

Postby brynn » Wed Aug 16, 2017 1:39 am

As before, there are a few different options.

If you used the Paint Bucket tool to fill them, you could "manually" edit the nodes, and overlap the fills, so that the fill covers up the line.

Or here's another way.

-- Before you start, duplicate the original path twice
-- Move them out of the way for now
-- Perform everything as explained above.
-- When finished, select the final result
-- Either make the stroke completely transparent (either zero alpha value or zero opacity); Or, change the width of the stroke to zero (either way, makes the stroke disappear)
-- Move the extra paths into position on the top and bottom. Even though you've made the stroke transparent or zero width, these extra paths will snap to the corners of the first rectangle.

Note that the extra paths will not fit exactly, but they're close. So you'll have to edit with the Node tool, to make them fit well.

Ooorr.... I can't remember this for sure, but I'm pretty sure that if you use the PAP extension, it works with groups. (Extensions menu > Generate from path > Pattern Along Path) So you could make your original pattern made of a square with a fill and no stroke, plus a square with a stroke but no fill on top, where you remove the 2 side segments. Group those together, and use them for the pattern. The only thing is that the extension isn't as "live" as the LPE. It sort of is live, if you use the Live Preview, but still not as live as LPE.


Return to “Help with using Inkscape”