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
Yep, the problem here is in the robustness of the method to determine if a seed is inside a triangle. Your input set has some seeds that are perfectly aligned (seeds 16, 5, 3),
One silly solution is just to change the order of your input data, calling random.shuffle.
random.shuffle(seeds)
forsinseeds:
dt.addPoint(s)
with produce this graph:
If you don't want to relay into random.shuffle (which could produce another bad permutation of your seeds), you can also sort the seed by coordinate X or coordinate Y
#Compute the permutation that sort the input points by X-coordinateperm=sorted(range(len(seeds)), key=lambdax: seeds[x][0])
#Add points to delaunay using that permutation orderforiinperm:
dt.addPoint(seeds[i])```
Hi! I used parts of your project in my own project (you can take a look at my project here: https://personnumber3377.github.io/projects/implementing_weighted_voronoi_stippling.html and here is the source code: https://github.com/personnumber3377/pythondelaunay )
If you set the points to this:
inside of delaunay2D_plotDemo.py and then when you try running it, you should get this error:
I don't really understand how your code works, so I don't really know how to fix it, but maybe you can add some insight to this?
Thanks in advance!
The text was updated successfully, but these errors were encountered: