You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run v.create_diagram(points=points) with points = [(0.,0.), (1.,0.), (0.,1.), (1.,1.)] the graph looks okay, four quadrants that are nice and square, but the output of get_coordinates() returns duplicate points:
Hi Penniman, thanks for reporting your issue. I will first explain why you get these results and then provide a possible fix.
Explanation
This is a result of the underlying algorithm. When the sweep line goes down and reaches the first two points, two arcs are inserted. When we reach the second two points, another two arcs are inserted. We then reach the following situation:
Here, two arcs are going to disappear at the exact same time. The algorithm is however going to handle this as two separate steps: first the left arc is going to disappear and so a point will be inserted there, and then we do the same for the right arc. So what we end up with is two points with the same coordinates and a zero-length edge.
(For more information:)
Possible fix
We could update the get_coordinates() to check for succeeding (and also first and last) points with the same coordinates, and exclude those from the result.
When I run
v.create_diagram(points=points)
withpoints = [(0.,0.), (1.,0.), (0.,1.), (1.,1.)]
the graph looks okay, four quadrants that are nice and square, but the output of get_coordinates() returns duplicate points:Notice the duplicated coordinate points for C and B:
The text was updated successfully, but these errors were encountered: