ckrbd.js
//a visit, for second part of Voronoi after closest dot.
a visit, for second part of Voronoi after closest dot.
a visit for second part of Voronoi after closest dot .
function GERedux(i,j,levl){
    var k = pyr[i][j];
    if (k){
        if (levl == 0) {
            cellChildren(i,j).forEach(cell => {
                let ck = image[cell.i][cell.j];
                if (ck == 0) image[cell.i][cell.j] = k;
                else {
                    let d2K = d2(cell.i,cell.j,dots[k].i,dots[k].j);
                    let d2Ck = d2(cell.i,cell.j,dots[ck].i,dots[ck].j)
                    if (d2K < d2Ck) image[cell.i][cell.j] = k;
                }
            });
        } else {
            children(i,j,levl).forEach(child => {
                let ck = pyr[child.i][child.j];
                if (ck == 0) pyr[child.i][child.j] = k;
                else {
                    let d2K = d2(child.i,child.j,dots[k].i,dots[k].j);
                    let d2Ck = d2(child.i,child.j,dots[ck].i,dots[ck].j)
                    if (d2K < d2Ck) pyr[child.i][child.j] = k;
                }
            });
        }
        return 1;
    } else return 0;
}
function GERedux ( i , j , levl ) { var k = pyr [ i ] [ j ] ; if ( k ) { if ( levl == 0 ) { cellChildren ( i , j ) . forEach ( cell => { let ck = image [ cell . i ] [ cell . j ] ; if ( ck == 0 ) image [ cell . i ] [ cell . j ] = k ; else { let d2K = d2 ( cell . i , cell . j , dots [ k ] . i , dots [ k ] . j ) ; let d2Ck = d2 ( cell . i , cell . j , dots [ ck ] . i , dots [ ck ] . j ) if ( d2K < d2Ck ) image [ cell . i ] [ cell . j ] = k ; } } ) ; } else { children ( i , j , levl ) . forEach ( child => { let ck = pyr [ child . i ] [ child . j ] ; if ( ck == 0 ) pyr [ child . i ] [ child . j ] = k ; else { let d2K = d2 ( child . i , child . j , dots [ k ] . i , dots [ k ] . j ) ; let d2Ck = d2 ( child . i , child . j , dots [ ck ] . i , dots [ ck ] . j ) if ( d2K < d2Ck ) pyr [ child . i ] [ child . j ] = k ; } } ) ; } return 1 ; } else return 0 ; }
a visit, for second part of Voronoi after closest dot.
a visit for second part of Voronoi after closest dot .
//level 0 gets special treatment