Normal of a Line (Perpendicular lines)
Hi,
I have a path built up of line segments. For each segment I have calculated a perpendicular line either side using this topic.
I now have this:
The path runs through the center of these lines.
Is there a way to have each of the lines join up correctly instead of overlapping?
I hope this make sense.
Kind Regards
Jayson
Hi,
In order to make the lines connect correctly, you'll need to trim or extend every line segment with the next line segment.
You know the start and the end points of the lines which is enough for calculating the line intersections.
Check this link for a line-line intersection test.
According to the results of the calculations, you'll need to extend or trim the lines.
it is possible that in some cases like steep curves with many line segments the line segment may actually be reversed, which may is a case you'll need to handle.
Good luck!
In order to make the lines connect correctly, you'll need to trim or extend every line segment with the next line segment.
You know the start and the end points of the lines which is enough for calculating the line intersections.
Check this link for a line-line intersection test.
According to the results of the calculations, you'll need to extend or trim the lines.
it is possible that in some cases like steep curves with many line segments the line segment may actually be reversed, which may is a case you'll need to handle.
Good luck!
The difficulty may be to detect which lines to intersect. There is no problem as long as following a line path, but problems may come up if T junctions and crossings are allowed to occur. I've posted a possible solution in this recent thread which may be of interest.
Quote:Original post by szecsWasn't yet aware of that thread ... The OP seems to have a popular problem these days :)
some other ideas
I have put so much effort to advertise the "idea", that I will implement that some day (to see if works at all). so maybe I have a thread about it too.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement