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

voronoi.index of triangle vertexes? #34

Closed
mbostock opened this issue Mar 25, 2018 · 1 comment
Closed

voronoi.index of triangle vertexes? #34

mbostock opened this issue Mar 25, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@mbostock
Copy link
Member

What if voronoi.index pointed to the first triangle vertex for a given cell, and then we used the halfedge traversal algorithm lazily? Then we wouldn’t need to precompute voronoi.edges.

@mourner mourner added the enhancement New feature or request label Mar 25, 2018
@redblobgames
Copy link

This is what I do, except I point to the first(*) halfedge. From the halfedge I can get the triangle vertex but I can also traverse in other fun ways.

(*) I've simplified a bit more by adding “ghost” triangles around the convex hull. These link to an “infinity” site. With the ghost elements, halfedges[e] is never -1, which simplifies some of the traversal logic. In exchange, whenever drawing I need to test for ghosts, but overall it's been a big win for my projects.

mbostock added a commit that referenced this issue Aug 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants