Here's a set of points that causes a test in tests.js to fail. Are collinear points a problem? I tried adding Math.random() to each point and this test still fails.
tape("delaunator: properly connected halfedges", function(t) {
let points = [[122,270],[181,121],[195,852],[204,694],[273,525],[280,355],[31,946],
[319,938],[33,625],[344,93],[369,793],[38,18],[426,539],[454,239],
[503,51],[506,997],[516,661],[532,386],[619,889],[689,131],[730,511],
[747,750],[760,285],[856,83],[88,479],[884,943],[927,696],[960,472],
[992,253]];
var d = new Delaunator(points);
for (var i = 0; i < d.halfedges.length; i++) {
var i2 = d.halfedges[i];
if (i2 !== -1 && d.halfedges[i2] !== i) {
t.fail('invalid halfedge connection');
}
}
t.pass('halfedges are valid');
t.end();
});
Here's a set of points that causes a test in tests.js to fail. Are collinear points a problem? I tried adding
Math.random()
to each point and this test still fails.