var materia=function(t){var e={};function i(s){if(e[s])return e[s].exports;var o=e[s]={i:s,l:!1,exports:{}};return t[s].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(s,o,function(e){return t[e]}.bind(null,o));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=7)}([function(t,e){t.exports=THREE},function(t,e,i){(function(){"use strict";var s=this.THREE||i(0);if(!s)throw new Error("MeshLine requires three.js");function o(){s.BufferGeometry.call(this),this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._vertices=[],this._bufferArray=[],this.widthCallback=null,this.matrixWorld=new s.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this},set:function(t){this.setFromGeometry(t)}},vertices:{enumerable:!0,get:function(){return this._vertices},set:function(t){this.setVertices(t)}},bufferArray:{enumerable:!0,get:function(){return this._bufferArray},set:function(t){this.setBufferArray(t)}}})}function n(t,e){var i=new s.Matrix4,o=new s.Ray,n=new s.Sphere,r=new s.Vector3,a=this.geometry;if(n.copy(a.boundingSphere),n.applyMatrix4(this.matrixWorld),!1!==t.ray.intersectSphere(n,r)){i.getInverse(this.matrixWorld),o.copy(t.ray).applyMatrix4(i);var h=new s.Vector3,l=new s.Vector3,c=new s.Vector3,u=this instanceof s.LineSegments?2:1,d=a.index,p=a.attributes;if(null!==d)for(var f=d.array,v=p.position.array,m=p.width.array,b=0,g=f.length-1;bV)){r.applyMatrix4(this.matrixWorld);var A=t.ray.origin.distanceTo(r);At.far||(e.push({distance:A,point:c.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this}),b=g)}}}}function r(t,e,i,s,o){var n;if(t=t.subarray||t.slice?t:t.buffer,i=i.subarray||i.slice?i:i.buffer,t=e?t.subarray?t.subarray(e,o&&e+o):t.slice(e,o&&e+o):t,i.set)i.set(t,s);else for(n=0;n0&&(e=this.copyV3(o),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]))}e=this.compareV3(i-1,0)?this.copyV3(1):this.copyV3(i-1),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]),this._attributes&&this._attributes.position.count===this.positions.length?(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0):this._attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)},this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()},o.prototype.advance=function(t){var e=this._attributes.position.array,i=this._attributes.previous.array,s=this._attributes.next.array,o=e.length;r(e,0,i,0,o),r(e,6,e,0,o-6),e[o-6]=t.x,e[o-5]=t.y,e[o-4]=t.z,e[o-3]=t.x,e[o-2]=t.y,e[o-1]=t.z,r(e,6,s,0,o-6),s[o-6]=t.x,s[o-5]=t.y,s[o-4]=t.z,s[o-3]=t.x,s[o-2]=t.y,s[o-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=["",s.ShaderChunk.logdepthbuf_pars_vertex,s.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;","\t vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",s.ShaderChunk.logdepthbuf_vertex,s.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",s.ShaderChunk.fog_vertex,"}"].join("\n"),s.ShaderChunk.meshline_frag=["",s.ShaderChunk.fog_pars_fragment,s.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",s.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",s.ShaderChunk.fog_fragment,"}"].join("\n"),a.prototype=Object.create(s.ShaderMaterial.prototype),a.prototype.constructor=a,a.prototype.isMeshLineMaterial=!0,a.prototype.copy=function(t){return s.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this},t.exports&&(e=t.exports={MeshLine:o,MeshLineMaterial:a,MeshLineRaycast:n}),e.MeshLine=o,e.MeshLineMaterial=a,e.MeshLineRaycast=n}).call(this)},function(t,e,i){"use strict";t.exports=function(t,e,i){var o=t*e,n=s*t,r=n-(n-t),a=t-r,h=s*e,l=h-(h-e),c=e-l,u=a*c-(o-r*l-a*l-r*c);if(i)return i[0]=u,i[1]=o,i;return[u,o]};var s=+(Math.pow(2,27)+1)},function(t,e,i){"use strict";t.exports=function(t,e){var i=0|t.length,s=0|e.length;if(1===i&&1===s)return function(t,e){var i=t+e,s=i-t,o=t-(i-s)+(e-s);if(o)return[o,i];return[i]}(t[0],e[0]);var o,n,r=new Array(i+s),a=0,h=0,l=0,c=Math.abs,u=t[h],d=c(u),p=e[l],f=c(p);d=s?(o=u,(h+=1)=2)return!1;t[i]=s}return!0})):C.filter((function(t){for(var e=0;e<=a;++e){var i=b[t[e]];if(i<0)return!1;t[e]=i}return!0}));if(1&a)for(c=0;c0&&e.push(","),e.push("tuple[",i,"]");e.push(")}return orient");var o=new Function("test",e.join("")),n=s[t+1];return n||(n=s),o(n)}(t)),this.orient=n}var c=l.prototype;c.handleBoundaryDegeneracy=function(t,e){var i=this.dimension,s=this.vertices.length-1,o=this.tuple,n=this.vertices,r=[t];for(t.lastVisited=-s;r.length>0;){(t=r.pop()).vertices;for(var a=t.adjacent,h=0;h<=i;++h){var l=a[h];if(l.boundary&&!(l.lastVisited<=-s)){for(var c=l.vertices,u=0;u<=i;++u){var d=c[u];o[u]=d<0?e:n[d]}var p=this.orient();if(p>0)return l;l.lastVisited=-s,0===p&&r.push(l)}}}return null},c.walk=function(t,e){var i=this.vertices.length-1,s=this.dimension,o=this.vertices,n=this.tuple,r=e?this.interior.length*Math.random()|0:this.interior.length-1,a=this.interior[r];t:for(;!a.boundary;){for(var h=a.vertices,l=a.adjacent,c=0;c<=s;++c)n[c]=o[h[c]];a.lastVisited=i;for(c=0;c<=s;++c){var u=l[c];if(!(u.lastVisited>=i)){var d=n[c];n[c]=t;var p=this.orient();if(n[c]=d,p<0){a=u;continue t}u.boundary?u.lastVisited=-i:u.lastVisited=i}}return}return a},c.addPeaks=function(t,e){var i=this.vertices.length-1,s=this.dimension,o=this.vertices,h=this.tuple,l=this.interior,c=this.simplices,u=[e];e.lastVisited=i,e.vertices[e.vertices.indexOf(-1)]=i,e.boundary=!1,l.push(e);for(var d=[];u.length>0;){var p=(e=u.pop()).vertices,f=e.adjacent,v=p.indexOf(i);if(!(v<0))for(var m=0;m<=s;++m)if(m!==v){var b=f[m];if(b.boundary&&!(b.lastVisited>=i)){var g=b.vertices;if(b.lastVisited!==-i){for(var w=0,y=0;y<=s;++y)g[y]<0?(w=y,h[y]=t):h[y]=o[g[y]];if(this.orient()>0){g[w]=i,b.boundary=!1,l.push(b),u.push(b),b.lastVisited=i;continue}b.lastVisited=-i}var C=b.adjacent,x=p.slice(),V=f.slice(),A=new n(x,V,!0);c.push(A);var M=C.indexOf(e);if(!(M<0)){C[M]=A,V[v]=b,x[m]=-1,V[m]=e,f[m]=A,A.flip();for(y=0;y<=s;++y){var S=x[y];if(!(S<0||S===i)){for(var _=new Array(s-1),k=0,E=0;E<=s;++E){var z=x[E];z<0||E===y||(_[k++]=z)}d.push(new r(_,A,y))}}}}}}d.sort(a);for(m=0;m+1=0?r[h++]=a[c]:l=1&c;if(l===(1&t)){var u=r[0];r[0]=r[1],r[1]=u}e.push(r)}}return e}},function(t,e,i){"use strict";var s=i(2),o=i(3),n=i(4),r=i(12);function a(t,e){for(var i=new Array(t.length-1),s=1;s>1;return["sum(",h(t.slice(0,e)),",",h(t.slice(e)),")"].join("")}function l(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],i=0;i0){if(n<=0)return r;s=o+n}else{if(!(o<0))return r;if(n>=0)return r;s=-(o+n)}var a=33306690738754716e-32*s;return r>=a||r<=-a?r:u(t,e,i)},function(t,e,i,s){var o=t[0]-s[0],n=e[0]-s[0],r=i[0]-s[0],a=t[1]-s[1],h=e[1]-s[1],l=i[1]-s[1],c=t[2]-s[2],u=e[2]-s[2],p=i[2]-s[2],f=n*l,v=r*h,m=r*a,b=o*l,g=o*h,w=n*a,y=c*(f-v)+u*(m-b)+p*(g-w),C=7771561172376103e-31*((Math.abs(f)+Math.abs(v))*Math.abs(c)+(Math.abs(m)+Math.abs(b))*Math.abs(u)+(Math.abs(g)+Math.abs(w))*Math.abs(p));return y>C||-y>C?y:d(t,e,i,s)}];function f(t){var e=p[t.length];return e||(e=p[t.length]=c(t.length)),e.apply(void 0,t)}!function(){for(;p.length<=5;)p.push(c(p.length));for(var e=[],i=["slow"],s=0;s<=5;++s)e.push("a"+s),i.push("o"+s);var o=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(s=2;s<=5;++s)o.push("case ",s,":return o",s,"(",e.slice(0,s).join(),");");o.push("}var s=new Array(arguments.length);for(var i=0;i=s?(o=u,(h+=1)>1,a=n(t[r],e);a<=0?(0===a&&(o=r),i=r+1):a>0&&(s=r-1)}return o}function c(t,e){for(var i=new Array(t.length),o=0,r=i.length;o=t.length||0!==n(t[m],a)););}return i}function u(t,e){if(e<0)return[];for(var i=[],o=(1<>>c&1&&l.push(o[c]);e.push(l)}return a(e)},e.skeleton=u,e.boundary=function(t){for(var e=[],i=0,s=t.length;i0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=i=((t>>>=e)>255)<<3,e|=i=((t>>>=i)>15)<<2,(e|=i=((t>>>=i)>3)<<1)|(t>>>=i)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=s,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var o=new Array(256);!function(t){for(var e=0;e<256;++e){var i=e,s=e,o=7;for(i>>>=1;i;i>>>=1)s<<=1,s|=1&i,--o;t[e]=s<>>8&255]<<16|o[t>>>16&255]<<8|o[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,i){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(i=1227133513&((i=3272356035&((i=251719695&((i=4278190335&((i&=1023)|i<<16))|i<<8))|i<<4))|i<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>s(t)+1}},function(t,e,i){"use strict";function s(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0)return function(t,e){var i,s;for(i=new Array(t),s=0;s0&&i.push(","),i.push("[");for(var r=0;r0&&i.push(","),r===o?i.push("+b[",n,"]"):i.push("+A[",n,"][",r,"]");i.push("]")}i.push("]),")}i.push("det(A)]}return ",e);var a=new Function("det",i.join(""));return a(t<6?s[t]:s)}var n=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;n.length<6;)n.push(o(n.length));for(var e=[],i=["function dispatchLinearSolve(A,b){switch(A.length){"],s=0;s<6;++s)e.push("s"+s),i.push("case ",s,":return s",s,"(A,b);");i.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),e.push("CACHE","g",i.join(""));var r=Function.apply(void 0,e);for(t.exports=r.apply(void 0,n.concat([n,o])),s=0;s<6;++s)t.exports[s]=n[s]}()},function(t,e,i){"use strict";var s=i(2),o=i(3),n=i(4),r=i(20);function a(t,e){for(var i=new Array(t.length-1),s=1;s>1;return["sum(",t(e.slice(0,i)),",",t(e.slice(i)),")"].join("")}(e);var s}function c(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",l(h(t)),")};return robustDeterminant",t].join(""))(o,n,s,r)}var u=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;u.length<6;)u.push(c(u.length));for(var e=[],i=["function robustDeterminant(m){switch(m.length){"],s=0;s<6;++s)e.push("det"+s),i.push("case ",s,":return det",s,"(m);");i.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),e.push("CACHE","gen",i.join(""));var o=Function.apply(void 0,e);for(t.exports=o.apply(void 0,u.concat([u,c])),s=0;s=0;--o){var n=i,r=t[o];(h=r-((i=n+r)-n))&&(t[--s]=i,i=h)}var a=0;for(o=s;o0&&(this.object.zoom/=t,this.object.updateProjectionMatrix(),this._zoomed=!0,this.staticMoving?this._zoomStart.copy(this._zoomEnd):this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor)}panCamera(){var t=new s.Vector2,e=new s.Vector3,i=new s.Vector3;if(t.copy(this._panEnd).sub(this._panStart),t.lengthSq()){var o=this.object.zoom;t.multiplyScalar(this.panSpeed/o),i.copy(this._eye).cross(this.object.up).setLength(t.x),i.add(e.copy(this.object.up).setLength(t.y)),this.object.position.add(i),this.rotationCenter.add(i),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(t.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}}checkDistances(){(this.enableZoom||this.enablePan)&&(this._eye.lengthSq()>this.maxDistance*this.maxDistance&&(this.object.position.addVectors(this.rotationCenter,this._eye.setLength(this.maxDistance)),this._zoomStart.copy(this._zoomEnd)),this._eye.lengthSq()1e-4||this._zoomed)&&(this.dispatchEvent(o),this._lastPosition.copy(this.object.position),this._zoomed=!1)}saveReset(){this.rotationCenter0.copy(this.rotationCenter),this.position0.copy(this.object.position),this.up0.copy(this.object.up),this.zoom0=this.object.zoom}reset(){this._state=a,this._prevState=a,this.rotationCenter.copy(this.rotationCenter0),this.object.position.copy(this.position0),this.object.up.copy(this.up0),this._eye.subVectors(this.object.position,this.rotationCenter),this.object.lookAt(this.rotationCenter),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(o),this._lastPosition.copy(this.object.position)}dispose(){this.domElement.removeEventListener("contextmenu",this.contextmenu.bind(this),!1),this.domElement.removeEventListener("mousedown",this.mousedown.bind(this),!1),this.domElement.removeEventListener("mousewheel",this.mousewheel.bind(this),!1),this.domElement.removeEventListener("MozMousePixelScroll",this.mousewheel.bind(this),!1),this.domElement.removeEventListener("touchstart",this.touchstart.bind(this),!1),this.domElement.removeEventListener("touchend",this.touchend.bind(this),!1),this.domElement.removeEventListener("touchmove",this.touchmove.bind(this),!1),document.removeEventListener("mousemove",this.mousemove.bind(this),!1),document.removeEventListener("mouseup",this.mouseup.bind(this),!1),window.removeEventListener("keydown",this.keydown.bind(this),!1),window.removeEventListener("keyup",this.keyup.bind(this),!1)}keydown(t){!1!==this.enabled&&(window.removeEventListener("keydown",this.keydown.bind(this)),this._prevState=this._state,this._state===a&&(t.keyCode===this.keys[h]&&this.enableRotate?this._state=h:t.keyCode===this.keys[l]&&this.enableZoom?this._state=l:t.keyCode===this.keys[c]&&this.enablePan&&(this._state=c)))}keyup(t){!1!==this.enabled&&(this._state=this._prevState)}mousedown(t){!1!==this.enabled&&(t.preventDefault(),t.stopPropagation(),this._state===a&&(this._state=t.button),this._state===h&&this.enableRotate?(this._moveCurr.copy(this.getMouseOnCircle(t.pageX,t.pageY)),this._movePrev.copy(this._moveCurr)):this._state===l&&this.enableZoom?(this._zoomStart.copy(this.getMouseOnScreen(t.pageX,t.pageY)),this._zoomEnd.copy(this._zoomStart)):this._state===c&&this.enablePan&&(this._panStart.copy(this.getMouseOnScreen(t.pageX,t.pageY)),this._panEnd.copy(this._panStart)),this.dispatchEvent(n))}mousemove(t){!1!==this.enabled&&(t.preventDefault(),t.stopPropagation(),this._state===h&&this.enableRotate?(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this.getMouseOnCircle(t.pageX,t.pageY))):this._state===l&&this.enableZoom?this._zoomEnd.copy(this.getMouseOnScreen(t.pageX,t.pageY)):this._state===c&&this.enablePan&&this._panEnd.copy(this.getMouseOnScreen(t.pageX,t.pageY)),this.update())}mouseup(t){!1!==this.enabled&&(t.preventDefault(),t.stopPropagation(),this._state=a,document.removeEventListener("mousemove",this.mousemove.bind(this)),document.removeEventListener("mouseup",this.mouseup.bind(this)),this.dispatchEvent(r))}mousewheel(t){if(!1===this.enabled)return;t.preventDefault(),t.stopPropagation();let e=0;t.wheelDelta?e=t.wheelDelta:t.detail&&(e=-t.detail),e/=Math.abs(e),this._zoomStart.y+=e*this.zoomSpeed,this.dispatchEvent(n),this.dispatchEvent(r),this.update()}touchstart(t){if(!1!==this.enabled){switch(t.touches.length){case 1:this._state=u,this._moveCurr.copy(this.getMouseOnCircle(t.touches[0].pageX,t.touches[0].pageY)),this._movePrev.copy(this._moveCurr);break;default:this._state=d;var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(e*e+i*i);var s=(t.touches[0].pageX+t.touches[1].pageX)/2,o=(t.touches[0].pageY+t.touches[1].pageY)/2;this._panStart.copy(this.getMouseOnScreen(s,o)),this._panEnd.copy(this._panStart)}this.dispatchEvent(n)}}touchmove(t){if(!1!==this.enabled){switch(t.preventDefault(),t.stopPropagation(),t.touches.length){case 1:this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this.getMouseOnCircle(t.touches[0].pageX,t.touches[0].pageY));break;default:var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY;this._touchZoomDistanceEnd=Math.sqrt(e*e+i*i);var s=(t.touches[0].pageX+t.touches[1].pageX)/2,o=(t.touches[0].pageY+t.touches[1].pageY)/2;this._panEnd.copy(this.getMouseOnScreen(s,o))}this.update()}}touchend(t){if(!1!==this.enabled){switch(t.touches.length){case 0:this._state=a;break;case 1:this._state=u,this._moveCurr.copy(this.getMouseOnCircle(t.touches[0].pageX,t.touches[0].pageY)),this._movePrev.copy(this._moveCurr)}this.dispatchEvent(r)}}contextmenu(t){t.preventDefault()}addEventListener(t,e){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){if(void 0!==this._listeners){var i=this._listeners[t];if(void 0!==i){var s=i.indexOf(e);-1!==s&&i.splice(s,1)}}}dispatchEvent(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e)for(var i=e.slice(0),s=0,o=i.length;st.updateMatrixWorld());const i=this.rootElement,o=i.clientWidth,n=i.clientHeight,r=[],a=t.length,h=new s.Vector3;for(let e=a,i=0;ic?c=i:id?d=s:s0&&(c.lineWidth=256*a,c.strokeStyle=h,c.strokeText(e,128,128)),c.fillText(e,128,128);const u=new s.Texture(l);u.needsUpdate=!0;const d=new s.SpriteMaterial({map:u}),p=new s.Sprite(d);p.scale.set(n,n,1),void 0===r&&(r=new s.Vector2(0,0));const f=new s.Vector2;f.addVectors(r,new s.Vector2(.5,.5)),p.center.copy(f);const v=new s.Object3D;return v.position.copy(t),v.add(p),v}rotateAroundWorldAxis(t,e,i){const o=new s.Matrix4;o.makeRotationAxis(e.normalize(),i),o.multiply(t.matrix),t.matrix=o,t.rotation.setFromRotationMatrix(t.matrix)}coordinateTransform(t,e,i,s=!0){return(s?i.clone():i).applyMatrix3(t).applyMatrix3(e)}alignView(t,e,i,o=!0){if(void 0===t)return;if(t.length>2)throw"At most two alignments can be performed.";const n=[],r=t=>{const o=t[0],r=t[1];let a;switch(o){case"up":a=new s.Vector3(0,1,0);break;case"down":a=new s.Vector3(0,-1,0);break;case"right":a=new s.Vector3(1,0,0);break;case"left":a=new s.Vector3(-1,0,0);break;case"front":a=new s.Vector3(0,0,1);break;case"back":a=new s.Vector3(0,0,-1)}const h=e[r];for(const t of n)h[t]=0;if(h.length()>1e-8){const t=(new s.Quaternion).setFromUnitVectors(h.clone().normalize(),a);for(const i in e)e[i].applyQuaternion(t);for(const e of i)e.applyQuaternion(t),e.updateMatrixWorld();"right"==o||"left"==o?n.push("x"):"up"==o||"down"==o?n.push("y"):"front"!=o&&"back"!=o||n.push("z")}};for(const e of t)r(e);o&&this.render()}}class v extends f{constructor(){super(...arguments),this.updateBonds=!1,this.atomicRadii=[],this.elementColors=[],this.lights=[],this.bondFills=[],this.atomFills=[],this.atomOutlines=[],this.axisLabels=[],this.elementNames=["H","He","Li","Be","B","C","N","O","F","Ne","Na","Mg","Al","Si","P","S","Cl","Ar","K","Ca","Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu","Zn","Ga","Ge","As","Se","Br","Kr","Rb","Sr","Y","Zr","Nb","Mo","Tc","Ru","Rh","Pd","Ag","Cd","In","Sn","Sb","Te","I","Xe","Cs","Ba","La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu","Hf","Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi","Po","At","Rn","Fr","Ra","Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr","Rf","Ha","Sg","Ns","Hs","Mt","Ds","Rg","Cn","Nh","Fl","Mc","Lv","Ts","Og"],this.elementNumbers={H:1,He:2,Li:3,Be:4,B:5,C:6,N:7,O:8,F:9,Ne:10,Na:11,Mg:12,Al:13,Si:14,P:15,S:16,Cl:17,Ar:18,K:19,Ca:20,Sc:21,Ti:22,V:23,Cr:24,Mn:25,Fe:26,Co:27,Ni:28,Cu:29,Zn:30,Ga:31,Ge:32,As:33,Se:34,Br:35,Kr:36,Rb:37,Sr:38,Y:39,Zr:40,Nb:41,Mo:42,Tc:43,Ru:44,Rh:45,Pd:46,Ag:47,Cd:48,In:49,Sn:50,Sb:51,Te:52,I:53,Xe:54,Cs:55,Ba:56,La:57,Ce:58,Pr:59,Nd:60,Pm:61,Sm:62,Eu:63,Gd:64,Tb:65,Dy:66,Ho:67,Er:68,Tm:69,Yb:70,Lu:71,Hf:72,Ta:73,W:74,Re:75,Os:76,Ir:77,Pt:78,Au:79,Hg:80,Tl:81,Pb:82,Bi:83,Po:84,At:85,Rn:86,Fr:87,Ra:88,Ac:89,Th:90,Pa:91,U:92,Np:93,Pu:94,Am:95,Cm:96,Bk:97,Cf:98,Es:99,Fm:100,Md:101,No:102,Lr:103},this.missing=.2,this.covalentRadii=[this.missing,.31,.28,1.28,.96,.84,.76,.71,.66,.57,.58,1.66,1.41,1.21,1.11,1.07,1.05,1.02,1.06,2.03,1.76,1.7,1.6,1.53,1.39,1.39,1.32,1.26,1.24,1.32,1.22,1.22,1.2,1.19,1.2,1.2,1.16,2.2,1.95,1.9,1.75,1.64,1.54,1.47,1.46,1.42,1.39,1.45,1.44,1.42,1.39,1.39,1.38,1.39,1.4,2.44,2.15,2.07,2.04,2.03,2.01,1.99,1.98,1.98,1.96,1.94,1.92,1.92,1.89,1.9,1.87,1.87,1.75,1.7,1.62,1.51,1.44,1.41,1.36,1.36,1.32,1.45,1.46,1.48,1.4,1.5,1.5,2.6,2.21,2.15,2.06,2,1.96,1.9,1.87,1.8,1.69,this.missing,this.missing,this.missing,this.missing,this.missing,this.missing,this.missing],this.jmolColors=["#ff0000","#ffffff","#d9ffff","#cc80ff","#c2ff00","#ffb5b5","#909090","#3050f8","#ff0d0d","#90e050","#b3e3f5","#ab5cf2","#8aff00","#bfa6a6","#f0c8a0","#ff8000","#ffff30","#1ff01f","#80d1e3","#8f40d4","#3dff00","#e6e6e6","#bfc2c7","#a6a6ab","#8a99c7","#9c7ac7","#e06633","#f090a0","#50d050","#c88033","#7d80b0","#c28f8f","#668f8f","#bd80e3","#ffa100","#a62929","#5cb8d1","#702eb0","#00ff00","#94ffff","#94e0e0","#73c2c9","#54b5b5","#3b9e9e","#248f8f","#0a7d8c","#006985","#c0c0c0","#ffd98f","#a67573","#668080","#9e63b5","#d47a00","#940094","#429eb0","#57178f","#00c900","#70d4ff","#ffffc7","#d9ffc7","#c7ffc7","#a3ffc7","#8fffc7","#61ffc7","#45ffc7","#30ffc7","#1fffc7","#00ff9c","#00e675","#00d452","#00bf38","#00ab24","#4dc2ff","#4da6ff","#2194d6","#267dab","#266696","#175487","#d0d0e0","#ffd123","#b8b8d0","#a6544d","#575961","#9e4fb5","#ab5c00","#754f45","#428296","#420066","#007d00","#70abfa","#00baff","#00a1ff","#008fff","#0080ff","#006bff","#545cf2","#785ce3","#8a4fe3","#a136d4","#b31fd4","#b31fba","#b30da6","#bd0d87","#c70066","#cc0059","#d1004f","#d90045","#e00038","#e6002e","#eb0026"]}setupScenes(){this.scenes=[],this.sceneStructure=new s.Scene,this.scenes.push(this.sceneStructure),this.sceneInfo=new s.Scene,this.scenes.push(this.sceneInfo)}setOptions(t,e=!0,i=!0){var s,o,n,r,a,h,l,c;const u={view:{fitMargin:.5},layout:{periodicity:"none",translation:[0,0,0],viewCenter:"COP",wrapTolerance:.05},outline:{enabled:!0,color:"#000000",size:.025},cell:{enabled:!0,color:"#000000",linewidth:1.5,dashSize:0,gapSize:0},latticeConstants:{enabled:!0,font:"Arial",size:.7,stroke:{width:.06,color:"#000"},a:{enabled:!0,color:"#C52929",label:"a"},b:{enabled:!0,color:"#47A823",label:"b"},c:{enabled:!0,color:"#3B5796",label:"c"},alpha:{enabled:!0,color:"#ffffff",label:"α"},beta:{enabled:!0,color:"#ffffff",label:"β"},gamma:{enabled:!0,color:"#ffffff",label:"γ"}},bonds:{enabled:!0,material:{phong:{shininess:30}},color:"#ffffff",radius:.08,threshold:1,smoothness:145},atoms:{material:{phong:{shininess:30}},colors:"Jmol",radii:"covalent",scale:1,smoothness:165}};0===Object.keys(this.options).length?(this.fillOptions(t,u),super.setOptions(u)):(this.fillOptions(t,this.options),super.setOptions(this.options),i&&(this.needFullReload(t)&&void 0!==this.structure?this.load(this.structure):(void 0!==(null===(s=null==t?void 0:t.latticeConstants)||void 0===s?void 0:s.enabled)&&this.toggleLatticeConstants(t.latticeConstants.enabled),void 0!==(null===(o=null==t?void 0:t.cell)||void 0===o?void 0:o.enabled)&&this.toggleCell(t.cell.enabled),void 0!==(null===(n=null==t?void 0:t.bonds)||void 0===n?void 0:n.enabled)&&this.toggleBonds(t.bonds.enabled),void 0!==(null===(a=null===(r=null==t?void 0:t.renderer)||void 0===r?void 0:r.shadows)||void 0===a?void 0:a.enabled)&&this.toggleShadows(t.renderer.shadows.enabled))),void 0!==(null===(h=null==t?void 0:t.renderer)||void 0===h?void 0:h.background)&&this.setBackgroundColor(null===(l=null==t?void 0:t.renderer)||void 0===l?void 0:l.background.color,null===(c=null==t?void 0:t.renderer)||void 0===c?void 0:c.background.opacity),e&&this.render())}needFullReload(t){return function t(e,i){for(var s in e)if(null!==e[s]&&"[object Object]"===Object.prototype.toString.call(e[s])){if(void 0===i[s])return!0;if(t(e[s],i[s]))return!0}else if(void 0===i[s])return!0;return!1}(t,{cell:{enabled:!0},latticeConstants:{enabled:!0},bonds:{enabled:!0},shadows:{enabled:!0}})}getOptions(){return this.options}getElementInfo(){return this.elements}toggleLatticeConstants(t){void 0!==this.latticeConstants&&(this.latticeConstants.visible=t,this.angleArcs.visible=t)}toggleCell(t){void 0!==this.convCell&&(this.convCell.visible=t),void 0!==this.primCell&&(this.primCell.visible=t)}toggleBonds(t){t&&this.createBonds(),void 0!==this.bonds&&(this.bonds.visible=t)}toggleShadows(t){var e,i,s;this.renderer.shadowMap.enabled=t;for(let e=0;ethis.elementNumbers[t]);if(this.maxRadii=Math.max(...f.map(t=>this.atomicRadii[t])),p){if(!Array.isArray(p))return console.log("Invalid value for 'bonds'. Provide a list of index pairs."),!1}else p="auto";if(l.length!=f.length)return console.log("The number of positions does not match the number of labels."),!1;null!=d&&null!=d||(d=[!1,!1,!1]),this.root=new s.Object3D,this.container=new s.Object3D,this.infoContainer=new s.Object3D,this.atoms=new s.Object3D,this.bonds=new s.Object3D,this.container.add(this.atoms),this.container.add(this.bonds),this.angleArcs=new s.Object3D,this.root.add(this.container),this.sceneStructure.add(this.root),this.sceneInfo.add(this.infoContainer),this.latticeConstants=new s.Object3D,this.container.add(this.latticeConstants),this.createBasisVectors(u);let v=[],m=[];if(!0===h)for(let t=0;t0&&(x=-x),h.rotateX(x),h.updateMatrixWorld(),h.updateMatrix();let V=h.localToWorld(r.vertices[9].clone()),A=V.length();V.multiplyScalar(1+.3/A);let M=this.createLabel(V,d.toString(),u,c,a,new s.Vector2(0,0),f,p);this.latticeConstants.add(M),this.axisLabels.push(M),this.angleArcs.add(h)}}}createBasisVectors(t){if(void 0===t)return this.basisVectors=void 0,this.B=void 0,void(this.Bi=void 0);const e=(new s.Vector3).fromArray(t[0]),i=(new s.Vector3).fromArray(t[1]),o=(new s.Vector3).fromArray(t[2]);this.basisVectors=[e,i,o];const n=new s.Matrix3;n.set(e.x,i.x,o.x,e.y,i.y,o.y,e.z,i.z,o.z),this.B=n,this.Bi=(new s.Matrix3).getInverse(n)}getCornerPoints(){this.atoms.updateMatrixWorld();const t=this.atoms.children,e=t.length,i=[];for(let o=0;o.001&&!i[t]&&(c=!1)}for(let o=e.length,n=0;n!0===t)){let s=this.options.layout.periodicity;"none"===s||("wrap"===s?this.wrap(t,i):"boundary"===s?this.addBoundaryAtoms(t,e):Array.isArray(s)&&this.repeat(s,t,e))}}let o={};for(let i=t.length,n=0;ne){let t=c[e],s=c[i],o=this.atomNumbers[e],n=this.atomNumbers[i],r=s.clone().sub(t).length(),a=this.options.atoms.scale*this.atomicRadii[o],h=this.options.atoms.scale*this.atomicRadii[n];r<=1.1*this.options.bonds.threshold*(a+h)&&this.addBond(e,i,t,s,l)}}this.updateBonds=!1}almostEqual(t,e,i,s){let o=e-t;return Math.abs(i.clone().multiplyScalar(o).length())0;)e=e.next,t--;for(;t<0;)e=e.prev,t++;return e}compute(){var t;void 0===t&&(t=new s.Triangle);var e=this.edge.tail(),i=this.edge.head(),o=this.edge.next.head();return t.set(e.point,i.point,o.point),t.getNormal(this.normal),t.getMidpoint(this.midpoint),this.area=t.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(t){return this.normal.dot(t)-this.constant}}const g=function(){var t,e,i,o=new s.Vector3;function n(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new a,this.unassigned=new a,this.vertices=[]}function r(t){this.point=t,this.prev=null,this.next=null,this.face=null}function a(){this.head=null,this.tail=null}return Object.assign(n.prototype,{setFromPoints:function(t){!0!==Array.isArray(t)&&console.error("THREE.ConvexHull: Points parameter is not an array."),t.length<4&&console.error("THREE.ConvexHull: The algorithm needs at least four points."),this.makeEmpty();for(var e=0,i=t.length;ethis.tolerance)return!1}return!0},intersectRay:function(t,e){for(var i=this.faces,s=-1/0,o=1/0,n=0,r=i.length;n0&&l>=0)return null;var c=0!==l?-h/l:0;if(!(c<=0)&&(l>0?o=Math.min(c,o):s=Math.max(c,s),s>o))return null}return s!==-1/0?t.at(s,e):t.at(o,e),e},intersectsRay:function(t){return null!==this.intersectRay(t,o)},makeEmpty:function(){return this.faces=[],this.vertices=[],this},addVertexToFace:function(t,e){return t.face=e,null===e.outside?this.assigned.append(t):this.assigned.insertBefore(e.outside,t),e.outside=t,this},removeVertexFromFace:function(t,e){return t===e.outside&&(null!==t.next&&t.next.face===e?e.outside=t.next:e.outside=null),this.assigned.remove(t),this},removeAllVerticesFromFace:function(t){if(null!==t.outside){for(var e=t.outside,i=t.outside;null!==i.next&&i.next.face===t;)i=i.next;return this.assigned.removeSubList(e,i),e.prev=i.next=null,t.outside=null,e}},deleteFaceVertices:function(t,e){var i=this.removeAllVerticesFromFace(t);if(void 0!==i)if(void 0===e)this.unassigned.appendChain(i);else{var s=i;do{var o=s.next;e.distanceToPoint(s.point)>this.tolerance?this.addVertexToFace(s,e):this.unassigned.append(s),s=o}while(null!==s)}return this},resolveUnassignedPoints:function(t){if(!1===this.unassigned.isEmpty()){var e=this.unassigned.first();do{for(var i=e.next,s=this.tolerance,o=null,n=0;ns&&(s=a,o=r),s>1e3*this.tolerance)break}}null!==o&&this.addVertexToFace(e,o),e=i}while(null!==e)}return this},computeExtremes:function(){var t,e,i,o=new s.Vector3,n=new s.Vector3,r=[],a=[];for(t=0;t<3;t++)r[t]=a[t]=this.vertices[0];for(o.copy(this.vertices[0].point),n.copy(this.vertices[0].point),t=0,e=this.vertices.length;tn.getComponent(i)&&(n.setComponent(i,l.getComponent(i)),a[i]=h)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(o.x),Math.abs(n.x))+Math.max(Math.abs(o.y),Math.abs(n.y))+Math.max(Math.abs(o.z),Math.abs(n.z))),{min:r,max:a}},computeInitialHull:function(){void 0===t&&(t=new s.Line3,e=new s.Plane,i=new s.Vector3);var o,n,r,a,h,l,c,u,d,p=this.vertices,f=this.computeExtremes(),v=f.min,m=f.max,g=0,w=0;for(l=0;l<3;l++)(d=m[l].point.getComponent(l)-v[l].point.getComponent(l))>g&&(g=d,w=l);for(n=v[w],r=m[w],g=0,t.set(n.point,r.point),l=0,c=this.vertices.length;lg&&(g=d,a=o));for(g=-1,e.setFromCoplanarPoints(n.point,r.point,a.point),l=0,c=this.vertices.length;lg&&(g=d,h=o);var y=[];if(e.distanceToPoint(h.point)<0)for(y.push(new b(n,r,a),new b(h,r,n),new b(h,a,r),new b(h,n,a)),l=0;l<3;l++)u=(l+1)%3,y[l+1].getEdge(2).setTwin(y[0].getEdge(u)),y[l+1].getEdge(1).setTwin(y[u+1].getEdge(0));else for(y.push(new b(n,a,r),new b(h,n,r),new b(h,r,a),new b(h,a,n)),l=0;l<3;l++)u=(l+1)%3,y[l+1].getEdge(2).setTwin(y[0].getEdge((3-l)%3)),y[l+1].getEdge(0).setTwin(y[u+1].getEdge(1));for(l=0;l<4;l++)this.faces.push(y[l]);for(l=0,c=p.length;lg&&(g=d,C=this.faces[u]);null!==C&&this.addVertexToFace(o,C)}return this},reindexFaces:function(){for(var t=[],e=0;ee&&(e=o,t=s),s=s.next}while(null!==s&&s.face===i);return t}},computeHorizon:function(t,e,i,s){var o;this.deleteFaceVertices(i),i.mark=1,o=null===e?e=i.getEdge(0):e.next;do{var n=o.twin,r=n.face;0===r.mark&&(r.distanceToPoint(t)>this.tolerance?this.computeHorizon(t,n,r,s):s.push(o)),o=o.next}while(o!==e);return this},addAdjoiningFace:function(t,e){var i=new b(t,e.tail(),e.head());return this.faces.push(i),i.getEdge(-1).setTwin(e.twin),i.getEdge(0)},addNewFaces:function(t,e){this.newFaces=[];for(var i=null,s=null,o=0;o