How to make a racetrack/road?

Post questions on how to use or achieve an effect in Inkscape.
jb15
Posts: 11
Joined: Sun Mar 13, 2011 5:53 am

How to make a racetrack/road?

Postby jb15 » Sun Mar 13, 2011 5:58 am

I'm new to Inkscape. I'm trying to make multiple (25+) racetrack roads. I'd like to be able to make what I want the road to look like, and then make it so that it's sort of a "pen" or stamp--so I can draw a quick line using pencil, and the computer automatically makes it a racetrack.

Any help would be appreciated. If you're not sure what I'm asking---I think what I'm trying to do is this:

http://vector.tutsplus.com/tutorials/to ... on-a-path/

llogg
Posts: 443
Joined: Tue Mar 11, 2008 7:30 am

Re: How to make a racetrack/road?

Postby llogg » Sun Mar 13, 2011 11:56 am

Your best bet for the approach you mention is to make the road pattern and then draw the path of your racetrack and do "Pattern along path". The shorter the length of your pattern the smoother your pattern along path can be using the Repeated, stretched option. I would say, however, you'd probably be able to simply draw the path and make a few duplicates of various stroke widths and get a better result.

llogg
Posts: 443
Joined: Tue Mar 11, 2008 7:30 am

Re: How to make a racetrack/road?

Postby llogg » Sun Mar 13, 2011 12:18 pm

On the left I used the pattern along path approach. The pattern is a group of two lines. One was made with a width of 128 and the dashed white lines with width of 16 or 32, can't remember. Gave the thick line a stroke pattern of sand and dropped the opacity of the thin line to around 80. Drew the track shape with the Bezier tool and did pattern along path. When I exported the bitmap I don't know why it dropped the dashed line on one part of the curve, in inkscape it is continuous.

On the right I used the same track shape path, duplicated it and gave the bottom path a stroke width of 128 and pattern of sand and the top path a dashed white stroke of thickness 16. This approach is much simpler and more effective. With more detail I would guess the pattern along path approach becomes more attractive, but also more cumbersome.
Attachments
racetracks.png
racetracks.png (140.28 KiB) Viewed 5741 times

jb15
Posts: 11
Joined: Sun Mar 13, 2011 5:53 am

Re: How to make a racetrack/road?

Postby jb15 » Mon Mar 14, 2011 10:51 pm

Thank you both for the responses; is there a chance you could take screenshots/video of what you did? I've tried a few different ways, and I don't seem to get it right.

Here are screenshots of what I'm doing (or, what I'm not doing...) :)
1. I draw squares, to make a track "pattern." At this point, they're only objects.
http://img858.imageshack.us/i/80926192.jpg/

2. I click Object > Pattern > Objects to Pattern
http://img190.imageshack.us/i/19228201.jpg/

3. At this point, I've figured out how to make the pattern appear in different shapes (for instance, a sqaure object):
http://img33.imageshack.us/i/23706124.jpg/

4. I make a "path" image using bezier:
http://img593.imageshack.us/i/92448648.jpg/

5. With the "path" image selected, I click "Path" > "Object to Path"

6. With the "path" image selected, I click "Exensions" > "Generate from Path" > "Pattern along Path"
http://img846.imageshack.us/i/62970515.jpg/

7. I click "Apply" and get an error message
http://img684.imageshack.us/i/92452429.jpg/

8. When I try selecting both the path, and the path image, and apply the pattern along path, this is what I get:
http://img819.imageshack.us/i/87177555.jpg/

Help would be VERY, VERY, VERY appreciated. Especially a step by step, or video instructions. THANKS!

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

Re: How to make a racetrack/road?

Postby brynn » Tue Mar 15, 2011 1:46 am

Hi jb15,
Image
Welcome to InkscapeForum!

It sounds like you're on the right track Image! Sorry :lol:
Ok, I think I know what's going wrong for you. I know this is gonna sound confusing, and honestly I can't explain it. But you DON'T do Object to Pattern when using Pattern Along Path. (Object to Pattern IS necessary if you're filling an object with a pattern-- like in your example where you filled a rectangle with your track pattern.) So do exactly what you've already done, except without converting the object to pattern.

A couple of things to watch out for: 1 - You have to have your object/group/pattern on top in z-order. And 2 - If your track object/group/pattern is too long, you will not have nice smooth curves. I'll upload a couple of examples to show you what i'm talking about. Also 3 - Note that if you use very sharp angles like in your skeleton path, it will distort the pattern. Now you can't even do pattern along path, without distorting your pattern. That's just how it works. But you can reduce the distortion by having broad sweeping curves in the skeleton path.

track samples.png
track samples.png (68.96 KiB) Viewed 5699 times


Let us know how it goes. Here's a link to the manual info on Pattern Along Path: http://tavmjong.free.fr/INKSCAPE/MANUAL ... nAlongPath

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

Re: How to make a racetrack/road?

Postby druban » Tue Mar 15, 2011 4:57 pm

Hi JB.
Breaking down your steps:
#1-3. Useful to know how to define and use pattern fills but not related to your question.
#4 & 5. Paths drawn with the bez tool are already paths so object to path does nothing.
#6 & 7. You only have one object selected. The extension cannot use the previously defined pattern if that's what you are expecting it to do. That pattern is only for the fill and stroke function to use.
#8. If I understand your description correctly, this should/might work, if you correct the z order of your objects. Use this button on the tool control bar:
g3179.png
g3179.png (3.49 KiB) Viewed 5677 times
to change the z order of your pattern object by selecting it by itself and then clicking. This brings it to the top, which is where it needs to be for the extension to work.
(The funky swirl is actually the top path being put on the lower one if I am reading your screenshot right...)
Your mind is what you think it is.

jb15
Posts: 11
Joined: Sun Mar 13, 2011 5:53 am

Re: How to make a racetrack/road?

Postby jb15 » Wed Mar 16, 2011 10:31 am

Wow! THANKS for the great info! I've messed around a little bit, and figured out a few things, and made my first track.

I am still having trouble with the "sand" image (instead of just a plain, grey-black color). I'll upload a screenshot, with a little more info, tomorrow.

THANKS for your time and assistance thus far.

jb15
Posts: 11
Joined: Sun Mar 13, 2011 5:53 am

Re: How to make a racetrack/road?

Postby jb15 » Wed Mar 16, 2011 10:42 am

brynn wrote:It sounds like you're on the right track Image! Sorry :lol:


I had to read that a few times before I figured it out... :)

chriswww
Posts: 383
Joined: Fri Nov 19, 2010 3:04 pm

Re: How to make a racetrack/road?

Postby chriswww » Wed Mar 16, 2011 3:34 pm

you could also possibly do the track using linked offsets, as long as there's no crossovers it works.
1 - create closed bezier curve with black fill and whatever color and size of stroke
2 - create linked offset. bring it to top as it's created underneath, and change fill to white. adjust the total width of the track/road by dragging the one control point on the linked offset inwards.
3 - create another linked offset and raise to top. change fill to none and change stroke to dashed of desired (white) color. and drag control point so the dashed line is in centre of the road.
now you can edit/drag the original bezier curve node points, and the linked offsets follow along. use whatever filter you desire for the original black fill to become more road like in appearance.

jb15
Posts: 11
Joined: Sun Mar 13, 2011 5:53 am

Re: How to make a racetrack/road?

Postby jb15 » Thu Mar 17, 2011 4:06 am

I've added the "Film" filter effect to the gray and green in my road, to make a pretty good grass/asphalt effect. I wondered, though: how do I scale the filter down, so that it doesn't looks so pixely (does that make sense)? The filter size is to big--I want it shrinked. I don't think I need to add a screenshot--if I do, let me know.

chriswww
Posts: 383
Joined: Fri Nov 19, 2010 3:04 pm

Re: How to make a racetrack/road?

Postby chriswww » Thu Mar 17, 2011 11:50 am

this comes up from time to time. i don't know the current status of this, i.e. is it a planned improvement to filters at large. afaik at moment you still can't scale the filter effect itself; unless someone else here more knowledgable offers better advice or some tricks. so for now i try to draw objects at a scale that's mostly suitable for filter effects, the A4 or thereabouts being a ok starting point for the whole drawing svg. but if you do an object of say 5 pixels diameter, then filters don't seem to work that well. you could always post-process with gimp or other program more equipped at funky raster based filters.

jb15
Posts: 11
Joined: Sun Mar 13, 2011 5:53 am

Re: How to make a racetrack/road?

Postby jb15 » Fri Mar 18, 2011 7:41 am

Here's what I've done (to rezise or scale the filter down):

1. I set the page size to 4x what I want the end-image to be.
2. I apply the filter.
3. I set resize the image to 1/4 of it's current size (which makes it the width/height I want).

While it might not be the best technique, it's good enough for my purposes.


Return to “Help with using Inkscape”