The following problem is in 2D, so answering can be done with some simplification.
I need to create closed areas (line segment or just a set of points - defined by convex polygon) from a set of point / line segments.
Actually, I used Voronio to generate "roads". Then I changed some data, now I need a route to loop through that data (which is still the line segment but does not comply with Voronevo anymore) and with the "roads" the border "down" Generate
I saw something graph diagrams and the shortest way theories, but I could not understand it.
Logically this can be done from one point to the left side, on which the available line (using only clockwise instructions) again mark this line and remove it from the data. Then you can repeat the same process and get all such areas.
I tried to apply it, but I could not find it because I could not find any way to write the C ++ code. The problem was with choosing the most counterclockwise lines from the lines available from a specific point. All the angle-based maths I have answered incorrectly because the way sin / COS has been implemented in C ++.
In short - if you can help the problem completely with a new perspective, well, then you help me find a way to write the portion of the code that Using the fixed line segment in the form returns the clockwise direction at the starting point.
EDIT: To do that picture I want to.
Check the image here - (Before I can post it here, I need 10 installations before: P)
I have a set of digits (purple small dots). Another array defines which points form a line (road). I want a way to define the area which is surrounded by roads, so I can put those buildings or small roads inside it and test against the edges so that each area is different. Hope this will give you more information on how to solve this problem.
Thank you for your help! You may try:
Even if you do not have 'Neighborhood' information, then you probably have all possible pairs purple blue dot and see which line segment For any point, a set of such roads will make a closed area around it.
This can not be optimal, but probably works, although I have to prove it Have not tried.
Forgive Your question is not really clear, but I think that work will be easy. You can use the finishing points of a segment when calculating the rudder.
If you want you to separate from different areas, you can try to find a different line and run the convex hull separately.
Comments
Post a Comment