-
Notifications
You must be signed in to change notification settings - Fork 22.9k
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
voronoi.triangles fails with square rectangle #1895
Comments
This is a specific instance of a more general problem: there is more than one possible Delaunay triangulation for n ≥ 4 cocircular points; otherwise there is always a unique triangulation satisfying the Delaunay property. I think a reasonable fix is to pick an arbitrary Delaunay triangulation in this situtation. |
Regular grids contain lots of instances of n = 4 cocircular points, for which there is no unique Delaunay triangulation. |
This issue can be closed. If anything, it is to be reopened on d3-voronoi; but see d3/d3-voronoi#13 which claims another computation method, and d3/d3-voronoi#12 which "solves" it by adding jitter. |
Issue3d/3d image_1895 |
d3.geom.voronoi().triangles returns only one triangle when given 4 points that consists of rectangle.
var h = 100, w = 200, vertices = [[0,0],[w,0],[0,h],[w,h]];
console.log( d3.geom.voronoi().triangles(vertices).length ); // shows 1
vertices = [[0,0],[w,0],[0,h],[w,h + 0.001]];
console.log( d3.geom.voronoi().triangles(vertices).length ); // shows 2
And I hope any accessor to edges(.r/.l) variables inside, especially info about index-based triangles.
The text was updated successfully, but these errors were encountered: