From 89a22419aedf414e082957aced6a1131badb78b7 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Sun, 7 Jan 2024 23:08:16 +0100 Subject: [PATCH] Version number --- p5.brush.js | 2 +- p5.brush.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/p5.brush.js b/p5.brush.js index edab1c3..18cb434 100644 --- a/p5.brush.js +++ b/p5.brush.js @@ -1,6 +1,6 @@ /** * @fileoverview p5.brush - A comprehensive toolset for brush management in p5.js. - * @version 1.0.5 + * @version 1.0.6 * @license MIT * @author Alejandro Campos Uribe * diff --git a/p5.brush.min.js b/p5.brush.min.js index d628384..dbf4d80 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 */ +/* p5.brush.js v1.0.6 - 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}('(1k(m,P){"6D"===3b 4m&&"3F"!==3b 6E?P(4m):"1k"===3b 4n&&4n.6F?4n(["4m"],P):(m=m||5v,P(m.3G={}))})(j,1k(m){1k P(a=!1){1a b=U&&a?Y:!1;S&&ca(!1);!a&&U&&(a=Y);k=a?a:6G.5v;S||(S=!0,u.5w(),da(k.1x/5x));n.3c(b)}1k ca(a=!0){S&&(n.1g[0].3H(),n.1g[0]=2q,n.1g[1].3H(),n.1g[1]=2q,n.1g[2].3H(),n.1g[2]=2q,a&&3G.3c())}1k E(){S||P()}1k 4o(a,b,c,d,f=!1){1a g=a.x;a=a.y;1t l=b.x,p=b.y;b=c.x;c=c.y;1t q=d.x,t=d.y;1n(g===l&&a===p||b===q&&c===t)1c!1;d=l-g;l=p-a;p=q-b;t-=c;q=t*d-p*l;1n(0===q)1c!1;p=(p*(a-c)-t*(g-b))/q;b=(d*(a-c)-l*(g-b))/q;1c!f&&(0>b||1n.1J(!1,!0));a.3I("5y",()=>n.1J(!1,!0,!0));a.3I("5z",()=>n.1J(!1,!0));a.3I("5z",()=>n.1J(!1,!0,!0))}1k Q(a,b){E();u.1S.1T(a,{5A:b});u.2k=a;u.4t()}1k da(a){1j(1a b 1K 4u){1a c=h.1S.2N(b[0]).3J;c.2b*=a;c.2O*=a;c.2P*=a}4v=a}1k 4w(a=5,b=45,c={4x:!1,5B:!1,4y:!1}){z.1f=!0;z.2r=[a,b,c]}1k 4z(a=0){R=e.2n(a,0,1);F=[]}1k T(a,b,c){F.1q([a,b,c])}1k 4A(a){a===k.3e&&(F.1q(F[0]),F.1q(F[1]));a=0!=R||u.1f?4B(F,R,a===k.3e?!0:!1):1w O(F);1n(v.1f||z.1f)a.1o(),a.1B();h.1f&&a.1U();H.1f&&a.2d();F=!1}1k 4B(a,b=.5,c=!1){1a d=1w W(0===b?"2Q":"1D");1n(a&&03f.1l?3>3f.1l?b:1:d;v.1N=3>3f.1l?k.1N(a):k.1N(a,b,c);v.1f=!0}1k 4D(a,b="2o"){E();v.2m=e.2n(a,0,.6);v.5D=b}1k 4E(a=.4,b=.4){E();v.2L=e.2n(a,0,1);v.2M=e.2n(b,0,1)}1a k,S=!1,U=!1,Y=!1;1y e={2A:()=>k.1h(),1h(a=0,b=1){1c 1===3f.1l?j.1F(j.2A(),0,1,0,a):j.1F(j.2A(),0,1,a,b)},1G(a,b){1c 1d.1M(j.1h(a,b))},2t(a=0,b=1){1y c=1-e.1h(),d=e.1h();1c 1d.3K(-2*1d.6J(c))*1d.1C(2*1d.2j*d)*b+a},6K(a){1a b,c,d=[];1j(b 6L a)1j(c=0;c<10*a[b];c++)d.1q(b);1c d[1d.1M(j.2A()*d.1l)]},1F(a,b,c,d,f,g=!1){a=d+(a-b)/(c-b)*(f-d);1c g?db;b++){1y c=b*a;e.c[b]=1d.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,o),1X(t,t));G=1i(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);}1O v(1b v,1m f){1c 1O(5Z(v,1b(1X(1b(.70,.71,.72),v)),f),1);}1m f(1s v,1m x,1m y,1m a){1c 5Y(1z(1X(v,1s(x,y)))*a);}3V 5X(){1O s=60(1p,1W);1n(s.x>0.){1s m=1s(12.4R,78.4S),k=1s(7.4R,58.4S),r=1s(17.4R,3.4S);1m x=f(1W,m.x,m.y,73.4T)*2.-1.,y=f(1W,k.x,k.y,74.4T)*2.-1.,d=f(1W,r.x,r.y,76.4T)*2.-1.;1y 1s z=1s(0);1s a;1O b;1n(4O){1m u=v(1W*5.,z,10.*1h.x,a),c=v(1W*5.,z,10.*1h.y,a),l=v(1W*5.,z,10.*1h.z,a),o=.25+.25*v(1W*4.,z,3.*1h.x,a);b=1O(v(2V.2X,o).2X+1b(u,c,l)*.3W*3X(2V.x-2V.y-2V.z),1);}2z b=1O(2V.2X,1);1n(s.w>.7){1m l=.5*(s.w-.7);b=b*(1.-l)-1O(.5)*l;}1b u=3Y(60(2A,1W).2X,b.2X,.9*s.w);77=1O(u+.4U*1b(x,y,d),1);}}\',3O(){1c"1m 3Z(1m s){1c s<.79?s/12.92:2p((s+.41)/1.41,2.4);}1m 42(1m s){1c s<.7a?s*12.92:1.41*2p(s,1./2.4)-.41;}1b 4V(1b s){1c 1b(3Z(s[0]),3Z(s[1]),3Z(s[2]));}1b 61(1b s){1c 7b(1b(42(s[0]),42(s[1]),42(s[2])),0.,1.);}3V 62(1b e,2o 1m m,2o 1m s,2o 1m f,2o 1m r,2o 1m x,2o 1m v,2o 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(1i(0.,e.x-e.z),1i(0.,e.x-e.y));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cP-5,0);e+=f[37]*1b(2e-5,7.cQ-6,0);1c e;}1m 64(1m v,1m m,1m s){1m z=m*2p(s,2.);1c z/(v*2p(1.-s,2.)+z);}1b 3Y(1b s,1b f,1m e){1b v=4V(s),m=4V(f);1m z[38],o[38];4W(v,z);4W(m,o);1m x=43(z)[1],w=43(o)[1];e=64(x,w,e);1m r[38];1j(cR c=0;c<38;c++){1m y=(1.-e)*(2p(1.-z[c],2.)/(2.*z[c]))+e*(2p(1.-o[c],2.)/(2.*o[c]));r[c]=1.+y-3K(2p(y,2.)+2.*y);}1c 63(43(r));}1O 3Y(1O s,1O e,1m z){1c 1O(3Y(s.2X,e.2X,z),5Z(s.w,e.w,z));}"}};"3F"!==3b 66&&4s(66.cS);m.cT=1k(a){U=!0;Y=a;4s(a)};1y u={1f:!1,1S:1w 4X,2k:"",67(){1c 1d.1E(k.1x,k.1A)/cU},5w(){j.R=.4U*k.1x;j.68=-1*k.1x;j.69=-1*k.1A;j.2v=1d.2E(2*k.1x/j.R);j.2F=1d.2E(2*k.1A/j.R);j.6a()},6b(){1c j.1S.2N(j.2k).2x},4t(a=0){j.1S.2N(j.2k).2x=j.1S.2N(j.2k).5A(a,j.6c())},6c(){1a a=46(j.2v);1j(1a b=0;b=-a-y.1H()[0]&&j.x<=a-y.1H()[0]&&j.y>=-b-y.1H()[1]&&j.y<=b-y.1H()[1]}2Y(){1c j.4d()&&u.1f?u.6b()[j.4b][j.4c]:0}6h(a,b,c=u.67(),d=!0){1n(j.4d()){1a g;1n(!d){g=e.1C(-b);1t f=e.1z(-b)}1j(1a l=0;l{1y c="3i"===b.1r||"2G"===b.1r||"1V"===b.1r;c||"3j"===b.1r||(b.1r="4e");"1V"===b.1r&&(X.2Z(b.1V.6j),b.3k=()=>h.1p.1V(X.3y.2N(h.p.1V.6j),-h.p.2b/2,-h.p.2b/2,h.p.2b,h.p.2b));b.1J=c&&!1!==b.1J||b.1J?!0:!1;h.1S.1T(a,{3J:b,d2:[],d3:[]})},1T(a,b,c=1){h.50(a);h.c=b;h.w=c;h.1f=!0},50(a){h.2K=a},6k(a,b,c){0<3f.1l&&(h.c=2>3f.1l?a:[a,b,c]);h.1f=!0},6l(a){h.w=a},3q(a){h.cr=a},52(){h.cr=2q},2U(a,b,c,d){E();1a f=e.2y(a,b,c,d);0!=f&&(h.4f(a,b,f,!1,!1),a=V(a,b,c,d),h.1U(a,!1))},53(a,b,c,d){E();h.4f(a,b,c,!0,!1);h.1U(e.2R(d),!1)},54(a,b,c,d){E();h.4f(b,c,a.1l,!0,a);h.1U(d,!0)},2P(){j.p=j.1S.2N(j.2K).3J;1c"4e"===j.p.1r||"3j"===j.p.1r?j.p.2P/j.w:j.p.2P},4f(a,b,c,d,f){j.1u=1w aa(a,b);j.1l=c;j.56=d;(j.39=f)&&f.3l(0)},1U(a,b){b||(j.2w=a);j.57();1y c=j.2P(),d=b?1d.2E(j.1l*a/c):1d.2E(j.1l/c);1j(1a f=0;f=h.cr[0]&&j.1u.x<=h.cr[2]&&j.1u.y>=h.cr[1]&&j.1u.y<=h.cr[3];1a a=.55*k.1x,b=.55*k.1A;1c j.1u.x>=-a-y.1H()[0]&&j.1u.x<=a-y.1H()[0]&&j.1u.y>=-b-y.1H()[1]&&j.1u.y<=b-y.1H()[1]},6n(a){1a b=j.w*j.p.2O*a+j.w*e.2t()*j.p.2O/3,c=j.p.2b*e.1h(.9,1.1);a=j.p.5k/a;1j(1a d=0;da;a++)j.5f(b*a/5,!1);2z 1n("2G"===h.p.1r||"1V"===h.p.1r)1j(1a c=1;5>c;c++)j.5g(b*c/5,a,!1)}}},X={3y:1w 4X,2Z(a){j.3y.1T(a,!1)},6s(a){a.d8();1j(1a b=0;b<4*a.1x*a.1A;b+=4){1a c=(a.3a[b]+a.3a[b+1]+a.3a[b+2])/3;a.3a[b]=a.3a[b+1]=a.3a[b+2]=2g;a.3a[b+3]=2g-c}a.d9()},3c(){1j(1a a 1K j.3y.5m()){1a b=db(a,()=>X.6s(b));j.3y.1T(a,b)}}},z={1f:!1,2r:[5,45,{}],2c:!1,1B(a){1a b=z.2r[0],c=z.2r[1],d=z.2r[2],f=h.c,g=h.2K,l=h.w,p=h.1f;z.2c&&h.1T(z.2c[0],z.2c[1],z.2c[2]);c=e.2R(c)%2a;1a q=3A,t=-3A,x=3A,A=-3A;1t r=L=>{1j(1a I 1K L.a)q=I[0]t?I[0]:t,x=I[1]A?I[1]:A};46.dc(a)||(a=[a]);1j(1t D 1K a)r(D);D=1w O([[q,x],[t,x],[t,A],[q,A]]);1a J=90>=c&&0<=c?x:A;1t B=d.4y?e.1F(d.4y,0,1,1,1.1,!0):1;r=[];1a M=0,C=b,G=L=>({3B:{x:q+C*L*e.1C(-c+90),y:J+C*L*e.1z(-c+90)},3C:{x:q+C*L*e.1C(-c+90)+e.1C(-c),y:J+C*L*e.1z(-c+90)+e.1z(-c)}});1j(;0I.x===ba.x?I.y-ba.y:I.x-ba.x);C*=B;M++}a=[];1j(1t N 1K r)"3F"!==3b N[0]&&a.1q(N);N=d.4x?d.4x:0;1j(K=0;K({x:c[0],y:c[1]}));b&&(j.3D=a);j.5n=j.3D.1F((c,d,f)=>[c,f[(d+1)%f.1l]])}4g(a){1a b=`${a.3B.x},${a.3B.y}-${a.3C.x},${a.3C.y}`;1n(j.3m&&j.3m[b])1c j.3m[b];1a c=[];1j(1a d 1K j.5n){1a f=4o(a.3B,a.3C,d[0],d[1]);!1!==f&&c.1q(f)}j.3m||(j.3m={});1c j.3m[b]=c}1U(a=!1,b,c){1a d=h.1f;a&&h.1T(a,b,c);1n(h.1f){E();1j(1a f 1K j.5n)h.2U(f[0].x,f[0].y,f[1].x,f[1].y)}h.1f=d}1o(a=!1,b,c,d,f,g){1a l=v.1f;a&&(4C(a,b),4D(c,g),4E(d,f));v.1f&&(E(),v.1o(j));v.1f=l}1B(a=!1,b,c){1a d=z.1f;a&&4w(a,b,c);z.1f&&(E(),z.1B(j));z.1f=d}2d(a=!1,b=H.a){1n(H.1f||a){n.1g[2].1q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b,c),j.2I.1o())}1B(a,b,c){z.1f&&(E(),j.1R&&(a=j.1R[0],b=j.1R[1],c=1),j.2I=j.4k(a,b,c,!0),j.2I.1B())}2d(a,b,c){j.1R&&(a=j.1R[0],b=j.1R[1],c=1);j.2I=j.4k(a,b,c,!0);n.1g[2].1q();n.1g[2].2W();a=k.1N(H.c);a.5j(H.a);n.1g[2].1o(a);n.1g[2].4h();1j(1a d 1K j.2I.3D)n.1g[2].4i(d.x,d.y);n.1g[2].4j(k.3e);n.1g[2].2s()}}1a F=!1,R;1y H={2d(a="5N",b=2g){H.1f=!0;H.c=a;H.a=b},4l(){H.1f=!1}},v={1f:!1,5q:!1,1N:"#di",2l:80,2m:.dj,2L:.4,2M:.4,1o(a){j.5r=a;j.v=a.a.1F(c=>k.5s(c[0],c[1]));1y b=j.v.1l*e.1h(.4);v.m=j.v.1F((c,d)=>{c=e.1h(.8,1.2)*j.2m;1c dj.3p&&(j.3p=a);1n(f)1j(f="5F"===k.3g()?1d.2j/2a:1,g=0;g{1y D=e.2t(.5,.1);1c r+.1*(D-.5)};1a q=k.5s();1j(1a r=0;r=v.2m?.25:.75:j.m[r];J*=b;c.1q(t);d.1q(p(J));1t x=D.x-t.x,A=D.y-t.y;1a B=1d.3K(x*x+A*A);q.1T(x,A).dn();x=j.2w[r];A="2o"==v.5D?90:-90;A=(x?A:-A)+45*e.2t(0,.4);q.1L(A*1d.2j/2a);q.do(e.2t(.5,.2)*e.1h(.6,1.4)*B*J);t=t.5u().dp(D,e.2n(e.2t(.5,.2),.1,.9));t.2Z(q);c.1q(t);d.1q(p(J));f.1q(x,x)}k.3g(l);1c 1w 5t(c,d,j.3o,f)}1o(a,b,c){1a d=e.1F(v.2m,0,.15,.6,1,!0);1y f=24*d,g=b/5+c*b/6,l=b/4+c*b/3,p=b/7+c*b/3,q=b/5;c*=3;n.4P=!0;y.1H();n.1J(a,!1,!1,!0);n.1g[0].1q();n.1g[0].2W();n.1g[0].3h(y.2C[0]+k.1x/2,y.2C[1]+k.1A/2);n.1g[0].1L(y.3d);n.1g[0].3x(Z);a=j.1I();1a t=a.1I().1I(.9),x=t.1I(.75),A=j.1I(.6);1j(1a r=0;r