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

How to get hull's halfedges ? #75

Open
w77 opened this issue Dec 22, 2021 · 3 comments
Open

How to get hull's halfedges ? #75

w77 opened this issue Dec 22, 2021 · 3 comments

Comments

@w77
Copy link

w77 commented Dec 22, 2021

How to get hull's halfedges ? Is there anything to get them directly or must I check all edges around hull's points ?
I need this to close the triangulation on a sphere. The last triangles are made with a pole in sterographic projection connected to each hull's edge. This pole/point is removed before running delaunator then added after and so all new triangles with this new point.

hull give points but hulltri, hullhash, hullnext and hullprev are not related to hull's actual edges.

@redblobgames
Copy link
Collaborator

All the halfedges that don't have an opposite are on the hull. That doesn't put them in order. But if you find any one of these halfedges without an opposite, A→B, then there should be only one halfedge B→ that doesn't have an opposite, and that will be the next one in the hull. You can keep following the chain until you get back to A, I think.

@Fil
Copy link
Collaborator

Fil commented Dec 22, 2021

For a spherical delaunay, you can also check https://github.com/Fil/d3-geo-voronoi (it uses delaunator internally, with the stereographic projection).

@w77
Copy link
Author

w77 commented Dec 22, 2021

For a spherical delaunay, you can also check https://github.com/Fil/d3-geo-voronoi (it uses delaunator internally, with the stereographic projection).

Oui je connais mais je ne comprend pas leur code. Le miens est beaucoup plus simple et marche aussi bien, sauf pour la fin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants