delaunator icon indicating copy to clipboard operation
delaunator copied to clipboard

How to get hull's halfedges ?

Open w77 opened this issue 3 years ago • 3 comments

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.

w77 avatar Dec 22 '21 02:12 w77

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.

redblobgames avatar Dec 22 '21 04:12 redblobgames

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

Fil avatar Dec 22 '21 14:12 Fil

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.

w77 avatar Dec 22 '21 14:12 w77