From 32c436f40a3dfcaefcd3384d03c383b6ebb9156e Mon Sep 17 00:00:00 2001 From: TreetopFlyer Date: Mon, 5 Jul 2021 20:51:08 -0400 Subject: [PATCH] setup --- index.html | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ region.js | 76 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 174 insertions(+) create mode 100644 index.html create mode 100644 region.js 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; + } +};