This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modification of delaunay.neighbors to find Voronoi cell neighbors | |
// This generator should be attached to delaunay.voronoi | |
*neighbors(i) { | |
const {delaunay: {inedges, hull, _hullIndex, halfedges, triangles, collinear = undefined}} = this; | |
// degenerate case with several collinear points | |
if (collinear) { | |
const l = collinear.indexOf(i); | |
if (l > 0) yield collinear[l - 1]; |