diff --git a/p5.brush.js b/p5.brush.js index 81dab64..9c39748 100644 --- a/p5.brush.js +++ b/p5.brush.js @@ -105,15 +105,13 @@ if (_isReady) _remove(false) // Set the renderer to the specified canvas or to the window if no ID is given _r = (!canvasID) ? window.self : canvasID; - // Load flowfield system if (!_isReady) { _isReady = true; - FF.create(); + FF.create(); // Load flowfield system + globalScale(_r.width / 250) // Adjust standard brushes to match canvas } - // Load realistic color blending - Mix.load(instanced); - // Adjust standard brushes to match canvas size - globalScale(_r.width / 250) // Adjust standard brushes to match canvas + // Load color blending + Mix.load(instanced); } /** @@ -122,8 +120,11 @@ function _remove (a = true) { if (_isReady) { Mix.mask.remove() + Mix.mask = null; Mix.mask2.remove() + Mix.mask2 = null; Mix.noBlend.remove() + Mix.noBlend = null; if (a) brush.load() } } @@ -204,6 +205,19 @@ return Math.floor(this.random(e,r)) }, + /** + * Generates a random gaussian. + * @param {number} mean - Mean. + * @param {number} stdev - Standard deviation. + * @returns {number} A random number following a normal distribution. + */ + gaussian(mean = 0, stdev = 1) { + const u = 1 - R.random(); + const v = R.random(); + const z = Math.sqrt( -2.0 * Math.log( u ) ) * Math.cos( 2.0 * Math.PI * v ); + return z * stdev + mean; + }, + /** * Generates a random value based on weighted probabilities. * @param {Object} weights - An object containing values as keys and their probabilities as values. @@ -562,7 +576,6 @@ */ reDraw() { _r.push(); - // Copy info from noBlend buffer _r.translate(-Matrix.trans()[0],-Matrix.trans()[1]) _r.image(Mix.noBlend, -_r.width/2, -_r.height/2) Mix.noBlend.clear() @@ -608,14 +621,9 @@ this.currentColor = this.getPigment(_color); if (webgl_mask) this.blending1 = true, this.color1 = this.currentColor; else this.blending2 = true, this.color2 = this.currentColor; - } - else { - _r.push(); - _r.translate(-Matrix.trans()[0],-Matrix.trans()[1]) - _r.image(this.noBlend,-_r.width/2, -_r.height/2) - this.noBlend.clear() - _r.pop(); - return; + } else if (_isLast) { + if (!webgl_mask) this.reDraw() + return } } @@ -625,32 +633,35 @@ let newColor = !_color ? this.currentColor : this.getPigment(_color); if (newColor.toString() !== this.currentColor.toString() || _isLast || !this.isCaching) { - _r.push(); - // Copy info from noBlend buffer - _r.translate(-Matrix.trans()[0],-Matrix.trans()[1]) - _r.image(this.noBlend,-_r.width/2, -_r.height/2) - this.noBlend.clear() - // Use the blend shader for rendering - _r.shader(this.shader); - // Set shader uniforms - // Color to blend - this.shader.setUniform('addColor', this.currentColor); - // Source canvas - this.shader.setUniform('source', _r._renderer); - // Bool to active watercolor blender vs marker blender - this.shader.setUniform('active', _watercolor); - // Random values for watercolor blender - this.shader.setUniform('random', [R.random(),R.random(),R.random()]); - // We select and apply the correct mask here - let mask = webgl_mask ? this.mask2: this.mask; - this.shader.setUniform('mask', mask); - // Draw a rectangle covering the whole canvas to apply the shader - _r.fill(0,0,0,0); - _r.noStroke(); - _r.rect(-_r.width/2, -_r.height/2, _r.width, _r.height); - _r.pop(); - // Clear the mask after drawing - mask.clear() + // Paste info from noBlend buffer + this.reDraw() + + if (this.isBlending) { + _r.push(); + _r.translate(-Matrix.trans()[0],-Matrix.trans()[1]) + // Use the blend shader for rendering + _r.shader(this.shader); + // Set shader uniforms + // Color to blend + this.shader.setUniform('addColor', this.currentColor); + // Source canvas + this.shader.setUniform('source', _r._renderer); + // Bool to active watercolor blender vs marker blender + this.shader.setUniform('active', _watercolor); + // Random values for watercolor blender + this.shader.setUniform('random', [R.random(),R.random(),R.random()]); + // We select and apply the correct mask here + let mask = webgl_mask ? this.mask2 : this.mask; + this.shader.setUniform('mask', mask); + // Draw a rectangle covering the whole canvas to apply the shader + _r.fill(0,0,0,0); + _r.noStroke(); + _r.rect(-_r.width/2, -_r.height/2, _r.width, _r.height); + _r.pop(); + // Clear the mask after drawing + mask.clear() + mask.reset() + } // We cache the new color here if (!_isLast) { this.currentColor = this.getPigment(_color); @@ -681,8 +692,6 @@ #include "spectral.glsl" // psrdnoise (c) Stefan Gustavson and Ian McEwan, - // ver. 2021-12-02, published under the MIT license: - // https://github.com/stegu/psrdnoise/ float psrdnoise(vec2 x, vec2 period, float alpha, out vec2 gradient) { vec2 uv = vec2(x.x+x.y*0.5, x.y); @@ -737,7 +746,7 @@ void main() { vec4 maskColor = texture2D(mask, vVertTexCoord); - if (maskColor.r > 0.0 && maskColor.a > 0.0) { + if (maskColor.r > 0.0) { vec2 r=vec2(12.9898,78.233), a=vec2(7.9898,58.233), l=vec2(17.9898,3.233); float d=rand(vVertTexCoord,r.x,r.y,43358.5453)*2.-1., x=rand(vVertTexCoord,a.x,a.y,43213.5453)*2.-1., s=rand(vVertTexCoord,l.x,l.y,33358.5453)*2.-1.; @@ -761,11 +770,9 @@ float blacken = 0.5 * (maskColor.a - darken_above); pigment = pigment * (1. - blacken) - vec4(0.5) * blacken; } - + vec3 mixedColor = spectral_mix(texture2D(source,vVertTexCoord).xyz, pigment.xyz, 0.9 * maskColor.a); gl_FragColor = vec4(mixedColor + 0.01*vec3(d,x,s),1.); - } else { - gl_FragColor = vec4(0); } } ` @@ -1494,7 +1501,7 @@ * @param {number} pressure - The current pressure value. */ drawSpray(pressure) { - let vibration = (this.w * this.p.vibration * pressure) + this.w * randomGaussian() * this.p.vibration / 3; + let vibration = (this.w * this.p.vibration * pressure) + this.w * R.gaussian() * this.p.vibration / 3; let sw = this.p.weight * R.random(0.9,1.1); const iterations = this.p.quality / pressure; for (let j = 0; j < iterations; j++) { @@ -1541,7 +1548,7 @@ * @param {number} pressure - The current pressure value. */ drawDefault(pressure) { - let vibration = this.w * this.p.vibration * (this.p.definition + (1-this.p.definition) * _r.randomGaussian() * this.gauss(0.5,0.9,5,0.2,1.2) / pressure); + let vibration = this.w * this.p.vibration * (this.p.definition + (1-this.p.definition) * R.gaussian() * this.gauss(0.5,0.9,5,0.2,1.2) / pressure); if (R.random(0, this.p.quality * pressure) > 0.4) { this.mask.circle(this.position.x + 0.7 * vibration * R.random(-1,1),this.position.y + vibration * R.random(-1,1), pressure * this.p.weight * R.random(0.85,1.15)); } @@ -2534,7 +2541,7 @@ const modAdjustment = degrow ? -0.5 : 1; // Inline changeModifier to reduce function calls const changeModifier = (modifier) => { - const gaussianVariation = _r.randomGaussian(0.5, 0.1); + const gaussianVariation = R.gaussian(0.5, 0.1); return modifier + (gaussianVariation - 0.5) * 0.1; }; // Reusable vector objects @@ -2556,11 +2563,11 @@ // Make sure that we always bleed in the selected direction let dir = this.dir[i]; let bleed = (F.direction == "out") ? 90 : -90; - let rotationDegrees = ((dir) ? bleed : -bleed) + (_r.randomGaussian(0,0.4)) * 45; + let rotationDegrees = ((dir) ? bleed : -bleed) + (R.gaussian(0,0.4)) * 45; direction.rotate(rotationDegrees * Math.PI / 180); - direction.mult(_r.randomGaussian(0.5, 0.2) * R.random(0.6, 1.4) * sideMagnitude * mod); + direction.mult(R.gaussian(0.5, 0.2) * R.random(0.6, 1.4) * sideMagnitude * mod); // Calculate the new vertex position - let newVertex = p5.Vector.lerp(currentVertex, nextVertex, R.constrain(_r.randomGaussian(0.5,0.2),0.1,0.9)); + let newVertex = p5.Vector.lerp(currentVertex, nextVertex, R.constrain(R.gaussian(0.5,0.2),0.1,0.9)); newVertex.add(direction); // Add the new vertex and its modifier newVerts.push(newVertex); @@ -2658,8 +2665,8 @@ const maxSizeFactor = 0.19 * this.size; Mix.mask.erase(3.5 * texture - R.map(intensity, 80, 120, 0.3, 1, true),0); for (let i = 0; i < numCircles; i++) { - const x = this.midP.x + _r.randomGaussian(0, halfSize); - const y = this.midP.y + _r.randomGaussian(0, halfSize); + const x = this.midP.x + R.gaussian(0, halfSize); + const y = this.midP.y + R.gaussian(0, halfSize); const size = R.random(minSizeFactor, maxSizeFactor); Mix.mask.circle(x, y, size); } @@ -2777,7 +2784,7 @@ exports.pick = B.setBrush; // Selects a brush to use. exports.clip = B.clip; // Clips brushes with a rectangle. exports.noClip = B.noClip; - + // STROKE Properties exports.stroke = B.setColor; // Activates and sets the stroke color. exports.strokeWeight = B.setWeight; // Sets the weight (thickness) of the stroke. diff --git a/p5.brush.min.js b/p5.brush.min.js index d048fa9..fb628ce 100644 --- a/p5.brush.min.js +++ b/p5.brush.min.js @@ -1,2 +1,2 @@ /* p5.brush.js v1.0.5 - Alejandro Campos - MIT License */ -eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(1j(m,N){"6H"===3p 4i&&"4j"!==3p 6I?N(4i):"1j"===3p 4k&&4k.6J?4k(["4i"],N):(m=m||5u,N(m.3F={}))})(j,1j(m){1j N(a=!1,b=!1){Q&&Z(!1);g=a?a:6K.5u;Q||(Q=!0,u.5v());r.39(b);aa(g.1x/5w)}1j Z(a=!0){Q&&(r.1d.3G(),r.2F.3G(),r.1N.3G(),a&&3F.39())}1j E(){Q||N()}1j ba(a,b,c,d,e=!1){1a h=a.x;a=a.y;1q l=b.x,n=b.y;b=c.x;c=c.y;1q q=d.x,t=d.y;1n(h===l&&a===n||b===q&&c===t)1c!1;d=l-h;l=n-a;n=q-b;t-=c;q=t*d-n*l;1n(0===q)1c!1;n=(n*(a-c)-t*(h-b))/q;b=(d*(a-c)-l*(h-b))/q;1c!e&&(0>b||13b.1l?3>3b.1l?b:1:d;v.1R=3>3b.1l?g.1R(a):g.1R(a,b,c);v.1h=!0}1j 4w(a,b="2c"){v.2k=f.2l(a,0,.6);v.5z=b}1j 4x(a=.4,b=.4){v.2I=f.2l(a,0,1);v.2J=f.2l(b,0,1)}1a g,Q=!1;2n.2P.3s("4y",()=>E());1y f={2w:()=>g.1i(),1i(a=0,b=1){1c 1===3b.1l?j.1F(j.2w(),0,1,0,a):j.1F(j.2w(),0,1,a,b)},1G(a,b){1c 1g.1K(j.1i(a,b))},6N(a){1a b,c,d=[];1k(b 6O a)1k(c=0;c<10*a[b];c++)d.1r(b);1c d[1g.1K(j.2w()*d.1l)]},1F(a,b,c,d,e,h=!1){a=d+(a-b)/(c-b)*(e-d);1c h?db;b++){1y c=b*a;f.c[b]=1g.1z(c);f.s[b]=1g.1w(c)}j.4z=!0}},6P:a=>!6Q(a),2Q:a=>(("5B"===g.2x()?1Z*a/1g.2p:a)%1u+1u)%1u};f.5A();1y w={2t:{},1O:{},1C:{},1o:{},4l:{}},y={2y:[0,0],3a:0,1J(a=0){y.3a=f.2Q(a)},1A(){1c j.2y=[g.4B.5C.4C[12],g.4B.5C.4C[13]]}};1q W=1;1q 5D=a=>W*=a;1y r={4D:!1,3c:!1,4E:!0,2d:1v 3K(3),39(a){j.1d=a?g.3d(g.1x,g.1B):3d(g.1x,g.1B);j.1d.3e(g.3e());j.1d.2R();j.1d.5E();j.1d.2x(g.4F);m.1d=j.1d;r.4D||(j.3L=j.3L.6R(\'#5F "5G.3M"\',j.3M()));j.2z=g.6S(j.5H,j.3L);r.4D=!0;j.1N=a?g.3d(g.1x,g.1B):3d(g.1x,g.1B);j.1N.3e(g.3e());j.1N.5E();j.1N.2R();j.1N.2x(g.4F);j.2F=a?g.3d(g.1x,g.1B,g.5I):3d(g.1x,g.1B,g.5I);j.2F.3e(g.3e());j.2F.2R();j.2F.2x(g.4F)},3N(a){a=a.6T;1a b=1v 3K(3);b[0]=a[0]/1V;b[1]=a[1]/1V;b[2]=a[2]/1V;1c b},4G(){g.1r();g.2S(-y.1A()[0],-y.1A()[1]);g.1L(r.1N,-g.1x/2,-g.1B/2);r.1N.2R();g.2v()},4H(){ca();k.1T("3f","6U",1);k.2T(-10,-10,-5,-5);da()},3O:1v 3K(3),3P:1v 3K(3),3Q:!1,3R:!1,1I(a=!1,b=!1,c=!1,d=!1){j.3c=c?j.3Q:j.3R;j.2d=c?j.3O:j.3P;1n(!j.3c)1n(a)j.2d=j.3N(a),c?(j.3Q=!0,j.3O=j.2d):(j.3R=!0,j.3P=j.2d);2u{g.1r();g.2S(-y.1A()[0],-y.1A()[1]);g.1L(j.1N,-g.1x/2,-g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.z,w.z);1b G=.8-1b(1X(g,g),1X(o,o),1X(t,t));G=1f(G,0.);1b H=G*G,I=H*H,J=1b(1X(A,g),1X(B,o),1X(F,t)),K=H*G,L=-8.*K*J;i=10.9*(I.x*A+L.x*g+(I.y*B+L.y*o)+(I.z*F+L.z*t));1c 10.9*1X(I,J);}1M v(1b v,1m f){1c 1M(5U(v,1b(1X(1b(.72,.73,.74),v)),f),1);}1m f(1p v,1m x,1m y,1m f){1c 5T(1w(1X(v,1p(x,y)))*f);}3U 5S(){1M s=5V(1d,1W);1n(s.x>0.){1p m=1p(12.4K,78.4L),k=1p(7.4K,58.4L),d=1p(17.4K,3.4L);1m x=f(1W,m.x,m.y,76.4M)*2.-1.,y=f(1W,k.x,k.y,77.4M)*2.-1.,l=f(1W,d.x,d.y,79.4M)*2.-1.;1y 1p z=1p(0);1p o;1M b;1n(4I){1m a=v(1W*5.,z,10.*1i.x,o),c=v(1W*5.,z,10.*1i.y,o),t=v(1W*5.,z,10.*1i.z,o),w=.25+.25*v(1W*4.,z,3.*1i.x,o);b=1M(v(3S.2U,w).2U+1b(a,c,t)*.3V,1);}2u b=1M(3S.2U,1);1n(s.w>.7){1m r=.5*(s.w-.7);b=b*(1.-r)-1M(.5)*r;}1b a=3W(5V(2w,1W).2U,b.2U,.9*s.w);7a=1M(a+.4N*1b(x,y,l),1);}}\',3M(){1c"1m 3X(1m s){1c s<.7b?s/12.92:2o((s+.3Y)/1.3Y,2.4);}1m 3Z(1m s){1c s<.7c?s*12.92:1.3Y*2o(s,1./2.4)-.3Y;}1b 4O(1b s){1c 1b(3X(s[0]),3X(s[1]),3X(s[2]));}1b 5W(1b s){1c 7d(1b(3Z(s[0]),3Z(s[1]),3Z(s[2])),0.,1.);}3U 5X(1b e,2c 1m m,2c 1m s,2c 1m f,2c 1m r,2c 1m x,2c 1m v,2c 1m z){m=1E(e.x,1E(e.y,e.z));e-=m;s=1E(e.y,e.z);f=1E(e.x,e.z);r=1E(e.x,e.y);x=1E(1f(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,3.cP-5,0);e+=f[36]*1b(4.cQ-5,1.cR-5,0);e+=f[37]*1b(2e-5,7.cS-6,0);1c e;}1m 5Z(1m v,1m m,1m s){1m z=m*2o(s,2.);1c z/(v*2o(1.-s,2.)+z);}1b 3W(1b s,1b f,1m e){1b v=4O(s),m=4O(f);1m z[38],o[38];4P(v,z);4P(m,o);1m x=41(z)[1],w=41(o)[1];e=5Z(x,w,e);1m r[38];1k(cT c=0;c<38;c++){1m y=(1.-e)*(2o(1.-z[c],2.)/(2.*z[c]))+e*(2o(1.-o[c],2.)/(2.*o[c]));r[c]=1.+y-4Q(2o(y,2.)+2.*y);}1c 5Y(41(r));}1M 3W(1M s,1M e,1m z){1c 1M(3W(s.2U,e.2U,z),5U(s.w,e.w,z));}"}};2n.2P.3s("4y",()=>r.1I(!1,!0));2n.2P.3s("4y",()=>r.1I(!1,!0,!0));2n.2P.3s("60",()=>r.1I(!1,!0));2n.2P.3s("60",()=>r.1I(!1,!0,!0));1y u={1h:!1,1S:1v 4R,2i:"",61(){1c 1g.1E(g.1x,g.1B)/cU},5v(){j.R=.4N*g.1x;j.62=-1*g.1x;j.63=-1*g.1B;j.2r=1g.2A(2*g.1x/j.R);j.2C=1g.2A(2*g.1B/j.R);j.64()},66(){1c j.1S.2K(j.2i).2t},4m(a=0){j.1S.2K(j.2i).2t=j.1S.2K(j.2i).5x(a,j.67())},67(){1a a=42(j.2r);1k(1a b=0;b=-a-y.1A()[0]&&j.x<=a-y.1A()[0]&&j.y>=-b-y.1A()[1]&&j.y<=b-y.1A()[1]}2V(){1c j.4b()&&u.1h?u.66()[j.49][j.4a]:0}6c(a,b,c=u.61(),d=!0){1n(j.4b()){1a h;1n(!d){h=f.1z(-b);1q e=f.1w(-b)}1k(1a l=0;l{1y c="3f"===b.1s||"2D"===b.1s||"1L"===b.1s;c||"3h"===b.1s||(b.1s="4c");"1L"===b.1s&&(V.2W(b.1L.6e),b.3i=()=>k.1d.1L(V.3y.2K(k.p.1L.6e),-k.p.2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b]=a.2Y[b+1]=a.2Y[b+2]=1V;a.2Y[b+3]=1V-c}a.dc()},39(){1k(1a a 1P j.3y.5h()){1a b=dd(a,()=>V.6n(b));j.3y.1T(a,b)}}},z={1h:!1,2q:[5,45,{}],2b:!1,1C(a){1a b=z.2q[0],c=z.2q[1],d=z.2q[2],e=k.c,h=k.2G,l=k.w,n=k.1h;z.2b&&k.1T(z.2b[0],z.2b[1],z.2b[2]);c=f.2Q(c)%1Z;1a q=3B,t=-3B,x=3B,A=-3B;1q p=K=>{1k(1a H 1P K.a)q=H[0]t?H[0]:t,x=H[1]A?H[1]:A};42.de(a)||(a=[a]);1k(1q D 1P a)p(D);D=1v P([[q,x],[t,x],[t,A],[q,A]]);1a I=90>=c&&0<=c?x:A;1q B=d.4r?f.1F(d.4r,0,1,1,1.1,!0):1;p=[];1a L=0,C=b,G=K=>({3C:{x:q+C*K*f.1z(-c+90),y:I+C*K*f.1w(-c+90)},3D:{x:q+C*K*f.1z(-c+90)+f.1z(-c),y:I+C*K*f.1w(-c+90)+f.1w(-c)}});1k(;0H.x===Y.x?H.y-Y.y:H.x-Y.x);C*=B;L++}a=[];1k(1q M 1P p)"4j"!==3p M[0]&&a.1r(M);M=d.4q?d.4q:0;1k(J=0;J({x:c[0],y:c[1]}));b&&(j.5i=a);j.5j=j.5i.1F((c,d,e)=>[c,e[(d+1)%e.1l]])}4f(a){1a b=`${a.3C.x},${a.3C.y}-${a.3D.x},${a.3D.y}`;1n(j.3j&&j.3j[b])1c j.3j[b];1a c=[];1k(1a d 1P j.5j){1a e=ba(a.3C,a.3D,d[0],d[1]);!1!==e&&c.1r(e)}j.3j||(j.3j={});1c j.3j[b]=c}1U(a=!1,b,c){1a d=k.1h;a&&k.1T(a,b,c);1n(k.1h){E();1k(1a e 1P j.5j)k.2T(e[0].x,e[0].y,e[1].x,e[1].y)}k.1h=d}1o(a=!1,b,c,d,e,h){1a l=v.1h;a&&(4v(a,b),4w(c,h),4x(d,e));v.1h&&(E(),v.1o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c,!0),j.3l.1C())}}1a F=!1,R;1y v={1h:!1,5n:!1,1R:"#dk",2j:80,2k:.dl,2I:.4,2J:.4,1o(a){j.5o=a;j.v=a.a.1F(c=>g.6p(c[0],c[1]));1y b=j.v.1l*f.1i(.4);v.m=j.v.1F((c,d)=>{c=f.1i(.8,1.2)*j.2k;1c dj.3o&&(j.3o=a);1n(e)1k(e="5B"===g.2x()?1g.2p/1Z:1,h=0;h{1y D=g.2E(.5,.1);1c p+.1*(D-.5)};1a q=1v 2n.5q;1k(1a p=0;p=v.2k?.25:.75:j.m[p];I*=b;c.1r(t);d.1r(n(I));1q x=D.x-t.x,A=D.y-t.y;1a B=1g.4Q(x*x+A*A);q.1T(x,A).dq();x=j.2s[p];A="2c"==v.5z?90:-90;A=(x?A:-A)+45*g.2E(0,.4);q.1J(A*1g.2p/1Z);q.dr(g.2E(.5,.2)*f.1i(.6,1.4)*B*I);t=2n.5q.ds(t,D,f.2l(g.2E(.5,.2),.1,.9));t.2W(q);c.1r(t);d.1r(n(I));e.1r(x,x)}g.2x(l);1c 1v 5p(c,d,j.3n,e)}1o(a,b,c){1a d=f.1F(v.2k,0,.15,.6,1,!0);1y e=24*d,h=b/5+c*b/6,l=b/4+c*b/3,n=b/7+c*b/3,q=b/5;c*=3;y.1A();r.1I(a,!1,!1,!0);r.1d.1r();r.1d.3u();r.1d.2S(y.2y[0]+g.1x/2,y.2y[1]+g.1B/2);r.1d.1J(y.3a);r.1d.3x(W);a=j.1H();1a t=a.1H().1H(.9),x=t.1H(.75),A=j.1H(.6);1k(1a p=0;p35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(1j(m,N){"6I"===3o 4k&&"4l"!==3o 6J?N(4k):"1j"===3o 4m&&4m.6K?4m(["4k"],N):(m=m||5u,N(m.3G={}))})(j,1j(m){1j N(a=!1,b=!1){Q&&Z(!1);h=a?a:6L.5u;Q||(Q=!0,u.5v(),aa(h.1z/5w));r.39(b)}1j Z(a=!0){Q&&(r.1d.3H(),r.1d=2q,r.2v.3H(),r.2v=2q,r.2h.3H(),r.2h=2q,a&&3G.39())}1j E(){Q||N()}1j ba(a,b,c,d,f=!1){1a g=a.x;a=a.y;1q l=b.x,n=b.y;b=c.x;c=c.y;1q q=d.x,t=d.y;1n(g===l&&a===n||b===q&&c===t)1c!1;d=l-g;l=n-a;n=q-b;t-=c;q=t*d-n*l;1n(0===q)1c!1;n=(n*(a-c)-t*(g-b))/q;b=(d*(a-c)-l*(g-b))/q;1c!f&&(0>b||13b.1l?3>3b.1l?b:1:d;v.1P=3>3b.1l?h.1P(a):h.1P(a,b,c);v.1i=!0}1j 4y(a,b="2b"){v.2l=e.2m(a,0,.6);v.5z=b}1j 4z(a=.4,b=.4){v.2I=e.2m(a,0,1);v.2J=e.2m(b,0,1)}1a h,Q=!1;2o.2Q.3r("4A",()=>E());1x e={2y:()=>h.1g(),1g(a=0,b=1){1c 1===3b.1l?j.1D(j.2y(),0,1,0,a):j.1D(j.2y(),0,1,a,b)},1E(a,b){1c 1f.1K(j.1g(a,b))},2s(a=0,b=1){1x c=1-e.1g(),d=e.1g();1c 1f.3K(-2*1f.6O(c))*1f.1y(2*1f.2i*d)*b+a},6P(a){1a b,c,d=[];1k(b 6Q a)1k(c=0;c<10*a[b];c++)d.1s(b);1c d[1f.1K(j.2y()*d.1l)]},1D(a,b,c,d,f,g=!1){a=d+(a-b)/(c-b)*(f-d);1c g?db;b++){1x c=b*a;e.c[b]=1f.1y(c);e.s[b]=1f.1w(c)}j.4B=!0}},6R:a=>!6S(a),2R:a=>(("5B"===h.2z()?1Y*a/1f.2i:a)%1u+1u)%1u};e.5A();1x w={2w:{},1M:{},1A:{},1o:{},4n:{}},y={2A:[0,0],3a:0,1J(a=0){y.3a=e.2R(a)},1F(){1c j.2A=[h.4D.5C.4E[12],h.4D.5C.4E[13]]}};1q W=1;1q 5D=a=>W*=a;1x r={4F:!1,2S:!1,4G:!0,2c:1v 3M(3),39(a){j.1d=a?h.3c(h.1z,h.1G):3c(h.1z,h.1G);j.1d.3d(h.3d());j.1d.3s();j.1d.5E();j.1d.2z(h.4H);m.1d=j.1d;r.4F||(j.3N=j.3N.6T(\'#5F "5G.3O"\',j.3O()));j.2C=h.6U(j.5H,j.3N);r.4F=!0;j.2h=a?h.3c(h.1z,h.1G):3c(h.1z,h.1G);j.2h.3d(h.3d());j.2h.5E();j.2h.3s();j.2h.2z(h.4H);j.2v=a?h.3c(h.1z,h.1G,h.5I):3c(h.1z,h.1G,h.5I);j.2v.3d(h.3d());j.2v.3s();j.2v.2z(h.4H)},3P(a){a=a.6V;1a b=1v 3M(3);b[0]=a[0]/1T;b[1]=a[1]/1T;b[2]=a[2]/1T;1c b},3t(){h.1s();h.3e(-y.1F()[0],-y.1F()[1]);h.1U(r.2h,-h.1z/2,-h.1G/2);r.2h.3s();h.2P()},4I(){ca();k.1R("3f","6W",1);k.2T(-10,-10,-5,-5);da()},3Q:1v 3M(3),3R:1v 3M(3),3S:!1,3T:!1,1I(a=!1,b=!1,c=!1,d=!1){j.2S=c?j.3S:j.3T;j.2c=c?j.3Q:j.3R;1n(!j.2S)1n(a)j.2c=j.3P(a),c?(j.3S=!0,j.3Q=j.2c):(j.3T=!0,j.3R=j.2c);2x 1n(b){c||j.3t();1c}1n((a?j.3P(a):j.2c).5J()!==j.2c.5J()||b||!j.4G)j.3t(),j.2S&&(h.1s(),h.3e(-y.1F()[0],-y.1F()[1]),h.2C(j.2C),j.2C.3u("3U",j.2c),j.2C.3u("2y",h.4D),j.2C.3u("4J",d),j.2C.3u("1g",[e.1g(),e.1g(),e.1g()]),d=c?j.2v:j.1d,j.2C.3u("1d",d),h.1o(0,0,0,0),h.3v(),h.3V(-h.1z/2,-h.1G/2,h.1z,h.1G),h.2P(),d.3s(),d.5K()),b||(j.2c=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+2.*y);}1c 5Z(43(r));}1L 3Y(1L s,1L e,1m z){1c 1L(3Y(s.2U,e.2U,z),5V(s.w,e.w,z));}"}};2o.2Q.3r("4A",()=>r.1I(!1,!0));2o.2Q.3r("4A",()=>r.1I(!1,!0,!0));2o.2Q.3r("61",()=>r.1I(!1,!0));2o.2Q.3r("61",()=>r.1I(!1,!0,!0));1x u={1i:!1,1Q:1v 4R,2j:"",62(){1c 1f.1C(h.1z,h.1G)/cW},5v(){j.R=.4O*h.1z;j.63=-1*h.1z;j.64=-1*h.1G;j.2t=1f.2D(2*h.1z/j.R);j.2E=1f.2D(2*h.1G/j.R);j.66()},67(){1c j.1Q.2K(j.2j).2w},4o(a=0){j.1Q.2K(j.2j).2w=j.1Q.2K(j.2j).5x(a,j.68())},68(){1a a=46(j.2t);1k(1a b=0;b=-a-y.1F()[0]&&j.x<=a-y.1F()[0]&&j.y>=-b-y.1F()[1]&&j.y<=b-y.1F()[1]}2V(){1c j.4d()&&u.1i?u.67()[j.4b][j.4c]:0}6d(a,b,c=u.62(),d=!0){1n(j.4d()){1a g;1n(!d){g=e.1y(-b);1q f=e.1w(-b)}1k(1a l=0;l{1x c="3f"===b.1r||"2F"===b.1r||"1U"===b.1r;c||"3g"===b.1r||(b.1r="4e");"1U"===b.1r&&(V.2W(b.1U.6f),b.3h=()=>k.1d.1U(V.3z.2K(k.p.1U.6f),-k.p.1Z/2,-k.p.1Z/2,k.p.1Z,k.p.1Z));b.1I=c&&!1!==b.1I||b.1I?!0:!1;k.1Q.1R(a,{3I:b,d3:[],d4:[]})},1R(a,b,c=1){k.4V(a);k.c=b;k.w=c;k.1i=!0},4V(a){k.2G=a},6g(a,b,c){0<3b.1l&&(k.c=2>3b.1l?a:[a,b,c]);k.1i=!0},6h(a){k.w=a},3p(a){k.cr=a},4W(){k.cr=2q},2T(a,b,c,d){E();1a f=h.2O(a,b,c,d);0!=f&&(k.4f(a,b,f,!1,!1),a=T(a,b,c,d),k.1S(a,!1))},4X(a,b,c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[1]A?H[1]:A};46.df(a)||(a=[a]);1k(1q D 1N a)p(D);D=1v P([[q,x],[t,x],[t,A],[q,A]]);1a I=90>=c&&0<=c?x:A;1q B=d.4t?e.1D(d.4t,0,1,1,1.1,!0):1;p=[];1a L=0,C=b,G=K=>({3D:{x:q+C*K*e.1y(-c+90),y:I+C*K*e.1w(-c+90)},3E:{x:q+C*K*e.1y(-c+90)+e.1y(-c),y:I+C*K*e.1w(-c+90)+e.1w(-c)}});1k(;0H.x===Y.x?H.y-Y.y:H.x-Y.x);C*=B;L++}a=[];1k(1q M 1N p)"4l"!==3o M[0]&&a.1s(M);M=d.4s?d.4s:0;1k(J=0;J({x:c[0],y:c[1]}));b&&(j.5i=a);j.5j=j.5i.1D((c,d,f)=>[c,f[(d+1)%f.1l]])}4h(a){1a b=`${a.3D.x},${a.3D.y}-${a.3E.x},${a.3E.y}`;1n(j.3i&&j.3i[b])1c j.3i[b];1a c=[];1k(1a d 1N j.5j){1a f=ba(a.3D,a.3E,d[0],d[1]);!1!==f&&c.1s(f)}j.3i||(j.3i={});1c j.3i[b]=c}1S(a=!1,b,c){1a d=k.1i;a&&k.1R(a,b,c);1n(k.1i){E();1k(1a f 1N j.5j)k.2T(f[0].x,f[0].y,f[1].x,f[1].y)}k.1i=d}1o(a=!1,b,c,d,f,g){1a l=v.1i;a&&(4x(a,b),4y(c,g),4z(d,f));v.1i&&(E(),v.1o(j));v.1i=l}1A(a=!1,b,c){1a d=z.1i;a&&4r(a,b,c);z.1i&&(E(),z.1A(j));z.1i=d}}48 U{49(a){j.2N=[];j.2g=[];j.3j=[];j.1r=a;j.2u=0;j.3A(0);j.3k=!1}1O(a=0,b=0,c=1,d=!1){0f+g,0);j.2g.1s(a)}3q(a=0,b=1,c=!1){a=c?(a%1u+1u)%1u:e.2R(a);j.2g.6p(-1);j.2g.1s(a);j.3j.1s(b)}1J(a){j.2u=e.2R(a)}2f(a){1c a>j.1l?j.3j[j.3j.1l-1]:j.5k(j.3j,a)}2V(a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