Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_coordinates() returns None #4

Closed
alexdiab opened this issue May 21, 2020 · 1 comment
Closed

get_coordinates() returns None #4

alexdiab opened this issue May 21, 2020 · 1 comment

Comments

@alexdiab
Copy link

Hi, I have an issue when trying to use get_coordinate() as it returns None for some of the set of points that I use. To reproduce the problem, here is the code that I use

points = [(3.45, 3.66), (6.0, 4.54), (7.82, 5.35), (5.65, 3.09), (1.99, 4.66)]
The_grid = Polygon([
    (0, 0),
    (0, 6),
    (9, 0),
    (9, 6)
])
v = Voronoi(The_grid)
v.create_diagram(points=points, vis_steps=False, verbose=False, vis_result=True, vis_tree=True)
points = v.points
points[2].get_coordinates()

I don't understand why the first_edge attribute present a Nonetype object in next.

I am trying to get all the vertices for each polygon formed by the Voronoi tesselation
Thank you for your help.

Yatoom added a commit that referenced this issue Mar 4, 2021
@Yatoom
Copy link
Owner

Yatoom commented Mar 4, 2021

Thank you very much for reporting this @alexdiab! Using your case, I was able to determine the problem. I added your case as a unit test to prevent future mistakes.

What went wrong?
During clipping, some of the edges fall outside of the bounding box. These need to be deleted, and the pointers need to be updated. It turns out that during this update process, some of the center points ended up pointing to the edges of other center points.

@Yatoom Yatoom closed this as completed Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants