Hi there,
I'm hoping I can be pointed in the right direction here..
I have a race track design, done from a Path. I need to be able to split the path up into segments and then do a stroke on top of that, that covers 1/4 of the width of the track.
I want it to look like the example file..only the track doesn't need to have 2 lanes, just one, but the stripes down the side need to be various different colours depending on the section of the track. I know I can do these by copying the path and using the inset or outset tool. However, I don't know how to break my path up into sections like those in the example. It would be super helpful if these segments were easily adjustable too.
The track will be split into 25 segments, most of which have a different colour inset into them.
EDIT: I have attached a better example in In Inkscape of what I want it to look like - only the blue line needs to be different colours per 'zone'. Is there any way to attach the thin white line objects to the path so that they follow its curvature and always stay within its bounds? I could just duplicate them 24 times then and move them around freehand.
I have had a look at pattern along path but the distance between the lines will not always be the same as it needs to denote different areas of the track, like a tight bend, straight, fast corner etc
Any help greatly appreciated!
Rich
Segmenting a Path? (Designing a racetrack)
Segmenting a Path? (Designing a racetrack)
- Attachments
-
- track2.svg
- (32.73 KiB) Downloaded 185 times
-
- example.jpg (245.98 KiB) Viewed 4464 times
Last edited by GTAjedi on Tue Feb 04, 2014 5:39 am, edited 6 times in total.
Re: Segmenting a Path? (Designing a racetrack)
Hi.
That track has curves with smaller curve radiuses than half of the stroke width, causing problems.
Resulting in sharp inner corners.
I suggest you to correct them before moving on.
That track has curves with smaller curve radiuses than half of the stroke width, causing problems.
Resulting in sharp inner corners.
I suggest you to correct them before moving on.
Re: Segmenting a Path? (Designing a racetrack)
Thanks but that isn't really an issue for me (unless you can explain why it prevents me doing what I want to) and doesn't really solve my problem.
Re: Segmenting a Path? (Designing a racetrack)
Thinking of a regular highway: would anyone perform a powerslide in the middle of the road, just to go on the right track?

More so, a path with a stroke is not a precise solution of what you want to achieve.
By drawing the inner edge or the outer edge, you could draw parallel lines with the dynamic offset feature.
Not a precise tool itself, nor would it work with the sharp corners you have -thus made that suggestion.
The other solution I would follow, is to draw each the outer and inner parts of the tracks, and, to use the interpolate extension to generate parallel lines in between. Which again, with sharp corners is not working nice.
Creating lines crossing the road in exact distances- you can do that with the pattern along path live path effect.
But where the track's radius is below it's width, those lines will actually intersect with eachother.
It is not a good starting point I guess.
It was my opinion that the mentioned problem makes it impossible to have a clean design.
If that's not an issue for you, then what is your question?
More so, a path with a stroke is not a precise solution of what you want to achieve.
By drawing the inner edge or the outer edge, you could draw parallel lines with the dynamic offset feature.
Not a precise tool itself, nor would it work with the sharp corners you have -thus made that suggestion.
The other solution I would follow, is to draw each the outer and inner parts of the tracks, and, to use the interpolate extension to generate parallel lines in between. Which again, with sharp corners is not working nice.
Creating lines crossing the road in exact distances- you can do that with the pattern along path live path effect.
But where the track's radius is below it's width, those lines will actually intersect with eachother.
It is not a good starting point I guess.
It was my opinion that the mentioned problem makes it impossible to have a clean design.
If that's not an issue for you, then what is your question?
Re: Segmenting a Path? (Designing a racetrack)
Hello:
I kind of understand your requirement, more or less.
I think it's related with this topic:
viewtopic.php" onclick="readonly();return false;"postlink" href="http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Paths-LivePathEffects-BendTool.html">http://tavmjong.free.fr/INKSCAPE/MANUAL ... dTool.html
First, you should draw your path as an horizontal path, trying to be the same length of your racetrack, in order to avoid distortions. Next, apply yhe path effect. Last copy an paste the skeleton path (your racetrack path)
I'm attaching a zip file with an inkscape SVG file, to exemplify what I mean. I have to say that when applying the bend tool to a group with a lot of elements, my machine almost hang outs. So I hope your machine were of last generation, it could ease the calculation of the effect.
Greetings
I kind of understand your requirement, more or less.
I think it's related with this topic:
viewtopic.php" onclick="readonly();return false;"postlink" href="http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Paths-LivePathEffects-BendTool.html">http://tavmjong.free.fr/INKSCAPE/MANUAL ... dTool.html
First, you should draw your path as an horizontal path, trying to be the same length of your racetrack, in order to avoid distortions. Next, apply yhe path effect. Last copy an paste the skeleton path (your racetrack path)
I'm attaching a zip file with an inkscape SVG file, to exemplify what I mean. I have to say that when applying the bend tool to a group with a lot of elements, my machine almost hang outs. So I hope your machine were of last generation, it could ease the calculation of the effect.
Greetings
- Attachments
-
- track0.zip
- (78.23 KiB) Downloaded 183 times
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.
Re: Segmenting a Path? (Designing a racetrack)
Lazur URH wrote:Thinking of a regular highway: would anyone perform a powerslide in the middle of the road, just to go on the right track?
More so, a path with a stroke is not a precise solution of what you want to achieve.
By drawing the inner edge or the outer edge, you could draw parallel lines with the dynamic offset feature.
Not a precise tool itself, nor would it work with the sharp corners you have -thus made that suggestion.
The other solution I would follow, is to draw each the outer and inner parts of the tracks, and, to use the interpolate extension to generate parallel lines in between. Which again, with sharp corners is not working nice.
Creating lines crossing the road in exact distances- you can do that with the pattern along path live path effect.
But where the track's radius is below it's width, those lines will actually intersect with eachother.
It is not a good starting point I guess.
It was my opinion that the mentioned problem makes it impossible to have a clean design.
If that's not an issue for you, then what is your question?
Ah OK. For the final track I was planning to use a fill for the track surface with a thin stroke for the outside (white line). I see what you mean about the tightness of the corners now but there probably won't be any like that - I suppose it was a poor example file and probably didn't explain what I wanted too well.
I have attached a (hopefully) much better example of what I am trying to achieve as track.svg. I can achieve a similar effect with pattern to path but I need the distances between the white lines (which I have just manually placed) to be variable as each section of the track is not equal length.
The other thing I don't quite understand is how I could make the blue line different colours in each section. I tried cutting the path and apply a different stroke but it just applies it to the whole path.
Re: Segmenting a Path? (Designing a racetrack)
Quick modifications here.
The outline was turned to a path (Shift+Alt+C), and nodes added here and there, making it possible to pair inner nodes with outer ones.
Then, a duplicant of it was broken apart (Ctrl+Shift+K), changed the direction of one of them, and the interpolate extension was run twice:
once it was making the yellow paths in parallel to eachother, and once toreproduce the centerline of the track.
Then, on that centerline, the pattern along path live path effect was set, to have an approximation of perpendiculars, that can make up segments.
How to move on: with ungrouping any interpolated parallel paths, you can combine two together -after one being reversed- to have a nice filled path with no outlines.
To draw the segments, draw each's edge with a path intersecting it with the track beneath, then you can edit duplicants of them manually.
If you can give a reference on the divisions, then I could improve on this.
If it was for a slotcar racetrack, a geometrical design would work better?
http://www.slotforum.com/forums/index.php?automodule=blog&blogid=116&showentry=1741
The outline was turned to a path (Shift+Alt+C), and nodes added here and there, making it possible to pair inner nodes with outer ones.
Then, a duplicant of it was broken apart (Ctrl+Shift+K), changed the direction of one of them, and the interpolate extension was run twice:
once it was making the yellow paths in parallel to eachother, and once toreproduce the centerline of the track.
Then, on that centerline, the pattern along path live path effect was set, to have an approximation of perpendiculars, that can make up segments.
How to move on: with ungrouping any interpolated parallel paths, you can combine two together -after one being reversed- to have a nice filled path with no outlines.
To draw the segments, draw each's edge with a path intersecting it with the track beneath, then you can edit duplicants of them manually.
If you can give a reference on the divisions, then I could improve on this.
If it was for a slotcar racetrack, a geometrical design would work better?
http://www.slotforum.com/forums/index.php?automodule=blog&blogid=116&showentry=1741
Re: Segmenting a Path? (Designing a racetrack)
Ahh, my apologies! I thought I had uploaded a new file but I've just uploaded the same thing again /doh
The correct file is now uploaded as track2.svg. This is more or less exactly how I want it to look. Obviously all I've done is make some white lines and manually place them. What I want to do is automate somewhat the generate of them. The track is for a board game I am making, so it doesnt need a centre line or any lanes (I may do in future but you guys have covered that pretty well).
The issue I was having with pattern to path is that the sections are of irregular lengths.
I had a look at the quick mods you did to the original file - I can follow you up to a point but then I'm lost. Reading what you've written though, I think the same thing can be applied to the track2.svg file to achieve what I want.
The correct file has the divisions I am looking for (pretty much exactly).
Sorry for the confusion and thanks for the help!
The correct file is now uploaded as track2.svg. This is more or less exactly how I want it to look. Obviously all I've done is make some white lines and manually place them. What I want to do is automate somewhat the generate of them. The track is for a board game I am making, so it doesnt need a centre line or any lanes (I may do in future but you guys have covered that pretty well).
The issue I was having with pattern to path is that the sections are of irregular lengths.
I had a look at the quick mods you did to the original file - I can follow you up to a point but then I'm lost. Reading what you've written though, I think the same thing can be applied to the track2.svg file to achieve what I want.
The correct file has the divisions I am looking for (pretty much exactly).
Sorry for the confusion and thanks for the help!
Re: Segmenting a Path? (Designing a racetrack)
Cleaned version:
https://dl.dropbox.com/s/asdivrjaxefvaio/hlp115II.svg
To make the originally blue part, used an interpolation with 20 steps and used the one at the right proportion of the track.
Then, converted those white rectangles at the edges of each segment to paths, edited them to be in place, then
used an alteration of it to be subtracted from the blue part.
To adjust the colours of the parts, use the node editor tool to select them.
Can't think of an automated way to make it this clean.
https://dl.dropbox.com/s/asdivrjaxefvaio/hlp115II.svg
To make the originally blue part, used an interpolation with 20 steps and used the one at the right proportion of the track.
Then, converted those white rectangles at the edges of each segment to paths, edited them to be in place, then
used an alteration of it to be subtracted from the blue part.
To adjust the colours of the parts, use the node editor tool to select them.
Can't think of an automated way to make it this clean.
Re: Segmenting a Path? (Designing a racetrack)
That's great! Exactly how I wanted to be able to do it. Unfortunately, I don't understand how you've done it 
Presumably you started by converting the blue path using Path to Stroke?
Pretty much stuck at the 1st step! I read a bit about the Interpolate function but I don't understand which 2 paths you are interpolating?
Converting the rectangles to paths I can do
I think you've moved them so the path points of the white rectangle/paths intersect points on the blue path?
Don't understand the "alteration of it to be subtracted from the blue part" either. What alteration do you make? Do you then use Path > Difference?
The automation isn't so bad
As long as I can change the colours of the blue line for each individual section.

Presumably you started by converting the blue path using Path to Stroke?
Pretty much stuck at the 1st step! I read a bit about the Interpolate function but I don't understand which 2 paths you are interpolating?
Converting the rectangles to paths I can do

Don't understand the "alteration of it to be subtracted from the blue part" either. What alteration do you make? Do you then use Path > Difference?
The automation isn't so bad

Re: Segmenting a Path? (Designing a racetrack)
All right, let's see if I can break it down to steps.

It all went something like this, in a nutshell...
There is no automation to do these.
Though the result could look much better if the original racetrack was constructed in a geometric way.
- original path with no fill but stroke given
- stroke converted to path (Shift+Alt+C)
- path duplicated (Ctrl+D), and a red fill is set with opacity;
time to clean up the details
-removing unnecessary nodes, setting segments straight where they should be,
adjusting handles - cleaned up path
- path duplicated (Ctrl+D), blue fill set, and broken apart (Ctrl+Shift+K)
- removed the blue paths fills and added outline,
opened their two straight segments, making sure their start and end nodes will be pair with the later extension run
one of the paths's direction is reversed - the interpolate extension run with 20 steps
- the right path chosen of the 20
- ungrouped the extension's result, then deleted unecessary objects
- middle path's direction reversed, duplicated and combined with the outer path, then
unconnected nodes were connected and fill is set with no stroke - the same thing done on the other side
- the basic part of the racetrack is ready, time to start making those segments
- rectangles showing the segment's edges from the original svg
- all converted to path (Ctrl+Shift+C) and combined together (Ctrl+K)
- new nodes added to the middle of line segments with the node editor tool's option
- stroke given and no fill
- segments opened and nodes deleted
- nodes deleted, segments straightened
- segmenting edge path duplicated (Ctrl+D), set stroke to red, scaled up each proportionally-individually through the transformation panel (Shift+Ctrl+M)
- scaled up paths combined back together, thin stroke width given
and the original's nodes snapped to path intersection points -snapping enabled; changed to outline mode (Ctrl+5 on the numpad twice) - converted stroke to path (Shift+Alt+C), and subtracted from the blue path below (Ctrl+-)
- the blue path broken apart (Ctrl+Shift+K), the tweak tool used to add random colours, and objects grouped together
It all went something like this, in a nutshell...
There is no automation to do these.
Though the result could look much better if the original racetrack was constructed in a geometric way.
Re: Segmenting a Path? (Designing a racetrack)
Heya,
Thanks for the help. I am now able to segment the coloured line which allows me to do what I want!
Thanks for the help. I am now able to segment the coloured line which allows me to do what I want!
