diff --git a/1/index.html b/1/index.html index 890169b..0e88580 100644 --- a/1/index.html +++ b/1/index.html @@ -4,12 +4,13 @@ Generative Art - seigler.github.io - + - + + diff --git a/2/index.html b/2/index.html index 890169b..0e88580 100644 --- a/2/index.html +++ b/2/index.html @@ -4,12 +4,13 @@ Generative Art - seigler.github.io - + - + + diff --git a/3/index.html b/3/index.html index 890169b..0e88580 100644 --- a/3/index.html +++ b/3/index.html @@ -4,12 +4,13 @@ Generative Art - seigler.github.io - + - + + diff --git a/4/index.html b/4/index.html new file mode 100644 index 0000000..0e88580 --- /dev/null +++ b/4/index.html @@ -0,0 +1,16 @@ + + + + + + Generative Art - seigler.github.io + + + + + + + + + + diff --git a/app-c1dfc3c0.css b/app-20b67cee.css similarity index 57% rename from app-c1dfc3c0.css rename to app-20b67cee.css index f1219ec..687f670 100644 --- a/app-c1dfc3c0.css +++ b/app-20b67cee.css @@ -1 +1 @@ -*,:after,:before{box-sizing:inherit}body,html{height:100%;box-sizing:border-box}body{background-color:#000;margin:0;padding:0;display:flex;align-items:center;justify-content:center;color:#fff;font-family:sans-serif}main{text-align:left}a{color:inherit}a:focus,a:hover{color:#66f}code{display:inline-block;font-size:1.2em;line-height:1;padding:.5em .5em .2em;background-color:#222}footer{position:fixed;bottom:0;left:0;max-width:100vw;color:#fff;background-color:rgba(0,0,0,.8);padding:.5em 1em;border-top-right-radius:.5em} \ No newline at end of file +*,:after,:before{box-sizing:inherit}body,html{height:100%;box-sizing:border-box}body{background-color:#000;margin:0;padding:0;display:flex;align-items:center;justify-content:center;color:#fff;font-family:sans-serif}main{text-align:left}a{color:inherit}a:focus,a:hover{color:#66f}code{display:inline-block;font-size:1.2em;line-height:1;padding:.5em .5em .2em;background-color:#222}ul{list-style:none;padding-left:0}footer{position:fixed;bottom:0;left:0;max-width:100vw;color:#fff;background-color:rgba(0,0,0,.8);padding:.5em 1em;border-top-right-radius:.5em} \ No newline at end of file diff --git a/app-57543808.js b/app-57543808.js deleted file mode 100644 index 6fc9114..0000000 --- a/app-57543808.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";var e="undefined"==typeof global?self:global;if("function"!=typeof e.require){var r={},o={},a={},n={}.hasOwnProperty,t=/^\.\.?(\/|$)/,i=function(e,r){for(var o,a=[],n=(t.test(r)?e+"/"+r:r).split("/"),i=0,s=n.length;i1&&r("./sketches/"+e[e.length-2])})}),require.register("sketches/1.js",function(e,r,o){new p5(function(e){function r(){if(a)e.randomSeed(a);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random()),e.blendMode(e.BLEND),e.background("#000"),e.blendMode(e.ADD);for(var h=n*t/s,p=Math.sqrt(h),g=Math.max(1,Math.round(t/p))+1,b=Math.max(1,Math.round(n/p))+1,k=e.random(0,1e3*d),S=[],_=0;_.5){c.fill("#000");var q=e.random(2*Math.PI),B=e.random(.1,1.5)*P/2,C=B*e.random(-.7,.3);c.circle((i+(C+P)*Math.cos(q))/2,(i+(C+P)*Math.sin(q))/2,2*B)}do{var W=e.random(2*Math.PI),D=e.random(2*Math.PI);c.stroke(0),c.strokeWeight(1+P*Math.pow(e.random(.7368),3)),c.line(i*(Math.sin(W)+.5),i*(Math.cos(W)+.5),i*(Math.sin(D)+.5),i*(Math.cos(D)+.5))}while(e.random()<.5+.45*L);var R=e.random(0,2*Math.PI),z=e.random(p),T=n/(b-1)*E+z*Math.cos(R),H=t/(g-1)*U+z*Math.sin(R);e.image(c,T-i/2,H-i/2)}m.shader(v),v.setUniform("u_resolution",[n,t]),v.setUniform("u_alpha",.05),m.rect(0,0,n,t),e.blendMode(e.OVERLAY),e.image(m,0,0)}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}e.disableFriendlyErrors=!0;var a,n,t,i,s,d,l,h,c,u,f,m,M,w,v;e.preload=function(){M=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),w=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),v=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag")},e.setup=function(){d=2,l=2,s=70,window.onhashchange=function(){a=window.location.hash.substr(1),r()},a=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSB,100),n=e.windowWidth,t=e.windowHeight,h=e.createCanvas(n,t),i=1.75*(n+t)/Math.sqrt(s),c=e.createGraphics(i,i),u=e.createGraphics(i,i,e.WEBGL),f=e.createGraphics(i,i,e.WEBGL),m=e.createGraphics(n,t,e.WEBGL),c.noStroke(),u.noStroke(),f.noStroke(),m.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(a=null,r()):"s"==e.key&&e.saveCanvas("seigler-p5-1-gradient_burst-"+a+".jpg","jpg")},e.doubleClicked=function(){a=null,r()};var p;e.windowResized=function(){clearTimeout(p),p=setTimeout(function(){window.location.reload()},100)}})}),require.register("sketches/2.js",function(e,r,o){new p5(function(e){function r(){if(a)e.randomSeed(a);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random()),e.blendMode(e.BLEND),e.background("#000"),e.blendMode(e.ADD);for(var c=n*t/s,k=Math.sqrt(c),S=Math.max(1,Math.round(t/k))+1,_=Math.max(1,Math.round(n/k))+1,x=e.random(0,1e3*d),E=[],U=0;U.5){m.fill("#000");var q=e.random(2*Math.PI),B=e.random(.1,1.5)*G/2,C=B*e.random(-.7,.3);m.circle((i+(C+G)*Math.cos(q))/2,(i+(C+G)*Math.sin(q))/2,2*B)}for(var W=i/100,D=0;D.3?u:f,0,0,A,H),m.resetMatrix()}while(e.random()<.8);var O=e.random(0,2*Math.PI),Y=e.random(k),F=n/(_-1)*P+Y*Math.cos(O),Q=t/(S-1)*y+Y*Math.sin(O);e.image(m,F-i/2,Q-i/2)}v.shader(b),b.setUniform("u_resolution",[n,t]),b.setUniform("u_alpha",.05),v.rect(0,0,n,t),e.blendMode(e.OVERLAY),e.image(v,0,0)}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}e.disableFriendlyErrors=!1;var a,n,t,i,s,d,l,h,c,u,f,m,M,w,v,p,g,b;e.preload=function(){p=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),g=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),b=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag"),u=e.loadImage("palm-leaf-1.jpg"),f=e.loadImage("palm-leaf-2.jpg")},e.setup=function(){d=2,l=6,h=2,s=80,c="seigler-p5-2-gradient_jungle",window.onhashchange=function(){a=window.location.hash.substr(1),r()},a=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSB,100),n=e.windowWidth,t=e.windowHeight,e.createCanvas(n,t),i=2*(n+t)/Math.sqrt(s),m=e.createGraphics(i,i),M=e.createGraphics(i,i,e.WEBGL),w=e.createGraphics(i,i,e.WEBGL),v=e.createGraphics(n,t,e.WEBGL),m.noStroke(),M.noStroke(),w.noStroke(),v.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(a=null,r()):"s"==e.key&&e.saveCanvas(c+a+".jpg","jpg")},e.doubleClicked=function(){a=null,r()};var k;e.windowResized=function(){clearTimeout(k),k=setTimeout(function(){window.location.reload()},100)}})}),require.register("sketches/3.js",function(e,r,o){new p5(function(e){function r(){if(n)e.randomSeed(n);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random(0,1e9)),e.blendMode(e.BLEND),e.background(291/360,.3,.25);var h=e.random(0,Math.PI),c=Math.min(t,i)/e.random(10,80),u=Math.max(t,i)*Math.SQRT2,f=Math.ceil(Math.SQRT2*u/c),m=t/2,M=i/2,w=Math.cos(h)*u/2,v=Math.sin(h)*u/2;e.strokeCap(e.SQUARE);for(var p=Math.ceil(f/2);p>0;p--)e.stroke(291/360,.3,.2+.1*(p%2)),e.strokeWeight((2*p-1)*c),e.line(m-w,M-v,m+w,M+v);d.shader(l),l.setUniform("u_resolution",[t,i]),l.setUniform("u_alpha",.05),d.rect(0,0,t,i),e.blendMode(e.OVERLAY),e.image(d,0,0),e.blendMode(e.BLEND),e.strokeCap(e.ROUND);for(var g=5,b=Math.max(1,Math.round(i/g))+1,k=Math.max(1,Math.round(t/g))+1,S=1000.37,_=[],x=function(r){var o=r%k,a=Math.floor(r/k),n=s.map(function(r,n){var t=r/Math.min(b,k);return e.noise(S*n+a*t,S*n+o*t)});_.push({row:a,col:o,noise:n})},E=0;E1.75*l-.5)){var f=t/(k-1)*s-g/2,m=i/(b-1)*n-g/2,M=2*Math.PI*a(c)+U,w=(8*u*u+1)*g;e.stroke(.075,.5,h-.2*(o/_.length)+.1),e.strokeWeight(g*(1+2*u*u*u)),e.line(f-w*Math.cos(M),m-w*Math.sin(M),f+w*Math.cos(M),m+w*Math.sin(M))}})}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}function a(e){return 23.8615*Math.pow(e,5)-59.6041*Math.pow(e,4)+47.2472*Math.pow(e,3)-11.3053*Math.pow(e,2)+.806219*e-.00259101}e.disableFriendlyErrors=!1;var n,t,i,s,d,l;e.preload=function(){l=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag")},e.setup=function(){filenamePrefix="seigler-p5-3-peanut_butter_and_jelly",t=e.windowWidth,i=e.windowHeight,s=[2,2,2,2],window.onhashchange=function(){n=window.location.hash.substr(1),r()},n=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSL,1),e.createCanvas(t,i),d=e.createGraphics(t,i,e.WEBGL),d.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(n=null,r()):"s"==e.key&&e.saveCanvas(filenamePrefix+n+".jpg","jpg")},e.doubleClicked=function(){n=null,r()};var h;e.windowResized=function(){clearTimeout(h),h=setTimeout(function(){window.location.reload()},100)}})}),require.register("___globals___",function(e,r,o){})}(),require("___globals___"),require("initialize"); \ No newline at end of file diff --git a/app-6597a989.js b/app-6597a989.js new file mode 100644 index 0000000..0069e6e --- /dev/null +++ b/app-6597a989.js @@ -0,0 +1 @@ +!function(){"use strict";var e="undefined"==typeof global?self:global;if("function"!=typeof e.require){var r={},o={},a={},n={}.hasOwnProperty,t=/^\.\.?(\/|$)/,i=function(e,r){for(var o,a=[],n=(t.test(r)?e+"/"+r:r).split("/"),i=0,s=n.length;i1&&r("./sketches/"+e[e.length-2])})}),require.register("sketches/1.js",function(e,r,o){new p5(function(e){function r(){if(a)e.randomSeed(a);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random()),e.blendMode(e.BLEND),e.background("#000"),e.blendMode(e.ADD);for(var h=n*t/s,v=Math.sqrt(h),b=Math.max(1,Math.round(t/v))+1,g=Math.max(1,Math.round(n/v))+1,S=e.random(0,1e3*l),k=[],x=0;x.5){c.fill("#000");var W=e.random(2*Math.PI),I=e.random(.1,1.5)*_/2,C=I*e.random(-.7,.3);c.circle((i+(C+_)*Math.cos(W))/2,(i+(C+_)*Math.sin(W))/2,2*I)}do{var H=e.random(2*Math.PI),R=e.random(2*Math.PI);c.stroke(0),c.strokeWeight(1+_*Math.pow(e.random(.7368),3)),c.line(i*(Math.sin(H)+.5),i*(Math.cos(H)+.5),i*(Math.sin(R)+.5),i*(Math.cos(R)+.5))}while(e.random()<.5+.45*L);var q=e.random(0,2*Math.PI),D=e.random(v),T=n/(g-1)*U+D*Math.cos(q),N=t/(b-1)*y+D*Math.sin(q);e.image(c,T-i/2,N-i/2)}m.shader(w),w.setUniform("u_resolution",[n,t]),w.setUniform("u_alpha",.05),m.rect(0,0,n,t),e.blendMode(e.OVERLAY),e.image(m,0,0)}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}e.disableFriendlyErrors=!0;var a,n,t,i,s,l,d,h,c,u,f,m,M,p,w;e.preload=function(){M=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),p=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),w=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag")},e.setup=function(){l=2,d=2,s=70,window.onhashchange=function(){a=window.location.hash.substr(1),r()},a=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSB,100),n=e.windowWidth,t=e.windowHeight,h=e.createCanvas(n,t),i=1.75*(n+t)/Math.sqrt(s),c=e.createGraphics(i,i),u=e.createGraphics(i,i,e.WEBGL),f=e.createGraphics(i,i,e.WEBGL),m=e.createGraphics(n,t,e.WEBGL),c.noStroke(),u.noStroke(),f.noStroke(),m.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(a=null,r()):"s"==e.key&&e.saveCanvas("seigler-p5-1-gradient_burst-"+a+".jpg","jpg")},e.doubleClicked=function(){a=null,r()};var v;e.windowResized=function(){clearTimeout(v),v=setTimeout(function(){window.location.reload()},100)}})}),require.register("sketches/2.js",function(e,r,o){new p5(function(e){function r(){if(a)e.randomSeed(a);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random()),e.blendMode(e.BLEND),e.background("#000"),e.blendMode(e.ADD);for(var c=n*t/s,S=Math.sqrt(c),k=Math.max(1,Math.round(t/S))+1,x=Math.max(1,Math.round(n/S))+1,E=e.random(0,1e3*l),U=[],y=0;y.5){m.fill("#000");var W=e.random(2*Math.PI),I=e.random(.1,1.5)*B/2,C=I*e.random(-.7,.3);m.circle((i+(C+B)*Math.cos(W))/2,(i+(C+B)*Math.sin(W))/2,2*I)}for(var H=i/100,R=0;R.3?u:f,0,0,z,N),m.resetMatrix()}while(e.random()<.8);var A=e.random(0,2*Math.PI),O=e.random(S),Q=n/(x-1)*_+O*Math.cos(A),Y=t/(k-1)*G+O*Math.sin(A);e.image(m,Q-i/2,Y-i/2)}w.shader(g),g.setUniform("u_resolution",[n,t]),g.setUniform("u_alpha",.05),w.rect(0,0,n,t),e.blendMode(e.OVERLAY),e.image(w,0,0)}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}e.disableFriendlyErrors=!0;var a,n,t,i,s,l,d,h,c,u,f,m,M,p,w,v,b,g;e.preload=function(){v=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),b=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),g=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag"),u=e.loadImage("palm-leaf-1.jpg"),f=e.loadImage("palm-leaf-2.jpg")},e.setup=function(){l=2,d=6,h=2,s=80,c="seigler-p5-2-gradient_jungle",window.onhashchange=function(){a=window.location.hash.substr(1),r()},a=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSB,100),n=e.windowWidth,t=e.windowHeight,e.createCanvas(n,t),i=2*(n+t)/Math.sqrt(s),m=e.createGraphics(i,i),M=e.createGraphics(i,i,e.WEBGL),p=e.createGraphics(i,i,e.WEBGL),w=e.createGraphics(n,t,e.WEBGL),m.noStroke(),M.noStroke(),p.noStroke(),w.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(a=null,r()):"s"==e.key&&e.saveCanvas(c+a+".jpg","jpg")},e.doubleClicked=function(){a=null,r()};var S;e.windowResized=function(){clearTimeout(S),S=setTimeout(function(){window.location.reload()},100)}})}),require.register("sketches/3.js",function(e,r,o){new p5(function(e){function r(){if(n)e.randomSeed(n);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random(0,1e9)),e.blendMode(e.BLEND),e.background(291/360,.3,.25);var h=e.random(0,Math.PI),c=Math.min(t,i)/e.random(10,80),u=Math.max(t,i)*Math.SQRT2,f=Math.ceil(Math.SQRT2*u/c),m=t/2,M=i/2,p=Math.cos(h)*u/2,w=Math.sin(h)*u/2;e.strokeCap(e.SQUARE);for(var v=Math.ceil(f/2);v>0;v--)e.stroke(291/360,.3,.2+.1*(v%2)),e.strokeWeight((2*v-1)*c),e.line(m-p,M-w,m+p,M+w);l.shader(d),d.setUniform("u_resolution",[t,i]),d.setUniform("u_alpha",.05),l.rect(0,0,t,i),e.blendMode(e.OVERLAY),e.image(l,0,0),e.blendMode(e.BLEND),e.strokeCap(e.ROUND);for(var b=5,g=Math.max(1,Math.round(i/b))+1,S=Math.max(1,Math.round(t/b))+1,k=1000.37,x=[],E=function(r){var o=r%S,a=Math.floor(r/S),n=s.map(function(r,n){var t=r/Math.min(g,S);return e.noise(k*n+a*t,k*n+o*t)});x.push({row:a,col:o,noise:n})},U=0;U1.75*d-.5)){var f=t/(S-1)*s-b/2,m=i/(g-1)*n-b/2,M=2*Math.PI*a(c)+y,p=(8*u*u+1)*b;e.stroke(.075,.5,h-.2*(o/x.length)+.1),e.strokeWeight(b*(1+2*u*u*u)),e.line(f-p*Math.cos(M),m-p*Math.sin(M),f+p*Math.cos(M),m+p*Math.sin(M))}})}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}function a(e){return 23.8615*Math.pow(e,5)-59.6041*Math.pow(e,4)+47.2472*Math.pow(e,3)-11.3053*Math.pow(e,2)+.806219*e-.00259101}e.disableFriendlyErrors=!0;var n,t,i,s,l,d;e.preload=function(){d=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag")},e.setup=function(){filenamePrefix="seigler-p5-3-peanut_butter_and_jelly",t=e.windowWidth,i=e.windowHeight,s=[2,2,2,2],window.onhashchange=function(){n=window.location.hash.substr(1),r()},n=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSL,1),e.createCanvas(t,i),l=e.createGraphics(t,i,e.WEBGL),l.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(n=null,r()):"s"==e.key&&e.saveCanvas(filenamePrefix+n+".jpg","jpg")},e.doubleClicked=function(){n=null,r()};var h;e.windowResized=function(){clearTimeout(h),h=setTimeout(function(){window.location.reload()},100)}})}),require.register("sketches/4.js",function(e,r,o){new p5(function(e){function r(){if(a)e.randomSeed(a);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random(0,1e9)),e.blendMode(e.BLEND);var u=e.random(0,Math.PI),f=Math.min(n,t)/e.random(10,80),m=Math.max(n,t)*Math.SQRT2,M=Math.ceil(Math.SQRT2*m/f),p=e.random(),w=n/2,v=t/2,b=Math.cos(u)*m/2,g=Math.sin(u)*m/2;d.buffer.strokeCap(e.SQUARE);for(var S=Math.ceil(M/2);S>0;S--)d.buffer.stroke(p,.5,.2+.1*(S%2)),d.buffer.strokeWeight((2*S-1)*f),d.buffer.line(w-b,v-g,w+b,v+g);e.blendMode(e.BLEND);for(var k=Math.min(n,t)/Math.round(e.random(3,10)),x=Math.max(1,Math.round(t/k/Math.sin(Math.PI/3)))+1,E=Math.max(1,Math.round(n/k))+1,U=200*k+Math.SQRT2,y=[],L=function(r){var o=r%E,a=Math.floor(r/E),n=i.map(function(r,n){return e.noise(U*(n+1)+(a-x/2)*r,U*(n+1)+(o-E/2)*r)});y.push({row:a,col:o,noise:n})},_=0;_=3){d.cells.fill(r.site.noise[2]),d.cells.beginShape();for(var o=0;o Generative Art - seigler.github.io - +

P5.js generative art

-
    -
  1. gradient burst
  2. -
  3. gradient jungle
  4. -
  5. peanut butter and jelly
  6. -
+
diff --git a/modules/rhill-voronoi-core.min.js b/modules/rhill-voronoi-core.min.js new file mode 100644 index 0000000..21ada46 --- /dev/null +++ b/modules/rhill-voronoi-core.min.js @@ -0,0 +1,120 @@ +/*! +Copyright (C) 2010-2013 Raymond Hill: https://github.com/gorhill/Javascript-Voronoi +MIT License: See https://github.com/gorhill/Javascript-Voronoi/LICENSE.md +*/ +; +function Voronoi(){this.vertices=null;this.edges=null;this.cells=null;this.toRecycle=null;this.beachsectionJunkyard=[];this.circleEventJunkyard=[]; +this.vertexJunkyard=[];this.edgeJunkyard=[];this.cellJunkyard=[]}Voronoi.prototype.reset=function(){if(!this.beachline){this.beachline=new this.RBTree() +}if(this.beachline.root){var a=this.beachline.getFirst(this.beachline.root);while(a){this.beachsectionJunkyard.push(a);a=a.rbNext +}}this.beachline.root=null;if(!this.circleEvents){this.circleEvents=new this.RBTree()}this.circleEvents.root=this.firstCircleEvent=null; +this.vertices=[];this.edges=[];this.cells=[]};Voronoi.prototype.sqrt=Math.sqrt;Voronoi.prototype.abs=Math.abs;Voronoi.prototype.ε=Voronoi.ε=1e-9; +Voronoi.prototype.invε=Voronoi.invε=1/Voronoi.ε;Voronoi.prototype.equalWithEpsilon=function(d,c){return this.abs(d-c)<1e-9 +};Voronoi.prototype.greaterThanWithEpsilon=function(d,c){return d-c>1e-9};Voronoi.prototype.greaterThanOrEqualWithEpsilon=function(d,c){return c-d<1e-9 +};Voronoi.prototype.lessThanWithEpsilon=function(d,c){return c-d>1e-9};Voronoi.prototype.lessThanOrEqualWithEpsilon=function(d,c){return d-c<1e-9 +};Voronoi.prototype.RBTree=function(){this.root=null};Voronoi.prototype.RBTree.prototype.rbInsertSuccessor=function(e,a){var d; +if(e){a.rbPrevious=e;a.rbNext=e.rbNext;if(e.rbNext){e.rbNext.rbPrevious=a}e.rbNext=a;if(e.rbRight){e=e.rbRight;while(e.rbLeft){e=e.rbLeft +}e.rbLeft=a}else{e.rbRight=a}d=e}else{if(this.root){e=this.getFirst(this.root);a.rbPrevious=null;a.rbNext=e;e.rbPrevious=a; +e.rbLeft=a;d=e}else{a.rbPrevious=a.rbNext=null;this.root=a;d=null}}a.rbLeft=a.rbRight=null;a.rbParent=d;a.rbRed=true;var c,b; +e=a;while(d&&d.rbRed){c=d.rbParent;if(d===c.rbLeft){b=c.rbRight;if(b&&b.rbRed){d.rbRed=b.rbRed=false;c.rbRed=true;e=c}else{if(e===d.rbRight){this.rbRotateLeft(d); +e=d;d=e.rbParent}d.rbRed=false;c.rbRed=true;this.rbRotateRight(c)}}else{b=c.rbLeft;if(b&&b.rbRed){d.rbRed=b.rbRed=false;c.rbRed=true; +e=c}else{if(e===d.rbLeft){this.rbRotateRight(d);e=d;d=e.rbParent}d.rbRed=false;c.rbRed=true;this.rbRotateLeft(c)}}d=e.rbParent +}this.root.rbRed=false};Voronoi.prototype.RBTree.prototype.rbRemoveNode=function(f){if(f.rbNext){f.rbNext.rbPrevious=f.rbPrevious +}if(f.rbPrevious){f.rbPrevious.rbNext=f.rbNext}f.rbNext=f.rbPrevious=null;var e=f.rbParent,g=f.rbLeft,b=f.rbRight,d;if(!g){d=b +}else{if(!b){d=g}else{d=this.getFirst(b)}}if(e){if(e.rbLeft===f){e.rbLeft=d}else{e.rbRight=d}}else{this.root=d}var a;if(g&&b){a=d.rbRed; +d.rbRed=f.rbRed;d.rbLeft=g;g.rbParent=d;if(d!==b){e=d.rbParent;d.rbParent=f.rbParent;f=d.rbRight;e.rbLeft=f;d.rbRight=b;b.rbParent=d +}else{d.rbParent=e;e=d;f=d.rbRight}}else{a=f.rbRed;f=d}if(f){f.rbParent=e}if(a){return}if(f&&f.rbRed){f.rbRed=false;return +}var c;do{if(f===this.root){break}if(f===e.rbLeft){c=e.rbRight;if(c.rbRed){c.rbRed=false;e.rbRed=true;this.rbRotateLeft(e); +c=e.rbRight}if((c.rbLeft&&c.rbLeft.rbRed)||(c.rbRight&&c.rbRight.rbRed)){if(!c.rbRight||!c.rbRight.rbRed){c.rbLeft.rbRed=false; +c.rbRed=true;this.rbRotateRight(c);c=e.rbRight}c.rbRed=e.rbRed;e.rbRed=c.rbRight.rbRed=false;this.rbRotateLeft(e);f=this.root; +break}}else{c=e.rbLeft;if(c.rbRed){c.rbRed=false;e.rbRed=true;this.rbRotateRight(e);c=e.rbLeft}if((c.rbLeft&&c.rbLeft.rbRed)||(c.rbRight&&c.rbRight.rbRed)){if(!c.rbLeft||!c.rbLeft.rbRed){c.rbRight.rbRed=false; +c.rbRed=true;this.rbRotateLeft(c);c=e.rbLeft}c.rbRed=e.rbRed;e.rbRed=c.rbLeft.rbRed=false;this.rbRotateRight(e);f=this.root; +break}}c.rbRed=true;f=e;e=e.rbParent}while(!f.rbRed);if(f){f.rbRed=false}};Voronoi.prototype.RBTree.prototype.rbRotateLeft=function(b){var d=b,c=b.rbRight,a=d.rbParent; +if(a){if(a.rbLeft===d){a.rbLeft=c}else{a.rbRight=c}}else{this.root=c}c.rbParent=a;d.rbParent=c;d.rbRight=c.rbLeft;if(d.rbRight){d.rbRight.rbParent=d +}c.rbLeft=d};Voronoi.prototype.RBTree.prototype.rbRotateRight=function(b){var d=b,c=b.rbLeft,a=d.rbParent;if(a){if(a.rbLeft===d){a.rbLeft=c +}else{a.rbRight=c}}else{this.root=c}c.rbParent=a;d.rbParent=c;d.rbLeft=c.rbRight;if(d.rbLeft){d.rbLeft.rbParent=d}c.rbRight=d +};Voronoi.prototype.RBTree.prototype.getFirst=function(a){while(a.rbLeft){a=a.rbLeft}return a};Voronoi.prototype.RBTree.prototype.getLast=function(a){while(a.rbRight){a=a.rbRight +}return a};Voronoi.prototype.Diagram=function(a){this.site=a};Voronoi.prototype.Cell=function(a){this.site=a;this.halfedges=[]; +this.closeMe=false};Voronoi.prototype.Cell.prototype.init=function(a){this.site=a;this.halfedges=[];this.closeMe=false;return this +};Voronoi.prototype.createCell=function(b){var a=this.cellJunkyard.pop();if(a){return a.init(b)}return new this.Cell(b)}; +Voronoi.prototype.Cell.prototype.prepareHalfedges=function(){var a=this.halfedges,b=a.length,c;while(b--){c=a[b].edge;if(!c.vb||!c.va){a.splice(b,1) +}}a.sort(function(e,d){return d.angle-e.angle});return a.length};Voronoi.prototype.Cell.prototype.getNeighborIds=function(){var a=[],b=this.halfedges.length,c; +while(b--){c=this.halfedges[b].edge;if(c.lSite!==null&&c.lSite.voronoiId!=this.site.voronoiId){a.push(c.lSite.voronoiId)}else{if(c.rSite!==null&&c.rSite.voronoiId!=this.site.voronoiId){a.push(c.rSite.voronoiId) +}}}return a};Voronoi.prototype.Cell.prototype.getBbox=function(){var i=this.halfedges,d=i.length,a=Infinity,g=Infinity,c=-Infinity,b=-Infinity,h,f,e; +while(d--){h=i[d].getStartpoint();f=h.x;e=h.y;if(fc){c=f}if(e>b){b=e}}return{x:a,y:g,width:c-a,height:b-g} +};Voronoi.prototype.Cell.prototype.pointIntersection=function(a,h){var b=this.halfedges,c=b.length,f,g,e,d;while(c--){f=b[c]; +g=f.getStartpoint();e=f.getEndpoint();d=(h-g.y)*(e.x-g.x)-(a-g.x)*(e.y-g.y);if(!d){return 0}if(d>0){return -1}}return 1}; +Voronoi.prototype.Vertex=function(a,b){this.x=a;this.y=b};Voronoi.prototype.Edge=function(b,a){this.lSite=b;this.rSite=a; +this.va=this.vb=null};Voronoi.prototype.Halfedge=function(d,e,a){this.site=e;this.edge=d;if(a){this.angle=Math.atan2(a.y-e.y,a.x-e.x) +}else{var c=d.va,b=d.vb;this.angle=d.lSite===e?Math.atan2(b.x-c.x,c.y-b.y):Math.atan2(c.x-b.x,b.y-c.y)}};Voronoi.prototype.createHalfedge=function(b,c,a){return new this.Halfedge(b,c,a) +};Voronoi.prototype.Halfedge.prototype.getStartpoint=function(){return this.edge.lSite===this.site?this.edge.va:this.edge.vb +};Voronoi.prototype.Halfedge.prototype.getEndpoint=function(){return this.edge.lSite===this.site?this.edge.vb:this.edge.va +};Voronoi.prototype.createVertex=function(a,c){var b=this.vertexJunkyard.pop();if(!b){b=new this.Vertex(a,c)}else{b.x=a;b.y=c +}this.vertices.push(b);return b};Voronoi.prototype.createEdge=function(e,a,d,b){var c=this.edgeJunkyard.pop();if(!c){c=new this.Edge(e,a) +}else{c.lSite=e;c.rSite=a;c.va=c.vb=null}this.edges.push(c);if(d){this.setEdgeStartpoint(c,e,a,d)}if(b){this.setEdgeEndpoint(c,e,a,b) +}this.cells[e.voronoiId].halfedges.push(this.createHalfedge(c,e,a));this.cells[a.voronoiId].halfedges.push(this.createHalfedge(c,a,e)); +return c};Voronoi.prototype.createBorderEdge=function(d,c,a){var b=this.edgeJunkyard.pop();if(!b){b=new this.Edge(d,null) +}else{b.lSite=d;b.rSite=null}b.va=c;b.vb=a;this.edges.push(b);return b};Voronoi.prototype.setEdgeStartpoint=function(b,d,a,c){if(!b.va&&!b.vb){b.va=c; +b.lSite=d;b.rSite=a}else{if(b.lSite===a){b.vb=c}else{b.va=c}}};Voronoi.prototype.setEdgeEndpoint=function(b,d,a,c){this.setEdgeStartpoint(b,a,d,c) +};Voronoi.prototype.Beachsection=function(){};Voronoi.prototype.createBeachsection=function(a){var b=this.beachsectionJunkyard.pop(); +if(!b){b=new this.Beachsection()}b.site=a;return b};Voronoi.prototype.leftBreakPoint=function(e,f){var a=e.site,m=a.x,l=a.y,k=l-f; +if(!k){return m}var n=e.rbPrevious;if(!n){return -Infinity}a=n.site;var h=a.x,g=a.y,d=g-f;if(!d){return h}var c=h-m,j=1/k-1/d,i=c/d; +if(j){return(-i+this.sqrt(i*i-2*j*(c*c/(-2*d)-g+d/2+l-k/2)))/j+m}return(m+h)/2};Voronoi.prototype.rightBreakPoint=function(b,c){var d=b.rbNext; +if(d){return this.leftBreakPoint(d,c)}var a=b.site;return a.y===c?a.x:Infinity};Voronoi.prototype.detachBeachsection=function(a){this.detachCircleEvent(a); +this.beachline.rbRemoveNode(a);this.beachsectionJunkyard.push(a)};Voronoi.prototype.removeBeachsection=function(b){var a=b.circleEvent,j=a.x,h=a.ycenter,e=this.createVertex(j,h),f=b.rbPrevious,d=b.rbNext,l=[b],g=Math.abs; +this.detachBeachsection(b);var m=f;while(m.circleEvent&&g(j-m.circleEvent.x)<1e-9&&g(h-m.circleEvent.ycenter)<1e-9){f=m.rbPrevious; +l.unshift(m);this.detachBeachsection(m);m=f}l.unshift(m);this.detachCircleEvent(m);var c=d;while(c.circleEvent&&g(j-c.circleEvent.x)<1e-9&&g(h-c.circleEvent.ycenter)<1e-9){d=c.rbNext; +l.push(c);this.detachBeachsection(c);c=d}l.push(c);this.detachCircleEvent(c);var k=l.length,i;for(i=1;i1e-9){o=o.rbLeft}else{q=j-this.rightBreakPoint(o,n);if(q>1e-9){if(!o.rbRight){p=o; +break}o=o.rbRight}else{if(v>-1e-9){p=o.rbPrevious;m=o}else{if(q>-1e-9){p=o;m=o.rbNext}else{p=m=o}}break}}}var e=this.createBeachsection(l); +this.beachline.rbInsertSuccessor(p,e);if(!p&&!m){return}if(p===m){this.detachCircleEvent(p);m=this.createBeachsection(p.site); +this.beachline.rbInsertSuccessor(e,m);e.edge=m.edge=this.createEdge(p.site,e.site);this.attachCircleEvent(p);this.attachCircleEvent(m); +return}if(p&&!m){e.edge=this.createEdge(p.site,e.site);return}if(p!==m){this.detachCircleEvent(p);this.detachCircleEvent(m); +var h=p.site,k=h.x,i=h.y,t=l.x-k,r=l.y-i,a=m.site,c=a.x-k,b=a.y-i,u=2*(t*b-r*c),g=t*t+r*r,f=c*c+b*b,s=this.createVertex((b*g-r*f)/u+k,(t*f-c*g)/u+i); +this.setEdgeStartpoint(m.edge,h,a,s);e.edge=this.createEdge(h,l,undefined,s);m.edge=this.createEdge(l,a,undefined,s);this.attachCircleEvent(p); +this.attachCircleEvent(m);return}};Voronoi.prototype.CircleEvent=function(){this.arc=null;this.rbLeft=null;this.rbNext=null; +this.rbParent=null;this.rbPrevious=null;this.rbRed=false;this.rbRight=null;this.site=null;this.x=this.y=this.ycenter=0};Voronoi.prototype.attachCircleEvent=function(i){var r=i.rbPrevious,o=i.rbNext; +if(!r||!o){return}var k=r.site,u=i.site,c=o.site;if(k===c){return}var t=u.x,s=u.y,n=k.x-t,l=k.y-s,f=c.x-t,e=c.y-s;var v=2*(n*e-l*f); +if(v>=-2e-12){return}var h=n*n+l*l,g=f*f+e*e,m=(e*h-l*g)/v,j=(n*g-f*h)/v,b=j+s;var q=this.circleEventJunkyard.pop();if(!q){q=new this.CircleEvent() +}q.arc=i;q.site=u;q.x=m+t;q.y=b+this.sqrt(m*m+j*j);q.ycenter=b;i.circleEvent=q;var a=null,p=this.circleEvents.root;while(p){if(q.y=n){return false +}if(i>k){if(!c||c.y=d){return false}}b=this.createVertex(g,d)}else{if(!c||c.y>d){c=this.createVertex(g,d) +}else{if(c.y1){if(i>k){if(!c||c.y=d){return false}}b=this.createVertex((d-q)/m,d)}else{if(!c||c.y>d){c=this.createVertex((d-q)/m,d)}else{if(c.y=n){return false}}b=this.createVertex(n,m*n+q) +}else{if(!c||c.x>n){c=this.createVertex(n,m*n+q)}else{if(c.x0){if(a>e){return false}if(a>f){f=a +}}}c=i.xr-b;if(k===0&&c<0){return false}a=c/k;if(k<0){if(a>e){return false}if(a>f){f=a}}else{if(k>0){if(a0){if(a>e){return false +}if(a>f){f=a}}}c=i.yb-l;if(j===0&&c<0){return false}a=c/j;if(j<0){if(a>e){return false}if(a>f){f=a}}else{if(j>0){if(a0){d.va=this.createVertex(b+f*k,l+f*j)}if(e<1){d.vb=this.createVertex(b+e*k,l+e*j)}if(f>0||e<1){this.cells[d.lSite.voronoiId].closeMe=true; +this.cells[d.rSite.voronoiId].closeMe=true}return true};Voronoi.prototype.clipEdges=function(e){var a=this.edges,d=a.length,c,b=Math.abs; +while(d--){c=a[d];if(!this.connectEdge(c,e)||!this.clipEdge(c,e)||(b(c.va.x-c.vb.x)<1e-9&&b(c.va.y-c.vb.y)<1e-9)){c.va=c.vb=null; +a.splice(d,1)}}};Voronoi.prototype.closeCells=function(p){var g=p.xl,d=p.xr,m=p.yt,j=p.yb,q=this.cells,a=q.length,n,e,o,c,b,l,k,i,f,h=Math.abs; +while(a--){n=q[a];if(!n.prepareHalfedges()){continue}if(!n.closeMe){continue}o=n.halfedges;c=o.length;e=0;while(e=1e-9||h(l.y-i.y)>=1e-9){switch(true){case this.equalWithEpsilon(l.x,g)&&this.lessThanWithEpsilon(l.y,j):f=this.equalWithEpsilon(i.x,g); +k=this.createVertex(g,f?i.y:j);b=this.createBorderEdge(n.site,l,k);e++;o.splice(e,0,this.createHalfedge(b,n.site,null));c++; +if(f){break}l=k;case this.equalWithEpsilon(l.y,j)&&this.lessThanWithEpsilon(l.x,d):f=this.equalWithEpsilon(i.y,j);k=this.createVertex(f?i.x:d,j); +b=this.createBorderEdge(n.site,l,k);e++;o.splice(e,0,this.createHalfedge(b,n.site,null));c++;if(f){break}l=k;case this.equalWithEpsilon(l.x,d)&&this.greaterThanWithEpsilon(l.y,m):f=this.equalWithEpsilon(i.x,d); +k=this.createVertex(d,f?i.y:m);b=this.createBorderEdge(n.site,l,k);e++;o.splice(e,0,this.createHalfedge(b,n.site,null));c++; +if(f){break}l=k;case this.equalWithEpsilon(l.y,m)&&this.greaterThanWithEpsilon(l.x,g):f=this.equalWithEpsilon(i.y,m);k=this.createVertex(f?i.x:g,m); +b=this.createBorderEdge(n.site,l,k);e++;o.splice(e,0,this.createHalfedge(b,n.site,null));c++;if(f){break}l=k;f=this.equalWithEpsilon(i.x,g); +k=this.createVertex(g,f?i.y:j);b=this.createBorderEdge(n.site,l,k);e++;o.splice(e,0,this.createHalfedge(b,n.site,null));c++; +if(f){break}l=k;f=this.equalWithEpsilon(i.y,j);k=this.createVertex(f?i.x:d,j);b=this.createBorderEdge(n.site,l,k);e++;o.splice(e,0,this.createHalfedge(b,n.site,null)); +c++;if(f){break}l=k;f=this.equalWithEpsilon(i.x,d);k=this.createVertex(d,f?i.y:m);b=this.createBorderEdge(n.site,l,k);e++; +o.splice(e,0,this.createHalfedge(b,n.site,null));c++;if(f){break}default:throw"Voronoi.closeCells() > this makes no sense!" +}}e++}n.closeMe=false}};Voronoi.prototype.quantizeSites=function(c){var b=this.ε,d=c.length,a;while(d--){a=c[d];a.x=Math.floor(a.x/b)*b; +a.y=Math.floor(a.y/b)*b}};Voronoi.prototype.recycle=function(a){if(a){if(a instanceof this.Diagram){this.toRecycle=a}else{throw"Voronoi.recycleDiagram() > Need a Diagram object." +}}};Voronoi.prototype.compute=function(i,j){var d=new Date();this.reset();if(this.toRecycle){this.vertexJunkyard=this.vertexJunkyard.concat(this.toRecycle.vertices); +this.edgeJunkyard=this.edgeJunkyard.concat(this.toRecycle.edges);this.cellJunkyard=this.cellJunkyard.concat(this.toRecycle.cells); +this.toRecycle=null}var h=i.slice(0);h.sort(function(n,m){var o=m.y-n.y;if(o){return o}return m.x-n.x});var b=h.pop(),l=0,f,e,k=this.cells,a; +for(;;){a=this.firstCircleEvent;if(b&&(!a||b.y