Imagine a GPS navigation system with lines connecting different locations. These lines are on roads (always straight, never curved) passing through multiple points. A simple representation is shown below.
Now it is possible that lines overlap. Lines that overlap must be placed in complete adjacent to the existing lines. How can I achieve this effect?
How can I build a system lines stay adjacent to overlapping lines and never cross over each other?
Intended-
Not intended-
As long as the red line does not intersect itself, define a 'left' of the line, in relation to its direction, you can use a normal to the line and pick a side. Then add a factor of this normal to each end point of your original line, and you have the blue line end points.