commit 32c436f40a3dfcaefcd3384d03c383b6ebb9156e Author: TreetopFlyer Date: Mon Jul 5 20:51:08 2021 -0400 setup diff --git a/index.html b/index.html new file mode 100644 index 0000000..9d8c7f8 --- /dev/null +++ b/index.html @@ -0,0 +1,98 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/region.js b/region.js new file mode 100644 index 0000000..511da41 --- /dev/null +++ b/region.js @@ -0,0 +1,76 @@ +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 + { + let coords = Region.XYZ(inIndex); + Kernel.Loop(Kernel.Corners, coords, (inX, inY, inZ)=> + { + let index = Region.I(inX, inY, inZ); + if(inRegion.filled[index] === undefined) + { + console.log(inX, inY, inZ, "surface"); + surface.push(inIndex); + return true; + } + else + { + console.log(inX, inY, inZ, "filled"); + } + }); + }); + return surface; + } +};