d3 / d3-voronoi

Compute the Voronoi diagram of a set of two-dimensional points.
Other
250 stars 65 forks source link

Compute Voronoi topology. #2

Closed mbostock closed 8 years ago

mbostock commented 9 years ago

In addition to #1, we should think about voronoi.topology: mbostock/d3#1819.

mbostock commented 8 years ago

It’s possible we want separate topologies for the cells and the triangle mesh. Having the triangle mesh topology would be useful for computing alpha shapes, for example.

mbostock commented 8 years ago

We’re almost there now that #1 is fixed: each cell exposes the indexes corresponding to each shared edge, so it’s easy to compute the cell topology.

One challenge remaining, though, is that the computed Voronoi diagram isn’t clipped: clipping is done when the cell polygons are computed. And the cell polygons can’t represent the topology.

So, it might be better to undo part of #1 and just apply clipping when computing the Voronoi diagram. That makes it slightly less flexible, but only theoretically… I think it’d still be perfectly fine in practice.

mbostock commented 8 years ago

This is now possible!

cd52a201d7694eb9d890

I’m not inclined to build it into this module yet, because it feels a bit obscure, but it’s doable in “user land” via the computed Voronoi diagram.