The next problem is 2D, so some simplifications can be made when you offer answers.
I need to create closed areas (defined either by line segments, or simply by a set of points - a convex polygon) from a set of points / line segments.
Mostly I used Voronoi to create roads. Then I changed some data. Now I need a way to iterate over this data (which are still linear segments, but no longer match Voronoi) and generate “neighborhoods” bordering on “roads”.
I looked at some chart diagrams and shortest paths, but I could not figure it out.
Logically, this can be done by starting from the left edge with one point, finding the path back to this point, using the shortest path with available lines (using only clockwise). Then check this line and delete the data. Then you can repeat the same process and get all such areas.
I tried to implement this, but it didn’t bother me, because I could not figure out how to write C ++ code that could do this. The problem was choosing the line itself counterclockwise from the available lines from a certain point. All the corner-based math, I gave the wrong answers, because the sin / cos method is implemented in C ++.
, - , , , , .
EDIT: , , .
- ( 10 , : P)

( ). , (). , , , , . , , .
!