diff --git a/gulpfile.js b/gulpfile.js index 42cdd78..250ab68 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,6 +15,7 @@ gulp.task('build', function() { THREE: 'libs/three.min', TrackballControls: 'libs/TrackballControls', dat: 'libs/dat.gui.min', + bigScreen: 'libs/bigscreen.min', VIS: 'libs/visualize', Velvety: "shaders/VelvetyShader" }, @@ -42,7 +43,7 @@ gulp.task('build', function() { }, VIS: { exports: "VIS", - deps: ["jquery","jqueryui"] + deps: ["jquery","jqueryui", "bigScreen"] }, viewer: { deps: [ diff --git a/public/javascript/build.js b/public/javascript/build.js index a4bd389..84a970c 100644 --- a/public/javascript/build.js +++ b/public/javascript/build.js @@ -18,6 +18,6 @@ if(l.numMorphNormals)for(l.__webglMorphNormalsBuffers=[],c=0,p=l.numMorphNormals },THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype),THREE.LineCurve3=THREE.Curve.create(function(e,t){this.v1=e,this.v2=t},function(e){var t=new THREE.Vector3;return t.subVectors(this.v2,this.v1),t.multiplyScalar(e),t.add(this.v1),t}),THREE.QuadraticBezierCurve3=THREE.Curve.create(function(e,t,i){this.v0=e,this.v1=t,this.v2=i},function(e){var t,i;return t=THREE.Shape.Utils.b2(e,this.v0.x,this.v1.x,this.v2.x),i=THREE.Shape.Utils.b2(e,this.v0.y,this.v1.y,this.v2.y),e=THREE.Shape.Utils.b2(e,this.v0.z,this.v1.z,this.v2.z),new THREE.Vector3(t,i,e)}),THREE.CubicBezierCurve3=THREE.Curve.create(function(e,t,i,r){this.v0=e,this.v1=t,this.v2=i,this.v3=r},function(e){var t,i;return t=THREE.Shape.Utils.b3(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),i=THREE.Shape.Utils.b3(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),e=THREE.Shape.Utils.b3(e,this.v0.z,this.v1.z,this.v2.z,this.v3.z),new THREE.Vector3(t,i,e)}),THREE.SplineCurve3=THREE.Curve.create(function(e){this.points=void 0==e?[]:e},function(e){var t,i=new THREE.Vector3,r=[],n=this.points,e=(n.length-1)*e;t=Math.floor(e),e-=t,r[0]=0==t?t:t-1,r[1]=t,r[2]=t>n.length-2?n.length-1:t+1,r[3]=t>n.length-3?n.length-1:t+2,t=n[r[0]];var o=n[r[1]],a=n[r[2]],r=n[r[3]];return i.x=THREE.Curve.Utils.interpolate(t.x,o.x,a.x,r.x,e),i.y=THREE.Curve.Utils.interpolate(t.y,o.y,a.y,r.y,e),i.z=THREE.Curve.Utils.interpolate(t.z,o.z,a.z,r.z,e),i}),THREE.ClosedSplineCurve3=THREE.Curve.create(function(e){this.points=void 0==e?[]:e},function(e){var t,i=new THREE.Vector3,r=[],n=this.points;return t=(n.length-0)*e,e=Math.floor(t),t-=e,e+=e>0?0:(Math.floor(Math.abs(e)/n.length)+1)*n.length,r[0]=(e-1)%n.length,r[1]=e%n.length,r[2]=(e+1)%n.length,r[3]=(e+2)%n.length,i.x=THREE.Curve.Utils.interpolate(n[r[0]].x,n[r[1]].x,n[r[2]].x,n[r[3]].x,t),i.y=THREE.Curve.Utils.interpolate(n[r[0]].y,n[r[1]].y,n[r[2]].y,n[r[3]].y,t),i.z=THREE.Curve.Utils.interpolate(n[r[0]].z,n[r[1]].z,n[r[2]].z,n[r[3]].z,t),i}),THREE.AnimationHandler=function(){var e=[],t={},i={update:function(t){for(var i=0;ie.hierarchy[i].keys[r].time&&(e.hierarchy[i].keys[r].time=0),void 0!==e.hierarchy[i].keys[r].rot&&!(e.hierarchy[i].keys[r].rot instanceof THREE.Quaternion)){var n=e.hierarchy[i].keys[r].rot;e.hierarchy[i].keys[r].rot=new THREE.Quaternion(n[0],n[1],n[2],n[3])}if(e.hierarchy[i].keys.length&&void 0!==e.hierarchy[i].keys[0].morphTargets){for(n={},r=0;ri;i++){r=this.hierarchy[i],r.matrixAutoUpdate=!0,void 0===r.animationCache&&(r.animationCache={},r.animationCache.prevKey={pos:0,rot:0,scl:0},r.animationCache.nextKey={pos:0,rot:0,scl:0},r.animationCache.originalMatrix=r instanceof THREE.Bone?r.skinMatrix:r.matrix);var o=r.animationCache.prevKey;r=r.animationCache.nextKey,o.pos=this.data.hierarchy[i].keys[0],o.rot=this.data.hierarchy[i].keys[0],o.scl=this.data.hierarchy[i].keys[0],r.pos=this.getNextKeyWith("pos",i,1),r.rot=this.getNextKeyWith("rot",i,1),r.scl=this.getNextKeyWith("scl",i,1)}this.update(0)}this.isPaused=!1,THREE.AnimationHandler.addToUpdate(this)},THREE.Animation.prototype.pause=function(){!0===this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this),this.isPaused=!this.isPaused},THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1,THREE.AnimationHandler.removeFromUpdate(this)},THREE.Animation.prototype.update=function(e){if(!1!==this.isPlaying){var t,i,r,n,o,a,s,l,c,h=["pos","rot","scl"];for(c=this.currentTime+=e*this.timeScale;this.currentTime>this.data.length;)this.currentTime-=this.data.length;l=this.currentTime%=this.data.length,parseInt(Math.min(l*this.data.fps,this.data.length*this.data.fps),10);for(var d=0,u=this.hierarchy.length;u>d;d++){e=this.hierarchy[d],s=e.animationCache;for(var p=0;3>p;p++){if(t=h[p],o=s.prevKey[t],a=s.nextKey[t],a.time<=c){if(c>=l){if(!this.loop)return void this.stop();for(o=this.data.hierarchy[d].keys[0],a=this.getNextKeyWith(t,d,1);null!==a&&a.timeo.index;)o=a,a=this.getNextKeyWith(t,d,a.index+1)}else do o=a,a=this.getNextKeyWith(t,d,a.index+1);while(null!==a&&a.timeo.index);s.prevKey[t]=o,s.nextKey[t]=a}e.matrixAutoUpdate=!0,e.matrixWorldNeedsUpdate=!0,i=(l-o.time)/(a.time-o.time),r=o[t],n=a[t],(0>i||i>1)&&(console.log("THREE.Animation.update: Warning! Scale out of bounds:"+i+" on bone "+d),i=0>i?0:1),"pos"===t?(t=e.position,this.interpolationType===THREE.AnimationHandler.LINEAR?(t.x=r[0]+(n[0]-r[0])*i,t.y=r[1]+(n[1]-r[1])*i,t.z=r[2]+(n[2]-r[2])*i):(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)&&(this.points[0]=this.getPrevKeyWith("pos",d,o.index-1).pos,this.points[1]=r,this.points[2]=n,this.points[3]=this.getNextKeyWith("pos",d,a.index+1).pos,i=.33*i+.33,r=this.interpolateCatmullRom(this.points,i),t.x=r[0],t.y=r[1],t.z=r[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(i=this.interpolateCatmullRom(this.points,1.01*i),this.target.set(i[0],i[1],i[2]),this.target.sub(t),this.target.y=0,this.target.normalize(),i=Math.atan2(this.target.x,this.target.z),e.rotation.set(0,i,0)))):"rot"===t?THREE.Quaternion.slerp(r,n,e.quaternion,i):"scl"===t&&(t=e.scale,t.x=r[0]+(n[0]-r[0])*i,t.y=r[1]+(n[1]-r[1])*i,t.z=r[2]+(n[2]-r[2])*i)}}}},THREE.Animation.prototype.interpolateCatmullRom=function(e,t){var i,r,n,o,a,s,l=[],c=[];return i=(e.length-1)*t,r=Math.floor(i),i-=r,l[0]=0===r?r:r-1,l[1]=r,l[2]=r>e.length-2?r:r+1,l[3]=r>e.length-3?r:r+2,r=e[l[0]],o=e[l[1]],a=e[l[2]],s=e[l[3]],l=i*i,n=i*l,c[0]=this.interpolate(r[0],o[0],a[0],s[0],i,l,n),c[1]=this.interpolate(r[1],o[1],a[1],s[1],i,l,n),c[2]=this.interpolate(r[2],o[2],a[2],s[2],i,l,n),c},THREE.Animation.prototype.interpolate=function(e,t,i,r,n,o,a){return e=.5*(i-e),r=.5*(r-t),(2*(t-i)+e+r)*a+(-3*(t-i)-2*e-r)*o+e*n+t},THREE.Animation.prototype.getNextKeyWith=function(e,t,i){for(var r=this.data.hierarchy[t].keys,i=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?i0?i:0:i>=0?i:i+r.length;i>=0;i--)if(void 0!==r[i][e])return r[i];return this.data.hierarchy[t].keys[r.length-1]},THREE.KeyFrameAnimation=function(e,t,i){for(this.root=e,this.data=THREE.AnimationHandler.get(t),this.hierarchy=THREE.AnimationHandler.parse(e),this.currentTime=0,this.timeScale=.001,this.isPlaying=!1,this.loop=this.isPaused=!0,this.JITCompile=void 0!==i?i:!0,e=0,t=this.hierarchy.length;t>e;e++){var i=this.data.hierarchy[e].sids,r=this.hierarchy[e];if(this.data.hierarchy[e].keys.length&&i){for(var n=0;ni;i++)r=this.hierarchy[i],n=this.data.hierarchy[i],void 0===n.animationCache&&(n.animationCache={},n.animationCache.prevKey=null,n.animationCache.nextKey=null,n.animationCache.originalMatrix=r instanceof THREE.Bone?r.skinMatrix:r.matrix),r=this.data.hierarchy[i].keys,r.length&&(n.animationCache.prevKey=r[0],n.animationCache.nextKey=r[1],this.startTime=Math.min(r[0].time,this.startTime),this.endTime=Math.max(r[r.length-1].time,this.endTime));this.update(0)}this.isPaused=!1,THREE.AnimationHandler.addToUpdate(this)},THREE.KeyFrameAnimation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this),this.isPaused=!this.isPaused},THREE.KeyFrameAnimation.prototype.stop=function(){this.isPaused=this.isPlaying=!1,THREE.AnimationHandler.removeFromUpdate(this);for(var e=0;eo)&&!this.loop){for(var e=0,c=this.hierarchy.length;c>e;e++){var h=this.data.hierarchy[e].keys,l=this.data.hierarchy[e].sids;if(r=h.length-1,n=this.hierarchy[e],h.length){for(h=0;he;e++){r=this.hierarchy[e],t=this.data.hierarchy[e];var h=t.keys,d=t.animationCache;if(this.JITCompile&&void 0!==l[e][n])r instanceof THREE.Bone?(r.skinMatrix=l[e][n],r.matrixWorldNeedsUpdate=!1):(r.matrix=l[e][n],r.matrixWorldNeedsUpdate=!0);else if(h.length){if(this.JITCompile&&d&&(r instanceof THREE.Bone?r.skinMatrix=d.originalMatrix:r.matrix=d.originalMatrix),t=d.prevKey,i=d.nextKey,t&&i){if(i.time<=a){if(s&&this.loop)for(t=h[0],i=h[1];i.time=o?t.interpolate(i,o):t.interpolate(i,i.time)}this.data.hierarchy[e].node.updateMatrix(),r.matrixWorldNeedsUpdate=!0}}if(this.JITCompile&&void 0===l[0][n])for(this.hierarchy[0].updateMatrixWorld(!0),e=0;e=0?i:i+t.length;i>=0;i--)if(t[i].hasTarget(e))return t[i];return t[t.length-1]},THREE.CubeCamera=function(e,t,i){THREE.Object3D.call(this);var r=new THREE.PerspectiveCamera(90,1,e,t);r.up.set(0,-1,0),r.lookAt(new THREE.Vector3(1,0,0)),this.add(r);var n=new THREE.PerspectiveCamera(90,1,e,t);n.up.set(0,-1,0),n.lookAt(new THREE.Vector3(-1,0,0)),this.add(n);var o=new THREE.PerspectiveCamera(90,1,e,t);o.up.set(0,0,1),o.lookAt(new THREE.Vector3(0,1,0)),this.add(o);var a=new THREE.PerspectiveCamera(90,1,e,t);a.up.set(0,0,-1),a.lookAt(new THREE.Vector3(0,-1,0)),this.add(a);var s=new THREE.PerspectiveCamera(90,1,e,t);s.up.set(0,-1,0),s.lookAt(new THREE.Vector3(0,0,1)),this.add(s);var l=new THREE.PerspectiveCamera(90,1,e,t);l.up.set(0,-1,0),l.lookAt(new THREE.Vector3(0,0,-1)),this.add(l),this.renderTarget=new THREE.WebGLRenderTargetCube(i,i,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter}),this.updateCubeMap=function(e,t){var i=this.renderTarget,c=i.generateMipmaps;i.generateMipmaps=!1,i.activeCubeFace=0,e.render(t,r,i),i.activeCubeFace=1,e.render(t,n,i),i.activeCubeFace=2,e.render(t,o,i),i.activeCubeFace=3,e.render(t,a,i),i.activeCubeFace=4,e.render(t,s,i),i.generateMipmaps=c,i.activeCubeFace=5,e.render(t,l,i)}},THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype),THREE.CombinedCamera=function(e,t,i,r,n,o,a){THREE.Camera.call(this),this.fov=i,this.left=-e/2,this.right=e/2,this.top=t/2,this.bottom=-t/2,this.cameraO=new THREE.OrthographicCamera(e/-2,e/2,t/2,t/-2,o,a),this.cameraP=new THREE.PerspectiveCamera(i,e/t,r,n),this.zoom=1,this.toPerspective()},THREE.CombinedCamera.prototype=Object.create(THREE.Camera.prototype),THREE.CombinedCamera.prototype.toPerspective=function(){this.near=this.cameraP.near,this.far=this.cameraP.far,this.cameraP.fov=this.fov/this.zoom,this.cameraP.updateProjectionMatrix(),this.projectionMatrix=this.cameraP.projectionMatrix,this.inPerspectiveMode=!0,this.inOrthographicMode=!1},THREE.CombinedCamera.prototype.toOrthographic=function(){var e=this.cameraP.aspect,t=(this.cameraP.near+this.cameraP.far)/2,t=Math.tan(this.fov/2)*t,e=2*t*e/2,t=t/this.zoom,e=e/this.zoom;this.cameraO.left=-e,this.cameraO.right=e,this.cameraO.top=t,this.cameraO.bottom=-t,this.cameraO.updateProjectionMatrix(),this.near=this.cameraO.near,this.far=this.cameraO.far,this.projectionMatrix=this.cameraO.projectionMatrix,this.inPerspectiveMode=!1,this.inOrthographicMode=!0},THREE.CombinedCamera.prototype.setSize=function(e,t){this.cameraP.aspect=e/t,this.left=-e/2,this.right=e/2,this.top=t/2,this.bottom=-t/2},THREE.CombinedCamera.prototype.setFov=function(e){this.fov=e,this.inPerspectiveMode?this.toPerspective():this.toOrthographic()},THREE.CombinedCamera.prototype.updateProjectionMatrix=function(){this.inPerspectiveMode?this.toPerspective():(this.toPerspective(),this.toOrthographic())},THREE.CombinedCamera.prototype.setLens=function(e,t){void 0===t&&(t=24);var i=2*THREE.Math.radToDeg(Math.atan(t/(2*e)));return this.setFov(i),i},THREE.CombinedCamera.prototype.setZoom=function(e){this.zoom=e,this.inPerspectiveMode?this.toPerspective():this.toOrthographic()},THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0,this.rotation.y=0,this.rotation.z=0,this.rotationAutoUpdate=!1},THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0,this.rotation.y=Math.PI,this.rotation.z=0,this.rotationAutoUpdate=!1},THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0,this.rotation.y=-Math.PI/2,this.rotation.z=0,this.rotationAutoUpdate=!1},THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0,this.rotation.y=Math.PI/2,this.rotation.z=0,this.rotationAutoUpdate=!1},THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2,this.rotation.y=0,this.rotation.z=0,this.rotationAutoUpdate=!1},THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2,this.rotation.y=0,this.rotation.z=0,this.rotationAutoUpdate=!1},THREE.CircleGeometry=function(e,t,i,r){THREE.Geometry.call(this),this.radius=e=e||50,this.segments=t=void 0!==t?Math.max(3,t):8,this.thetaStart=i=void 0!==i?i:0,this.thetaLength=r=void 0!==r?r:2*Math.PI;var n,o=[];n=new THREE.Vector3;var a=new THREE.Vector2(.5,.5);for(this.vertices.push(n),o.push(a),n=0;t>=n;n++){var s=new THREE.Vector3,l=i+n/t*r;s.x=e*Math.cos(l),s.y=e*Math.sin(l),this.vertices.push(s),o.push(new THREE.Vector2((s.x/e+1)/2,(s.y/e+1)/2))}for(i=new THREE.Vector3(0,0,1),n=1;t>=n;n++)this.faces.push(new THREE.Face3(n,n+1,0,[i.clone(),i.clone(),i.clone()])),this.faceVertexUvs[0].push([o[n].clone(),o[n+1].clone(),a.clone()]);this.computeCentroids(),this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,e)},THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CubeGeometry=function(e,t,i,r,n,o){function a(e,t,i,r,n,o,a,l){var c,h=s.widthSegments,d=s.heightSegments,u=n/2,p=o/2,f=s.vertices.length;"x"===e&&"y"===t||"y"===e&&"x"===t?c="z":"x"===e&&"z"===t||"z"===e&&"x"===t?(c="y",d=s.depthSegments):("z"===e&&"y"===t||"y"===e&&"z"===t)&&(c="x",h=s.depthSegments);var m=h+1,g=d+1,E=n/h,v=o/d,y=new THREE.Vector3;for(y[c]=a>0?1:-1,n=0;g>n;n++)for(o=0;m>o;o++){var _=new THREE.Vector3;_[e]=(o*E-u)*i,_[t]=(n*v-p)*r,_[c]=a,s.vertices.push(_)}for(n=0;d>n;n++)for(o=0;h>o;o++)p=o+m*n,e=o+m*(n+1),t=o+1+m*(n+1),i=o+1+m*n,r=new THREE.Vector2(o/h,1-n/d),a=new THREE.Vector2(o/h,1-(n+1)/d),c=new THREE.Vector2((o+1)/h,1-(n+1)/d),u=new THREE.Vector2((o+1)/h,1-n/d),p=new THREE.Face3(p+f,e+f,i+f),p.normal.copy(y),p.vertexNormals.push(y.clone(),y.clone(),y.clone()),p.materialIndex=l,s.faces.push(p),s.faceVertexUvs[0].push([r,a,u]),p=new THREE.Face3(e+f,t+f,i+f),p.normal.copy(y),p.vertexNormals.push(y.clone(),y.clone(),y.clone()),p.materialIndex=l,s.faces.push(p),s.faceVertexUvs[0].push([a.clone(),c,u.clone()])}THREE.Geometry.call(this);var s=this;this.width=e,this.height=t,this.depth=i,this.widthSegments=r||1,this.heightSegments=n||1,this.depthSegments=o||1,e=this.width/2,t=this.height/2,i=this.depth/2,a("z","y",-1,-1,this.depth,this.height,e,0),a("z","y",1,-1,this.depth,this.height,-e,1),a("x","z",1,1,this.width,this.depth,t,2),a("x","z",1,-1,this.width,this.depth,-t,3),a("x","y",1,-1,this.width,this.height,i,4),a("x","y",-1,-1,this.width,this.height,-i,5),this.computeCentroids(),this.mergeVertices()},THREE.CubeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CylinderGeometry=function(e,t,i,r,n,o){THREE.Geometry.call(this),this.radiusTop=e=void 0!==e?e:20,this.radiusBottom=t=void 0!==t?t:20,this.height=i=void 0!==i?i:100,this.radialSegments=r=r||8,this.heightSegments=n=n||1,this.openEnded=o=void 0!==o?o:!1;var a,s,l=i/2,c=[],h=[];for(s=0;n>=s;s++){var d=[],u=[],p=s/n,f=p*(t-e)+e;for(a=0;r>=a;a++){var m=a/r,g=new THREE.Vector3;g.x=f*Math.sin(2*m*Math.PI),g.y=-p*i+l,g.z=f*Math.cos(2*m*Math.PI),this.vertices.push(g),d.push(this.vertices.length-1),u.push(new THREE.Vector2(m,1-p))}c.push(d),h.push(u)}for(i=(t-e)/i,a=0;r>a;a++)for(0!==e?(d=this.vertices[c[0][a]].clone(),u=this.vertices[c[0][a+1]].clone()):(d=this.vertices[c[1][a]].clone(),u=this.vertices[c[1][a+1]].clone()),d.setY(Math.sqrt(d.x*d.x+d.z*d.z)*i).normalize(),u.setY(Math.sqrt(u.x*u.x+u.z*u.z)*i).normalize(),s=0;n>s;s++){var p=c[s][a],f=c[s+1][a],m=c[s+1][a+1],g=c[s][a+1],E=d.clone(),v=d.clone(),y=u.clone(),_=u.clone(),T=h[s][a].clone(),x=h[s+1][a].clone(),b=h[s+1][a+1].clone(),R=h[s][a+1].clone();this.faces.push(new THREE.Face3(p,f,g,[E,v,_])),this.faceVertexUvs[0].push([T,x,R]),this.faces.push(new THREE.Face3(f,m,g,[v.clone(),y,_.clone()])),this.faceVertexUvs[0].push([x.clone(),b,R.clone()])}if(!1===o&&e>0)for(this.vertices.push(new THREE.Vector3(0,l,0)),a=0;r>a;a++)p=c[0][a],f=c[0][a+1],m=this.vertices.length-1,E=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),T=h[0][a].clone(),x=h[0][a+1].clone(),b=new THREE.Vector2(x.x,0),this.faces.push(new THREE.Face3(p,f,m,[E,v,y])),this.faceVertexUvs[0].push([T,x,b]);if(!1===o&&t>0)for(this.vertices.push(new THREE.Vector3(0,-l,0)),a=0;r>a;a++)p=c[s][a+1],f=c[s][a],m=this.vertices.length-1,E=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),T=h[s][a+1].clone(),x=h[s][a].clone(),b=new THREE.Vector2(x.x,1),this.faces.push(new THREE.Face3(p,f,m,[E,v,y])),this.faceVertexUvs[0].push([T,x,b]);this.computeCentroids(),this.computeFaceNormals()},THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ExtrudeGeometry=function(e,t){"undefined"!=typeof e&&(THREE.Geometry.call(this),e=e instanceof Array?e:[e],this.shapebb=e[e.length-1].getBoundingBox(),this.addShapeList(e,t),this.computeCentroids(),this.computeFaceNormals())},THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ExtrudeGeometry.prototype.addShapeList=function(e,t){for(var i=e.length,r=0;i>r;r++)this.addShape(e[r],t)},THREE.ExtrudeGeometry.prototype.addShape=function(e,t){function i(e,t,i){return t||console.log("die"),t.clone().multiplyScalar(i).add(e)}function r(e,t,i){var r=THREE.ExtrudeGeometry.__v1,n=THREE.ExtrudeGeometry.__v2,o=THREE.ExtrudeGeometry.__v3,a=THREE.ExtrudeGeometry.__v4,s=THREE.ExtrudeGeometry.__v5,l=THREE.ExtrudeGeometry.__v6;return r.set(e.x-t.x,e.y-t.y),n.set(e.x-i.x,e.y-i.y),r=r.normalize(),n=n.normalize(),o.set(-r.y,r.x),a.set(n.y,-n.x),s.copy(e).add(o),l.copy(e).add(a),s.equals(l)?a.clone():(s.copy(t).add(o),l.copy(i).add(a),o=r.dot(a),a=l.sub(s).dot(a),0===o&&(console.log("Either infinite or no solutions!"),console.log(0===a?"Its finite solutions.":"Too bad, no solutions.")),a/=o,0>a?(t=Math.atan2(t.y-e.y,t.x-e.x),e=Math.atan2(i.y-e.y,i.x-e.x),t>e&&(e+=2*Math.PI),i=(t+e)/2,e=-Math.cos(i),i=-Math.sin(i),new THREE.Vector2(e,i)):r.multiplyScalar(a).add(s).sub(e).clone())}function n(i,r){var n,o;for(j=i.length;0<=--j;){n=j,o=j-1,0>o&&(o=i.length-1);for(var a=0,s=v+2*m,a=0;s>a;a++){var l=F*a,c=F*(a+1),h=r+n+l,l=r+o+l,d=r+o+c,c=r+n+c,u=i,p=a,f=s,g=n,E=o,h=h+M,l=l+M,d=d+M,c=c+M;S.faces.push(new THREE.Face3(h,l,c,null,null,x)),S.faces.push(new THREE.Face3(l,d,c,null,null,x)),h=b.generateSideWallUV(S,e,u,t,h,l,d,c,p,f,g,E),S.faceVertexUvs[0].push([h[0],h[1],h[3]]),S.faceVertexUvs[0].push([h[1],h[2],h[3]])}}}function o(e,t,i){S.vertices.push(new THREE.Vector3(e,t,i))}function a(i,r,n,o){i+=M,r+=M,n+=M,S.faces.push(new THREE.Face3(i,r,n,null,null,T)),i=o?b.generateBottomUV(S,e,t,i,r,n):b.generateTopUV(S,e,t,i,r,n),S.faceVertexUvs[0].push(i)}var s,l,c,h,d,u=void 0!==t.amount?t.amount:100,p=void 0!==t.bevelThickness?t.bevelThickness:6,f=void 0!==t.bevelSize?t.bevelSize:p-2,m=void 0!==t.bevelSegments?t.bevelSegments:3,g=void 0!==t.bevelEnabled?t.bevelEnabled:!0,E=void 0!==t.curveSegments?t.curveSegments:12,v=void 0!==t.steps?t.steps:1,y=t.extrudePath,_=!1,T=t.material,x=t.extrudeMaterial,b=void 0!==t.UVGenerator?t.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator;y&&(s=y.getSpacedPoints(v),_=!0,g=!1,l=void 0!==t.frames?t.frames:new THREE.TubeGeometry.FrenetFrames(y,v,!1),c=new THREE.Vector3,h=new THREE.Vector3,d=new THREE.Vector3),g||(f=p=m=0);var R,w,H,S=this,M=this.vertices.length,E=e.extractPoints(E),C=E.shape,E=E.holes;if(y=!THREE.Shape.Utils.isClockWise(C)){for(C=C.reverse(),w=0,H=E.length;H>w;w++)R=E[w],THREE.Shape.Utils.isClockWise(R)&&(E[w]=R.reverse());y=!1}var A=THREE.Shape.Utils.triangulateShape(C,E),y=C;for(w=0,H=E.length;H>w;w++)R=E[w],C=C.concat(R);var D,P,L,k,F=C.length,z=A.length,N=[],j=0,O=y.length;for(D=O-1,P=j+1;O>j;j++,D++,P++)D===O&&(D=0),P===O&&(P=0),N[j]=r(y[j],y[D],y[P]);var B,U=[],V=N.concat();for(w=0,H=E.length;H>w;w++){for(R=E[w],B=[],j=0,O=R.length,D=O-1,P=j+1;O>j;j++,D++,P++)D===O&&(D=0),P===O&&(P=0),B[j]=r(R[j],R[D],R[P]);U.push(B),V=V.concat(B)}for(D=0;m>D;D++){for(R=D/m,L=p*(1-R),P=f*Math.sin(R*Math.PI/2),j=0,O=y.length;O>j;j++)k=i(y[j],N[j],P),o(k.x,k.y,-L);for(w=0,H=E.length;H>w;w++)for(R=E[w],B=U[w],j=0,O=R.length;O>j;j++)k=i(R[j],B[j],P),o(k.x,k.y,-L)}for(P=f,j=0;F>j;j++)k=g?i(C[j],V[j],P):C[j],_?(h.copy(l.normals[0]).multiplyScalar(k.x),c.copy(l.binormals[0]).multiplyScalar(k.y),d.copy(s[0]).add(h).add(c),o(d.x,d.y,d.z)):o(k.x,k.y,0);for(R=1;v>=R;R++)for(j=0;F>j;j++)k=g?i(C[j],V[j],P):C[j],_?(h.copy(l.normals[R]).multiplyScalar(k.x),c.copy(l.binormals[R]).multiplyScalar(k.y),d.copy(s[R]).add(h).add(c),o(d.x,d.y,d.z)):o(k.x,k.y,u/v*R);for(D=m-1;D>=0;D--){for(R=D/m,L=p*(1-R),P=f*Math.sin(R*Math.PI/2),j=0,O=y.length;O>j;j++)k=i(y[j],N[j],P),o(k.x,k.y,u+L);for(w=0,H=E.length;H>w;w++)for(R=E[w],B=U[w],j=0,O=R.length;O>j;j++)k=i(R[j],B[j],P),_?o(k.x,k.y+s[v-1].y,s[v-1].x+L):o(k.x,k.y,u+L)}if(g){for(p=0*F,j=0;z>j;j++)u=A[j],a(u[2]+p,u[1]+p,u[0]+p,!0);for(p=F*(v+2*m),j=0;z>j;j++)u=A[j],a(u[0]+p,u[1]+p,u[2]+p,!1)}else{for(j=0;z>j;j++)u=A[j],a(u[2],u[1],u[0],!0);for(j=0;z>j;j++)u=A[j],a(u[0]+F*v,u[1]+F*v,u[2]+F*v,!1)}for(u=0,n(y,u),u+=y.length,w=0,H=E.length;H>w;w++)R=E[w],n(R,u),u+=R.length},THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(e,t,i,r,n,o){return t=e.vertices[n].x,n=e.vertices[n].y,i=e.vertices[o].x,o=e.vertices[o].y,[new THREE.Vector2(e.vertices[r].x,e.vertices[r].y),new THREE.Vector2(t,n),new THREE.Vector2(i,o)]},generateBottomUV:function(e,t,i,r,n,o){return this.generateTopUV(e,t,i,r,n,o)},generateSideWallUV:function(e,t,i,r,n,o,a,s){var t=e.vertices[n].x,i=e.vertices[n].y,n=e.vertices[n].z,r=e.vertices[o].x,l=e.vertices[o].y,o=e.vertices[o].z,c=e.vertices[a].x,h=e.vertices[a].y,a=e.vertices[a].z,d=e.vertices[s].x,u=e.vertices[s].y,e=e.vertices[s].z;return.01>Math.abs(i-l)?[new THREE.Vector2(t,1-n),new THREE.Vector2(r,1-o),new THREE.Vector2(c,1-a),new THREE.Vector2(d,1-e)]:[new THREE.Vector2(i,1-n),new THREE.Vector2(l,1-o),new THREE.Vector2(h,1-a),new THREE.Vector2(u,1-e)]}},THREE.ExtrudeGeometry.__v1=new THREE.Vector2,THREE.ExtrudeGeometry.__v2=new THREE.Vector2,THREE.ExtrudeGeometry.__v3=new THREE.Vector2,THREE.ExtrudeGeometry.__v4=new THREE.Vector2,THREE.ExtrudeGeometry.__v5=new THREE.Vector2,THREE.ExtrudeGeometry.__v6=new THREE.Vector2,THREE.ShapeGeometry=function(e,t){THREE.Geometry.call(this),!1==e instanceof Array&&(e=[e]),this.shapebb=e[e.length-1].getBoundingBox(),this.addShapeList(e,t),this.computeCentroids(),this.computeFaceNormals()},THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ShapeGeometry.prototype.addShapeList=function(e,t){for(var i=0,r=e.length;r>i;i++)this.addShape(e[i],t);return this},THREE.ShapeGeometry.prototype.addShape=function(e,t){void 0===t&&(t={});var i,r,n,o=t.material,a=void 0===t.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:t.UVGenerator,s=this.vertices.length;i=e.extractPoints(void 0!==t.curveSegments?t.curveSegments:12);var l=i.shape,c=i.holes;if(!THREE.Shape.Utils.isClockWise(l))for(l=l.reverse(),i=0,r=c.length;r>i;i++)n=c[i],THREE.Shape.Utils.isClockWise(n)&&(c[i]=n.reverse());var h=THREE.Shape.Utils.triangulateShape(l,c);for(i=0,r=c.length;r>i;i++)n=c[i],l=l.concat(n);for(c=l.length,r=h.length,i=0;c>i;i++)n=l[i],this.vertices.push(new THREE.Vector3(n.x,n.y,0));for(i=0;r>i;i++)c=h[i],l=c[0]+s,n=c[1]+s,c=c[2]+s,this.faces.push(new THREE.Face3(l,n,c,null,null,o)),this.faceVertexUvs[0].push(a.generateBottomUV(this,e,t,l,n,c))},THREE.LatheGeometry=function(e,t,i,r){THREE.Geometry.call(this);for(var t=t||12,i=i||0,r=r||2*Math.PI,n=1/(e.length-1),o=1/t,a=0,s=t;s>=a;a++)for(var l=i+a*o*r,c=Math.cos(l),h=Math.sin(l),l=0,d=e.length;d>l;l++){var u=e[l],p=new THREE.Vector3;p.x=c*u.x-h*u.y,p.y=h*u.x+c*u.y,p.z=u.z,this.vertices.push(p)}for(i=e.length,a=0,s=t;s>a;a++)for(l=0,d=e.length-1;d>l;l++){var t=h=l+i*a,r=h+i,c=h+1+i,h=h+1,u=a*o,p=l*n,f=u+o,m=p+n;this.faces.push(new THREE.Face3(t,r,h)),this.faceVertexUvs[0].push([new THREE.Vector2(u,p),new THREE.Vector2(f,p),new THREE.Vector2(u,m)]),this.faces.push(new THREE.Face3(r,c,h)),this.faceVertexUvs[0].push([new THREE.Vector2(f,p),new THREE.Vector2(f,m),new THREE.Vector2(u,m)])}this.mergeVertices(),this.computeCentroids(),this.computeFaceNormals(),this.computeVertexNormals()},THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PlaneGeometry=function(e,t,i,r){THREE.Geometry.call(this),this.width=e,this.height=t,this.widthSegments=i||1,this.heightSegments=r||1;for(var n=e/2,o=t/2,i=this.widthSegments,r=this.heightSegments,a=i+1,s=r+1,l=this.width/i,c=this.height/r,h=new THREE.Vector3(0,0,1),e=0;s>e;e++)for(t=0;a>t;t++)this.vertices.push(new THREE.Vector3(t*l-n,-(e*c-o),0));for(e=0;r>e;e++)for(t=0;i>t;t++){var d=t+a*e,n=t+a*(e+1),o=t+1+a*(e+1),s=t+1+a*e,l=new THREE.Vector2(t/i,1-e/r),c=new THREE.Vector2(t/i,1-(e+1)/r),u=new THREE.Vector2((t+1)/i,1-(e+1)/r),p=new THREE.Vector2((t+1)/i,1-e/r),d=new THREE.Face3(d,n,s);d.normal.copy(h),d.vertexNormals.push(h.clone(),h.clone(),h.clone()),this.faces.push(d),this.faceVertexUvs[0].push([l,c,p]),d=new THREE.Face3(n,o,s),d.normal.copy(h),d.vertexNormals.push(h.clone(),h.clone(),h.clone()),this.faces.push(d),this.faceVertexUvs[0].push([c.clone(),u,p.clone()])}this.computeCentroids()},THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.RingGeometry=function(e,t,i,r,n,o){THREE.Geometry.call(this);for(var a,e=e||0,t=t||50,n=void 0!==n?n:0,o=void 0!==o?o:2*Math.PI,i=void 0!==i?Math.max(3,i):8,r=void 0!==r?Math.max(3,r):8,s=[],l=e,c=(t-e)/r,e=0;r>=e;e++){for(a=0;i>=a;a++){var h=new THREE.Vector3,d=n+a/i*o;h.x=l*Math.cos(d),h.y=l*Math.sin(d),this.vertices.push(h),s.push(new THREE.Vector2((h.x/t+1)/2,(h.y/t+1)/2))}l+=c}for(t=new THREE.Vector3(0,0,1),e=0;r>e;e++)for(n=e*i,a=0;i>=a;a++)d=a+n,o=d+e,c=d+i+e,h=d+i+1+e,this.faces.push(new THREE.Face3(o,c,h,[t.clone(),t.clone(),t.clone()])),this.faceVertexUvs[0].push([s[o].clone(),s[c].clone(),s[h].clone()]),o=d+e,c=d+i+1+e,h=d+1+e,this.faces.push(new THREE.Face3(o,c,h,[t.clone(),t.clone(),t.clone()])),this.faceVertexUvs[0].push([s[o].clone(),s[c].clone(),s[h].clone()]);this.computeCentroids(),this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,l)},THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.SphereGeometry=function(e,t,i,r,n,o,a){THREE.Geometry.call(this),this.radius=e=e||50,this.widthSegments=t=Math.max(3,Math.floor(t)||8),this.heightSegments=i=Math.max(2,Math.floor(i)||6),this.phiStart=r=void 0!==r?r:0,this.phiLength=n=void 0!==n?n:2*Math.PI,this.thetaStart=o=void 0!==o?o:0,this.thetaLength=a=void 0!==a?a:Math.PI;var s,l,c=[],h=[];for(l=0;i>=l;l++){var d=[],u=[];for(s=0;t>=s;s++){var p=s/t,f=l/i,m=new THREE.Vector3;m.x=-e*Math.cos(r+p*n)*Math.sin(o+f*a),m.y=e*Math.cos(o+f*a),m.z=e*Math.sin(r+p*n)*Math.sin(o+f*a),this.vertices.push(m),d.push(this.vertices.length-1),u.push(new THREE.Vector2(p,1-f))}c.push(d),h.push(u)}for(l=0;lt;t++)for(this.grid[t]=[],i=t/(r-1),c=e.getPointAt(i),o=h[t],a=d[t],i=0;in;n++)o=n/(t-1),s[n]=e.getTangentAt(o),s[n].normalize();for(l[0]=new THREE.Vector3,c[0]=new THREE.Vector3,e=Number.MAX_VALUE,n=Math.abs(s[0].x),o=Math.abs(s[0].y),a=Math.abs(s[0].z),e>=n&&(e=n,r.set(1,0,0)),e>=o&&(e=o,r.set(0,1,0)),e>=a&&r.set(0,0,1),h.crossVectors(s[0],r).normalize(),l[0].crossVectors(s[0],h),c[0].crossVectors(s[0],l[0]),n=1;t>n;n++)l[n]=l[n-1].clone(),c[n]=c[n-1].clone(),h.crossVectors(s[n-1],s[n]),1e-4n;n++)l[n].applyMatrix4(d.makeRotationAxis(s[n],r*n)),c[n].crossVectors(s[n],l[n])},THREE.PolyhedronGeometry=function(e,t,i,r){function n(e){var t=e.normalize().clone();t.index=s.vertices.push(t)-1;var i=Math.atan2(e.z,-e.x)/2/Math.PI+.5,e=Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5;return t.uv=new THREE.Vector2(i,1-e),t}function o(e,t,i){var r=new THREE.Face3(e.index,t.index,i.index,[e.clone(),t.clone(),i.clone()]);r.centroid.add(e).add(t).add(i).divideScalar(3),s.faces.push(r),r=Math.atan2(r.centroid.z,-r.centroid.x),s.faceVertexUvs[0].push([a(e.uv,e,r),a(t.uv,t,r),a(i.uv,i,r)])}function a(e,t,i){return 0>i&&1===e.x&&(e=new THREE.Vector2(e.x-1,e.y)),0===t.x&&0===t.z&&(e=new THREE.Vector2(i/2/Math.PI+.5,e.y)),e.clone()}THREE.Geometry.call(this);for(var i=i||1,r=r||0,s=this,l=0,c=e.length;c>l;l++)n(new THREE.Vector3(e[l][0],e[l][1],e[l][2]));for(var h=this.vertices,e=[],l=0,c=t.length;c>l;l++){var d=h[t[l][0]],u=h[t[l][1]],p=h[t[l][2]];e[l]=new THREE.Face3(d.index,u.index,p.index,[d.clone(),u.clone(),p.clone()])}for(l=0,c=e.length;c>l;l++){u=e[l],h=r,t=Math.pow(2,h),Math.pow(4,h);for(var h=n(s.vertices[u.a]),d=n(s.vertices[u.b]),f=n(s.vertices[u.c]),u=[],p=0;t>=p;p++){u[p]=[];for(var m=n(h.clone().lerp(f,p/t)),g=n(d.clone().lerp(f,p/t)),E=t-p,v=0;E>=v;v++)u[p][v]=0==v&&p==t?m:n(m.clone().lerp(g,v/E))}for(p=0;t>p;p++)for(v=0;2*(t-p)-1>v;v++)h=Math.floor(v/2),0==v%2?o(u[p][h+1],u[p+1][h],u[p][h]):o(u[p][h+1],u[p+1][h+1],u[p+1][h])}for(l=0,c=this.faceVertexUvs[0].length;c>l;l++)r=this.faceVertexUvs[0][l],e=r[0].x,t=r[1].x,h=r[2].x,d=Math.max(e,Math.max(t,h)),u=Math.min(e,Math.min(t,h)),d>.9&&.1>u&&(.2>e&&(r[0].x+=1),.2>t&&(r[1].x+=1),.2>h&&(r[2].x+=1));for(l=0,c=this.vertices.length;c>l;l++)this.vertices[l].multiplyScalar(i);this.mergeVertices(),this.computeCentroids(),this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,i)},THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.IcosahedronGeometry=function(e,t){this.radius=e,this.detail=t;var i=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[[-1,i,0],[1,i,0],[-1,-i,0],[1,-i,0],[0,-1,i],[0,1,i],[0,-1,-i],[0,1,-i],[i,0,-1],[i,0,1],[-i,0,-1],[-i,0,1]],[[0,11,5],[0,5,1],[0,1,7],[0,7,10],[0,10,11],[1,5,9],[5,11,4],[11,10,2],[10,7,6],[7,1,8],[3,9,4],[3,4,2],[3,2,6],[3,6,8],[3,8,9],[4,9,5],[2,4,11],[6,2,10],[8,6,7],[9,8,1]],e,t)},THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.OctahedronGeometry=function(e,t){THREE.PolyhedronGeometry.call(this,[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],[[0,2,4],[0,4,3],[0,3,5],[0,5,2],[1,2,5],[1,5,3],[1,3,4],[1,4,2]],e,t)},THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TetrahedronGeometry=function(e,t){THREE.PolyhedronGeometry.call(this,[[1,1,1],[-1,-1,1],[-1,1,-1],[1,-1,-1]],[[2,1,0],[0,3,2],[1,3,0],[2,3,1]],e,t)},THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ParametricGeometry=function(e,t,i){THREE.Geometry.call(this);var r,n,o,a,s=this.vertices,l=this.faces,c=this.faceVertexUvs[0],h=t+1;for(r=0;i>=r;r++)for(a=r/i,n=0;t>=n;n++)o=n/t,o=e(o,a),s.push(o);var d,u,p,f;for(r=0;i>r;r++)for(n=0;t>n;n++)e=r*h+n,s=r*h+n+1,a=(r+1)*h+n+1,o=(r+1)*h+n,d=new THREE.Vector2(n/t,r/i),u=new THREE.Vector2((n+1)/t,r/i),p=new THREE.Vector2((n+1)/t,(r+1)/i),f=new THREE.Vector2(n/t,(r+1)/i),l.push(new THREE.Face3(e,s,o)),c.push([d,u,f]),l.push(new THREE.Face3(s,a,o)),c.push([u.clone(),p,f.clone()]);this.computeCentroids(),this.computeFaceNormals(),this.computeVertexNormals()},THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.AxisHelper=function(e){var e=e||1,t=new THREE.Geometry;t.vertices.push(new THREE.Vector3,new THREE.Vector3(e,0,0),new THREE.Vector3,new THREE.Vector3(0,e,0),new THREE.Vector3,new THREE.Vector3(0,0,e)),t.colors.push(new THREE.Color(16711680),new THREE.Color(16755200),new THREE.Color(65280),new THREE.Color(11206400),new THREE.Color(255),new THREE.Color(43775)),e=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors}),THREE.Line.call(this,t,e,THREE.LinePieces)},THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype),THREE.ArrowHelper=function(e,t,i,r,n,o){THREE.Object3D.call(this),void 0===r&&(r=16776960),void 0===i&&(i=1),void 0===n&&(n=.2*i),void 0===o&&(o=.2*n),this.position=t,t=new THREE.Geometry,t.vertices.push(new THREE.Vector3(0,0,0)),t.vertices.push(new THREE.Vector3(0,1,0)),this.line=new THREE.Line(t,new THREE.LineBasicMaterial({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),t=new THREE.CylinderGeometry(0,.5,1,5,1),t.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0)),this.cone=new THREE.Mesh(t,new THREE.MeshBasicMaterial({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,n,o)},THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.ArrowHelper.prototype.setDirection=function(){var e,t=new THREE.Vector3;return function(i){.99999i.y?this.quaternion.set(1,0,0,0):(t.set(i.z,0,-i.x).normalize(),e=Math.acos(i.y),this.quaternion.setFromAxisAngle(t,e))}}(),THREE.ArrowHelper.prototype.setLength=function(e,t,i){void 0===t&&(t=.2*e),void 0===i&&(i=.2*t),this.line.scale.set(1,e,1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()},THREE.ArrowHelper.prototype.setColor=function(e){this.line.material.color.setHex(e),this.cone.material.color.setHex(e)},THREE.BoxHelper=function(e){var t=[new THREE.Vector3(1,1,1),new THREE.Vector3(-1,1,1),new THREE.Vector3(-1,-1,1),new THREE.Vector3(1,-1,1),new THREE.Vector3(1,1,-1),new THREE.Vector3(-1,1,-1),new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,-1,-1)];this.vertices=t;var i=new THREE.Geometry;i.vertices.push(t[0],t[1],t[1],t[2],t[2],t[3],t[3],t[0],t[4],t[5],t[5],t[6],t[6],t[7],t[7],t[4],t[0],t[4],t[1],t[5],t[2],t[6],t[3],t[7]),THREE.Line.call(this,i,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces),void 0!==e&&this.update(e)},THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype),THREE.BoxHelper.prototype.update=function(e){var t=e.geometry;null===t.boundingBox&&t.computeBoundingBox();var i=t.boundingBox.min,t=t.boundingBox.max,r=this.vertices;r[0].set(t.x,t.y,t.z),r[1].set(i.x,t.y,t.z),r[2].set(i.x,i.y,t.z),r[3].set(t.x,i.y,t.z),r[4].set(t.x,t.y,i.z),r[5].set(i.x,t.y,i.z),r[6].set(i.x,i.y,i.z),r[7].set(t.x,i.y,i.z),this.geometry.computeBoundingSphere(),this.geometry.verticesNeedUpdate=!0,this.matrixAutoUpdate=!1,this.matrixWorld=e.matrixWorld},THREE.BoundingBoxHelper=function(e,t){var i=t||8947848;this.object=e,this.box=new THREE.Box3,THREE.Mesh.call(this,new THREE.CubeGeometry(1,1,1),new THREE.MeshBasicMaterial({color:i,wireframe:!0}))},THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},THREE.CameraHelper=function(e){function t(e,t,r){i(e,r),i(t,r)}function i(e,t){r.vertices.push(new THREE.Vector3),r.colors.push(new THREE.Color(t)),void 0===o[e]&&(o[e]=[]),o[e].push(r.vertices.length-1)}var r=new THREE.Geometry,n=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),o={};t("n1","n2",16755200),t("n2","n4",16755200),t("n4","n3",16755200),t("n3","n1",16755200),t("f1","f2",16755200),t("f2","f4",16755200),t("f4","f3",16755200),t("f3","f1",16755200),t("n1","f1",16755200),t("n2","f2",16755200),t("n3","f3",16755200),t("n4","f4",16755200),t("p","n1",16711680),t("p","n2",16711680),t("p","n3",16711680),t("p","n4",16711680),t("u1","u2",43775),t("u2","u3",43775),t("u3","u1",43775),t("c","t",16777215),t("p","c",3355443),t("cn1","cn2",3355443),t("cn3","cn4",3355443),t("cf1","cf2",3355443),t("cf3","cf4",3355443),THREE.Line.call(this,r,n,THREE.LinePieces),this.camera=e,this.matrixWorld=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()},THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype),THREE.CameraHelper.prototype.update=function(){var e=new THREE.Vector3,t=new THREE.Camera,i=new THREE.Projector;return function(){function r(r,o,a,s){if(e.set(o,a,s),i.unprojectVector(e,t),r=n.pointMap[r],void 0!==r)for(o=0,a=r.length;a>o;o++)n.geometry.vertices[r[o]].copy(e)}var n=this;t.projectionMatrix.copy(this.camera.projectionMatrix),r("c",0,0,-1),r("t",0,0,1),r("n1",-1,-1,-1),r("n2",1,-1,-1),r("n3",-1,1,-1),r("n4",1,1,-1),r("f1",-1,-1,1),r("f2",1,-1,1),r("f3",-1,1,1),r("f4",1,1,1),r("u1",.7,1.1,-1),r("u2",-.7,1.1,-1),r("u3",0,2,-1),r("cf1",-1,0,1),r("cf2",1,0,1),r("cf3",0,-1,1),r("cf4",0,1,1),r("cn1",-1,0,-1),r("cn2",1,0,-1),r("cn3",0,-1,-1),r("cn4",0,1,-1),this.geometry.verticesNeedUpdate=!0}}(),THREE.DirectionalLightHelper=function(e,t){THREE.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrixWorld=e.matrixWorld,this.matrixAutoUpdate=!1;var t=t||1,i=new THREE.PlaneGeometry(t,t),r=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});r.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new THREE.Mesh(i,r),this.add(this.lightPlane),i=new THREE.Geometry,i.vertices.push(new THREE.Vector3),i.vertices.push(new THREE.Vector3),r=new THREE.LineBasicMaterial({fog:!1}),r.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new THREE.Line(i,r),this.add(this.targetLine),this.update()},THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},THREE.DirectionalLightHelper.prototype.update=function(){var e=new THREE.Vector3,t=new THREE.Vector3,i=new THREE.Vector3;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),i.subVectors(t,e),this.lightPlane.lookAt(i),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(i),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),THREE.FaceNormalsHelper=function(e,t,i,r){this.object=e,this.size=t||1;for(var e=i||16776960,r=r||1,t=new THREE.Geometry,i=0,n=this.object.geometry.faces.length;n>i;i++)t.vertices.push(new THREE.Vector3),t.vertices.push(new THREE.Vector3);THREE.Line.call(this,t,new THREE.LineBasicMaterial({color:e,linewidth:r}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.FaceNormalsHelper.prototype.update=function(){var e=new THREE.Vector3;return function(){this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var t=this.geometry.vertices,i=this.object.geometry.faces,r=this.object.matrixWorld,n=0,o=i.length;o>n;n++){var a=i[n];e.copy(a.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);var s=2*n;t[s].copy(a.centroid).applyMatrix4(r),t[s+1].addVectors(t[s],e)}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.GridHelper=function(e,t){var i=new THREE.Geometry,r=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924),this.color2=new THREE.Color(8947848);for(var n=-e;e>=n;n+=t){i.vertices.push(new THREE.Vector3(-e,0,n),new THREE.Vector3(e,0,n),new THREE.Vector3(n,0,-e),new THREE.Vector3(n,0,e));var o=0===n?this.color1:this.color2;i.colors.push(o,o,o,o)}THREE.Line.call(this,i,r,THREE.LinePieces)},THREE.GridHelper.prototype=Object.create(THREE.Line.prototype),THREE.GridHelper.prototype.setColors=function(e,t){this.color1.set(e),this.color2.set(t),this.geometry.colorsNeedUpdate=!0},THREE.HemisphereLightHelper=function(e,t){THREE.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrixWorld=e.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new THREE.Color,new THREE.Color];var i=new THREE.SphereGeometry(t,4,2);i.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var r=0;8>r;r++)i.faces[r].color=this.colors[4>r?0:1];r=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0}),this.lightSphere=new THREE.Mesh(i,r),this.add(this.lightSphere),this.update()},THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},THREE.HemisphereLightHelper.prototype.update=function(){var e=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),THREE.PointLightHelper=function(e,t){this.light=e,this.light.updateMatrixWorld();var i=new THREE.SphereGeometry(t,4,2),r=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});r.color.copy(this.light.color).multiplyScalar(this.light.intensity),THREE.Mesh.call(this,i,r),this.matrixWorld=this.light.matrixWorld,this.matrixAutoUpdate=!1},THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},THREE.SpotLightHelper=function(e){THREE.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrixWorld=e.matrixWorld,this.matrixAutoUpdate=!1,e=new THREE.CylinderGeometry(0,1,1,8,1,!0),e.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0)),e.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));var t=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(e,t),this.add(this.cone),this.update()},THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},THREE.SpotLightHelper.prototype.update=function(){var e=new THREE.Vector3,t=new THREE.Vector3;return function(){var i=this.light.distance?this.light.distance:1e4,r=i*Math.tan(this.light.angle);this.cone.scale.set(r,r,i),e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t.sub(e)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),THREE.VertexNormalsHelper=function(e,t,i,r){this.object=e,this.size=t||1;for(var t=i||16711680,r=r||1,i=new THREE.Geometry,e=e.geometry.faces,n=0,o=e.length;o>n;n++)for(var a=0,s=e[n].vertexNormals.length;s>a;a++)i.vertices.push(new THREE.Vector3),i.vertices.push(new THREE.Vector3);THREE.Line.call(this,i,new THREE.LineBasicMaterial({color:t,linewidth:r}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexNormalsHelper.prototype.update=function(){var e=new THREE.Vector3;return function(){var t=["a","b","c","d"];this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var i=this.geometry.vertices,r=this.object.geometry.vertices,n=this.object.geometry.faces,o=this.object.matrixWorld,a=0,s=0,l=n.length;l>s;s++)for(var c=n[s],h=0,d=c.vertexNormals.length;d>h;h++){var u=c.vertexNormals[h];i[a].copy(r[c[t[h]]]).applyMatrix4(o),e.copy(u).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size),e.add(i[a]),a+=1,i[a].copy(e),a+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.VertexTangentsHelper=function(e,t,i,r){this.object=e,this.size=t||1;for(var t=i||255,r=r||1,i=new THREE.Geometry,e=e.geometry.faces,n=0,o=e.length;o>n;n++)for(var a=0,s=e[n].vertexTangents.length;s>a;a++)i.vertices.push(new THREE.Vector3),i.vertices.push(new THREE.Vector3);THREE.Line.call(this,i,new THREE.LineBasicMaterial({color:t,linewidth:r}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.update()},THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexTangentsHelper.prototype.update=function(){var e=new THREE.Vector3;return function(){var t=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var i=this.geometry.vertices,r=this.object.geometry.vertices,n=this.object.geometry.faces,o=this.object.matrixWorld,a=0,s=0,l=n.length;l>s;s++)for(var c=n[s],h=0,d=c.vertexTangents.length;d>h;h++){var u=c.vertexTangents[h];i[a].copy(r[c[t[h]]]).applyMatrix4(o),e.copy(u).transformDirection(o).multiplyScalar(this.size),e.add(i[a]),a+=1,i[a].copy(e),a+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.WireframeHelper=function(e){var t=[0,0],i={},r=function(e,t){return e-t},n=["a","b","c","d"],o=new THREE.BufferGeometry,a=0;if(e.geometry instanceof THREE.Geometry){for(var s=e.geometry.vertices,l=e.geometry.faces,c=new Uint32Array(6*l.length),h=0,d=l.length;d>h;h++)for(var u=l[h],p=0;3>p;p++){t[0]=u[n[p]],t[1]=u[n[(p+1)%3]],t.sort(r);var f=t.toString();void 0===i[f]&&(c[2*a]=t[0],c[2*a+1]=t[1],i[f]=!0,a++)}for(o.addAttribute("position",Float32Array,2*a,3),t=o.attributes.position.array,h=0,d=a;d>h;h++)for(p=0;2>p;p++)a=s[c[2*h+p]],n=6*h+3*p,t[n+0]=a.x,t[n+1]=a.y,t[n+2]=a.z}else{for(s=e.geometry.attributes.position.array,l=e.geometry.attributes.index.array,c=new Uint32Array(2*l.length),h=0,d=l.length/3;d>h;h++)for(p=0;3>p;p++)n=3*h,t[0]=l[n+p],t[1]=l[n+(p+1)%3],t.sort(r),f=t.toString(),void 0===i[f]&&(c[2*a]=t[0],c[2*a+1]=t[1],i[f]=!0,a++);for(o.addAttribute("position",Float32Array,2*a,3),t=o.attributes.position.array,h=0,d=a;d>h;h++)for(p=0;2>p;p++)n=6*h+3*p,a=3*c[2*h+p],t[n+0]=s[a],t[n+1]=s[a+1],t[n+2]=s[a+2]}THREE.Line.call(this,o,new THREE.LineBasicMaterial({color:16777215}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.matrixWorld=e.matrixWorld},THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype),THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this),this.render=function(){}},THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype),THREE.LensFlare=function(e,t,i,r,n){THREE.Object3D.call(this),this.lensFlares=[],this.positionScreen=new THREE.Vector3,this.customUpdateCallback=void 0,void 0!==e&&this.add(e,t,i,r,n)},THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype),THREE.LensFlare.prototype.add=function(e,t,i,r,n,o){void 0===t&&(t=-1),void 0===i&&(i=0),void 0===o&&(o=1),void 0===n&&(n=new THREE.Color(16777215)),void 0===r&&(r=THREE.NormalBlending),i=Math.min(i,Math.max(0,i)),this.lensFlares.push({texture:e,size:t,distance:i,x:0,y:0,z:0,scale:1,rotation:1,opacity:o,color:n,blending:r})},THREE.LensFlare.prototype.updateLensFlares=function(){var e,t,i=this.lensFlares.length,r=2*-this.positionScreen.x,n=2*-this.positionScreen.y;for(e=0;i>e;e++)t=this.lensFlares[e],t.x=this.positionScreen.x+r*t.distance,t.y=this.positionScreen.y+n*t.distance,t.wantedRotation=.25*t.x*Math.PI,t.rotation+=.25*(t.wantedRotation-t.rotation)},THREE.MorphBlendMesh=function(e,t){THREE.Mesh.call(this,e,t),this.animationsMap={},this.animationsList=[];var i=this.geometry.morphTargets.length;this.createAnimation("__default",0,i-1,i/1),this.setAnimationWeight("__default",1)},THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphBlendMesh.prototype.createAnimation=function(e,t,i,r){t={startFrame:t,endFrame:i,length:i-t+1,fps:r,duration:(i-t)/r,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1},this.animationsMap[e]=t,this.animationsList.push(t)},THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(e){for(var t,i=/([a-z]+)(\d+)/,r={},n=this.geometry,o=0,a=n.morphTargets.length;a>o;o++){var s=n.morphTargets[o].name.match(i);if(s&&1s.end&&(s.end=o),t||(t=l)}}for(l in r)s=r[l],this.createAnimation(l,s.start,s.end,e);this.firstAnimation=t},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(e){(e=this.animationsMap[e])&&(e.direction=1,e.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(e){(e=this.animationsMap[e])&&(e.direction=-1,e.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(e,t){var i=this.animationsMap[e];i&&(i.fps=t,i.duration=(i.end-i.start)/i.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(e,t){var i=this.animationsMap[e];i&&(i.duration=t,i.fps=(i.end-i.start)/i.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(e,t){var i=this.animationsMap[e];i&&(i.weight=t)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(e,t){var i=this.animationsMap[e];i&&(i.time=t)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(e){var t=0;return(e=this.animationsMap[e])&&(t=e.time),t},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(e){var t=-1;return(e=this.animationsMap[e])&&(t=e.duration),t},THREE.MorphBlendMesh.prototype.playAnimation=function(e){var t=this.animationsMap[e];t?(t.time=0,t.active=!0):console.warn("animation["+e+"] undefined")},THREE.MorphBlendMesh.prototype.stopAnimation=function(e){(e=this.animationsMap[e])&&(e.active=!1)},THREE.MorphBlendMesh.prototype.update=function(e){for(var t=0,i=this.animationsList.length;i>t;t++){var r=this.animationsList[t];if(r.active){var n=r.duration/r.length;r.time+=r.direction*e,r.mirroredLoop?(r.time>r.duration||0>r.time)&&(r.direction*=-1,r.time>r.duration&&(r.time=r.duration,r.directionBackwards=!0),0>r.time&&(r.time=0,r.directionBackwards=!1)):(r.time%=r.duration,0>r.time&&(r.time+=r.duration));var o=r.startFrame+THREE.Math.clamp(Math.floor(r.time/n),0,r.length-1),a=r.weight;o!==r.currentFrame&&(this.morphTargetInfluences[r.lastFrame]=0,this.morphTargetInfluences[r.currentFrame]=1*a,this.morphTargetInfluences[o]=0,r.lastFrame=r.currentFrame,r.currentFrame=o),n=r.time%n/n,r.directionBackwards&&(n=1-n),this.morphTargetInfluences[r.currentFrame]=n*a,this.morphTargetInfluences[r.lastFrame]=(1-n)*a}}},THREE.LensFlarePlugin=function(){function e(e,i){var r=t.createProgram(),n=t.createShader(t.FRAGMENT_SHADER),o=t.createShader(t.VERTEX_SHADER),a="precision "+i+" float;\n";return t.shaderSource(n,a+e.fragmentShader),t.shaderSource(o,a+e.vertexShader),t.compileShader(n),t.compileShader(o),t.attachShader(r,n),t.attachShader(r,o),t.linkProgram(r),r}var t,i,r,n,o,a,s,l,c,h,d,u,p;this.init=function(f){t=f.context,i=f,r=f.getPrecision(),n=new Float32Array(16),o=new Uint16Array(6),f=0,n[f++]=-1,n[f++]=-1,n[f++]=0,n[f++]=0,n[f++]=1,n[f++]=-1,n[f++]=1,n[f++]=0,n[f++]=1,n[f++]=1,n[f++]=1,n[f++]=1,n[f++]=-1,n[f++]=1,n[f++]=0,n[f++]=1,f=0,o[f++]=0,o[f++]=1,o[f++]=2,o[f++]=0,o[f++]=2,o[f++]=3,a=t.createBuffer(),s=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,n,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,s),t.bufferData(t.ELEMENT_ARRAY_BUFFER,o,t.STATIC_DRAW),l=t.createTexture(),c=t.createTexture(),t.bindTexture(t.TEXTURE_2D,l),t.texImage2D(t.TEXTURE_2D,0,t.RGB,16,16,0,t.RGB,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.bindTexture(t.TEXTURE_2D,c),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,16,16,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),0>=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(h=!1,d=e(THREE.ShaderFlares.lensFlare,r)):(h=!0,d=e(THREE.ShaderFlares.lensFlareVertexTexture,r)),u={},p={},u.vertex=t.getAttribLocation(d,"position"),u.uv=t.getAttribLocation(d,"uv"),p.renderType=t.getUniformLocation(d,"renderType"),p.map=t.getUniformLocation(d,"map"),p.occlusionMap=t.getUniformLocation(d,"occlusionMap"),p.opacity=t.getUniformLocation(d,"opacity"),p.color=t.getUniformLocation(d,"color"),p.scale=t.getUniformLocation(d,"scale"),p.rotation=t.getUniformLocation(d,"rotation"),p.screenPosition=t.getUniformLocation(d,"screenPosition")},this.render=function(e,r,n,o){var e=e.__webglFlares,f=e.length;if(f){var m=new THREE.Vector3,g=o/n,E=.5*n,v=.5*o,y=16/o,_=new THREE.Vector2(y*g,y),T=new THREE.Vector3(1,1,0),x=new THREE.Vector2(1,1),b=p,y=u;t.useProgram(d),t.enableVertexAttribArray(u.vertex),t.enableVertexAttribArray(u.uv),t.uniform1i(b.occlusionMap,0),t.uniform1i(b.map,1),t.bindBuffer(t.ARRAY_BUFFER,a),t.vertexAttribPointer(y.vertex,2,t.FLOAT,!1,16,0),t.vertexAttribPointer(y.uv,2,t.FLOAT,!1,16,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,s),t.disable(t.CULL_FACE),t.depthMask(!1);var R,w,H,S,M;for(R=0;f>R;R++)if(y=16/o,_.set(y*g,y),S=e[R],m.set(S.matrixWorld.elements[12],S.matrixWorld.elements[13],S.matrixWorld.elements[14]),m.applyMatrix4(r.matrixWorldInverse),m.applyProjection(r.projectionMatrix),T.copy(m),x.x=T.x*E+E,x.y=T.y*v+v,h||0w;w++)M=S.lensFlares[w],.001p;p++)if(m=d.__lights[p],m.castShadow)if(m instanceof THREE.DirectionalLight&&m.shadowCascade)for(E=0;ER;R++)_[R]=new THREE.Vector3,v[R]=new THREE.Vector3;_=T.shadowCascadeNearZ[y],T=T.shadowCascadeFarZ[y],v[0].set(-1,-1,_),v[1].set(1,-1,_),v[2].set(-1,1,_),v[3].set(1,1,_),v[4].set(-1,-1,T),v[5].set(1,-1,T),v[6].set(-1,1,T),v[7].set(1,1,T),b.originalCamera=u,v=new THREE.Gyroscope,v.position=m.shadowCascadeOffset,v.add(b),v.add(b.target),u.add(v),m.shadowCascadeArray[E]=b,console.log("Created virtualLight",b)}y=m,_=E,T=y.shadowCascadeArray[_],T.position.copy(y.position),T.target.position.copy(y.target.position),T.lookAt(T.target),T.shadowCameraVisible=y.shadowCameraVisible,T.shadowDarkness=y.shadowDarkness,T.shadowBias=y.shadowCascadeBias[_],v=y.shadowCascadeNearZ[_],y=y.shadowCascadeFarZ[_],T=T.pointsFrustum,T[0].z=v,T[1].z=v,T[2].z=v,T[3].z=v,T[4].z=y,T[5].z=y,T[6].z=y,T[7].z=y,x[g]=b,g++}else x[g]=m,g++;for(p=0,f=x.length;f>p;p++){if(m=x[p],m.shadowMap||(E=THREE.LinearFilter,t.shadowMapType===THREE.PCFSoftShadowMap&&(E=THREE.NearestFilter),m.shadowMap=new THREE.WebGLRenderTarget(m.shadowMapWidth,m.shadowMapHeight,{minFilter:E,magFilter:E,format:THREE.RGBAFormat}),m.shadowMapSize=new THREE.Vector2(m.shadowMapWidth,m.shadowMapHeight),m.shadowMatrix=new THREE.Matrix4),!m.shadowCamera){if(m instanceof THREE.SpotLight)m.shadowCamera=new THREE.PerspectiveCamera(m.shadowCameraFov,m.shadowMapWidth/m.shadowMapHeight,m.shadowCameraNear,m.shadowCameraFar);else{if(!(m instanceof THREE.DirectionalLight)){console.error("Unsupported light type for shadow");continue}m.shadowCamera=new THREE.OrthographicCamera(m.shadowCameraLeft,m.shadowCameraRight,m.shadowCameraTop,m.shadowCameraBottom,m.shadowCameraNear,m.shadowCameraFar)}d.add(m.shadowCamera),!0===d.autoUpdate&&d.updateMatrixWorld()}if(m.shadowCameraVisible&&!m.cameraHelper&&(m.cameraHelper=new THREE.CameraHelper(m.shadowCamera),m.shadowCamera.add(m.cameraHelper)),m.isVirtual&&b.originalCamera==u){for(E=u,g=m.shadowCamera,v=m.pointsFrustum,T=m.pointsWorld,l.set(1/0,1/0,1/0),c.set(-1/0,-1/0,-1/0),y=0;8>y;y++)_=T[y],_.copy(v[y]),THREE.ShadowMapPlugin.__projector.unprojectVector(_,E),_.applyMatrix4(g.matrixWorldInverse),_.xc.x&&(c.x=_.x),_.yc.y&&(c.y=_.y),_.zc.z&&(c.z=_.z);g.left=l.x,g.right=c.x,g.top=c.y,g.bottom=l.y,g.updateProjectionMatrix()}for(g=m.shadowMap,v=m.shadowMatrix,E=m.shadowCamera,E.position.setFromMatrixPosition(m.matrixWorld),h.setFromMatrixPosition(m.target.matrixWorld),E.lookAt(h),E.updateMatrixWorld(),E.matrixWorldInverse.getInverse(E.matrixWorld),m.cameraHelper&&(m.cameraHelper.visible=m.shadowCameraVisible),m.shadowCameraVisible&&m.cameraHelper.update(),v.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),v.multiply(E.projectionMatrix),v.multiply(E.matrixWorldInverse),s.multiplyMatrices(E.projectionMatrix,E.matrixWorldInverse),a.setFromMatrix(s),t.setRenderTarget(g),t.clear(),T=d.__webglObjects,m=0,g=T.length;g>m;m++)y=T[m],v=y.object,y.render=!1,!v.visible||!v.castShadow||(v instanceof THREE.Mesh||v instanceof THREE.ParticleSystem)&&v.frustumCulled&&!a.intersectsObject(v)||(v._modelViewMatrix.multiplyMatrices(E.matrixWorldInverse,v.matrixWorld),y.render=!0);for(m=0,g=T.length;g>m;m++)y=T[m],y.render&&(v=y.object,y=y.buffer,R=v.material instanceof THREE.MeshFaceMaterial?v.material.materials[0]:v.material,_=0m;m++)y=T[m],v=y.object,v.visible&&v.castShadow&&(v._modelViewMatrix.multiplyMatrices(E.matrixWorldInverse,v.matrixWorld),t.renderImmediateObject(E,d.__lights,null,i,v))}p=t.getClearColor(),f=t.getClearAlpha(),e.clearColor(p.r,p.g,p.b,f),e.enable(e.BLEND),t.shadowMapCullFace===THREE.CullFaceFront&&e.cullFace(e.BACK)}},THREE.ShadowMapPlugin.__projector=new THREE.Projector,THREE.SpritePlugin=function(){function e(e,t){return e.z!==t.z?t.z-e.z:t.id-e.id}var t,i,r,n,o,a,s,l,c,h,d,u,p,f,m,g,E,v,y,_,T,x,b,R,w;this.init=function(e){v=e.context,y=e,T=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),x=new Uint16Array([0,1,2,0,2,3]),b=v.createBuffer(),R=v.createBuffer(),v.bindBuffer(v.ARRAY_BUFFER,b),v.bufferData(v.ARRAY_BUFFER,T,v.STATIC_DRAW),v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,R),v.bufferData(v.ELEMENT_ARRAY_BUFFER,x,v.STATIC_DRAW);var e=v.createProgram(),H=v.createShader(v.VERTEX_SHADER),S=v.createShader(v.FRAGMENT_SHADER);v.shaderSource(H,["precision "+y.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n")),v.shaderSource(S,["precision "+y.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")),v.compileShader(H),v.compileShader(S),v.attachShader(e,H),v.attachShader(e,S),v.linkProgram(e),w=e,g=v.getAttribLocation(w,"position"),E=v.getAttribLocation(w,"uv"),t=v.getUniformLocation(w,"uvOffset"),i=v.getUniformLocation(w,"uvScale"),r=v.getUniformLocation(w,"rotation"),n=v.getUniformLocation(w,"scale"),o=v.getUniformLocation(w,"color"),a=v.getUniformLocation(w,"map"),s=v.getUniformLocation(w,"opacity"),l=v.getUniformLocation(w,"modelViewMatrix"),c=v.getUniformLocation(w,"projectionMatrix"),h=v.getUniformLocation(w,"fogType"),d=v.getUniformLocation(w,"fogDensity"),u=v.getUniformLocation(w,"fogNear"),p=v.getUniformLocation(w,"fogFar"),f=v.getUniformLocation(w,"fogColor"),m=v.getUniformLocation(w,"alphaTest"),e=document.createElement("canvas"),e.width=8,e.height=8,H=e.getContext("2d"),H.fillStyle="#ffffff",H.fillRect(0,0,e.width,e.height),_=new THREE.Texture(e),_.needsUpdate=!0},this.render=function(T,x){var H=T.__webglSprites,S=H.length;if(S){v.useProgram(w),v.enableVertexAttribArray(g),v.enableVertexAttribArray(E),v.disable(v.CULL_FACE),v.enable(v.BLEND),v.bindBuffer(v.ARRAY_BUFFER,b),v.vertexAttribPointer(g,2,v.FLOAT,!1,16,0),v.vertexAttribPointer(E,2,v.FLOAT,!1,16,8),v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,R),v.uniformMatrix4fv(c,!1,x.projectionMatrix.elements),v.activeTexture(v.TEXTURE0),v.uniform1i(a,0);var M=0,C=0,A=T.fog;A?(v.uniform3f(f,A.color.r,A.color.g,A.color.b),A instanceof THREE.Fog?(v.uniform1f(u,A.near),v.uniform1f(p,A.far),v.uniform1i(h,1),C=M=1):A instanceof THREE.FogExp2&&(v.uniform1f(d,A.density),v.uniform1i(h,2),C=M=2)):(v.uniform1i(h,0),C=M=0);for(var D,P,L=[],A=0;S>A;A++)D=H[A],!1!==D.visible&&(D._modelViewMatrix.multiplyMatrices(x.matrixWorldInverse,D.matrixWorld),D.z=-D._modelViewMatrix.elements[14]);for(H.sort(e),A=0;S>A;A++)D=H[A],!1!==D.visible&&(P=D.material,v.uniform1f(m,P.alphaTest),v.uniformMatrix4fv(l,!1,D._modelViewMatrix.elements),L[0]=D.scale.x,L[1]=D.scale.y,D=T.fog&&P.fog?C:0,M!==D&&(v.uniform1i(h,D),M=D),v.uniform2f(i,P.uvScale.x,P.uvScale.y),v.uniform2f(t,P.uvOffset.x,P.uvOffset.y),v.uniform1f(s,P.opacity),v.uniform3f(o,P.color.r,P.color.g,P.color.b),v.uniform1f(r,P.rotation),v.uniform2fv(n,L),y.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst),y.setDepthTest(P.depthTest),y.setDepthWrite(P.depthWrite),P.map&&P.map.image&&P.map.image.width?y.setTexture(P.map,0):y.setTexture(_,0),v.drawElements(v.TRIANGLES,6,v.UNSIGNED_SHORT,0));v.enable(v.CULL_FACE)}}},THREE.DepthPassPlugin=function(){this.enabled=!1,this.renderTarget=null;var e,t,i,r,n,o,a=new THREE.Frustum,s=new THREE.Matrix4;this.init=function(a){e=a.context,t=a;var a=THREE.ShaderLib.depthRGBA,s=THREE.UniformsUtils.clone(a.uniforms);i=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:s}),r=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:s,morphTargets:!0}),n=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:s,skinning:!0}),o=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:s,morphTargets:!0,skinning:!0}),i._shadowPass=!0,r._shadowPass=!0,n._shadowPass=!0,o._shadowPass=!0},this.render=function(e,t){this.enabled&&this.update(e,t)},this.update=function(l,c){var h,d,u,p,f,m;for(e.clearColor(1,1,1,1),e.disable(e.BLEND),t.setDepthTest(!0),!0===l.autoUpdate&&l.updateMatrixWorld(),c.matrixWorldInverse.getInverse(c.matrixWorld),s.multiplyMatrices(c.projectionMatrix,c.matrixWorldInverse),a.setFromMatrix(s),t.setRenderTarget(this.renderTarget),t.clear(),m=l.__webglObjects,h=0,d=m.length;d>h;h++)u=m[h],f=u.object,u.render=!1,!f.visible||(f instanceof THREE.Mesh||f instanceof THREE.ParticleSystem)&&f.frustumCulled&&!a.intersectsObject(f)||(f._modelViewMatrix.multiplyMatrices(c.matrixWorldInverse,f.matrixWorld),u.render=!0);var g;for(h=0,d=m.length;d>h;h++)u=m[h],!u.render||(f=u.object,u=u.buffer,f instanceof THREE.ParticleSystem&&!f.customDepthMaterial)||((g=f.material instanceof THREE.MeshFaceMaterial?f.material.materials[0]:f.material)&&t.setMaterialFaces(f.material),p=0h;h++)u=m[h],f=u.object,f.visible&&(f._modelViewMatrix.multiplyMatrices(c.matrixWorldInverse,f.matrixWorld),t.renderImmediateObject(c,l.__lights,null,i,f));h=t.getClearColor(),d=t.getClearAlpha(),e.clearColor(h.r,h.g,h.b,d),e.enable(e.BLEND)}},THREE.ShaderFlares={lensFlareVertexTexture:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *= visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},lensFlare:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}},define("THREE",function(e){return function(){var t;return t||e.THREE}}(this)),function(){var e=this,t=e._,i={},r=Array.prototype,n=Object.prototype,o=Function.prototype,a=r.push,s=r.slice,l=r.concat,c=n.toString,h=n.hasOwnProperty,d=r.forEach,u=r.map,p=r.reduce,f=r.reduceRight,m=r.filter,g=r.every,E=r.some,v=r.indexOf,y=r.lastIndexOf,_=Array.isArray,T=Object.keys,x=o.bind,b=function(e){return e instanceof b?e:this instanceof b?void(this._wrapped=e):new b(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=b),exports._=b):e._=b,b.VERSION="1.6.0";var R=b.each=b.forEach=function(e,t,r){if(null==e)return e;if(d&&e.forEach===d)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,o=e.length;o>n;n++)if(t.call(r,e[n],n,e)===i)return}else for(var a=b.keys(e),n=0,o=a.length;o>n;n++)if(t.call(r,e[a[n]],a[n],e)===i)return;return e};b.map=b.collect=function(e,t,i){var r=[];return null==e?r:u&&e.map===u?e.map(t,i):(R(e,function(e,n,o){r.push(t.call(i,e,n,o))}),r)};var w="Reduce of empty array with no initial value";b.reduce=b.foldl=b.inject=function(e,t,i,r){var n=arguments.length>2;if(null==e&&(e=[]),p&&e.reduce===p)return r&&(t=b.bind(t,r)),n?e.reduce(t,i):e.reduce(t);if(R(e,function(e,o,a){n?i=t.call(r,i,e,o,a):(i=e,n=!0)}),!n)throw new TypeError(w);return i},b.reduceRight=b.foldr=function(e,t,i,r){var n=arguments.length>2;if(null==e&&(e=[]),f&&e.reduceRight===f)return r&&(t=b.bind(t,r)),n?e.reduceRight(t,i):e.reduceRight(t);var o=e.length;if(o!==+o){var a=b.keys(e);o=a.length}if(R(e,function(s,l,c){l=a?a[--o]:--o,n?i=t.call(r,i,e[l],l,c):(i=e[l],n=!0)}),!n)throw new TypeError(w);return i},b.find=b.detect=function(e,t,i){var r;return H(e,function(e,n,o){return t.call(i,e,n,o)?(r=e,!0):void 0}),r},b.filter=b.select=function(e,t,i){var r=[];return null==e?r:m&&e.filter===m?e.filter(t,i):(R(e,function(e,n,o){t.call(i,e,n,o)&&r.push(e)}),r)},b.reject=function(e,t,i){return b.filter(e,function(e,r,n){return!t.call(i,e,r,n)},i)},b.every=b.all=function(e,t,r){t||(t=b.identity);var n=!0;return null==e?n:g&&e.every===g?e.every(t,r):(R(e,function(e,o,a){return(n=n&&t.call(r,e,o,a))?void 0:i}),!!n)};var H=b.some=b.any=function(e,t,r){t||(t=b.identity);var n=!1;return null==e?n:E&&e.some===E?e.some(t,r):(R(e,function(e,o,a){return n||(n=t.call(r,e,o,a))?i:void 0}),!!n)};b.contains=b.include=function(e,t){return null==e?!1:v&&e.indexOf===v?-1!=e.indexOf(t):H(e,function(e){return e===t})},b.invoke=function(e,t){var i=s.call(arguments,2),r=b.isFunction(t);return b.map(e,function(e){return(r?t:e[t]).apply(e,i)})},b.pluck=function(e,t){return b.map(e,b.property(t))},b.where=function(e,t){return b.filter(e,b.matches(t))},b.findWhere=function(e,t){return b.find(e,b.matches(t))},b.max=function(e,t,i){if(!t&&b.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);var r=-1/0,n=-1/0;return R(e,function(e,o,a){var s=t?t.call(i,e,o,a):e;s>n&&(r=e,n=s)}),r},b.min=function(e,t,i){if(!t&&b.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);var r=1/0,n=1/0;return R(e,function(e,o,a){var s=t?t.call(i,e,o,a):e;n>s&&(r=e,n=s)}),r},b.shuffle=function(e){var t,i=0,r=[];return R(e,function(e){t=b.random(i++),r[i-1]=r[t],r[t]=e}),r},b.sample=function(e,t,i){return null==t||i?(e.length!==+e.length&&(e=b.values(e)),e[b.random(e.length-1)]):b.shuffle(e).slice(0,Math.max(0,t))};var S=function(e){return null==e?b.identity:b.isFunction(e)?e:b.property(e)};b.sortBy=function(e,t,i){return t=S(t),b.pluck(b.map(e,function(e,r,n){return{value:e,index:r,criteria:t.call(i,e,r,n)}}).sort(function(e,t){var i=e.criteria,r=t.criteria;if(i!==r){if(i>r||void 0===i)return 1;if(r>i||void 0===r)return-1}return e.index-t.index}),"value")};var M=function(e){return function(t,i,r){var n={};return i=S(i),R(t,function(o,a){var s=i.call(r,o,a,t);e(n,s,o)}),n}};b.groupBy=M(function(e,t,i){b.has(e,t)?e[t].push(i):e[t]=[i]}),b.indexBy=M(function(e,t,i){e[t]=i}),b.countBy=M(function(e,t){b.has(e,t)?e[t]++:e[t]=1}),b.sortedIndex=function(e,t,i,r){i=S(i);for(var n=i.call(r,t),o=0,a=e.length;a>o;){var s=o+a>>>1;i.call(r,e[s])t?[]:s.call(e,0,t)},b.initial=function(e,t,i){return s.call(e,0,e.length-(null==t||i?1:t))},b.last=function(e,t,i){return null==e?void 0:null==t||i?e[e.length-1]:s.call(e,Math.max(e.length-t,0))},b.rest=b.tail=b.drop=function(e,t,i){return s.call(e,null==t||i?1:t)},b.compact=function(e){return b.filter(e,b.identity)};var C=function(e,t,i){return t&&b.every(e,b.isArray)?l.apply(i,e):(R(e,function(e){b.isArray(e)||b.isArguments(e)?t?a.apply(i,e):C(e,t,i):i.push(e)}),i)};b.flatten=function(e,t){return C(e,t,[])},b.without=function(e){return b.difference(e,s.call(arguments,1))},b.partition=function(e,t){var i=[],r=[];return R(e,function(e){(t(e)?i:r).push(e)}),[i,r]},b.uniq=b.unique=function(e,t,i,r){b.isFunction(t)&&(r=i,i=t,t=!1);var n=i?b.map(e,i,r):e,o=[],a=[];return R(n,function(i,r){(t?r&&a[a.length-1]===i:b.contains(a,i))||(a.push(i),o.push(e[r]))}),o},b.union=function(){return b.uniq(b.flatten(arguments,!0))},b.intersection=function(e){var t=s.call(arguments,1);return b.filter(b.uniq(e),function(e){return b.every(t,function(t){return b.contains(t,e)})})},b.difference=function(e){var t=l.apply(r,s.call(arguments,1));return b.filter(e,function(e){return!b.contains(t,e)})},b.zip=function(){for(var e=b.max(b.pluck(arguments,"length").concat(0)),t=new Array(e),i=0;e>i;i++)t[i]=b.pluck(arguments,""+i);return t},b.object=function(e,t){if(null==e)return{};for(var i={},r=0,n=e.length;n>r;r++)t?i[e[r]]=t[r]:i[e[r][0]]=e[r][1];return i},b.indexOf=function(e,t,i){if(null==e)return-1;var r=0,n=e.length;if(i){if("number"!=typeof i)return r=b.sortedIndex(e,t),e[r]===t?r:-1;r=0>i?Math.max(0,n+i):i}if(v&&e.indexOf===v)return e.indexOf(t,i);for(;n>r;r++)if(e[r]===t)return r;return-1},b.lastIndexOf=function(e,t,i){if(null==e)return-1;var r=null!=i;if(y&&e.lastIndexOf===y)return r?e.lastIndexOf(t,i):e.lastIndexOf(t);for(var n=r?i:e.length;n--;)if(e[n]===t)return n;return-1},b.range=function(e,t,i){arguments.length<=1&&(t=e||0,e=0),i=arguments[2]||1;for(var r=Math.max(Math.ceil((t-e)/i),0),n=0,o=new Array(r);r>n;)o[n++]=e,e+=i;return o};var A=function(){};b.bind=function(e,t){var i,r;if(x&&e.bind===x)return x.apply(e,s.call(arguments,1));if(!b.isFunction(e))throw new TypeError;return i=s.call(arguments,2),r=function(){if(!(this instanceof r))return e.apply(t,i.concat(s.call(arguments)));A.prototype=e.prototype;var n=new A;A.prototype=null;var o=e.apply(n,i.concat(s.call(arguments)));return Object(o)===o?o:n}},b.partial=function(e){var t=s.call(arguments,1);return function(){for(var i=0,r=t.slice(),n=0,o=r.length;o>n;n++)r[n]===b&&(r[n]=arguments[i++]);for(;i=h?(clearTimeout(a),a=null,s=c,o=e.apply(r,n),r=n=null):a||i.trailing===!1||(a=setTimeout(l,h)),o}},b.debounce=function(e,t,i){var r,n,o,a,s,l=function(){var c=b.now()-a;t>c?r=setTimeout(l,t-c):(r=null,i||(s=e.apply(o,n),o=n=null))};return function(){o=this,n=arguments,a=b.now();var c=i&&!r;return r||(r=setTimeout(l,t)),c&&(s=e.apply(o,n),o=n=null),s}},b.once=function(e){var t,i=!1;return function(){return i?t:(i=!0,t=e.apply(this,arguments),e=null,t)}},b.wrap=function(e,t){return b.partial(t,e)},b.compose=function(){var e=arguments;return function(){for(var t=arguments,i=e.length-1;i>=0;i--)t=[e[i].apply(this,t)];return t[0]}},b.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},b.keys=function(e){if(!b.isObject(e))return[];if(T)return T(e);var t=[];for(var i in e)b.has(e,i)&&t.push(i);return t},b.values=function(e){for(var t=b.keys(e),i=t.length,r=new Array(i),n=0;i>n;n++)r[n]=e[t[n]];return r},b.pairs=function(e){for(var t=b.keys(e),i=t.length,r=new Array(i),n=0;i>n;n++)r[n]=[t[n],e[t[n]]];return r},b.invert=function(e){for(var t={},i=b.keys(e),r=0,n=i.length;n>r;r++)t[e[i[r]]]=i[r];return t},b.functions=b.methods=function(e){var t=[];for(var i in e)b.isFunction(e[i])&&t.push(i);return t.sort()},b.extend=function(e){return R(s.call(arguments,1),function(t){if(t)for(var i in t)e[i]=t[i]}),e},b.pick=function(e){var t={},i=l.apply(r,s.call(arguments,1));return R(i,function(i){i in e&&(t[i]=e[i])}),t},b.omit=function(e){var t={},i=l.apply(r,s.call(arguments,1));for(var n in e)b.contains(i,n)||(t[n]=e[n]);return t},b.defaults=function(e){return R(s.call(arguments,1),function(t){if(t)for(var i in t)void 0===e[i]&&(e[i]=t[i])}),e},b.clone=function(e){return b.isObject(e)?b.isArray(e)?e.slice():b.extend({},e):e},b.tap=function(e,t){return t(e),e};var D=function(e,t,i,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;e instanceof b&&(e=e._wrapped),t instanceof b&&(t=t._wrapped);var n=c.call(e);if(n!=c.call(t))return!1;switch(n){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if("object"!=typeof e||"object"!=typeof t)return!1;for(var o=i.length;o--;)if(i[o]==e)return r[o]==t;var a=e.constructor,s=t.constructor;if(a!==s&&!(b.isFunction(a)&&a instanceof a&&b.isFunction(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1;i.push(e),r.push(t);var l=0,h=!0;if("[object Array]"==n){if(l=e.length,h=l==t.length)for(;l--&&(h=D(e[l],t[l],i,r)););}else{for(var d in e)if(b.has(e,d)&&(l++,!(h=b.has(t,d)&&D(e[d],t[d],i,r))))break;if(h){for(d in t)if(b.has(t,d)&&!l--)break;h=!l}}return i.pop(),r.pop(),h};b.isEqual=function(e,t){return D(e,t,[],[])},b.isEmpty=function(e){if(null==e)return!0;if(b.isArray(e)||b.isString(e))return 0===e.length;for(var t in e)if(b.has(e,t))return!1;return!0},b.isElement=function(e){return!(!e||1!==e.nodeType)},b.isArray=_||function(e){return"[object Array]"==c.call(e)},b.isObject=function(e){return e===Object(e)},R(["Arguments","Function","String","Number","Date","RegExp"],function(e){b["is"+e]=function(t){return c.call(t)=="[object "+e+"]"}}),b.isArguments(arguments)||(b.isArguments=function(e){return!(!e||!b.has(e,"callee"))}),"function"!=typeof/./&&(b.isFunction=function(e){return"function"==typeof e}),b.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},b.isNaN=function(e){return b.isNumber(e)&&e!=+e},b.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"==c.call(e)},b.isNull=function(e){return null===e},b.isUndefined=function(e){return void 0===e},b.has=function(e,t){return h.call(e,t)},b.noConflict=function(){return e._=t,this},b.identity=function(e){return e},b.constant=function(e){return function(){return e}},b.property=function(e){return function(t){return t[e]}},b.matches=function(e){return function(t){if(t===e)return!0;for(var i in e)if(e[i]!==t[i])return!1;return!0}},b.times=function(e,t,i){for(var r=Array(Math.max(0,e)),n=0;e>n;n++)r[n]=t.call(i,n);return r},b.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},b.now=Date.now||function(){return(new Date).getTime()};var P={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};P.unescape=b.invert(P.escape);var L={escape:new RegExp("["+b.keys(P.escape).join("")+"]","g"),unescape:new RegExp("("+b.keys(P.unescape).join("|")+")","g")};b.each(["escape","unescape"],function(e){b[e]=function(t){return null==t?"":(""+t).replace(L[e],function(t){return P[e][t]})}}),b.result=function(e,t){if(null==e)return void 0;var i=e[t];return b.isFunction(i)?i.call(e):i},b.mixin=function(e){R(b.functions(e),function(t){var i=b[t]=e[t];b.prototype[t]=function(){var e=[this._wrapped];return a.apply(e,arguments),j.call(this,i.apply(b,e))}})};var k=0;b.uniqueId=function(e){var t=++k+"";return e?e+t:t},b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},N=/\\|'|\r|\n|\t|\u2028|\u2029/g;b.template=function(e,t,i){var r;i=b.defaults({},i,b.templateSettings);var n=new RegExp([(i.escape||F).source,(i.interpolate||F).source,(i.evaluate||F).source].join("|")+"|$","g"),o=0,a="__p+='";e.replace(n,function(t,i,r,n,s){return a+=e.slice(o,s).replace(N,function(e){return"\\"+z[e]}),i&&(a+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'"),r&&(a+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),n&&(a+="';\n"+n+"\n__p+='"),o=s+t.length,t}),a+="';\n",i.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(i.variable||"obj","_",a)}catch(s){throw s.source=a,s}if(t)return r(t,b);var l=function(e){return r.call(this,e,b)};return l.source="function("+(i.variable||"obj")+"){\n"+a+"}",l},b.chain=function(e){return b(e).chain()};var j=function(e){return this._chain?b(e).chain():e};b.mixin(b),R(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];b.prototype[e]=function(){var i=this._wrapped;return t.apply(i,arguments),"shift"!=e&&"splice"!=e||0!==i.length||delete i[0],j.call(this,i)}}),R(["concat","join","slice"],function(e){var t=r[e];b.prototype[e]=function(){return j.call(this,t.apply(this._wrapped,arguments))}}),b.extend(b.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return b})}.call(this),define("assembly",["THREE"],function(e){function t(e,t,i){this._rootID=e,this._defaultColor=t,this._loader=i,this._objects=[],this._product=void 0}return t.prototype.getCADjs=function(){return this._loader._parent},t.prototype.getID=function(){return this._product?this._product.getID():"id0"},t.prototype.isChild=function(e){return void 0!==this._objects[e]},t.prototype.getChild=function(e){return this._objects[e]},t.prototype.makeChild=function(e,t){if(!e)throw new Error("null id");var i=this._objects[e];return i?i:(this._objects[e]=t,null)},t.prototype.setRootProduct=function(e){this._product=e},t.prototype.name=function(){return this._product?this._product._stepFile?this._product._stepFile:this._product._name:"Assembly"},t.prototype.getBoundingBox=function(){return this._product?this._product.getBoundingBox():new e.Box3},t.prototype.showBoundingBox=function(){this._product&&this._product.showBoundingBox()},t.prototype.hideBoundingBox=function(){this._product&&this._product.hideBoundingBox()},t.prototype.getByID=function(e){var t=void 0;if("id0"===e)t=this;else if("undefined"!=typeof e){var i=e.split("_");t=this._objects[i[0]],i.length>1&&"0"!==i[1]&&(t=t._instances[i[1]-1])}return t},t.prototype.toggleTransparency=function(){this._product&&this._product.toggleTransparency()},t.prototype.setOpacity=function(e){this._product&&this._product.setOpacity(e)},t.prototype.showAll=function(){this._product&&this._product.getObject3D().traverse(function(e){e.visible=!0})},t.prototype.hideAll=function(){this._product&&this._product.getObject3D().traverse(function(e){e.visible=!1 -})},t.prototype.toggleVisibility=function(){return this._product._object3D.visible?this.hide():this.show(),this._product._object3D.visible},t.prototype.hide=function(){this._product&&this._product.hide()},t.prototype.show=function(){this._product&&this._product.show()},t.prototype.hideAllBoundingBoxes=function(){this.dispatchEvent({type:"_hideBounding"})},t.prototype.clearHighlights=function(){this.dispatchEvent({type:"_clearHighlights"})},t.prototype.clearOpacity=function(){this.dispatchEvent({type:"_clearOpacity"})},t.prototype.getTree=function(){var e={id:"id0",text:this.name(),state:{opened:!0,disabled:!1,selected:!1},children:[]};return this._product&&e.children.push(this._product.getTree()),e},t.prototype.centerGeometry=function(){if(this._product){var t=this._product.getBoundingBox();if(!t.empty()){var i=(t.max.x+t.min.x)/-2,r=(t.max.y+t.min.y)/-2,n=(t.max.z+t.min.z)/-2;this._product.getObject3D().applyMatrix((new e.Matrix4).makeTranslation(i,r,n))}}},t.prototype.zoomToFit=function(t,i){var r=this._product.getBoundingBox(),n=.5*r.size().length(),o=2*Math.atan(e.Math.degToRad(.5*t.fov)*t.aspect),a=Math.min(e.Math.degToRad(t.fov),o),s=n/Math.sin(.5*a),l=new e.Vector3,c=t.position.clone().sub(i.target).normalize().multiplyScalar(s);i.sceneRadius=n,i.target0.copy(l.clone()),i.position0.copy(c.clone()),i.up0.copy(t.up.clone()),i.reset()},t.prototype.select=function(t,i,r){if(!this._product)return void 0;i=i/window.innerWidth*2-1,r=2*-(r/window.innerHeight)+1;var n=new e.Vector3(i,r,.999),o=new e.Projector;o.unprojectVector(n,t),n.sub(t.position).normalize();var a=new e.Raycaster(t.position,n),s=a.intersectObjects(this._product.getObject3D().children,!0),l=void 0;if(s.length>0){for(var c=void 0,h=0;he,t.material.depthWrite=1===e,t.material.uniforms.opacity.value=e)})},t.prototype.toggleVisibility=function(){return this._object3D.visible?this.hide():this.show(),this._object3D.visible},t.prototype.toggleTransparency=function(){this.setOpacity(this.isTransparent()?1:.5)},t.prototype.isTransparent=function(){var e=!1,t=function(t){!e&&t.material&&t.material.uniforms.opacity&&(e=t.material.uniforms.opacity.value<1)};return t(this._object3D),e||this._object3D.traverse(t),e},t.prototype.hide=function(){this._object3D.traverse(function(e){e.visible=!1})},t.prototype.show=function(){this._object3D.traverse(function(e){e.visible=!0})},t.prototype.explode=function(){},e.EventDispatcher.prototype.apply(t.prototype),t}),define("text",["module"],function(e){var t,i,r,n,o,a=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],s=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,l=/]*>\s*([\s\S]+)\s*<\/body>/im,c="undefined"!=typeof location&&location.href,h=c&&location.protocol&&location.protocol.replace(/\:/,""),d=c&&location.hostname,u=c&&(location.port||void 0),p={},f=e.config&&e.config()||{};return t={version:"2.0.10",strip:function(e){if(e){e=e.replace(s,"");var t=e.match(l);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:f.createXhr||function(){var e,t,i;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(t=0;3>t;t+=1){i=a[t];try{e=new ActiveXObject(i)}catch(r){}if(e){a=[i];break}}return e},parseName:function(e){var t,i,r,n=!1,o=e.indexOf("."),a=0===e.indexOf("./")||0===e.indexOf("../");return-1!==o&&(!a||o>1)?(t=e.substring(0,o),i=e.substring(o+1,e.length)):t=e,r=i||t,o=r.indexOf("!"),-1!==o&&(n="strip"===r.substring(o+1),r=r.substring(0,o),i?i=r:t=r),{moduleName:t,ext:i,strip:n}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,i,r,n){var o,a,s,l=t.xdRegExp.exec(e);return l?(o=l[2],a=l[3],a=a.split(":"),s=a[1],a=a[0],!(o&&o!==i||a&&a.toLowerCase()!==r.toLowerCase()||(s||a)&&s!==n)):!0},finishLoad:function(e,i,r,n){r=i?t.strip(r):r,f.isBuild&&(p[e]=r),n(r)},load:function(e,i,r,n){if(n.isBuild&&!n.inlineText)return void r();f.isBuild=n.isBuild;var o=t.parseName(e),a=o.moduleName+(o.ext?"."+o.ext:""),s=i.toUrl(a),l=f.useXhr||t.useXhr;return 0===s.indexOf("empty:")?void r():void(!c||l(s,h,d,u)?t.get(s,function(i){t.finishLoad(e,o.strip,i,r)},function(e){r.error&&r.error(e)}):i([a],function(e){t.finishLoad(o.moduleName+"."+o.ext,o.strip,e,r)}))},write:function(e,i,r){if(p.hasOwnProperty(i)){var n=t.jsEscape(p[i]);r.asModule(e+"!"+i,"define(function () { return '"+n+"';});\n")}},writeFile:function(e,i,r,n,o){var a=t.parseName(i),s=a.ext?"."+a.ext:"",l=a.moduleName+s,c=r.toUrl(a.moduleName+s)+".js";t.load(l,r,function(){var i=function(e){return n(c,e)};i.asModule=function(e,t){return n.asModule(e,c,t)},t.write(e,l,i,o)},o)}},"node"===f.env||!f.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(i=require.nodeRequire("fs"),t.get=function(e,t,r){try{var n=i.readFileSync(e,"utf8");0===n.indexOf("")&&(n=n.substring(1)),t(n)}catch(o){r(o)}}):"xhr"===f.env||!f.env&&t.createXhr()?t.get=function(e,i,r,n){var o,a=t.createXhr();if(a.open("GET",e,!0),n)for(o in n)n.hasOwnProperty(o)&&a.setRequestHeader(o.toLowerCase(),n[o]);f.onXhr&&f.onXhr(a,e),a.onreadystatechange=function(){var t,n;4===a.readyState&&(t=a.status,t>399&&600>t?(n=new Error(e+" HTTP status: "+t),n.xhr=a,r(n)):i(a.responseText),f.onXhrComplete&&f.onXhrComplete(a,e))},a.send(null)}:"rhino"===f.env||!f.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?t.get=function(e,t){var i,r,n="utf-8",o=new java.io.File(e),a=java.lang.System.getProperty("line.separator"),s=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(o),n)),l="";try{for(i=new java.lang.StringBuffer,r=s.readLine(),r&&r.length()&&65279===r.charAt(0)&&(r=r.substring(1)),null!==r&&i.append(r);null!==(r=s.readLine());)i.append(a),i.append(r);l=String(i.toString())}finally{s.close()}t(l)}:("xpconnect"===f.env||!f.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(r=Components.classes,n=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),o="@mozilla.org/windows-registry-key;1"in r,t.get=function(e,t){var i,a,s,l={};o&&(e=e.replace(/\//g,"\\")),s=new FileUtils.File(e);try{i=r["@mozilla.org/network/file-input-stream;1"].createInstance(n.nsIFileInputStream),i.init(s,1,0,!1),a=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(n.nsIConverterInputStream),a.init(i,"utf-8",i.available(),n.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),a.readString(i.available(),l),a.close(),i.close(),t(l.value)}catch(c){throw new Error((s&&s.path||"")+": "+c)}}),t}),define("text!shaders/VelvetyShader-vertex.glsl",[],function(){return"varying vec3 fNormal;\nvarying vec3 fPosition;\nvarying vec3 fColor;\n\nconst float minColorBrightness = 0.15;\n\n// This ensures that black colored shapes are not rendered as solid black by\n// effectively making dark colors slightly lighter.\nvec3 applyMinColorBrightness(vec3 color)\n{\n if (length(color) < minColorBrightness * 3.0) {\n return color + minColorBrightness;\n } else {\n return color;\n }\n}\n\nvoid main()\n{\n vec4 pos = modelViewMatrix * vec4(position, 1.0);\n vec3 N = normalMatrix * normal;\n vec3 I = pos.xyz;\n fNormal = normalize(faceforward(N, I, N));\n fColor = applyMinColorBrightness(color);\n fPosition = I;\n gl_Position = projectionMatrix * pos;\n}\n"}),define("text!shaders/VelvetyShader-fragment.glsl",[],function(){return"uniform float opacity;\nuniform float ambientFactor; // the brightness of edge lighting (suggested defualt: 0.3, prefer 0.0 to 1.0)\nuniform float directFactor; // the brightness of front lighting (suggested defualt: 1.0, prefer 0.0 to 1.0)\n\nvarying vec3 fPosition;\nvarying vec3 fNormal;\nvarying vec3 fColor;\n\nvoid main()\n{\n float lightAmount = smoothstep(-ambientFactor, directFactor, dot(fNormal, normalize(-fPosition)));\n gl_FragColor = vec4(fColor * lightAmount, opacity);\n}\n"}),define("Velvety",["THREE","text!shaders/VelvetyShader-vertex.glsl","text!shaders/VelvetyShader-fragment.glsl"],function(e,t,i){e.VelvetyShader=function(){return{vertexColors:e.VertexColors,uniforms:{opacity:{type:"f",value:1},ambientFactor:{type:"f",value:.3},directFactor:{type:"f",value:1}},vertexShader:t,fragmentShader:i}}}),define("shape",["THREE","Velvety"],function(e){function t(t,i,r,n,o){var a=i.makeChild(t,this);return this._id=t,this._assembly=i,this._parent=r,this._unit=o,this._instances=[],a?(this.instance(a,i,r,n),a=this):(this._instanceID=0,this._children=[],this._annotations=[],this._shells=[],this._annotations=[],this._object3D=new e.Object3D,this._transform=(new e.Matrix4).copy(n),this._object3D.applyMatrix(this._transform)),a}return t.prototype.getCADjs=function(){return this._assembly.getCADjs()},t.prototype.instance=function(i,r,n,o){i._instances.push(this),this._instanceID=i._instances.length,this._object3D=new e.Object3D,this._transform=(new e.Matrix4).copy(o),this._object3D.applyMatrix(this._transform),this._shells=i._shells,this._annotations=i._annotations,this._children=[];for(var a=this,s=0;se,t.material.depthWrite=1===e,t.material.uniforms.opacity.value=e)})},t.prototype.showBoundingBox=function(){var e=this.getBoundingBox(!1);if(this.bbox||e.empty()||(this.bbox=this._assembly.buildBoundingBox(e)),this.bbox){var t=this;this._eventFunc=function(){t.hideBoundingBox()},this._assembly.addEventListener("_hideBounding",this._eventFunc),this._object3D.add(this.bbox)}},t.prototype.hideBoundingBox=function(){this._assembly.removeEventListener("_hideBounding",this._eventFunc),this._object3D.remove(this.bbox)},t.prototype.getCentroid=function(e){void 0===e&&(e=!0);var t=this.getBoundingBox(!1);return e&&(t.min.applyMatrix4(this._object3D.matrixWorld),t.max.applyMatrix4(this._object3D.matrixWorld)),t.center()},t.prototype.explode=function(t,i){var r,n;if(!this._explodeDistance){this._explodeStates={},this._explodeDistance=0,i=i?i:1,this._explodeStepSize=t/60*i,this._explodeStepRemain=60*i;var o=this.getCentroid(!0);for(r=0;r0},t.prototype.resetExplode=function(){this._explodeDistance&&(this.explode(-this._explodeDistance),this._explodeDistance=void 0,this._explodeStates=void 0,this._exploseStep=void 0)},e.EventDispatcher.prototype.apply(t.prototype),t}),define("annotation",["THREE"],function(e){function t(e,t){var i=t.makeChild(e,this);return i||(this._id=e,this._assembly=t,this._geometry=void 0),i}return t.prototype.getID=function(){return this._id},t.prototype.addGeometry=function(t){this._lines=_.map(t.lines,function(t){var i=new e.BufferGeometry;return i.addAttribute("position",Float32Array,t.length/3,3),i.attributes.position.array.set(t),i}),this.dispatchEvent({type:"annotationEndLoad",annotation:this})},t.prototype.getGeometry=function(){return this._lines},e.EventDispatcher.prototype.apply(t.prototype),t}),define("shell",["THREE"],function(e){function t(e,t,i,r,n,o){var a=t.makeChild(e,this);return a||(this._id=e,this._assembly=t,this._parent=i,this._size=r,this._color=n,this._boundingBox=o,this._boundingBox.empty()&&console.log("Found empty bounding box: "+this._id)),a}return t.prototype.unloadData=function(){console.log("Shell.unloadData - Not Implemented")},t.prototype.getID=function(){return this._id},t.prototype.addGeometry=function(t,i,r){this.dispatchEvent({type:"shellStartLoad",shell:this}),this._geometry=new e.BufferGeometry,this._geometry.addAttribute("position",Float32Array,3*this._size,3),this._geometry.addAttribute("normal",Float32Array,3*this._size,3),this._geometry.addAttribute("color",Float32Array,3*this._size,3);var n,o=21845;this._geometry.offsets=[];var a=this._size/o;for(n=0;a>n;n++){var s={start:n*o*3,index:n*o*3,count:3*Math.min(this._size-n*o,o)};this._geometry.offsets.push(s)}this._geometry.attributes.position.array=t,this._geometry.attributes.normal.array=i,this._geometry.attributes.color.array=r,this._geometry.computeBoundingBox(),this._boundingBox=this._geometry.boundingBox.clone(),this._isLoaded=!0,this.dispatchEvent({type:"shellEndLoad",shell:this})},t.prototype.getBoundingBox=function(){return this._boundingBox},t.prototype.getSize=function(){return this._size},t.prototype.getGeometry=function(){return this._geometry},e.EventDispatcher.prototype.apply(t.prototype),t}),define("data_loader",["THREE","underscore","assembly","product","shape","annotation","shell"],function(e,t,i,r,n,o,a){function s(e,t,i){this._parent=e,this._viewer=t,this._queue=[],this._loading=[],this._maxWorkers=i.maxWorkers?i.maxWorkers:4,this._freeWorkers=[],this._shells={};var r=this;for(this._workers=[];this._workers.length>16&255)/255,(i>>8&255)/255,(i>>0&255)/255)},s.parseUnit=function(e){var t=e.split(" ")[0],i=parseFloat(e.split(" ")[1]);return"mm"!==t&&console.log("Found non-MM unit: "+t),i},s.parseFloatVec=function(e,t){var i=e.split(" ");if(null!=t&&i.length!=t)throw new Error("parse_float_vec: unexpected number of elements expecting "+t+" have "+i.length);t=i.length;for(var r=new Array(t),n=0;t>n;n++){var o=parseFloat(i[n]);if(!isFinite(o))throw new Error("number is not finite");r[n]=o}return r},s.getArrayFromAttribute=function(e,t){var i=e.getAttribute(t);return i?i.split(" "):[]},s.prototype.load=function(e,t,i){var r=function(e,t){e?i(e):i(void 0,t)},n={url:e,validateType:t,callback:r};this.resolveUrl(n,"index.json"),this.addRequest(n),this.runLoadQueue()},s.prototype.setRequestBase=function(e){var t=new RegExp("^(.*)/.*$"),i=t.exec(e.url);if(i){var r=i[1];"."!=r&&(r.match(/\/$/)||(r+="/"),e.base?r.match(/^\//)?e.base=r:r.length>0?e.base+=r+"/":e.base="":e.base=r)}},s.prototype.resolveUrl=function(e,t){e.base||this.setRequestBase(e),e.url.match(/\/$/)&&(e.url+=t);var i=e.url.split(".").pop();switch(i){case"xml":e.contentType="application/xml";break;case"json":e.contentType="application/json";break;default:console.log("DataLoader.resolveUrl error - invalid content type: "+i)}return!e.url.base||e.url.match(/^\w+:/)||e.url.match(/^\//)?e.url:e.url.base+e.url},s.prototype.addRequest=function(e){this.resolveUrl(e),this._queue.push(e);var t=e.url.split("/");this.dispatchEvent({type:"addRequest",file:t[t.length-1]})},s.prototype.sortQueue=function(){return this._queue.shift()},s.prototype.queueLength=function(e){var t=this._maxWorkers-this._freeWorkers.length;return e?t:this._queue.length+t},s.prototype.runLoadQueue=function(){for(;this._queue.length>0&&this._freeWorkers.length>0;){var e=this._freeWorkers.shift(),t=this.sortQueue();t.workerID=e,this._loading[e]=t,this.initRequest(t)}},s.prototype.workerMessage=function(e){var i,r;-1!=t.indexOf(["rootLoad","shellLoad","annotationLoad","loadError"],e.data.type)&&(i=this._loading[e.data.workerID]),-1!=t.indexOf(["rootLoad","workerFinish","loadError"],e.data.type)&&(this._loading[e.data.workerID]=void 0,this._freeWorkers.push(e.data.workerID),this.runLoadQueue());var n,o,a=new DOMParser;switch(e.data.type){case"rootLoad":switch(i.contentType){case"application/xml":this.buildAssemblyXML(e.data.data,i);break;case"application/json":this.buildAssemblyJSON(e.data.data,i)}break;case"annotationLoad":switch(i.contentType){case"application/xml":n=a.parseFromString(e.data.data,"text/xml").documentElement,o={id:n.getAttribute("id"),lines:this.parseAnnotationXML(n)};break;case"application/json":o=JSON.parse(e.data.data)}i.annotation.addGeometry(o),this.dispatchEvent({type:"shellLoad",file:e.data.file});break;case"shellLoad":switch(i.contentType){case"application/xml":n=a.parseFromString(e.data.data,"text/xml").documentElement,r=i.shell,o=this.parseShellXML(n,i.shellSize);break;case"application/json":r=this._shells[e.data.id],o=e.data.data;break;default:console.log("Blahhlal - What the hell is this?")}delete this._shells[e.data.id],r.addGeometry(o.position,o.normals,o.colors),this.dispatchEvent({type:"shellLoad",file:e.data.file});break;case"workerFinish":this.dispatchEvent({type:"workerFinish",file:e.data.file});break;case"parseComplete":case"loadProgress":case"loadComplete":this.dispatchEvent(e.data);break;case"loadError":i.callback&&i.callback({error:"loadError",status:e.data.status,file:i.url})}},s.prototype.initRequest=function(e){var t=this._workers[e.workerID],i={url:e.url,workerID:e.workerID,type:e.validateType};"shell"===i.type&&(i.shellSize=e.shellSize),t.postMessage(i)},s.prototype.buildElementMapXML=function(e){for(var t={},i=0;i0)for(var c=0;ci;i++)if(t=this.passes[i],t.enabled){if(t.render(this.renderer,this.writeBuffer,this.readBuffer,e,r),t.needsSwap){if(r){var o=this.renderer.context; -o.stencilFunc(o.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),o.stencilFunc(o.EQUAL,1,4294967295)}this.swapBuffers()}t instanceof THREE.MaskPass?r=!0:t instanceof THREE.ClearMaskPass&&(r=!1)}},reset:function(e){void 0===e&&(e=this.renderTarget1.clone(),e.width=window.innerWidth,e.height=window.innerHeight),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2},setSize:function(e,t){var i=this.renderTarget1.clone();i.width=e,i.height=t,this.reset(i)}},define("libs/threejs/EffectComposer",["THREE"],function(){}),THREE.CopyShader={uniforms:{tDiffuse:{type:"t",value:null},opacity:{type:"f",value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")},define("libs/threejs/CopyShader",["THREE"],function(){}),THREE.FXAAShader={uniforms:{tDiffuse:{type:"t",value:null},resolution:{type:"v2",value:new THREE.Vector2(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","#define FXAA_REDUCE_MIN (1.0/128.0)","#define FXAA_REDUCE_MUL (1.0/8.0)","#define FXAA_SPAN_MAX 8.0","void main() {","vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;","vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;","vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;","vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;","vec4 rgbaM = texture2D( tDiffuse, gl_FragCoord.xy * resolution );","vec3 rgbM = rgbaM.xyz;","float opacity = rgbaM.w;","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float lumaNW = dot( rgbNW, luma );","float lumaNE = dot( rgbNE, luma );","float lumaSW = dot( rgbSW, luma );","float lumaSE = dot( rgbSE, luma );","float lumaM = dot( rgbM, luma );","float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );","float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );","vec2 dir;","dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));","dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));","float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );","float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );","dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),","max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),","dir * rcpDirMin)) * resolution;","vec3 rgbA = texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ).xyz;","rgbA += texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ).xyz;","rgbA *= 0.5;","vec3 rgbB = texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * -0.5 ).xyz;","rgbB += texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * 0.5 ).xyz;","rgbB *= 0.25;","rgbB += rgbA * 0.5;","float lumaB = dot( rgbB, luma );","if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {","gl_FragColor = vec4( rgbA, opacity );","} else {","gl_FragColor = vec4( rgbB, opacity );","}","}"].join("\n")},define("libs/threejs/FXAAShader",["THREE"],function(){}),THREE.SSAOShader={uniforms:{tDiffuse:{type:"t",value:null},tDepth:{type:"t",value:null},size:{type:"v2",value:new THREE.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},fogNear:{type:"f",value:5},fogFar:{type:"f",value:100},fogEnabled:{type:"i",value:0},onlyAO:{type:"i",value:0},aoClamp:{type:"f",value:.3},lumInfluence:{type:"f",value:.9}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cameraNear;","uniform float cameraFar;","uniform float fogNear;","uniform float fogFar;","uniform bool fogEnabled;","uniform bool onlyAO;","uniform vec2 size;","uniform float aoClamp;","uniform float lumInfluence;","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","varying vec2 vUv;","#define DL 2.399963229728653","#define EULER 2.718281828459045","float width = size.x;","float height = size.y;","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","const int samples = 8;","const float radius = 5.0;","const bool useNoise = false;","const float noiseAmount = 0.0003;","const float diffArea = 0.4;","const float gDisplace = 0.4;","const vec3 onlyAOColor = vec3( 1.0, 0.7, 0.5 );","float unpackDepth( const in vec4 rgba_depth ) {","const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );","float depth = dot( rgba_depth, bit_shift );","return depth;","}","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( width / 2.0 ) );","float gg = fract( coord.t * ( height / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float doFog() {","float zdepth = unpackDepth( texture2D( tDepth, vUv ) );","float depth = -cameraFar * cameraNear / ( zdepth * cameraFarMinusNear - cameraFar );","return smoothstep( fogNear, fogFar, depth );","}","float readDepth( const in vec2 coord ) {","return cameraCoef / ( cameraFarPlusNear - unpackDepth( texture2D( tDepth, coord ) ) * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 2.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * dd * dd / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","float dd = radius - depth * radius;","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + dd * vv;","vec2 coord2 = vUv - dd * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / width ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / height ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float pw;","float ph;","float ao;","float dz = 1.0 / float( samples );","float z = 1.0 - dz / 2.0;","float l = 0.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","pw = cos( l ) * r;","ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","if ( fogEnabled ) {","ao = mix( ao, 1.0, doFog() );","}","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = onlyAOColor * vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")},define("libs/threejs/SSAOShader",["THREE"],function(){}),THREE.RenderPass=function(e,t,i,r,n){this.scene=e,this.camera=t,this.overrideMaterial=i,this.clearColor=r,this.clearAlpha=void 0!==n?n:1,this.oldClearColor=new THREE.Color,this.oldClearAlpha=1,this.enabled=!0,this.clear=!0,this.needsSwap=!1},THREE.RenderPass.prototype={render:function(e,t,i){this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),e.render(this.scene,this.camera,i,this.clear),this.clearColor&&e.setClearColor(this.oldClearColor,this.oldClearAlpha),this.scene.overrideMaterial=null}},define("libs/threejs/RenderPass",["THREE"],function(){}),THREE.ShaderPass=function(e,t){this.textureID=void 0!==t?t:"tDiffuse",this.uniforms=THREE.UniformsUtils.clone(e.uniforms),this.material=new THREE.ShaderMaterial({uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.renderToScreen=!1,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.camera=new THREE.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new THREE.Scene,this.quad=new THREE.Mesh(new THREE.PlaneGeometry(2,2),null),this.scene.add(this.quad)},THREE.ShaderPass.prototype={render:function(e,t,i){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i),this.quad.material=this.material,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)}},define("libs/threejs/ShaderPass",["THREE","libs/threejs/RenderPass"],function(){}),THREE.MaskPass=function(e,t){this.scene=e,this.camera=t,this.enabled=!0,this.clear=!0,this.needsSwap=!1,this.inverse=!1},THREE.MaskPass.prototype={render:function(e,t,i){var r=e.context;r.colorMask(!1,!1,!1,!1),r.depthMask(!1);var n,o;this.inverse?(n=0,o=1):(n=1,o=0),r.enable(r.STENCIL_TEST),r.stencilOp(r.REPLACE,r.REPLACE,r.REPLACE),r.stencilFunc(r.ALWAYS,n,4294967295),r.clearStencil(o),e.render(this.scene,this.camera,i,this.clear),e.render(this.scene,this.camera,t,this.clear),r.colorMask(!0,!0,!0,!0),r.depthMask(!0),r.stencilFunc(r.EQUAL,1,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP)}},THREE.ClearMaskPass=function(){this.enabled=!0},THREE.ClearMaskPass.prototype={render:function(e){var t=e.context;t.disable(t.STENCIL_TEST)}},define("libs/threejs/MaskPass",["THREE"],function(){}),define("text!templates/compass_dom.html",[],function(){return'
\n
\n Front\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n
\n Back\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n
\n Right\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n
\n Left\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n
\n Top\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n
\n Bottom\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n
\n'}),define("compass",["THREE","text!templates/compass_dom.html"],function(e,t){function i(e,t){var r,n=e.style,o=i._transformPropertyNames;for(r=0;r1?n.normalize():n.z=Math.sqrt(1-o*o),g.copy(d.object.position).sub(d.target),r.copy(d.object.up).setLength(n.y),r.add(e.copy(d.object.up).cross(g).setLength(n.x)),r.add(g.setLength(n.z)),r}}(),this.rotateCamera=function(){var e=new THREE.Vector3,t=new THREE.Quaternion;return function(){var i=Math.acos(E.dot(v)/E.length()/v.length());i&&(e.crossVectors(E,v).normalize(),i*=d.rotateSpeed,t.setFromAxisAngle(e,-i),g.applyQuaternion(t),d.object.up.applyQuaternion(t),v.applyQuaternion(t),d.staticMoving?E.copy(v):(t.setFromAxisAngle(e,i*(d.dynamicDampingFactor-1)),E.applyQuaternion(t)))}}(),this.zoomCamera=function(){var e;f===u.TOUCH_ZOOM?(e=T/x,T=x,g.multiplyScalar(e)):(e=1+(_.y-y.y)*d.zoomSpeed,1!==e&&e>0&&(g.multiplyScalar(e),d.staticMoving?y.copy(_):y.y+=(_.y-y.y)*this.dynamicDampingFactor))},this.panCamera=function(){var e=new THREE.Vector2,t=new THREE.Vector3,i=new THREE.Vector3;return function(){e.copy(R).sub(b),e.lengthSq()&&(e.multiplyScalar(g.length()*d.panSpeed),i.copy(g).cross(d.object.up).setLength(e.x),i.add(t.copy(d.object.up).setLength(e.y)),d.object.position.add(i),d.target.add(i),d.staticMoving?b.copy(R):b.add(e.subVectors(R,b).multiplyScalar(d.dynamicDampingFactor)))}}(),this.checkDistances=function(){d.noZoom&&d.noPan||(g.lengthSq()>d.maxDistance*d.maxDistance&&d.object.position.addVectors(d.target,g.setLength(d.maxDistance)),g.lengthSq()0&&(d.dispatchEvent(w),p.copy(d.object.position))},this.reset=function(){f=u.NONE,m=u.NONE,d.target.copy(d.target0),d.object.position.copy(d.position0),d.object.up.copy(d.up0),g.subVectors(d.object.position,d.target),d.object.lookAt(d.target),d.dispatchEvent(w),p.copy(d.object.position)},this.domElement.addEventListener("contextmenu",function(e){e.preventDefault()},!1),this.domElement.addEventListener("mousedown",n,!1),this.domElement.addEventListener("mousewheel",s,!1),this.domElement.addEventListener("DOMMouseScroll",s,!1),this.domElement.addEventListener("touchstart",l,!1),this.domElement.addEventListener("touchend",h,!1),this.domElement.addEventListener("touchmove",c,!1),window.addEventListener("keydown",i,!1),window.addEventListener("keyup",r,!1),this.handleResize()},THREE.TrackballControls.prototype=Object.create(THREE.EventDispatcher.prototype),define("TrackballControls",["THREE"],function(){}),define("viewer_controls",["THREE","TrackballControls"],function(e){function t(t){function i(){r=new e.TrackballControls(n,o),r.rotateSpeed=1,r.zoomSpeed=1.2,r.panSpeed=.8,r.noZoom=!1,r.noPan=!1,r.staticMoving=!0,r.dynamicDampingFactor=.3,r.up0.set(0,1,0),r.position0=l.clone().applyEuler(s),r.position0.multiplyScalar(-a),r.sceneRadius=a,r._reset=r.reset,r._update=r.update,r.reset=function(){var e=this.sceneRadius||0;this._reset(),n.far=e+n.position.length()},r.update=function(){var e=this.sceneRadius||0;this._update(),n.far=e+n.position.length()},r.reset(),r.setRotationFromEuler=function(e,t){var i=r.object.position.length(),n="undefined"==typeof t?r.up0:t;r.position0=l.clone().applyEuler(e).multiplyScalar(-i),r.up0.set(n.x,n.y,n.z),r.reset()}}var r=null,n=t.camera,o=t.canvas,a=t.viewDistance||13e3,s=t.viewAngles||new e.Euler(0,0,0),l=new e.Vector3(0,0,1);if(void 0===n||null===n)throw new Error("No camera specified");return i(),r}return t}),define("viewer",["THREE","compass","viewer_controls"],function(e,t,i){function r(r){var n,o,a,s,l,c,h,d,u,p,f,m,g,E,v,y,_,T,x=!1,b=!1;m={minFilter:e.LinearFilter,magFilter:e.LinearFilter,format:e.RGBAFormat},n=document.getElementById(r._viewContainerId),o=new e.WebGLRenderer({antialias:!0,alpha:!0}),this.renderer=o,o.setClearColor(r.getThemeValue("canvasClearColor")),o.setSize(n.offsetWidth,n.offsetHeight),o.sortObjects=!0,o.autoClear=!1,g=new e.WebGLRenderTarget(n.offsetWidth,n.offsetHeight,m),E=new e.DepthPassPlugin,E.renderTarget=g,E.enabled=!1,o.addPrePlugin(E),a=o.domElement,n.appendChild(a),s=new e.Scene,l=new e.PerspectiveCamera(75,n.offsetWidth/n.offsetHeight,.1,1e6),l.position.x=-5e3,l.position.y=-5e3,l.position.z=0,l.lookAt(s.position),v=new e.EffectComposer(o),y=new e.ShaderPass(e.SSAOShader),y.uniforms.tDepth.value=g,y.uniforms.size.value.set(n.offsetWidth,n.offsetHeight),y.uniforms.cameraNear.value=l.near,y.uniforms.cameraFar.value=l.far,y.uniforms.aoClamp.value=.9,y.uniforms.lumInfluence.value=.5,y.enabled=!1,_=new e.ShaderPass(e.FXAAShader),_.uniforms.resolution.value.set(1/n.offsetWidth,1/n.offsetHeight),T=new e.ShaderPass(e.CopyShader),T.renderToScreen=!0,v.addPass(y),v.addPass(_),v.addPass(T),c=i({viewer:this,camera:l,canvas:a,renderPassSSAO:y,renderPassFXAA:_}),h=new t(r._compassContainerId,l,c,{width:200,height:200}),d=function(){E.enabled=!0,o.render(s,l,v.renderTarget2,!0),E.enabled=!1,v.render(.5)},u=function(e){requestAnimationFrame(function(){u(!1)}),(b===!0||x===!0||e===!0)&&(x=!1,d(),c.update(),h.update())},f=function(){x=!0},p=function(e){s.add(e),f()},c.addEventListener("change",function(){f()}),c.addEventListener("start",function(){b=!0}),c.addEventListener("end",function(){f(),b=!1}),window.addEventListener("resize",function(){g=new e.WebGLRenderTarget(n.offsetWidth,n.offsetHeight,m),E.renderTarget=g,y.uniforms.tDepth.value=g,y.uniforms.size.value.set(n.offsetWidth,n.offsetHeight),_.uniforms.resolution.value.set(1/n.offsetWidth,1/n.offsetHeight),o.setSize(n.offsetWidth,n.offsetHeight),l.aspect=n.offsetWidth/n.offsetHeight,l.updateProjectionMatrix(),l.lookAt(s.position),v.reset(),c.handleResize(),d() -}),this.camera=l,this.controls=c,this.invalidate=f,this.add3DObject=p,u(!0)}return e.EventDispatcher.prototype.apply(r.prototype),r}),define("cad",["jquery","jstree","data_loader","viewer"],function(e,t,i,r){function n(t){if(!(t&&t.viewContainerId&&t.compassContainerId&&t.treeContainerSelector))throw"CAD.js requires a configuration!!!";this._viewContainerId=t.viewContainerId,this._$viewContainer=e("#"+t.viewContainerId),this._compassContainerId=t.compassContainerId,this._$compassContainer=e("#"+t.compassContainerId),this._treeContainerSelector=t.treeContainerSelector,this._$treeContainer=e(t.treeContainerSelector),this._$downloadsContainer=e("#"+t.downloadsContainerId),this._isCompact=void 0,this._loader=void 0,this._parts=[],this._viewer=void 0,this._theme=void 0,this.setCompactMode(void 0!==t.isCompact?t.isCompact:!1),this.setTheme(o[t.theme]||o.dark)}var o={dark:{cssClass:"dark",canvasClearColor:0,annotationColor:16777215},bright:{cssClass:"bright",canvasClearColor:16777215,annotationColor:32896}};return o.default=o.dark,n.prototype.setupPage=function(){var t=0;this._theme&&(t=this._theme.canvasClearColor),this._viewer=new r(this),this._loader=new i(this,this._viewer,{autorun:!1}),this.bindEvents(),e(this).trigger("pageSetup"),e("body").removeClass("non-initialized")},n.prototype.setCompactMode=function(t){var i=e("body");this._isCompact!==t&&(t?i.addClass("compact"):i.removeClass("compact"),this._isCompact=t)},n.prototype.setTheme=function(t){var i=e("body");t&&(this._theme&&i.removeClass(this._theme.cssClass),i.addClass(t.cssClass),this._viewer&&this._viewer.renderer.setClearColor(t.canvasClearColor),this._theme=t)},n.prototype.getThemeValue=function(e){return"undefined"!=typeof this._theme[e]?this._theme[e]:o.default[e]},n.prototype.load=function(t){var i=this;this._loader.load(t,"assembly",function(t,r){t?(e("#dialog").dialog({autoOpen:!0,buttons:[{text:"Ok",click:function(){e(this).dialog("close")}}],modal:!0,title:"CAD.js Load Error - "+t.status}),e("#dialog-content").text("Error loading model: "+t.file)):(i._parts.push(r),r.centerGeometry(),r.zoomToFit(i._viewer.camera,i._viewer.controls),i.renderTree(),i._loader.runLoadQueue())})},n.prototype.render=function(){this._parts[0].render()},n.prototype.bindEvents=function(){var t=this,i=e(this._$viewContainer)[0],r=this._$downloadsContainer.find(">ul"),n=this._$downloadsContainer.find(".steptools-downloads-count");this._loader.addEventListener("addRequest",function(e){var i=e.file.split(".")[0];r.append("
  • "+e.file+"
  • ");var o=t._loader.queueLength(!1);n.text(o),t._$downloadsContainer.removeClass("out")}),this._loader.addEventListener("loadComplete",function(t){var i=t.file.split(".")[0];"index"===i?e("li#index").remove():e("li#"+i).text(t.file+": Parsing")}),this._loader.addEventListener("parseComplete",function(t){var i=t.file.split(".")[0];e("li#"+i).text(t.file+": Finishing")}),this._loader.addEventListener("shellLoad",function(){t._viewer.invalidate()}),this._loader.addEventListener("workerFinish",function(i){var r=i.file.split(".")[0];e("li#"+r).remove();var o=t._loader.queueLength(!1);n.text(o),0===o&&t._$downloadsContainer.addClass("out")}),this._loader.addEventListener("loadProgress",function(t){if(t.loaded){var i=t.file.split(".")[0];e("li#"+i).text(t.file+": "+t.loaded.toFixed(2)+"%")}});var o;this._viewer.controls.addEventListener("change",function(){o=!0}),this._viewer.controls.addEventListener("start",function(){o=!1}),i.addEventListener("mouseup",function(e){o||t.onClick(e),o=!1},!1),i.addEventListener("mousemove",function(){o||t.onMove()},!1),window.addEventListener("keypress",function(e){var i,r;switch(e.keyCode||e.charCode||e.which){case 120:t.explode(100);break;case 115:t.explode(-100);break;case 113:t._parts[0].hideAllBoundingBoxes(),t.tree.deselect_all(),t._viewer.invalidate();break;case 111:i=t.tree.get_selected(!1),r=t._parts[0].getByID(i[0]),r?r.toggleTransparency():t._parts[0].toggleTransparency(),t._viewer.invalidate();break;case 122:t._parts[0].zoomToFit(t._viewer.camera,t._viewer.controls),t._viewer.invalidate();break;case 106:i=t.tree.get_selected(!1),r=t._parts[0].getByID(i[0]),r&&(r.toggleVisibility()?t.tree.enable_node(i):t.tree.disable_node(i),t._viewer.invalidate())}},!0)},n.prototype.onClick=function(e){if(this._parts[0]){e.metaKey||(this._parts[0].hideAllBoundingBoxes(),this.tree.deselect_all());var t=this._parts[0].select(this._viewer.camera,e.clientX,e.clientY);if(t){t=t.getNamedParent();var i=this.tree.get_node(t.getID());this.tree.select_node(i)}this._viewer.invalidate()}},n.prototype.onMove=function(){this._parts.length>0},n.prototype.explode=function(e){var t=this.tree.get_selected(!1);if(t){for(var i=0;i",{"class":"processingOverlay"}),e=o("
    ",{"class":"processingOverlayContent"}),this.config.loadingImg&&e.append(o("",{src:this.config.loadingImg,"class":"processingLoadingGif"})),e.append(o("

    ",{text:this.config.loadingMsg})),this.processingOverlay.append(e),o(document).find("body").css("min-height",500).append(this.processingOverlay))},removeProcessingOverlay:function(){null!==this.processingOverlay&&(this.processingOverlay.remove(),this.processingOverlay=null)},pollProcessing:function(){var t=this;o.ajax({url:t.getProcessingPollUrl(),type:"GET",dataType:"json",data:{unique_id:t.getProcessResourceId()},success:function(i){o(t).trigger("pollComplete")!==!1&&(t.parameters.processingStatus=i.status,"loading"===i.status?setTimeout(function(){e.VIS.pollProcessing.call(e.VIS)},t.config.loadingPollInterval):"ready"===i.status?t.processingSuccess.call(t):t.processingError.call(t))},error:function(){t.processingError()}})},processingSuccess:function(){this.removeProcessingOverlay();var e=this;o.ajax({url:e.getProcessingParamsUrl(),type:"GET",dataType:"json",data:{unique_id:e.getProcessResourceId()},success:function(t){o.each(t.parameters,function(i){e.parameters[i]=t.parameters[i]}),o(e).trigger("ready")},error:function(){e.processingError()}})},processingError:function(){this.createProcessingOverlay(),this.processingOverlay.find(".processingOverlayContent").html(o("

    ",{text:"There was an error processing this file for visualization"})).append(o("You can ")).append(o("",{href:this.getResourceUrl(),text:"download the file"})).append(o(" instead."))},pollComplete:o.noop,initConfig:o.noop,ready:o.noop},e.VIS=n}(window),define("VIS",["jquery","jqueryui"],function(e){return function(){var t;return t||e.VIS}}(this)),require.config({paths:{jquery:"libs/jquery.min",jqueryui:"libs/jquery-ui.min",jstree:"libs/jstree.min",underscore:"libs/underscore-min",THREE:"libs/three.min",TrackballControls:"libs/TrackballControls",dat:"libs/dat.gui.min",bigScreen:"libs/bigscreen.min",VIS:"libs/visualize",Velvety:"shaders/VelvetyShader"},shim:{jquery:{exports:"$"},jqueryui:{deps:["jquery"]},jstree:{deps:["jquery","jqueryui"]},underscore:{exports:"_"},THREE:{exports:"THREE"},TrackballControls:{deps:["THREE"]},dat:{exports:"dat"},VIS:{exports:"VIS",deps:["jquery","jqueryui","bigScreen"]},viewer:{deps:["libs/threejs/EffectComposer","libs/threejs/CopyShader","libs/threejs/FXAAShader","libs/threejs/SSAOShader","libs/threejs/RenderPass","libs/threejs/ShaderPass","libs/threejs/MaskPass"]},"libs/threejs/EffectComposer":{deps:["THREE"]},"libs/threejs/CopyShader":{deps:["THREE"]},"libs/threejs/FXAAShader":{deps:["THREE"]},"libs/threejs/SSAOShader":{deps:["THREE"]},"libs/threejs/RenderPass":{deps:["THREE"]},"libs/threejs/ShaderPass":{deps:["THREE","libs/threejs/RenderPass"]},"libs/threejs/MaskPass":{deps:["THREE"]}}}),requirejs(["cad","jquery","THREE","VIS"],function(e,t,i,r){t(r).on("ready",function(){var t=window.cadjs=new e({viewContainerId:"steptools-view",compassContainerId:"steptools-compass",downloadsContainerId:"steptools-downloads",treeContainerSelector:".steptools-tree",isCompact:"true"===r.getParameter("compact"),theme:r.getParameter("theme")});t.setupPage(),t.load(r.getResourceUrl())}),r.init()}),define("main",function(){}); \ No newline at end of file +})},t.prototype.toggleVisibility=function(){return this._product._object3D.visible?this.hide():this.show(),this._product._object3D.visible},t.prototype.hide=function(){this._product&&this._product.hide()},t.prototype.show=function(){this._product&&this._product.show()},t.prototype.hideAllBoundingBoxes=function(){this.dispatchEvent({type:"_hideBounding"})},t.prototype.clearHighlights=function(){this.dispatchEvent({type:"_clearHighlights"})},t.prototype.clearOpacity=function(){this.dispatchEvent({type:"_clearOpacity"})},t.prototype.getTree=function(){var e={id:"id0",text:this.name(),state:{opened:!0,disabled:!1,selected:!1},children:[]};return this._product&&e.children.push(this._product.getTree()),e},t.prototype.centerGeometry=function(){if(this._product){var t=this._product.getBoundingBox();if(!t.empty()){var i=(t.max.x+t.min.x)/-2,r=(t.max.y+t.min.y)/-2,n=(t.max.z+t.min.z)/-2;this._product.applyMatrix((new e.Matrix4).makeTranslation(i,r,n))}}},t.prototype.zoomToFit=function(t,i){var r=this._product.getBoundingBox(),n=.5*r.size().length(),o=2*Math.atan(e.Math.degToRad(.5*t.fov)*t.aspect),a=Math.min(e.Math.degToRad(t.fov),o),s=n/Math.sin(.5*a),l=new e.Vector3,c=t.position.clone().sub(i.target).normalize().multiplyScalar(s);i.sceneRadius=n,i.target0.copy(l.clone()),i.position0.copy(c.clone()),i.up0.copy(t.up.clone()),i.reset()},t.prototype.select=function(t,i,r){if(!this._product)return void 0;i=i/window.innerWidth*2-1,r=2*-(r/window.innerHeight)+1;var n=new e.Vector3(i,r,.999),o=new e.Projector;o.unprojectVector(n,t),n.sub(t.position).normalize();var a=new e.Raycaster(t.position,n),s=a.intersectObjects(this._product.getObject3D().children,!0),l=void 0;if(s.length>0){for(var c=void 0,h=0;he,t.material.depthWrite=1===e,t.material.uniforms.opacity.value=e)})},t.prototype.toggleVisibility=function(){return this._object3D.visible?this.hide():this.show(),this._object3D.visible},t.prototype.toggleTransparency=function(){this.setOpacity(this.isTransparent()?1:.5)},t.prototype.isTransparent=function(){var e=!1,t=function(t){!e&&t.material&&t.material.uniforms.opacity&&(e=t.material.uniforms.opacity.value<1)};return t(this._object3D),e||this._object3D.traverse(t),e},t.prototype.hide=function(){this._object3D.traverse(function(e){e.visible=!1})},t.prototype.show=function(){this._object3D.traverse(function(e){e.visible=!0})},t.prototype.explode=function(){},e.EventDispatcher.prototype.apply(t.prototype),t}),define("text",["module"],function(e){var t,i,r,n,o,a=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],s=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,l=/]*>\s*([\s\S]+)\s*<\/body>/im,c="undefined"!=typeof location&&location.href,h=c&&location.protocol&&location.protocol.replace(/\:/,""),d=c&&location.hostname,u=c&&(location.port||void 0),p={},f=e.config&&e.config()||{};return t={version:"2.0.10",strip:function(e){if(e){e=e.replace(s,"");var t=e.match(l);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:f.createXhr||function(){var e,t,i;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(t=0;3>t;t+=1){i=a[t];try{e=new ActiveXObject(i)}catch(r){}if(e){a=[i];break}}return e},parseName:function(e){var t,i,r,n=!1,o=e.indexOf("."),a=0===e.indexOf("./")||0===e.indexOf("../");return-1!==o&&(!a||o>1)?(t=e.substring(0,o),i=e.substring(o+1,e.length)):t=e,r=i||t,o=r.indexOf("!"),-1!==o&&(n="strip"===r.substring(o+1),r=r.substring(0,o),i?i=r:t=r),{moduleName:t,ext:i,strip:n}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,i,r,n){var o,a,s,l=t.xdRegExp.exec(e);return l?(o=l[2],a=l[3],a=a.split(":"),s=a[1],a=a[0],!(o&&o!==i||a&&a.toLowerCase()!==r.toLowerCase()||(s||a)&&s!==n)):!0},finishLoad:function(e,i,r,n){r=i?t.strip(r):r,f.isBuild&&(p[e]=r),n(r)},load:function(e,i,r,n){if(n.isBuild&&!n.inlineText)return void r();f.isBuild=n.isBuild;var o=t.parseName(e),a=o.moduleName+(o.ext?"."+o.ext:""),s=i.toUrl(a),l=f.useXhr||t.useXhr;return 0===s.indexOf("empty:")?void r():void(!c||l(s,h,d,u)?t.get(s,function(i){t.finishLoad(e,o.strip,i,r)},function(e){r.error&&r.error(e)}):i([a],function(e){t.finishLoad(o.moduleName+"."+o.ext,o.strip,e,r)}))},write:function(e,i,r){if(p.hasOwnProperty(i)){var n=t.jsEscape(p[i]);r.asModule(e+"!"+i,"define(function () { return '"+n+"';});\n")}},writeFile:function(e,i,r,n,o){var a=t.parseName(i),s=a.ext?"."+a.ext:"",l=a.moduleName+s,c=r.toUrl(a.moduleName+s)+".js";t.load(l,r,function(){var i=function(e){return n(c,e)};i.asModule=function(e,t){return n.asModule(e,c,t)},t.write(e,l,i,o)},o)}},"node"===f.env||!f.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(i=require.nodeRequire("fs"),t.get=function(e,t,r){try{var n=i.readFileSync(e,"utf8");0===n.indexOf("")&&(n=n.substring(1)),t(n)}catch(o){r(o)}}):"xhr"===f.env||!f.env&&t.createXhr()?t.get=function(e,i,r,n){var o,a=t.createXhr();if(a.open("GET",e,!0),n)for(o in n)n.hasOwnProperty(o)&&a.setRequestHeader(o.toLowerCase(),n[o]);f.onXhr&&f.onXhr(a,e),a.onreadystatechange=function(){var t,n;4===a.readyState&&(t=a.status,t>399&&600>t?(n=new Error(e+" HTTP status: "+t),n.xhr=a,r(n)):i(a.responseText),f.onXhrComplete&&f.onXhrComplete(a,e))},a.send(null)}:"rhino"===f.env||!f.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?t.get=function(e,t){var i,r,n="utf-8",o=new java.io.File(e),a=java.lang.System.getProperty("line.separator"),s=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(o),n)),l="";try{for(i=new java.lang.StringBuffer,r=s.readLine(),r&&r.length()&&65279===r.charAt(0)&&(r=r.substring(1)),null!==r&&i.append(r);null!==(r=s.readLine());)i.append(a),i.append(r);l=String(i.toString())}finally{s.close()}t(l)}:("xpconnect"===f.env||!f.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(r=Components.classes,n=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),o="@mozilla.org/windows-registry-key;1"in r,t.get=function(e,t){var i,a,s,l={};o&&(e=e.replace(/\//g,"\\")),s=new FileUtils.File(e);try{i=r["@mozilla.org/network/file-input-stream;1"].createInstance(n.nsIFileInputStream),i.init(s,1,0,!1),a=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(n.nsIConverterInputStream),a.init(i,"utf-8",i.available(),n.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),a.readString(i.available(),l),a.close(),i.close(),t(l.value)}catch(c){throw new Error((s&&s.path||"")+": "+c)}}),t}),define("text!shaders/VelvetyShader-vertex.glsl",[],function(){return"varying vec3 fNormal;\nvarying vec3 fPosition;\nvarying vec3 fColor;\n\nconst float minColorBrightness = 0.15;\n\n// This ensures that black colored shapes are not rendered as solid black by\n// effectively making dark colors slightly lighter.\nvec3 applyMinColorBrightness(vec3 color)\n{\n if (length(color) < minColorBrightness * 3.0) {\n return color + minColorBrightness;\n } else {\n return color;\n }\n}\n\nvoid main()\n{\n vec4 pos = modelViewMatrix * vec4(position, 1.0);\n vec3 N = normalMatrix * normal;\n vec3 I = pos.xyz;\n fNormal = normalize(faceforward(N, I, N));\n fColor = applyMinColorBrightness(color);\n fPosition = I;\n gl_Position = projectionMatrix * pos;\n}\n"}),define("text!shaders/VelvetyShader-fragment.glsl",[],function(){return"uniform float opacity;\nuniform float ambientFactor; // the brightness of edge lighting (suggested defualt: 0.3, prefer 0.0 to 1.0)\nuniform float directFactor; // the brightness of front lighting (suggested defualt: 1.0, prefer 0.0 to 1.0)\n\nvarying vec3 fPosition;\nvarying vec3 fNormal;\nvarying vec3 fColor;\n\nvoid main()\n{\n float lightAmount = smoothstep(-ambientFactor, directFactor, dot(fNormal, normalize(-fPosition)));\n gl_FragColor = vec4(fColor * lightAmount, opacity);\n}\n"}),define("Velvety",["THREE","text!shaders/VelvetyShader-vertex.glsl","text!shaders/VelvetyShader-fragment.glsl"],function(e,t,i){e.VelvetyShader=function(){return{vertexColors:e.VertexColors,uniforms:{opacity:{type:"f",value:1},ambientFactor:{type:"f",value:.3},directFactor:{type:"f",value:1}},vertexShader:t,fragmentShader:i}}}),define("shape",["THREE","Velvety"],function(e){function t(t,i,r,n,o){var a=i.makeChild(t,this);return this._id=t,this._assembly=i,this._parent=r,this._unit=o,this._instances=[],a?(this.instance(a,i,r,n),a=this):(this._instanceID=0,this._children=[],this._annotations=[],this._shells=[],this._annotations=[],this._object3D=new e.Object3D,this._transform=(new e.Matrix4).copy(n),this._object3D.applyMatrix(this._transform),this._overlay3D=this._object3D.clone()),a}return t.prototype.getCADjs=function(){return this._assembly.getCADjs()},t.prototype.instance=function(i,r,n,o){i._instances.push(this),this._instanceID=i._instances.length,this._object3D=new e.Object3D,this._transform=(new e.Matrix4).copy(o),this._object3D.applyMatrix(this._transform),this._overlay3D=this._object3D.clone(),this._shells=i._shells,this._annotations=i._annotations,this._children=[];for(var a=this,s=0;se,t.material.depthWrite=1===e,t.material.uniforms.opacity.value=e)})},t.prototype.showBoundingBox=function(){var e=this.getBoundingBox(!1);if(this.bbox||e.empty()||(this.bbox=this._assembly.buildBoundingBox(e)),this.bbox){var t=this;this._eventFunc=function(){t.hideBoundingBox()},this._assembly.addEventListener("_hideBounding",this._eventFunc),this._overlay3D.add(this.bbox)}},t.prototype.hideBoundingBox=function(){this._assembly.removeEventListener("_hideBounding",this._eventFunc),this._overlay3D.remove(this.bbox)},t.prototype.getCentroid=function(e){void 0===e&&(e=!0);var t=this.getBoundingBox(!1);return e&&(t.min.applyMatrix4(this._object3D.matrixWorld),t.max.applyMatrix4(this._object3D.matrixWorld)),t.center()},t.prototype.explode=function(t,i){var r,n;if(!this._explodeDistance){this._explodeStates={},this._explodeDistance=0,i=i?i:1,this._explodeStepSize=t/60*i,this._explodeStepRemain=60*i;var o=this.getCentroid(!0);for(r=0;r0},t.prototype.resetExplode=function(){this._explodeDistance&&(this.explode(-this._explodeDistance),this._explodeDistance=void 0,this._explodeStates=void 0,this._exploseStep=void 0)},e.EventDispatcher.prototype.apply(t.prototype),t}),define("annotation",["THREE"],function(e){function t(e,t){var i=t.makeChild(e,this);return i||(this._id=e,this._assembly=t,this._geometry=void 0),i}return t.prototype.getID=function(){return this._id},t.prototype.addGeometry=function(t){this._lines=_.map(t.lines,function(t){var i=new e.BufferGeometry;return i.addAttribute("position",Float32Array,t.length/3,3),i.attributes.position.array.set(t),i}),this.dispatchEvent({type:"annotationEndLoad",annotation:this})},t.prototype.getGeometry=function(){return this._lines},e.EventDispatcher.prototype.apply(t.prototype),t}),define("shell",["THREE"],function(e){function t(e,t,i,r,n,o){var a=t.makeChild(e,this);return a||(this._id=e,this._assembly=t,this._parent=i,this._size=r,this._color=n,this._boundingBox=o,this._boundingBox.empty()&&console.log("Found empty bounding box: "+this._id)),a}return t.prototype.unloadData=function(){console.log("Shell.unloadData - Not Implemented")},t.prototype.getID=function(){return this._id},t.prototype.addGeometry=function(t,i,r){this.dispatchEvent({type:"shellStartLoad",shell:this}),this._geometry=new e.BufferGeometry,this._geometry.addAttribute("position",Float32Array,3*this._size,3),this._geometry.addAttribute("normal",Float32Array,3*this._size,3),this._geometry.addAttribute("color",Float32Array,3*this._size,3);var n,o=21845;this._geometry.offsets=[];var a=this._size/o;for(n=0;a>n;n++){var s={start:n*o*3,index:n*o*3,count:3*Math.min(this._size-n*o,o)};this._geometry.offsets.push(s)}this._geometry.attributes.position.array=t,this._geometry.attributes.normal.array=i,this._geometry.attributes.color.array=r,this._geometry.computeBoundingBox(),this._boundingBox=this._geometry.boundingBox.clone(),this._isLoaded=!0,this.dispatchEvent({type:"shellEndLoad",shell:this})},t.prototype.getBoundingBox=function(){return this._boundingBox},t.prototype.getSize=function(){return this._size},t.prototype.getGeometry=function(){return this._geometry},e.EventDispatcher.prototype.apply(t.prototype),t}),define("data_loader",["THREE","underscore","assembly","product","shape","annotation","shell"],function(e,t,i,r,n,o,a){function s(e,t,i){this._parent=e,this._viewer=t,this._queue=[],this._loading=[],this._maxWorkers=i.maxWorkers?i.maxWorkers:4,this._freeWorkers=[],this._shells={};var r=this;for(this._workers=[];this._workers.length>16&255)/255,(i>>8&255)/255,(i>>0&255)/255)},s.parseUnit=function(e){var t=e.split(" ")[0],i=parseFloat(e.split(" ")[1]);return"mm"!==t&&console.log("Found non-MM unit: "+t),i},s.parseFloatVec=function(e,t){var i=e.split(" ");if(null!=t&&i.length!=t)throw new Error("parse_float_vec: unexpected number of elements expecting "+t+" have "+i.length);t=i.length;for(var r=new Array(t),n=0;t>n;n++){var o=parseFloat(i[n]);if(!isFinite(o))throw new Error("number is not finite");r[n]=o}return r},s.getArrayFromAttribute=function(e,t){var i=e.getAttribute(t);return i?i.split(" "):[]},s.prototype.load=function(e,t,i){var r=function(e,t){e?i(e):i(void 0,t)},n={url:e,validateType:t,callback:r};this.resolveUrl(n,"index.json"),this.addRequest(n),this.runLoadQueue()},s.prototype.setRequestBase=function(e){var t=new RegExp("^(.*)/.*$"),i=t.exec(e.url);if(i){var r=i[1];"."!=r&&(r.match(/\/$/)||(r+="/"),e.base?r.match(/^\//)?e.base=r:r.length>0?e.base+=r+"/":e.base="":e.base=r)}},s.prototype.resolveUrl=function(e,t){e.base||this.setRequestBase(e),e.url.match(/\/$/)&&(e.url+=t);var i=e.url.split(".").pop();switch(i){case"xml":e.contentType="application/xml";break;case"json":e.contentType="application/json";break;default:console.log("DataLoader.resolveUrl error - invalid content type: "+i)}return!e.url.base||e.url.match(/^\w+:/)||e.url.match(/^\//)?e.url:e.url.base+e.url},s.prototype.addRequest=function(e){this.resolveUrl(e),this._queue.push(e);var t=e.url.split("/");this.dispatchEvent({type:"addRequest",file:t[t.length-1]})},s.prototype.sortQueue=function(){return this._queue.shift()},s.prototype.queueLength=function(e){var t=this._maxWorkers-this._freeWorkers.length;return e?t:this._queue.length+t},s.prototype.runLoadQueue=function(){for(;this._queue.length>0&&this._freeWorkers.length>0;){var e=this._freeWorkers.shift(),t=this.sortQueue();t.workerID=e,this._loading[e]=t,this.initRequest(t)}},s.prototype.workerMessage=function(e){var i,r;-1!=t.indexOf(["rootLoad","shellLoad","annotationLoad","loadError"],e.data.type)&&(i=this._loading[e.data.workerID]),-1!=t.indexOf(["rootLoad","workerFinish","loadError"],e.data.type)&&(this._loading[e.data.workerID]=void 0,this._freeWorkers.push(e.data.workerID),this.runLoadQueue());var n,o,a=new DOMParser;switch(e.data.type){case"rootLoad":switch(i.contentType){case"application/xml":this.buildAssemblyXML(e.data.data,i);break;case"application/json":this.buildAssemblyJSON(e.data.data,i)}break;case"annotationLoad":switch(i.contentType){case"application/xml":n=a.parseFromString(e.data.data,"text/xml").documentElement,o={id:n.getAttribute("id"),lines:this.parseAnnotationXML(n)};break;case"application/json":o=JSON.parse(e.data.data)}i.annotation.addGeometry(o),this.dispatchEvent({type:"shellLoad",file:e.data.file});break;case"shellLoad":switch(i.contentType){case"application/xml":n=a.parseFromString(e.data.data,"text/xml").documentElement,r=i.shell,o=this.parseShellXML(n,i.shellSize);break;case"application/json":r=this._shells[e.data.id],o=e.data.data;break;default:console.log("Blahhlal - What the hell is this?")}delete this._shells[e.data.id],r.addGeometry(o.position,o.normals,o.colors),this.dispatchEvent({type:"shellLoad",file:e.data.file});break;case"workerFinish":this.dispatchEvent({type:"workerFinish",file:e.data.file});break;case"parseComplete":case"loadProgress":case"loadComplete":this.dispatchEvent(e.data);break;case"loadError":i.callback&&i.callback({error:"loadError",status:e.data.status,file:i.url})}},s.prototype.initRequest=function(e){var t=this._workers[e.workerID],i={url:e.url,workerID:e.workerID,type:e.validateType};"shell"===i.type&&(i.shellSize=e.shellSize),t.postMessage(i)},s.prototype.buildElementMapXML=function(e){for(var t={},i=0;i0)for(var c=0;ci;i++)if(t=this.passes[i],t.enabled){if(t.render(this.renderer,this.writeBuffer,this.readBuffer,e,r),t.needsSwap){if(r){var o=this.renderer.context;o.stencilFunc(o.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),o.stencilFunc(o.EQUAL,1,4294967295)}this.swapBuffers()}t instanceof THREE.MaskPass?r=!0:t instanceof THREE.ClearMaskPass&&(r=!1)}},reset:function(e){void 0===e&&(e=this.renderTarget1.clone(),e.width=window.innerWidth,e.height=window.innerHeight),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2},setSize:function(e,t){var i=this.renderTarget1.clone();i.width=e,i.height=t,this.reset(i)}},define("libs/threejs/EffectComposer",["THREE"],function(){}),THREE.CopyShader={uniforms:{tDiffuse:{type:"t",value:null},opacity:{type:"f",value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")},define("libs/threejs/CopyShader",["THREE"],function(){}),THREE.FXAAShader={uniforms:{tDiffuse:{type:"t",value:null},resolution:{type:"v2",value:new THREE.Vector2(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","#define FXAA_REDUCE_MIN (1.0/128.0)","#define FXAA_REDUCE_MUL (1.0/8.0)","#define FXAA_SPAN_MAX 8.0","void main() {","vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;","vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;","vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;","vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;","vec4 rgbaM = texture2D( tDiffuse, gl_FragCoord.xy * resolution );","vec3 rgbM = rgbaM.xyz;","float opacity = rgbaM.w;","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float lumaNW = dot( rgbNW, luma );","float lumaNE = dot( rgbNE, luma );","float lumaSW = dot( rgbSW, luma );","float lumaSE = dot( rgbSE, luma );","float lumaM = dot( rgbM, luma );","float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );","float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );","vec2 dir;","dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));","dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));","float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );","float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );","dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),","max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),","dir * rcpDirMin)) * resolution;","vec3 rgbA = texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ).xyz;","rgbA += texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ).xyz;","rgbA *= 0.5;","vec3 rgbB = texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * -0.5 ).xyz;","rgbB += texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * 0.5 ).xyz;","rgbB *= 0.25;","rgbB += rgbA * 0.5;","float lumaB = dot( rgbB, luma );","if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {","gl_FragColor = vec4( rgbA, opacity );","} else {","gl_FragColor = vec4( rgbB, opacity );","}","}"].join("\n")},define("libs/threejs/FXAAShader",["THREE"],function(){}),THREE.SSAOShader={uniforms:{tDiffuse:{type:"t",value:null},tDepth:{type:"t",value:null},size:{type:"v2",value:new THREE.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},fogNear:{type:"f",value:5},fogFar:{type:"f",value:100},fogEnabled:{type:"i",value:0},onlyAO:{type:"i",value:0},aoClamp:{type:"f",value:.3},lumInfluence:{type:"f",value:.9}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cameraNear;","uniform float cameraFar;","uniform float fogNear;","uniform float fogFar;","uniform bool fogEnabled;","uniform bool onlyAO;","uniform vec2 size;","uniform float aoClamp;","uniform float lumInfluence;","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","varying vec2 vUv;","#define DL 2.399963229728653","#define EULER 2.718281828459045","float width = size.x;","float height = size.y;","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","const int samples = 8;","const float radius = 5.0;","const bool useNoise = false;","const float noiseAmount = 0.0003;","const float diffArea = 0.4;","const float gDisplace = 0.4;","const vec3 onlyAOColor = vec3( 1.0, 0.7, 0.5 );","float unpackDepth( const in vec4 rgba_depth ) {","const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );","float depth = dot( rgba_depth, bit_shift );","return depth;","}","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( width / 2.0 ) );","float gg = fract( coord.t * ( height / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float doFog() {","float zdepth = unpackDepth( texture2D( tDepth, vUv ) );","float depth = -cameraFar * cameraNear / ( zdepth * cameraFarMinusNear - cameraFar );","return smoothstep( fogNear, fogFar, depth );","}","float readDepth( const in vec2 coord ) {","return cameraCoef / ( cameraFarPlusNear - unpackDepth( texture2D( tDepth, coord ) ) * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 2.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * dd * dd / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","float dd = radius - depth * radius;","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + dd * vv;","vec2 coord2 = vUv - dd * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / width ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / height ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float pw;","float ph;","float ao;","float dz = 1.0 / float( samples );","float z = 1.0 - dz / 2.0;","float l = 0.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","pw = cos( l ) * r;","ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","if ( fogEnabled ) {","ao = mix( ao, 1.0, doFog() );","}","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = onlyAOColor * vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")},define("libs/threejs/SSAOShader",["THREE"],function(){}),THREE.RenderPass=function(e,t,i,r,n){this.scene=e,this.camera=t,this.overrideMaterial=i,this.clearColor=r,this.clearAlpha=void 0!==n?n:1,this.oldClearColor=new THREE.Color,this.oldClearAlpha=1,this.enabled=!0,this.clear=!0,this.needsSwap=!1},THREE.RenderPass.prototype={render:function(e,t,i){this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),e.render(this.scene,this.camera,i,this.clear),this.clearColor&&e.setClearColor(this.oldClearColor,this.oldClearAlpha),this.scene.overrideMaterial=null}},define("libs/threejs/RenderPass",["THREE"],function(){}),THREE.ShaderPass=function(e,t){this.textureID=void 0!==t?t:"tDiffuse",this.uniforms=THREE.UniformsUtils.clone(e.uniforms),this.material=new THREE.ShaderMaterial({uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.renderToScreen=!1,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.camera=new THREE.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new THREE.Scene,this.quad=new THREE.Mesh(new THREE.PlaneGeometry(2,2),null),this.scene.add(this.quad)},THREE.ShaderPass.prototype={render:function(e,t,i){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i),this.quad.material=this.material,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)}},define("libs/threejs/ShaderPass",["THREE","libs/threejs/RenderPass"],function(){}),THREE.MaskPass=function(e,t){this.scene=e,this.camera=t,this.enabled=!0,this.clear=!0,this.needsSwap=!1,this.inverse=!1},THREE.MaskPass.prototype={render:function(e,t,i){var r=e.context;r.colorMask(!1,!1,!1,!1),r.depthMask(!1);var n,o;this.inverse?(n=0,o=1):(n=1,o=0),r.enable(r.STENCIL_TEST),r.stencilOp(r.REPLACE,r.REPLACE,r.REPLACE),r.stencilFunc(r.ALWAYS,n,4294967295),r.clearStencil(o),e.render(this.scene,this.camera,i,this.clear),e.render(this.scene,this.camera,t,this.clear),r.colorMask(!0,!0,!0,!0),r.depthMask(!0),r.stencilFunc(r.EQUAL,1,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP)}},THREE.ClearMaskPass=function(){this.enabled=!0},THREE.ClearMaskPass.prototype={render:function(e){var t=e.context;t.disable(t.STENCIL_TEST)}},define("libs/threejs/MaskPass",["THREE"],function(){}),define("text!templates/compass_dom.html",[],function(){return'
    \n
    \n Front\n
    \n\n
    \n
    \n
    \n
    \n\n
    \n
    \n
    \n
    \n
    \n
    \n Back\n
    \n\n
    \n
    \n
    \n
    \n\n
    \n
    \n
    \n
    \n
    \n
    \n Right\n
    \n\n
    \n
    \n
    \n
    \n\n
    \n
    \n
    \n
    \n
    \n
    \n Left\n
    \n\n
    \n
    \n
    \n
    \n\n
    \n
    \n
    \n
    \n
    \n
    \n Top\n
    \n\n
    \n
    \n
    \n
    \n\n
    \n
    \n
    \n
    \n
    \n
    \n Bottom\n
    \n\n
    \n
    \n
    \n
    \n\n
    \n
    \n
    \n
    \n
    \n
    \n'}),define("compass",["THREE","text!templates/compass_dom.html"],function(e,t){function i(e,t){var r,n=e.style,o=i._transformPropertyNames;for(r=0;r1?n.normalize():n.z=Math.sqrt(1-o*o),g.copy(d.object.position).sub(d.target),r.copy(d.object.up).setLength(n.y),r.add(e.copy(d.object.up).cross(g).setLength(n.x)),r.add(g.setLength(n.z)),r}}(),this.rotateCamera=function(){var e=new THREE.Vector3,t=new THREE.Quaternion;return function(){var i=Math.acos(E.dot(v)/E.length()/v.length());i&&(e.crossVectors(E,v).normalize(),i*=d.rotateSpeed,t.setFromAxisAngle(e,-i),g.applyQuaternion(t),d.object.up.applyQuaternion(t),v.applyQuaternion(t),d.staticMoving?E.copy(v):(t.setFromAxisAngle(e,i*(d.dynamicDampingFactor-1)),E.applyQuaternion(t)))}}(),this.zoomCamera=function(){var e;f===u.TOUCH_ZOOM?(e=T/x,T=x,g.multiplyScalar(e)):(e=1+(_.y-y.y)*d.zoomSpeed,1!==e&&e>0&&(g.multiplyScalar(e),d.staticMoving?y.copy(_):y.y+=(_.y-y.y)*this.dynamicDampingFactor))},this.panCamera=function(){var e=new THREE.Vector2,t=new THREE.Vector3,i=new THREE.Vector3;return function(){e.copy(R).sub(b),e.lengthSq()&&(e.multiplyScalar(g.length()*d.panSpeed),i.copy(g).cross(d.object.up).setLength(e.x),i.add(t.copy(d.object.up).setLength(e.y)),d.object.position.add(i),d.target.add(i),d.staticMoving?b.copy(R):b.add(e.subVectors(R,b).multiplyScalar(d.dynamicDampingFactor)))}}(),this.checkDistances=function(){d.noZoom&&d.noPan||(g.lengthSq()>d.maxDistance*d.maxDistance&&d.object.position.addVectors(d.target,g.setLength(d.maxDistance)),g.lengthSq()0&&(d.dispatchEvent(w),p.copy(d.object.position))},this.reset=function(){f=u.NONE,m=u.NONE,d.target.copy(d.target0),d.object.position.copy(d.position0),d.object.up.copy(d.up0),g.subVectors(d.object.position,d.target),d.object.lookAt(d.target),d.dispatchEvent(w),p.copy(d.object.position)},this.domElement.addEventListener("contextmenu",function(e){e.preventDefault()},!1),this.domElement.addEventListener("mousedown",n,!1),this.domElement.addEventListener("mousewheel",s,!1),this.domElement.addEventListener("DOMMouseScroll",s,!1),this.domElement.addEventListener("touchstart",l,!1),this.domElement.addEventListener("touchend",h,!1),this.domElement.addEventListener("touchmove",c,!1),window.addEventListener("keydown",i,!1),window.addEventListener("keyup",r,!1),this.handleResize()},THREE.TrackballControls.prototype=Object.create(THREE.EventDispatcher.prototype),define("TrackballControls",["THREE"],function(){}),define("viewer_controls",["THREE","TrackballControls"],function(e){function t(t){function i(){r=new e.TrackballControls(n,o),r.rotateSpeed=1,r.zoomSpeed=1.2,r.panSpeed=.8,r.noZoom=!1,r.noPan=!1,r.staticMoving=!0,r.dynamicDampingFactor=.3,r.up0.set(0,1,0),r.position0=l.clone().applyEuler(s),r.position0.multiplyScalar(-a),r.sceneRadius=a,r._reset=r.reset,r._update=r.update,r.reset=function(){var e=this.sceneRadius||0;this._reset(),n.far=e+n.position.length()},r.update=function(){var e=this.sceneRadius||0;this._update(),n.far=e+n.position.length()},r.reset(),r.setRotationFromEuler=function(e,t){var i=r.object.position.length(),n="undefined"==typeof t?r.up0:t;r.position0=l.clone().applyEuler(e).multiplyScalar(-i),r.up0.set(n.x,n.y,n.z),r.reset()}}var r=null,n=t.camera,o=t.canvas,a=t.viewDistance||13e3,s=t.viewAngles||new e.Euler(0,0,0),l=new e.Vector3(0,0,1);if(void 0===n||null===n)throw new Error("No camera specified");return i(),r}return t}),define("viewer",["THREE","compass","viewer_controls"],function(e,t,i){function r(r){var n,o,a,s,l,c,h,d,u,p,f,m,g,E,v,y,_,T,x=!1,b=!1;m={minFilter:e.LinearFilter,magFilter:e.LinearFilter,format:e.RGBAFormat},n=document.getElementById(r._viewContainerId),o=new e.WebGLRenderer({antialias:!0,alpha:!0}),this.renderer=o,o.setClearColor(r.getThemeValue("canvasClearColor")),o.setSize(n.offsetWidth,n.offsetHeight),o.sortObjects=!0,o.autoClear=!1,g=new e.WebGLRenderTarget(n.offsetWidth,n.offsetHeight,m),E=new e.DepthPassPlugin,E.renderTarget=g,E.enabled=!1,o.addPrePlugin(E),a=o.domElement,n.appendChild(a),s=new e.Scene,l=new e.PerspectiveCamera(75,n.offsetWidth/n.offsetHeight,.1,1e6),l.position.x=-5e3,l.position.y=-5e3,l.position.z=0,l.lookAt(s.position),v=new e.EffectComposer(o),y=new e.ShaderPass(e.SSAOShader),y.uniforms.tDepth.value=g,y.uniforms.size.value.set(n.offsetWidth,n.offsetHeight),y.uniforms.cameraNear.value=l.near,y.uniforms.cameraFar.value=l.far,y.uniforms.aoClamp.value=.9,y.uniforms.lumInfluence.value=.5,y.enabled=!1,_=new e.ShaderPass(e.FXAAShader),_.uniforms.resolution.value.set(1/n.offsetWidth,1/n.offsetHeight),T=new e.ShaderPass(e.CopyShader),T.renderToScreen=!0,v.addPass(y),v.addPass(_),v.addPass(T),c=i({viewer:this,camera:l,canvas:a,renderPassSSAO:y,renderPassFXAA:_}),h=new t(r._compassContainerId,l,c,{width:200,height:200}),d=function(){E.enabled=!0,o.render(s,l,v.renderTarget2,!0),E.enabled=!1,v.render(.5)},u=function(e){requestAnimationFrame(function(){u(!1)}),(b===!0||x===!0||e===!0)&&(x=!1,d(),c.update(),h.update()) +},f=function(){x=!0},p=function(e){s.add(e),f()},c.addEventListener("change",function(){f()}),c.addEventListener("start",function(){b=!0}),c.addEventListener("end",function(){f(),b=!1}),window.addEventListener("resize",function(){g=new e.WebGLRenderTarget(n.offsetWidth,n.offsetHeight,m),E.renderTarget=g,y.uniforms.tDepth.value=g,y.uniforms.size.value.set(n.offsetWidth,n.offsetHeight),_.uniforms.resolution.value.set(1/n.offsetWidth,1/n.offsetHeight),o.setSize(n.offsetWidth,n.offsetHeight),l.aspect=n.offsetWidth/n.offsetHeight,l.updateProjectionMatrix(),l.lookAt(s.position),v.reset(),c.handleResize(),d()}),this.camera=l,this.controls=c,this.invalidate=f,this.add3DObject=p,u(!0)}return e.EventDispatcher.prototype.apply(r.prototype),r}),define("cad",["jquery","jstree","data_loader","viewer"],function(e,t,i,r){function n(t){if(!(t&&t.viewContainerId&&t.compassContainerId&&t.treeContainerSelector))throw"CAD.js requires a configuration!!!";this._viewContainerId=t.viewContainerId,this._$viewContainer=e("#"+t.viewContainerId),this._compassContainerId=t.compassContainerId,this._$compassContainer=e("#"+t.compassContainerId),this._treeContainerSelector=t.treeContainerSelector,this._$treeContainer=e(t.treeContainerSelector),this._$downloadsContainer=e("#"+t.downloadsContainerId),this._isCompact=void 0,this._isFullScreen=void 0,this._wasCompactBeforeFullscreen=!1,this._loader=void 0,this._parts=[],this._viewer=void 0,this._theme=void 0,this.setCompactMode(void 0!==t.isCompact?t.isCompact:!1),this.setTheme(o[t.theme]||o.dark)}var o={dark:{cssClass:"dark",canvasClearColor:0,annotationColor:16777215},bright:{cssClass:"bright",canvasClearColor:16777215,annotationColor:32896}};return o.default=o.dark,n.prototype.setupPage=function(){var t,n,o=this,a=0,s=e("#resizer"),l=e("#resizer>.expander"),c=e("#resizer>.minimizer");BigScreen.enabled&&this._isCompact===!0?(t=function(){BigScreen.toggle()},n=function(){BigScreen.toggle()},s.show(),c.hide(),l.show(),l.click(function(){n()}),c.click(function(){t()}),BigScreen.onenter=function(){c.toggle(),l.toggle(),o.setFullScreenMode(!0)},BigScreen.onexit=function(){c.toggle(),l.toggle(),o.setFullScreenMode(!1)}):s.hide(),this._theme&&(a=this._theme.canvasClearColor),this._viewer=new r(this),this._loader=new i(this,this._viewer,{autorun:!1}),this.bindEvents(),e(this).trigger("pageSetup"),e("body").removeClass("non-initialized")},n.prototype.setCompactMode=function(t){var i=e("body");this._isCompact!==t&&(t?i.addClass("compact"):i.removeClass("compact"),this._isCompact=t)},n.prototype.setFullScreenMode=function(t){var i=e("body");this._isFullScreen!==t&&(this._isFullScreen!==!0&&this._isCompact===!0?(this._wasCompactBeforeFullscreen=!0,this.setCompactMode(!1)):this._isFullScreen===!0&&this._wasCompactBeforeFullscreen===!0&&(this._wasCompactBeforeFullscreen=!1,this.setCompactMode(!0)),this._isFullScreen=t,this._isFullScreen?i.addClass("fullscreen"):i.removeClass("fullscreen"))},n.prototype.setTheme=function(t){var i=e("body");t&&(this._theme&&i.removeClass(this._theme.cssClass),i.addClass(t.cssClass),this._viewer&&this._viewer.renderer.setClearColor(t.canvasClearColor),this._theme=t)},n.prototype.getThemeValue=function(e){return"undefined"!=typeof this._theme[e]?this._theme[e]:o.default[e]},n.prototype.load=function(t){var i=this;this._loader.load(t,"assembly",function(t,r){t?(e("#dialog").dialog({autoOpen:!0,buttons:[{text:"Ok",click:function(){e(this).dialog("close")}}],modal:!0,title:"CAD.js Load Error - "+t.status}),e("#dialog-content").text("Error loading model: "+t.file)):(i._parts.push(r),r.centerGeometry(),r.zoomToFit(i._viewer.camera,i._viewer.controls),i.renderTree(),i._loader.runLoadQueue())})},n.prototype.render=function(){this._parts[0].render()},n.prototype.bindEvents=function(){var t=this,i=e(this._$viewContainer)[0],r=this._$downloadsContainer.find(">ul"),n=this._$downloadsContainer.find(".steptools-downloads-count");this._loader.addEventListener("addRequest",function(e){var i=e.file.split(".")[0];r.append("
  • "+e.file+"
  • ");var o=t._loader.queueLength(!1);n.text(o),t._$downloadsContainer.removeClass("out")}),this._loader.addEventListener("loadComplete",function(t){var i=t.file.split(".")[0];"index"===i?e("li#index").remove():e("li#"+i).text(t.file+": Parsing")}),this._loader.addEventListener("parseComplete",function(t){var i=t.file.split(".")[0];e("li#"+i).text(t.file+": Finishing")}),this._loader.addEventListener("shellLoad",function(){t._viewer.invalidate()}),this._loader.addEventListener("workerFinish",function(i){var r=i.file.split(".")[0];e("li#"+r).remove();var o=t._loader.queueLength(!1);n.text(o),0===o&&t._$downloadsContainer.addClass("out")}),this._loader.addEventListener("loadProgress",function(t){if(t.loaded){var i=t.file.split(".")[0];e("li#"+i).text(t.file+": "+t.loaded.toFixed(2)+"%")}});var o;this._viewer.controls.addEventListener("change",function(){o=!0}),this._viewer.controls.addEventListener("start",function(){o=!1}),i.addEventListener("mouseup",function(e){o||t.onClick(e),o=!1},!1),i.addEventListener("mousemove",function(){o||t.onMove()},!1),window.addEventListener("keypress",function(e){var i,r;switch(e.keyCode||e.charCode||e.which){case 120:t.explode(100);break;case 115:t.explode(-100);break;case 113:t._parts[0].hideAllBoundingBoxes(),t.tree.deselect_all(),t._viewer.invalidate();break;case 111:i=t.tree.get_selected(!1),r=t._parts[0].getByID(i[0]),r?r.toggleTransparency():t._parts[0].toggleTransparency(),t._viewer.invalidate();break;case 122:t._parts[0].zoomToFit(t._viewer.camera,t._viewer.controls),t._viewer.invalidate();break;case 106:i=t.tree.get_selected(!1),r=t._parts[0].getByID(i[0]),r&&(r.toggleVisibility()?t.tree.enable_node(i):t.tree.disable_node(i),t._viewer.invalidate())}},!0)},n.prototype.onClick=function(e){if(this._parts[0]){e.metaKey||(this._parts[0].hideAllBoundingBoxes(),this.tree.deselect_all());var t=this._parts[0].select(this._viewer.camera,e.clientX,e.clientY);if(t){t=t.getNamedParent();var i=this.tree.get_node(t.getID());this.tree.select_node(i)}this._viewer.invalidate()}},n.prototype.onMove=function(){this._parts.length>0},n.prototype.explode=function(e){var t=this.tree.get_selected(!1);if(t){for(var i=0;i=7,h=function(){var e=t.createElement("video"),i={request:["requestFullscreen","webkitRequestFullscreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"],exit:["exitFullscreen","webkitCancelFullScreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],enabled:["fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullscreenEnabled"],element:["fullscreenElement","webkitFullscreenElement","webkitCurrentFullScreenElement","mozFullScreenElement","msFullscreenElement"],change:["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],error:["fullscreenerror","webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"]},r={};for(var n in i)for(var o=0,a=i[n].length;a>o;o++)if(i[n][o]in e||i[n][o]in t||"on"+i[n][o].toLowerCase()in t){r[n]=i[n][o];break}return r}(),d=null,u=null,p=function(){},f=[],m=!1;navigator.userAgent.indexOf("Android")>-1&&navigator.userAgent.indexOf("Chrome")>-1&&(m=parseInt(navigator.userAgent.replace(/^.*Chrome\/(\d+).*$/,"$1"),10)||!0);var g=function(e){var t=f[f.length-1];(e!==t.element&&e!==d||!t.hasEntered)&&("VIDEO"===e.tagName&&(d=e),1===f.length&&y.onenter(y.element),t.enter.call(t.element,e||t.element),t.hasEntered=!0)},E=function(){!d||u||c||(d.setAttribute("controls","controls"),d.removeAttribute("controls")),d=null,u=null;var e=f.pop();e&&(e.exit.call(e.element),y.element||(f.forEach(function(e){e.exit.call(e.element)}),f=[],y.onexit()))},v=function(e,t){if(f.length>0){var i=f.pop();t=t||i.element,i.error.call(t,e),y.onerror(t,e)}},y={request:function(e,r,o,a){if(e=e||t.body,f.push({element:e,enter:r||p,exit:o||p,error:a||p}),void 0===h.request)return n(e);if(i&&t[h.enabled]===!1)return n(e);if(m!==!1&&32>m)return n(e);if(i&&void 0===h.enabled)return h.enabled="webkitFullscreenEnabled",e[h.request](),void setTimeout(function(){t[h.element]?t[h.enabled]=!0:(t[h.enabled]=!1,n(e))},250);try{/5\.1[\.\d]* Safari/.test(navigator.userAgent)?e[h.request]():e[h.request](l&&Element.ALLOW_KEYBOARD_INPUT),setTimeout(function(){t[h.element]||v(i?"not_enabled":"not_allowed",e)},100)}catch(s){v("not_enabled",e)}},exit:function(){s(),t[h.exit]()},toggle:function(e,t,i,r){y.element?y.exit():y.request(e,t,i,r)},videoEnabled:function(e){if(y.enabled)return!0;e=e||t.body;var i=r(e);return i&&void 0!==i.webkitSupportsFullscreen?i.readyStatem?!1:t[h.enabled]||!1:!0}}})}catch(_){y.element=null,y.enabled=!1}h.change&&t.addEventListener(h.change,function(){if(y.onchange(y.element),y.element){var e=f[f.length-2];e&&e.element===y.element?E():(g(y.element),a())}else E()},!1),t.addEventListener("webkitbeginfullscreen",function(e){f.push({element:e.srcElement,enter:p,exit:p,error:p}),y.onchange(e.srcElement),g(e.srcElement)},!0),t.addEventListener("webkitendfullscreen",function(e){y.onchange(e.srcElement),E(e.srcElement)},!0),h.error&&t.addEventListener(h.error,function(){v("not_allowed")},!1),e.BigScreen=y}(window,document,self!==top),define("bigScreen",function(){}),function(e){function t(t){var i,r,n=t||e,o=n.location.search.substring(1),a=o.split("&"),s={};for(r=0;r",{"class":"processingOverlay"}),e=o("
    ",{"class":"processingOverlayContent"}),this.config.loadingImg&&e.append(o("",{src:this.config.loadingImg,"class":"processingLoadingGif"})),e.append(o("

    ",{text:this.config.loadingMsg})),this.processingOverlay.append(e),o(document).find("body").css("min-height",500).append(this.processingOverlay))},removeProcessingOverlay:function(){null!==this.processingOverlay&&(this.processingOverlay.remove(),this.processingOverlay=null)},pollProcessing:function(){var t=this;o.ajax({url:t.getProcessingPollUrl(),type:"GET",dataType:"json",data:{unique_id:t.getProcessResourceId()},success:function(i){o(t).trigger("pollComplete")!==!1&&(t.parameters.processingStatus=i.status,"loading"===i.status?setTimeout(function(){e.VIS.pollProcessing.call(e.VIS)},t.config.loadingPollInterval):"ready"===i.status?t.processingSuccess.call(t):t.processingError.call(t))},error:function(){t.processingError()}})},processingSuccess:function(){this.removeProcessingOverlay();var e=this;o.ajax({url:e.getProcessingParamsUrl(),type:"GET",dataType:"json",data:{unique_id:e.getProcessResourceId()},success:function(t){o.each(t.parameters,function(i){e.parameters[i]=t.parameters[i]}),o(e).trigger("ready")},error:function(){e.processingError()}})},processingError:function(){this.createProcessingOverlay(),this.processingOverlay.find(".processingOverlayContent").html(o("

    ",{text:"There was an error processing this file for visualization"})).append(o("You can ")).append(o("",{href:this.getResourceUrl(),text:"download the file"})).append(o(" instead."))},pollComplete:o.noop,initConfig:o.noop,ready:o.noop},e.VIS=n}(window),define("VIS",["jquery","jqueryui","bigScreen"],function(e){return function(){var t;return t||e.VIS}}(this)),require.config({paths:{jquery:"libs/jquery.min",jqueryui:"libs/jquery-ui.min",jstree:"libs/jstree.min",underscore:"libs/underscore-min",THREE:"libs/three.min",TrackballControls:"libs/TrackballControls",dat:"libs/dat.gui.min",bigScreen:"libs/bigscreen.min",VIS:"libs/visualize",Velvety:"shaders/VelvetyShader"},shim:{jquery:{exports:"$"},jqueryui:{deps:["jquery"]},jstree:{deps:["jquery","jqueryui"]},underscore:{exports:"_"},THREE:{exports:"THREE"},TrackballControls:{deps:["THREE"]},dat:{exports:"dat"},VIS:{exports:"VIS",deps:["jquery","jqueryui","bigScreen"]},viewer:{deps:["libs/threejs/EffectComposer","libs/threejs/CopyShader","libs/threejs/FXAAShader","libs/threejs/SSAOShader","libs/threejs/RenderPass","libs/threejs/ShaderPass","libs/threejs/MaskPass"]},"libs/threejs/EffectComposer":{deps:["THREE"]},"libs/threejs/CopyShader":{deps:["THREE"]},"libs/threejs/FXAAShader":{deps:["THREE"]},"libs/threejs/SSAOShader":{deps:["THREE"]},"libs/threejs/RenderPass":{deps:["THREE"]},"libs/threejs/ShaderPass":{deps:["THREE","libs/threejs/RenderPass"]},"libs/threejs/MaskPass":{deps:["THREE"]}}}),requirejs(["cad","jquery","THREE","VIS"],function(e,t,i,r){t(r).on("ready",function(){var t=window.cadjs=new e({viewContainerId:"steptools-view",compassContainerId:"steptools-compass",downloadsContainerId:"steptools-downloads",treeContainerSelector:".steptools-tree",isCompact:"true"===r.getParameter("compact"),theme:r.getParameter("theme")});t.setupPage(),t.load(r.getResourceUrl())}),r.init()}),define("main",function(){}); \ No newline at end of file