Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Shifted from Voronoi to Delaunay triangulation, to direct Delaunay Triangulation #13

Closed
wants to merge 1 commit into from

Conversation

adithyaphilip
Copy link

@adithyaphilip adithyaphilip commented Jul 28, 2016

This PR fixes d3/d3#1895.

The issue stemmed from the fact that we first perform a Voronoi Tessellation and then attempt to derive the Delaunay Triangulation from it. This works fine in all cases except when there is a set of cocircular points (n >= 4) anywhere within the input, leading to the formation of degenerate Voronoi vertices (degree > 3). For such vertices, the standard technique of joining the sites of neighbouring cells will not produce a valid Delaunay triangulation (Chapter 4. Delaunay Triangulation in https://www.whitman.edu/Documents/Academics/Mathematics/dobrinat.pdf).

Instead of depending on the Voronoi Diagram, this PR aims to derive the Delaunay Triangulation directly using the fast implementation seen in https://github.com/ironwallaby/delaunay.

P.S.
A more efficient solution would be to first generate the Voronoi vertices from the Voronoi edges (that have already been computed), identify the degenerate vertices, and specially handle the triangulation for them. This would involve gathering all the input points (sites) that are involved with that vertex, and then triangulating them separately. This special triangulation could be made even more efficient by sorting these vertices, and triangulating in a clockwise manner instead of considering all possible triangulations (since any triangulation of a cocircular set of points should give a Delaunay triangulation). I'm not sure if this method is documented or something I just thought of, so I thought I'd wait for a go-ahead in case the added complexity was not worth the improvement in efficiency.

@quentin-ol
Copy link

Is there any plan to accept this PR?

@thetroy thetroy mentioned this pull request Jan 20, 2017
@mbostock
Copy link
Member

mbostock commented Aug 6, 2018

d3-voronoi will probably, eventually be replaced with d3-delaunay, which is much faster at computing the Delaunay triangulation and its dual.

@mbostock mbostock closed this Aug 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants