{
replay;
const {triangles, halfedges} = delaunay;
const queue = new FlatQueue();
const onEdge = new Uint8Array(halfedges.length);
const visited = new Uint8Array(points.length);
function addToQueue(i) {
onEdge[i] = 1;
visited[triangles[i]] = 1;
const p0 = points[triangles[i]];
const p1 = points[triangles[i % 3 === 2 ? i - 2 : i + 1]];
const r = circumcircles.r[i];
const x = circumcircles.x[i];
const y = circumcircles.y[i];
const [x0, y0] = p0;
const [x1, y1] = p1;
const area = (y - y0) * (x1 - x) - (x - x0) * (y1 - y);
const cx = (x0 + x1) / 2;
const cy = (y0 + y1) / 2;
const d = Math.sqrt(Math.pow(cx - x, 2) + Math.pow(cy - y, 2));
if (area >= 0 || d / r < 0.2)
queue.push(i, -r);
}
for (let i = 0; i < halfedges.length; i++) {
if (halfedges[i] === -1) addToQueue(i);
}
const ctx = DOM.context2d(width, height);
yield draw(ctx, queue, onEdge);
while (true) {
await Promises.delay(100);
const i = queue.pop();
if (i === undefined) break;
const i1 = halfedges[i % 3 === 2 ? i - 2 : i + 1];
const i2 = halfedges[i % 3 === 0 ? i + 2 : i - 1];
if (!visited[triangles[i1]] && i1 !== -1) {
addToQueue(i1);
addToQueue(i2);
onEdge[i] = 0;
}
yield draw(ctx, queue, onEdge);
}
}