├── .README.md.swp ├── .gitignore ├── README.md ├── backgrounds ├── boxes-01.png ├── boxes-02.png ├── boxes-03.png ├── boxes-04.png ├── boxes-05.png ├── boxes-06.png ├── boxes-07.png ├── boxes-08.png ├── boxes-09.png ├── boxes-10.png ├── boxes-11.png ├── boxes-12.png ├── boxes-13.png ├── boxes-14.png ├── boxes-15.png ├── boxes.png └── honeycomb.png ├── examples ├── 01.gif ├── 01.png ├── 02.gif ├── 02.png ├── 03.png ├── 05.png ├── 06.png ├── 08.png ├── 09.png ├── 12.png ├── 13.png ├── 14.png ├── 15.png ├── 16.png ├── 17.png ├── 18.png ├── 19.png ├── 20.png ├── 21.png ├── 24.png ├── 27.png ├── 28.png ├── 30.png ├── 31.png ├── 32.png ├── 34.png ├── 35.png ├── 36.png ├── 37.png ├── 38.png ├── 39.png └── honeycomb-14.gif ├── index.html ├── js └── processing.api.js └── source-images ├── 01.png ├── 03.png ├── 04.png ├── 07.jpg ├── 09.jpg ├── 12.png └── readme ├── 01.png ├── 02.png ├── 03.png ├── 04.png ├── 05.png └── bee.png /.README.md.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/.README.md.swp -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # honeycomb-js 4 | 5 | A bee flew into my room today and I thought about how they make [honeycombs](https://en.wikipedia.org/wiki/Honeycomb). 6 | # Demo 7 | 8 | You can play around with the resulting patterns by moving the cursor and pressing `+` or `-` on your keyboard. To see the tesselation grid hit `d`. Make sure the browser window has the focus by clicking on the image, otherwise keys won't work. 9 | 10 | Demo: [honeycomb-js](https://fgrimme.github.io) 11 | 12 | There is also a small gallery of 3d'ish op-art patterns. 13 | 14 | Gallery: [patterns](#pattern-gallery) 15 | 16 | 17 | #How it works 18 | 19 | **honeycomb-js** is an implementation of a simple [Kaleidoscope](https://en.wikipedia.org/wiki/Kaleidoscope). It creates symmetric patterns based on an input image. It is a fun project and I use it to create background images for websites. There are some samples in the backgrounds directory. 20 | 21 | The code is written in Processing first and is then exported to JavaScript. You can find the Java/Processing implementation here [honeycomb](https://github.com/fgrimme/honeycomb) and the Android version here [SymDroid](https://github.com/fgrimme/SymDroid). 22 | 23 | 24 | To simulate the Kaleidoscope functionality, a hexagon is created consisting of six triangles as the basic shape. The triangles are rendered with a texture taken from a reference image. The source area for the texture is controlled by the cursor position. 25 | 26 | **Rotation** 27 | 28 | Next, the triangles get rotated by 60° each. To create a symmetrical image the texture is mirrored alternatingly along the x-axis. 29 | 30 | 31 | 32 | 33 | The coordinates for the triangle rotation can be easily calculated by imagining a surrounding circle. 34 | 35 | 36 | 37 | 38 | 39 | ```javascript 40 | x = RADIUS * cos( TWO_PI / 6) 41 | y = RADIUS * sin( TWO_PI / 6 ) 42 | ``` 43 | 44 | **Horizontal Tesselation** 45 | 46 | 47 | The resulting hexagonal shape is tesselated over the entire canvas. First horizontally and then vertically. 48 | The position on the x-axis is calculated by adding the radius times three to the last position. 49 | 50 | 51 | 52 | 53 | 54 | ```javascript 55 | x += RADIUS * 3 56 | ``` 57 | 58 | **Vertical Tesselation** 59 | 60 | The position on the y-axis is caculated by the square root of half the radius times three (angle bisector in equilateral triangle). 61 | 62 | 63 | 64 | ```javascript 65 | y += sqrt(3) * (RADIUS / 2) 66 | ``` 67 | 68 | **Honeycomb Tesselation** 69 | 70 | Not very precise ~ my Gimp skills are not the best :-) 71 | 72 | 73 | 74 | #Keymap 75 | 76 | > Some of the functions could not be ported to the JS version. 77 | 78 | | Key | Function | 79 | |-------|----------------------- 80 | | m | next image | 81 | | n | previous image | 82 | | + | increase radius | 83 | | - | decrease radius | 84 | | r | record | 85 | | k | jump right | 86 | | p | screenshot | 87 | | c | move circular | 88 | | d | toggle mouse | 89 | | v | toggle direction | 90 | | y | increase velocity | 91 | | x | decrease velocity | 92 | | i | show image path | 93 | | t | toggle transparency | 94 | | j | jump down | 95 | | h | jump left | 96 | | u | jump up | 97 | | 1 | reset image | 98 | | 2 | invert image | 99 | | 3 | desaturate image | 100 | | 4 | blur image | 101 | | 5 | bitmap image | 102 | | 6 | posterize image | 103 | | 7 | erode image | 104 | | 8 | dilate image | 105 | | UP | move up | 106 | | DOWN | move down | 107 | | LEFT | move left | 108 | | RIGHT |move right | 109 | 110 | # Pattern Gallery 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /backgrounds/boxes-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-01.png -------------------------------------------------------------------------------- /backgrounds/boxes-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-02.png -------------------------------------------------------------------------------- /backgrounds/boxes-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-03.png -------------------------------------------------------------------------------- /backgrounds/boxes-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-04.png -------------------------------------------------------------------------------- /backgrounds/boxes-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-05.png -------------------------------------------------------------------------------- /backgrounds/boxes-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-06.png -------------------------------------------------------------------------------- /backgrounds/boxes-07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-07.png -------------------------------------------------------------------------------- /backgrounds/boxes-08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-08.png -------------------------------------------------------------------------------- /backgrounds/boxes-09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-09.png -------------------------------------------------------------------------------- /backgrounds/boxes-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-10.png -------------------------------------------------------------------------------- /backgrounds/boxes-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-11.png -------------------------------------------------------------------------------- /backgrounds/boxes-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-12.png -------------------------------------------------------------------------------- /backgrounds/boxes-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-13.png -------------------------------------------------------------------------------- /backgrounds/boxes-14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-14.png -------------------------------------------------------------------------------- /backgrounds/boxes-15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes-15.png -------------------------------------------------------------------------------- /backgrounds/boxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/boxes.png -------------------------------------------------------------------------------- /backgrounds/honeycomb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/backgrounds/honeycomb.png -------------------------------------------------------------------------------- /examples/01.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/01.gif -------------------------------------------------------------------------------- /examples/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/01.png -------------------------------------------------------------------------------- /examples/02.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/02.gif -------------------------------------------------------------------------------- /examples/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/02.png -------------------------------------------------------------------------------- /examples/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/03.png -------------------------------------------------------------------------------- /examples/05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/05.png -------------------------------------------------------------------------------- /examples/06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/06.png -------------------------------------------------------------------------------- /examples/08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/08.png -------------------------------------------------------------------------------- /examples/09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/09.png -------------------------------------------------------------------------------- /examples/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/12.png -------------------------------------------------------------------------------- /examples/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/13.png -------------------------------------------------------------------------------- /examples/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/14.png -------------------------------------------------------------------------------- /examples/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/15.png -------------------------------------------------------------------------------- /examples/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/16.png -------------------------------------------------------------------------------- /examples/17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/17.png -------------------------------------------------------------------------------- /examples/18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/18.png -------------------------------------------------------------------------------- /examples/19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/19.png -------------------------------------------------------------------------------- /examples/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/20.png -------------------------------------------------------------------------------- /examples/21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/21.png -------------------------------------------------------------------------------- /examples/24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/24.png -------------------------------------------------------------------------------- /examples/27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/27.png -------------------------------------------------------------------------------- /examples/28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/28.png -------------------------------------------------------------------------------- /examples/30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/30.png -------------------------------------------------------------------------------- /examples/31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/31.png -------------------------------------------------------------------------------- /examples/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/32.png -------------------------------------------------------------------------------- /examples/34.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/34.png -------------------------------------------------------------------------------- /examples/35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/35.png -------------------------------------------------------------------------------- /examples/36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/36.png -------------------------------------------------------------------------------- /examples/37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/37.png -------------------------------------------------------------------------------- /examples/38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/38.png -------------------------------------------------------------------------------- /examples/39.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/39.png -------------------------------------------------------------------------------- /examples/honeycomb-14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/examples/honeycomb-14.gif -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 20 | 21 | 22 | 23 | 24 |
25 |
26 | 27 |

Your browser does not support the canvas tag.

28 | 29 |
30 | 33 |
34 |
35 | 249 | 250 | 251 | -------------------------------------------------------------------------------- /js/processing.api.js: -------------------------------------------------------------------------------- 1 | (function(m,v,p,d){var i=function(){};var t=function(){if("console" in m){return function(I){m.console.log("Processing.js: "+I)}}return i}();var s=function(I){var J=new XMLHttpRequest;J.open("GET",I,false);if(J.overrideMimeType){J.overrideMimeType("text/plain")}J.setRequestHeader("If-Modified-Since","Fri, 01 Jan 1960 00:00:00 GMT");J.send(null);if(J.status!==200&&J.status!==0){throw"XMLHttpRequest failed, status code "+J.status}return J.responseText};var H="document" in this&&!("fake" in this.document);v.head=v.head||v.getElementsByTagName("head")[0];function j(I,J){if(I in m){return m[I]}if(typeof m[J]==="function"){return m[J]}return function(L){if(L instanceof Array){return L}if(typeof L==="number"){var K=[];K.length=L;return K}}}if(v.documentMode>=9&&!v.doctype){throw"The doctype directive is missing. The recommended doctype in Internet Explorer is the HTML5 doctype: "}var e=j("Float32Array","WebGLFloatArray"),n=j("Int32Array","WebGLIntArray"),x=j("Uint16Array","WebGLUnsignedShortArray"),r=j("Uint8Array","WebGLUnsignedByteArray");var k={X:0,Y:1,Z:2,R:3,G:4,B:5,A:6,U:7,V:8,NX:9,NY:10,NZ:11,EDGE:12,SR:13,SG:14,SB:15,SA:16,SW:17,TX:18,TY:19,TZ:20,VX:21,VY:22,VZ:23,VW:24,AR:25,AG:26,AB:27,DR:3,DG:4,DB:5,DA:6,SPR:28,SPG:29,SPB:30,SHINE:31,ER:32,EG:33,EB:34,BEEN_LIT:35,VERTEX_FIELD_COUNT:36,P2D:1,JAVA2D:1,WEBGL:2,P3D:2,OPENGL:2,PDF:0,DXF:0,OTHER:0,WINDOWS:1,MAXOSX:2,LINUX:3,EPSILON:0.0001,MAX_FLOAT:3.4028235e+38,MIN_FLOAT:-3.4028235e+38,MAX_INT:2147483647,MIN_INT:-2147483648,PI:p.PI,TWO_PI:2*p.PI,HALF_PI:p.PI/2,THIRD_PI:p.PI/3,QUARTER_PI:p.PI/4,DEG_TO_RAD:p.PI/180,RAD_TO_DEG:180/p.PI,WHITESPACE:" \t\n\r\u000c\u00a0",RGB:1,ARGB:2,HSB:3,ALPHA:4,CMYK:5,TIFF:0,TARGA:1,JPEG:2,GIF:3,BLUR:11,GRAY:12,INVERT:13,OPAQUE:14,POSTERIZE:15,THRESHOLD:16,ERODE:17,DILATE:18,REPLACE:0,BLEND:1<<0,ADD:1<<1,SUBTRACT:1<<2,LIGHTEST:1<<3,DARKEST:1<<4,DIFFERENCE:1<<5,EXCLUSION:1<<6,MULTIPLY:1<<7,SCREEN:1<<8,OVERLAY:1<<9,HARD_LIGHT:1<<10,SOFT_LIGHT:1<<11,DODGE:1<<12,BURN:1<<13,ALPHA_MASK:4278190080,RED_MASK:16711680,GREEN_MASK:65280,BLUE_MASK:255,CUSTOM:0,ORTHOGRAPHIC:2,PERSPECTIVE:3,POINT:2,POINTS:2,LINE:4,LINES:4,TRIANGLE:8,TRIANGLES:9,TRIANGLE_STRIP:10,TRIANGLE_FAN:11,QUAD:16,QUADS:16,QUAD_STRIP:17,POLYGON:20,PATH:21,RECT:30,ELLIPSE:31,ARC:32,SPHERE:40,BOX:41,GROUP:0,PRIMITIVE:1,GEOMETRY:3,VERTEX:0,BEZIER_VERTEX:1,CURVE_VERTEX:2,BREAK:3,CLOSESHAPE:4,OPEN:1,CLOSE:2,CORNER:0,CORNERS:1,RADIUS:2,CENTER_RADIUS:2,CENTER:3,DIAMETER:3,CENTER_DIAMETER:3,BASELINE:0,TOP:101,BOTTOM:102,NORMAL:1,NORMALIZED:1,IMAGE:2,MODEL:4,SHAPE:5,SQUARE:"butt",ROUND:"round",PROJECT:"square",MITER:"miter",BEVEL:"bevel",AMBIENT:0,DIRECTIONAL:1,SPOT:3,BACKSPACE:8,TAB:9,ENTER:10,RETURN:13,ESC:27,DELETE:127,CODED:65535,SHIFT:16,CONTROL:17,ALT:18,CAPSLK:20,PGUP:33,PGDN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLK:144,META:157,INSERT:155,ARROW:"default",CROSS:"crosshair",HAND:"pointer",MOVE:"move",TEXT:"text",WAIT:"wait",NOCURSOR:"url('data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='), auto",DISABLE_OPENGL_2X_SMOOTH:1,ENABLE_OPENGL_2X_SMOOTH:-1,ENABLE_OPENGL_4X_SMOOTH:2,ENABLE_NATIVE_FONTS:3,DISABLE_DEPTH_TEST:4,ENABLE_DEPTH_TEST:-4,ENABLE_DEPTH_SORT:5,DISABLE_DEPTH_SORT:-5,DISABLE_OPENGL_ERROR_REPORT:6,ENABLE_OPENGL_ERROR_REPORT:-6,ENABLE_ACCURATE_TEXTURES:7,DISABLE_ACCURATE_TEXTURES:-7,HINT_COUNT:10,SINCOS_LENGTH:720,PRECISIONB:15,PRECISIONF:1<<15,PREC_MAXVAL:(1<<15)-1,PREC_ALPHA_SHIFT:24-15,PREC_RED_SHIFT:16-15,NORMAL_MODE_AUTO:0,NORMAL_MODE_SHAPE:1,NORMAL_MODE_VERTEX:2,MAX_LIGHTS:8};function b(K){if(typeof K==="string"){var J=0;for(var I=0;I0?K:0}}this.get=function(M){return L[M]};this.contains=function(M){return this.indexOf(M)>-1};this.indexOf=function(O){for(var N=0,M=L.length;N=0;--M){if(u(N,L[M])){return M}}return -1};this.add=function(){if(arguments.length===1){L.push(arguments[0])}else{if(arguments.length===2){var M=arguments[0];if(typeof M==="number"){if(M>=0&&M<=L.length){L.splice(M,0,arguments[1])}else{throw M+" is not a valid index"}}else{throw typeof M+" is not a number"}}else{throw"Please use the proper number of parameters."}}};this.addAll=function(N,M){var O;if(typeof N==="number"){if(N<0||N>L.length){throw"Index out of bounds for addAll: "+N+" greater or equal than "+L.length}O=new f(M);while(O.hasNext()){L.splice(N++,0,O.next())}}else{O=new f(N);while(O.hasNext()){L.push(O.next())}}};this.set=function(){if(arguments.length===2){var M=arguments[0];if(typeof M==="number"){if(M>=0&&M-1){L.splice(M,1);return true}return false};this.removeAll=function(Q){var N,M,P,O=new I;O.addAll(this);this.clear();for(N=0,M=0;N0?arguments[0]:16;var S=arguments.length>1?arguments[1]:0.75;var L=[];L.length=R;var N=0;var J=this;function P(U){var T=b(U)%L.length;return T<0?L.length+T:T}function M(){if(N<=S*L.length){return}var W=[];for(var V=0;V=L.length){W=true}else{if(L[T]===d||X>=L[T].length){X=-1;++T}else{return}}}}this.hasNext=function(){return !W};this.next=function(){V=Y(L[T][X]);U();return V};this.remove=function(){if(V!==d){Z(V);--X;U()}};U()}function Q(T,U,V){this.clear=function(){J.clear()};this.contains=function(W){return U(W)};this.containsAll=function(X){var W=X.iterator();while(W.hasNext()){if(!this.contains(W.next())){return false}}return true};this.isEmpty=function(){return J.isEmpty()};this.iterator=function(){return new K(T,V)};this.remove=function(W){if(this.contains(W)){V(W);return true}return false};this.removeAll=function(Z){var W=Z.iterator();var Y=false;while(W.hasNext()){var X=W.next();if(this.contains(X)){V(X);Y=true}}return true};this.retainAll=function(aa){var Y=this.iterator();var X=[];while(Y.hasNext()){var Z=Y.next();if(!aa.contains(Z)){X.push(Z)}}for(var W=0;W0};this.size=function(){return J.size()};this.toArray=function(){var W=[];var X=this.iterator();while(X.hasNext()){W.push(X.next())}return W}}function O(T){this._isIn=function(U){return U===J&&T.removed===d};this.equals=function(U){return u(T.key,U.getKey())};this.getKey=function(){return T.key};this.getValue=function(){return T.value};this.hashCode=function(U){return b(T.key)};this.setValue=function(V){var U=T.value;T.value=V;return U}}this.clear=function(){N=0;L=[];L.length=R};this.clone=function(){var T=new I;T.putAll(this);return T};this.containsKey=function(V){var T=P(V);var W=L[T];if(W===d){return false}for(var U=0;U1){X.splice(U,1)}else{L[T]=d}return W}}return null};this.removeByValue=function(V){var X,U,T,W;for(X in L){if(L.hasOwnProperty(X)){for(U=0,T=L[X].length;U0){this.div(L)}},limit:function(L){if(this.mag()>L){this.normalize();this.mult(L)}},heading2D:function(){return -p.atan2(-this.y,this.x)},toString:function(){return"["+this.x+", "+this.y+", "+this.z+"]"},array:function(){return[this.x,this.y,this.z]}};function J(L){return function(O,N){var M=O.get();M[L](N);return M}}for(var K in I.prototype){if(I.prototype.hasOwnProperty(K)&&!I.hasOwnProperty(K)){I[K]=J(K)}}return I}();function C(){}C.prototype=k;var c=new C;c.ArrayList=o;c.HashMap=E;c.PVector=l;c.ObjectIterator=f;c.PConstants=k;c.defineProperty=function(J,I,K){if("defineProperty" in Object){Object.defineProperty(J,I,K)}else{if(K.hasOwnProperty("get")){J.__defineGetter__(I,K.get)}if(K.hasOwnProperty("set")){J.__defineSetter__(I,K.set)}}};function B(J,I,M){if(!J.hasOwnProperty(I)||typeof J[I]!=="function"){J[I]=M;return}var L=J[I];if("$overloads" in L){L.$defaultOverload=M;return}if(!("$overloads" in M)&&L.length===M.length){return}var O,K;if("$overloads" in M){O=M.$overloads.slice(0);O[L.length]=L;K=M.$defaultOverload}else{O=[];O[M.length]=M;O[L.length]=L;K=L}var N=function(){var P=N.$overloads[arguments.length]||("$methodArgsIndex" in N&&arguments.length>N.$methodArgsIndex?N.$overloads[N.$methodArgsIndex]:null)||N.$defaultOverload;return P.apply(this,arguments)};N.$overloads=O;if("$methodArgsIndex" in M){N.$methodArgsIndex=M.$methodArgsIndex}N.$defaultOverload=K;N.name=I;J[I]=N}function y(L,K){function M(N){c.defineProperty(L,N,{get:function(){return K[N]},set:function(O){K[N]=O},enumerable:true})}var J=[];for(var I in K){if(typeof K[I]==="function"){B(L,I,K[I])}else{if(I.charAt(0)!=="$"&&!(I in L)){J.push(I)}}}while(J.length>0){M(J.shift())}L.$super=K}c.extendClassChain=function(J){var K=[J];for(var I=J.$upcast;I;I=I.$upcast){y(I,J);K.push(I);J=I}while(K.length>0){K.pop().$self=J}};c.extendStaticMembers=function(I,J){y(I,J)};c.extendInterfaceMembers=function(I,J){y(I,J)};c.addMethod=function(L,K,N,M){var I=L[K];if(I||M){var J=N.length;if("$overloads" in I){I.$overloads[J]=N}else{var O=function(){var Q=O.$overloads[arguments.length]||("$methodArgsIndex" in O&&arguments.length>O.$methodArgsIndex?O.$overloads[O.$methodArgsIndex]:null)||O.$defaultOverload;return Q.apply(this,arguments)};var P=[];if(I){P[I.length]=I}P[J]=N;O.$overloads=P;O.$defaultOverload=I||N;if(M){O.$methodArgsIndex=J}O.name=K;L[K]=O}}else{L[K]=N}};function a(I){if(typeof I!=="string"){return false}return["byte","int","char","color","float","long","double"].indexOf(I)!==-1}c.createJavaArray=function(N,O){var J=null,K=null;if(typeof N==="string"){if(N==="boolean"){K=false}else{if(a(N)){K=0}}}if(typeof O[0]==="number"){var I=0|O[0];if(O.length<=1){J=[];J.length=I;for(var M=0;M"+X;v.body.appendChild(O);var P=I.width,W=I.height,Q=W/2;T.fillStyle="white";T.fillRect(0,0,P,W);T.fillStyle="black";T.fillText(X,0,Q);var K=T.getImageData(0,0,P,W).data;var U=0,N=P*4,V=K.length;while(++U0&&K[U]===255){i()}var Y=p.round(U/N);S.ascent=Z*(Q-M);S.descent=Z*(Y-Q);if(v.defaultView.getComputedStyle){var J=v.defaultView.getComputedStyle(O,null).getPropertyValue("height");J=Z*J.replace("px","");if(J>=S.size*2){S.leading=p.round(J/2)}}v.body.removeChild(O);if(S.caching){return T}}function g(I,J){if(I===d){I=""}this.name=I;if(J===d){J=0}this.size=J;this.glyph=false;this.ascent=0;this.descent=0;this.leading=1.2*J;var M=I.indexOf(" Italic Bold");if(M!==-1){I=I.substring(0,M)}this.style="normal";var L=I.indexOf(" Italic");if(L!==-1){I=I.substring(0,L);this.style="italic"}this.weight="normal";var K=I.indexOf(" Bold");if(K!==-1){I=I.substring(0,K);this.weight="bold"}this.family="sans-serif";if(I!==d){switch(I){case"sans-serif":case"serif":case"monospace":case"fantasy":case"cursive":this.family=I;break;default:this.family='"'+I+'", sans-serif';break}}this.context2d=z(this);this.css=this.getCSSDefinition();if(this.context2d){this.context2d.font=this.css}}g.prototype.caching=true;g.prototype.getCSSDefinition=function(K,I){if(K===d){K=this.size+"px"}if(I===d){I=this.leading+"px"}var J=[this.style,"normal",this.weight,K+"/"+I,this.family];return J.join(" ")};g.prototype.measureTextWidth=function(I){return this.context2d.measureText(I).width};g.prototype.measureTextWidthFallback=function(K){var J=v.createElement("canvas"),I=J.getContext("2d");I.font=this.css;return I.measureText(K).width};g.PFontCache={length:0};g.get=function(L,M){M=(M*10+0.5|0)/10;var J=g.PFontCache,I=L+"/"+M;if(!J[I]){J[I]=new g(L,M);J.length++;if(J.length===50){g.prototype.measureTextWidth=g.prototype.measureTextWidthFallback;g.prototype.caching=false;var K;for(K in J){if(K!=="length"){J[K].context2d=null}}return new g(L,M)}if(J.length===400){g.PFontCache={};g.get=g.getFallback;return new g(L,M)}}return J[I]};g.getFallback=function(I,J){return new g(I,J)};g.list=function(){return["sans-serif","serif","monospace","fantasy","cursive"]};g.preloading={template:{},initialized:false,initialize:function(){var K=function(){var M="#E3KAI2wAgT1MvMg7Eo3VmNtYX7ABi3CxnbHlm7Abw3kaGVhZ7ACs3OGhoZWE7A53CRobXR47AY3AGbG9jYQ7G03Bm1heH7ABC3CBuYW1l7Ae3AgcG9zd7AI3AE#B3AQ2kgTY18PPPUACwAg3ALSRoo3#yld0xg32QAB77#E777773B#E3C#I#Q77773E#Q7777777772CMAIw7AB77732B#M#Q3wAB#g3B#E#E2BB//82BB////w#B7#gAEg3E77x2B32B#E#Q#MTcBAQ32gAe#M#QQJ#E32M#QQJ#I#g32Q77#";var L=function(N){return"AAAAAAAA".substr(~~N?7-N:6)};return M.replace(/[#237]/g,L)};var I=v.createElement("style");I.setAttribute("type","text/css");I.innerHTML='@font-face {\n font-family: "PjsEmptyFont";\n src: url(\'data:application/x-font-ttf;base64,'+K()+"')\n format('truetype');\n}";v.head.appendChild(I);var J=v.createElement("span");J.style.cssText='position: absolute; top: 0; left: 0; opacity: 0; font-family: "PjsEmptyFont", fantasy;';J.innerHTML="AAAAAAAA";v.body.appendChild(J);this.template=J;this.initialized=true},getElementWidth:function(I){return v.defaultView.getComputedStyle(I,"").getPropertyValue("width")},timeAttempted:0,pending:function(M){if(!this.initialized){this.initialize()}var K,I,L=this.getElementWidth(this.template);for(var J=0;J cos( light.angle ) ) { spotAttenuation = pow( spotDot, light.concentration ); } else{ spotAttenuation = 0.0; } attenuation *= spotAttenuation;")+" float nDotVP = max( 0.0, dot( vertNormal, VP ) ); vec3 halfVector = normalize( VP - normalize(ecPos) ); float nDotHV = max( 0.0, dot( vertNormal, halfVector ) ); if( nDotVP != 0.0 ) { powerFactor = pow( nDotHV, uShininess ); } spec += uSpecular * powerFactor * attenuation; col += light.color * nDotVP * attenuation;}void main(void) { vec3 finalAmbient = vec3( 0.0 ); vec3 finalDiffuse = vec3( 0.0 ); vec3 finalSpecular = vec3( 0.0 ); vec4 col = uColor; if ( uColor[0] == -1.0 ){ col = aColor; } vec3 norm = normalize(vec3( uNormalTransform * vec4( aNormal, 0.0 ) )); vec4 ecPos4 = uView * uModel * vec4(aVertex, 1.0); vec3 ecPos = (vec3(ecPos4))/ecPos4.w; if( uLightCount == 0 ) { vFrontColor = col + vec4(uMaterialSpecular, 1.0); } else { for( int i = 0; i < 8; i++ ) { Light l = getLight(i); if( i >= uLightCount ){ break; } if( l.type == 0 ) { AmbientLight( finalAmbient, ecPos, l ); } else if( l.type == 1 ) { DirectionalLight( finalDiffuse, finalSpecular, norm, ecPos, l ); } else if( l.type == 2 ) { PointLight( finalDiffuse, finalSpecular, norm, ecPos, l ); } else { SpotLight( finalDiffuse, finalSpecular, norm, ecPos, l ); } } if( uUsingMat == false ) { vFrontColor = vec4( vec3( col ) * finalAmbient + vec3( col ) * finalDiffuse + vec3( col ) * finalSpecular, col[3] ); } else{ vFrontColor = vec4( uMaterialEmissive + (vec3(col) * uMaterialAmbient * finalAmbient ) + (vec3(col) * finalDiffuse) + (uMaterialSpecular * finalSpecular), col[3] ); } } vTexture.xy = aTexture.xy; gl_Position = uProjection * uView * uModel * vec4( aVertex, 1.0 );}";var aA="#ifdef GL_ES\nprecision highp float;\n#endif\nvarying vec4 vFrontColor;uniform sampler2D uSampler;uniform bool uUsingTexture;varying vec2 vTexture;void main(void){ if( uUsingTexture ){ gl_FragColor = vec4(texture2D(uSampler, vTexture.xy)) * vFrontColor; } else{ gl_FragColor = vFrontColor; }}";function dX(d7,d6,d9,d8){var d5=dx.locations[d7];if(d5===d){d5=d3.getUniformLocation(d6,d9);dx.locations[d7]=d5}if(d5!==null){if(d8.length===4){d3.uniform4fv(d5,d8)}else{if(d8.length===3){d3.uniform3fv(d5,d8)}else{if(d8.length===2){d3.uniform2fv(d5,d8)}else{d3.uniform1f(d5,d8)}}}}}function dU(d7,d6,d9,d8){var d5=dx.locations[d7];if(d5===d){d5=d3.getUniformLocation(d6,d9);dx.locations[d7]=d5}if(d5!==null){if(d8.length===4){d3.uniform4iv(d5,d8)}else{if(d8.length===3){d3.uniform3iv(d5,d8)}else{if(d8.length===2){d3.uniform2iv(d5,d8)}else{d3.uniform1i(d5,d8)}}}}}function a4(d9,d7,ea,d8,d6){var d5=dx.locations[d9];if(d5===d){d5=d3.getUniformLocation(d7,ea);dx.locations[d9]=d5}if(d5!==-1){if(d6.length===16){d3.uniformMatrix4fv(d5,d8,d6)}else{if(d6.length===9){d3.uniformMatrix3fv(d5,d8,d6)}else{d3.uniformMatrix2fv(d5,d8,d6)}}}}function c7(d9,d7,ea,d6,d8){var d5=dx.attributes[d9];if(d5===d){d5=d3.getAttribLocation(d7,ea);dx.attributes[d9]=d5}if(d5!==-1){d3.bindBuffer(d3.ARRAY_BUFFER,d8);d3.vertexAttribPointer(d5,d6,d3.FLOAT,false,0,0);d3.enableVertexAttribArray(d5)}}function cb(d7,d6,d8){var d5=dx.attributes[d7];if(d5===d){d5=d3.getAttribLocation(d6,d8);dx.attributes[d7]=d5}if(d5!==-1){d3.disableVertexAttribArray(d5)}}var bA=function(d7,d9,d6){var ea=d7.createShader(d7.VERTEX_SHADER);d7.shaderSource(ea,d9);d7.compileShader(ea);if(!d7.getShaderParameter(ea,d7.COMPILE_STATUS)){throw d7.getShaderInfoLog(ea)}var d8=d7.createShader(d7.FRAGMENT_SHADER);d7.shaderSource(d8,d6);d7.compileShader(d8);if(!d7.getShaderParameter(d8,d7.COMPILE_STATUS)){throw d7.getShaderInfoLog(d8)}var d5=d7.createProgram();d7.attachShader(d5,ea);d7.attachShader(d5,d8);d7.linkProgram(d5);if(!d7.getProgramParameter(d5,d7.LINK_STATUS)){throw"Error linking shaders."}return d5};var aU=function(d5,d9,d6,d8,d7){return{x:d5,y:d9,w:d6,h:d8}};var bf=aU;var bW=function(d5,d9,d6,d8,d7){return{x:d5,y:d9,w:d7?d6:d6-d5,h:d7?d8:d8-d9}};var aI=function(d5,d9,d6,d8,d7){return{x:d5-d6/2,y:d9-d8/2,w:d6,h:d8}};var dm=function(){};var bM=function(){};var bw=function(){};var b5=function(){};bM.prototype=new dm;bM.prototype.constructor=bM;bw.prototype=new dm;bw.prototype.constructor=bw;b5.prototype=new dm;b5.prototype.constructor=b5;dm.prototype.a3DOnlyFunction=i;var cg={};var bK=cR.Character=function(d5){if(typeof d5==="string"&&d5.length===1){this.code=d5.charCodeAt(0)}else{if(typeof d5==="number"){this.code=d5}else{if(d5 instanceof bK){this.code=d5}else{this.code=NaN}}}return cg[this.code]===d?cg[this.code]=this:cg[this.code]};bK.prototype.toString=function(){return String.fromCharCode(this.code)};bK.prototype.valueOf=function(){return this.code};var J=cR.PShape=function(d5){this.family=d5||0;this.visible=true;this.style=true;this.children=[];this.nameTable=[];this.params=[];this.name="";this.image=null;this.matrix=null;this.kind=null;this.close=null;this.width=null;this.height=null;this.parent=null};J.prototype={isVisible:function(){return this.visible},setVisible:function(d5){this.visible=d5},disableStyle:function(){this.style=false;for(var d6=0,d5=this.children.length;d60){for(d6=0,d5=this.nameTable.length;d6, it's <"+this.element.getName()+">"}}else{if(arguments.length===2){if(typeof arguments[1]==="string"){if(arguments[1].indexOf(".svg")>-1){this.element=new cR.XMLElement(cR,arguments[1]);this.vertexCodes=[];this.vertices=[];this.opacity=1;this.stroke=false;this.strokeColor=4278190080;this.strokeWeight=1;this.strokeCap="butt";this.strokeJoin="miter";this.strokeGradient="";this.strokeGradientPaint="";this.strokeName="";this.strokeOpacity=1;this.fill=true;this.fillColor=4278190080;this.fillGradient=null;this.fillGradientPaint=null;this.fillOpacity=1}}else{if(arguments[0]){this.element=arguments[1];this.vertexCodes=arguments[0].vertexCodes.slice();this.vertices=arguments[0].vertices.slice();this.stroke=arguments[0].stroke;this.strokeColor=arguments[0].strokeColor;this.strokeWeight=arguments[0].strokeWeight;this.strokeCap=arguments[0].strokeCap;this.strokeJoin=arguments[0].strokeJoin;this.strokeGradient=arguments[0].strokeGradient;this.strokeGradientPaint=arguments[0].strokeGradientPaint;this.strokeName=arguments[0].strokeName;this.fill=arguments[0].fill;this.fillColor=arguments[0].fillColor;this.fillGradient=arguments[0].fillGradient;this.fillGradientPaint=arguments[0].fillGradientPaint;this.fillName=arguments[0].fillName;this.strokeOpacity=arguments[0].strokeOpacity;this.fillOpacity=arguments[0].fillOpacity;this.opacity=arguments[0].opacity}}}}this.name=this.element.getStringAttribute("id");var d5=this.element.getStringAttribute("display","inline");this.visible=d5!=="none";var ea=this.element.getAttribute("transform");if(ea){this.matrix=this.parseMatrix(ea)}var d7=this.element.getStringAttribute("viewBox");if(d7!==null){var d9=d7.split(" ");this.width=d9[2];this.height=d9[3]}var d6=this.element.getStringAttribute("width");var d8=this.element.getStringAttribute("height");if(d6!==null){this.width=this.parseUnitSize(d6);this.height=this.parseUnitSize(d8)}else{if(this.width===0||this.height===0){this.width=1;this.height=1;throw"The width and/or height is not readable in the tag of this file."}}this.parseColors(this.element);this.parseChildren(this.element)};cm.prototype=new J;cm.prototype.parseMatrix=function(){function d5(d7){var d6=[];d7.replace(/\((.*?)\)/,function(){return function(d8,d9){d6=d9.replace(/,+/g," ").split(/\s+/)}}());return d6}return function(ed){this.checkMatrix(2);var d6=[];ed.replace(/\s*(\w+)\((.*?)\)/g,function(eg){d6.push(cR.trim(eg))});if(d6.length===0){return null}for(var eb=0,d9=d6.length;eb=65&&eo<=90||eo>=97&&eo<=122){ep=es;es++;if(es=65&&eo<=90||eo>=97&&eo<=100||eo>=102&&eo<=122)&&er===false){if(eo===32){if(em!==""){eq.push(parseFloat(em));em=""}es++}else{if(eo===45){if(et[es-1].valueOf()===101){em+=et[es].toString();es++}else{if(em!==""){eq.push(parseFloat(em))}em=et[es].toString();es++}}else{em+=et[es].toString();es++}}if(es===et.length){er=true}else{eo=et[es].valueOf()}}}if(em!==""){eq.push(parseFloat(em));em=""}d9=et[ep];eo=d9.valueOf();if(eo===77){if(eq.length>=2&&eq.length%2===0){d8=eq[0];d7=eq[1];this.parsePathMoveto(d8,d7);if(eq.length>2){for(ep=2,en=eq.length;ep=2&&eq.length%2===0){d8+=eq[0];d7+=eq[1];this.parsePathMoveto(d8,d7);if(eq.length>2){for(ep=2,en=eq.length;ep=2&&eq.length%2===0){for(ep=0,en=eq.length;ep=2&&eq.length%2===0){for(ep=0,en=eq.length;ep=6&&eq.length%6===0){for(ep=0,en=eq.length;ep=6&&eq.length%6===0){for(ep=0,en=eq.length;ep=4&&eq.length%4===0){for(ep=0,en=eq.length;ep=4&&eq.length%4===0){for(ep=0,en=eq.length;ep=4&&eq.length%4===0){for(ep=0,en=eq.length;ep=4&&eq.length%4===0){for(ep=0,en=eq.length;ep=2&&eq.length%2===0){for(ep=0,en=eq.length;ep=2&&eq.length%2===0){for(ep=0,en=eq.length;ep0){this.parsePathCode(1);this.parsePathVertex(d7+(d5-d7)*2/3,d9+(ea-d9)*2/3);this.parsePathVertex(d6+(d5-d6)*2/3,d8+(ea-d8)*2/3);this.parsePathVertex(d6,d8)}else{throw"Path must start with M/m"}};cm.prototype.parsePathCurveto=function(d8,ea,d6,d9,d5,d7){if(this.vertices.length>0){this.parsePathCode(1);this.parsePathVertex(d8,ea);this.parsePathVertex(d6,d9);this.parsePathVertex(d5,d7)}else{throw"Path must start with M/m"}};cm.prototype.parsePathLineto=function(d6,d5){if(this.vertices.length>0){this.parsePathCode(0);this.parsePathVertex(d6,d5);this.vertices[this.vertices.length-1]["moveTo"]=false}else{throw"Path must start with M/m"}};cm.prototype.parsePathMoveto=function(d6,d5){if(this.vertices.length>0){this.parsePathCode(3)}this.parsePathCode(0);this.parsePathVertex(d6,d5);this.vertices[this.vertices.length-1]["moveTo"]=true};cm.prototype.parsePathVertex=function(d5,d7){var d6=[];d6[0]=d5;d6[1]=d7;this.vertices.push(d6)};cm.prototype.parsePathCode=function(d5){this.vertexCodes.push(d5)};cm.prototype.parsePoly=function(d9){this.family=21;this.close=d9;var d6=cR.trim(this.element.getStringAttribute("points").replace(/[,\s]+/g," "));if(d6!==null){var d5=d6.split(" ");if(d5.length%2===0){for(var d8=0,d7=d5.length;d8"}};cm.prototype.parseEllipse=function(d7){this.kind=31;this.family=1;this.params=[];this.params[0]=this.element.getFloatAttribute("cx")|0;this.params[1]=this.element.getFloatAttribute("cy")|0;var d6,d5;if(d7){d6=d5=this.element.getFloatAttribute("r");if(d6<0){throw"svg error: negative radius found while parsing "}}else{d6=this.element.getFloatAttribute("rx");d5=this.element.getFloatAttribute("ry");if(d6<0||d5<0){throw"svg error: negative x-axis radius or y-axis radius found while parsing "}}this.params[0]-=d6;this.params[1]-=d5;this.params[2]=d6*2;this.params[3]=d5*2};cm.prototype.parseLine=function(){this.kind=4;this.family=1;this.params=[];this.params[0]=this.element.getFloatAttribute("x1");this.params[1]=this.element.getFloatAttribute("y1");this.params[2]=this.element.getFloatAttribute("x2");this.params[3]=this.element.getFloatAttribute("y2")};cm.prototype.parseColors=function(d7){if(d7.hasAttribute("opacity")){this.setOpacity(d7.getAttribute("opacity"))}if(d7.hasAttribute("stroke")){this.setStroke(d7.getAttribute("stroke"))}if(d7.hasAttribute("stroke-width")){this.setStrokeWeight(d7.getAttribute("stroke-width"))}if(d7.hasAttribute("stroke-linejoin")){this.setStrokeJoin(d7.getAttribute("stroke-linejoin"))}if(d7.hasAttribute("stroke-linecap")){this.setStrokeCap(d7.getStringAttribute("stroke-linecap"))}if(d7.hasAttribute("fill")){this.setFill(d7.getStringAttribute("fill"))}if(d7.hasAttribute("style")){var ea=d7.getStringAttribute("style");var d8=ea.toString().split(";");for(var d6=0,d5=d8.length;d6=1&&arguments[0]!==null){if(d7.isVisible()){cR.pushMatrix();if(N===3){if(arguments.length===5){cR.translate(d6-d8/2,d9-d5/2);cR.scale(d8/d7.getWidth(),d5/d7.getHeight())}else{if(arguments.length===3){cR.translate(d6-d7.getWidth()/2,-d7.getHeight()/2)}else{cR.translate(-d7.getWidth()/2,-d7.getHeight()/2)}}}else{if(N===0){if(arguments.length===5){cR.translate(d6,d9);cR.scale(d8/d7.getWidth(),d5/d7.getHeight())}else{if(arguments.length===3){cR.translate(d6,d9)}}}else{if(N===1){if(arguments.length===5){d8-=d6;d5-=d9;cR.translate(d6,d9);cR.scale(d8/d7.getWidth(),d5/d7.getHeight())}else{if(arguments.length===3){cR.translate(d6,d9)}}}}}d7.draw(cR);if(arguments.length===1&&N===3||arguments.length>1){cR.popMatrix()}}}};cR.shapeMode=function(d5){N=d5};cR.loadShape=function(d5){if(arguments.length===1){if(d5.indexOf(".svg")>-1){return new cm(null,d5)}}return null};var cO=function(d9,d8,d5,d6,d7){this.fullName=d9||"";this.name=d8||"";this.namespace=d5||"";this.value=d6;this.type=d7};cO.prototype={getName:function(){return this.name},getFullName:function(){return this.fullName},getNamespace:function(){return this.namespace},getValue:function(){return this.value},getType:function(){return this.type},setValue:function(d5){this.value=d5}};var b4=cR.XMLElement=function(d5,d7,d8,d6){this.attributes=[];this.children=[];this.fullName=null;this.name=null;this.namespace="";this.content=null;this.parent=null;this.lineNr="";this.systemID="";this.type="ELEMENT";if(d5){if(typeof d5==="string"){if(d7===d&&d5.indexOf("<")>-1){this.parse(d5)}else{this.fullName=d5;this.namespace=d7;this.systemId=d8;this.lineNr=d6}}else{this.parse(d7)}}};b4.prototype={parse:function(d5){var d7;try{var d9=d5.substring(d5.length-4);if(d9===".xml"||d9===".svg"){d5=s(d5)}d7=(new DOMParser).parseFromString(d5,"text/xml");var d6=d7.documentElement;if(d6){this.parseChildrenRecursive(null,d6)}else{throw"Error loading document"}return this}catch(d8){throw d8}},parseChildrenRecursive:function(ed,eb){var ea,d6,ec,d9,d8,d5;if(!ed){this.fullName=eb.localName;this.name=eb.nodeName;ea=this}else{ea=new b4(eb.nodeName);ea.parent=ed}if(eb.nodeType===3&&eb.textContent!==""){return this.createPCDataElement(eb.textContent)}if(eb.nodeType===4){return this.createCDataElement(eb.textContent)}if(eb.attributes){for(d9=0,d8=eb.attributes.length;d9":">","'":"'",'"':"""},d5;for(d5 in d6){if(!Object.hasOwnProperty(d6,d5)){d7=d7.replace(new RegExp(d5,"g"),d6[d5])}}d8.cdata=d7;return d8},hasAttribute:function(){if(arguments.length===1){return this.getAttribute(arguments[0])!==null}if(arguments.length===2){return this.getAttribute(arguments[0],arguments[1])!==null}},equals:function(ea){if(!(ea instanceof b4)){return false}var d7,d6;if(this.fullName!==ea.fullName){return false}if(this.attributes.length!==ea.getAttributeCount()){return false}if(this.attributes.length!==ea.attributes.length){return false}var ee,ec,d5,eb,ed;for(d7=0,d6=this.attributes.length;d70){var d9,d8;for(d7=0,d6=this.children.length;d70},addChild:function(d5){if(d5!==null){d5.parent=this;this.children.push(d5)}},insertChild:function(d7,d5){if(d7){if(d7.getLocalName()===null&&!this.hasChildren()){var d6=this.children[this.children.length-1];if(d6.getLocalName()===null){d6.setContent(d6.getContent()+d7.getContent());return}}d7.parent=this;this.children.splice(d5,0,d7)}},getChild:function(d6){if(typeof d6==="number"){return this.children[d6]}if(d6.indexOf("/")!==-1){return this.getChildRecursive(d6.split("/"),0)}var d5,d9;for(var d8=0,d7=this.getChildCount();d8d5){this.children.splice(d5,1)}},findAttribute:function(d6,d8){this.namespace=d8||"";for(var d7=0,d5=this.attributes.length;d70){D.debug("Tried to set content for XMLElement with children")}this.content=d5},setName:function(){if(arguments.length===1){this.name=arguments[0];this.fullName=arguments[0];this.namespace=null}else{var d5=arguments[0].indexOf(":");if(arguments[1]===null||d5<0){this.name=arguments[0]}else{this.name=arguments[0].substring(d5+1)}this.fullName=arguments[0];this.namespace=arguments[1]}},getName:function(){return this.fullName},getLocalName:function(){return this.name},getAttributeCount:function(){return this.attributes.length},toString:function(){if(this.type==="TEXT"){return this.content}if(this.type==="CDATA"){return this.cdata}var d7=this.fullName;var d8="<"+d7;var d6,d9;for(d6=0;d6"}else{d8+=">"+this.content+""}}else{d8+=">";for(d9=0;d9"}return d8}};b4.parse=function(d6){var d5=new b4;d5.parse(d6);return d5};var db=cR.XML=cR.XMLElement;cR.loadXML=function(d5){return new db(cR,d5)};var ch=function(d8){var d5=0;for(var d6=0;d6-2147483648){var d6=this.elements[0];var eb=this.elements[1];var d9=this.elements[2];var d8=this.elements[3];var d7=this.elements[4];var d5=this.elements[5];this.elements[0]=d7/ea;this.elements[3]=-d8/ea;this.elements[1]=-eb/ea;this.elements[4]=d6/ea;this.elements[2]=(eb*d5-d7*d9)/ea;this.elements[5]=(d8*d9-d6*d5)/ea;return true}return false},scale:function(d6,d5){if(d6&&!d5){d5=d6}if(d6&&d5){this.elements[0]*=d6;this.elements[1]*=d5;this.elements[3]*=d6;this.elements[4]*=d5}},invScale:function(d6,d5){if(d6&&!d5){d5=d6}this.scale(1/d6,1/d5)},apply:function(){var d7;if(arguments.length===1&&arguments[0] instanceof aS){d7=arguments[0].array()}else{if(arguments.length===6){d7=Array.prototype.slice.call(arguments)}else{if(arguments.length===1&&arguments[0] instanceof Array){d7=arguments[0]}}}var d5=[0,0,this.elements[2],0,0,this.elements[5]];var d8=0;for(var d9=0;d9<2;d9++){for(var d6=0;d6<3;d6++,d8++){d5[d8]+=this.elements[d9*3+0]*d7[d6+0]+this.elements[d9*3+1]*d7[d6+3]}}this.elements=d5.slice()},preApply:function(){var d6;if(arguments.length===1&&arguments[0] instanceof aS){d6=arguments[0].array()}else{if(arguments.length===6){d6=Array.prototype.slice.call(arguments)}else{if(arguments.length===1&&arguments[0] instanceof Array){d6=arguments[0]}}}var d5=[0,0,d6[2],0,0,d6[5]];d5[2]=d6[2]+this.elements[2]*d6[0]+this.elements[5]*d6[1];d5[5]=d6[5]+this.elements[2]*d6[3]+this.elements[5]*d6[4];d5[0]=this.elements[0]*d6[0]+this.elements[3]*d6[1];d5[3]=this.elements[0]*d6[3]+this.elements[3]*d6[4];d5[1]=this.elements[1]*d6[0]+this.elements[4]*d6[1];d5[4]=this.elements[1]*d6[3]+this.elements[4]*d6[4];this.elements=d5.slice()},rotate:function(d7){var d9=p.cos(d7);var d5=p.sin(d7);var d8=this.elements[0];var d6=this.elements[1];this.elements[0]=d9*d8+d5*d6;this.elements[1]=-d5*d8+d9*d6;d8=this.elements[3];d6=this.elements[4];this.elements[3]=d9*d8+d5*d6;this.elements[4]=-d5*d8+d9*d6},rotateZ:function(d5){this.rotate(d5)},invRotateZ:function(d5){this.rotateZ(d5-p.PI)},print:function(){var d6=ch(this.elements);var d5=""+cR.nfs(this.elements[0],d6,4)+" "+cR.nfs(this.elements[1],d6,4)+" "+cR.nfs(this.elements[2],d6,4)+"\n"+cR.nfs(this.elements[3],d6,4)+" "+cR.nfs(this.elements[4],d6,4)+" "+cR.nfs(this.elements[5],d6,4)+"\n\n";cR.println(d5)}};var aK=cR.PMatrix3D=function(){this.reset()};aK.prototype={set:function(){if(arguments.length===16){this.elements=Array.prototype.slice.call(arguments)}else{if(arguments.length===1&&arguments[0] instanceof aK){this.elements=arguments[0].array()}else{if(arguments.length===1&&arguments[0] instanceof Array){this.elements=arguments[0].slice()}}}},get:function(){var d5=new aK;d5.set(this.elements);return d5},reset:function(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},array:function az(){return this.elements.slice()},translate:function(d6,d5,d7){if(d7===d){d7=0}this.elements[3]+=d6*this.elements[0]+d5*this.elements[1]+d7*this.elements[2];this.elements[7]+=d6*this.elements[4]+d5*this.elements[5]+d7*this.elements[6];this.elements[11]+=d6*this.elements[8]+d5*this.elements[9]+d7*this.elements[10];this.elements[15]+=d6*this.elements[12]+d5*this.elements[13]+d7*this.elements[14]},transpose:function(){var d5=this.elements[4];this.elements[4]=this.elements[1];this.elements[1]=d5;d5=this.elements[8];this.elements[8]=this.elements[2];this.elements[2]=d5;d5=this.elements[6];this.elements[6]=this.elements[9];this.elements[9]=d5;d5=this.elements[3];this.elements[3]=this.elements[12];this.elements[12]=d5;d5=this.elements[7];this.elements[7]=this.elements[13];this.elements[13]=d5;d5=this.elements[11];this.elements[11]=this.elements[14];this.elements[14]=d5},mult:function(d7,d8){var d5,ea,d9,d6;if(d7 instanceof l){d5=d7.x;ea=d7.y;d9=d7.z;d6=1;if(!d8){d8=new l}}else{if(d7 instanceof Array){d5=d7[0];ea=d7[1];d9=d7[2];d6=d7[3]||1;if(!d8||d8.length!==3&&d8.length!==4){d8=[0,0,0]}}}if(d8 instanceof Array){if(d8.length===3){d8[0]=this.elements[0]*d5+this.elements[1]*ea+this.elements[2]*d9+this.elements[3];d8[1]=this.elements[4]*d5+this.elements[5]*ea+this.elements[6]*d9+this.elements[7];d8[2]=this.elements[8]*d5+this.elements[9]*ea+this.elements[10]*d9+this.elements[11]}else{if(d8.length===4){d8[0]=this.elements[0]*d5+this.elements[1]*ea+this.elements[2]*d9+this.elements[3]*d6;d8[1]=this.elements[4]*d5+this.elements[5]*ea+this.elements[6]*d9+this.elements[7]*d6;d8[2]=this.elements[8]*d5+this.elements[9]*ea+this.elements[10]*d9+this.elements[11]*d6;d8[3]=this.elements[12]*d5+this.elements[13]*ea+this.elements[14]*d9+this.elements[15]*d6}}}if(d8 instanceof l){d8.x=this.elements[0]*d5+this.elements[1]*ea+this.elements[2]*d9+this.elements[3];d8.y=this.elements[4]*d5+this.elements[5]*ea+this.elements[6]*d9+this.elements[7];d8.z=this.elements[8]*d5+this.elements[9]*ea+this.elements[10]*d9+this.elements[11]}return d8},preApply:function(){var d7;if(arguments.length===1&&arguments[0] instanceof aK){d7=arguments[0].array()}else{if(arguments.length===16){d7=Array.prototype.slice.call(arguments)}else{if(arguments.length===1&&arguments[0] instanceof Array){d7=arguments[0]}}}var d5=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var d8=0;for(var d9=0;d9<4;d9++){for(var d6=0;d6<4;d6++,d8++){d5[d8]+=this.elements[d6+0]*d7[d9*4+0]+this.elements[d6+4]*d7[d9*4+1]+this.elements[d6+8]*d7[d9*4+2]+this.elements[d6+12]*d7[d9*4+3]}}this.elements=d5.slice()},apply:function(){var d7;if(arguments.length===1&&arguments[0] instanceof aK){d7=arguments[0].array()}else{if(arguments.length===16){d7=Array.prototype.slice.call(arguments)}else{if(arguments.length===1&&arguments[0] instanceof Array){d7=arguments[0]}}}var d5=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var d8=0;for(var d9=0;d9<4;d9++){for(var d6=0;d6<4;d6++,d8++){d5[d8]+=this.elements[d9*4+0]*d7[d6+0]+this.elements[d9*4+1]*d7[d6+4]+this.elements[d9*4+2]*d7[d6+8]+this.elements[d9*4+3]*d7[d6+12]}}this.elements=d5.slice()},rotate:function(d9,d5,eb,d8){if(!eb){this.rotateZ(d9)}else{var ea=cR.cos(d9);var d7=cR.sin(d9);var d6=1-ea;this.apply(d6*d5*d5+ea,d6*d5*eb-d7*d8,d6*d5*d8+d7*eb,0,d6*d5*eb+d7*d8,d6*eb*eb+ea,d6*eb*d8-d7*d5,0,d6*d5*d8-d7*eb,d6*eb*d8+d7*d5,d6*d8*d8+ea,0,0,0,0,1)}},invApply:function(){if(W===d){W=new aK}var d5=arguments;W.set(d5[0],d5[1],d5[2],d5[3],d5[4],d5[5],d5[6],d5[7],d5[8],d5[9],d5[10],d5[11],d5[12],d5[13],d5[14],d5[15]);if(!W.invert()){return false}this.preApply(W);return true},rotateX:function(d6){var d7=cR.cos(d6);var d5=cR.sin(d6);this.apply([1,0,0,0,0,d7,-d5,0,0,d5,d7,0,0,0,0,1])},rotateY:function(d6){var d7=cR.cos(d6);var d5=cR.sin(d6);this.apply([d7,0,d5,0,0,1,0,0,-d5,0,d7,0,0,0,0,1])},rotateZ:function(d6){var d7=p.cos(d6);var d5=p.sin(d6);this.apply([d7,-d5,0,0,d5,d7,0,0,0,0,1,0,0,0,0,1])},scale:function(d7,d6,d5){if(d7&&!d6&&!d5){d6=d5=d7}else{if(d7&&d6&&!d5){d5=1}}if(d7&&d6&&d5){this.elements[0]*=d7;this.elements[1]*=d6;this.elements[2]*=d5;this.elements[4]*=d7;this.elements[5]*=d6;this.elements[6]*=d5;this.elements[8]*=d7;this.elements[9]*=d6;this.elements[10]*=d5;this.elements[12]*=d7;this.elements[13]*=d6;this.elements[14]*=d5}},skewX:function(d6){var d5=p.tan(d6);this.apply(1,d5,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},skewY:function(d6){var d5=p.tan(d6);this.apply(1,0,0,0,d5,1,0,0,0,0,1,0,0,0,0,1)},shearX:function(d6){var d5=p.tan(d6);this.apply(1,d5,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},shearY:function(d6){var d5=p.tan(d6);this.apply(1,0,0,0,d5,1,0,0,0,0,1,0,0,0,0,1)},multX:function(d5,d8,d7,d6){if(!d7){return this.elements[0]*d5+this.elements[1]*d8+this.elements[3]}if(!d6){return this.elements[0]*d5+this.elements[1]*d8+this.elements[2]*d7+this.elements[3]}return this.elements[0]*d5+this.elements[1]*d8+this.elements[2]*d7+this.elements[3]*d6},multY:function(d5,d8,d7,d6){if(!d7){return this.elements[4]*d5+this.elements[5]*d8+this.elements[7]}if(!d6){return this.elements[4]*d5+this.elements[5]*d8+this.elements[6]*d7+this.elements[7]}return this.elements[4]*d5+this.elements[5]*d8+this.elements[6]*d7+this.elements[7]*d6},multZ:function(d5,d8,d7,d6){if(!d6){return this.elements[8]*d5+this.elements[9]*d8+this.elements[10]*d7+this.elements[11]}return this.elements[8]*d5+this.elements[9]*d8+this.elements[10]*d7+this.elements[11]*d6},multW:function(d5,d8,d7,d6){if(!d6){return this.elements[12]*d5+this.elements[13]*d8+this.elements[14]*d7+this.elements[15]}return this.elements[12]*d5+this.elements[13]*d8+this.elements[14]*d7+this.elements[15]*d6},invert:function(){var ee=this.elements[0]*this.elements[5]-this.elements[1]*this.elements[4];var ed=this.elements[0]*this.elements[6]-this.elements[2]*this.elements[4];var ec=this.elements[0]*this.elements[7]-this.elements[3]*this.elements[4];var eb=this.elements[1]*this.elements[6]-this.elements[2]*this.elements[5];var ea=this.elements[1]*this.elements[7]-this.elements[3]*this.elements[5];var d9=this.elements[2]*this.elements[7]-this.elements[3]*this.elements[6];var d8=this.elements[8]*this.elements[13]-this.elements[9]*this.elements[12];var d7=this.elements[8]*this.elements[14]-this.elements[10]*this.elements[12];var d6=this.elements[8]*this.elements[15]-this.elements[11]*this.elements[12];var ej=this.elements[9]*this.elements[14]-this.elements[10]*this.elements[13];var eh=this.elements[9]*this.elements[15]-this.elements[11]*this.elements[13];var eg=this.elements[10]*this.elements[15]-this.elements[11]*this.elements[14];var ei=ee*eg-ed*eh+ec*ej+eb*d6-ea*d7+d9*d8;if(p.abs(ei)<=1e-9){return false}var ef=[];ef[0]=+this.elements[5]*eg-this.elements[6]*eh+this.elements[7]*ej;ef[4]=-this.elements[4]*eg+this.elements[6]*d6-this.elements[7]*d7;ef[8]=+this.elements[4]*eh-this.elements[5]*d6+this.elements[7]*d8;ef[12]=-this.elements[4]*ej+this.elements[5]*d7-this.elements[6]*d8;ef[1]=-this.elements[1]*eg+this.elements[2]*eh-this.elements[3]*ej;ef[5]=+this.elements[0]*eg-this.elements[2]*d6+this.elements[3]*d7;ef[9]=-this.elements[0]*eh+this.elements[1]*d6-this.elements[3]*d8;ef[13]=+this.elements[0]*ej-this.elements[1]*d7+this.elements[2]*d8;ef[2]=+this.elements[13]*d9-this.elements[14]*ea+this.elements[15]*eb;ef[6]=-this.elements[12]*d9+this.elements[14]*ec-this.elements[15]*ed;ef[10]=+this.elements[12]*ea-this.elements[13]*ec+this.elements[15]*ee;ef[14]=-this.elements[12]*eb+this.elements[13]*ed-this.elements[14]*ee;ef[3]=-this.elements[9]*d9+this.elements[10]*ea-this.elements[11]*eb;ef[7]=+this.elements[8]*d9-this.elements[10]*ec+this.elements[11]*ed;ef[11]=-this.elements[8]*ea+this.elements[9]*ec-this.elements[11]*ee;ef[15]=+this.elements[8]*eb-this.elements[9]*ed+this.elements[10]*ee;var d5=1/ei;ef[0]*=d5;ef[1]*=d5;ef[2]*=d5;ef[3]*=d5;ef[4]*=d5;ef[5]*=d5;ef[6]*=d5;ef[7]*=d5;ef[8]*=d5;ef[9]*=d5;ef[10]*=d5;ef[11]*=d5;ef[12]*=d5;ef[13]*=d5;ef[14]*=d5;ef[15]*=d5;this.elements=ef.slice();return true},toString:function(){var d6="";for(var d5=0;d5<15;d5++){d6+=this.elements[d5]+", "}d6+=this.elements[15];return d6},print:function(){var d6=ch(this.elements);var d5=""+cR.nfs(this.elements[0],d6,4)+" "+cR.nfs(this.elements[1],d6,4)+" "+cR.nfs(this.elements[2],d6,4)+" "+cR.nfs(this.elements[3],d6,4)+"\n"+cR.nfs(this.elements[4],d6,4)+" "+cR.nfs(this.elements[5],d6,4)+" "+cR.nfs(this.elements[6],d6,4)+" "+cR.nfs(this.elements[7],d6,4)+"\n"+cR.nfs(this.elements[8],d6,4)+" "+cR.nfs(this.elements[9],d6,4)+" "+cR.nfs(this.elements[10],d6,4)+" "+cR.nfs(this.elements[11],d6,4)+"\n"+cR.nfs(this.elements[12],d6,4)+" "+cR.nfs(this.elements[13],d6,4)+" "+cR.nfs(this.elements[14],d6,4)+" "+cR.nfs(this.elements[15],d6,4)+"\n\n";cR.println(d5)},invTranslate:function(d6,d5,d7){this.preApply(1,0,0,-d6,0,1,0,-d5,0,0,1,-d7,0,0,0,1)},invRotateX:function(d6){var d7=p.cos(-d6);var d5=p.sin(-d6);this.preApply([1,0,0,0,0,d7,-d5,0,0,d5,d7,0,0,0,0,1])},invRotateY:function(d6){var d7=p.cos(-d6);var d5=p.sin(-d6);this.preApply([d7,0,d5,0,0,1,0,0,-d5,0,d7,0,0,0,0,1])},invRotateZ:function(d6){var d7=p.cos(-d6);var d5=p.sin(-d6);this.preApply([d7,-d5,0,0,d5,d7,0,0,0,0,1,0,0,0,0,1])},invScale:function(d5,d7,d6){this.preApply([1/d5,0,0,0,0,1/d7,0,0,0,0,1/d6,0,0,0,0,1])}};var Q=cR.PMatrixStack=function(){this.matrixStack=[]};Q.prototype.load=function(){var d5=dT.$newPMatrix();if(arguments.length===1){d5.set(arguments[0])}else{d5.set(arguments)}this.matrixStack.push(d5)};bM.prototype.$newPMatrix=function(){return new aS};bw.prototype.$newPMatrix=function(){return new aK};Q.prototype.push=function(){this.matrixStack.push(this.peek())};Q.prototype.pop=function(){return this.matrixStack.pop()};Q.prototype.peek=function(){var d5=dT.$newPMatrix();d5.set(this.matrixStack[this.matrixStack.length-1]);return d5};Q.prototype.mult=function(d5){this.matrixStack[this.matrixStack.length-1].apply(d5)};cR.split=function(d6,d5){return d6.split(d5)};cR.splitTokens=function(eb,ea){if(ea===d){return eb.split(/\s+/g)}var d8=ea.split(/()/g),d6="",d5=eb.length,d7,ec,d9=[];for(d7=0;d7-1){if(d6!==""){d9.push(d6)}d6=""}else{d6+=ec}}if(d6!==""){d9.push(d6)}return d9};cR.append=function(d6,d5){d6[d6.length]=d5;return d6};cR.concat=function(d6,d5){return d6.concat(d5)};cR.sort=function(ea,d8){var d6=[];if(ea.length>0){var d9=d8>0?d8:ea.length;for(var d7=0;d70){for(var d5=d6.length;d5>8)};cR.peg=function(d5){return d5<0?0:d5>255?255:d5};cR.modes=function(){var ea=4278190080,d7=16711680,d6=65280,d9=255,d8=p.min,d5=p.max;function eb(eg,ej,ef,eo,eq,ep,eh,el,ek,ed,ee){var en=d8(((eg&4278190080)>>>24)+ej,255)<<24;var ec=ef+((ek-ef)*ej>>8);ec=(ec<0?0:ec>255?255:ec)<<16;var ei=eo+((ed-eo)*ej>>8);ei=(ei<0?0:ei>255?255:ei)<<8;var em=eq+((ee-eq)*ej>>8);em=em<0?0:em>255?255:em;return en|ec|ei|em}return{replace:function(ed,ec){return ec},blend:function(ee,ed){var eg=(ed&ea)>>>24,ec=ee&d7,ei=ee&d6,ek=ee&d9,ej=ed&d7,ef=ed&d6,eh=ed&d9;return d8(((ee&ea)>>>24)+eg,255)<<24|ec+((ej-ec)*eg>>8)&d7|ei+((ef-ei)*eg>>8)&d6|ek+((eh-ek)*eg>>8)&d9},add:function(ed,ec){var ee=(ec&ea)>>>24;return d8(((ed&ea)>>>24)+ee,255)<<24|d8((ed&d7)+((ec&d7)>>8)*ee,d7)&d7|d8((ed&d6)+((ec&d6)>>8)*ee,d6)&d6|d8((ed&d9)+((ec&d9)*ee>>8),d9)},subtract:function(ed,ec){var ee=(ec&ea)>>>24;return d8(((ed&ea)>>>24)+ee,255)<<24|d5((ed&d7)-((ec&d7)>>8)*ee,d6)&d7|d5((ed&d6)-((ec&d6)>>8)*ee,d9)&d6|d5((ed&d9)-((ec&d9)*ee>>8),0)},lightest:function(ed,ec){var ee=(ec&ea)>>>24;return d8(((ed&ea)>>>24)+ee,255)<<24|d5(ed&d7,((ec&d7)>>8)*ee)&d7|d5(ed&d6,((ec&d6)>>8)*ee)&d6|d5(ed&d9,(ec&d9)*ee>>8)},darkest:function(ee,ed){var eg=(ed&ea)>>>24,ec=ee&d7,ei=ee&d6,ek=ee&d9,ej=d8(ee&d7,((ed&d7)>>8)*eg),ef=d8(ee&d6,((ed&d6)>>8)*eg),eh=d8(ee&d9,(ed&d9)*eg>>8);return d8(((ee&ea)>>>24)+eg,255)<<24|ec+((ej-ec)*eg>>8)&d7|ei+((ef-ei)*eg>>8)&d6|ek+((eh-ek)*eg>>8)&d9},difference:function(eg,ef){var ei=(ef&ea)>>>24,ee=(eg&d7)>>16,el=(eg&d6)>>8,en=eg&d9,em=(ef&d7)>>16,eh=(ef&d6)>>8,ek=ef&d9,ej=ee>em?ee-em:em-ee,ec=el>eh?el-eh:eh-el,ed=en>ek?en-ek:ek-en;return eb(eg,ei,ee,el,en,em,eh,ek,ej,ec,ed)},exclusion:function(eg,ef){var ei=(ef&ea)>>>24,ee=(eg&d7)>>16,el=(eg&d6)>>8,en=eg&d9,em=(ef&d7)>>16,eh=(ef&d6)>>8,ek=ef&d9,ej=ee+em-(ee*em>>7),ec=el+eh-(el*eh>>7),ed=en+ek-(en*ek>>7);return eb(eg,ei,ee,el,en,em,eh,ek,ej,ec,ed)},multiply:function(eg,ef){var ei=(ef&ea)>>>24,ee=(eg&d7)>>16,el=(eg&d6)>>8,en=eg&d9,em=(ef&d7)>>16,eh=(ef&d6)>>8,ek=ef&d9,ej=ee*em>>8,ec=el*eh>>8,ed=en*ek>>8;return eb(eg,ei,ee,el,en,em,eh,ek,ej,ec,ed)},screen:function(eg,ef){var ei=(ef&ea)>>>24,ee=(eg&d7)>>16,el=(eg&d6)>>8,en=eg&d9,em=(ef&d7)>>16,eh=(ef&d6)>>8,ek=ef&d9,ej=255-((255-ee)*(255-em)>>8),ec=255-((255-el)*(255-eh)>>8),ed=255-((255-en)*(255-ek)>>8);return eb(eg,ei,ee,el,en,em,eh,ek,ej,ec,ed)},hard_light:function(eg,ef){var ei=(ef&ea)>>>24,ee=(eg&d7)>>16,el=(eg&d6)>>8,en=eg&d9,em=(ef&d7)>>16,eh=(ef&d6)>>8,ek=ef&d9,ej=em<128?ee*em>>7:255-((255-ee)*(255-em)>>7),ec=eh<128?el*eh>>7:255-((255-el)*(255-eh)>>7),ed=ek<128?en*ek>>7:255-((255-en)*(255-ek)>>7);return eb(eg,ei,ee,el,en,em,eh,ek,ej,ec,ed)},soft_light:function(eg,ef){var ei=(ef&ea)>>>24,ee=(eg&d7)>>16,el=(eg&d6)>>8,en=eg&d9,em=(ef&d7)>>16,eh=(ef&d6)>>8,ek=ef&d9,ej=(ee*em>>7)+(ee*ee>>8)-(ee*ee*em>>15),ec=(el*eh>>7)+(el*el>>8)-(el*el*eh>>15),ed=(en*ek>>7)+(en*en>>8)-(en*en*ek>>15);return eb(eg,ei,ee,el,en,em,eh,ek,ej,ec,ed)},overlay:function(eg,ef){var ei=(ef&ea)>>>24,ee=(eg&d7)>>16,el=(eg&d6)>>8,en=eg&d9,em=(ef&d7)>>16,eh=(ef&d6)>>8,ek=ef&d9,ej=ee<128?ee*em>>7:255-((255-ee)*(255-em)>>7),ec=el<128?el*eh>>7:255-((255-el)*(255-eh)>>7),ed=en<128?en*ek>>7:255-((255-en)*(255-ek)>>7);return eb(eg,ei,ee,el,en,em,eh,ek,ej,ec,ed)},dodge:function(eg,ef){var ei=(ef&ea)>>>24,ee=(eg&d7)>>16,el=(eg&d6)>>8,en=eg&d9,em=(ef&d7)>>16,eh=(ef&d6)>>8,ek=ef&d9;var ej=255;if(em!==255){ej=(ee<<8)/(255-em);ej=ej<0?0:ej>255?255:ej}var ec=255;if(eh!==255){ec=(el<<8)/(255-eh);ec=ec<0?0:ec>255?255:ec}var ed=255;if(ek!==255){ed=(en<<8)/(255-ek);ed=ed<0?0:ed>255?255:ed}return eb(eg,ei,ee,el,en,em,eh,ek,ej,ec,ed)},burn:function(eg,ef){var ei=(ef&ea)>>>24,ee=(eg&d7)>>16,el=(eg&d6)>>8,en=eg&d9,em=(ef&d7)>>16,eh=(ef&d6)>>8,ek=ef&d9;var ej=0;if(em!==0){ej=(255-ee<<8)/em;ej=255-(ej<0?0:ej>255?255:ej)}var ec=0;if(eh!==0){ec=(255-el<<8)/eh;ec=255-(ec<0?0:ec>255?255:ec)}var ed=0;if(ek!==0){ed=(255-en<<8)/ek;ed=255-(ed<0?0:ed>255?255:ed)}return eb(eg,ei,ee,el,en,em,eh,ek,ej,ec,ed)}}}();function dC(ea,d9,d7,d6){var d5,d8,ec,ed;if(cT===3){var eb=cR.color.toRGB(ea,d9,d7);d5=eb[0];d8=eb[1];ec=eb[2]}else{d5=p.round(255*(ea/bE));d8=p.round(255*(d9/bD));ec=p.round(255*(d7/bB))}ed=p.round(255*(d6/bP));d5=d5<0?0:d5;d8=d8<0?0:d8;ec=ec<0?0:ec;ed=ed<0?0:ed;d5=d5>255?255:d5;d8=d8>255?255:d8;ec=ec>255?255:ec;ed=ed>255?255:ed;return ed<<24&4278190080|d5<<16&16711680|d8<<8&65280|ec&255}function dF(d5,d7){var d6;if(d5&4278190080){d6=p.round(255*(d7/bP));d6=d6>255?255:d6;d6=d6<0?0:d6;return d5-(d5&4278190080)+(d6<<24&4278190080)}if(cT===1){return dC(d5,d5,d5,d7)}if(cT===3){return dC(0,0,d5/bE*bB,d7)}}function dH(d5){if(d5<=bE&&d5>=0){if(cT===1){return dC(d5,d5,d5,bP)}if(cT===3){return dC(0,0,d5/bE*bB,bP)}}if(d5){if(d5>2147483647){d5-=4294967296}return d5}}cR.color=function(d5,d8,d7,d6){if(d5!==d&&d8!==d&&d7!==d&&d6!==d){return dC(d5,d8,d7,d6)}if(d5!==d&&d8!==d&&d7!==d){return dC(d5,d8,d7,bP)}if(d5!==d&&d8!==d){return dF(d5,d8)}if(typeof d5==="number"){return dH(d5)}return dC(bE,bD,bB,bP)};cR.color.toString=function(d5){return"rgba("+(d5>>16&255)+","+(d5>>8&255)+","+(d5&255)+","+(d5>>24&255)/255+")"};cR.color.toInt=function(d8,d7,d5,d6){return d6<<24&4278190080|d8<<16&16711680|d7<<8&65280|d5&255};cR.color.toArray=function(d5){return[d5>>16&255,d5>>8&255,d5&255,d5>>24&255]};cR.color.toGLArray=function(d5){return[(d5>>16&255)/255,(d5>>8&255)/255,(d5&255)/255,(d5>>24&255)/255]};cR.color.toRGB=function(d7,ed,ea){d7=d7>bE?bE:d7;ed=ed>bD?bD:ed;ea=ea>bB?bB:ea;d7=d7/bE*360;ed=ed/bD*100;ea=ea/bB*100;var ec=p.round(ea/100*255);if(ed===0){return[ec,ec,ec]}var d8=d7%360;var d9=d8%60;var d6=p.round(ea*(100-ed)/10000*255);var d5=p.round(ea*(6000-ed*d9)/600000*255);var eb=p.round(ea*(6000-ed*(60-d9))/600000*255);switch(p.floor(d8/60)){case 0:return[ec,eb,d6];case 1:return[d5,ec,d6];case 2:return[d6,ec,eb];case 3:return[d6,d5,ec];case 4:return[eb,d6,ec];case 5:return[ec,d6,d5]}};function aN(ec){var eb,ea,d6;eb=(ec>>16&255)/255;ea=(ec>>8&255)/255;d6=(ec&255)/255;var d5=cR.max(cR.max(eb,ea),d6),d8=cR.min(cR.min(eb,ea),d6),d7,d9;if(d8===d5){return[0,0,d5*bB]}d9=(d5-d8)/d5;if(eb===d5){d7=(ea-d6)/(d5-d8)}else{if(ea===d5){d7=2+(d6-eb)/(d5-d8)}else{d7=4+(eb-ea)/(d5-d8)}}d7/=6;if(d7<0){d7+=1}else{if(d7>1){d7-=1}}return[d7*bE,d9*bD,d5*bB]}cR.brightness=function(d5){return aN(d5)[2]};cR.saturation=function(d5){return aN(d5)[1]};cR.hue=function(d5){return aN(d5)[0]};cR.red=function(d5){return(d5>>16&255)/255*bE};cR.green=function(d5){return(d5>>8&255)/255*bD};cR.blue=function(d5){return(d5&255)/255*bB};cR.alpha=function(d5){return(d5>>24&255)/255*bP};cR.lerpColor=function(eh,eg,ea){var ef,el,em,en,ej,d5,eb,ep,ei,eq,d9,eo;var ed,ec,d6,ek,ee;var d8=cR.color(eh);var d7=cR.color(eg);if(cT===3){ed=aN(d8);ep=(d8>>24&255)/bP;ec=aN(d7);eo=(d7>>24&255)/bP;ek=cR.lerp(ed[0],ec[0],ea);ee=cR.lerp(ed[1],ec[1],ea);em=cR.lerp(ed[2],ec[2],ea);d6=cR.color.toRGB(ek,ee,em);en=cR.lerp(ep,eo,ea)*bP;return en<<24&4278190080|(d6[0]&255)<<16|(d6[1]&255)<<8|d6[2]&255}ej=d8>>16&255;d5=d8>>8&255;eb=d8&255;ep=(d8>>24&255)/bP;ei=d7>>16&255;eq=d7>>8&255;d9=d7&255;eo=(d7>>24&255)/bP;ef=cR.lerp(ej,ei,ea)|0;el=cR.lerp(d5,eq,ea)|0;em=cR.lerp(eb,d9,ea)|0;en=cR.lerp(ep,eo,ea)*bP;return en<<24&4278190080|ef<<16&16711680|el<<8&65280|em&255};cR.colorMode=function(){cT=arguments[0];if(arguments.length>1){bE=arguments[1];bD=arguments[2]||arguments[1];bB=arguments[3]||arguments[1];bP=arguments[4]||arguments[1]}};cR.blendColor=function(d6,d5,d7){if(d7===0){return cR.modes.replace(d6,d5)}else{if(d7===1){return cR.modes.blend(d6,d5)}else{if(d7===2){return cR.modes.add(d6,d5)}else{if(d7===4){return cR.modes.subtract(d6,d5)}else{if(d7===8){return cR.modes.lightest(d6,d5)}else{if(d7===16){return cR.modes.darkest(d6,d5)}else{if(d7===32){return cR.modes.difference(d6,d5)}else{if(d7===64){return cR.modes.exclusion(d6,d5)}else{if(d7===128){return cR.modes.multiply(d6,d5)}else{if(d7===256){return cR.modes.screen(d6,d5)}else{if(d7===1024){return cR.modes.hard_light(d6,d5)}else{if(d7===2048){return cR.modes.soft_light(d6,d5)}else{if(d7===512){return cR.modes.overlay(d6,d5)}else{if(d7===4096){return cR.modes.dodge(d6,d5)}else{if(d7===8192){return cR.modes.burn(d6,d5)}}}}}}}}}}}}}}}};function ay(){d3.save()}function cK(){d3.restore();bY=true;al=true}cR.printMatrix=function(){dE.print()};bM.prototype.translate=function(d5,d6){dE.translate(d5,d6);aO.invTranslate(d5,d6);d3.translate(d5,d6)};bw.prototype.translate=function(d5,d7,d6){dE.translate(d5,d7,d6);aO.invTranslate(d5,d7,d6)};bM.prototype.scale=function(d5,d6){dE.scale(d5,d6);aO.invScale(d5,d6);d3.scale(d5,d6||d5)};bw.prototype.scale=function(d5,d7,d6){dE.scale(d5,d7,d6);aO.invScale(d5,d7,d6)};bM.prototype.transform=function(d6){var d5=d6.array();d3.transform(d5[0],d5[3],d5[1],d5[4],d5[2],d5[5])};bw.prototype.transformm=function(d5){throw"p.transform is currently not supported in 3D mode"};bM.prototype.pushMatrix=function(){ah.load(dE);c5.load(aO);ay()};bw.prototype.pushMatrix=function(){ah.load(dE);c5.load(aO)};bM.prototype.popMatrix=function(){dE.set(ah.pop());aO.set(c5.pop());cK()};bw.prototype.popMatrix=function(){dE.set(ah.pop());aO.set(c5.pop())};bM.prototype.resetMatrix=function(){dE.reset();aO.reset();d3.setTransform(1,0,0,1,0,0)};bw.prototype.resetMatrix=function(){dE.reset();aO.reset()};dm.prototype.applyMatrix=function(){var d5=arguments;dE.apply(d5[0],d5[1],d5[2],d5[3],d5[4],d5[5],d5[6],d5[7],d5[8],d5[9],d5[10],d5[11],d5[12],d5[13],d5[14],d5[15]);aO.invApply(d5[0],d5[1],d5[2],d5[3],d5[4],d5[5],d5[6],d5[7],d5[8],d5[9],d5[10],d5[11],d5[12],d5[13],d5[14],d5[15])};bM.prototype.applyMatrix=function(){var d5=arguments;for(var d6=d5.length;d6<16;d6++){d5[d6]=0}d5[10]=d5[15]=1;dm.prototype.applyMatrix.apply(this,d5)};cR.rotateX=function(d5){dE.rotateX(d5);aO.invRotateX(d5)};bM.prototype.rotateZ=function(){throw"rotateZ() is not supported in 2D mode. Use rotate(float) instead."};bw.prototype.rotateZ=function(d5){dE.rotateZ(d5);aO.invRotateZ(d5)};cR.rotateY=function(d5){dE.rotateY(d5);aO.invRotateY(d5)};bM.prototype.rotate=function(d5){dE.rotateZ(d5);aO.invRotateZ(d5);d3.rotate(d5)};bw.prototype.rotate=function(d5){cR.rotateZ(d5)};bM.prototype.shearX=function(d5){dE.shearX(d5);d3.transform(1,0,d5,1,0,0)};bw.prototype.shearX=function(d5){dE.shearX(d5)};bM.prototype.shearY=function(d5){dE.shearY(d5);d3.transform(1,d5,0,1,0,0)};bw.prototype.shearY=function(d5){dE.shearY(d5)};cR.pushStyle=function(){ay();cR.pushMatrix();var d5={doFill:aC,currentFillColor:aW,doStroke:b9,currentStrokeColor:cq,curTint:ba,curRectMode:bF,curColorMode:cT,colorModeX:bE,colorModeZ:bB,colorModeY:bD,colorModeA:bP,curTextFont:R,horizontalTextAlignment:I,verticalTextAlignment:cW,textMode:cD,curFontName:T,curTextSize:dV,curTextAscent:aY,curTextDescent:dv,curTextLeading:d2};bh.push(d5)};cR.popStyle=function(){var d5=bh.pop();if(d5){cK();cR.popMatrix();aC=d5.doFill;aW=d5.currentFillColor;b9=d5.doStroke;cq=d5.currentStrokeColor;ba=d5.curTint;bF=d5.curRectMode;cT=d5.curColorMode;bE=d5.colorModeX;bB=d5.colorModeZ;bD=d5.colorModeY;bP=d5.colorModeA;R=d5.curTextFont;T=d5.curFontName;dV=d5.curTextSize;I=d5.horizontalTextAlignment;cW=d5.verticalTextAlignment;cD=d5.textMode;aY=d5.curTextAscent;dv=d5.curTextDescent;d2=d5.curTextLeading}else{throw"Too many popStyle() without enough pushStyle()"}};cR.year=function(){return(new Date).getFullYear()};cR.month=function(){return(new Date).getMonth()+1};cR.day=function(){return(new Date).getDate()};cR.hour=function(){return(new Date).getHours()};cR.minute=function(){return(new Date).getMinutes()};cR.second=function(){return(new Date).getSeconds()};cR.millis=function(){return Date.now()-dk};function co(){var d5=(Date.now()-dn)/1000;K++;var d6=K/d5;if(d5>0.5){dn=Date.now();K=0;cR.__frameRate=d6}cR.frameCount++}bM.prototype.redraw=function(){co();d3.lineWidth=dR;var d5=cR.pmouseX,d6=cR.pmouseY;cR.pmouseX=dI;cR.pmouseY=d0;ay();cR.draw();cK();dI=cR.mouseX;d0=cR.mouseY;cR.pmouseX=d5;cR.pmouseY=d6};bw.prototype.redraw=function(){co();var d5=cR.pmouseX,d6=cR.pmouseY;cR.pmouseX=dI;cR.pmouseY=d0;d3.clear(d3.DEPTH_BUFFER_BIT);dx={attributes:{},locations:{}};cR.noLights();cR.lightFalloff(1,0,0);cR.shininess(1);cR.ambient(255,255,255);cR.specular(0,0,0);cR.emissive(0,0,0);cR.camera();cR.draw();dI=cR.mouseX;d0=cR.mouseY;cR.pmouseX=d5;cR.pmouseY=d6};cR.noLoop=function(){ax=false;ar=false;clearInterval(bZ);cL.onPause()};cR.loop=function(){if(ar){return}dn=Date.now();K=0;bZ=m.setInterval(function(){try{cL.onFrameStart();cR.redraw();cL.onFrameEnd()}catch(d5){m.clearInterval(bZ);throw d5}},au);ax=true;ar=true;cL.onLoop()};cR.frameRate=function(d5){dP=d5;au=1000/dP;if(ax){cR.noLoop();cR.loop()}};var ao=[];function bJ(d7,d6,d5){if(d7.addEventListener){d7.addEventListener(d6,d5,false)}else{d7.attachEvent("on"+d6,d5)}ao.push({elem:d7,type:d6,fn:d5})}function c9(d5){var d8=d5.elem,d7=d5.type,d6=d5.fn;if(d8.removeEventListener){d8.removeEventListener(d7,d6,false)}else{if(d8.detachEvent){d8.detachEvent("on"+d7,d6)}}}cR.exit=function(){m.clearInterval(bZ);F(cR.externals.canvas.id);delete Z.onmousedown;for(var d6 in D.lib){if(D.lib.hasOwnProperty(d6)){if(D.lib[d6].hasOwnProperty("detach")){D.lib[d6].detach(cR)}}}var d5=ao.length;while(d5--){c9(ao[d5])}cL.onExit()};cR.cursor=function(){if(arguments.length>1||arguments.length===1&&arguments[0] instanceof cR.PImage){var d8=arguments[0],d5,ea;if(arguments.length>=3){d5=arguments[1];ea=arguments[2];if(d5<0||ea<0||ea>=d8.height||d5>=d8.width){throw"x and y must be non-negative and less than the dimensions of the image"}}else{d5=d8.width>>>1;ea=d8.height>>>1}var d6=d8.toDataURL();var d7='url("'+d6+'") '+d5+" "+ea+", default";U=Z.style.cursor=d7}else{if(arguments.length===1){var d9=arguments[0];U=Z.style.cursor=d9}else{U=Z.style.cursor=cf}}};cR.noCursor=function(){U=Z.style.cursor=k.NOCURSOR};cR.link=function(d5,d6){if(d6!==d){m.open(d5,d6)}else{m.location=d5}};cR.beginDraw=i;cR.endDraw=i;bM.prototype.toImageData=function(d5,d8,d6,d7){d5=d5!==d?d5:0;d8=d8!==d?d8:0;d6=d6!==d?d6:cR.width;d7=d7!==d?d7:cR.height;return d3.getImageData(d5,d8,d6,d7)};bw.prototype.toImageData=function(ed,ec,ee,d9){ed=ed!==d?ed:0;ec=ec!==d?ec:0;ee=ee!==d?ee:cR.width;d9=d9!==d?d9:cR.height;var eb=v.createElement("canvas"),ef=eb.getContext("2d"),d8=ef.createImageData(ee,d9),d6=new r(ee*d9*4);d3.readPixels(ed,ec,ee,d9,d3.RGBA,d3.UNSIGNED_BYTE,d6);for(var d7=0,ea=d6.length,d5=d8.data;d70){d8=d7}else{if(d6 instanceof bK){d8=16;d6|=0}else{d8=32;while(d8>1&&!(d6>>>d8-1&1)){d8--}}}var d5="";while(d8>0){d5+=d6>>>--d8&1?"1":"0"}return d5};cR.unbinary=function(d6){var d8=d6.length-1,d7=1,d5=0;while(d8>=0){var d9=d6[d8--];if(d9!=="0"&&d9!=="1"){throw"the value passed into unbinary was not an 8 bit binary number"}if(d9==="1"){d5+=d7}d7<<=1}return d5};function cS(eh,ef,d9,ek,eb,ei){var d7=eh<0?d9:ef;var d6=eb===0;var eg=eb===d||eb<0?0:eb;var ee=p.abs(eh);if(d6){eg=1;ee*=10;while(p.abs(p.round(ee)-ee)>0.000001&&eg<7){++eg;ee*=10}}else{if(eg!==0){ee*=p.pow(10,eg)}}var d8,ed=ee*2;if(p.floor(ee)===ee){d8=ee}else{if(p.floor(ed)===ed){var d5=p.floor(ee);d8=d5+d5%2}else{d8=p.round(ee)}}var ea="";var ej=ek+eg;while(ej>0||d8>0){ej--;ea=""+d8%10+ea;d8=p.floor(d8/10)}if(ei!==d){var ec=ea.length-3-eg;while(ec>0){ea=ea.substring(0,ec)+ei+ea.substring(ec);ec-=3}}if(eg>0){return d7+ea.substring(0,ea.length-eg)+"."+ea.substring(ea.length-eg,ea.length)}return d7+ea}function aj(eb,ea,d5,ed,d6,ec){if(eb instanceof Array){var d8=[];for(var d7=0,d9=eb.length;d7=d6){d5=d5.substring(d5.length-d6,d5.length)}return d5};cR.hex=function(d6,d5){if(arguments.length===1){if(d6 instanceof bK){d5=4}else{d5=8}}return aH(d6,d5)};function dA(d5){var d6=parseInt("0x"+d5,16);if(d6>2147483647){d6-=4294967296}return d6}cR.unhex=function(d7){if(d7 instanceof Array){var d5=[];for(var d6=0;d60?d8:null};cR.__contains=function(d6,d5){if(typeof d6!=="string"){return d6.contains.apply(d6,a7(arguments))}return d6!==null&&d5!==null&&typeof d5==="string"&&d6.indexOf(d5)>-1};cR.__replaceAll=function(d5,d7,d6){if(typeof d5!=="string"){return d5.replaceAll.apply(d5,a7(arguments))}return d5.replace(new RegExp(d7,"g"),d6)};cR.__replaceFirst=function(d5,d7,d6){if(typeof d5!=="string"){return d5.replaceFirst.apply(d5,a7(arguments))}return d5.replace(new RegExp(d7,""),d6)};cR.__replace=function(d8,ea,d9){if(typeof d8!=="string"){return d8.replace.apply(d8,a7(arguments))}if(ea instanceof RegExp){return d8.replace(ea,d9)}if(typeof ea!=="string"){ea=ea.toString()}if(ea===""){return d8}var d7=d8.indexOf(ea);if(d7<0){return d8}var d6=0,d5="";do{d5+=d8.substring(d6,d7)+d9;d6=d7+ea.length}while((d7=d8.indexOf(ea,d6))>=0);return d5+d8.substring(d6)};cR.__equals=function(d6,d5){if(d6.equals instanceof Function){return d6.equals.apply(d6,a7(arguments))}return d6.valueOf()===d5.valueOf()};cR.__equalsIgnoreCase=function(d6,d5){if(typeof d6!=="string"){return d6.equalsIgnoreCase.apply(d6,a7(arguments))}return d6.toLowerCase()===d5.toLowerCase()};cR.__toCharArray=function(d7){if(typeof d7!=="string"){return d7.toCharArray.apply(d7,a7(arguments))}var d8=[];for(var d6=0,d5=d7.length;d6d5.length){return false}return d7===""||d7===d5?true:d5.indexOf(d7)===d6};cR.__endsWith=function(d6,d7){if(typeof d6!=="string"){return d6.endsWith.apply(d6,a7(arguments))}var d5=d7?d7.length:0;return d7===""||d7===d6?true:d6.indexOf(d7)===d6.length-d5};cR.__hashCode=function(d5){if(d5.hashCode instanceof Function){return d5.hashCode.apply(d5,a7(arguments))}return b(d5)};cR.__printStackTrace=function(d5){cR.println("Exception: "+d5.toString())};var d4=[];cR.println=function(d5){var d6=d4.length;if(d6){D.logger.log(d4.join(""));d4.length=0}if(arguments.length===0&&d6===0){D.logger.log("")}else{if(arguments.length!==0){D.logger.log(d5)}}};cR.print=function(d5){d4.push(d5)};cR.str=function(d7){if(d7 instanceof Array){var d5=[];for(var d6=0;d60){var d5=d8.shift();if(d5===d6){return true}if(d5.$interfaces){d8=d8.concat(d5.$interfaces)}}return false}while(d9.hasOwnProperty("$base")){d9=d9.$base;if(d9===d6){return true}}return false};cR.abs=p.abs;cR.ceil=p.ceil;cR.constrain=function(d6,d7,d5){return d6>d5?d5:d60)){throw"Non-empty array is expected"}var d5=d6[0],d8=d6.length;for(var d7=1;d70)){throw"Non-empty array is expected"}var d7=d5[0],d8=d5.length;for(var d6=1;d6d5[d6]){d7=d5[d6]}}return d7};cR.norm=function(d6,d5,d7){return(d6-d5)/(d7-d5)};cR.pow=p.pow;cR.round=p.round;cR.sq=function(d5){return d5*d5};cR.sqrt=p.sqrt;cR.acos=p.acos;cR.asin=p.asin;cR.atan=p.atan;cR.atan2=p.atan2;cR.cos=p.cos;cR.degrees=function(d5){return d5*180/p.PI};cR.radians=function(d5){return d5/180*p.PI};cR.sin=p.sin;cR.tan=p.tan;var bT=p.random;cR.random=function(){if(arguments.length===0){return bT()}if(arguments.length===1){return bT()*arguments[0]}var d6=arguments[0],d5=arguments[1];return bT()*(d5-d6)+d6};function cj(d7,d6){var d9=d7||362436069,d5=d6||521288629;var d8=function(){d9=36969*(d9&65535)+(d9>>>16)&4294967295;d5=18000*(d5&65535)+(d5>>>16)&4294967295;return((d9&65535)<<16|d5&65535)&4294967295};this.nextDouble=function(){var ea=d8()/4294967296;return ea<0?1+ea:ea};this.nextInt=d8}cj.createRandomized=function(){var d5=new Date;return new cj(d5/60000&4294967295,d5&4294967295)};cR.randomSeed=function(d5){bT=(new cj(d5)).nextDouble};cR.Random=function(d5){var d8=false,d6,d7;this.nextGaussian=function(){if(d8){d8=false;return d6}var ec,ea,d9;do{ec=2*d7()-1;ea=2*d7()-1;d9=ec*ec+ea*ea}while(d9>=1||d9===0);var eb=p.sqrt(-2*p.log(d9)/d9);d6=ea*eb;d8=true;return ec*eb};d7=d5===d?p.random:(new cj(d5)).nextDouble};function du(ec){var d6=ec!==d?new cj(ec):cj.createRandomized();var eb,d9;var d8=new r(512);for(eb=0;eb<256;++eb){d8[eb]=eb}for(eb=0;eb<256;++eb){var ee=d8[d9=d6.nextInt()&255];d8[d9]=d8[eb];d8[eb]=ee}for(eb=0;eb<256;++eb){d8[eb+256]=d8[eb]}function d5(ei,ef,el,ek){var ej=ei&15;var eh=ej<8?ef:el,eg=ej<4?el:ej===12||ej===14?ef:ek;return((ej&1)===0?eh:-eh)+((ej&2)===0?eg:-eg)}function ea(eh,ef,ei){var eg=(eh&1)===0?ef:ei;return(eh&2)===0?-eg:eg}function ed(eg,ef){return(eg&1)===0?-ef:ef}function d7(eh,eg,ef){return eg+eh*(ef-eg)}this.noise3d=function(er,eq,ep){var ei=p.floor(er)&255,eg=p.floor(eq)&255,ef=p.floor(ep)&255;er-=p.floor(er);eq-=p.floor(eq);ep-=p.floor(ep);var em=(3-2*er)*er*er,el=(3-2*eq)*eq*eq,ek=(3-2*ep)*ep*ep;var et=d8[ei]+eg,eo=d8[et]+ef,en=d8[et+1]+ef,es=d8[ei+1]+eg,ej=d8[es]+ef,eh=d8[es+1]+ef;return d7(ek,d7(el,d7(em,d5(d8[eo],er,eq,ep),d5(d8[ej],er-1,eq,ep)),d7(em,d5(d8[en],er,eq-1,ep),d5(d8[eh],er-1,eq-1,ep))),d7(el,d7(em,d5(d8[eo+1],er,eq,ep-1),d5(d8[ej+1],er-1,eq,ep-1)),d7(em,d5(d8[en+1],er,eq-1,ep-1),d5(d8[eh+1],er-1,eq-1,ep-1))))};this.noise2d=function(ef,em){var el=p.floor(ef)&255,ej=p.floor(em)&255;ef-=p.floor(ef);em-=p.floor(em);var eh=(3-2*ef)*ef*ef,eg=(3-2*em)*em*em;var ek=d8[el]+ej,ei=d8[el+1]+ej;return d7(eg,d7(eh,ea(d8[ek],ef,em),ea(d8[ei],ef-1,em)),d7(eh,ea(d8[ek+1],ef,em-1),ea(d8[ei+1],ef-1,em-1)))};this.noise1d=function(ef){var eh=p.floor(ef)&255;ef-=p.floor(ef);var eg=(3-2*ef)*ef*ef;return d7(eg,ed(d8[eh],ef),ed(d8[eh+1],ef-1))}}var bR={generator:d,octaves:4,fallout:0.5,seed:d};cR.noise=function(d5,ec,eb){if(bR.generator===d){bR.generator=new du(bR.seed)}var ea=bR.generator;var d9=1,d6=1,d8=0;for(var d7=0;d70){Z.style.removeProperty("width");Z.style.removeProperty("height")}Z.width=cR.width=d6||100;Z.height=cR.height=d9||100;for(var ea in d7){if(d7.hasOwnProperty(ea)){d3[ea]=d7[ea]}}cR.textFont(R);cR.background();bU=p.max(1000,d6*d9*0.05);cR.externals.context=d3;for(var d5=0;d5<720;d5++){ac[d5]=cR.sin(d5*(p.PI/180)*0.5);bg[d5]=cR.cos(d5*(p.PI/180)*0.5)}};bM.prototype.size=function(d5,d7,d6){if(d3===d){d3=Z.getContext("2d");ah=new Q;c5=new Q;dE=new aS;aO=new aS}dm.prototype.size.apply(this,arguments)};bw.prototype.size=function(){var d6=false;return function d5(d8,ea,d9){if(d6){throw"Multiple calls to size() for 3D renders are not allowed."}d6=true;function eb(ed){var eg=["experimental-webgl","webgl","webkit-3d"],ef;for(var ee=0,ec=eg.length;ee>16&255)/255,(d6>>8&255)/255,(d6&255)/255];d3.useProgram(ds);dX("uLights.color.3d."+dG,ds,"uLights"+dG+".color",d7);dX("uLights.position.3d."+dG,ds,"uLights"+dG+".position",eb.array());dU("uLights.type.3d."+dG,ds,"uLights"+dG+".type",0);dU("uLightCount3d",ds,"uLightCount",++dG)};bM.prototype.directionalLight=dm.prototype.a3DOnlyFunction;bw.prototype.directionalLight=function(d5,eb,ed,ec,ea,d9){if(dG===8){throw"can only create "+8+" lights"}d3.useProgram(ds);var ee=new aK;ee.scale(1,-1,1);ee.apply(dE.array());ee=ee.array();var d7=[ee[0]*ec+ee[4]*ea+ee[8]*d9,ee[1]*ec+ee[5]*ea+ee[9]*d9,ee[2]*ec+ee[6]*ea+ee[10]*d9];var d6=dC(d5,eb,ed,0);var d8=[(d6>>16&255)/255,(d6>>8&255)/255,(d6&255)/255];dX("uLights.color.3d."+dG,ds,"uLights"+dG+".color",d8);dX("uLights.position.3d."+dG,ds,"uLights"+dG+".position",d7);dU("uLights.type.3d."+dG,ds,"uLights"+dG+".type",1);dU("uLightCount3d",ds,"uLightCount",++dG)};bM.prototype.lightFalloff=dm.prototype.a3DOnlyFunction;bw.prototype.lightFalloff=function(d6,d5,d7){d3.useProgram(ds);dX("uFalloff3d",ds,"uFalloff",[d6,d5,d7])};bM.prototype.lightSpecular=dm.prototype.a3DOnlyFunction;bw.prototype.lightSpecular=function(d9,d8,d5){var d6=dC(d9,d8,d5,0);var d7=[(d6>>16&255)/255,(d6>>8&255)/255,(d6&255)/255];d3.useProgram(ds);dX("uSpecular3d",ds,"uSpecular",d7)};cR.lights=function(){cR.ambientLight(128,128,128);cR.directionalLight(128,128,128,0,0,-1);cR.lightFalloff(1,0,0);cR.lightSpecular(0,0,0)};bM.prototype.pointLight=dm.prototype.a3DOnlyFunction;bw.prototype.pointLight=function(d5,d8,ed,ee,ea,d9){if(dG===8){throw"can only create "+8+" lights"}var eb=new l(ee,ea,d9);var ec=new aK;ec.scale(1,-1,1);ec.apply(dE.array());ec.mult(eb,eb);var d6=dC(d5,d8,ed,0);var d7=[(d6>>16&255)/255,(d6>>8&255)/255,(d6&255)/255];d3.useProgram(ds);dX("uLights.color.3d."+dG,ds,"uLights"+dG+".color",d7);dX("uLights.position.3d."+dG,ds,"uLights"+dG+".position",eb.array());dU("uLights.type.3d."+dG,ds,"uLights"+dG+".type",2);dU("uLightCount3d",ds,"uLightCount",++dG)};bM.prototype.noLights=dm.prototype.a3DOnlyFunction;bw.prototype.noLights=function(){dG=0;d3.useProgram(ds);dU("uLightCount3d",ds,"uLightCount",dG)};bM.prototype.spotLight=dm.prototype.a3DOnlyFunction;bw.prototype.spotLight=function(d5,ed,ei,ej,eh,ef,ee,ec,ea,d9,eb){if(dG===8){throw"can only create "+8+" lights"}d3.useProgram(ds);var eg=new l(ej,eh,ef);var ek=new aK;ek.scale(1,-1,1);ek.apply(dE.array());ek.mult(eg,eg);ek=ek.array();var d7=[ek[0]*ee+ek[4]*ec+ek[8]*ea,ek[1]*ee+ek[5]*ec+ek[9]*ea,ek[2]*ee+ek[6]*ec+ek[10]*ea];var d6=dC(d5,ed,ei,0);var d8=[(d6>>16&255)/255,(d6>>8&255)/255,(d6&255)/255];dX("uLights.color.3d."+dG,ds,"uLights"+dG+".color",d8);dX("uLights.position.3d."+dG,ds,"uLights"+dG+".position",eg.array());dX("uLights.direction.3d."+dG,ds,"uLights"+dG+".direction",d7);dX("uLights.concentration.3d."+dG,ds,"uLights"+dG+".concentration",eb);dX("uLights.angle.3d."+dG,ds,"uLights"+dG+".angle",d9);dU("uLights.type.3d."+dG,ds,"uLights"+dG+".type",3);dU("uLightCount3d",ds,"uLightCount",++dG)};bM.prototype.beginCamera=function(){throw"beginCamera() is not available in 2D mode"};bw.prototype.beginCamera=function(){if(ak){throw"You cannot call beginCamera() again before calling endCamera()"}ak=true;dE=cc;aO=bQ};bM.prototype.endCamera=function(){throw"endCamera() is not available in 2D mode"};bw.prototype.endCamera=function(){if(!ak){throw"You cannot call endCamera() before calling beginCamera()"}dE.set(bQ);aO.set(cc);ak=false};cR.camera=function(eg,ef,ed,eb,d9,d8,eo,em,ek){if(eg===d){dg=cR.width/2;de=cR.height/2;dd=de/p.tan(cF/2);eg=dg;ef=de;ed=dd;eb=dg;d9=de;d8=0;eo=0;em=1;ek=0}var ea=new l(eg-eb,ef-d9,ed-d8);var ec=new l(eo,em,ek);ea.normalize();var ee=l.cross(ec,ea);ec=l.cross(ea,ee);ee.normalize();ec.normalize();var ep=ee.x,en=ee.y,el=ee.z;var d7=ec.x,d6=ec.y,d5=ec.z;var ej=ea.x,ei=ea.y,eh=ea.z;bQ.set(ep,en,el,0,d7,d6,d5,0,ej,ei,eh,0,0,0,0,1);bQ.translate(-eg,-ef,-ed);cc.reset();cc.invApply(ep,en,el,0,d7,d6,d5,0,ej,ei,eh,0,0,0,0,1);cc.translate(eg,ef,ed);dE.set(bQ);aO.set(cc)};cR.perspective=function(d9,d7,ea,d6){if(arguments.length===0){de=Z.height/2;dd=de/p.tan(cF/2);aV=dd/10;ap=dd*10;b0=cR.width/cR.height;d9=cF;d7=b0;ea=aV;d6=ap}var eb,d5,ec,d8;eb=ea*p.tan(d9/2);d5=-eb;ec=eb*d7;d8=d5*d7;cR.frustum(d8,ec,d5,eb,ea,d6)};bM.prototype.frustum=function(){throw"Processing.js: frustum() is not supported in 2D mode"};bw.prototype.frustum=function(eb,d7,d6,ea,d9,d5){cd=true;c6=new aK;c6.set(2*d9/(d7-eb),0,(d7+eb)/(d7-eb),0,0,2*d9/(ea-d6),(ea+d6)/(ea-d6),0,0,0,-(d5+d9)/(d5-d9),-(2*d5*d9)/(d5-d9),0,0,-1,0);var d8=new aK;d8.set(c6);d8.transpose();d3.useProgram(dL);a4("projection2d",dL,"uProjection",false,d8.array());d3.useProgram(ds);a4("projection3d",ds,"uProjection",false,d8.array());d3.useProgram(bO);a4("uProjectionUS",bO,"uProjection",false,d8.array())};cR.ortho=function(d6,eh,d5,ef,ec,eb){if(arguments.length===0){d6=0;eh=cR.width;d5=0;ef=cR.height;ec=-10;eb=10}var eg=2/(eh-d6);var ee=2/(ef-d5);var ed=-2/(eb-ec);var ea=-(eh+d6)/(eh-d6);var d9=-(ef+d5)/(ef-d5);var d8=-(eb+ec)/(eb-ec);c6=new aK;c6.set(eg,0,0,ea,0,ee,0,d9,0,0,ed,d8,0,0,0,1);var d7=new aK;d7.set(c6);d7.transpose();d3.useProgram(dL);a4("projection2d",dL,"uProjection",false,d7.array());d3.useProgram(ds);a4("projection3d",ds,"uProjection",false,d7.array());d3.useProgram(bO);a4("uProjectionUS",bO,"uProjection",false,d7.array());cd=false};cR.printProjection=function(){c6.print()};cR.printCamera=function(){bQ.print()};bM.prototype.box=dm.prototype.a3DOnlyFunction;bw.prototype.box=function(d7,ea,ec){if(!ea||!ec){ea=ec=d7}var d9=new aK;d9.scale(d7,ea,ec);var d6=new aK;d6.scale(1,-1,1);d6.apply(dE.array());d6.transpose();if(aC){d3.useProgram(ds);a4("model3d",ds,"uModel",false,d9.array());a4("view3d",ds,"uView",false,d6.array());d3.enable(d3.POLYGON_OFFSET_FILL);d3.polygonOffset(1,1);dX("color3d",ds,"uColor",bj);if(dG>0){var d8=new aK;d8.set(d6);var d5=new aK;d5.set(d9);d8.mult(d5);var eb=new aK;eb.set(d8);eb.invert();eb.transpose();a4("uNormalTransform3d",ds,"uNormalTransform",false,eb.array());c7("aNormal3d",ds,"aNormal",3,cE)}else{cb("aNormal3d",ds,"aNormal")}c7("aVertex3d",ds,"aVertex",3,bc);cb("aColor3d",ds,"aColor");cb("aTexture3d",ds,"aTexture");d3.drawArrays(d3.TRIANGLES,0,dc.length/3);d3.disable(d3.POLYGON_OFFSET_FILL)}if(dR>0&&b9){d3.useProgram(dL);a4("uModel2d",dL,"uModel",false,d9.array());a4("uView2d",dL,"uView",false,d6.array());dX("uColor2d",dL,"uColor",cV);dU("uIsDrawingText2d",dL,"uIsDrawingText",false);c7("vertex2d",dL,"aVertex",3,df);cb("aTextureCoord2d",dL,"aTextureCoord");d3.drawArrays(d3.LINES,0,bC.length/3)}};var cy=function(){var d6;cA=[];for(d6=0;d60){var d7=new aK;d7.set(d6);var d5=new aK;d5.set(d8);d7.mult(d5);var ea=new aK;ea.set(d7);ea.invert();ea.transpose();a4("uNormalTransform3d",ds,"uNormalTransform",false,ea.array());c7("aNormal3d",ds,"aNormal",3,bb)}else{cb("aNormal3d",ds,"aNormal")}d3.useProgram(ds);cb("aTexture3d",ds,"aTexture");a4("uModel3d",ds,"uModel",false,d8.array());a4("uView3d",ds,"uView",false,d6.array());c7("aVertex3d",ds,"aVertex",3,bb);cb("aColor3d",ds,"aColor");d3.enable(d3.POLYGON_OFFSET_FILL);d3.polygonOffset(1,1);dX("uColor3d",ds,"uColor",bj);d3.drawArrays(d3.TRIANGLE_STRIP,0,cA.length/3);d3.disable(d3.POLYGON_OFFSET_FILL)}if(dR>0&&b9){d3.useProgram(dL);a4("uModel2d",dL,"uModel",false,d8.array());a4("uView2d",dL,"uView",false,d6.array());c7("aVertex2d",dL,"aVertex",3,bb);cb("aTextureCoord2d",dL,"aTextureCoord");dX("uColor2d",dL,"uColor",cV);dU("uIsDrawingText",dL,"uIsDrawingText",false);d3.drawArrays(d3.LINE_STRIP,0,cA.length/3)}};cR.modelX=function(eb,ea,d9){var ed=dE.array();var ef=cc.array();var d5=ed[0]*eb+ed[1]*ea+ed[2]*d9+ed[3];var ee=ed[4]*eb+ed[5]*ea+ed[6]*d9+ed[7];var ec=ed[8]*eb+ed[9]*ea+ed[10]*d9+ed[11];var d6=ed[12]*eb+ed[13]*ea+ed[14]*d9+ed[15];var d7=ef[0]*d5+ef[1]*ee+ef[2]*ec+ef[3]*d6;var d8=ef[12]*d5+ef[13]*ee+ef[14]*ec+ef[15]*d6;return d8!==0?d7/d8:d7};cR.modelY=function(eb,ea,d9){var ed=dE.array();var ef=cc.array();var d5=ed[0]*eb+ed[1]*ea+ed[2]*d9+ed[3];var ee=ed[4]*eb+ed[5]*ea+ed[6]*d9+ed[7];var ec=ed[8]*eb+ed[9]*ea+ed[10]*d9+ed[11];var d6=ed[12]*eb+ed[13]*ea+ed[14]*d9+ed[15];var d7=ef[4]*d5+ef[5]*ee+ef[6]*ec+ef[7]*d6;var d8=ef[12]*d5+ef[13]*ee+ef[14]*ec+ef[15]*d6;return d8!==0?d7/d8:d7};cR.modelZ=function(eb,ea,d9){var ed=dE.array();var ef=cc.array();var d5=ed[0]*eb+ed[1]*ea+ed[2]*d9+ed[3];var ee=ed[4]*eb+ed[5]*ea+ed[6]*d9+ed[7];var ec=ed[8]*eb+ed[9]*ea+ed[10]*d9+ed[11];var d7=ed[12]*eb+ed[13]*ea+ed[14]*d9+ed[15];var d6=ef[8]*d5+ef[9]*ee+ef[10]*ec+ef[11]*d7;var d8=ef[12]*d5+ef[13]*ee+ef[14]*ec+ef[15]*d7;return d8!==0?d6/d8:d6};bM.prototype.ambient=dm.prototype.a3DOnlyFunction;bw.prototype.ambient=function(d8,d7,d6){d3.useProgram(ds);dU("uUsingMat3d",ds,"uUsingMat",true);var d5=cR.color(d8,d7,d6);dX("uMaterialAmbient3d",ds,"uMaterialAmbient",cR.color.toGLArray(d5).slice(0,3))};bM.prototype.emissive=dm.prototype.a3DOnlyFunction;bw.prototype.emissive=function(d8,d7,d6){d3.useProgram(ds);dU("uUsingMat3d",ds,"uUsingMat",true);var d5=cR.color(d8,d7,d6);dX("uMaterialEmissive3d",ds,"uMaterialEmissive",cR.color.toGLArray(d5).slice(0,3))};bM.prototype.shininess=dm.prototype.a3DOnlyFunction;bw.prototype.shininess=function(d5){d3.useProgram(ds);dU("uUsingMat3d",ds,"uUsingMat",true);dX("uShininess3d",ds,"uShininess",d5)};bM.prototype.specular=dm.prototype.a3DOnlyFunction;bw.prototype.specular=function(d8,d7,d6){d3.useProgram(ds);dU("uUsingMat3d",ds,"uUsingMat",true);var d5=cR.color(d8,d7,d6);dX("uMaterialSpecular3d",ds,"uMaterialSpecular",cR.color.toGLArray(d5).slice(0,3))};cR.screenX=function(ec,eb,ea){var ee=dE.array();if(ee.length===16){var d5=ee[0]*ec+ee[1]*eb+ee[2]*ea+ee[3];var ef=ee[4]*ec+ee[5]*eb+ee[6]*ea+ee[7];var ed=ee[8]*ec+ee[9]*eb+ee[10]*ea+ee[11];var d6=ee[12]*ec+ee[13]*eb+ee[14]*ea+ee[15];var d9=c6.array();var d7=d9[0]*d5+d9[1]*ef+d9[2]*ed+d9[3]*d6;var d8=d9[12]*d5+d9[13]*ef+d9[14]*ed+d9[15]*d6;if(d8!==0){d7/=d8}return cR.width*(1+d7)/2}return dE.multX(ec,eb)};cR.screenY=function av(ec,eb,ea){var ee=dE.array();if(ee.length===16){var d5=ee[0]*ec+ee[1]*eb+ee[2]*ea+ee[3];var ef=ee[4]*ec+ee[5]*eb+ee[6]*ea+ee[7];var ed=ee[8]*ec+ee[9]*eb+ee[10]*ea+ee[11];var d6=ee[12]*ec+ee[13]*eb+ee[14]*ea+ee[15];var d9=c6.array();var d7=d9[4]*d5+d9[5]*ef+d9[6]*ed+d9[7]*d6;var d8=d9[12]*d5+d9[13]*ef+d9[14]*ed+d9[15]*d6;if(d8!==0){d7/=d8}return cR.height*(1+d7)/2}return dE.multY(ec,eb)};cR.screenZ=function at(ec,eb,ea){var ee=dE.array();if(ee.length!==16){return 0}var d9=c6.array();var d5=ee[0]*ec+ee[1]*eb+ee[2]*ea+ee[3];var ef=ee[4]*ec+ee[5]*eb+ee[6]*ea+ee[7];var ed=ee[8]*ec+ee[9]*eb+ee[10]*ea+ee[11];var d7=ee[12]*ec+ee[13]*eb+ee[14]*ea+ee[15];var d6=d9[8]*d5+d9[9]*ef+d9[10]*ed+d9[11]*d7;var d8=d9[12]*d5+d9[13]*ef+d9[14]*ed+d9[15]*d7;if(d8!==0){d6/=d8}return(d6+1)/2};dm.prototype.fill=function(){var d5=cR.color(arguments[0],arguments[1],arguments[2],arguments[3]);if(d5===aW&&aC){return}aC=true;aW=d5};bM.prototype.fill=function(){dm.prototype.fill.apply(this,arguments);al=true};bw.prototype.fill=function(){dm.prototype.fill.apply(this,arguments);bj=cR.color.toGLArray(aW)};function bi(){if(aC){if(al){d3.fillStyle=cR.color.toString(aW);al=false}d3.fill()}}cR.noFill=function(){aC=false};dm.prototype.stroke=function(){var d5=cR.color(arguments[0],arguments[1],arguments[2],arguments[3]);if(d5===cq&&b9){return}b9=true;cq=d5};bM.prototype.stroke=function(){dm.prototype.stroke.apply(this,arguments);bY=true};bw.prototype.stroke=function(){dm.prototype.stroke.apply(this,arguments);cV=cR.color.toGLArray(cq)};function c8(){if(b9){if(bY){d3.strokeStyle=cR.color.toString(cq);bY=false}d3.stroke()}}cR.noStroke=function(){b9=false};dm.prototype.strokeWeight=function(d5){dR=d5};bM.prototype.strokeWeight=function(d5){dm.prototype.strokeWeight.apply(this,arguments);d3.lineWidth=d5};bw.prototype.strokeWeight=function(d5){dm.prototype.strokeWeight.apply(this,arguments);d3.useProgram(dL);dX("pointSize2d",dL,"uPointSize",d5);d3.useProgram(bO);dX("pointSizeUnlitShape",bO,"uPointSize",d5);d3.lineWidth(d5)};cR.strokeCap=function(d5){dT.$ensureContext().lineCap=d5};cR.strokeJoin=function(d5){dT.$ensureContext().lineJoin=d5};bM.prototype.smooth=function(){dJ=true;var d5=Z.style;d5.setProperty("image-rendering","optimizeQuality","important");d5.setProperty("-ms-interpolation-mode","bicubic","important");if(d3.hasOwnProperty("mozImageSmoothingEnabled")){d3.mozImageSmoothingEnabled=true}};bw.prototype.smooth=function(){dJ=true};bM.prototype.noSmooth=function(){dJ=false;var d5=Z.style;d5.setProperty("image-rendering","optimizeSpeed","important");d5.setProperty("image-rendering","-moz-crisp-edges","important");d5.setProperty("image-rendering","-webkit-optimize-contrast","important");d5.setProperty("image-rendering","optimize-contrast","important");d5.setProperty("-ms-interpolation-mode","nearest-neighbor","important");if(d3.hasOwnProperty("mozImageSmoothingEnabled")){d3.mozImageSmoothingEnabled=false}};bw.prototype.noSmooth=function(){dJ=false};bM.prototype.point=function(d5,d6){if(!b9){return}d5=p.round(d5);d6=p.round(d6);d3.fillStyle=cR.color.toString(cq);al=true;if(dR>1){d3.beginPath();d3.arc(d5,d6,dR/2,0,6.283185307179586,false);d3.fill()}else{d3.fillRect(d5,d6,1,1)}};bw.prototype.point=function(d5,d9,d8){var d7=new aK;d7.translate(d5,d9,d8||0);d7.transpose();var d6=new aK;d6.scale(1,-1,1);d6.apply(dE.array());d6.transpose();d3.useProgram(dL);a4("uModel2d",dL,"uModel",false,d7.array());a4("uView2d",dL,"uView",false,d6.array());if(dR>0&&b9){dX("uColor2d",dL,"uColor",cV);dU("uIsDrawingText2d",dL,"uIsDrawingText",false);dU("uSmooth2d",dL,"uSmooth",dJ);c7("aVertex2d",dL,"aVertex",3,aq);cb("aTextureCoord2d",dL,"aTextureCoord");d3.drawArrays(d3.POINTS,0,1)}};cR.beginShape=function(d5){dM=d5;d1=[];a6=[]};bM.prototype.vertex=function(d6,d8,d5){var d7=[];if(dp){dp=false}d7.isVert=true;d7[0]=d6;d7[1]=d8;d7[2]=0;d7[3]=0;d7[4]=0;d7[5]=aW;d7[6]=cq;a6.push(d7);if(d5){a6[a6.length-1]["moveTo"]=d5}};bw.prototype.vertex=function(d5,ea,d9,d8,d7){var d6=[];if(dp){dp=false}d6.isVert=true;if(d7===d&&dO){d7=d8;d8=d9;d9=0}if(d8!==d&&d7!==d){if(dZ===2){d8/=cn.width;d7/=cn.height}d8=d8>1?1:d8;d8=d8<0?0:d8;d7=d7>1?1:d7;d7=d7<0?0:d7}d6[0]=d5;d6[1]=ea;d6[2]=d9||0;d6[3]=d8||0;d6[4]=d7||0;d6[5]=bj[0];d6[6]=bj[1];d6[7]=bj[2];d6[8]=bj[3];d6[9]=cV[0];d6[10]=cV[1];d6[11]=cV[2];d6[12]=cV[3];d6[13]=a3;d6[14]=a2;d6[15]=a1;a6.push(d6)};var dW=function(d7,d6){var d5=new aK;d5.scale(1,-1,1);d5.apply(dE.array());d5.transpose();d3.useProgram(bO);a4("uViewUS",bO,"uView",false,d5.array());dU("uSmoothUS",bO,"uSmooth",dJ);c7("aVertexUS",bO,"aVertex",3,aq);d3.bufferData(d3.ARRAY_BUFFER,new e(d7),d3.STREAM_DRAW);c7("aColorUS",bO,"aColor",4,aB);d3.bufferData(d3.ARRAY_BUFFER,new e(d6),d3.STREAM_DRAW);d3.drawArrays(d3.POINTS,0,d7.length/3)};var be=function(d9,d8,d7){var d6;if(d8==="LINES"){d6=d3.LINES}else{if(d8==="LINE_LOOP"){d6=d3.LINE_LOOP}else{d6=d3.LINE_STRIP}}var d5=new aK;d5.scale(1,-1,1);d5.apply(dE.array());d5.transpose();d3.useProgram(bO);a4("uViewUS",bO,"uView",false,d5.array());c7("aVertexUS",bO,"aVertex",3,b3);d3.bufferData(d3.ARRAY_BUFFER,new e(d9),d3.STREAM_DRAW);c7("aColorUS",bO,"aColor",4,bx);d3.bufferData(d3.ARRAY_BUFFER,new e(d7),d3.STREAM_DRAW);d3.drawArrays(d6,0,d9.length/3)};var dh=function(ea,d9,d8,d7){var d6;if(d9==="TRIANGLES"){d6=d3.TRIANGLES}else{if(d9==="TRIANGLE_FAN"){d6=d3.TRIANGLE_FAN}else{d6=d3.TRIANGLE_STRIP}}var d5=new aK;d5.scale(1,-1,1);d5.apply(dE.array());d5.transpose();d3.useProgram(ds);a4("model3d",ds,"uModel",false,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);a4("view3d",ds,"uView",false,d5.array());d3.enable(d3.POLYGON_OFFSET_FILL);d3.polygonOffset(1,1);dX("color3d",ds,"uColor",[-1,0,0,0]);c7("vertex3d",ds,"aVertex",3,an);d3.bufferData(d3.ARRAY_BUFFER,new e(ea),d3.STREAM_DRAW);if(dO&&ba!==null){br(d8)}c7("aColor3d",ds,"aColor",4,aB);d3.bufferData(d3.ARRAY_BUFFER,new e(d8),d3.STREAM_DRAW);cb("aNormal3d",ds,"aNormal");if(dO){dU("uUsingTexture3d",ds,"uUsingTexture",dO);c7("aTexture3d",ds,"aTexture",2,aa);d3.bufferData(d3.ARRAY_BUFFER,new e(d7),d3.STREAM_DRAW)}d3.drawArrays(d6,0,ea.length/3);d3.disable(d3.POLYGON_OFFSET_FILL)};function cN(){bi();c8();d3.closePath()}bM.prototype.endShape=function(ec){if(a6.length===0){return}var d8=ec===2;if(d8){a6.push(a6[0])}var d7=[];var d5=[];var ee=[];var eh=[];var ea=[];var ed;dp=true;var eb,d9,d6;var eg=a6.length;for(eb=0;eb3){var ef=[],ei=1-aE;d3.beginPath();d3.moveTo(a6[1][0],a6[1][1]);for(eb=1;eb+22){d3.beginPath();d3.moveTo(a6[0][0],a6[0][1]);d3.lineTo(a6[1][0],a6[1][1]);d3.lineTo(a6[2][0],a6[2][1]);if(aC){cR.fill(a6[2][5]);bi()}if(b9){cR.stroke(a6[2][6]);c8()}d3.closePath();for(eb=3;eb3){for(eb=0;eb+12){for(eb=0;eb+22){for(eb=0;eb+22){for(eb=0;eb<3;eb++){ed=a6[eb];for(d9=0;d9<3;d9++){d7.push(ed[d9])}}for(eb=0;eb<3;eb++){ed=a6[eb];for(d9=9;d9<13;d9++){eh.push(ed[d9])}}if(b9){be(d7,"LINE_LOOP",eh)}for(eb=2;eb+13){for(eb=0;eb<2;eb++){ed=a6[eb];for(d9=0;d9<3;d9++){d7.push(ed[d9])}}for(eb=0;eb<2;eb++){ed=a6[eb];for(d9=9;d9<13;d9++){eh.push(ed[d9])}}be(d7,"LINE_STRIP",eh);if(eg>4&&eg%2>0){ef=d5.splice(d5.length-3);a6.pop()}for(eb=0;eb+33){am(b6[cX-4][0],b6[cX-4][1],b6[cX-4][2],b6[cX-3][0],b6[cX-3][1],b6[cX-3][2],b6[cX-2][0],b6[cX-2][1],b6[cX-2][2],b6[cX-1][0],b6[cX-1][1],b6[cX-1][2])}};bM.prototype.curve=function(ea,ec,d8,eb,d6,d9,d5,d7){cR.beginShape();cR.curveVertex(ea,ec);cR.curveVertex(d8,eb);cR.curveVertex(d6,d9);cR.curveVertex(d5,d7);cR.endShape()};bw.prototype.curve=function(d7,ef,eb,d6,ee,ea,d5,ed,d9,eg,ec,d8){if(d8!==d){cR.beginShape();cR.curveVertex(d7,ef,eb);cR.curveVertex(d6,ee,ea);cR.curveVertex(d5,ed,d9);cR.curveVertex(eg,ec,d8);cR.endShape();return}cR.beginShape();cR.curveVertex(d7,ef);cR.curveVertex(eb,d6);cR.curveVertex(ee,ea);cR.curveVertex(d5,ed);cR.endShape()};cR.curveTightness=function(d5){aE=d5};cR.curveDetail=function(d5){L=d5;dl()};cR.rectMode=function(d5){bF=d5};cR.imageMode=function(d5){switch(d5){case 0:bf=aU;break;case 1:bf=bW;break;case 3:bf=aI;break;default:throw"Invalid imageMode"}};cR.ellipseMode=function(d5){cI=d5};cR.arc=function(eh,ef,d8,ej,d7,eg){if(d8<=0||eg6.283185307179586){d7=0;eg=6.283185307179586}var ei=d8/2,ek=ej/2,ec=eh+ei,ea=ef+ek,d6=0|0.5+d7*cR.RAD_TO_DEG*2,ee=0|0.5+eg*cR.RAD_TO_DEG*2,ed,eb;if(aC){var d9=b9;b9=false;cR.beginShape();cR.vertex(ec,ea);for(ed=d6;ed<=ee;ed++){eb=ed%720;cR.vertex(ec+bg[eb]*ei,ea+ac[eb]*ek)}cR.endShape(2);b9=d9}if(b9){var d5=aC;aC=false;cR.beginShape();for(ed=d6;ed<=ee;ed++){eb=ed%720;cR.vertex(ec+bg[eb]*ei,ea+ac[eb]*ek)}cR.endShape();aC=d5}};bM.prototype.line=function(d6,ed,d5,eb){if(!b9){return}d6=p.round(d6);d5=p.round(d5);ed=p.round(ed);eb=p.round(eb);if(d6===d5&&ed===eb){cR.point(d6,ed);return}var d7=d,ee=d,ea=true,ec=dE.array(),d8=[1,0,0,0,1,0];for(var d9=0;d9<6&&ea;d9++){ea=ec[d9]===d8[d9]}if(ea){if(d6===d5){if(ed>eb){d7=ed;ed=eb;eb=d7}eb++;if(dR%2===1){d3.translate(0.5,0)}}else{if(ed===eb){if(d6>d5){d7=d6;d6=d5;d5=d7}d5++;if(dR%2===1){d3.translate(0,0.5)}}}if(dR===1){ee=d3.lineCap;d3.lineCap="butt"}}d3.beginPath();d3.moveTo(d6||0,ed||0);d3.lineTo(d5||0,eb||0);c8();if(ea){if(d6===d5&&dR%2===1){d3.translate(-0.5,0)}else{if(ed===eb&&dR%2===1){d3.translate(0,-0.5)}}if(dR===1){d3.lineCap=ee}}};bw.prototype.line=function(d7,ea,ec,d6,d8,eb){if(d8===d||eb===d){eb=0;d8=d6;d6=ec;ec=0}if(d7===d6&&ea===d8&&ec===eb){cR.point(d7,ea,ec);return}var d9=[d7,ea,ec,d6,d8,eb];var d5=new aK;d5.scale(1,-1,1);d5.apply(dE.array());d5.transpose();if(dR>0&&b9){d3.useProgram(dL);a4("uModel2d",dL,"uModel",false,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);a4("uView2d",dL,"uView",false,d5.array());dX("uColor2d",dL,"uColor",cV);dU("uIsDrawingText",dL,"uIsDrawingText",false);c7("aVertex2d",dL,"aVertex",3,b3);cb("aTextureCoord2d",dL,"aTextureCoord");d3.bufferData(d3.ARRAY_BUFFER,new e(d9),d3.STREAM_DRAW);d3.drawArrays(d3.LINES,0,2)}};bM.prototype.bezier=function(){if(arguments.length!==8){throw"You must use 8 parameters for bezier() in 2D mode"}cR.beginShape();cR.vertex(arguments[0],arguments[1]);cR.bezierVertex(arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7]);cR.endShape()};bw.prototype.bezier=function(){if(arguments.length!==12){throw"You must use 12 parameters for bezier() in 3D mode"}cR.beginShape();cR.vertex(arguments[0],arguments[1],arguments[2]);cR.bezierVertex(arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8],arguments[9],arguments[10],arguments[11]);cR.endShape()};cR.bezierDetail=function(d5){ct=d5};cR.bezierPoint=function(d6,d5,d9,d8,d7){return(1-d7)*(1-d7)*(1-d7)*d6+3*(1-d7)*(1-d7)*d7*d5+3*(1-d7)*d7*d7*d9+d7*d7*d7*d8};cR.bezierTangent=function(d6,d5,d9,d8,d7){return 3*d7*d7*(-d6+3*d5-3*d9+d8)+6*d7*(d6-2*d5+d9)+3*(-d6+d5)};cR.curvePoint=function(d6,d5,d9,d8,d7){return 0.5*(2*d5+(-d6+d9)*d7+(2*d6-5*d5+4*d9-d8)*d7*d7+(-d6+3*d5-3*d9+d8)*d7*d7*d7)};cR.curveTangent=function(d6,d5,d9,d8,d7){return 0.5*(-d6+d9+2*(2*d6-5*d5+4*d9-d8)*d7+3*(-d6+3*d5-3*d9+d8)*d7*d7)};cR.triangle=function(d8,ea,d6,d9,d5,d7){cR.beginShape(9);cR.vertex(d8,ea,0);cR.vertex(d6,d9,0);cR.vertex(d5,d7,0);cR.endShape()};cR.quad=function(ea,ec,d8,eb,d6,d9,d5,d7){cR.beginShape(16);cR.vertex(ea,ec,0);cR.vertex(d8,eb,0);cR.vertex(d6,d9,0);cR.vertex(d5,d7,0);cR.endShape()};var bI=function(eb,ea,d5,ec,ee,d9,ed,d6){if(d6===d){d9=ee;ed=ee;d6=ee}var d7=d5/2,d8=ec/2;if(ee>d7||ee>d8){ee=p.min(d7,d8)}if(d9>d7||d9>d8){d9=p.min(d7,d8)}if(ed>d7||ed>d8){ed=p.min(d7,d8)}if(d6>d7||d6>d8){d6=p.min(d7,d8)}if(!aC||b9){d3.translate(0.5,0.5)}d3.beginPath();d3.moveTo(eb+ee,ea);d3.lineTo(eb+d5-d9,ea);d3.quadraticCurveTo(eb+d5,ea,eb+d5,ea+d9);d3.lineTo(eb+d5,ea+ec-ed);d3.quadraticCurveTo(eb+d5,ea+ec,eb+d5-ed,ea+ec);d3.lineTo(eb+d6,ea+ec);d3.quadraticCurveTo(eb,ea+ec,eb,ea+ec-d6);d3.lineTo(eb,ea+ee);d3.quadraticCurveTo(eb,ea,eb+ee,ea);if(!aC||b9){d3.translate(-0.5,-0.5)}bi();c8()};bM.prototype.rect=function(d6,ec,d9,d5,d7,ea,d8,eb){if(!d9&&!d5){return}if(bF===1){d9-=d6;d5-=ec}else{if(bF===2){d9*=2;d5*=2;d6-=d9/2;ec-=d5/2}else{if(bF===3){d6-=d9/2;ec-=d5/2}}}d6=p.round(d6);ec=p.round(ec);d9=p.round(d9);d5=p.round(d5);if(d7!==d){bI(d6,ec,d9,d5,d7,ea,d8,eb);return}if(b9&&dR%2===1){d3.translate(0.5,0.5)}d3.beginPath();d3.rect(d6,ec,d9,d5);bi();c8();if(b9&&dR%2===1){d3.translate(-0.5,-0.5)}};bw.prototype.rect=function(ed,ec,d5,ef,eh,ea,eg,d6){if(eh!==d){throw"rect() with rounded corners is not supported in 3D mode"}if(bF===1){d5-=ed;ef-=ec}else{if(bF===2){d5*=2;ef*=2;ed-=d5/2;ec-=ef/2}else{if(bF===3){ed-=d5/2;ec-=ef/2}}}var d9=new aK;d9.translate(ed,ec,0);d9.scale(d5,ef,1);d9.transpose();var eb=new aK;eb.scale(1,-1,1);eb.apply(dE.array());eb.transpose();if(dR>0&&b9){d3.useProgram(dL);a4("uModel2d",dL,"uModel",false,d9.array());a4("uView2d",dL,"uView",false,eb.array());dX("uColor2d",dL,"uColor",cV);dU("uIsDrawingText2d",dL,"uIsDrawingText",false);c7("aVertex2d",dL,"aVertex",3,aw);cb("aTextureCoord2d",dL,"aTextureCoord");d3.drawArrays(d3.LINE_LOOP,0,af.length/3)}if(aC){d3.useProgram(ds);a4("uModel3d",ds,"uModel",false,d9.array());a4("uView3d",ds,"uView",false,eb.array());d3.enable(d3.POLYGON_OFFSET_FILL);d3.polygonOffset(1,1);dX("color3d",ds,"uColor",bj);if(dG>0){var ee=new aK;ee.set(eb);var d7=new aK;d7.set(d9);ee.mult(d7);var d8=new aK;d8.set(ee);d8.invert();d8.transpose();a4("uNormalTransform3d",ds,"uNormalTransform",false,d8.array());c7("aNormal3d",ds,"aNormal",3,bX)}else{cb("normal3d",ds,"aNormal")}c7("vertex3d",ds,"aVertex",3,aw);d3.drawArrays(d3.TRIANGLE_FAN,0,af.length/3);d3.disable(d3.POLYGON_OFFSET_FILL)}};bM.prototype.ellipse=function(eb,ea,d6,ed){eb=eb||0;ea=ea||0;if(d6<=0&&ed<=0){return}if(cI===2){d6*=2;ed*=2}else{if(cI===1){d6=d6-eb;ed=ed-ea;eb+=d6/2;ea+=ed/2}else{if(cI===0){eb+=d6/2;ea+=ed/2}}}if(d6===ed){d3.beginPath();d3.arc(eb,ea,d6/2,0,6.283185307179586,false);bi();c8()}else{var ec=d6/2,d9=ed/2,d5=0.5522847498307933,d8=d5*ec,d7=d5*d9;cR.beginShape();cR.vertex(eb+ec,ea);cR.bezierVertex(eb+ec,ea-d7,eb+d8,ea-d9,eb,ea-d9);cR.bezierVertex(eb-d8,ea-d9,eb-ec,ea-d7,eb-ec,ea);cR.bezierVertex(eb-ec,ea+d7,eb-d8,ea+d9,eb,ea+d9);cR.bezierVertex(eb+d8,ea+d9,eb+ec,ea+d7,eb+ec,ea);cR.endShape()}};bw.prototype.ellipse=function(ei,eh,d7,ek){ei=ei||0;eh=eh||0;if(d7<=0&&ek<=0){return}if(cI===2){d7*=2;ek*=2}else{if(cI===1){d7=d7-ei;ek=ek-eh;ei+=d7/2;eh+=ek/2}else{if(cI===0){ei+=d7/2;eh+=ek/2}}}var ej=d7/2,ee=ek/2,d5=0.5522847498307933,d9=d5*ej,d8=d5*ee;cR.beginShape();cR.vertex(ei+ej,eh);cR.bezierVertex(ei+ej,eh-d8,0,ei+d9,eh-ee,0,ei,eh-ee,0);cR.bezierVertex(ei-d9,eh-ee,0,ei-ej,eh-d8,0,ei-ej,eh,0);cR.bezierVertex(ei-ej,eh+d8,0,ei-d9,eh+ee,0,ei,eh+ee,0);cR.bezierVertex(ei+d9,eh+ee,0,ei+ej,eh+d8,0,ei+ej,eh,0);cR.endShape();if(aC){var ea=0,ef=0,ec,eb;for(ec=0;ec>16&255;d8[d9+1]=ea>>8&255;d8[d9+2]=ea&255;d8[d9+3]=ea>>24&255;d6.__isDirty=true}}(d5),toArray:function(d6){return function(){var d7=[],ea=d6.imageData.data,d9=d6.width*d6.height;if(d6.isRemote){throw"Image is loaded remotely. Cannot get pixels."}for(var d8=0,eb=0;d8>16&255;ea[eb+1]=ec>>8&255;ea[eb+2]=ec&255;ea[eb+3]=ec>>24&255}d6.__isDirty=true}}(d5)}}var cB=function(d8,eb,d9){this.__isDirty=false;if(d8 instanceof HTMLImageElement){this.fromHTMLImageData(d8)}else{if(eb||d9){this.width=d8||1;this.height=eb||1;var d6=this.sourceImg=v.createElement("canvas");d6.width=this.width;d6.height=this.height;var ec=this.imageData=d6.getContext("2d").createImageData(this.width,this.height);this.format=d9===2||d9===4?d9:1;if(this.format===1){for(var d7=3,ea=this.imageData.data,d5=ea.length;d7=cR.width||d5<0||d8<0||d8>=cR.height){return 0}if(dQ){var d7=((0|d5)+cR.width*(0|d8))*4;d6=cR.imageData.data;return(d6[d7+3]&255)<<24|(d6[d7]&255)<<16|(d6[d7+1]&255)<<8|d6[d7+2]&255}d6=cR.toImageData(0|d5,0|d8,1,1).data;return(d6[3]&255)<<24|(d6[0]&255)<<16|(d6[1]&255)<<8|d6[2]&255}function c3(d5,d9,d6){if(d6.isRemote){throw"Image is loaded remotely. Cannot get x,y."}var d8=d9*d6.width*4+d5*4,d7=d6.imageData.data;return(d7[d8+3]&255)<<24|(d7[d8]&255)<<16|(d7[d8+1]&255)<<8|d7[d8+2]&255}function c1(d5,d9,d6,d7){var d8=new cB(d6,d7,2);d8.fromImageData(cR.toImageData(d5,d9,d6,d7));return d8}function c0(ea,d9,eb,eg,em){if(em.isRemote){throw"Image is loaded remotely. Cannot get x,y,w,h."}var ek=new cB(eb,eg,2),d7=ek.imageData.data,d8=em.width,eh=em.height,ej=em.imageData.data;var d5=p.max(0,-d9),d6=p.max(0,-ea),ec=p.min(eg,eh-d9),ed=p.min(eb,d8-ea);for(var ef=d5;ef=0&&d7>=0&&d7bU){O()}}}function bq(d5,eb,d8,d6){if(d6.isRemote){throw"Image is loaded remotely. Cannot set x,y."}var ea=cR.color.toArray(d8);var d9=eb*d6.width*4+d5*4;var d7=d6.imageData.data;d7[d9]=ea[0];d7[d9+1]=ea[1];d7[d9+2]=ea[2];d7[d9+3]=ea[3]}cR.set=function(d5,ea,d8,d7){var d6,d9;if(arguments.length===3){if(typeof d8==="number"){bs(d5,ea,d8)}else{if(d8 instanceof cB||d8.__isPImage){cR.image(d8,d5,ea)}}}else{if(arguments.length===4){bq(d5,ea,d8,d7)}}};cR.imageData={};cR.pixels={getLength:function(){return cR.imageData.data.length?cR.imageData.data.length/4:0},getPixel:function(d5){var d7=d5*4,d6=cR.imageData.data;return d6[d7+3]<<24&4278190080|d6[d7+0]<<16&16711680|d6[d7+1]<<8&65280|d6[d7+2]&255},setPixel:function(d5,d8){var d7=d5*4,d6=cR.imageData.data;d6[d7+0]=(d8&16711680)>>>16;d6[d7+1]=(d8&65280)>>>8;d6[d7+2]=d8&255;d6[d7+3]=(d8&4278190080)>>>24},toArray:function(){var d5=[],d7=cR.imageData.width*cR.imageData.height,d8=cR.imageData.data;for(var d6=0,d9=0;d60){bz(d8,d7,d6,d5)}var d9=cR.color.toGLArray(aZ);d3.clearColor(d9[0],d9[1],d9[2],d9[3]);d3.clear(d3.COLOR_BUFFER_BIT|d3.DEPTH_BUFFER_BIT)};bM.prototype.image=function(d8,ed,eb,ee,d9){ed=p.round(ed);eb=p.round(eb);if(d8.width>0){var ef=ee||d8.width;var ec=d9||d8.height;var d5=bf(ed||0,eb||0,ee||d8.width,d9||d8.height,arguments.length<4);var ea=!!d8.sourceImg&&ba===null;if(ea){var d6=d8.sourceImg;if(d8.__isDirty){d8.updatePixels()}d3.drawImage(d6,0,0,d6.width,d6.height,d5.x,d5.y,d5.w,d5.h)}else{var d7=d8.toImageData();if(ba!==null){ba(d7);d8.__isDirty=true}d3.drawImage(bt(d7).canvas,0,0,d8.width,d8.height,d5.x,d5.y,d5.w,d5.h)}}};bw.prototype.image=function(d7,d5,d9,d6,d8){if(d7.width>0){d5=p.round(d5);d9=p.round(d9);d6=d6||d7.width;d8=d8||d7.height;cR.beginShape(cR.QUADS);cR.texture(d7);cR.vertex(d5,d9,0,0,0);cR.vertex(d5,d9+d8,0,0,d8);cR.vertex(d5+d6,d9+d8,0,d6,d8);cR.vertex(d5+d6,d9,0,d6,0);cR.endShape()}};cR.tint=function(d8,d7,d5,ed){var ea=cR.color(d8,d7,d5,ed);var d6=cR.red(ea)/bE;var d9=cR.green(ea)/bD;var eb=cR.blue(ea)/bB;var ec=cR.alpha(ea)/bP;ba=function(eh){var eg=eh.data,ef=4*eh.width*eh.height;for(var ee=0;ee=d5){break}ek=0}for(es=ek;es=d5){break}d9=(eq+ew)*4;en=eb[es];em+=en*d8[d9+3];ea+=en*d8[d9];eg+=en*d8[d9+1];el+=en*d8[d9+2];d7+=en;eq++}ei=ew+ef;ex[ei]=em/d7;ep[ei]=ea/d7;ey[ei]=eg/d7;ec[ei]=el/d7}ew+=d5}ew=0;eu=-eh;et=eu*d5;for(ee=0;ee=d6){break}ek=0;ei=eu;eq=ef+et}for(es=ek;es=d6){break}en=eb[es];em+=en*ex[eq];ea+=en*ep[eq];eg+=en*ey[eq];el+=en*ec[eq];d7+=en;ei++;eq+=d5}d9=(ef+ew)*4;d8[d9]=ea/d7;d8[d9+1]=eg/d7;d8[d9+2]=el/d7;d8[d9+3]=em/d7}ew+=d5;et+=d5;eu++}};var ca=function(em,eg){var ec=0;var eq=eg.pixels.getLength();var eh=new n(eq);var ek,d6,ef,ee,d8;var el,d9,eb,ed,d7,ei,ep,d5,en,ea,eo,ej;if(!em){while(ec=d6){el=ec}if(eb<0){eb=0}if(ed>=eq){ed=ec}ep=eg.pixels.getPixel(eb);ei=eg.pixels.getPixel(d9);d5=eg.pixels.getPixel(ed);d7=eg.pixels.getPixel(el);d8=77*(ef>>16&255)+151*(ef>>8&255)+28*(ef&255);ea=77*(ei>>16&255)+151*(ei>>8&255)+28*(ei&255);en=77*(d7>>16&255)+151*(d7>>8&255)+28*(d7&255);eo=77*(ep>>16&255)+151*(ep>>8&255)+28*(ep&255);ej=77*(d5>>16&255)+151*(d5>>8&255)+28*(d5&255);if(ea>d8){ee=ei;d8=ea}if(en>d8){ee=d7;d8=en}if(eo>d8){ee=ep;d8=eo}if(ej>d8){ee=d5;d8=ej}eh[ec++]=ee}}}else{while(ec=d6){el=ec}if(eb<0){eb=0}if(ed>=eq){ed=ec}ep=eg.pixels.getPixel(eb);ei=eg.pixels.getPixel(d9);d5=eg.pixels.getPixel(ed);d7=eg.pixels.getPixel(el);d8=77*(ef>>16&255)+151*(ef>>8&255)+28*(ef&255);ea=77*(ei>>16&255)+151*(ei>>8&255)+28*(ei&255);en=77*(d7>>16&255)+151*(d7>>8&255)+28*(d7&255);eo=77*(ep>>16&255)+151*(ep>>8&255)+28*(ep&255);ej=77*(d5>>16&255)+151*(d5>>8&255)+28*(d5&255);if(ea>16&255)+151*(ea>>8&255)+28*(ea&255)>>8;ef.pixels.setPixel(ee,ea&4278190080|d6<<16|d6<<8|d6)}}break;case 13:for(ee=0;ee255){throw"Levels must be between 2 and 255 for filter(POSTERIZE, levels)"}var ed=ek-1;for(ee=0;ee>16&255;var ei=ef.pixels.getPixel(ee)>>8&255;var d7=ef.pixels.getPixel(ee)&255;d5=(d5*ek>>8)*255/ed;ei=(ei*ek>>8)*255/ed;d7=(d7*ek>>8)*255/ed;ef.pixels.setPixel(ee,4278190080&ef.pixels.getPixel(ee)|d5<<16|ei<<8|d7)}break;case 14:for(ee=0;ee1){throw"Level must be between 0 and 1 for filter(THRESHOLD, level)"}var d9=cR.floor(eb*255);for(ee=0;ee>16,cR.max((ef.pixels.getPixel(ee)&65280)>>8,ef.pixels.getPixel(ee)&255));ef.pixels.setPixel(ee,ef.pixels.getPixel(ee)&4278190080|(ejeg){d5=eg}}else{var ef=eg+d7-ei;if(d5>ef){d5=ef}}if(ebd9){ec=d9}}else{var d8=d9+ee-eb;if(ec>d8){ec=d8}}return !(d5<=0||ec<=0)};var dN={};dN[1]=cR.modes.blend;dN[2]=cR.modes.add;dN[4]=cR.modes.subtract;dN[8]=cR.modes.lightest;dN[16]=cR.modes.darkest;dN[0]=cR.modes.replace;dN[32]=cR.modes.difference;dN[64]=cR.modes.exclusion;dN[128]=cR.modes.multiply;dN[256]=cR.modes.screen;dN[512]=cR.modes.overlay;dN[1024]=cR.modes.hard_light;dN[2048]=cR.modes.soft_light;dN[4096]=cR.modes.dodge;dN[8192]=cR.modes.burn;cR.blit_resize=function(ei,eu,eo,et,en,ez,ee,em,es,ej,er,eh,ek){var ex,ew;if(eu<0){eu=0}if(eo<0){eo=0}if(et>=ei.width){et=ei.width-1}if(en>=ei.height){en=ei.height-1}var eD=et-eu;var eI=en-eo;var d5=er-es;var ef=eh-ej;if(d5<=0||ef<=0||eD<=0||eI<=0||es>=ee||ej>=em||eu>=ei.width||eo>=ei.height){return}var ec=p.floor(eD/d5*32768);var d9=p.floor(eI/ef*32768);var eB=cR.shared;eB.srcXOffset=p.floor(es<0?-es*ec:eu*32768);eB.srcYOffset=p.floor(ej<0?-ej*d9:eo*32768);if(es<0){d5+=es;es=0}if(ej<0){ef+=ej;ej=0}d5=p.min(d5,ee-es);ef=p.min(ef,em-ej);var ep=ej*ee+es;var eL;eB.srcBuffer=ei.imageData.data;eB.iw=ei.width;eB.iw1=ei.width-1;eB.ih1=ei.height-1;var eq=cR.filter_bilinear,eF=cR.filter_new_scanline,ed=dN[ek],eC,eH,eA,eE,d7,d8,d6=4278190080,eG=16711680,ev=65280,eb=255,eK=32767,ey=15,eg=1,el=9,ea=eB.srcBuffer,eJ=p.min;for(ew=0;ew>ey)*eB.iw;eB.v2=eJ((eB.srcYOffset>>ey)+1,eB.ih1)*eB.iw;for(ex=0;ex>ey;eB.ll=eB.ifU*eB.fracV>>ey;eB.ur=eB.fracU*eB.ifV>>ey;eB.lr=eB.fracU*eB.fracV>>ey;eB.u1=eB.sX>>ey;eB.u2=eJ(eB.u1+1,eB.iw1);eA=(eB.v1+eB.u1)*4;eE=(eB.v1+eB.u2)*4;d7=(eB.v2+eB.u1)*4;d8=(eB.v2+eB.u2)*4;eB.cUL=ea[eA+3]<<24&d6|ea[eA]<<16&eG|ea[eA+1]<<8&ev|ea[eA+2]&eb;eB.cUR=ea[eE+3]<<24&d6|ea[eE]<<16&eG|ea[eE+1]<<8&ev|ea[eE+2]&eb;eB.cLL=ea[d7+3]<<24&d6|ea[d7]<<16&eG|ea[d7+1]<<8&ev|ea[d7+2]&eb;eB.cLR=ea[d8+3]<<24&d6|ea[d8]<<16&eG|ea[d8+1]<<8&ev|ea[d8+2]&eb;eB.r=eB.ul*((eB.cUL&eG)>>16)+eB.ll*((eB.cLL&eG)>>16)+eB.ur*((eB.cUR&eG)>>16)+eB.lr*((eB.cLR&eG)>>16)<>>ey&ev;eB.b=eB.ul*(eB.cUL&eb)+eB.ll*(eB.cLL&eb)+eB.ur*(eB.cUR&eb)+eB.lr*(eB.cLR&eb)>>>ey;eB.a=eB.ul*((eB.cUL&d6)>>>24)+eB.ll*((eB.cLL&d6)>>>24)+eB.ur*((eB.cUR&d6)>>>24)+eB.lr*((eB.cLR&d6)>>>24)<>>16;ez[eH+1]=(eC&ev)>>>8;ez[eH+2]=eC&eb;ez[eH+3]=(eC&d6)>>>24;eB.sX+=ec}ep+=ee;eB.srcYOffset+=d9}};cR.loadFont=function(d6,d7){if(d6===d){throw"font name required in loadFont."}if(d6.indexOf(".svg")===-1){if(d7===d){d7=R.size}return g.get(d6,d7)}var d5=cR.loadGlyphs(d6);return{name:d6,css:"12px sans-serif",glyph:true,units_per_em:d5.units_per_em,horiz_adv_x:1/d5.units_per_em*d5.horiz_adv_x,ascent:d5.ascent,descent:d5.descent,width:function(ec){var ea=0;var d8=ec.length;for(var d9=0;d9":return d5.greater;case"?":return d5.question;case"@":return d5.at;case"[":return d5.bracketleft;case"\\":return d5.backslash;case"]":return d5.bracketright;case"^":return d5.asciicircum;case"`":return d5.grave;case"{":return d5.braceleft;case"|":return d5.bar;case"}":return d5.braceright;case"~":return d5.asciitilde;default:return d5[d6]}}catch(d7){D.debug(d7)}};bM.prototype.text$line=function(ed,eg,ef,ee,ea){var ec=0,eb=0;if(!R.glyph){if(ed&&"fillText" in d3){if(al){d3.fillStyle=cR.color.toString(aW);al=false}if(ea===39||ea===3){ec=R.measureTextWidth(ed);if(ea===39){eb=-ec}else{eb=-ec/2}}d3.fillText(ed,eg+eb,ef)}}else{var d5=cR.glyphTable[T];ay();d3.translate(eg,ef+dV);if(ea===39||ea===3){ec=d5.width(ed);if(ea===39){eb=-ec}else{eb=-ec/2}}var eh=d5.units_per_em,d9=1/eh*dV;d3.scale(d9,d9);for(var d6=0,d7=ed.length;d6ei){return}var eh=-1;var d9=0;var d5=0;var eb=[];for(var ea=0,en=el.length;ea0){eh=ea}else{return}}if(ec==="\n"){eb.push({text:el.substring(d9,ea),width:d5});d9=ea+1}else{eb.push({text:el.substring(d9,eh+1),width:d5});d9=eh+1}d5=0;ea=d9-1}}if(d9ei-dv){break}d8=eb[d7];dT.text$line(d8.text,eg+ep,ef+ed+eo,ee,I)}}cR.text=function(){if(cD===5){return}if(arguments.length===3){bd(bp(arguments[0]),arguments[1],arguments[2],0)}else{if(arguments.length===4){bd(bp(arguments[0]),arguments[1],arguments[2],arguments[3])}else{if(arguments.length===5){a8(bp(arguments[0]),arguments[1],arguments[2],arguments[3],arguments[4],0)}else{if(arguments.length===6){a8(bp(arguments[0]),arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])}}}}};cR.textMode=function(d5){cD=d5};cR.loadGlyphs=function(eb){var ed,ec,d9,d7,ek,ej,ei,el,ef,em,eg,eh="[0-9\\-]+",ee;var ea=function(es,er){var ep=0,eo=[],en,eq=new RegExp(es,"g");en=eo[ep]=eq.exec(er);while(en){ep++;en=eo[ep]=eq.exec(er)}return eo};var d6=function(es){var et=ea("[A-Za-z][0-9\\- ]+|Z",es);var er=function(){ay();return dT.$ensureContext()};var ep=function(){bi();c8();cK()};ee="return {draw:function(){var curContext=beforePathDraw();curContext.beginPath();";ed=0;ec=0;d9=0;d7=0;ek=0;ej=0;es=0;el=0;ef="";em=et.length-1;for(var eo=0;eoaB){aA=aB-aC}}aw.height=aA/aB*100+"%";ak()},au=[ae(aj,"mousemove",function(aA){if(ay){av(Y.innerHeight-aA.clientY);ao.scrollTop=al}}),ae(aj,"mouseup",function(){if(ay){ay=al=I}}),ae(ax,"dblclick",function(aA){aA.preventDefault();if(ap){av(ap);ap=I}else{ap=am.clientHeight;aw.height="0px"}}),ae(ax,"mousedown",function(aA){aA.preventDefault();ay=N;al=ao.scrollTop}),ae(ax,"contextmenu",function(){ay=I}),ae(an,"click",function(){aq()})];aq=function(){var aA=au.length;while(aA--){Q.apply(O,au[aA])}ag.removeChild(am);P.paddingBottom=ar;V(ao);V(am);O[K]=S};R(am,W,ao,Z,ax,ad,an,ai);an[ab]="Close Log";af(an,U("\u2716"));ax[ab]="Double-click to toggle log minimization";ag.insertBefore(am,ag.firstChild);O[K]=function(aC){if(at===J){ao.removeChild(ao.firstChild)}else{at++}var aB=af(ao,ac(ah)),aA=af(aB,ac(ah));aB[ab]=(new Date).toLocaleTimeString();R(aB,T,aA,aa);af(aA,U(aC));ao.scrollTop=ao.scrollHeight};O[K](az);ak()}})()}else{if(typeof print===M){O[K]=print}}}return O}();D.logger=G;D.version="1.4.1-API";D.lib={};D.registerLibrary=function(I,J){D.lib[I]=J;if(J.hasOwnProperty("init")){J.init(c)}};D.instances=A;D.getInstanceById=function(I){return A[h[I]]};D.Sketch=function(I){this.attachFunction=I;this.options={pauseOnBlur:false,globalKeyEvents:false};this.onLoad=i;this.onSetup=i;this.onPause=i;this.onLoop=i;this.onFrameStart=i;this.onFrameEnd=i;this.onExit=i;this.params={};this.imageCache={pending:0,images:{},operaCache:{},add:function(K,J){if(this.images[K]){return}if(!H){this.images[K]=null}if(!J){J=new Image;J.onload=function(M){return function(){M.pending--}}(this);this.pending++;J.src=K}this.images[K]=J;if(m.opera){var L=v.createElement("div");L.appendChild(J);L.style.position="absolute";L.style.opacity=0;L.style.width="1px";L.style.height="1px";if(!this.operaCache[K]){v.body.appendChild(L);this.operaCache[K]=L}}}};this.sourceCode=undefined;this.attach=function(K){if(typeof this.attachFunction==="function"){this.attachFunction(K)}else{if(this.sourceCode){var J=(new Function("return ("+this.sourceCode+");"))();J(K);this.attachFunction=J}else{throw"Unable to attach sketch to the processing instance"}}}};if(H){m.Processing=D}else{this.Processing=D}})(window,window.document,Math); -------------------------------------------------------------------------------- /source-images/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/source-images/01.png -------------------------------------------------------------------------------- /source-images/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/source-images/03.png -------------------------------------------------------------------------------- /source-images/04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/source-images/04.png -------------------------------------------------------------------------------- /source-images/07.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/source-images/07.jpg -------------------------------------------------------------------------------- /source-images/09.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/source-images/09.jpg -------------------------------------------------------------------------------- /source-images/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/source-images/12.png -------------------------------------------------------------------------------- /source-images/readme/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/source-images/readme/01.png -------------------------------------------------------------------------------- /source-images/readme/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/source-images/readme/02.png -------------------------------------------------------------------------------- /source-images/readme/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/source-images/readme/03.png -------------------------------------------------------------------------------- /source-images/readme/04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/source-images/readme/04.png -------------------------------------------------------------------------------- /source-images/readme/05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/source-images/readme/05.png -------------------------------------------------------------------------------- /source-images/readme/bee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fbngrm/honeycomb-js/7261074fc4d756cb72d7cda7e82d0cb6ce4a7418/source-images/readme/bee.png --------------------------------------------------------------------------------