N
N
NoEscape2014-01-22 21:32:33
Algorithms
NoEscape, 2014-01-22 21:32:33

How to build a "road", having an array of points?

fb41f6ffc083.png
The yellow line is a line built by sequentially connecting points from an array.
You need to end up with something like this:
maxresdefault.jpg
Can you tell me the algorithm for obtaining points of the edges of the road?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2014-01-22
@NoEscape

Linear algebra, school? Equation of a straight line through two given points (road segment). Its offset along the perpendicular in both directions by the width of the road = shoulders of this segment.
Intersections resp. straight lines with shoulders of adjacent segments = shoulder corners.
A special case is very sharp corners (imagine an angle of about 1˚) - shoulders can go to infinity to cross. It is necessary to limit the distance of the point of intersection of the outer shoulders from the point of the corner of the center line. See the term "miter limit".
Miter%20Limit%20Illustration.gif 

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question