export const Kernel = { Corners: [ [ 1, 1, -1], [ 1, -1, -1], [-1, 1, -1], [-1, -1, -1], [ 1, 1, 1], [ 1, -1, 1], [-1, 1, 1], [-1, -1, 1] ], Cardinal: [ [ 1, 0, 0], [ 0, 1, 0], [-1, 0, 0], [ 0, -1, 0], [ 0, 0, 1], [ 0, 0, -1] ], Loop(inList, inVector, inHandler) { for(let i=0; i { if(inValue) { let coords = Region.XYZ(inIndex); Kernel.Loop(Kernel.Corners, coords, (inX, inY, inZ)=> { let kernel = Region.I(inX, inY, inZ); if(!inRegion.voxels[kernel]) { console.log(coords, "surface"); surface.push(inIndex); return true; } }); } }); return surface; } };