{"version":3,"sources":["webpack:///jam-headless.js","webpack:///webpack/bootstrap f51d1ee20a1007488b49","webpack:///external \"three\"","webpack:///external \"rx\"","webpack:///external \"fs\"","webpack:///external \"glView-helpers\"","webpack:///./src/components/webgl/bufferToPng.js","webpack:///./src/components/webgl/deps/CombinedCamera.js","webpack:///./src/components/webgl/deps/OrbitControls.js","webpack:///./src/components/webgl/deps/Projector.js","webpack:///./src/components/webgl/deps/Selector.js","webpack:///./src/components/webgl/deps/post-process/AdditiveBlendShader.js","webpack:///./src/components/webgl/deps/post-process/CopyShader.js","webpack:///./src/components/webgl/deps/post-process/EdgeShader3.js","webpack:///./src/components/webgl/deps/post-process/EffectComposer.js","webpack:///./src/components/webgl/deps/post-process/FXAAShader.js","webpack:///./src/components/webgl/deps/post-process/MaskPass.js","webpack:///./src/components/webgl/deps/post-process/RenderPass.js","webpack:///./src/components/webgl/deps/post-process/ShaderPass.js","webpack:///./src/components/webgl/deps/post-process/vignetteShader.js","webpack:///./src/components/webgl/presets.js","webpack:///./src/components/webgl/rendererCLI.js","webpack:///./src/components/webgl/utils2.js","webpack:///./src/components/webgl/view.js","webpack:///./src/utils/meshUtils.js","webpack:///./src/utils/utils.js","webpack:///./~/glView-helpers/lib/grids/LabeledGrid.js","webpack:///./~/usco-obj-parser/lib/obj-parser.js","webpack:///./~/usco-stl-parser/lib/stl-parser.js","webpack:///external \"gl\"","webpack:///external \"pngjs\"","webpack:///external \"ramda\""],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","require","bufferToPng","buffer","width","height","fileName","genOutput","inBuf","PNG","png","j","i","k","r","g","b","a","data","pack","pipe","fs","createWriteStream","Object","defineProperty","value","_interopRequireDefault","obj","__esModule","default","_three","_three2","CombinedCamera","fov","near","far","orthoNear","orthoFar","createOrientationFunct","methodName","orCode","self","orientationGenerator","Camera","this","left","right","top","bottom","cameraO","OrthographicCamera","cameraP","PerspectiveCamera","zoom","toPerspective","target","Vector3","defaultPosition","orientationMap","F","B","A","U","L","R","orientationNameMap","FL","FR","FA","FU","BL","BR","BA","BU","LA","LU","RA","RU","FAL","FAR","FUL","FUR","BAL","BAR","BUL","BUR","shortOrientationName","orientation","charAt","toUpperCase","slice","prototype","create","lookAt","m1","Matrix4","vector","inOrthographicMode","toOrthographic","position","up","quaternion","setFromRotationMatrix","updateProjectionMatrix","projectionMatrix","inPerspectiveMode","aspect","distance","subVectors","length","Math","tan","halfWidth","halfHeight","setSize","setFov","setLens","focalLength","frameHeight","undefined","radToDeg","atan","setZoom","toDiagonalView","copy","name","offset","clone","sub","components","combinedTransform","component","nPost","add","setLength","centerView","resetView","OrbitControls","object","domElement","upVector","getAutoRotationAngle","PI","scope","autoRotateSpeed","getZoomScale","pow","userZoomSpeed","objects","objectOptions","camStates","document","enabled","centers","userZoom","userRotate","userRotateSpeed","userPan","userPanSpeed","autoRotate","minPolarAngle","maxPolarAngle","minDistance","maxDistance","active","mainPointerPressed","EPS","PIXELS_PER_ROUND","phiDelta","thetaDelta","scale","origPhiDelta","origThetaDelta","origScale","addObject","options","indexOf","DEFAULTS","assign","push","lastPosition","changeEvent","type","update","dt","center","camState","curThetaDelta","curPhiDelta","curScale","z","theta","atan2","x","y","phi","sqrt","map","index","max","min","radius","sin","cos","distanceTo","dispatchEvent","enable","disable","reset","setObservables","observables","zoomDir","zoomScale","cameras","rotate","angle","dragMoves$","zooms$","subscribe","e","delta","EventDispatcher","RenderableObject","RenderableFace","v1","RenderableVertex","v2","v3","normalModel","vertexNormalsModel","vertexNormalsLength","color","Color","material","uvs","Vector2","positionWorld","positionScreen","Vector4","visible","vertex","RenderableLine","vertexColors","RenderableSprite","rotation","Projector","getNextObjectInPool","_objectCount","_objectPoolLength","_objectPool","getNextVertexInPool","_vertexCount","_vertexPoolLength","_vertexPool","getNextFaceInPool","_faceCount","_facePoolLength","face","_facePool","getNextLineInPool","_lineCount","_linePoolLength","line","_linePool","getNextSpriteInPool","_spriteCount","_spritePoolLength","sprite","_spritePool","painterSort","clipLine","s1","s2","alpha1","alpha2","bc1near","w","bc2near","bc1far","bc2far","lerp","_object","_vertex","_face","_line","_sprite","_modelMatrix","_renderData","lights","elements","_vA","_vB","_vC","_vector3","_vector4","_clipBox","Box3","_boundingBox","_points3","Array","_viewMatrix","_viewProjectionMatrix","_modelViewProjectionMatrix","_normalMatrix","Matrix3","_frustum","Frustum","_clippedVertex1PositionScreen","_clippedVertex2PositionScreen","projectVector","camera","console","warn","project","unprojectVector","unproject","pickingRay","error","RenderList","normals","normalMatrix","setObject","getNormalMatrix","matrixWorld","projectVertex","applyMatrix4","invW","pushVertex","set","pushNormal","pushUv","checkTriangleVisibility","isIntersectionBox","setFromPoints","checkBackfaceCulling","pushLine","pushTriangle","side","DoubleSide","arguments","normal","applyMatrix3","normalize","offset2","uv","renderList","projectScene","scene","sortObjects","sortElements","autoUpdate","updateMatrixWorld","parent","matrixWorldInverse","getInverse","multiplyMatrices","setFromMatrix","traverseVisible","Light","Mesh","Line","Sprite","frustumCulled","intersectsObject","renderDepth","setFromMatrixPosition","applyProjection","sort","o","ol","geometry","BufferGeometry","attributes","offsets","positions","array","l","indices","start","count","Geometry","vertices","faces","faceVertexUvs","isFaceMaterial","MeshFaceMaterial","objectMaterials","v","vl","f","fl","materials","materialIndex","morphTargets","morphInfluences","morphTargetInfluences","v1p","v2p","v3p","t","tl","influence","targets","FrontSide","BackSide","negate","faceVertexNormals","vertexNormals","n","nl","vertexUvs","u","step","mode","LinePieces","multiplyScalar","VertexColors","colors","abs","_classCallCheck","instance","Constructor","TypeError","isRootNode","node","selectTrickleUp","selectable","walkUp","checker","findSelectionRoot","getCoordsFromPosSizeRect","inputs","pos","rect","pick","mouseCoords","hiearchyRoot","ortho","mousecoords","intersects","degToRad","transformDirection","raycaster","Raycaster","intersectObjects","filter","intersect","_createClass","defineProperties","props","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","_Projector","Selector","projector","isOrtho","children","_pickInner","AdditiveBlendShader","uniforms","tDiffuse1","tDiffuse2","tDiffuse3","normalThreshold","depthThreshold","strengh","vertexShader","join","fragmentShader","CopyShader","tDiffuse","opacity","EdgeShader3","EffectComposer","renderer","renderTarget","pixelRatio","getPixelRatio","floor","context","canvas","parameters","minFilter","LinearFilter","magFilter","format","RGBFormat","stencilBuffer","WebGLRenderTarget","renderTarget1","renderTarget2","writeBuffer","readBuffer","passes","copyPass","ShaderPass","swapBuffers","tmp","addPass","pass","insertPass","splice","render","maskActive","il","needsSwap","stencilFunc","NOTEQUAL","EQUAL","MaskPass","ClearMaskPass","FXAAShader","resolution","clear","inverse","colorMask","depthMask","writeValue","clearValue","STENCIL_TEST","stencilOp","REPLACE","ALWAYS","clearStencil","KEEP","RenderPass","overrideMaterial","clearColor","clearAlpha","oldClearColor","oldClearAlpha","getClearColor","getClearAlpha","setClearColor","shader","textureID","UniformsUtils","ShaderMaterial","defines","renderToScreen","Scene","quad","PlaneBufferGeometry","VignetteShader","darkness","presets","shadowMapEnabled","shadowMapAutoUpdate","shadowMapSoft","shadowMapType","autoUpdateScene","physicallyBasedShading","autoClear","gammaInput","gammaOutput","lens","controls","rotateSpeed","panSpeed","zoomSpeed","speed","_enabled","_active","scenes","main","gndColor","intensity","castShadow","onlyShadow","helpers","postProcessParsedData","mesh","_meshUtils","geometryFromBuffers","postProcessMesh","centerMesh","toArrayBuffer","ab","ArrayBuffer","view","Uint8Array","_slicedToArray","sliceIterator","arr","_arr","_n","_d","_e","_s","_i","Symbol","iterator","next","done","err","isArray","_view","_view2","_rx","_rx2","_fs","_fs2","_utils","_glViewHelpers","global","Rx","stlParser","objParser","meshTools","args","process","argv","uri","_args$1$split$map","split","parseInt","_args$1$split$map2","_getNameAndExtension","getNameAndExtension","ext","outputPath","log","parsers","readFileSync","parse","parseOptions","parsedObs$","progress","forEach","positionFromCoords","coords","event","targetObject","isTransformTool","input","selectionAt","_Selector","outEvent","clientX","clientY","offsetX","offsetY","detail","pickingInfos","meshFrom","_take","_ramda","take","_take2","makeCamera","cameraData","params","_CombinedCamera2","fromArray","makeControls","controlsData","_OrbitControls2","makeLight","lightData","light","HemisphereLight","newColor","AmbientLight","dirLightDefaults","shadowMapWidth","shadowMapHeight","shadowCameraLeft","shadowCameraRight","shadowCameraTop","shadowCameraBottom","shadowCameraNear","shadowCameraFar","shadowCameraFov","shadowBias","shadowDarkness","shadowCameraVisible","DirectionalLight","hasOwnProperty","Error","_OrbitControls","_CombinedCamera","contextToBuffer","gl","depth","readPixels","RGBA","UNSIGNED_BYTE","writeBufferToFile","path","_bufferToPng2","writeContextToFile","setupPostProcess","devicePixelRatio","renderTargetParameters","RGBAFormat","outScene","maskScene","composer","_EffectComposer2","_RenderPass2","outline","maskPass","clearMask","fxaaPass","vignettePass","lastPass","composers","setupPostProcess2","ppData","makeOfflineCanvas","addEventListener","makeLiveCanvas","createElement","makeCanvas","window","setupNodeSpecific","monkeyPatchGl","setupScene","extras","config","setupRenderer","WebGLRenderer","antialias","preserveDrawingBuffer","setPixelRatio","keys","_presets","dynamicInjector","Object3D","shadowPlane","ShadowPlane","MeshNormalMaterial","shading","SmoothShading","sceneExtras","targetNode","zoomToFit","_gl","getContext","_EffectComposer","_ShaderPass","_RenderPass","_CopyShader","_FXAAShader","_vignetteShader","_EdgeShader","_AdditiveBlendShader","_LabeledGrid","_bufferToPng","objectEffects","planes","shape","MeshPhongMaterial","specular","shininess","FlatShading","computeVertexNormals","computeFaceNormals","morphNormals","_ref","addAttribute","BufferAttribute","meshTohash","modelHash","hash","hex","trim","string","String","replace","exists","isEmpty","str","test","itemsEqual","JSON","stringify","toArray","constructor","safeJSONParse","getExtension","fname","substr","lastIndexOf","toLowerCase","_uriElems","shift","pop","isValidFile","file","File","generateUUID","chars","uuid","rnd","random","_possibleConstructorReturn","ReferenceError","_inherits","subClass","superClass","setPrototypeOf","__proto__","LabeledGrid","_THREE$Object3D","text","textColor","textLocation","_this","getPrototypeOf","marginSize","stepSubDivisions","_drawGrid","gridGeometry","gridMaterial","mainGridZ","subGridGeometry","subGridMaterial","subGridZ","LineBasicMaterial","setHex","linewidth","transparent","centerBased","mainGrid","subGrid","offsetWidth","offsetLength","marginGeometry","strongGridMaterial","margin","_drawNumbering","_toggle","traverse","child","toggle","labels","label","location","remove","sizeLabel","sizeLabel2","_labelStore","numbering","labelsFront","labelsSideRight","drawTextOnPlane","labelsSideLeft","labelsBack","textVisible","size","plane","texture","font","textAlign","fillStyle","fillText","strokeStyle","strokeText","Texture","needsUpdate","generateMipmaps","MeshBasicMaterial","alphaTest","doubleSided","overdraw","s","code",1,"cleanUpNextTick","draining","currentQueue","queue","concat","queueIndex","drainQueue","timeout","setTimeout","len","run","clearTimeout","Item","fun","noop","nextTick","apply","title","browser","env","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","binding","cwd","chdir","dir","umask",2,"isNode","isBrowser","isModule","detect","_process",3,"source","totalKeys","totalArgs",4,"defaults","useWorker","_compositeDetect2","_assign2","_parameters","obs","ReplaySubject","worker","Worker","URL","createObjectURL","Blob","onmessage","modelData","onNext","total","_parseHelpers","createModelBuffers","onCompleted","NaN","onerror","onError","filename","lineno","message","postMessage","terminate","_obj2","getData","inputDataType","outputs","_compositeDetect","_assign","_obj","./obj","./parseHelpers","composite-detect","fast.js/object/assign",5,"OBJ","parseIndex","dataArray","currentObject","_attributes","_handle_face_line","rawData","rIndices","idx","isNaN","_newObject","faceCount","vertex_pattern","normal_pattern","uv_pattern","face_pattern1","face_pattern2","face_pattern3","face_pattern4","lines","normIndices","uvIndices","face_offset","currentMaterial","result","exec","parseFloat","substring","_unindexData",6,"Float32Array","Uint32Array","webkitURL","mozURL","parseSteps","ensureBinary","isBinary","isDataBinary","parseBinary","parseASCII","ensureString","reader","DataView","getUint32","dataOffset","faceLength","vertexstart","getFloat32","patternFace","patternNormal","patternVertex","posArray","normArray","./utils","buf","array_buffer","byteLength","fromCharCode","charCodeAt","expect","face_size","n_faces"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA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+B,EAAA,GAEAC,EAAApB,EAAAE,UAAA,OACAgB,EAAA,GAAAE,EAAAD,EACAD,IAAAlB,EAAAe,WAxCA/9B,OAAAC,eAAA/B,EAAA,cACAgC,OAAA,IAEAhC,EAAA6+B,eACA7+B,EAAAw+B,eACAx+B,EAAA0+B,yBAsCS,U5BykJH,SAASz+B,EAAQD,G6Bz9JvBC,EAAAD,QAAAQ,QAAA,O7B+9JM,SAASP,EAAQD,G8B/9JvBC,EAAAD,QAAAQ,QAAA,U9Bq+JM,SAASP,EAAQD,G+Br+JvBC,EAAAD,QAAAQ,QAAA","file":"jam-headless.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"./dist/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(20);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = require(\"three\");\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = require(\"rx\");\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = require(\"fs\");\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = require(\"glView-helpers\");\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\texports.default = bufferToPng;\n\tvar fs = __webpack_require__(3);\n\t\n\tfunction bufferToPng(buffer, width, height, fileName) {\n\t\n\t  function genOutput(inBuf, width, height) {\n\t    var PNG = __webpack_require__(29).PNG;\n\t    var png = new PNG({ width: width, height: height });\n\t\n\t    /*for (let i = 0; i < inBuf.length; ++i) {\n\t      png.data[i] = inBuf[i]\n\t    }*/\n\t    //vertical flip\n\t\n\t    for (var j = 0; j < height; ++j) {\n\t      //from https://gist.github.com/bsergean\n\t      for (var i = 0; i < width; ++i) {\n\t\n\t        var k = j * width + i;\n\t        var r = inBuf[4 * k];\n\t        var g = inBuf[4 * k + 1];\n\t        var b = inBuf[4 * k + 2];\n\t        var a = inBuf[4 * k + 3];\n\t\n\t        var m = (height - j + 1) * width + i;\n\t        png.data[4 * m] = r;\n\t        png.data[4 * m + 1] = g;\n\t        png.data[4 * m + 2] = b;\n\t        png.data[4 * m + 3] = a;\n\t      }\n\t    }\n\t    png.pack().pipe(fs.createWriteStream(fileName));\n\t  }\n\t\n\t  //this is just a helper\n\t  function log(inBuf, width, height) {\n\t    var channels = inBuf.length / 4;\n\t    for (var i = 0; i < channels; ++i) {\n\t      var r = inBuf[i * 4];\n\t      var g = inBuf[i * 4 + 1];\n\t      var b = inBuf[i * 4 + 2];\n\t      var a = inBuf[i * 4 + 3];\n\t\n\t      console.log(r, g, b, a);\n\t      console.log(\"//\");\n\t    }\n\t  }\n\t\n\t  genOutput(buffer, width, height);\n\t}\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/*\n\t *  @author zz85 / http://twitter.com/blurspline / http://www.lab4games.net/zz85/blog\n\t *\n\t *  A general perpose camera, for setting FOV, Lens Focal Length,\n\t *      and switching between perspective and orthographic views easily.\n\t *      Use this only if you do not wish to manage\n\t *      both a Orthographic and Perspective Camera\n\t *\n\t * some additional changes by kaosat-dev\n\t */\n\t\n\tvar CombinedCamera = function CombinedCamera(width, height, fov, near, far, orthoNear, orthoFar) {\n\t\n\t    _three2.default.Camera.call(this);\n\t\n\t    this.fov = fov;\n\t\n\t    this.left = -width / 2;\n\t    this.right = width / 2;\n\t    this.top = height / 2;\n\t    this.bottom = -height / 2;\n\t\n\t    // We could also handle the projectionMatrix internally, but just wanted to test nested camera objects\n\t\n\t    this.cameraO = new _three2.default.OrthographicCamera(width / -2, width / 2, height / 2, height / -2, orthoNear, orthoFar);\n\t    this.cameraP = new _three2.default.PerspectiveCamera(fov, width / height, near, far);\n\t\n\t    this.zoom = 1;\n\t\n\t    this.toPerspective();\n\t\n\t    var aspect = width / height;\n\t\n\t    this.target = new _three2.default.Vector3();\n\t    this.defaultPosition = new _three2.default.Vector3();\n\t\n\t    /**\n\t      Orientations:\n\t        front: +x \n\t        back:  -x\n\t        top/above : +z\n\t        bottom/under : -z\n\t        left: +y\n\t        right: -y \n\t    */\n\t    this.orientationMap = {\n\t        \"F\": new _three2.default.Vector3(1, 0, 0),\n\t        \"B\": new _three2.default.Vector3(-1, 0, 0),\n\t\n\t        \"A\": new _three2.default.Vector3(0, 0, 1),\n\t        \"U\": new _three2.default.Vector3(0, 0, -1),\n\t\n\t        \"L\": new _three2.default.Vector3(0, 1, 0),\n\t        \"R\": new _three2.default.Vector3(0, -1, 0)\n\t    };\n\t\n\t    //we generate methods for each an every possible case\n\t    var orientationNameMap = {\n\t        \"F\": \"Front\",\n\t        \"B\": \"Back\",\n\t        \"L\": \"Left\",\n\t        \"R\": \"Right\",\n\t        \"A\": \"Top\",\n\t        \"U\": \"Bottom\",\n\t\n\t        \"FL\": \"FrontLeft\",\n\t        \"FR\": \"FrontRight\",\n\t        \"FA\": \"FrontTop\",\n\t        \"FU\": \"FrontBottom\",\n\t\n\t        \"BL\": \"BackLeft\",\n\t        \"BR\": \"BackRight\",\n\t        \"BA\": \"BackTop\",\n\t        \"BU\": \"BackBottom\",\n\t\n\t        \"LA\": \"LeftTop\",\n\t        \"LU\": \"LeftBottom\",\n\t        \"RA\": \"RightTop\",\n\t        \"RU\": \"RightBottom\",\n\t\n\t        \"FAL\": \"FrontTopLeft\",\n\t        \"FAR\": \"FrontTopRight\",\n\t        \"FUL\": \"FrontBottomLeft\",\n\t        \"FUR\": \"FrontBottomRight\",\n\t\n\t        \"BAL\": \"BackTopLeft\",\n\t        \"BAR\": \"BackTopRight\",\n\t        \"BUL\": \"BackBottomLeft\",\n\t        \"BUR\": \"BackBottomRight\"\n\t    };\n\t\n\t    var self = this;\n\t    function createOrientationFunct(methodName, orCode) {\n\t        self[methodName] = function () {\n\t            self.orientationGenerator(orCode);\n\t        };\n\t    }\n\t\n\t    for (var shortOrientationName in orientationNameMap) {\n\t        var orientation = orientationNameMap[shortOrientationName];\n\t        var methodName = \"to\" + orientation.charAt(0).toUpperCase() + orientation.slice(1) + \"View\";\n\t        createOrientationFunct(methodName, shortOrientationName);\n\t    }\n\t};\n\t\n\tCombinedCamera.prototype = Object.create(_three2.default.Camera.prototype);\n\t\n\tCombinedCamera.prototype.lookAt = (function () {\n\t\n\t    // This routine does not support cameras with rotated and/or translated parent(s)\n\t\n\t    var m1 = new _three2.default.Matrix4();\n\t\n\t    return function (vector) {\n\t        this.target = vector;\n\t        if (this.inOrthographicMode === true) {\n\t            this.toOrthographic();\n\t        }\n\t\n\t        m1.lookAt(this.position, vector, this.up);\n\t\n\t        this.quaternion.setFromRotationMatrix(m1);\n\t    };\n\t})();\n\t\n\tCombinedCamera.prototype.toPerspective = function () {\n\t\n\t    // Switches to the Perspective Camera\n\t\n\t    this.near = this.cameraP.near;\n\t    this.far = this.cameraP.far;\n\t\n\t    this.cameraP.fov = this.fov / this.zoom;\n\t\n\t    this.cameraP.updateProjectionMatrix();\n\t\n\t    this.projectionMatrix = this.cameraP.projectionMatrix;\n\t\n\t    this.inPerspectiveMode = true;\n\t    this.inOrthographicMode = false;\n\t};\n\t\n\tCombinedCamera.prototype.toOrthographic = function () {\n\t\n\t    // Switches to the Orthographic camera estimating viewport from Perspective\n\t\n\t    var fov = this.fov;\n\t    var aspect = this.cameraP.aspect;\n\t    var near = this.cameraP.near;\n\t    var far = this.cameraP.far;\n\t\n\t    //set the orthographic view rectangle to 0,0,width,height\n\t    //see here : http://stackoverflow.com/questions/13483775/set-zoomvalue-of-a-perspective-equal-to-perspective\n\t    if (this.target === null) {\n\t        this.target = new _three2.default.Vector3();\n\t    }\n\t    var distance = new _three2.default.Vector3().subVectors(this.position, this.target).length() * 0.3;\n\t    var width = Math.tan(fov) * distance * aspect;\n\t    var height = Math.tan(fov) * distance;\n\t\n\t    var halfWidth = width;\n\t    var halfHeight = height;\n\t\n\t    this.cameraO.left = halfWidth;\n\t    this.cameraO.right = -halfWidth;\n\t    this.cameraO.top = -halfHeight;\n\t    this.cameraO.bottom = halfHeight;\n\t\n\t    this.cameraO.updateProjectionMatrix();\n\t\n\t    this.near = this.cameraO.near;\n\t    this.far = this.cameraO.far;\n\t    this.projectionMatrix = this.cameraO.projectionMatrix;\n\t\n\t    this.inPerspectiveMode = false;\n\t    this.inOrthographicMode = true;\n\t};\n\t\n\tCombinedCamera.prototype.setSize = function (width, height) {\n\t\n\t    this.cameraP.aspect = width / height;\n\t    this.left = -width / 2;\n\t    this.right = width / 2;\n\t    this.top = height / 2;\n\t    this.bottom = -height / 2;\n\t};\n\t\n\tCombinedCamera.prototype.setFov = function (fov) {\n\t\n\t    this.fov = fov;\n\t\n\t    if (this.inPerspectiveMode) {\n\t\n\t        this.toPerspective();\n\t    } else {\n\t\n\t        this.toOrthographic();\n\t    }\n\t};\n\t\n\t// For mantaining similar API with PerspectiveCamera\n\t\n\tCombinedCamera.prototype.updateProjectionMatrix = function () {\n\t\n\t    if (this.inPerspectiveMode) {\n\t\n\t        this.toPerspective();\n\t    } else {\n\t\n\t        this.toPerspective();\n\t        this.toOrthographic();\n\t    }\n\t};\n\t\n\t/*\n\t* Uses Focal Length (in mm) to estimate and set FOV\n\t* 35mm (fullframe) camera is used if frame size is not specified;\n\t* Formula based on http://www.bobatkins.com/photography/technical/field_of_view.html\n\t*/\n\tCombinedCamera.prototype.setLens = function (focalLength, frameHeight) {\n\t\n\t    if (frameHeight === undefined) frameHeight = 24;\n\t\n\t    var fov = 2 * _three2.default.Math.radToDeg(Math.atan(frameHeight / (focalLength * 2)));\n\t\n\t    this.setFov(fov);\n\t\n\t    return fov;\n\t};\n\t\n\tCombinedCamera.prototype.setZoom = function (zoom) {\n\t\n\t    this.zoom = zoom;\n\t\n\t    if (this.inPerspectiveMode) {\n\t        this.toPerspective();\n\t    } else {\n\t        this.toOrthographic();\n\t    }\n\t};\n\t\n\tCombinedCamera.prototype.toDiagonalView = function () {\n\t    this.position.copy(this.defaultPosition);\n\t    this.target = new _three2.default.Vector3();\n\t    this.lookAt(this.target);\n\t};\n\t\n\tCombinedCamera.prototype.orientationGenerator = function (name) {\n\t\n\t    //name is a string of letters of length 1 to 3 representing\n\t    // the desired orientation : ex : a: above, r: right, ar: above right\n\t    //, flb: front left bottom\n\t\n\t    var offset = this.position.clone().sub(this.target);\n\t    var components = name;\n\t    //console.log(\"offset distance\",offset.length());\n\t\n\t    var combinedTransform = new _three2.default.Vector3();\n\t    for (var i = 0; i < components.length; i++) {\n\t        //console.log(\"handling\", components[i] );\n\t        var component = components[i];\n\t        var nPost = this.orientationMap[component].clone(); //.multiplyScalar( offset.length() );\n\t\n\t        combinedTransform.add(nPost);\n\t    }\n\t    combinedTransform.setLength(offset.length());\n\t    //console.log(\"offset disance 2\",combinedTransform.length() );\n\t    this.position.copy(combinedTransform);\n\t\n\t    //console.log(\"offset disance 3\",this.position.clone().sub(this.target).length() );\n\t    this.lookAt(this.target);\n\t    //console.log(\"offset disance 4\",this.position.clone().sub(this.target).length() );\n\t};\n\t\n\t/*CombinedCamera.prototype.toFrontView = function() {\n\t    \n\t    var offset = this.position.clone().sub( this.target );\n\t    var nPost = new  THREE.Vector3();\n\t    nPost.y = -offset.length();\n\t    this.position.copy( nPost );\n\t    this.lookAt( this.target );\n\t};\n\t\n\tCombinedCamera.prototype.toFrontLeftView = function() {\n\t    //TODO: check posisitoning\n\t    var offset = this.position.clone().sub( this.target );\n\t    var nPost = new  THREE.Vector3();\n\t    nPost.y = -offset.length();\n\t    nPost.x = -offset.length();\n\t    this.position.copy( nPost );\n\t    this.lookAt( this.target );\n\t};\n\t\n\tCombinedCamera.prototype.toFrontRightView = function() {\n\t    //TODO: check posisitoning\n\t    var offset = this.position.clone().sub( this.target );\n\t    var nPost = new  THREE.Vector3();\n\t    nPost.y = -offset.length();\n\t    nPost.x = offset.length();\n\t    this.position.copy( nPost );\n\t    this.lookAt( this.target );\n\t};\n\t\n\tCombinedCamera.prototype.toFrontTopView = function() {\n\t    //TODO: check posisitoning\n\t    var offset = this.position.clone().sub( this.target );\n\t    var nPost = new  THREE.Vector3();\n\t    nPost.y = -offset.length();\n\t    nPost.z = offset.length();\n\t    this.position.copy( nPost );\n\t    this.lookAt( this.target );\n\t};\n\t\n\tCombinedCamera.prototype.toFrontBottomView = function() {\n\t    //TODO: check posisitoning\n\t    var offset = this.position.clone().sub( this.target );\n\t    var nPost = new  THREE.Vector3();\n\t    nPost.y = -offset.length();\n\t    nPost.z = -offset.length();\n\t    this.position.copy( nPost );\n\t    this.lookAt( this.target );\n\t};\n\t\n\tCombinedCamera.prototype.toBackView = function() {\n\t\n\t    var offset = this.position.clone().sub(this.target);\n\t    var nPost = new  THREE.Vector3();\n\t    nPost.y = offset.length();\n\t    this.position.copy(nPost);\n\t    this.lookAt(this.target);\n\t};\n\t\n\tCombinedCamera.prototype.toLeftView = function() {\n\t    \n\t    var offset = this.position.clone().sub(this.target);\n\t    var nPost = new  THREE.Vector3();\n\t    nPost.x = offset.length();\n\t    this.position.copy(nPost);\n\t    this.lookAt(this.target);\n\t    \n\t};\n\t\n\tCombinedCamera.prototype.toRightView = function() {\n\t    var offset = this.position.clone().sub(this.target);\n\t    var nPost = new  THREE.Vector3();\n\t    nPost.x = -offset.length();\n\t    this.position.copy( nPost );\n\t    this.lookAt(this.target );\n\t};\n\t\n\tCombinedCamera.prototype.toTopView = function() {\n\t    this.orientationGenerator( \"a\" );\n\t};\n\t\n\tCombinedCamera.prototype.toBottomView = function() {\n\t    var offset = this.position.clone().sub(this.target);\n\t    var nPost = new  THREE.Vector3();\n\t    nPost.z = -offset.length();\n\t    this.position.copy( nPost );\n\t    this.lookAt( this.target );\n\t};*/\n\t\n\tCombinedCamera.prototype.centerView = function () {\n\t    //var offset = new THREE.Vector3().sub(this.target.clone());\n\t    //this.position= new THREE.Vector3(100,100,200);\n\t    //this.target = new THREE.Vector3();\n\t\n\t    this.position.copy(this.defaultPosition);\n\t    this.lookAt(this.target);\n\t};\n\t\n\tCombinedCamera.prototype.resetView = function () {\n\t    this.position.copy(this.defaultPosition);\n\t    this.target.copy(new _three2.default.Vector3());\n\t};\n\t\n\t//export default CombinedCamera;\n\tmodule.exports = CombinedCamera;\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * @author kaosat-dev\n\t * @author qiao / https://github.com/qiao\n\t * @author mrdoob / http://mrdoob.com\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t */\n\tvar OrbitControls = function OrbitControls(object, domElement, upVector) {\n\t\n\t  //this.object = object\n\t  this.objects = [];\n\t  this.objectOptions = [];\n\t  this.camStates = [];\n\t\n\t  this.domElement = domElement !== undefined ? domElement : document;\n\t  this.upVector = upVector || new _three2.default.Vector3(0, 1, 0);\n\t\n\t  // API\n\t  this.enabled = true;\n\t\n\t  //this.center = new THREE.Vector3()\n\t  this.centers = [];\n\t\n\t  this.userZoom = true;\n\t  this.userZoomSpeed = 1.0;\n\t\n\t  this.userRotate = true;\n\t  this.userRotateSpeed = 1.0;\n\t\n\t  this.userPan = true;\n\t  this.userPanSpeed = 2.0;\n\t\n\t  this.autoRotate = false;\n\t  this.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60\n\t\n\t  this.minPolarAngle = 0; // radians\n\t  this.maxPolarAngle = Math.PI; // radians\n\t\n\t  this.minDistance = 0.2;\n\t  this.maxDistance = 600;\n\t\n\t  this.active = false;\n\t  this.mainPointerPressed = false;\n\t\n\t  // internals\n\t\n\t  var scope = this;\n\t\n\t  var EPS = 0.000001;\n\t  var PIXELS_PER_ROUND = 1800;\n\t\n\t  var phiDelta = 0;\n\t  var thetaDelta = 0;\n\t  var scale = 1;\n\t\n\t  var origPhiDelta = phiDelta;\n\t  var origThetaDelta = thetaDelta;\n\t  var origScale = scale;\n\t\n\t  //to add control of multiple cameras\n\t  this.addObject = function (object, options) {\n\t    if (this.objects.indexOf(object) != -1) return;\n\t    var DEFAULTS = { userZoom: true, userPan: true, userRotate: true };\n\t    options = Object.assign({}, DEFAULTS, options);\n\t\n\t    this.objects.push(object);\n\t    this.objectOptions.push(options);\n\t    this.centers.push(new _three2.default.Vector3());\n\t    this.camStates.push({ phiDelta: 0, thetaDelta: 0, scale: 1, lastPosition: new _three2.default.Vector3() });\n\t  };\n\t\n\t  // events\n\t  var changeEvent = { type: 'change' };\n\t\n\t  this.update = function (dt) {\n\t    //this is a modified version, with inverted Y and Z (since we use camera.z => up)\n\t    //we also allow multiple objects/cameras\n\t    for (var i = 0; i < this.objects.length; i++) {\n\t      var object = this.objects[i];\n\t      var center = this.centers[i];\n\t      var camState = this.camStates[i];\n\t\n\t      var curThetaDelta = camState.thetaDelta;\n\t      var curPhiDelta = camState.phiDelta;\n\t      var curScale = camState.scale;\n\t\n\t      var lastPosition = camState.lastPosition;\n\t\n\t      var position = object.position;\n\t      var offset = position.clone().sub(center);\n\t\n\t      if (this.upVector.z == 1) {\n\t        // angle from z-axis around y-axis, upVector : z\n\t        var theta = Math.atan2(offset.x, offset.y);\n\t        // angle from y-axis\n\t        var phi = Math.atan2(Math.sqrt(offset.x * offset.x + offset.y * offset.y), offset.z);\n\t      } else {\n\t        //in case of y up\n\t        var theta = Math.atan2(offset.x, offset.z);\n\t        var phi = Math.atan2(Math.sqrt(offset.x * offset.x + offset.z * offset.z), offset.y);\n\t        curThetaDelta = -curThetaDelta;\n\t      }\n\t\n\t      if (this.autoRotate) {\n\t        //this.rotateLeft( getAutoRotationAngle() )\n\t        //PER camera\n\t        this.objects.map(function (object, index) {\n\t          if (scope.objectOptions[index].userRotate) {\n\t            scope.camStates[index].thetaDelta += getAutoRotationAngle();\n\t          }\n\t        });\n\t      }\n\t\n\t      theta += curThetaDelta;\n\t      phi += curPhiDelta;\n\t\n\t      // restrict phi to be between desired limits\n\t      phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, phi));\n\t      // restrict phi to be betwee EPS and PI-EPS\n\t      phi = Math.max(EPS, Math.min(Math.PI - EPS, phi));\n\t      //multiply by scaling effect\n\t      var radius = offset.length() * curScale;\n\t      // restrict radius to be between desired limits\n\t      radius = Math.max(this.minDistance, Math.min(this.maxDistance, radius));\n\t\n\t      if (this.upVector.z == 1) {\n\t        offset.x = radius * Math.sin(phi) * Math.sin(theta);\n\t        offset.z = radius * Math.cos(phi);\n\t        offset.y = radius * Math.sin(phi) * Math.cos(theta);\n\t      } else {\n\t        offset.x = radius * Math.sin(phi) * Math.sin(theta);\n\t        offset.y = radius * Math.cos(phi);\n\t        offset.z = radius * Math.sin(phi) * Math.cos(theta);\n\t      }\n\t\n\t      //\n\t      position.copy(center).add(offset);\n\t      object.lookAt(center);\n\t\n\t      if (lastPosition.distanceTo(object.position) > 0) {\n\t        //this.active = true\n\t        this.dispatchEvent(changeEvent);\n\t\n\t        lastPosition.copy(object.position);\n\t      } else {\n\t        //fireDeActivated()\n\t      }\n\t\n\t      camState.thetaDelta /= 1.5;\n\t      camState.phiDelta /= 1.5;\n\t      camState.scale = 1;\n\t    }\n\t  };\n\t\n\t  function getAutoRotationAngle() {\n\t    return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;\n\t  }\n\t\n\t  function getZoomScale() {\n\t    return Math.pow(0.95, scope.userZoomSpeed);\n\t  }\n\t\n\t  this.enable = function () {\n\t    scope.enabled = true;\n\t    this.enabled = true;\n\t  };\n\t\n\t  this.disable = function () {\n\t    scope.enabled = false;\n\t    this.enabled = false;\n\t  };\n\t\n\t  this.reset = function () {\n\t    for (var i = 0; i < this.objects.length; i++) {\n\t      var center = this.centers[i];\n\t      center = new _three2.default.Vector3();\n\t    }\n\t    this.objects.map(function (object, index) {\n\t      var center = this.centers[index];\n\t      center = new _three2.default.Vector3();\n\t      this.camStates[index].phiDelta = origPhiDelta;\n\t      this.camStates[index].thetaDelta = origThetaDelta;\n\t      this.camStates[index].scale = origScale = scale;\n\t    });\n\t\n\t    this.update();\n\t  };\n\t\n\t  this.setObservables = function (observables) {\n\t    var dragMoves$ = observables.dragMoves$;\n\t    var zooms$ = observables.zooms$;\n\t\n\t    var self = this;\n\t\n\t    /* are these useful ?\n\t    scope.userZoomSpeed = 0.6\n\t     onPinch\n\t    */\n\t    function zoom(zoomDir, zoomScale, cameras) {\n\t\n\t      if (scope.enabled === false) return;\n\t      if (scope.userZoom === false) return;\n\t\n\t      //PER camera\n\t      cameras.map(function (object, index) {\n\t        if (scope.objectOptions[index].userZoom) {\n\t\n\t          if (zoomDir < 0) scope.camStates[index].scale /= zoomScale;\n\t          if (zoomDir > 0) scope.camStates[index].scale *= zoomScale;\n\t        }\n\t      });\n\t    }\n\t\n\t    function rotate(cameras, angle) {\n\t\n\t      if (scope.enabled === false) return;\n\t      if (scope.userRotate === false) return;\n\t\n\t      //PER camera\n\t      cameras.map(function (object, index) {\n\t        if (scope.objectOptions[index].userRotate) {\n\t          scope.camStates[index].thetaDelta += angle.x;\n\t          scope.camStates[index].phiDelta += angle.y;\n\t        }\n\t      });\n\t    }\n\t\n\t    //TODO: implement\n\t    function pan(cameras, offset) {\n\t      //console.log(event)\n\t      var _origDist = distance.clone();\n\t\n\t      //do this PER camera\n\t      cameras.map(function (object, index) {\n\t        if (scope.objectOptions[index].userPan) {\n\t          var _distance = _origDist.clone();\n\t          _distance.transformDirection(object.matrix);\n\t          _distance.multiplyScalar(scope.userPanSpeed);\n\t\n\t          object.position.add(_distance);\n\t          scope.centers[index].add(_distance);\n\t        }\n\t      });\n\t    }\n\t\n\t    dragMoves$.subscribe(function (e) {\n\t      var delta = e.delta;\n\t\n\t      /*if ( angle === undefined ) {\n\t      angle = 2 * Math.PI /180  * scope.userRotateSpeed\n\t      }*/\n\t      var angle = { x: 0, y: 0 };\n\t      angle.x = 2 * Math.PI * delta.x / PIXELS_PER_ROUND * scope.userRotateSpeed;\n\t      angle.y = -2 * Math.PI * delta.y / PIXELS_PER_ROUND * scope.userRotateSpeed;\n\t\n\t      //console.log(\"rotate by angle\",angle)\n\t      /*if ( angle === undefined ) {\n\t        angle = 2 * Math.PI /180  * scope.userRotateSpeed\n\t      } */\n\t      rotate(self.objects, angle);\n\t    });\n\t    //.subscribe(e=>e)//console.log(\"dragMoves\",e.delta))\n\t\n\t    zooms$.subscribe(function (delta) {\n\t      var zoomScale = undefined;\n\t      if (!zoomScale) {\n\t        zoomScale = getZoomScale();\n\t      }\n\t      zoom(delta, zoomScale, self.objects);\n\t    });\n\t    //.subscribe(e=>e)//console.log(\"zoom\",e))\n\t  };\n\t};\n\t\n\tOrbitControls.prototype = Object.create(_three2.default.EventDispatcher.prototype);\n\t\n\texports.default = OrbitControls;\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t\tvalue: true\n\t});\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t//var THREE = require(\"three\"); //until it is done via the import syntax everywhere we have to use this\n\t\n\t_three2.default.RenderableObject = function () {\n\t\n\t\tthis.id = 0;\n\t\n\t\tthis.object = null;\n\t\tthis.z = 0;\n\t};\n\t\n\t//\n\t\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author supereggbert / http://www.paulbrunt.co.uk/\n\t * @author julianwa / https://github.com/julianwa\n\t */\n\t_three2.default.RenderableFace = function () {\n\t\n\t\tthis.id = 0;\n\t\n\t\tthis.v1 = new _three2.default.RenderableVertex();\n\t\tthis.v2 = new _three2.default.RenderableVertex();\n\t\tthis.v3 = new _three2.default.RenderableVertex();\n\t\n\t\tthis.normalModel = new _three2.default.Vector3();\n\t\n\t\tthis.vertexNormalsModel = [new _three2.default.Vector3(), new _three2.default.Vector3(), new _three2.default.Vector3()];\n\t\tthis.vertexNormalsLength = 0;\n\t\n\t\tthis.color = new _three2.default.Color();\n\t\tthis.material = null;\n\t\tthis.uvs = [new _three2.default.Vector2(), new _three2.default.Vector2(), new _three2.default.Vector2()];\n\t\n\t\tthis.z = 0;\n\t};\n\t\n\t//\n\t\n\t_three2.default.RenderableVertex = function () {\n\t\n\t\tthis.position = new _three2.default.Vector3();\n\t\tthis.positionWorld = new _three2.default.Vector3();\n\t\tthis.positionScreen = new _three2.default.Vector4();\n\t\n\t\tthis.visible = true;\n\t};\n\t\n\t_three2.default.RenderableVertex.prototype.copy = function (vertex) {\n\t\n\t\tthis.positionWorld.copy(vertex.positionWorld);\n\t\tthis.positionScreen.copy(vertex.positionScreen);\n\t};\n\t\n\t//\n\t\n\t_three2.default.RenderableLine = function () {\n\t\n\t\tthis.id = 0;\n\t\n\t\tthis.v1 = new _three2.default.RenderableVertex();\n\t\tthis.v2 = new _three2.default.RenderableVertex();\n\t\n\t\tthis.vertexColors = [new _three2.default.Color(), new _three2.default.Color()];\n\t\tthis.material = null;\n\t\n\t\tthis.z = 0;\n\t};\n\t\n\t//\n\t\n\t_three2.default.RenderableSprite = function () {\n\t\n\t\tthis.id = 0;\n\t\n\t\tthis.object = null;\n\t\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t\tthis.z = 0;\n\t\n\t\tthis.rotation = 0;\n\t\tthis.scale = new _three2.default.Vector2();\n\t\n\t\tthis.material = null;\n\t};\n\t\n\t//\n\t\n\t_three2.default.Projector = function () {\n\t\n\t\tvar _object,\n\t\t    _objectCount,\n\t\t    _objectPool = [],\n\t\t    _objectPoolLength = 0,\n\t\t    _vertex,\n\t\t    _vertexCount,\n\t\t    _vertexPool = [],\n\t\t    _vertexPoolLength = 0,\n\t\t    _face,\n\t\t    _faceCount,\n\t\t    _facePool = [],\n\t\t    _facePoolLength = 0,\n\t\t    _line,\n\t\t    _lineCount,\n\t\t    _linePool = [],\n\t\t    _linePoolLength = 0,\n\t\t    _sprite,\n\t\t    _spriteCount,\n\t\t    _spritePool = [],\n\t\t    _spritePoolLength = 0,\n\t\t    _renderData = { objects: [], lights: [], elements: [] },\n\t\t    _vA = new _three2.default.Vector3(),\n\t\t    _vB = new _three2.default.Vector3(),\n\t\t    _vC = new _three2.default.Vector3(),\n\t\t    _vector3 = new _three2.default.Vector3(),\n\t\t    _vector4 = new _three2.default.Vector4(),\n\t\t    _clipBox = new _three2.default.Box3(new _three2.default.Vector3(-1, -1, -1), new _three2.default.Vector3(1, 1, 1)),\n\t\t    _boundingBox = new _three2.default.Box3(),\n\t\t    _points3 = new Array(3),\n\t\t    _points4 = new Array(4),\n\t\t    _viewMatrix = new _three2.default.Matrix4(),\n\t\t    _viewProjectionMatrix = new _three2.default.Matrix4(),\n\t\t    _modelMatrix,\n\t\t    _modelViewProjectionMatrix = new _three2.default.Matrix4(),\n\t\t    _normalMatrix = new _three2.default.Matrix3(),\n\t\t    _frustum = new _three2.default.Frustum(),\n\t\t    _clippedVertex1PositionScreen = new _three2.default.Vector4(),\n\t\t    _clippedVertex2PositionScreen = new _three2.default.Vector4();\n\t\n\t\t//\n\t\n\t\tthis.projectVector = function (vector, camera) {\n\t\n\t\t\tconsole.warn('THREE.Projector: .projectVector() is now vector.project().');\n\t\t\tvector.project(camera);\n\t\t};\n\t\n\t\tthis.unprojectVector = function (vector, camera) {\n\t\n\t\t\tconsole.warn('THREE.Projector: .unprojectVector() is now vector.unproject().');\n\t\t\tvector.unproject(camera);\n\t\t};\n\t\n\t\tthis.pickingRay = function (vector, camera) {\n\t\n\t\t\tconsole.error('THREE.Projector: .pickingRay() has been removed.');\n\t\t};\n\t\n\t\t//\n\t\n\t\tvar RenderList = function RenderList() {\n\t\n\t\t\tvar normals = [];\n\t\t\tvar uvs = [];\n\t\n\t\t\tvar object = null;\n\t\t\tvar material = null;\n\t\n\t\t\tvar normalMatrix = new _three2.default.Matrix3();\n\t\n\t\t\tvar setObject = function setObject(value) {\n\t\n\t\t\t\tobject = value;\n\t\t\t\tmaterial = object.material;\n\t\n\t\t\t\tnormalMatrix.getNormalMatrix(object.matrixWorld);\n\t\n\t\t\t\tnormals.length = 0;\n\t\t\t\tuvs.length = 0;\n\t\t\t};\n\t\n\t\t\tvar projectVertex = function projectVertex(vertex) {\n\t\n\t\t\t\tvar position = vertex.position;\n\t\t\t\tvar positionWorld = vertex.positionWorld;\n\t\t\t\tvar positionScreen = vertex.positionScreen;\n\t\n\t\t\t\tpositionWorld.copy(position).applyMatrix4(_modelMatrix);\n\t\t\t\tpositionScreen.copy(positionWorld).applyMatrix4(_viewProjectionMatrix);\n\t\n\t\t\t\tvar invW = 1 / positionScreen.w;\n\t\n\t\t\t\tpositionScreen.x *= invW;\n\t\t\t\tpositionScreen.y *= invW;\n\t\t\t\tpositionScreen.z *= invW;\n\t\n\t\t\t\tvertex.visible = positionScreen.x >= -1 && positionScreen.x <= 1 && positionScreen.y >= -1 && positionScreen.y <= 1 && positionScreen.z >= -1 && positionScreen.z <= 1;\n\t\t\t};\n\t\n\t\t\tvar pushVertex = function pushVertex(x, y, z) {\n\t\n\t\t\t\t_vertex = getNextVertexInPool();\n\t\t\t\t_vertex.position.set(x, y, z);\n\t\n\t\t\t\tprojectVertex(_vertex);\n\t\t\t};\n\t\n\t\t\tvar pushNormal = function pushNormal(x, y, z) {\n\t\n\t\t\t\tnormals.push(x, y, z);\n\t\t\t};\n\t\n\t\t\tvar pushUv = function pushUv(x, y) {\n\t\n\t\t\t\tuvs.push(x, y);\n\t\t\t};\n\t\n\t\t\tvar checkTriangleVisibility = function checkTriangleVisibility(v1, v2, v3) {\n\t\n\t\t\t\tif (v1.visible === true || v2.visible === true || v3.visible === true) return true;\n\t\n\t\t\t\t_points3[0] = v1.positionScreen;\n\t\t\t\t_points3[1] = v2.positionScreen;\n\t\t\t\t_points3[2] = v3.positionScreen;\n\t\n\t\t\t\treturn _clipBox.isIntersectionBox(_boundingBox.setFromPoints(_points3));\n\t\t\t};\n\t\n\t\t\tvar checkBackfaceCulling = function checkBackfaceCulling(v1, v2, v3) {\n\t\n\t\t\t\treturn (v3.positionScreen.x - v1.positionScreen.x) * (v2.positionScreen.y - v1.positionScreen.y) - (v3.positionScreen.y - v1.positionScreen.y) * (v2.positionScreen.x - v1.positionScreen.x) < 0;\n\t\t\t};\n\t\n\t\t\tvar pushLine = function pushLine(a, b) {\n\t\n\t\t\t\tvar v1 = _vertexPool[a];\n\t\t\t\tvar v2 = _vertexPool[b];\n\t\n\t\t\t\t_line = getNextLineInPool();\n\t\n\t\t\t\t_line.id = object.id;\n\t\t\t\t_line.v1.copy(v1);\n\t\t\t\t_line.v2.copy(v2);\n\t\t\t\t_line.z = (v1.positionScreen.z + v2.positionScreen.z) / 2;\n\t\n\t\t\t\t_line.material = object.material;\n\t\n\t\t\t\t_renderData.elements.push(_line);\n\t\t\t};\n\t\n\t\t\tvar pushTriangle = function pushTriangle(a, b, c) {\n\t\n\t\t\t\tvar v1 = _vertexPool[a];\n\t\t\t\tvar v2 = _vertexPool[b];\n\t\t\t\tvar v3 = _vertexPool[c];\n\t\n\t\t\t\tif (checkTriangleVisibility(v1, v2, v3) === false) return;\n\t\n\t\t\t\tif (material.side === _three2.default.DoubleSide || checkBackfaceCulling(v1, v2, v3) === true) {\n\t\n\t\t\t\t\t_face = getNextFaceInPool();\n\t\n\t\t\t\t\t_face.id = object.id;\n\t\t\t\t\t_face.v1.copy(v1);\n\t\t\t\t\t_face.v2.copy(v2);\n\t\t\t\t\t_face.v3.copy(v3);\n\t\t\t\t\t_face.z = (v1.positionScreen.z + v2.positionScreen.z + v3.positionScreen.z) / 3;\n\t\n\t\t\t\t\tfor (var i = 0; i < 3; i++) {\n\t\n\t\t\t\t\t\tvar offset = arguments[i] * 3;\n\t\t\t\t\t\tvar normal = _face.vertexNormalsModel[i];\n\t\n\t\t\t\t\t\tnormal.set(normals[offset], normals[offset + 1], normals[offset + 2]);\n\t\t\t\t\t\tnormal.applyMatrix3(normalMatrix).normalize();\n\t\n\t\t\t\t\t\tvar offset2 = arguments[i] * 2;\n\t\n\t\t\t\t\t\tvar uv = _face.uvs[i];\n\t\t\t\t\t\tuv.set(uvs[offset2], uvs[offset2 + 1]);\n\t\t\t\t\t}\n\t\n\t\t\t\t\t_face.vertexNormalsLength = 3;\n\t\n\t\t\t\t\t_face.material = object.material;\n\t\n\t\t\t\t\t_renderData.elements.push(_face);\n\t\t\t\t}\n\t\t\t};\n\t\n\t\t\treturn {\n\t\t\t\tsetObject: setObject,\n\t\t\t\tprojectVertex: projectVertex,\n\t\t\t\tcheckTriangleVisibility: checkTriangleVisibility,\n\t\t\t\tcheckBackfaceCulling: checkBackfaceCulling,\n\t\t\t\tpushVertex: pushVertex,\n\t\t\t\tpushNormal: pushNormal,\n\t\t\t\tpushUv: pushUv,\n\t\t\t\tpushLine: pushLine,\n\t\t\t\tpushTriangle: pushTriangle\n\t\t\t};\n\t\t};\n\t\n\t\tvar renderList = new RenderList();\n\t\n\t\tthis.projectScene = function (scene, camera, sortObjects, sortElements) {\n\t\n\t\t\t_faceCount = 0;\n\t\t\t_lineCount = 0;\n\t\t\t_spriteCount = 0;\n\t\n\t\t\t_renderData.elements.length = 0;\n\t\n\t\t\tif (scene.autoUpdate === true) scene.updateMatrixWorld();\n\t\t\tif (camera.parent === undefined) camera.updateMatrixWorld();\n\t\n\t\t\t_viewMatrix.copy(camera.matrixWorldInverse.getInverse(camera.matrixWorld));\n\t\t\t_viewProjectionMatrix.multiplyMatrices(camera.projectionMatrix, _viewMatrix);\n\t\n\t\t\t_frustum.setFromMatrix(_viewProjectionMatrix);\n\t\n\t\t\t//\n\t\n\t\t\t_objectCount = 0;\n\t\n\t\t\t_renderData.objects.length = 0;\n\t\t\t_renderData.lights.length = 0;\n\t\n\t\t\tscene.traverseVisible(function (object) {\n\t\n\t\t\t\tif (object instanceof _three2.default.Light) {\n\t\n\t\t\t\t\t_renderData.lights.push(object);\n\t\t\t\t} else if (object instanceof _three2.default.Mesh || object instanceof _three2.default.Line || object instanceof _three2.default.Sprite) {\n\t\n\t\t\t\t\tif (object.material.visible === false) return;\n\t\n\t\t\t\t\tif (object.frustumCulled === false || _frustum.intersectsObject(object) === true) {\n\t\n\t\t\t\t\t\t_object = getNextObjectInPool();\n\t\t\t\t\t\t_object.id = object.id;\n\t\t\t\t\t\t_object.object = object;\n\t\n\t\t\t\t\t\tif (object.renderDepth !== null) {\n\t\n\t\t\t\t\t\t\t_object.z = object.renderDepth;\n\t\t\t\t\t\t} else {\n\t\n\t\t\t\t\t\t\t_vector3.setFromMatrixPosition(object.matrixWorld);\n\t\t\t\t\t\t\t_vector3.applyProjection(_viewProjectionMatrix);\n\t\t\t\t\t\t\t_object.z = _vector3.z;\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t_renderData.objects.push(_object);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\n\t\t\tif (sortObjects === true) {\n\t\n\t\t\t\t_renderData.objects.sort(painterSort);\n\t\t\t}\n\t\n\t\t\t//\n\t\n\t\t\tfor (var o = 0, ol = _renderData.objects.length; o < ol; o++) {\n\t\n\t\t\t\tvar object = _renderData.objects[o].object;\n\t\t\t\tvar geometry = object.geometry;\n\t\n\t\t\t\trenderList.setObject(object);\n\t\n\t\t\t\t_modelMatrix = object.matrixWorld;\n\t\n\t\t\t\t_vertexCount = 0;\n\t\n\t\t\t\tif (object instanceof _three2.default.Mesh) {\n\t\n\t\t\t\t\tif (geometry instanceof _three2.default.BufferGeometry) {\n\t\n\t\t\t\t\t\tvar attributes = geometry.attributes;\n\t\t\t\t\t\tvar offsets = geometry.offsets;\n\t\n\t\t\t\t\t\tif (attributes.position === undefined) continue;\n\t\n\t\t\t\t\t\tvar positions = attributes.position.array;\n\t\n\t\t\t\t\t\tfor (var i = 0, l = positions.length; i < l; i += 3) {\n\t\n\t\t\t\t\t\t\trenderList.pushVertex(positions[i], positions[i + 1], positions[i + 2]);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (attributes.normal !== undefined) {\n\t\n\t\t\t\t\t\t\tvar normals = attributes.normal.array;\n\t\n\t\t\t\t\t\t\tfor (var i = 0, l = normals.length; i < l; i += 3) {\n\t\n\t\t\t\t\t\t\t\trenderList.pushNormal(normals[i], normals[i + 1], normals[i + 2]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (attributes.uv !== undefined) {\n\t\n\t\t\t\t\t\t\tvar uvs = attributes.uv.array;\n\t\n\t\t\t\t\t\t\tfor (var i = 0, l = uvs.length; i < l; i += 2) {\n\t\n\t\t\t\t\t\t\t\trenderList.pushUv(uvs[i], uvs[i + 1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (attributes.index !== undefined) {\n\t\n\t\t\t\t\t\t\tvar indices = attributes.index.array;\n\t\n\t\t\t\t\t\t\tif (offsets.length > 0) {\n\t\n\t\t\t\t\t\t\t\tfor (var o = 0; o < offsets.length; o++) {\n\t\n\t\t\t\t\t\t\t\t\tvar offset = offsets[o];\n\t\t\t\t\t\t\t\t\tvar index = offset.index;\n\t\n\t\t\t\t\t\t\t\t\tfor (var i = offset.start, l = offset.start + offset.count; i < l; i += 3) {\n\t\n\t\t\t\t\t\t\t\t\t\trenderList.pushTriangle(indices[i] + index, indices[i + 1] + index, indices[i + 2] + index);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\n\t\t\t\t\t\t\t\tfor (var i = 0, l = indices.length; i < l; i += 3) {\n\t\n\t\t\t\t\t\t\t\t\trenderList.pushTriangle(indices[i], indices[i + 1], indices[i + 2]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\n\t\t\t\t\t\t\tfor (var i = 0, l = positions.length / 3; i < l; i += 3) {\n\t\n\t\t\t\t\t\t\t\trenderList.pushTriangle(i, i + 1, i + 2);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (geometry instanceof _three2.default.Geometry) {\n\t\n\t\t\t\t\t\tvar vertices = geometry.vertices;\n\t\t\t\t\t\tvar faces = geometry.faces;\n\t\t\t\t\t\tvar faceVertexUvs = geometry.faceVertexUvs[0];\n\t\n\t\t\t\t\t\t_normalMatrix.getNormalMatrix(_modelMatrix);\n\t\n\t\t\t\t\t\tvar isFaceMaterial = object.material instanceof _three2.default.MeshFaceMaterial;\n\t\t\t\t\t\tvar objectMaterials = isFaceMaterial === true ? object.material : null;\n\t\n\t\t\t\t\t\tfor (var v = 0, vl = vertices.length; v < vl; v++) {\n\t\n\t\t\t\t\t\t\tvar vertex = vertices[v];\n\t\t\t\t\t\t\trenderList.pushVertex(vertex.x, vertex.y, vertex.z);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tfor (var f = 0, fl = faces.length; f < fl; f++) {\n\t\n\t\t\t\t\t\t\tvar face = faces[f];\n\t\n\t\t\t\t\t\t\tvar material = isFaceMaterial === true ? objectMaterials.materials[face.materialIndex] : object.material;\n\t\n\t\t\t\t\t\t\tif (material === undefined) continue;\n\t\n\t\t\t\t\t\t\tvar side = material.side;\n\t\n\t\t\t\t\t\t\tvar v1 = _vertexPool[face.a];\n\t\t\t\t\t\t\tvar v2 = _vertexPool[face.b];\n\t\t\t\t\t\t\tvar v3 = _vertexPool[face.c];\n\t\n\t\t\t\t\t\t\tif (material.morphTargets === true) {\n\t\n\t\t\t\t\t\t\t\tvar morphTargets = geometry.morphTargets;\n\t\t\t\t\t\t\t\tvar morphInfluences = object.morphTargetInfluences;\n\t\n\t\t\t\t\t\t\t\tvar v1p = v1.position;\n\t\t\t\t\t\t\t\tvar v2p = v2.position;\n\t\t\t\t\t\t\t\tvar v3p = v3.position;\n\t\n\t\t\t\t\t\t\t\t_vA.set(0, 0, 0);\n\t\t\t\t\t\t\t\t_vB.set(0, 0, 0);\n\t\t\t\t\t\t\t\t_vC.set(0, 0, 0);\n\t\n\t\t\t\t\t\t\t\tfor (var t = 0, tl = morphTargets.length; t < tl; t++) {\n\t\n\t\t\t\t\t\t\t\t\tvar influence = morphInfluences[t];\n\t\n\t\t\t\t\t\t\t\t\tif (influence === 0) continue;\n\t\n\t\t\t\t\t\t\t\t\tvar targets = morphTargets[t].vertices;\n\t\n\t\t\t\t\t\t\t\t\t_vA.x += (targets[face.a].x - v1p.x) * influence;\n\t\t\t\t\t\t\t\t\t_vA.y += (targets[face.a].y - v1p.y) * influence;\n\t\t\t\t\t\t\t\t\t_vA.z += (targets[face.a].z - v1p.z) * influence;\n\t\n\t\t\t\t\t\t\t\t\t_vB.x += (targets[face.b].x - v2p.x) * influence;\n\t\t\t\t\t\t\t\t\t_vB.y += (targets[face.b].y - v2p.y) * influence;\n\t\t\t\t\t\t\t\t\t_vB.z += (targets[face.b].z - v2p.z) * influence;\n\t\n\t\t\t\t\t\t\t\t\t_vC.x += (targets[face.c].x - v3p.x) * influence;\n\t\t\t\t\t\t\t\t\t_vC.y += (targets[face.c].y - v3p.y) * influence;\n\t\t\t\t\t\t\t\t\t_vC.z += (targets[face.c].z - v3p.z) * influence;\n\t\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t\tv1.position.add(_vA);\n\t\t\t\t\t\t\t\tv2.position.add(_vB);\n\t\t\t\t\t\t\t\tv3.position.add(_vC);\n\t\n\t\t\t\t\t\t\t\trenderList.projectVertex(v1);\n\t\t\t\t\t\t\t\trenderList.projectVertex(v2);\n\t\t\t\t\t\t\t\trenderList.projectVertex(v3);\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\tif (renderList.checkTriangleVisibility(v1, v2, v3) === false) continue;\n\t\n\t\t\t\t\t\t\tvar visible = renderList.checkBackfaceCulling(v1, v2, v3);\n\t\n\t\t\t\t\t\t\tif (side !== _three2.default.DoubleSide) {\n\t\t\t\t\t\t\t\tif (side === _three2.default.FrontSide && visible === false) continue;\n\t\t\t\t\t\t\t\tif (side === _three2.default.BackSide && visible === true) continue;\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t_face = getNextFaceInPool();\n\t\n\t\t\t\t\t\t\t_face.id = object.id;\n\t\t\t\t\t\t\t_face.v1.copy(v1);\n\t\t\t\t\t\t\t_face.v2.copy(v2);\n\t\t\t\t\t\t\t_face.v3.copy(v3);\n\t\n\t\t\t\t\t\t\t_face.normalModel.copy(face.normal);\n\t\n\t\t\t\t\t\t\tif (visible === false && (side === _three2.default.BackSide || side === _three2.default.DoubleSide)) {\n\t\n\t\t\t\t\t\t\t\t_face.normalModel.negate();\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t_face.normalModel.applyMatrix3(_normalMatrix).normalize();\n\t\n\t\t\t\t\t\t\tvar faceVertexNormals = face.vertexNormals;\n\t\n\t\t\t\t\t\t\tfor (var n = 0, nl = Math.min(faceVertexNormals.length, 3); n < nl; n++) {\n\t\n\t\t\t\t\t\t\t\tvar normalModel = _face.vertexNormalsModel[n];\n\t\t\t\t\t\t\t\tnormalModel.copy(faceVertexNormals[n]);\n\t\n\t\t\t\t\t\t\t\tif (visible === false && (side === _three2.default.BackSide || side === _three2.default.DoubleSide)) {\n\t\n\t\t\t\t\t\t\t\t\tnormalModel.negate();\n\t\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t\tnormalModel.applyMatrix3(_normalMatrix).normalize();\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t_face.vertexNormalsLength = faceVertexNormals.length;\n\t\n\t\t\t\t\t\t\tvar vertexUvs = faceVertexUvs[f];\n\t\n\t\t\t\t\t\t\tif (vertexUvs !== undefined) {\n\t\n\t\t\t\t\t\t\t\tfor (var u = 0; u < 3; u++) {\n\t\n\t\t\t\t\t\t\t\t\t_face.uvs[u].copy(vertexUvs[u]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t_face.color = face.color;\n\t\t\t\t\t\t\t_face.material = material;\n\t\n\t\t\t\t\t\t\t_face.z = (v1.positionScreen.z + v2.positionScreen.z + v3.positionScreen.z) / 3;\n\t\n\t\t\t\t\t\t\t_renderData.elements.push(_face);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (object instanceof _three2.default.Line) {\n\t\n\t\t\t\t\tif (geometry instanceof _three2.default.BufferGeometry) {\n\t\n\t\t\t\t\t\tvar attributes = geometry.attributes;\n\t\n\t\t\t\t\t\tif (attributes.position !== undefined) {\n\t\n\t\t\t\t\t\t\tvar positions = attributes.position.array;\n\t\n\t\t\t\t\t\t\tfor (var i = 0, l = positions.length; i < l; i += 3) {\n\t\n\t\t\t\t\t\t\t\trenderList.pushVertex(positions[i], positions[i + 1], positions[i + 2]);\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\tif (attributes.index !== undefined) {\n\t\n\t\t\t\t\t\t\t\tvar indices = attributes.index.array;\n\t\n\t\t\t\t\t\t\t\tfor (var i = 0, l = indices.length; i < l; i += 2) {\n\t\n\t\t\t\t\t\t\t\t\trenderList.pushLine(indices[i], indices[i + 1]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\n\t\t\t\t\t\t\t\tvar step = object.mode === _three2.default.LinePieces ? 2 : 1;\n\t\n\t\t\t\t\t\t\t\tfor (var i = 0, l = positions.length / 3 - 1; i < l; i += step) {\n\t\n\t\t\t\t\t\t\t\t\trenderList.pushLine(i, i + 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (geometry instanceof _three2.default.Geometry) {\n\t\n\t\t\t\t\t\t_modelViewProjectionMatrix.multiplyMatrices(_viewProjectionMatrix, _modelMatrix);\n\t\n\t\t\t\t\t\tvar vertices = object.geometry.vertices;\n\t\n\t\t\t\t\t\tif (vertices.length === 0) continue;\n\t\n\t\t\t\t\t\tv1 = getNextVertexInPool();\n\t\t\t\t\t\tv1.positionScreen.copy(vertices[0]).applyMatrix4(_modelViewProjectionMatrix);\n\t\n\t\t\t\t\t\t// Handle LineStrip and LinePieces\n\t\t\t\t\t\tvar step = object.mode === _three2.default.LinePieces ? 2 : 1;\n\t\n\t\t\t\t\t\tfor (var v = 1, vl = vertices.length; v < vl; v++) {\n\t\n\t\t\t\t\t\t\tv1 = getNextVertexInPool();\n\t\t\t\t\t\t\tv1.positionScreen.copy(vertices[v]).applyMatrix4(_modelViewProjectionMatrix);\n\t\n\t\t\t\t\t\t\tif ((v + 1) % step > 0) continue;\n\t\n\t\t\t\t\t\t\tv2 = _vertexPool[_vertexCount - 2];\n\t\n\t\t\t\t\t\t\t_clippedVertex1PositionScreen.copy(v1.positionScreen);\n\t\t\t\t\t\t\t_clippedVertex2PositionScreen.copy(v2.positionScreen);\n\t\n\t\t\t\t\t\t\tif (clipLine(_clippedVertex1PositionScreen, _clippedVertex2PositionScreen) === true) {\n\t\n\t\t\t\t\t\t\t\t// Perform the perspective divide\n\t\t\t\t\t\t\t\t_clippedVertex1PositionScreen.multiplyScalar(1 / _clippedVertex1PositionScreen.w);\n\t\t\t\t\t\t\t\t_clippedVertex2PositionScreen.multiplyScalar(1 / _clippedVertex2PositionScreen.w);\n\t\n\t\t\t\t\t\t\t\t_line = getNextLineInPool();\n\t\n\t\t\t\t\t\t\t\t_line.id = object.id;\n\t\t\t\t\t\t\t\t_line.v1.positionScreen.copy(_clippedVertex1PositionScreen);\n\t\t\t\t\t\t\t\t_line.v2.positionScreen.copy(_clippedVertex2PositionScreen);\n\t\n\t\t\t\t\t\t\t\t_line.z = Math.max(_clippedVertex1PositionScreen.z, _clippedVertex2PositionScreen.z);\n\t\n\t\t\t\t\t\t\t\t_line.material = object.material;\n\t\n\t\t\t\t\t\t\t\tif (object.material.vertexColors === _three2.default.VertexColors) {\n\t\n\t\t\t\t\t\t\t\t\t_line.vertexColors[0].copy(object.geometry.colors[v]);\n\t\t\t\t\t\t\t\t\t_line.vertexColors[1].copy(object.geometry.colors[v - 1]);\n\t\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t\t_renderData.elements.push(_line);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (object instanceof _three2.default.Sprite) {\n\t\n\t\t\t\t\t_vector4.set(_modelMatrix.elements[12], _modelMatrix.elements[13], _modelMatrix.elements[14], 1);\n\t\t\t\t\t_vector4.applyMatrix4(_viewProjectionMatrix);\n\t\n\t\t\t\t\tvar invW = 1 / _vector4.w;\n\t\n\t\t\t\t\t_vector4.z *= invW;\n\t\n\t\t\t\t\tif (_vector4.z >= -1 && _vector4.z <= 1) {\n\t\n\t\t\t\t\t\t_sprite = getNextSpriteInPool();\n\t\t\t\t\t\t_sprite.id = object.id;\n\t\t\t\t\t\t_sprite.x = _vector4.x * invW;\n\t\t\t\t\t\t_sprite.y = _vector4.y * invW;\n\t\t\t\t\t\t_sprite.z = _vector4.z;\n\t\t\t\t\t\t_sprite.object = object;\n\t\n\t\t\t\t\t\t_sprite.rotation = object.rotation;\n\t\n\t\t\t\t\t\t_sprite.scale.x = object.scale.x * Math.abs(_sprite.x - (_vector4.x + camera.projectionMatrix.elements[0]) / (_vector4.w + camera.projectionMatrix.elements[12]));\n\t\t\t\t\t\t_sprite.scale.y = object.scale.y * Math.abs(_sprite.y - (_vector4.y + camera.projectionMatrix.elements[5]) / (_vector4.w + camera.projectionMatrix.elements[13]));\n\t\n\t\t\t\t\t\t_sprite.material = object.material;\n\t\n\t\t\t\t\t\t_renderData.elements.push(_sprite);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\tif (sortElements === true) {\n\t\n\t\t\t\t_renderData.elements.sort(painterSort);\n\t\t\t}\n\t\n\t\t\treturn _renderData;\n\t\t};\n\t\n\t\t// Pools\n\t\n\t\tfunction getNextObjectInPool() {\n\t\n\t\t\tif (_objectCount === _objectPoolLength) {\n\t\n\t\t\t\tvar object = new _three2.default.RenderableObject();\n\t\t\t\t_objectPool.push(object);\n\t\t\t\t_objectPoolLength++;\n\t\t\t\t_objectCount++;\n\t\t\t\treturn object;\n\t\t\t}\n\t\n\t\t\treturn _objectPool[_objectCount++];\n\t\t}\n\t\n\t\tfunction getNextVertexInPool() {\n\t\n\t\t\tif (_vertexCount === _vertexPoolLength) {\n\t\n\t\t\t\tvar vertex = new _three2.default.RenderableVertex();\n\t\t\t\t_vertexPool.push(vertex);\n\t\t\t\t_vertexPoolLength++;\n\t\t\t\t_vertexCount++;\n\t\t\t\treturn vertex;\n\t\t\t}\n\t\n\t\t\treturn _vertexPool[_vertexCount++];\n\t\t}\n\t\n\t\tfunction getNextFaceInPool() {\n\t\n\t\t\tif (_faceCount === _facePoolLength) {\n\t\n\t\t\t\tvar face = new _three2.default.RenderableFace();\n\t\t\t\t_facePool.push(face);\n\t\t\t\t_facePoolLength++;\n\t\t\t\t_faceCount++;\n\t\t\t\treturn face;\n\t\t\t}\n\t\n\t\t\treturn _facePool[_faceCount++];\n\t\t}\n\t\n\t\tfunction getNextLineInPool() {\n\t\n\t\t\tif (_lineCount === _linePoolLength) {\n\t\n\t\t\t\tvar line = new _three2.default.RenderableLine();\n\t\t\t\t_linePool.push(line);\n\t\t\t\t_linePoolLength++;\n\t\t\t\t_lineCount++;\n\t\t\t\treturn line;\n\t\t\t}\n\t\n\t\t\treturn _linePool[_lineCount++];\n\t\t}\n\t\n\t\tfunction getNextSpriteInPool() {\n\t\n\t\t\tif (_spriteCount === _spritePoolLength) {\n\t\n\t\t\t\tvar sprite = new _three2.default.RenderableSprite();\n\t\t\t\t_spritePool.push(sprite);\n\t\t\t\t_spritePoolLength++;\n\t\t\t\t_spriteCount++;\n\t\t\t\treturn sprite;\n\t\t\t}\n\t\n\t\t\treturn _spritePool[_spriteCount++];\n\t\t}\n\t\n\t\t//\n\t\n\t\tfunction painterSort(a, b) {\n\t\n\t\t\tif (a.z !== b.z) {\n\t\n\t\t\t\treturn b.z - a.z;\n\t\t\t} else if (a.id !== b.id) {\n\t\n\t\t\t\treturn a.id - b.id;\n\t\t\t} else {\n\t\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\n\t\tfunction clipLine(s1, s2) {\n\t\n\t\t\tvar alpha1 = 0,\n\t\t\t    alpha2 = 1,\n\t\t\t   \n\t\n\t\t\t// Calculate the boundary coordinate of each vertex for the near and far clip planes,\n\t\t\t// Z = -1 and Z = +1, respectively.\n\t\t\tbc1near = s1.z + s1.w,\n\t\t\t    bc2near = s2.z + s2.w,\n\t\t\t    bc1far = -s1.z + s1.w,\n\t\t\t    bc2far = -s2.z + s2.w;\n\t\n\t\t\tif (bc1near >= 0 && bc2near >= 0 && bc1far >= 0 && bc2far >= 0) {\n\t\n\t\t\t\t// Both vertices lie entirely within all clip planes.\n\t\t\t\treturn true;\n\t\t\t} else if (bc1near < 0 && bc2near < 0 || bc1far < 0 && bc2far < 0) {\n\t\n\t\t\t\t// Both vertices lie entirely outside one of the clip planes.\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\n\t\t\t\t// The line segment spans at least one clip plane.\n\t\n\t\t\t\tif (bc1near < 0) {\n\t\n\t\t\t\t\t// v1 lies outside the near plane, v2 inside\n\t\t\t\t\talpha1 = Math.max(alpha1, bc1near / (bc1near - bc2near));\n\t\t\t\t} else if (bc2near < 0) {\n\t\n\t\t\t\t\t// v2 lies outside the near plane, v1 inside\n\t\t\t\t\talpha2 = Math.min(alpha2, bc1near / (bc1near - bc2near));\n\t\t\t\t}\n\t\n\t\t\t\tif (bc1far < 0) {\n\t\n\t\t\t\t\t// v1 lies outside the far plane, v2 inside\n\t\t\t\t\talpha1 = Math.max(alpha1, bc1far / (bc1far - bc2far));\n\t\t\t\t} else if (bc2far < 0) {\n\t\n\t\t\t\t\t// v2 lies outside the far plane, v2 inside\n\t\t\t\t\talpha2 = Math.min(alpha2, bc1far / (bc1far - bc2far));\n\t\t\t\t}\n\t\n\t\t\t\tif (alpha2 < alpha1) {\n\t\n\t\t\t\t\t// The line segment spans two boundaries, but is outside both of them.\n\t\t\t\t\t// (This can't happen when we're only clipping against just near/far but good\n\t\t\t\t\t//  to leave the check here for future usage if other clip planes are added.)\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\n\t\t\t\t\t// Update the s1 and s2 vertices to match the clipped line segment.\n\t\t\t\t\ts1.lerp(s2, alpha1);\n\t\t\t\t\ts2.lerp(s1, 1 - alpha2);\n\t\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\t\n\t//module.exports = THREE.Projector;\n\texports.default = _three2.default.Projector;\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\texports.findSelectionRoot = findSelectionRoot;\n\texports.getCoordsFromPosSizeRect = getCoordsFromPosSizeRect;\n\texports.pick = pick;\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar _Projector = __webpack_require__(8);\n\t\n\tvar _Projector2 = _interopRequireDefault(_Projector);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction isRootNode(node) {\n\t  return node.selectTrickleUp === false && node.selectable === true;\n\t}\n\t\n\tfunction walkUp(node, checker) {\n\t  if (node) {\n\t    if (checker(node)) {\n\t      return node;\n\t    }\n\t    if (node.parent) {\n\t      return walkUp(node.parent, checker);\n\t    }\n\t  }\n\t  return undefined;\n\t}\n\t\n\tfunction findSelectionRoot(node) {\n\t  return walkUp(node, isRootNode);\n\t}\n\t\n\tfunction getCoordsFromPosSizeRect(inputs) {\n\t  var pos = inputs.pos;\n\t  var rect = inputs.rect;\n\t  var width = inputs.width;\n\t  var height = inputs.height;\n\t\n\t  var x = (pos.x - rect.left) / width * 2 - 1;\n\t  var y = -((pos.y - rect.top) / height) * 2 + 1;\n\t  //v = new THREE.Vector3((x / this.viewWidth) * 2 - 1, -(y / this.viewHeight) * 2 + 1, 1)\n\t  return { x: x, y: y };\n\t}\n\t\n\tfunction pick(mouseCoords, camera, hiearchyRoot) {\n\t  var ortho = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];\n\t  var precision = arguments.length <= 4 || arguments[4] === undefined ? 10 : arguments[4];\n\t  var x = mouseCoords.x;\n\t  var y = mouseCoords.y;\n\t\n\t  var mousecoords = new _three2.default.Vector3(x, y, 0.5);\n\t  var v = mousecoords;\n\t  var intersects = [];\n\t\n\t  if (!ortho) {\n\t    v.unproject(camera);\n\t    var fooV = v.clone();\n\t    var raycaster = new _three2.default.Raycaster(camera.position, v.sub(camera.position).normalize());\n\t    //raycaster.precision = 10\n\t    intersects = raycaster.intersectObjects(hiearchyRoot, true);\n\t  } else {\n\t    // use picking ray since it's an orthographic camera\n\t    //var ray = this.projector.pickingRay( v, this.camera )\n\t    //intersects = ray.intersectObjects( this.hiearchyRoot, true )\n\t    //see here:\n\t    _three2.default.Vector3.prototype.pickingRay = function (camera) {\n\t      var tan = Math.tan(0.5 * _three2.default.Math.degToRad(camera.fov)) / camera.zoom;\n\t\n\t      this.x *= tan * camera.aspect;\n\t      this.y *= tan;\n\t      this.z = -1;\n\t      return this.transformDirection(camera.matrixWorld);\n\t    };\n\t\n\t    var raycaster = new _three2.default.Raycaster();\n\t    v.pickingRay(camera);\n\t    raycaster.set(camera.position, v);\n\t    intersects = raycaster.intersectObjects(hiearchyRoot, true);\n\t  }\n\t\n\t  //remove invisibles, dedupe ??\n\t  //TODO: use transducers.js ?\n\t  intersects = intersects.filter(function (intersect) {\n\t    return intersect.object && intersect.object.visible === true;\n\t  }) //&& intersect.object.pickable)\n\t  .sort(function (a, b) {\n\t    return a.distance - b.distance;\n\t  });\n\t  //.reverse()\n\t\n\t  return intersects;\n\t}\n\t\n\tvar Selector = (function () {\n\t  function Selector() {\n\t    _classCallCheck(this, Selector);\n\t\n\t    this.projector = new _three2.default.Projector();\n\t    this.camera = undefined;\n\t    //for camera\n\t    this.isOrtho = false;\n\t  }\n\t\n\t  /*pick(event, rect, width, height, scene){\n\t    event.preventDefault()\n\t    //console.log(\"rect, width, height\",rect, width, height)\n\t    var x =   ( (event.clientX - rect.left) / width) * 2 - 1\n\t    var y = - ( (event.clientY - rect.top) / height) * 2 + 1\n\t     this.hiearchyRoot = scene.children\n\t     return this._pickInner( x, y, null, this.camera)\n\t  }*/\n\t\n\t  _createClass(Selector, [{\n\t    key: 'pickAlt',\n\t    value: function pickAlt(pos, rect, width, height, scene) {\n\t      //console.log(\"rect, width, height\",rect, width, height)\n\t      var x = (pos.x - rect.left) / width * 2 - 1;\n\t      var y = -((pos.y - rect.top) / height) * 2 + 1;\n\t\n\t      this.hiearchyRoot = scene.children;\n\t\n\t      return this._pickInner(x, y, null, this.camera);\n\t    }\n\t  }, {\n\t    key: '_pickInner',\n\t    value: function _pickInner(x, y, isOrtho, camera) {\n\t      isOrtho = isOrtho || this.isOrtho;\n\t      camera = camera || this.camera;\n\t      var mousecoords = new _three2.default.Vector3(x, y, 0.5);\n\t\n\t      var intersects = [];\n\t      //v = new THREE.Vector3((x / this.viewWidth) * 2 - 1, -(y / this.viewHeight) * 2 + 1, 1)\n\t      var v = mousecoords;\n\t      if (!isOrtho) {\n\t        v.unproject(camera);\n\t        var v1 = v.clone();\n\t        var fooV = v.clone();\n\t        var raycaster = new _three2.default.Raycaster(camera.position, v.sub(camera.position).normalize());\n\t        //raycaster.precision = 10\n\t        intersects = raycaster.intersectObjects(this.hiearchyRoot, true);\n\t      } else {\n\t        // use picking ray since it's an orthographic camera\n\t        //var ray = this.projector.pickingRay( v, this.camera )\n\t        //intersects = ray.intersectObjects( this.hiearchyRoot, true )\n\t        //see here:\n\t        _three2.default.Vector3.prototype.pickingRay = function (camera) {\n\t          var tan = Math.tan(0.5 * _three2.default.Math.degToRad(camera.fov)) / camera.zoom;\n\t\n\t          this.x *= tan * camera.aspect;\n\t          this.y *= tan;\n\t          this.z = -1;\n\t\n\t          return this.transformDirection(camera.matrixWorld);\n\t        };\n\t\n\t        var raycaster = new _three2.default.Raycaster();\n\t        v.pickingRay(this.camera);\n\t        raycaster.set(this.camera.position, v);\n\t        intersects = raycaster.intersectObjects(this.hiearchyRoot, true);\n\t      }\n\t\n\t      //remove invisibles, dedupe\n\t      //TODO: use transducers.js\n\t      intersects = intersects.sort().filter(function (intersect, pos) {\n\t        return intersect.object && intersect.object.visible === true && !pos || intersect != intersects[pos - 1];\n\t      });\n\t\n\t      return intersects;\n\t\n\t      /*\n\t      mousecoords.unproject(camera)\n\t      raycaster.ray.set( camera.position, mousecoords.sub( camera.position ).normalize() )\n\t       var intersections = raycaster.intersectObjects( this._THREEObject3D.children, true )\n\t      var firstintersection = ( intersections.length ) > 0 ? intersections[ 0 ] : null\n\t      if (firstintersection !== null) {\n\t        var pickobject = firstintersection.object\n\t        if (typeof pickobject.userData !== 'undefined' &&\n\t            typeof pickobject.userData.props.onPick === 'function') {\n\t          pickobject.userData.props.onPick(event, firstintersection)\n\t        }\n\t      }*/\n\t    }\n\t  }]);\n\t\n\t  return Selector;\n\t})();\n\t\n\texports.default = Selector;\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t    value: true\n\t});\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * original @author stemkoski / http://github.com/stemkoski\n\t * modified by @kaosat-dev / http://github.com/kaosat-dev\n\t * Blend three textures additively\n\t * texel1 + texel2\n\t * + vec4(0.5, 0.75, 1.0, 1.0)\n\t */\n\t\n\tvar AdditiveBlendShader = {\n\t\n\t    uniforms: {\n\t\n\t        \"tDiffuse1\": { type: \"t\", value: null },\n\t        \"tDiffuse2\": { type: \"t\", value: null },\n\t        \"tDiffuse3\": { type: \"t\", value: null },\n\t        \"normalThreshold\": { type: \"f\", value: 0.1 },\n\t        \"depthThreshold\": { type: \"f\", value: 0.05 },\n\t        \"strengh\": { type: \"f\", value: 0.4 },\n\t        \"color\": { type: \"c\", value: new _three2.default.Color(0x000002) }\n\t    },\n\t\n\t    vertexShader: [\"varying vec2 vUv;\", \"void main() {\", \"vUv = uv;\", \"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\", \"}\"].join(\"\\n\"),\n\t\n\t    fragmentShader: [\"uniform sampler2D tDiffuse1;\", \"uniform sampler2D tDiffuse2;\", \"uniform sampler2D tDiffuse3;\", \"uniform float normalThreshold;\", \"uniform float depthThreshold;\", \"uniform float strengh;\", \"uniform vec3 color;\", \"varying vec2 vUv;\", \"void main() {\", \"vec4 colorTexel = texture2D( tDiffuse1, vUv );\", \"vec4 normalTexel = texture2D( tDiffuse2, vUv );\", \"vec4 depthTexel = texture2D( tDiffuse3, vUv );\", \"gl_FragColor = colorTexel;\", \"if( normalTexel.r >= normalThreshold || depthTexel.r >=depthThreshold) {\", \"gl_FragColor= colorTexel*(1.0-strengh) + vec4(color[0], color[1], color[2],1);\", \"}\", \"}\"].join(\"\\n\")\n\t\n\t};\n\t\n\texports.default = AdditiveBlendShader;\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t *\n\t * Full-screen textured quad shader\n\t */\n\t\n\t_three2.default.CopyShader = {\n\t\n\t  uniforms: {\n\t\n\t    \"tDiffuse\": { type: \"t\", value: null },\n\t    \"opacity\": { type: \"f\", value: 1.0 }\n\t\n\t  },\n\t\n\t  vertexShader: [\"varying vec2 vUv;\", \"void main() {\", \"vUv = uv;\", \"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\", \"}\"].join(\"\\n\"),\n\t\n\t  fragmentShader: [\"uniform float opacity;\", \"uniform sampler2D tDiffuse;\", \"varying vec2 vUv;\", \"void main() {\", \"vec4 texel = texture2D( tDiffuse, vUv );\", \"gl_FragColor = opacity * texel;\", \"}\"].join(\"\\n\")\n\t\n\t};\n\t\n\texports.default = _three2.default.CopyShader;\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t    value: true\n\t});\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * @author zz85 / https://github.com/zz85 | https://www.lab4games.net/zz85/blog\n\t *\n\t * Edge Detection Shader using Sobel filter\n\t * Based on http://rastergrid.com/blog/2011/01/frei-chen-edge-detector\n\t *\n\t * aspect: vec2 of (1/width, 1/height)\n\t */\n\t\n\tvar EdgeShader3 = {\n\t\n\t    uniforms: {\n\t\n\t        \"tDiffuse\": { type: \"t\", value: null },\n\t        \"aspect\": { type: \"v2\", value: new _three2.default.Vector2(512, 512) }\n\t    },\n\t\n\t    vertexShader: [\"varying vec2 vUv;\", \"void main() {\", \"vUv = uv;\", \"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\", \"}\"].join(\"\\n\"),\n\t\n\t    fragmentShader: [\"uniform sampler2D tDiffuse;\", \"varying vec2 vUv;\", \"uniform vec2 aspect;\", \"vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);\", \"mat3 G[2];\", \"const mat3 g0 = mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 );\", \"const mat3 g1 = mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 );\", \"void main(void)\", \"{\", \"mat3 I;\", \"float cnv[2];\", \"vec3 sample;\", \"G[0] = g0;\", \"G[1] = g1;\",\n\t\n\t    /* fetch the 3x3 neighbourhood and use the RGB vector's length as intensity value */\n\t    \"for (float i=0.0; i<3.0; i++)\", \"for (float j=0.0; j<3.0; j++) {\", \"sample = texture2D( tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;\", \"I[int(i)][int(j)] = length(sample);\", \"}\",\n\t\n\t    /* calculate the convolution values for all the masks */\n\t    \"for (int i=0; i<2; i++) {\", \"float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\", \"cnv[i] = dp3 * dp3; \", \"}\", \"gl_FragColor = vec4(0.5 * sqrt(cnv[0]*cnv[0]+cnv[1]*cnv[1]));\", \"} \"].join(\"\\n\")\n\t\n\t};\n\t\n\texports.default = EdgeShader3;\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\t\n\t_three2.default.EffectComposer = function (renderer, renderTarget) {\n\t\n\t  this.renderer = renderer;\n\t\n\t  if (renderTarget === undefined) {\n\t\n\t    var pixelRatio = renderer.getPixelRatio();\n\t\n\t    var width = Math.floor(renderer.context.canvas.width / pixelRatio) || 1;\n\t    var height = Math.floor(renderer.context.canvas.height / pixelRatio) || 1;\n\t    var parameters = { minFilter: _three2.default.LinearFilter, magFilter: _three2.default.LinearFilter, format: _three2.default.RGBFormat, stencilBuffer: false };\n\t\n\t    renderTarget = new _three2.default.WebGLRenderTarget(width, height, parameters);\n\t  }\n\t\n\t  this.renderTarget1 = renderTarget;\n\t  this.renderTarget2 = renderTarget.clone();\n\t\n\t  this.writeBuffer = this.renderTarget1;\n\t  this.readBuffer = this.renderTarget2;\n\t\n\t  this.passes = [];\n\t\n\t  if (_three2.default.CopyShader === undefined) console.error(\"THREE.EffectComposer relies on THREE.CopyShader\");\n\t\n\t  this.copyPass = new _three2.default.ShaderPass(_three2.default.CopyShader);\n\t};\n\t\n\t_three2.default.EffectComposer.prototype = {\n\t\n\t  swapBuffers: function swapBuffers() {\n\t\n\t    var tmp = this.readBuffer;\n\t    this.readBuffer = this.writeBuffer;\n\t    this.writeBuffer = tmp;\n\t  },\n\t\n\t  addPass: function addPass(pass) {\n\t\n\t    this.passes.push(pass);\n\t  },\n\t\n\t  insertPass: function insertPass(pass, index) {\n\t\n\t    this.passes.splice(index, 0, pass);\n\t  },\n\t\n\t  render: function render(delta) {\n\t\n\t    this.writeBuffer = this.renderTarget1;\n\t    this.readBuffer = this.renderTarget2;\n\t\n\t    var maskActive = false;\n\t\n\t    var pass,\n\t        i,\n\t        il = this.passes.length;\n\t\n\t    for (i = 0; i < il; i++) {\n\t\n\t      pass = this.passes[i];\n\t\n\t      if (!pass.enabled) continue;\n\t\n\t      pass.render(this.renderer, this.writeBuffer, this.readBuffer, delta, maskActive);\n\t\n\t      if (pass.needsSwap) {\n\t\n\t        if (maskActive) {\n\t\n\t          var context = this.renderer.context;\n\t\n\t          context.stencilFunc(context.NOTEQUAL, 1, 0xffffffff);\n\t\n\t          this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, delta);\n\t\n\t          context.stencilFunc(context.EQUAL, 1, 0xffffffff);\n\t        }\n\t\n\t        this.swapBuffers();\n\t      }\n\t\n\t      if (pass instanceof _three2.default.MaskPass) {\n\t\n\t        maskActive = true;\n\t      } else if (pass instanceof _three2.default.ClearMaskPass) {\n\t\n\t        maskActive = false;\n\t      }\n\t    }\n\t  },\n\t\n\t  reset: function reset(renderTarget) {\n\t\n\t    if (renderTarget === undefined) {\n\t\n\t      renderTarget = this.renderTarget1.clone();\n\t\n\t      var pixelRatio = this.renderer.getPixelRatio();\n\t\n\t      renderTarget.width = Math.floor(this.renderer.context.canvas.width / pixelRatio);\n\t      renderTarget.height = Math.floor(this.renderer.context.canvas.height / pixelRatio);\n\t    }\n\t\n\t    this.renderTarget1 = renderTarget;\n\t    this.renderTarget2 = renderTarget.clone();\n\t\n\t    this.writeBuffer = this.renderTarget1;\n\t    this.readBuffer = this.renderTarget2;\n\t  },\n\t\n\t  setSize: function setSize(width, height) {\n\t\n\t    var renderTarget = this.renderTarget1.clone();\n\t\n\t    renderTarget.width = width;\n\t    renderTarget.height = height;\n\t\n\t    this.reset(renderTarget);\n\t  }\n\t\n\t};\n\texports.default = _three2.default.EffectComposer;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author davidedc / http://www.sketchpatch.net/\n\t *\n\t * NVIDIA FXAA by Timothy Lottes\n\t * http://timothylottes.blogspot.com/2011/06/fxaa3-source-released.html\n\t * - WebGL port by @supereggbert\n\t * http://www.glge.org/demos/fxaa/\n\t */\n\t\n\t_three2.default.FXAAShader = {\n\t\n\t  uniforms: {\n\t\n\t    \"tDiffuse\": { type: \"t\", value: null },\n\t    \"resolution\": { type: \"v2\", value: new _three2.default.Vector2(1 / 1024, 1 / 512) }\n\t\n\t  },\n\t\n\t  vertexShader: [\"void main() {\", \"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\", \"}\"].join(\"\\n\"),\n\t\n\t  fragmentShader: [\"uniform sampler2D tDiffuse;\", \"uniform vec2 resolution;\", \"#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;\", \"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;\", \"vec4 rgbA = (1.0/2.0) * (\", \"texture2D(tDiffuse,  gl_FragCoord.xy  * resolution + dir * (1.0/3.0 - 0.5)) +\", \"texture2D(tDiffuse,  gl_FragCoord.xy  * resolution + dir * (2.0/3.0 - 0.5)));\", \"vec4 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * (\", \"texture2D(tDiffuse,  gl_FragCoord.xy  * resolution + dir * (0.0/3.0 - 0.5)) +\", \"texture2D(tDiffuse,  gl_FragCoord.xy  * resolution + dir * (3.0/3.0 - 0.5)));\", \"float lumaB = dot(rgbB, vec4(luma, 0.0));\", \"if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {\", \"gl_FragColor = rgbA;\", \"} else {\", \"gl_FragColor = rgbB;\", \"}\", \"}\"].join(\"\\n\")\n\t\n\t};\n\t\n\texports.default = _three2.default.FXAAShader;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\texports.ClearMaskPass = exports.MaskPass = undefined;\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\t\n\t_three2.default.MaskPass = function (scene, camera) {\n\t\n\t  this.scene = scene;\n\t  this.camera = camera;\n\t\n\t  this.enabled = true;\n\t  this.clear = true;\n\t  this.needsSwap = false;\n\t\n\t  this.inverse = false;\n\t};\n\t\n\t_three2.default.MaskPass.prototype = {\n\t\n\t  render: function render(renderer, writeBuffer, readBuffer, delta) {\n\t\n\t    var context = renderer.context;\n\t\n\t    // don't update color or depth\n\t\n\t    context.colorMask(false, false, false, false);\n\t    context.depthMask(false);\n\t\n\t    // set up stencil\n\t\n\t    var writeValue, clearValue;\n\t\n\t    if (this.inverse) {\n\t\n\t      writeValue = 0;\n\t      clearValue = 1;\n\t    } else {\n\t\n\t      writeValue = 1;\n\t      clearValue = 0;\n\t    }\n\t\n\t    context.enable(context.STENCIL_TEST);\n\t    context.stencilOp(context.REPLACE, context.REPLACE, context.REPLACE);\n\t    context.stencilFunc(context.ALWAYS, writeValue, 0xffffffff);\n\t    context.clearStencil(clearValue);\n\t\n\t    // draw into the stencil buffer\n\t\n\t    renderer.render(this.scene, this.camera, readBuffer, this.clear);\n\t    renderer.render(this.scene, this.camera, writeBuffer, this.clear);\n\t\n\t    // re-enable update of color and depth\n\t\n\t    context.colorMask(true, true, true, true);\n\t    context.depthMask(true);\n\t\n\t    // only render where stencil is set to 1\n\t\n\t    context.stencilFunc(context.EQUAL, 1, 0xffffffff); // draw if == 1\n\t    context.stencilOp(context.KEEP, context.KEEP, context.KEEP);\n\t  }\n\t\n\t};\n\t\n\t_three2.default.ClearMaskPass = function () {\n\t\n\t  this.enabled = true;\n\t};\n\t\n\t_three2.default.ClearMaskPass.prototype = {\n\t\n\t  render: function render(renderer, writeBuffer, readBuffer, delta) {\n\t\n\t    var context = renderer.context;\n\t\n\t    context.disable(context.STENCIL_TEST);\n\t  }\n\t\n\t};\n\t\n\tvar MaskPass = _three2.default.MaskPass;\n\tvar ClearMaskPass = _three2.default.ClearMaskPass;\n\texports.MaskPass = MaskPass;\n\texports.ClearMaskPass = ClearMaskPass;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\t\n\t_three2.default.RenderPass = function (scene, camera, overrideMaterial, clearColor, clearAlpha) {\n\t\n\t  this.scene = scene;\n\t  this.camera = camera;\n\t\n\t  this.overrideMaterial = overrideMaterial;\n\t\n\t  this.clearColor = clearColor;\n\t  this.clearAlpha = clearAlpha !== undefined ? clearAlpha : 1;\n\t\n\t  this.oldClearColor = new _three2.default.Color();\n\t  this.oldClearAlpha = 1;\n\t\n\t  this.enabled = true;\n\t  this.clear = true;\n\t  this.needsSwap = false;\n\t};\n\t\n\t_three2.default.RenderPass.prototype = {\n\t\n\t  render: function render(renderer, writeBuffer, readBuffer, delta) {\n\t\n\t    this.scene.overrideMaterial = this.overrideMaterial;\n\t\n\t    if (this.clearColor) {\n\t\n\t      this.oldClearColor.copy(renderer.getClearColor());\n\t      this.oldClearAlpha = renderer.getClearAlpha();\n\t\n\t      renderer.setClearColor(this.clearColor, this.clearAlpha);\n\t    }\n\t\n\t    renderer.render(this.scene, this.camera, readBuffer, this.clear);\n\t\n\t    if (this.clearColor) {\n\t\n\t      renderer.setClearColor(this.oldClearColor, this.oldClearAlpha);\n\t    }\n\t\n\t    this.scene.overrideMaterial = null;\n\t  }\n\t\n\t};\n\t\n\texports.default = _three2.default.RenderPass;\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\t\n\t_three2.default.ShaderPass = function (shader, textureID) {\n\t\n\t  this.textureID = textureID !== undefined ? textureID : \"tDiffuse\";\n\t\n\t  this.uniforms = _three2.default.UniformsUtils.clone(shader.uniforms);\n\t\n\t  this.material = new _three2.default.ShaderMaterial({\n\t\n\t    defines: shader.defines || {},\n\t    uniforms: this.uniforms,\n\t    vertexShader: shader.vertexShader,\n\t    fragmentShader: shader.fragmentShader\n\t\n\t  });\n\t\n\t  this.renderToScreen = false;\n\t\n\t  this.enabled = true;\n\t  this.needsSwap = true;\n\t  this.clear = false;\n\t\n\t  this.camera = new _three2.default.OrthographicCamera(-1, 1, 1, -1, 0, 1);\n\t  this.scene = new _three2.default.Scene();\n\t\n\t  this.quad = new _three2.default.Mesh(new _three2.default.PlaneBufferGeometry(2, 2), null);\n\t  this.scene.add(this.quad);\n\t};\n\t\n\t_three2.default.ShaderPass.prototype = {\n\t\n\t  render: function render(renderer, writeBuffer, readBuffer, delta) {\n\t\n\t    if (this.uniforms[this.textureID]) {\n\t\n\t      this.uniforms[this.textureID].value = readBuffer;\n\t    }\n\t\n\t    this.quad.material = this.material;\n\t\n\t    if (this.renderToScreen) {\n\t\n\t      renderer.render(this.scene, this.camera);\n\t    } else {\n\t\n\t      renderer.render(this.scene, this.camera, writeBuffer, this.clear);\n\t    }\n\t  }\n\t\n\t};\n\t\n\texports.default = _three2.default.ShaderPass;\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t *\n\t * Vignette shader\n\t * based on PaintEffect postprocess from ro.me\n\t * http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js\n\t */\n\t\n\t_three2.default.VignetteShader = {\n\t\n\t  uniforms: {\n\t\n\t    \"tDiffuse\": { type: \"t\", value: null },\n\t    \"offset\": { type: \"f\", value: 1.0 },\n\t    \"darkness\": { type: \"f\", value: 1.0 }\n\t\n\t  },\n\t\n\t  vertexShader: [\"varying vec2 vUv;\", \"void main() {\", \"vUv = uv;\", \"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\", \"}\"].join(\"\\n\"),\n\t\n\t  fragmentShader: [\"uniform float offset;\", \"uniform float darkness;\", \"uniform sampler2D tDiffuse;\", \"varying vec2 vUv;\", \"void main() {\",\n\t\n\t  // Eskil's vignette\n\t\n\t  \"vec4 texel = texture2D( tDiffuse, vUv );\", \"vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );\", \"gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );\",\n\t\n\t  /*\n\t  // alternative version from glfx.js\n\t  // this one makes more \"dusty\" look (as opposed to \"burned\")\n\t   \"vec4 color = texture2D( tDiffuse, vUv );\",\n\t  \"float dist = distance( vUv, vec2( 0.5 ) );\",\n\t  \"color.rgb *= smoothstep( 0.8, offset * 0.799, dist *( darkness + offset ) );\",\n\t  \"gl_FragColor = color;\",\n\t  */\n\t\n\t  \"}\"].join(\"\\n\")\n\t\n\t};\n\t\n\texports.default = _three2.default.VignetteShader;\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\tvar presets = exports.presets = {\n\t  renderer: {\n\t    shadowMapEnabled: true,\n\t    shadowMapAutoUpdate: true,\n\t    shadowMapSoft: true,\n\t    shadowMapType: undefined, //THREE.PCFSoftShadowMap,//THREE.PCFSoftShadowMap,//PCFShadowMap\n\t    autoUpdateScene: true, //Default ?\n\t    physicallyBasedShading: false, //Default ?\n\t    autoClear: true, //Default ?\n\t    gammaInput: false,\n\t    gammaOutput: false\n\t  },\n\t  cameras: [{\n\t    name: \"mainCamera\",\n\t    pos: [75, 75, 145], //[100,-100,100]\n\t    up: [0, 0, 1],\n\t    lens: {\n\t      fov: 45,\n\t      near: 0.1,\n\t      far: 20000\n\t    }\n\t  }],\n\t  controls: [{\n\t    up: [0, 0, 1],\n\t    rotateSpeed: 2.0,\n\t    panSpeed: 2.0,\n\t    zoomSpeed: 2.0,\n\t    autoRotate: {\n\t      enabled: false,\n\t      speed: 0.2\n\t    },\n\t    _enabled: true,\n\t    _active: true\n\t  }],\n\t  scenes: {\n\t    \"main\": [\n\t    //{ type:\"hemisphereLight\", color:\"#FFFF33\", gndColor:\"#FF9480\", pos:[0, 0, 500], intensity:0.6 },\n\t    { type: \"hemisphereLight\", color: \"#FFEEEE\", gndColor: \"#FFFFEE\", pos: [0, 1200, 1500], intensity: 0.8 }, { type: \"ambientLight\", color: \"#0x252525\", intensity: 0.03 }, { type: \"directionalLight\", color: \"#262525\", intensity: 0.2, pos: [150, 150, 1500], castShadow: true, onlyShadow: true }\n\t    //{ type:\"directionalLight\", color:\"#FFFFFF\", intensity:0.2 , pos:[150,150,1500], castShadow:true, onlyShadow:true}\n\t    ],\n\t    \"helpers\": [{ type: \"LabeledGrid\" }]\n\t  }\n\t};\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; })();\n\t\n\tvar _view = __webpack_require__(22);\n\t\n\tvar _view2 = _interopRequireDefault(_view);\n\t\n\tvar _rx = __webpack_require__(2);\n\t\n\tvar _rx2 = _interopRequireDefault(_rx);\n\t\n\tvar _fs = __webpack_require__(3);\n\t\n\tvar _fs2 = _interopRequireDefault(_fs);\n\t\n\tvar _utils = __webpack_require__(24);\n\t\n\tvar _meshUtils = __webpack_require__(23);\n\t\n\tvar _glViewHelpers = __webpack_require__(4);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t//BIG hack, because parsers are browserified modules ...\n\tglobal.Rx = _rx2.default;\n\tvar stlParser = __webpack_require__(27);\n\tvar objParser = __webpack_require__(26);\n\t//import * as stlParser from 'usco-stl-parser'\n\t//import * as objParser from 'usco-obj-parser'\n\t\n\tvar centerMesh = _glViewHelpers.meshTools.centerMesh;\n\t\n\t//TODO: refactor ,same as assetManager\n\tfunction postProcessParsedData(data) {\n\t  var mesh = data;\n\t  mesh = (0, _meshUtils.geometryFromBuffers)(mesh);\n\t  mesh = (0, _meshUtils.postProcessMesh)(mesh);\n\t  mesh = centerMesh(mesh);\n\t  return mesh;\n\t}\n\t\n\t/*import makeHttpDriver     from '../../core/drivers/simpleHttpDriver'\n\timport {requests,resources} from '../../utils/assetManager'\n\tlet httpDriver   = makeHttpDriver()*/\n\t\n\t//see http://stackoverflow.com/questions/8609289/convert-a-binary-nodejs-buffer-to-javascript-arraybuffer\n\tfunction toArrayBuffer(buffer) {\n\t  var ab = new ArrayBuffer(buffer.length);\n\t  var view = new Uint8Array(ab);\n\t  for (var i = 0; i < buffer.length; ++i) {\n\t    view[i] = buffer[i];\n\t  }\n\t  return ab;\n\t}\n\t\n\t/////////deal with command line args etc\n\tvar args = process.argv.slice(2);\n\t\n\tif (args.length > 0) {\n\t  (function () {\n\t\n\t    //more advanced params handling , for later\n\t    /*\n\t      console.log(\"params\",args)\n\t      let params = args.reduce(function(cur,combo){\n\t      let [name,val]= cur.split(\"=\")\n\t      combo[name] = val\n\t    },{})*/\n\t\n\t    var uri = args[0];\n\t\n\t    var _args$1$split$map = args[1].split(\"x\").map(function (e) {\n\t      return parseInt(e);\n\t    });\n\t\n\t    var _args$1$split$map2 = _slicedToArray(_args$1$split$map, 2);\n\t\n\t    var width = _args$1$split$map2[0];\n\t    var height = _args$1$split$map2[1];\n\t\n\t    var _getNameAndExtension = (0, _utils.getNameAndExtension)(uri);\n\t\n\t    var name = _getNameAndExtension.name;\n\t    var ext = _getNameAndExtension.ext;\n\t\n\t    var resolution = { width: width, height: height };\n\t    var outputPath = uri + '.png';\n\t\n\t    console.log(\"Running renderer with params\", uri, resolution, outputPath);\n\t\n\t    var parsers = {};\n\t    parsers[\"stl\"] = stlParser.default;\n\t    parsers[\"obj\"] = objParser.default;\n\t\n\t    var data = toArrayBuffer(_fs2.default.readFileSync(uri));\n\t    var parse = parsers[ext];\n\t    var parseOptions = {};\n\t    var parsedObs$ = parse(data, parseOptions);\n\t\n\t    var data$ = parsedObs$.filter(function (e) {\n\t      return e.progress === undefined;\n\t    }) //seperate out progress data\n\t    .map(postProcessParsedData).forEach(function (mesh) {\n\t      console.log(\"foooo\");\n\t      (0, _view2.default)({ mesh: mesh, uri: outputPath, resolution: resolution });\n\t    });\n\t\n\t    /*let uris = args\n\t    const requests$ = Rx.Observable.from(uris)\n\t     .map(function(uri){\n\t        return {\n\t          url:uri\n\t          ,method:'get'\n\t          ,type:'resource'\n\t        }\n\t      })\n\t     const responses$ = httpDriver(requests$)\n\t      responses$\n\t        .forEach(e=>console.log(\"responses\",e))\n\t    //resources()*/\n\t  })();\n\t}\n\n/***/ },\n/* 21 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; })();\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\texports.positionFromCoords = positionFromCoords;\n\texports.targetObject = targetObject;\n\texports.isTransformTool = isTransformTool;\n\texports.selectionAt = selectionAt;\n\texports.meshFrom = meshFrom;\n\texports.makeCamera = makeCamera;\n\texports.makeControls = makeControls;\n\texports.makeLight = makeLight;\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar _OrbitControls = __webpack_require__(7);\n\t\n\tvar _OrbitControls2 = _interopRequireDefault(_OrbitControls);\n\t\n\tvar _CombinedCamera = __webpack_require__(6);\n\t\n\tvar _CombinedCamera2 = _interopRequireDefault(_CombinedCamera);\n\t\n\tvar _ramda = __webpack_require__(30);\n\t\n\tvar _Selector = __webpack_require__(9);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction positionFromCoords(coords) {\n\t  return { position: { x: coords.x, y: coords.y }, event: coords };\n\t}\n\tfunction targetObject(event) {\n\t  return event.target.object;\n\t}\n\tfunction isTransformTool(input) {\n\t  return [\"translate\", \"rotate\", \"scale\", null, undefined].indexOf(input) > -1;\n\t}\n\t\n\tfunction selectionAt(event, mouseCoords, camera, hiearchyRoot) {\n\t  //log.debug(\"selection at\",event)\n\t  //, container, selector, width, height, rootObject\n\t\n\t  //let intersects = selector.pickAlt({x:event.clientX,y:event.clientY}, rect, width, height, rootObject)\n\t  var intersects = (0, _Selector.pick)(mouseCoords, camera, hiearchyRoot); //, ortho = false, precision=10)\n\t\n\t  var outEvent = {};\n\t  outEvent.clientX = event.clientX;\n\t  outEvent.clientY = event.clientY;\n\t  outEvent.offsetX = event.offsetX;\n\t  outEvent.offsetY = event.offsetY;\n\t  outEvent.x = event.x || event.clientX;\n\t  outEvent.y = event.y || event.clientY;\n\t\n\t  outEvent.detail = {};\n\t  outEvent.detail.pickingInfos = intersects;\n\t  return outEvent;\n\t}\n\t\n\tfunction meshFrom(event) {\n\t  var mesh = undefined;\n\t  if (event && event.detail && event.detail.pickingInfos) {\n\t    var _take = (0, _ramda.take)(1, event.detail.pickingInfos);\n\t\n\t    var _take2 = _slicedToArray(_take, 1);\n\t\n\t    var intersect = _take2[0]; //we actually only get the best match => DO NOT MODIFY original object\n\t\n\t    if (intersect && intersect.object) {\n\t      mesh = (0, _Selector.findSelectionRoot)(intersect.object); //now we make sure that what we have is actually selectable\n\t    }\n\t  }\n\t  return mesh;\n\t}\n\t\n\t////////////Various \"making\" functions , data/config in, (3d object) instances out\n\t//yup, like factories ! yikes !\n\t\n\t/*create a camera instance from the provided data*/\n\tfunction makeCamera(cameraData, params) {\n\t  //let cameraData = cameraData//TODO: merge with defaults using object.assign\n\t  var DEFAULTS = {\n\t    width: 320,\n\t    height: 240,\n\t    lens: {\n\t      fov: 45,\n\t      near: 0.1,\n\t      far: 20000\n\t    },\n\t    aspect: 320 / 240,\n\t    up: [0, 0, 1],\n\t    pos: [0, 0, 0]\n\t  };\n\t  cameraData = Object.assign({}, DEFAULTS, cameraData);\n\t\n\t  var camera = new _CombinedCamera2.default(cameraData.width, cameraData.height, cameraData.lens.fov, cameraData.lens.near, cameraData.lens.far, cameraData.lens.near, cameraData.lens.far);\n\t\n\t  camera.up.fromArray(cameraData.up);\n\t  camera.position.fromArray(cameraData.pos);\n\t  return camera;\n\t}\n\t\n\t/*setup a controls instance from the provided data*/\n\tfunction makeControls(controlsData) {\n\t  var up = new _three2.default.Vector3().fromArray(controlsData.up);\n\t\n\t  //controlsData = controlsData//TODO: merge with defaults using object.assign\n\t  var controls = new _OrbitControls2.default(undefined, undefined, up);\n\t  controls.upVector = up;\n\t\n\t  controls.userPanSpeed = controlsData.panSpeed;\n\t  controls.userZoomSpeed = controlsData.zoomSpeed;\n\t  controls.userRotateSpeed = controlsData.rotateSpeed;\n\t\n\t  controls.autoRotate = controlsData.autoRotate.enabled;\n\t  controls.autoRotateSpeed = controlsData.autoRotate.speed;\n\t\n\t  return controls;\n\t}\n\t\n\t/*create a light instance from the provided data*/\n\tfunction makeLight(lightData) {\n\t  var light = undefined;\n\t  var DEFAULTS = {\n\t    color: \"#FFF\",\n\t    intensity: 1,\n\t    pos: [0, 0, 0]\n\t  };\n\t  lightData = Object.assign({}, DEFAULTS, lightData);\n\t\n\t  switch (lightData.type) {\n\t    case \"light\":\n\t      light = new _three2.default.Light(lightData.color);\n\t      light.intensity = lightData.intensity;\n\t      break;\n\t    case \"hemisphereLight\":\n\t      light = new _three2.default.HemisphereLight(lightData.color, lightData.gndColor, lightData.intensity);\n\t      break;\n\t    case \"ambientLight\":\n\t      // ambient light does not have intensity, only color\n\t      var newColor = new _three2.default.Color(lightData.color);\n\t      newColor.r *= lightData.intensity;\n\t      newColor.g *= lightData.intensity;\n\t      newColor.b *= lightData.intensity;\n\t      light = new _three2.default.AmbientLight(newColor);\n\t      break;\n\t    case \"directionalLight\":\n\t      var dirLightDefaults = {\n\t        castShadow: false,\n\t        onlyShadow: false,\n\t\n\t        shadowMapWidth: 2048,\n\t        shadowMapHeight: 2048,\n\t        shadowCameraLeft: -500,\n\t        shadowCameraRight: 500,\n\t        shadowCameraTop: 500,\n\t        shadowCameraBottom: -500,\n\t        shadowCameraNear: 1200,\n\t        shadowCameraFar: 5000,\n\t        shadowCameraFov: 50,\n\t        shadowBias: 0.0001,\n\t        shadowDarkness: 0.3,\n\t        shadowCameraVisible: false\n\t      };\n\t      lightData = Object.assign({}, dirLightDefaults, lightData);\n\t      light = new _three2.default.DirectionalLight(lightData.color, lightData.intensity);\n\t      for (var key in lightData) {\n\t        if (light.hasOwnProperty(key)) {\n\t          light[key] = lightData[key];\n\t        }\n\t      }\n\t\n\t      break;\n\t    default:\n\t      throw new Error(\"could not create light\");\n\t      break;\n\t  }\n\t\n\t  light.position.fromArray(lightData.pos);\n\t\n\t  return light;\n\t}\n\t\n\tfunction cameraWobble3dHint(camera) {\n\t  var time = arguments.length <= 1 || arguments[1] === undefined ? 1500 : arguments[1];\n\t\n\t  var camPos = camera.position.clone();\n\t  var target = camera.position.clone().add(new _three2.default.Vector3(-5, -10, -5));\n\t\n\t  var tween = new TWEEN.Tween(camPos).to(target, time).repeat(Infinity).delay(500).yoyo(true).easing(TWEEN.Easing.Cubic.InOut).onUpdate(function () {\n\t    camera.position.copy(camPos);\n\t  }).start();\n\t\n\t  var camRot = camera.rotation.clone();\n\t  //let rtarget = camera.rotation.clone().add(new THREE.Vector3(50,50,50))\n\t\n\t  /*let tween2 = new TWEEN.Tween( camRot )\n\t    .to( rtarget , time )\n\t    .repeat( Infinity )\n\t    .delay( 500 )\n\t    .yoyo(true)\n\t    .easing( TWEEN.Easing.Quadratic.InOut )\n\t    .onUpdate( function () {\n\t      camera.position.copy(camRot)\n\t    } )\n\t    .start()*/\n\t  return tween;\n\t}\n\n/***/ },\n/* 22 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\texports.default = view;\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar _utils = __webpack_require__(21);\n\t\n\tvar _presets = __webpack_require__(19);\n\t\n\tvar _EffectComposer = __webpack_require__(13);\n\t\n\tvar _EffectComposer2 = _interopRequireDefault(_EffectComposer);\n\t\n\tvar _ShaderPass = __webpack_require__(17);\n\t\n\tvar _ShaderPass2 = _interopRequireDefault(_ShaderPass);\n\t\n\tvar _RenderPass = __webpack_require__(16);\n\t\n\tvar _RenderPass2 = _interopRequireDefault(_RenderPass);\n\t\n\tvar _MaskPass = __webpack_require__(15);\n\t\n\tvar _CopyShader = __webpack_require__(11);\n\t\n\tvar _CopyShader2 = _interopRequireDefault(_CopyShader);\n\t\n\tvar _FXAAShader = __webpack_require__(14);\n\t\n\tvar _FXAAShader2 = _interopRequireDefault(_FXAAShader);\n\t\n\tvar _vignetteShader = __webpack_require__(18);\n\t\n\tvar _vignetteShader2 = _interopRequireDefault(_vignetteShader);\n\t\n\tvar _EdgeShader = __webpack_require__(12);\n\t\n\tvar _EdgeShader2 = _interopRequireDefault(_EdgeShader);\n\t\n\tvar _AdditiveBlendShader = __webpack_require__(10);\n\t\n\tvar _AdditiveBlendShader2 = _interopRequireDefault(_AdditiveBlendShader);\n\t\n\tvar _glViewHelpers = __webpack_require__(4);\n\t\n\tvar _LabeledGrid = __webpack_require__(25);\n\t\n\tvar _LabeledGrid2 = _interopRequireDefault(_LabeledGrid);\n\t\n\tvar _bufferToPng = __webpack_require__(5);\n\t\n\tvar _bufferToPng2 = _interopRequireDefault(_bufferToPng);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _typeof(obj) { return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; } //default configuration for lighting, cameras etc\n\t\n\tvar zoomToFit = _glViewHelpers.objectEffects.zoomToFit;\n\t\n\tvar gl = __webpack_require__(28)(); //(width, height, { preserveDrawingBuffer: true })\n\t\n\t//console.log(\"helpers.grids\",helpers,helpers.grids)\n\t//let LabeledGrid = helpers.grids.LabeledGrid\n\tvar ShadowPlane = _glViewHelpers.planes.ShadowPlane;\n\t\n\tfunction makeGlRendering() {}\n\t\n\t//Helpers for offline Rendering\n\t\n\tfunction contextToBuffer(gl, width, height) {\n\t  var depth = arguments.length <= 3 || arguments[3] === undefined ? 4 : arguments[3];\n\t\n\t  var buffer = new Uint8Array(width * height * depth);\n\t  gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buffer);\n\t  return buffer;\n\t}\n\t\n\tfunction writeBufferToFile(buffer, width, height, path) {\n\t  (0, _bufferToPng2.default)(buffer, width, height, path);\n\t}\n\t\n\tfunction writeContextToFile(context, width, height, depth) {\n\t  var path = arguments.length <= 4 || arguments[4] === undefined ? \"./test.png\" : arguments[4];\n\t\n\t  var buffer = contextToBuffer(context, width, height, depth);\n\t  writeBufferToFile(buffer, width, height, path);\n\t}\n\t\n\t//////////////////////////////////////////////////\n\t\n\tfunction setupPostProcess(renderer, camera, scene, params) {\n\t  var width = params.width;\n\t  var height = params.height;\n\t  var devicePixelRatio = params.devicePixelRatio;\n\t  var renderToScreen = params.renderToScreen;\n\t  ////////post processing\n\t\n\t  var renderTargetParameters = {\n\t    minFilter: _three2.default.LinearFilter,\n\t    magFilter: _three2.default.LinearFilter,\n\t    format: _three2.default.RGBAFormat,\n\t    stencilBuffer: true\n\t  };\n\t\n\t  var outScene = new _three2.default.Scene();\n\t  var maskScene = new _three2.default.Scene();\n\t\n\t  var renderTarget = new _three2.default.WebGLRenderTarget(width, height, renderTargetParameters);\n\t\n\t  //setup composer\n\t  var composer = new _EffectComposer2.default(renderer);\n\t  composer.renderTarget1.stencilBuffer = true;\n\t  composer.renderTarget2.stencilBuffer = true;\n\t\n\t  var normal = new _RenderPass2.default(scene, camera);\n\t  var outline = new _RenderPass2.default(outScene, camera);\n\t  var maskPass = new _three2.default.MaskPass(maskScene, camera);\n\t  maskPass.inverse = true;\n\t  var clearMask = new _three2.default.ClearMaskPass();\n\t  var copyPass = new _three2.default.ShaderPass(_three2.default.CopyShader);\n\t  var fxaaPass = new _three2.default.ShaderPass(_three2.default.FXAAShader);\n\t  var vignettePass = new _three2.default.ShaderPass(_three2.default.VignetteShader);\n\t\n\t  fxaaPass.uniforms['resolution'].value.set(1 / width * devicePixelRatio, 1 / height * devicePixelRatio);\n\t  vignettePass.uniforms[\"offset\"].value = 0.95;\n\t  vignettePass.uniforms[\"darkness\"].value = 0.9;\n\t\n\t  renderer.autoClear = false;\n\t  //renderer.autoClearStencil = false   \n\t  outline.clear = false;\n\t  //normal.clear = false   \n\t\n\t  composer.addPass(normal);\n\t  composer.addPass(maskPass);\n\t  composer.addPass(outline);\n\t\n\t  composer.addPass(clearMask);\n\t  //composer.addPass(vignettePass)\n\t  //composer.addPass(fxaaPass)\n\t  composer.addPass(copyPass);\n\t\n\t  var lastPass = composer.passes[composer.passes.length - 1];\n\t  lastPass.renderToScreen = renderToScreen;\n\t\n\t  return { composers: [composer], fxaaPass: fxaaPass, outScene: outScene, maskScene: maskScene };\n\t\n\t  //return {composer:finalComposer, fxaaPass, outScene, maskScene, composers:[normalComposer,depthComposer,finalComposer]}\n\t}\n\t\n\tfunction setupPostProcess2(renderer, camera, scene, params) {\n\t\n\t  //FIXME hack\n\t  if (!renderer.context.canvas) {\n\t    renderer.context.canvas = {\n\t      width: params.width,\n\t      height: params.height\n\t    };\n\t  }\n\t\n\t  var ppData = setupPostProcess(renderer, camera, scene, params);\n\t  //composer = ppData.composer\n\t  var composers = ppData.composers;\n\t  /*fxaaPass = ppData.fxaaPass\n\t  outScene = ppData.outScene\n\t  maskScene = ppData.maskScene*/\n\t  return composers;\n\t}\n\t\n\t///various helpers\n\t\n\tfunction makeOfflineCanvas() {\n\t  // mock object, not used in our test case, might be problematic for some workflow\n\t  var canvas = new Object();\n\t  canvas.addEventListener = function (e, b) {\n\t    //only for contextLost\n\t    //console.log(\"canvas addEventListener\",e,b)\n\t  };\n\t  return canvas;\n\t}\n\t\n\tfunction makeLiveCanvas() {\n\t  var canvas = document.createElement('canvas');\n\t  return canvas;\n\t}\n\t\n\tfunction makeCanvas() {\n\t  if (typeof window !== 'undefined') {\n\t    return makeLiveCanvas();\n\t  }\n\t  return makeOfflineCanvas();\n\t}\n\t\n\tfunction handleResize(sizeInfos) {\n\t  //log.debug(\"setting glView size\",sizeInfos)\n\t  console.log(\"setting glView size\", sizeInfos);\n\t  var width = sizeInfos.width;\n\t  var height = sizeInfos.height;\n\t  var aspect = sizeInfos.aspect;\n\t\n\t  if (width > 0 && height > 0 && camera && renderer) {\n\t    (function () {\n\t      renderer.setSize(width, height);\n\t      camera.aspect = aspect;\n\t      camera.setSize(width, height);\n\t      camera.updateProjectionMatrix();\n\t\n\t      var pixelRatio = window.devicePixelRatio || 1;\n\t      fxaaPass.uniforms['resolution'].value.set(1 / (width * pixelRatio), 1 / (height * pixelRatio));\n\t\n\t      composers.forEach(function (c) {\n\t        c.reset();\n\t        c.setSize(width * pixelRatio, height * pixelRatio);\n\t      });\n\t    })();\n\t  }\n\t}\n\t\n\tfunction setupWindowSpecific(container, renderer, camera) {\n\t  console.log(\"initializing into container\", container);\n\t  container.appendChild(renderer.domElement);\n\t\n\t  //controls are only needed for live aka browser mode\n\t  var controls = (0, _utils.makeControls)(config.controls[0]);\n\t  var transformControls = new TransformControls(camera);\n\t  //controls, transformControls\n\t\n\t  //prevents zooming the 3d view from scrolling the window\n\t  preventScroll(container);\n\t  transformControls.setDomElement(container);\n\t\n\t  //more init\n\t  controls.setObservables(actions.filteredInteractions$);\n\t  controls.addObject(camera);\n\t\n\t  //let pixelRatio = window.devicePixelRatio || 1\n\t  return {\n\t    updateables: [controls, transformControls]\n\t  };\n\t}\n\t\n\tfunction setupNodeSpecific(renderer, camera, scene) {\n\t  camera.lookAt(scene.position);\n\t}\n\t\n\tfunction monkeyPatchGl(gl) {\n\t\n\t  function checkObject(object) {\n\t    return (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' || object === void 0;\n\t  }\n\t\n\t  //Don't allow: \", $, `, @, \\, ', \\0\n\t  function isValidString(str) {\n\t    return !/[\\\"\\$\\`\\@\\\\\\'\\0]/.test(str);\n\t  }\n\t\n\t  function checkWrapper(context, object, wrapper) {\n\t    if (!checkValid(object, wrapper)) {\n\t      setError(context, gl.INVALID_VALUE);\n\t      return false;\n\t    } else if (!checkOwns(context, object)) {\n\t      setError(context, gl.INVALID_OPERATION);\n\t      return false;\n\t    }\n\t    return true;\n\t  }\n\t\n\t  function shaderSource(shader, source) {\n\t    if (!checkObject(shader)) {\n\t      throw new TypeError('shaderSource(WebGLShader, String)');\n\t    }\n\t    if (!shader || !source && typeof source !== 'string') {\n\t      setError(this, gl.INVALID_VALUE);\n\t      return;\n\t    }\n\t    source += '';\n\t    if (!isValidString(source)) {\n\t      setError(this, gl.INVALID_VALUE);\n\t      return;\n\t    } else if (checkWrapper(this, shader, WebGLShader)) {\n\t\n\t      //patch\n\t      if (source.indexOf('precision') >= 0) {\n\t\n\t        //'#ifdef GL_ES',\n\t        var sourceChunks = source.split('\\n');\n\t\n\t        sourceChunks.map(function (chunk) {\n\t          console.log(\"chunk\", chunk);\n\t        });\n\t\n\t        //sourceChunks = sourceChunks.concat(['#endif'])\n\t        source = sourceChunks.concat('\\n');\n\t      }\n\t\n\t      _shaderSource.call(this, shader._ | 0, wrapShader(shader._type, source));\n\t      shader._source = source;\n\t    }\n\t  }\n\t  //gl.shaderSource = shaderSource.bind(gl)\n\t  return gl;\n\t\n\t  //gl.shaderSource()\n\t  //\n\t}\n\t\n\tfunction render(renderer, composers, camera, scene) {\n\t  composers.forEach(function (c) {\n\t    return c.render();\n\t  });\n\t  //renderer.render(scene, camera)\n\t\n\t  /*let width = 640\n\t  let height = 480\n\t  let rtTexture = new THREE.WebGLRenderTarget(width, height, {\n\t    minFilter: THREE.LinearFilter,\n\t    magFilter: THREE.NearestFilter,\n\t    format: THREE.RGBAFormat\n\t  })\n\t   renderer.render(scene, camera, rtTexture, true)*/\n\t\n\t  //composer.passes[composer.passes.length-1].uniforms[ 'tDiffuse2' ].value = composers[0].renderTarget2\n\t  //composer.passes[composer.passes.length-1].uniforms[ 'tDiffuse3' ].value = composers[1].renderTarget2\n\t}\n\t\n\tfunction setupScene(scene, extras, config) {\n\t  config.scenes[\"main\"]\n\t  //TODO , update to be more generic\n\t  .map(function (light) {\n\t    return (0, _utils.makeLight)(light);\n\t  }).forEach(function (light) {\n\t    return scene.add(light);\n\t  });\n\t\n\t  return scene;\n\t}\n\t\n\tfunction setupRenderer(canvas, context, config) {\n\t  var pixelRatio = 1;\n\t\n\t  var renderer = new _three2.default.WebGLRenderer({\n\t    antialias: false,\n\t    preserveDrawingBuffer: true,\n\t    //width: 0,\n\t    //height: 0,\n\t    canvas: canvas,\n\t    context: context\n\t  });\n\t  renderer.setClearColor(\"#fff\");\n\t  renderer.setPixelRatio(pixelRatio);\n\t  Object.keys(config.renderer).map(function (key) {\n\t    //TODO add hasOwnProp check\n\t    renderer[key] = config.renderer[key];\n\t  });\n\t\n\t  console.log(\"renderer setup DONE\");\n\t\n\t  return renderer;\n\t}\n\t\n\tfunction getDefaultsWindowSpecific() {\n\t  var params = {\n\t    width: window.innerWidth,\n\t    height: window.innerHeight,\n\t    pixelRatio: window.devicePixelRatio || 1\n\t  };\n\t  return params;\n\t}\n\t\n\tfunction makeDefaults(data) {\n\t  var params = {\n\t    width: resolution.width,\n\t    height: resolution.height,\n\t    devicePixelRatio: 1,\n\t    renderToScreen: typeof window !== 'undefined' //FALSE if you want server side renders\n\t  };\n\t}\n\t\n\t//////////////////////////////////////////////////\n\t\n\tfunction view(data) {\n\t  var mesh = data.mesh;\n\t  var uri = data.uri;\n\t  var resolution = data.resolution;\n\t\n\t  var config = _presets.presets;\n\t  var params = {\n\t    width: resolution.width,\n\t    height: resolution.height,\n\t    devicePixelRatio: 1,\n\t    renderToScreen: typeof window !== 'undefined' //FALSE if you want server side renders\n\t  };\n\t\n\t  gl = monkeyPatchGl(gl);\n\t\n\t  var renderer = null;\n\t  var composer = null;\n\t  var composers = [];\n\t  var outScene = null;\n\t  var maskScene = null;\n\t\n\t  var scene = new _three2.default.Scene();\n\t  var dynamicInjector = new _three2.default.Object3D(); //all dynamic mapped objects reside here\n\t  scene.dynamicInjector = dynamicInjector;\n\t  scene.add(dynamicInjector);\n\t\n\t  var camera = (0, _utils.makeCamera)(config.cameras[0], params);\n\t  //let grid        = new LabeledGrid(200, 200, 10, config.cameras[0].up) //needs CANVAS....\n\t  var shadowPlane = new ShadowPlane(2000, 2000, null, config.cameras[0].up);\n\t\n\t  var material = new _three2.default.ShaderMaterial();\n\t\n\t  //material = new THREE.MeshBasicMaterial( { color: 0xf0ff00 } )\n\t  //material = new THREE.MeshPhongMaterial( { color: 0x17a9f5, specular: 0xffffff, shininess: 5, shading: THREE.FlatShading} )//NOT WORKING => black shape\n\t  //material = new THREE.MeshBasicMaterial( { color: 0xffaa00, transparent: true, blending: THREE.AdditiveBlending } ) //NOT WORKING => all white\n\t  //material = new THREE.MeshLambertMaterial( { color: 0xdddddd, shading: THREE.SmoothShading } )  //NOT WORKING => black shape\n\t  material = new _three2.default.MeshNormalMaterial({ shading: _three2.default.SmoothShading }); //THIS WORKS\n\t  //material = new THREE.MeshBasicMaterial( { color: 0xffaa00, wireframe: true } )//THIS WORKS\n\t  //material = new THREE.MeshDepthMaterial() //NOT WORKING => all white\n\t\n\t  //hack\n\t  mesh.material = material;\n\t  dynamicInjector.add(mesh);\n\t\n\t  var sceneExtras = [camera, shadowPlane];\n\t\n\t  var canvas = makeCanvas();\n\t  renderer = setupRenderer(canvas, gl, config);\n\t  scene = setupScene(scene, sceneExtras, config);\n\t  composers = setupPostProcess2(renderer, camera, scene, params);\n\t\n\t  //do context specific config\n\t  setupNodeSpecific(renderer, camera, scene);\n\t  //this is too hard coded\n\t  var targetNode = dynamicInjector;\n\t  zoomToFit(targetNode, camera, new _three2.default.Vector3());\n\t\n\t  ///do the actual rendering\n\t  render(renderer, composers, camera, scene);\n\t\n\t  //now we output to file\n\t  var _gl = renderer.getContext();\n\t  writeContextToFile(_gl, params.width, params.height, 4, uri); //,4, path)\n\t}\n\n/***/ },\n/* 23 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\texports.postProcessMesh = postProcessMesh;\n\texports.geometryFromBuffers = geometryFromBuffers;\n\texports.meshTohash = meshTohash;\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t//TODO: UNIFY api for parsers, this is redundant\n\tfunction postProcessMesh(shape) {\n\t\n\t  //geometry\n\t  if (!(shape instanceof _three2.default.Object3D)) {\n\t    var material = new _three2.default.MeshPhongMaterial({ color: 0x17a9f5, specular: 0xffffff, shininess: 5, shading: _three2.default.FlatShading });\n\t    shape = new _three2.default.Mesh(shape, material);\n\t  }\n\t\n\t  //FIXME  should this be handled by the asset manager or the parsers ?\n\t  //ie , this won't work for loaded hierarchies etc\n\t  var geometry = shape.geometry;\n\t  if (geometry) {\n\t    geometry.computeVertexNormals(); //needed at least for .ply files\n\t    geometry.computeFaceNormals();\n\t  }\n\t\n\t  /* OLD STUFF, needs to be sorted out \n\t    var vs = require('./vertShader.vert')();\n\t    var fs = require('./fragShader.frag')();\n\t     var material = new THREE.RawShaderMaterial( {\n\t            uniforms: {\n\t              time: { type: \"f\", value: 1.0 }\n\t            },\n\t            vertexShader: vs,\n\t            fragmentShader: fs,\n\t            side: THREE.DoubleSide,\n\t            transparent: true\n\t           } );\n\t    var material = new this.defaultMaterialType({color:color, specular: 0xffffff, shininess: 2, shading: THREE.FlatShading});//,vertexColors: THREE.VertexColors\n\t  */\n\t\n\t  //Additional hack, only for buffer geometry\n\t  if (!geometry.morphTargets) geometry.morphTargets = [];\n\t  if (!geometry.morphNormals) geometry.morphNormals = [];\n\t  return shape;\n\t}\n\t\n\tfunction geometryFromBuffers(_ref) {\n\t  var positions = _ref.positions;\n\t  var normals = _ref.normals;\n\t  var indices = _ref.indices;\n\t  var colors = _ref.colors;\n\t\n\t  var geometry = new _three2.default.BufferGeometry();\n\t\n\t  geometry.addAttribute('position', new _three2.default.BufferAttribute(positions, 3));\n\t  geometry.addAttribute('normal', new _three2.default.BufferAttribute(normals, 3));\n\t\n\t  if (indices) {\n\t    geometry.addAttribute('index', new _three2.default.BufferAttribute(indices, 1));\n\t  }\n\t  if (colors) {\n\t    geometry.addAttribute('color', new _three2.default.BufferAttribute(colors, 1));\n\t  }\n\t\n\t  return geometry;\n\t}\n\t\n\t//import Hashes from 'jshashes'\n\tfunction meshTohash(mesh) {\n\t  //let SHA512 = new Hashes.SHA512\n\t  //geometry.vertices\n\t  /*for obj in meshLoader.loadMeshes(arg):\n\t    for mesh in obj._meshList:\n\t      hash.update(mesh.vertexes.tostring())*/\n\t\n\t  var modelHash = hash.hex();\n\t  return modelHash;\n\t}\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\texports.trim = trim;\n\texports.exists = exists;\n\texports.isEmpty = isEmpty;\n\texports.itemsEqual = itemsEqual;\n\texports.toArray = toArray;\n\texports.safeJSONParse = safeJSONParse;\n\texports.getExtension = getExtension;\n\texports.getNameAndExtension = getNameAndExtension;\n\texports.isValidFile = isValidFile;\n\texports.generateUUID = generateUUID;\n\tfunction trim(string) {\n\t  return String(string).replace(/^\\s+|\\s+$/g, '');\n\t}\n\t\n\tfunction exists(input) {\n\t  return input !== null && input !== undefined;\n\t}\n\t\n\t//utiity to determine if a string is empty, null, or full of whitespaces\n\tfunction isEmpty(str) {\n\t  if (!(typeof str === \"string\")) return false; //UUUGH bad way of checking not a string\n\t  return !str || /^\\s*$/.test(str) || str.length === 0 || !str.trim();\n\t}\n\t\n\tfunction itemsEqual(a, b) {\n\t  //perhaps an immutable library would not require such horrors?\n\t  if (JSON.stringify(a) === JSON.stringify(b)) {\n\t    return true;\n\t  }\n\t  return false;\n\t}\n\t\n\t/*converts input data to array if it is not already an array*/\n\tfunction toArray(data) {\n\t  if (!data) return [];\n\t  if (data.constructor !== Array) return [data];\n\t  return data;\n\t}\n\t\n\t/* JSON parse that always returns an object*/\n\tfunction safeJSONParse(str) {\n\t  try {\n\t    return JSON.parse(str) || {}; //from cycle.js\n\t  } catch (error) {\n\t    throw new Error(\"Error parsing data\", JSON.stringify(str));\n\t  }\n\t}\n\t\n\t//file utils ??\n\tfunction getExtension(fname) {\n\t  return fname.substr((~ -fname.lastIndexOf(\".\") >>> 0) + 2).toLowerCase();\n\t}\n\t\n\tfunction getNameAndExtension(uri) {\n\t  var _uriElems = uri.split(\"?\");\n\t  var name = _uriElems.shift().split(\"/\").pop();\n\t  var ext = getExtension(uri);\n\t  return { name: name, ext: ext };\n\t}\n\t\n\tfunction isValidFile(file) {\n\t  return typeof file !== \"undefined\" && file !== null && file instanceof File;\n\t}\n\t\n\t//TODO: taken from three.js ,do correct attribution\n\tfunction generateUUID() {\n\t\n\t  // http://www.broofa.com/Tools/Math.uuid.htm\n\t\n\t  var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');\n\t  var uuid = new Array(36);\n\t  var rnd = 0,\n\t      r = undefined;\n\t\n\t  return (function () {\n\t\n\t    for (var i = 0; i < 36; i++) {\n\t\n\t      if (i == 8 || i == 13 || i == 18 || i == 23) {\n\t\n\t        uuid[i] = '-';\n\t      } else if (i == 14) {\n\t\n\t        uuid[i] = '4';\n\t      } else {\n\t\n\t        if (rnd <= 0x02) rnd = 0x2000000 + Math.random() * 0x1000000 | 0;\n\t        r = rnd & 0xf;\n\t        rnd = rnd >> 4;\n\t        uuid[i] = chars[i == 19 ? r & 0x3 | 0x8 : r];\n\t      }\n\t    }\n\t    return uuid.join('');\n\t  })();\n\t}\n\n/***/ },\n/* 25 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\t\n\tvar _three = __webpack_require__(1);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\t/*TODO:\n\t - refactor\n\t - use label helper\n\t*/\n\t\n\tvar LabeledGrid = (function (_THREE$Object3D) {\n\t  _inherits(LabeledGrid, _THREE$Object3D);\n\t\n\t  function LabeledGrid() {\n\t    var width = arguments.length <= 0 || arguments[0] === undefined ? 200 : arguments[0];\n\t    var length = arguments.length <= 1 || arguments[1] === undefined ? 200 : arguments[1];\n\t    var step = arguments.length <= 2 || arguments[2] === undefined ? 100 : arguments[2];\n\t    var upVector = arguments.length <= 3 || arguments[3] === undefined ? [0, 1, 0] : arguments[3];\n\t    var color = arguments.length <= 4 || arguments[4] === undefined ? 0x00baff : arguments[4];\n\t    var opacity = arguments.length <= 5 || arguments[5] === undefined ? 0.2 : arguments[5];\n\t    var text = arguments.length <= 6 || arguments[6] === undefined ? true : arguments[6];\n\t    var textColor = arguments.length <= 7 || arguments[7] === undefined ? \"#000000\" : arguments[7];\n\t    var textLocation = arguments.length <= 8 || arguments[8] === undefined ? \"center\" : arguments[8];\n\t\n\t    _classCallCheck(this, LabeledGrid);\n\t\n\t    var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(LabeledGrid).call(this));\n\t\n\t    _this.width = width;\n\t    _this.length = length;\n\t    _this.step = step;\n\t    _this.color = color;\n\t    _this.opacity = opacity;\n\t    _this.text = text;\n\t    _this.textColor = textColor;\n\t    _this.textLocation = textLocation;\n\t    _this.upVector = new _three2.default.Vector3().fromArray(upVector);\n\t\n\t    _this.name = \"grid\";\n\t\n\t    //TODO: clean this up\n\t    _this.marginSize = 10;\n\t    _this.stepSubDivisions = 10;\n\t\n\t    _this._drawGrid();\n\t\n\t    //default grid orientation is z up, rotate if not the case\n\t    var upVector = _this.upVector;\n\t    _this.up = upVector;\n\t    _this.lookAt(upVector);\n\t    return _this;\n\t  }\n\t\n\t  _createClass(LabeledGrid, [{\n\t    key: \"_drawGrid\",\n\t    value: function _drawGrid() {\n\t      var gridGeometry, gridMaterial, mainGridZ, planeFragmentShader, planeGeometry, planeMaterial, subGridGeometry, subGridMaterial, subGridZ;\n\t\n\t      //offset to avoid z fighting\n\t      mainGridZ = -0.05;\n\t      gridGeometry = new _three2.default.Geometry();\n\t      gridMaterial = new _three2.default.LineBasicMaterial({\n\t        color: new _three2.default.Color().setHex(this.color),\n\t        opacity: this.opacity,\n\t        linewidth: 2,\n\t        transparent: true\n\t      });\n\t\n\t      subGridZ = -0.05;\n\t      subGridGeometry = new _three2.default.Geometry();\n\t      subGridMaterial = new _three2.default.LineBasicMaterial({\n\t        color: new _three2.default.Color().setHex(this.color),\n\t        opacity: this.opacity / 2,\n\t        transparent: true\n\t      });\n\t\n\t      var step = this.step;\n\t      var stepSubDivisions = this.stepSubDivisions;\n\t      var width = this.width;\n\t      var length = this.length;\n\t\n\t      var centerBased = true;\n\t\n\t      if (centerBased) {\n\t        for (var i = 0; i <= width / 2; i += step / stepSubDivisions) {\n\t          subGridGeometry.vertices.push(new _three2.default.Vector3(-length / 2, i, subGridZ));\n\t          subGridGeometry.vertices.push(new _three2.default.Vector3(length / 2, i, subGridZ));\n\t\n\t          subGridGeometry.vertices.push(new _three2.default.Vector3(-length / 2, -i, subGridZ));\n\t          subGridGeometry.vertices.push(new _three2.default.Vector3(length / 2, -i, subGridZ));\n\t\n\t          if (i % step == 0) {\n\t            gridGeometry.vertices.push(new _three2.default.Vector3(-length / 2, i, mainGridZ));\n\t            gridGeometry.vertices.push(new _three2.default.Vector3(length / 2, i, mainGridZ));\n\t\n\t            gridGeometry.vertices.push(new _three2.default.Vector3(-length / 2, -i, mainGridZ));\n\t            gridGeometry.vertices.push(new _three2.default.Vector3(length / 2, -i, mainGridZ));\n\t          }\n\t        }\n\t        for (var i = 0; i <= length / 2; i += step / stepSubDivisions) {\n\t          subGridGeometry.vertices.push(new _three2.default.Vector3(i, -width / 2, subGridZ));\n\t          subGridGeometry.vertices.push(new _three2.default.Vector3(i, width / 2, subGridZ));\n\t\n\t          subGridGeometry.vertices.push(new _three2.default.Vector3(-i, -width / 2, subGridZ));\n\t          subGridGeometry.vertices.push(new _three2.default.Vector3(-i, width / 2, subGridZ));\n\t\n\t          if (i % step == 0) {\n\t            gridGeometry.vertices.push(new _three2.default.Vector3(i, -width / 2, mainGridZ));\n\t            gridGeometry.vertices.push(new _three2.default.Vector3(i, width / 2, mainGridZ));\n\t\n\t            gridGeometry.vertices.push(new _three2.default.Vector3(-i, -width / 2, mainGridZ));\n\t            gridGeometry.vertices.push(new _three2.default.Vector3(-i, width / 2, mainGridZ));\n\t          }\n\t        }\n\t      } else {\n\t        for (var i = -width / 2; i <= width / 2; i += step / stepSubDivisions) {\n\t          subGridGeometry.vertices.push(new _three2.default.Vector3(-length / 2, i, subGridZ));\n\t          subGridGeometry.vertices.push(new _three2.default.Vector3(length / 2, i, subGridZ));\n\t\n\t          if (i % step == 0) {\n\t            gridGeometry.vertices.push(new _three2.default.Vector3(-length / 2, i, mainGridZ));\n\t            gridGeometry.vertices.push(new _three2.default.Vector3(length / 2, i, mainGridZ));\n\t          }\n\t        }\n\t        for (var i = -length / 2; i <= length / 2; i += step / stepSubDivisions) {\n\t          subGridGeometry.vertices.push(new _three2.default.Vector3(i, -width / 2, subGridZ));\n\t          subGridGeometry.vertices.push(new _three2.default.Vector3(i, width / 2, subGridZ));\n\t\n\t          if (i % step == 0) {\n\t            gridGeometry.vertices.push(new _three2.default.Vector3(i, -width / 2, mainGridZ));\n\t            gridGeometry.vertices.push(new _three2.default.Vector3(i, width / 2, mainGridZ));\n\t          }\n\t        }\n\t      }\n\t\n\t      this.mainGrid = new _three2.default.Line(gridGeometry, gridMaterial, _three2.default.LinePieces);\n\t      //create sub grid geometry object\n\t      this.subGrid = new _three2.default.Line(subGridGeometry, subGridMaterial, _three2.default.LinePieces);\n\t\n\t      //create margin\n\t      var offsetWidth = width + this.marginSize;\n\t      var offsetLength = length + this.marginSize;\n\t\n\t      var marginGeometry = new _three2.default.Geometry();\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(-length / 2, -width / 2, subGridZ));\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(length / 2, -width / 2, subGridZ));\n\t\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(length / 2, -width / 2, subGridZ));\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(length / 2, width / 2, subGridZ));\n\t\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(length / 2, width / 2, subGridZ));\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(-length / 2, width / 2, subGridZ));\n\t\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(-length / 2, width / 2, subGridZ));\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(-length / 2, -width / 2, subGridZ));\n\t\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(-offsetLength / 2, -offsetWidth / 2, subGridZ));\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(offsetLength / 2, -offsetWidth / 2, subGridZ));\n\t\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(offsetLength / 2, -offsetWidth / 2, subGridZ));\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(offsetLength / 2, offsetWidth / 2, subGridZ));\n\t\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(offsetLength / 2, offsetWidth / 2, subGridZ));\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(-offsetLength / 2, offsetWidth / 2, subGridZ));\n\t\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(-offsetLength / 2, offsetWidth / 2, subGridZ));\n\t      marginGeometry.vertices.push(new _three2.default.Vector3(-offsetLength / 2, -offsetWidth / 2, subGridZ));\n\t\n\t      var strongGridMaterial = new _three2.default.LineBasicMaterial({\n\t        color: new _three2.default.Color().setHex(this.color),\n\t        opacity: this.opacity * 2,\n\t        linewidth: 2,\n\t        transparent: true\n\t      });\n\t      this.margin = new _three2.default.Line(marginGeometry, strongGridMaterial, _three2.default.LinePieces);\n\t\n\t      //add all grids, subgrids, margins etc\n\t      this.add(this.mainGrid);\n\t      this.add(this.subGrid);\n\t      this.add(this.margin);\n\t\n\t      this._drawNumbering();\n\t    }\n\t  }, {\n\t    key: \"toggle\",\n\t    value: function toggle(_toggle) {\n\t      //apply visibility settings to all children\n\t      this.traverse(function (child) {\n\t        child.visible = _toggle;\n\t      });\n\t    }\n\t  }, {\n\t    key: \"setOpacity\",\n\t    value: function setOpacity(opacity) {\n\t      this.opacity = opacity;\n\t      this.mainGrid.material.opacity = opacity;\n\t      this.subGrid.material.opacity = opacity / 2;\n\t      this.margin.material.opacity = opacity * 2;\n\t    }\n\t  }, {\n\t    key: \"setColor\",\n\t    value: function setColor(color) {\n\t      this.color = color;\n\t      this.mainGrid.material.color = new _three2.default.Color().setHex(this.color);\n\t      this.subGrid.material.color = new _three2.default.Color().setHex(this.color);\n\t      this.margin.material.color = new _three2.default.Color().setHex(this.color);\n\t    }\n\t  }, {\n\t    key: \"toggleText\",\n\t    value: function toggleText(toggle) {\n\t      this.text = toggle;\n\t      var labels = this.labels.children;\n\t      for (var i = 0; i < this.labels.children.length; i++) {\n\t        var label = labels[i];\n\t        label.visible = toggle;\n\t      }\n\t    }\n\t  }, {\n\t    key: \"setTextColor\",\n\t    value: function setTextColor(color) {\n\t      this.textColor = color;\n\t      this._drawNumbering();\n\t    }\n\t  }, {\n\t    key: \"setTextLocation\",\n\t    value: function setTextLocation(location) {\n\t      this.textLocation = location;\n\t      return this._drawNumbering();\n\t    }\n\t  }, {\n\t    key: \"setUp\",\n\t    value: function setUp(upVector) {\n\t      this.upVector = upVector;\n\t      this.up = upVector;\n\t      this.lookAt(upVector);\n\t    }\n\t  }, {\n\t    key: \"resize\",\n\t    value: function resize(width, length) {\n\t      if (width && length) {\n\t        var width = Math.max(width, 10);\n\t        this.width = width;\n\t\n\t        var length = Math.max(length, 10);\n\t        this.length = length;\n\t\n\t        this.step = Math.max(this.step, 5);\n\t\n\t        this.remove(this.mainGrid);\n\t        this.remove(this.subGrid);\n\t        this.remove(this.margin);\n\t        //this.remove(this.plane);\n\t        return this._drawGrid();\n\t      }\n\t    }\n\t  }, {\n\t    key: \"_drawNumbering\",\n\t    value: function _drawNumbering() {\n\t      var label, sizeLabel, sizeLabel2, xLabelsLeft, xLabelsRight, yLabelsBack, yLabelsFront;\n\t      var step = this.step;\n\t\n\t      this._labelStore = {};\n\t\n\t      if (this.labels != null) {\n\t        this.mainGrid.remove(this.labels);\n\t      }\n\t      this.labels = new _three2.default.Object3D();\n\t\n\t      var width = this.width;\n\t      var length = this.length;\n\t      var numbering = this.numbering = \"centerBased\";\n\t\n\t      var labelsFront = new _three2.default.Object3D();\n\t      var labelsSideRight = new _three2.default.Object3D();\n\t\n\t      if (numbering == \"centerBased\") {\n\t        for (var i = 0; i <= width / 2; i += step) {\n\t          var sizeLabel = this.drawTextOnPlane(\"\" + i, 32);\n\t          var sizeLabel2 = sizeLabel.clone();\n\t\n\t          sizeLabel.position.set(length / 2, -i, 0.1);\n\t          sizeLabel.rotation.z = -Math.PI / 2;\n\t          labelsFront.add(sizeLabel);\n\t\n\t          sizeLabel2.position.set(length / 2, i, 0.1);\n\t          sizeLabel2.rotation.z = -Math.PI / 2;\n\t          labelsFront.add(sizeLabel2);\n\t        }\n\t\n\t        for (var i = 0; i <= length / 2; i += step) {\n\t          var sizeLabel = this.drawTextOnPlane(\"\" + i, 32);\n\t          var sizeLabel2 = sizeLabel.clone();\n\t\n\t          sizeLabel.position.set(-i, width / 2, 0.1);\n\t          //sizeLabel.rotation.z = -Math.PI / 2;\n\t          labelsSideRight.add(sizeLabel);\n\t\n\t          sizeLabel2.position.set(i, width / 2, 0.1);\n\t          //sizeLabel2.rotation.z = -Math.PI / 2;\n\t          labelsSideRight.add(sizeLabel2);\n\t        }\n\t\n\t        var labelsSideLeft = labelsSideRight.clone();\n\t        labelsSideLeft.rotation.z = -Math.PI;\n\t        //labelsSideLeft = labelsSideRight.clone().translateY(- width );\n\t\n\t        var labelsBack = labelsFront.clone();\n\t        labelsBack.rotation.z = -Math.PI;\n\t      }\n\t\n\t      /*if (this.textLocation === \"center\") {\n\t        yLabelsRight.translateY(- length/ 2);\n\t        xLabelsFront.translateX(- width / 2);\n\t      } else {\n\t        yLabelsLeft = yLabelsRight.clone().translateY( -width );\n\t        xLabelsBack = xLabelsFront.clone().translateX( -length );\n\t        \n\t        this.labels.add( yLabelsLeft );\n\t        this.labels.add( xLabelsBack) ;\n\t      }*/\n\t      //this.labels.add( yLabelsRight );\n\t      this.labels.add(labelsFront);\n\t      this.labels.add(labelsBack);\n\t\n\t      this.labels.add(labelsSideRight);\n\t      this.labels.add(labelsSideLeft);\n\t\n\t      //apply visibility settings to all labels\n\t      var textVisible = this.text;\n\t      this.labels.traverse(function (child) {\n\t        child.visible = textVisible;\n\t      });\n\t\n\t      this.mainGrid.add(this.labels);\n\t    }\n\t  }, {\n\t    key: \"drawTextOnPlane\",\n\t    value: function drawTextOnPlane(text, size) {\n\t      var canvas, context, material, plane, texture;\n\t\n\t      if (size == null) {\n\t        size = 256;\n\t      }\n\t\n\t      if (document) {\n\t        canvas = document.createElement('canvas');\n\t      } else {\n\t        canvas = {};\n\t      }\n\t\n\t      var size = 128;\n\t      canvas.width = size;\n\t      canvas.height = size;\n\t      context = canvas.getContext('2d');\n\t      context.font = \"18px sans-serif\";\n\t      context.textAlign = 'center';\n\t      context.fillStyle = this.textColor;\n\t      context.fillText(text, canvas.width / 2, canvas.height / 2);\n\t      context.strokeStyle = this.textColor;\n\t      context.strokeText(text, canvas.width / 2, canvas.height / 2);\n\t\n\t      texture = new _three2.default.Texture(canvas);\n\t      texture.needsUpdate = true;\n\t      texture.generateMipmaps = true;\n\t      texture.magFilter = _three2.default.LinearFilter;\n\t      texture.minFilter = _three2.default.LinearFilter;\n\t\n\t      material = new _three2.default.MeshBasicMaterial({\n\t        map: texture,\n\t        transparent: true,\n\t        color: 0xffffff,\n\t        alphaTest: 0.3\n\t      });\n\t      plane = new _three2.default.Mesh(new _three2.default.PlaneBufferGeometry(size / 8, size / 8), material);\n\t      plane.doubleSided = true;\n\t      plane.overdraw = true;\n\t\n\t      return plane;\n\t    }\n\t  }]);\n\t\n\t  return LabeledGrid;\n\t})(_three2.default.Object3D);\n\t\n\t//autoresize, disabled for now\n\t/*\n\tupdateGridSize() {\n\t      var max, maxX, maxY, min, minX, minY, size, subchild, _getBounds, _i, _len, _ref,\n\t        _this = this;\n\t      minX = 99999;\n\t      maxX = -99999;\n\t      minY = 99999;\n\t      maxY = -99999;\n\t      _getBounds = function(mesh) {\n\t        var bBox, subchild, _i, _len, _ref, _results;\n\t        if (mesh instanceof THREE.Mesh) {\n\t          mesh.geometry.computeBoundingBox();\n\t          bBox = mesh.geometry.boundingBox;\n\t          minX = Math.min(minX, bBox.min.x);\n\t          maxX = Math.max(maxX, bBox.max.x);\n\t          minY = Math.min(minY, bBox.min.y);\n\t          maxY = Math.max(maxY, bBox.max.y);\n\t          _ref = mesh.children;\n\t          _results = [];\n\t          for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n\t            subchild = _ref[_i];\n\t            _results.push(_getBounds(subchild));\n\t          }\n\t          return _results;\n\t        }\n\t      };\n\t      if (this.rootAssembly != null) {\n\t        _ref = this.rootAssembly.children;\n\t        for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n\t          subchild = _ref[_i];\n\t          if (subchild.name !== \"renderSubs\" && subchild.name !== \"connectors\") {\n\t            _getBounds(subchild);\n\t          }\n\t        }\n\t      }\n\t      max = Math.max(Math.max(maxX, maxY), 100);\n\t      min = Math.min(Math.min(minX, minY), -100);\n\t      size = (Math.max(max, Math.abs(min))) * 2;\n\t      size = Math.ceil(size / 10) * 10;\n\t      if (size >= 200) {\n\t        return this.resize(size);\n\t      }\n\t};\n\t*/\n\t\n\texports.default = LabeledGrid;\n\n/***/ },\n/* 26 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar require;var require;/*** IMPORTS FROM imports-loader ***/\n\tvar Rx = __webpack_require__(2);\n\t\n\t(function(f){if(true){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.objParser = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n\t// shim for using process in browser\n\t\n\tvar process = module.exports = {};\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\t\n\tfunction cleanUpNextTick() {\n\t    draining = false;\n\t    if (currentQueue.length) {\n\t        queue = currentQueue.concat(queue);\n\t    } else {\n\t        queueIndex = -1;\n\t    }\n\t    if (queue.length) {\n\t        drainQueue();\n\t    }\n\t}\n\t\n\tfunction drainQueue() {\n\t    if (draining) {\n\t        return;\n\t    }\n\t    var timeout = setTimeout(cleanUpNextTick);\n\t    draining = true;\n\t\n\t    var len = queue.length;\n\t    while(len) {\n\t        currentQueue = queue;\n\t        queue = [];\n\t        while (++queueIndex < len) {\n\t            if (currentQueue) {\n\t                currentQueue[queueIndex].run();\n\t            }\n\t        }\n\t        queueIndex = -1;\n\t        len = queue.length;\n\t    }\n\t    currentQueue = null;\n\t    draining = false;\n\t    clearTimeout(timeout);\n\t}\n\t\n\tprocess.nextTick = function (fun) {\n\t    var args = new Array(arguments.length - 1);\n\t    if (arguments.length > 1) {\n\t        for (var i = 1; i < arguments.length; i++) {\n\t            args[i - 1] = arguments[i];\n\t        }\n\t    }\n\t    queue.push(new Item(fun, args));\n\t    if (queue.length === 1 && !draining) {\n\t        setTimeout(drainQueue, 0);\n\t    }\n\t};\n\t\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t    this.fun = fun;\n\t    this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t    this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\t\n\tfunction noop() {}\n\t\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\t\n\tprocess.binding = function (name) {\n\t    throw new Error('process.binding is not supported');\n\t};\n\t\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t    throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\t\n\t},{}],2:[function(require,module,exports){\n\t(function (process){\n\t(function () {\n\t  // Hueristics.\n\t  var isNode = typeof process !== 'undefined' && process.versions && !!process.versions.node;\n\t  var isBrowser = typeof window !== 'undefined';\n\t  var isModule = typeof module !== 'undefined' && !!module.exports;\n\t\n\t  // Export.\n\t  var detect = (isModule ? exports : (this.detect = {}));\n\t  detect.isNode = isNode;\n\t  detect.isBrowser = isBrowser;\n\t  detect.isModule = isModule;\n\t}).call(this);\n\t}).call(this,require('_process'))\n\t},{\"_process\":1}],3:[function(require,module,exports){\n\t'use strict';\n\t\n\t/**\n\t * Analogue of Object.assign().\n\t * Copies properties from one or more source objects to\n\t * a target object. Existing keys on the target object will be overwritten.\n\t *\n\t * > Note: This differs from spec in some important ways:\n\t * > 1. Will throw if passed non-objects, including `undefined` or `null` values.\n\t * > 2. Does not support the curious Exception handling behavior, exceptions are thrown immediately.\n\t * > For more details, see:\n\t * > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t *\n\t *\n\t *\n\t * @param  {Object} target      The target object to copy properties to.\n\t * @param  {Object} source, ... The source(s) to copy properties from.\n\t * @return {Object}             The updated target object.\n\t */\n\tmodule.exports = function fastAssign (target) {\n\t  var totalArgs = arguments.length,\n\t      source, i, totalKeys, keys, key, j;\n\t\n\t  for (i = 1; i < totalArgs; i++) {\n\t    source = arguments[i];\n\t    keys = Object.keys(source);\n\t    totalKeys = keys.length;\n\t    for (j = 0; j < totalKeys; j++) {\n\t      key = keys[j];\n\t      target[key] = source[key];\n\t    }\n\t  }\n\t  return target;\n\t};\n\t\n\t},{}],4:[function(require,module,exports){\n\t(function (global){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\texports.inputDataType = exports.outputs = undefined;\n\texports.default = parse;\n\t\n\tvar _compositeDetect = require('composite-detect');\n\t\n\tvar _compositeDetect2 = _interopRequireDefault(_compositeDetect);\n\t\n\tvar _assign = require('fast.js/object/assign');\n\t\n\tvar _assign2 = _interopRequireDefault(_assign);\n\t\n\tvar _rx = typeof window !== \"undefined\" ? window['Rx'] : typeof global !== \"undefined\" ? global['Rx'] : null;\n\t\n\tvar _rx2 = _interopRequireDefault(_rx);\n\t\n\tvar _obj = require('./obj');\n\t\n\tvar _obj2 = _interopRequireDefault(_obj);\n\t\n\tvar _parseHelpers = require('./parseHelpers');\n\t\n\tfunction _interopRequireDefault(obj) {\n\t  return obj && obj.__esModule ? obj : { default: obj };\n\t}\n\t\n\tvar outputs = exports.outputs = [\"geometry\"]; //to be able to auto determine data type(s) fetched by parser\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author kaosat-dev\n\t */\n\t\n\tvar inputDataType = exports.inputDataType = \"arrayBuffer\"; //to be able to set required input data type\n\t\n\tfunction parse(data) {\n\t  var parameters = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\t\n\t  var defaults = {\n\t    useWorker: _compositeDetect2.default.isBrowser === true,\n\t    offsets: [0]\n\t  };\n\t  parameters = (0, _assign2.default)({}, defaults, parameters);\n\t\n\t  var _parameters = parameters;\n\t  var useWorker = _parameters.useWorker;\n\t  var offsets = _parameters.offsets;\n\t\n\t  var obs = new _rx2.default.ReplaySubject(1);\n\t\n\t  if (useWorker) {\n\t    (function () {\n\t      var worker = new Worker(window.URL.createObjectURL(new Blob(['(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error(\"Cannot find module \\'\"+o+\"\\'\")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\\n\"use strict\";\\n\\nObject.defineProperty(exports, \"__esModule\", {\\n\\tvalue: true\\n});\\nvar OBJ = function OBJ() {};\\n\\nOBJ.prototype = {\\n\\tconstructor: OBJ\\n};\\n\\nOBJ.prototype.parseIndex = function (index, type) {\\n\\n\\tindex = parseInt(index);\\n\\tvar dataArray = this.currentObject._attributes[type];\\n\\n\\treturn index >= 0 ? index - 1 : index + dataArray.length;\\n};\\n\\nOBJ.prototype._handle_face_line = function (rawData, rIndices, indices, type) {\\n\\tvar data = [];\\n\\n\\tvar tmpIdx = [];\\n\\tfor (var i = 0; i < rIndices.length; i++) {\\n\\t\\tvar idx = rIndices[i];\\n\\t\\t//console.log(data[ idx ]);\\n\\t\\t//data.push( parseInt( rawData[ idx] ) );\\n\\t\\tdata.push(this.parseIndex(rawData[idx], type));\\n\\t}\\n\\n\\tif (isNaN(data[3])) {\\n\\t\\tindices.push(data[0], data[1], data[2]);\\n\\t\\t//indices.push( this.parseIndex( data[ 0 ], type) , this.parseIndex( data[ 1 ], type) , this.parseIndex( data[ 2 ], type) );\\n\\t} else {\\n\\t\\t\\tindices.push(data[0], data[1], data[3], data[1], data[2], data[3]);\\n\\t\\t}\\n};\\n\\nOBJ.prototype._newObject = function () {\\n\\tvar currentObject = {};\\n\\tcurrentObject._attributes = {};\\n\\tcurrentObject._attributes[\"position\"] = [];\\n\\tcurrentObject._attributes[\"normal\"] = [];\\n\\tcurrentObject._attributes[\"uv\"] = [];\\n\\tcurrentObject._attributes[\"indices\"] = [];\\n\\tcurrentObject.faceCount = 0;\\n\\treturn currentObject;\\n};\\n\\nOBJ.prototype.getData = function (text) {\\n\\tvar vertex_pattern = /v( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)/;\\n\\t// vn float float float\\n\\tvar normal_pattern = /vn( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)/;\\n\\t// vt float float\\n\\tvar uv_pattern = /vt( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)/;\\n\\t// f vertex vertex vertex ...\\n\\tvar face_pattern1 = /f( +\\\\d+)( +\\\\d+)( +\\\\d+)( +\\\\d+)?/;\\n\\t// f vertex/uv vertex/uv vertex/uv ...\\n\\tvar face_pattern2 = /f( +(\\\\d+)\\\\/(\\\\d+))( +(\\\\d+)\\\\/(\\\\d+))( +(\\\\d+)\\\\/(\\\\d+))( +(\\\\d+)\\\\/(\\\\d+))?/;\\n\\t// f vertex/uv/normal vertex/uv/normal vertex/uv/normal ...\\n\\tvar face_pattern3 = /f( +(\\\\d+)\\\\/(\\\\d+)\\\\/(\\\\d+))( +(\\\\d+)\\\\/(\\\\d+)\\\\/(\\\\d+))( +(\\\\d+)\\\\/(\\\\d+)\\\\/(\\\\d+))( +(\\\\d+)\\\\/(\\\\d+)\\\\/(\\\\d+))?/;\\n\\t// f vertex//normal vertex//normal vertex//normal ...\\n\\tvar face_pattern4 = /f( +(\\\\d+)\\\\/\\\\/(\\\\d+))( +(\\\\d+)\\\\/\\\\/(\\\\d+))( +(\\\\d+)\\\\/\\\\/(\\\\d+))( +(\\\\d+)\\\\/\\\\/(\\\\d+))?/;\\n\\n\\ttext = text.replace(/\\\\\\\\\\\\r\\\\n/g, \\'\\'); // handles line continuations\\n\\tvar lines = text.split(\\'\\\\n\\');\\n\\n\\tvar vertices = [];\\n\\tvar normals = [];\\n\\tvar uvs = [];\\n\\tvar indices = [];\\n\\tvar normIndices = [];\\n\\tvar uvIndices = [];\\n\\n\\tvar faceCount = 0;\\n\\tvar face_offset = 0;\\n\\n\\tvar defaultNormal = [1, 1, 1];\\n\\tvar defaultUv = [0, 0];\\n\\n\\tvar objects = [];\\n\\tvar textures = {};\\n\\tvar materials = {};\\n\\n\\tvar currentObject = this._newObject();\\n\\tthis.currentObject = currentObject;\\n\\tvar currentMaterial = {};\\n\\n\\tvertices = currentObject._attributes[\"position\"];\\n\\tnormals = currentObject._attributes[\"normal\"];\\n\\tuvs = currentObject._attributes[\"uv\"];\\n\\tindices = currentObject._attributes[\"indices\"];\\n\\n\\tfor (var i = 0; i < lines.length; i++) {\\n\\t\\tvar line = lines[i];\\n\\t\\tline = line.trim().toLowerCase(); //needed because of some \"exponent\" values in upper case\\n\\t\\tvar result;\\n\\n\\t\\t//console.log(line);\\n\\n\\t\\tif (line.length === 0 || line.charAt(0) === \\'#\\') {\\n\\t\\t\\tcontinue;\\n\\t\\t} else if ((result = vertex_pattern.exec(line)) !== null) {\\n\\t\\t\\t// [\"v 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\\n\\t\\t\\tvertices.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]));\\n\\t\\t} else if ((result = normal_pattern.exec(line)) !== null) {\\n\\t\\t\\t// [\"vn 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\\n\\t\\t\\tnormals.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]));\\n\\t\\t} else if ((result = uv_pattern.exec(line)) !== null) {\\n\\t\\t\\t// [\"vt 0.1 0.2\", \"0.1\", \"0.2\"]\\n\\t\\t\\tuvs.push(parseFloat(result[1]), parseFloat(result[2]));\\n\\t\\t} else if ((result = face_pattern1.exec(line)) !== null) {\\n\\t\\t\\t// [\"f 1 2 3\", \"1\", \"2\", \"3\", undefined]\\n\\t\\t\\t//console.log(\"result v1\");\\n\\t\\t\\tthis._handle_face_line(result, [1, 2, 3, 4], indices, \"position\");\\n\\t\\t\\t//faces, uvs, normals_inds, geometry,face_offset, normals, uvs\\n\\t\\t} else if ((result = face_pattern2.exec(line)) !== null) {\\n\\t\\t\\t\\t// [\"f 1/1 2/2 3/3\", \" 1/1\", \"1\", \"1\", \" 2/2\", \"2\", \"2\", \" 3/3\", \"3\", \"3\", undefined, undefined, undefined]\\n\\t\\t\\t\\t//console.log(\"result v2\");\\n\\t\\t\\t\\tthis._handle_face_line(result, [2, 5, 8, 11], indices, \"position\"); //2,5,8,11//possible winding order change of for some stuff11,8,5,2\\n\\t\\t\\t\\tthis._handle_face_line(result, [3, 6, 9, 12], uvIndices, \"uv\");\\n\\t\\t\\t} else if ((result = face_pattern3.exec(line)) !== null) {\\n\\t\\t\\t\\t// [\"f 1/1/1 2/2/2 3/3/3\", \" 1/1/1\", \"1\", \"1\", \"1\", \" 2/2/2\", \"2\", \"2\", \"2\", \" 3/3/3\", \"3\", \"3\", \"3\", undefined, undefined, undefined, undefined]\\n\\t\\t\\t\\t//console.log(\"result v3\");\\n\\t\\t\\t\\t//result[ 2 ], result[ 6 ], result[ 10 ], result[ 14 ]\\n\\t\\t\\t\\tthis._handle_face_line(result, [2, 6, 10, 14], indices, \"position\"); //2,6,10,14\\n\\t\\t\\t\\tthis._handle_face_line(result, [4, 8, 12, 16], normIndices, \"normal\");\\n\\t\\t\\t\\tthis._handle_face_line(result, [3, 7, 11, 15], uvIndices, \"uv\");\\n\\t\\t\\t} else if ((result = face_pattern4.exec(line)) !== null) {\\n\\t\\t\\t\\t//console.log(\"result v4\");\\n\\t\\t\\t\\t// [\"f 1//1 2//2 3//3\", \" 1//1\", \"1\", \"1\", \" 2//2\", \"2\", \"2\", \" 3//3\", \"3\", \"3\", undefined, undefined, undefined]\\n\\t\\t\\t\\tthis._handle_face_line(result, [2, 5, 8, 11], indices, \"position\");\\n\\t\\t\\t\\tthis._handle_face_line(result, [3, 6, 9, 12], normIndices, \"normal\");\\n\\t\\t\\t} else if (/^o /.test(line)) {\\n\\t\\t\\t\\t// object\\n\\t\\t\\t\\t//console.log(\"object\")\\n\\t\\t\\t\\tif (currentObject) {\\n\\t\\t\\t\\t\\t//if (!(geometry === undefined)) {\\n\\t\\t\\t\\t\\tface_offset = face_offset + vertices.length;\\n\\n\\t\\t\\t\\t\\t//console.log(\"oldobject\")\\n\\t\\t\\t\\t\\t//console.log( currentObject)\\n\\t\\t\\t\\t\\tcurrentObject.faceCount = indices.length;\\n\\n\\t\\t\\t\\t\\t//reset all for next object\\n\\t\\t\\t\\t\\tcurrentObject = this._newObject();\\n\\t\\t\\t\\t\\tcurrentObject.name = line.substring(2).trim();\\n\\t\\t\\t\\t\\tvertices = currentObject._attributes[\"position\"];\\n\\t\\t\\t\\t\\tnormals = currentObject._attributes[\"normal\"];\\n\\t\\t\\t\\t\\tuvs = currentObject._attributes[\"uv\"];\\n\\t\\t\\t\\t\\tindices = currentObject._attributes[\"indices\"];\\n\\t\\t\\t\\t\\tnormIndices = currentObject._attributes[\"normIndices\"];\\n\\t\\t\\t\\t\\tuvIndices = currentObject._attributes[\"uvIndices\"];\\n\\n\\t\\t\\t\\t\\tobjects.push(currentObject);\\n\\t\\t\\t\\t}\\n\\t\\t\\t} else if (/^g /.test(line)) {\\n\\t\\t\\t\\t// group\\n\\t\\t\\t\\t//console.log(\"group\");\\n\\t\\t\\t} else if (/^usemtl /.test(line)) {\\n\\t\\t\\t\\t\\t// material\\n\\t\\t\\t\\t\\tcurrentMaterial.name = line.substring(7).trim();\\n\\t\\t\\t\\t} else if (/^mtllib /.test(line)) {\\n\\t\\t\\t\\t\\t// mtl file\\n\\t\\t\\t\\t\\tcurrentMaterial = {};\\n\\t\\t\\t\\t} else if (/^s /.test(line)) {\\n\\t\\t\\t\\t\\t// smooth shading\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\t// console.log( \"OBJParser: Unhandled line \" + line );\\n\\t\\t\\t\\t\\t}\\n\\t}\\n\\n\\tif (objects.indexOf(currentObject) == -1) {\\n\\t\\tobjects.push(currentObject);\\n\\t}\\n\\tcurrentObject.faceCount = indices.length / 3;\\n\\n\\treturn {\\n\\t\\tobjects: objects\\n\\t};\\n};\\n\\n/*\\n  extracts data based on indices since obj has different indices for normals, uvs etc, while webgl does not\\n*/\\nOBJ.prototype._unindexData = function (object) {\\n\\tvar resultPositions = [];\\n\\tvar resultNormals = [];\\n\\tvar resultUv = [];\\n\\n\\tvar vertices = object._attributes[\"position\"];\\n\\tvar normals = object._attributes[\"normal\"];\\n\\tvar uvs = object._attributes[\"uv\"];\\n\\n\\tfor (var i = 0; i < object.indices.length; i++) {\\n\\t\\t//resultPositions.push( data. );\\n\\t}\\n};\\nexports.default = OBJ;\\n\\n},{}],2:[function(require,module,exports){\\n\\'use strict\\';\\n\\nvar _obj = require(\\'./obj\\');\\n\\nvar _obj2 = _interopRequireDefault(_obj);\\n\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\n\\nself.onmessage = function (event) {\\n\\n  var data = event.data;\\n  data = data.data;\\n\\n  var result = new _obj2.default().getData(data);\\n\\n  self.postMessage({ data: result });\\n  self.close();\\n};\\n\\n},{\"./obj\":1}]},{},[2])'], { type: \"text/javascript\" }))); //browserify\n\t\n\t      worker.onmessage = function (event) {\n\t        if (\"data\" in event.data) {\n\t          var data = event.data.data;\n\t          data.objects.forEach(function (modelData, index) {\n\t            obs.onNext({ progress: (index + 1) / Object.keys(data.objects).length, total: undefined });\n\t            obs.onNext((0, _parseHelpers.createModelBuffers)(modelData));\n\t          });\n\t          obs.onNext({ progress: 1, total: undefined });\n\t          obs.onCompleted();\n\t        } else if (\"progress\" in event.data) {\n\t          //console.log(\"got progress\", event.data.progress);\n\t          obs.onNext({ progress: event.data.progress, total: Math.NaN });\n\t        }\n\t      };\n\t      worker.onerror = function (event) {\n\t        obs.onError('filename:' + event.filename + ' lineno: ' + event.lineno + ' error: ' + event.message);\n\t      };\n\t      worker.postMessage({ data: data });\n\t      obs.catch(function (e) {\n\t        return worker.terminate();\n\t      });\n\t    })();\n\t  } else {\n\t    data = new _obj2.default().getData(data);\n\t\n\t    data.objects.forEach(function (modelData, index) {\n\t      obs.onNext({ progress: (index + 1) / Object.keys(data.objects).length, total: undefined });\n\t      obs.onNext((0, _parseHelpers.createModelBuffers)(modelData));\n\t    });\n\t\n\t    obs.onNext({ progress: 1, total: undefined });\n\t    obs.onCompleted();\n\t  }\n\t  return obs;\n\t}\n\t\n\t}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\t},{\"./obj\":5,\"./parseHelpers\":6,\"composite-detect\":2,\"fast.js/object/assign\":3}],5:[function(require,module,exports){\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t\tvalue: true\n\t});\n\tvar OBJ = function OBJ() {};\n\t\n\tOBJ.prototype = {\n\t\tconstructor: OBJ\n\t};\n\t\n\tOBJ.prototype.parseIndex = function (index, type) {\n\t\n\t\tindex = parseInt(index);\n\t\tvar dataArray = this.currentObject._attributes[type];\n\t\n\t\treturn index >= 0 ? index - 1 : index + dataArray.length;\n\t};\n\t\n\tOBJ.prototype._handle_face_line = function (rawData, rIndices, indices, type) {\n\t\tvar data = [];\n\t\n\t\tvar tmpIdx = [];\n\t\tfor (var i = 0; i < rIndices.length; i++) {\n\t\t\tvar idx = rIndices[i];\n\t\t\t//console.log(data[ idx ]);\n\t\t\t//data.push( parseInt( rawData[ idx] ) );\n\t\t\tdata.push(this.parseIndex(rawData[idx], type));\n\t\t}\n\t\n\t\tif (isNaN(data[3])) {\n\t\t\tindices.push(data[0], data[1], data[2]);\n\t\t\t//indices.push( this.parseIndex( data[ 0 ], type) , this.parseIndex( data[ 1 ], type) , this.parseIndex( data[ 2 ], type) );\n\t\t} else {\n\t\t\t\tindices.push(data[0], data[1], data[3], data[1], data[2], data[3]);\n\t\t\t}\n\t};\n\t\n\tOBJ.prototype._newObject = function () {\n\t\tvar currentObject = {};\n\t\tcurrentObject._attributes = {};\n\t\tcurrentObject._attributes[\"position\"] = [];\n\t\tcurrentObject._attributes[\"normal\"] = [];\n\t\tcurrentObject._attributes[\"uv\"] = [];\n\t\tcurrentObject._attributes[\"indices\"] = [];\n\t\tcurrentObject.faceCount = 0;\n\t\treturn currentObject;\n\t};\n\t\n\tOBJ.prototype.getData = function (text) {\n\t\tvar vertex_pattern = /v( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\t\t// vn float float float\n\t\tvar normal_pattern = /vn( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\t\t// vt float float\n\t\tvar uv_pattern = /vt( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\t\t// f vertex vertex vertex ...\n\t\tvar face_pattern1 = /f( +\\d+)( +\\d+)( +\\d+)( +\\d+)?/;\n\t\t// f vertex/uv vertex/uv vertex/uv ...\n\t\tvar face_pattern2 = /f( +(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+))?/;\n\t\t// f vertex/uv/normal vertex/uv/normal vertex/uv/normal ...\n\t\tvar face_pattern3 = /f( +(\\d+)\\/(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+)\\/(\\d+))?/;\n\t\t// f vertex//normal vertex//normal vertex//normal ...\n\t\tvar face_pattern4 = /f( +(\\d+)\\/\\/(\\d+))( +(\\d+)\\/\\/(\\d+))( +(\\d+)\\/\\/(\\d+))( +(\\d+)\\/\\/(\\d+))?/;\n\t\n\t\ttext = text.replace(/\\\\\\r\\n/g, ''); // handles line continuations\n\t\tvar lines = text.split('\\n');\n\t\n\t\tvar vertices = [];\n\t\tvar normals = [];\n\t\tvar uvs = [];\n\t\tvar indices = [];\n\t\tvar normIndices = [];\n\t\tvar uvIndices = [];\n\t\n\t\tvar faceCount = 0;\n\t\tvar face_offset = 0;\n\t\n\t\tvar defaultNormal = [1, 1, 1];\n\t\tvar defaultUv = [0, 0];\n\t\n\t\tvar objects = [];\n\t\tvar textures = {};\n\t\tvar materials = {};\n\t\n\t\tvar currentObject = this._newObject();\n\t\tthis.currentObject = currentObject;\n\t\tvar currentMaterial = {};\n\t\n\t\tvertices = currentObject._attributes[\"position\"];\n\t\tnormals = currentObject._attributes[\"normal\"];\n\t\tuvs = currentObject._attributes[\"uv\"];\n\t\tindices = currentObject._attributes[\"indices\"];\n\t\n\t\tfor (var i = 0; i < lines.length; i++) {\n\t\t\tvar line = lines[i];\n\t\t\tline = line.trim().toLowerCase(); //needed because of some \"exponent\" values in upper case\n\t\t\tvar result;\n\t\n\t\t\t//console.log(line);\n\t\n\t\t\tif (line.length === 0 || line.charAt(0) === '#') {\n\t\t\t\tcontinue;\n\t\t\t} else if ((result = vertex_pattern.exec(line)) !== null) {\n\t\t\t\t// [\"v 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\t\t\t\tvertices.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]));\n\t\t\t} else if ((result = normal_pattern.exec(line)) !== null) {\n\t\t\t\t// [\"vn 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\t\t\t\tnormals.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]));\n\t\t\t} else if ((result = uv_pattern.exec(line)) !== null) {\n\t\t\t\t// [\"vt 0.1 0.2\", \"0.1\", \"0.2\"]\n\t\t\t\tuvs.push(parseFloat(result[1]), parseFloat(result[2]));\n\t\t\t} else if ((result = face_pattern1.exec(line)) !== null) {\n\t\t\t\t// [\"f 1 2 3\", \"1\", \"2\", \"3\", undefined]\n\t\t\t\t//console.log(\"result v1\");\n\t\t\t\tthis._handle_face_line(result, [1, 2, 3, 4], indices, \"position\");\n\t\t\t\t//faces, uvs, normals_inds, geometry,face_offset, normals, uvs\n\t\t\t} else if ((result = face_pattern2.exec(line)) !== null) {\n\t\t\t\t\t// [\"f 1/1 2/2 3/3\", \" 1/1\", \"1\", \"1\", \" 2/2\", \"2\", \"2\", \" 3/3\", \"3\", \"3\", undefined, undefined, undefined]\n\t\t\t\t\t//console.log(\"result v2\");\n\t\t\t\t\tthis._handle_face_line(result, [2, 5, 8, 11], indices, \"position\"); //2,5,8,11//possible winding order change of for some stuff11,8,5,2\n\t\t\t\t\tthis._handle_face_line(result, [3, 6, 9, 12], uvIndices, \"uv\");\n\t\t\t\t} else if ((result = face_pattern3.exec(line)) !== null) {\n\t\t\t\t\t// [\"f 1/1/1 2/2/2 3/3/3\", \" 1/1/1\", \"1\", \"1\", \"1\", \" 2/2/2\", \"2\", \"2\", \"2\", \" 3/3/3\", \"3\", \"3\", \"3\", undefined, undefined, undefined, undefined]\n\t\t\t\t\t//console.log(\"result v3\");\n\t\t\t\t\t//result[ 2 ], result[ 6 ], result[ 10 ], result[ 14 ]\n\t\t\t\t\tthis._handle_face_line(result, [2, 6, 10, 14], indices, \"position\"); //2,6,10,14\n\t\t\t\t\tthis._handle_face_line(result, [4, 8, 12, 16], normIndices, \"normal\");\n\t\t\t\t\tthis._handle_face_line(result, [3, 7, 11, 15], uvIndices, \"uv\");\n\t\t\t\t} else if ((result = face_pattern4.exec(line)) !== null) {\n\t\t\t\t\t//console.log(\"result v4\");\n\t\t\t\t\t// [\"f 1//1 2//2 3//3\", \" 1//1\", \"1\", \"1\", \" 2//2\", \"2\", \"2\", \" 3//3\", \"3\", \"3\", undefined, undefined, undefined]\n\t\t\t\t\tthis._handle_face_line(result, [2, 5, 8, 11], indices, \"position\");\n\t\t\t\t\tthis._handle_face_line(result, [3, 6, 9, 12], normIndices, \"normal\");\n\t\t\t\t} else if (/^o /.test(line)) {\n\t\t\t\t\t// object\n\t\t\t\t\t//console.log(\"object\")\n\t\t\t\t\tif (currentObject) {\n\t\t\t\t\t\t//if (!(geometry === undefined)) {\n\t\t\t\t\t\tface_offset = face_offset + vertices.length;\n\t\n\t\t\t\t\t\t//console.log(\"oldobject\")\n\t\t\t\t\t\t//console.log( currentObject)\n\t\t\t\t\t\tcurrentObject.faceCount = indices.length;\n\t\n\t\t\t\t\t\t//reset all for next object\n\t\t\t\t\t\tcurrentObject = this._newObject();\n\t\t\t\t\t\tcurrentObject.name = line.substring(2).trim();\n\t\t\t\t\t\tvertices = currentObject._attributes[\"position\"];\n\t\t\t\t\t\tnormals = currentObject._attributes[\"normal\"];\n\t\t\t\t\t\tuvs = currentObject._attributes[\"uv\"];\n\t\t\t\t\t\tindices = currentObject._attributes[\"indices\"];\n\t\t\t\t\t\tnormIndices = currentObject._attributes[\"normIndices\"];\n\t\t\t\t\t\tuvIndices = currentObject._attributes[\"uvIndices\"];\n\t\n\t\t\t\t\t\tobjects.push(currentObject);\n\t\t\t\t\t}\n\t\t\t\t} else if (/^g /.test(line)) {\n\t\t\t\t\t// group\n\t\t\t\t\t//console.log(\"group\");\n\t\t\t\t} else if (/^usemtl /.test(line)) {\n\t\t\t\t\t\t// material\n\t\t\t\t\t\tcurrentMaterial.name = line.substring(7).trim();\n\t\t\t\t\t} else if (/^mtllib /.test(line)) {\n\t\t\t\t\t\t// mtl file\n\t\t\t\t\t\tcurrentMaterial = {};\n\t\t\t\t\t} else if (/^s /.test(line)) {\n\t\t\t\t\t\t// smooth shading\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// console.log( \"OBJParser: Unhandled line \" + line );\n\t\t\t\t\t\t}\n\t\t}\n\t\n\t\tif (objects.indexOf(currentObject) == -1) {\n\t\t\tobjects.push(currentObject);\n\t\t}\n\t\tcurrentObject.faceCount = indices.length / 3;\n\t\n\t\treturn {\n\t\t\tobjects: objects\n\t\t};\n\t};\n\t\n\t/*\n\t  extracts data based on indices since obj has different indices for normals, uvs etc, while webgl does not\n\t*/\n\tOBJ.prototype._unindexData = function (object) {\n\t\tvar resultPositions = [];\n\t\tvar resultNormals = [];\n\t\tvar resultUv = [];\n\t\n\t\tvar vertices = object._attributes[\"position\"];\n\t\tvar normals = object._attributes[\"normal\"];\n\t\tvar uvs = object._attributes[\"uv\"];\n\t\n\t\tfor (var i = 0; i < object.indices.length; i++) {\n\t\t\t//resultPositions.push( data. );\n\t\t}\n\t};\n\texports.default = OBJ;\n\t\n\t},{}],6:[function(require,module,exports){\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\texports.createModelBuffers = createModelBuffers;\n\t//TODO: potential candidate for re-use across parsers with a few changes\n\tfunction createModelBuffers(modelData) {\n\t  //console.log(\"creating model buffers\",modelData, modelData._attributes)\n\t\n\t  var faces = modelData.faceCount;\n\t  var colorSize = 3;\n\t\n\t  var positions = new Float32Array(faces * 3 * 3);\n\t  var normals = new Float32Array(faces * 3 * 3);\n\t  //let colors  = new Float32Array( faces *3 * colorSize )\n\t  var indices = new Uint32Array(faces * 3);\n\t\n\t  //vertices.set( modelData.position );\n\t  //normals.set( modelData.normal );\n\t  //indices.set( modelData.indices );\n\t\n\t  positions.set(modelData._attributes.position);\n\t  normals.set(modelData._attributes.normal);\n\t  indices.set(modelData._attributes.indices);\n\t\n\t  //materials = []\n\t  return { positions: positions, indices: indices, normals: normals };\n\t}\n\t\n\t/*\n\tOBJParser.prototype._parse = function( text )\n\t{\n\t  var object = new THREE.Object3D();\n\t  var geometry, material, mesh;\n\t  var face_offset = 0;\n\t\n\t  // create mesh if no objects in text\n\t  if ( /^o /gm.test( text ) === false ) {\n\t\n\t    geometry = new THREE.Geometry();\n\t    material = new THREE.MeshLambertMaterial();\n\t    mesh = new THREE.Mesh( geometry, material );\n\t    object.add( mesh );\n\t\n\t  }\n\t\n\t    var vertices = [];\n\t    var verticesCount = 0;\n\t    var normals = [];\n\t    var uvs = [];\n\t    // v float float float\n\t    var vertex_pattern = /v( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\t    // vn float float float\n\t    var normal_pattern = /vn( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\t    // vt float float\n\t    var uv_pattern = /vt( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\t    // f vertex vertex vertex ...\n\t    var face_pattern1 = /f( +\\d+)( +\\d+)( +\\d+)( +\\d+)?/;\n\t    // f vertex/uv vertex/uv vertex/uv ...\n\t    var face_pattern2 = /f( +(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+))?/;\n\t    // f vertex/uv/normal vertex/uv/normal vertex/uv/normal ...\n\t    var face_pattern3 = /f( +(\\d+)\\/(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+)\\/(\\d+))?/;\n\t    // f vertex//normal vertex//normal vertex//normal ...\n\t    var face_pattern4 = /f( +(\\d+)\\/\\/(\\d+))( +(\\d+)\\/\\/(\\d+))( +(\\d+)\\/\\/(\\d+))( +(\\d+)\\/\\/(\\d+))?/\n\t\n\t    var lines = text.split( '\\n' );\n\t\n\t    for ( var i = 0; i < lines.length; i ++ ) {\n\t      var line = lines[ i ];\n\t      line = line.trim();\n\t      var result;\n\t\n\t      if ( line.length === 0 || line.charAt( 0 ) === '#' ) {\n\t        continue;\n\t      } else if ( ( result = vertex_pattern.exec( line ) ) !== null ) {\n\t        // [\"v 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\t        geometry.vertices.push( vector(\n\t          parseFloat( result[ 1 ] ),\n\t          parseFloat( result[ 2 ] ),\n\t          parseFloat( result[ 3 ] )\n\t        ) );\n\t      } else if ( ( result = normal_pattern.exec( line ) ) !== null ) {\n\t        // [\"vn 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\t        normals.push( vector(\n\t          parseFloat( result[ 1 ] ),\n\t          parseFloat( result[ 2 ] ),\n\t          parseFloat( result[ 3 ] )\n\t        ) );\n\t      } else if ( ( result = uv_pattern.exec( line ) ) !== null ) {\n\t        // [\"vt 0.1 0.2\", \"0.1\", \"0.2\"]\n\t        uvs.push( uv(\n\t          parseFloat( result[ 1 ] ),\n\t          parseFloat( result[ 2 ] )\n\t        ) );\n\t      } else if ( ( result = face_pattern1.exec( line ) ) !== null ) {\n\t        // [\"f 1 2 3\", \"1\", \"2\", \"3\", undefined]\n\t        handle_face_line([ result[ 1 ], result[ 2 ], result[ 3 ], result[ 4 ] ], geometry,face_offset, normals, uvs);\n\t      } else if ( ( result = face_pattern2.exec( line ) ) !== null ) {\n\t        // [\"f 1/1 2/2 3/3\", \" 1/1\", \"1\", \"1\", \" 2/2\", \"2\", \"2\", \" 3/3\", \"3\", \"3\", undefined, undefined, undefined]\n\t        handle_face_line(\n\t          [ result[ 2 ], result[ 5 ], result[ 8 ], result[ 11 ] ], //faces\n\t          [ result[ 3 ], result[ 6 ], result[ 9 ], result[ 12 ] ] //uv\n\t          , geometry, face_offset, normals, uvs\n\t        );\n\t      } else if ( ( result = face_pattern3.exec( line ) ) !== null ) {\n\t        // [\"f 1/1/1 2/2/2 3/3/3\", \" 1/1/1\", \"1\", \"1\", \"1\", \" 2/2/2\", \"2\", \"2\", \"2\", \" 3/3/3\", \"3\", \"3\", \"3\", undefined, undefined, undefined, undefined]\n\t        handle_face_line(\n\t          [ result[ 2 ], result[ 6 ], result[ 10 ], result[ 14 ] ], //faces\n\t          [ result[ 3 ], result[ 7 ], result[ 11 ], result[ 15 ] ], //uv\n\t          [ result[ 4 ], result[ 8 ], result[ 12 ], result[ 16 ] ] //normal\n\t          , geometry, face_offset, normals, uvs\n\t        );\n\t      } else if ( ( result = face_pattern4.exec( line ) ) !== null ) {\n\t        // [\"f 1//1 2//2 3//3\", \" 1//1\", \"1\", \"1\", \" 2//2\", \"2\", \"2\", \" 3//3\", \"3\", \"3\", undefined, undefined, undefined]\n\t        handle_face_line(\n\t          [ result[ 2 ], result[ 5 ], result[ 8 ], result[ 11 ] ], //faces\n\t          [ ], //uv\n\t          [ result[ 3 ], result[ 6 ], result[ 9 ], result[ 12 ] ] //normal\n\t          , geometry, face_offset, normals, uvs\n\t        );\n\t\n\t      } else if ( /^o /.test( line ) ) {\n\t        // object\n\t        if (!(geometry === undefined)) {\n\t          face_offset = face_offset + geometry.vertices.length;\n\t        }\n\t\n\t        geometry = new THREE.Geometry();\n\t        material = new THREE.MeshLambertMaterial();\n\t\n\t        mesh = new THREE.Mesh( geometry, material );\n\t        mesh.name = line.substring( 2 ).trim();\n\t        object.add( mesh );\n\t\n\t        verticesCount = 0;\n\t\n\t      } else if ( /^g /.test( line ) ) {\n\t        // group\n\t      } else if ( /^usemtl /.test( line ) ) {\n\t        // material\n\t        material.name = line.substring( 7 ).trim();\n\t      } else if ( /^mtllib /.test( line ) ) {\n\t        // mtl file\n\t      } else if ( /^s /.test( line ) ) {\n\t        // smooth shading\n\t      } else {\n\t        // console.log( \"OBJParser: Unhandled line \" + line );\n\t      }\n\t    }\n\t\n\t    for ( var i = 0, l = object.children.length; i < l; i ++ ) {\n\t      var geometry = object.children[ i ].geometry;\n\t    }\n\t\n\t    return object;\n\t}\n\t\n\t\n\t    function vector( x, y, z ) {\n\t      return new THREE.Vector3( x, y, z );\n\t    }\n\t\n\t    function uv( u, v ) {\n\t      return new THREE.Vector2( u, v );\n\t    }\n\t\n\t    function face3( a, b, c, normals ) {\n\t      return new THREE.Face3( a, b, c, normals );\n\t    }\n\t\n\t\n\t    function add_face( a, b, c, normals_inds, geometry ,face_offset, normals) {\n\t      if ( normals_inds === undefined ) {\n\t        geometry.faces.push( face3(\n\t          parseInt( a ) - (face_offset + 1),\n\t          parseInt( b ) - (face_offset + 1),\n\t          parseInt( c ) - (face_offset + 1)\n\t        ) );\n\t      } else {\n\t        geometry.faces.push( face3(\n\t          parseInt( a ) - (face_offset + 1),\n\t          parseInt( b ) - (face_offset + 1),\n\t          parseInt( c ) - (face_offset + 1),\n\t          [\n\t            normals[ parseInt( normals_inds[ 0 ] ) - 1 ].clone(),\n\t            normals[ parseInt( normals_inds[ 1 ] ) - 1 ].clone(),\n\t            normals[ parseInt( normals_inds[ 2 ] ) - 1 ].clone()\n\t          ]\n\t        ) );\n\t      }\n\t    }\n\t\n\t    function add_uvs( a, b, c, geometry , uvs) {\n\t      geometry.faceVertexUvs[ 0 ].push( [\n\t        uvs[ parseInt( a ) - 1 ].clone(),\n\t        uvs[ parseInt( b ) - 1 ].clone(),\n\t        uvs[ parseInt( c ) - 1 ].clone()\n\t      ] );\n\t    }\n\t\n\t    function handle_face_line(faces, uvs, normals_inds, geometry,face_offset, normals, uvs) {\n\t      if ( faces[ 3 ] === undefined ) {\n\t        add_face( faces[ 0 ], faces[ 1 ], faces[ 2 ], normals_inds, geometry,face_offset, normals );\n\t        if (!(uvs === undefined) && uvs.length > 0) {\n\t          add_uvs( uvs[ 0 ], uvs[ 1 ], uvs[ 2 ] , geometry , uvs);\n\t        }\n\t      } else {\n\t        if (!(normals_inds === undefined) && normals_inds.length > 0) {\n\t          add_face( faces[ 0 ], faces[ 1 ], faces[ 3 ], [ normals_inds[ 0 ], normals_inds[ 1 ], normals_inds[ 3 ] ], geometry,face_offset, normals);\n\t          add_face( faces[ 1 ], faces[ 2 ], faces[ 3 ], [ normals_inds[ 1 ], normals_inds[ 2 ], normals_inds[ 3 ] ], geometry,face_offset, normals);\n\t        } else {\n\t          add_face( faces[ 0 ], faces[ 1 ], faces[ 3 ], geometry,face_offset, normals);\n\t          add_face( faces[ 1 ], faces[ 2 ], faces[ 3 ], geometry,face_offset, normals);\n\t        }\n\t        if (!(uvs === undefined) && uvs.length > 0) {\n\t          add_uvs( uvs[ 0 ], uvs[ 1 ], uvs[ 3 ] , geometry,face_offset, normals);\n\t          add_uvs( uvs[ 1 ], uvs[ 2 ], uvs[ 3 ] , geometry,face_offset, normals);\n\t        }\n\t      }\n\t    }*/\n\t\n\t},{}]},{},[4])(4)\n\t});\n\n\n/***/ },\n/* 27 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar require;var require;/*** IMPORTS FROM imports-loader ***/\n\tvar Rx = __webpack_require__(2);\n\t\n\t(function(f){if(true){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.stlParser = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n\t// shim for using process in browser\n\t\n\tvar process = module.exports = {};\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\t\n\tfunction cleanUpNextTick() {\n\t    draining = false;\n\t    if (currentQueue.length) {\n\t        queue = currentQueue.concat(queue);\n\t    } else {\n\t        queueIndex = -1;\n\t    }\n\t    if (queue.length) {\n\t        drainQueue();\n\t    }\n\t}\n\t\n\tfunction drainQueue() {\n\t    if (draining) {\n\t        return;\n\t    }\n\t    var timeout = setTimeout(cleanUpNextTick);\n\t    draining = true;\n\t\n\t    var len = queue.length;\n\t    while(len) {\n\t        currentQueue = queue;\n\t        queue = [];\n\t        while (++queueIndex < len) {\n\t            if (currentQueue) {\n\t                currentQueue[queueIndex].run();\n\t            }\n\t        }\n\t        queueIndex = -1;\n\t        len = queue.length;\n\t    }\n\t    currentQueue = null;\n\t    draining = false;\n\t    clearTimeout(timeout);\n\t}\n\t\n\tprocess.nextTick = function (fun) {\n\t    var args = new Array(arguments.length - 1);\n\t    if (arguments.length > 1) {\n\t        for (var i = 1; i < arguments.length; i++) {\n\t            args[i - 1] = arguments[i];\n\t        }\n\t    }\n\t    queue.push(new Item(fun, args));\n\t    if (queue.length === 1 && !draining) {\n\t        setTimeout(drainQueue, 0);\n\t    }\n\t};\n\t\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t    this.fun = fun;\n\t    this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t    this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\t\n\tfunction noop() {}\n\t\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\t\n\tprocess.binding = function (name) {\n\t    throw new Error('process.binding is not supported');\n\t};\n\t\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t    throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\t\n\t},{}],2:[function(require,module,exports){\n\t(function (process){\n\t(function () {\n\t  // Hueristics.\n\t  var isNode = typeof process !== 'undefined' && process.versions && !!process.versions.node;\n\t  var isBrowser = typeof window !== 'undefined';\n\t  var isModule = typeof module !== 'undefined' && !!module.exports;\n\t\n\t  // Export.\n\t  var detect = (isModule ? exports : (this.detect = {}));\n\t  detect.isNode = isNode;\n\t  detect.isBrowser = isBrowser;\n\t  detect.isModule = isModule;\n\t}).call(this);\n\t}).call(this,require('_process'))\n\t},{\"_process\":1}],3:[function(require,module,exports){\n\t'use strict';\n\t\n\t/**\n\t * Analogue of Object.assign().\n\t * Copies properties from one or more source objects to\n\t * a target object. Existing keys on the target object will be overwritten.\n\t *\n\t * > Note: This differs from spec in some important ways:\n\t * > 1. Will throw if passed non-objects, including `undefined` or `null` values.\n\t * > 2. Does not support the curious Exception handling behavior, exceptions are thrown immediately.\n\t * > For more details, see:\n\t * > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\t *\n\t *\n\t *\n\t * @param  {Object} target      The target object to copy properties to.\n\t * @param  {Object} source, ... The source(s) to copy properties from.\n\t * @return {Object}             The updated target object.\n\t */\n\tmodule.exports = function fastAssign (target) {\n\t  var totalArgs = arguments.length,\n\t      source, i, totalKeys, keys, key, j;\n\t\n\t  for (i = 1; i < totalArgs; i++) {\n\t    source = arguments[i];\n\t    keys = Object.keys(source);\n\t    totalKeys = keys.length;\n\t    for (j = 0; j < totalKeys; j++) {\n\t      key = keys[j];\n\t      target[key] = source[key];\n\t    }\n\t  }\n\t  return target;\n\t};\n\t\n\t},{}],4:[function(require,module,exports){\n\t(function (global){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\texports.outputs = undefined;\n\texports.default = parse;\n\t\n\tvar _compositeDetect = require('composite-detect');\n\t\n\tvar _compositeDetect2 = _interopRequireDefault(_compositeDetect);\n\t\n\tvar _assign = require('fast.js/object/assign');\n\t\n\tvar _assign2 = _interopRequireDefault(_assign);\n\t\n\tvar _rx = typeof window !== \"undefined\" ? window['Rx'] : typeof global !== \"undefined\" ? global['Rx'] : null;\n\t\n\tvar _rx2 = _interopRequireDefault(_rx);\n\t\n\tvar _parseHelpers = require('./parseHelpers');\n\t\n\tfunction _interopRequireDefault(obj) {\n\t  return obj && obj.__esModule ? obj : { default: obj };\n\t}\n\t\n\t/**\n\t * @author aleeper / http://adamleeper.com/\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author gero3 / https://github.com/gero3\n\t * @author kaosat-dev / https://github.com/kaosat-dev\n\t *\n\t * Description: A THREE parser for STL ASCII files & BINARY, as created by Solidworks and other CAD programs.\n\t *\n\t * Supports both binary and ASCII encoded files, with automatic detection of type.\n\t *\n\t * Limitations:\n\t *  Binary decoding ignores header. There doesn't seem to be much of a use for it.\n\t *  There is perhaps some question as to how valid it is to always assume little-endian-ness.\n\t *  ASCII decoding assumes file is UTF-8. Seems to work for the examples...\n\t *\n\t * Usage:\n\t *  var parser = new STLParser();\n\t *  var loader = new THREE.XHRLoader( parser );\n\t *  loader.addEventListener( 'load', function ( event ) {\n\t *\n\t *    var geometry = event.content;\n\t *    scene.add( new THREE.Mesh( geometry ) );\n\t *\n\t *  } );\n\t *  loader.load( './models/stl/slotted_disk.stl' );\n\t */\n\t\n\t//var detectEnv = require(\"composite-detect\");\n\tvar outputs = exports.outputs = [\"geometry\"]; //to be able to auto determine data type(s) fetched by parser\n\t\n\tfunction parse(data) {\n\t  var parameters = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\t\n\t  var defaults = {\n\t    useWorker: _compositeDetect2.default.isBrowser === true\n\t  };\n\t  parameters = (0, _assign2.default)({}, defaults, parameters);\n\t  var _parameters = parameters;\n\t  var useWorker = _parameters.useWorker;\n\t\n\t  var obs = new _rx2.default.ReplaySubject(1);\n\t\n\t  if (useWorker) {\n\t    (function () {\n\t      //var Worker = require(\"./worker.js\")//Webpack worker!\n\t      //var worker = new Worker\n\t\n\t      var worker = new Worker((window.URL || window.webkitURL || window.mozURL).createObjectURL(new Blob(['(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error(\"Cannot find module \\'\"+o+\"\\'\")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\\n\\'use strict\\';\\n\\nObject.defineProperty(exports, \"__esModule\", {\\n  value: true\\n});\\nexports.parseSteps = parseSteps;\\nexports.parseBinary = parseBinary;\\nexports.parseASCII = parseASCII;\\n\\nvar _utils = require(\\'./utils\\');\\n\\nfunction parseSteps(data) {\\n  data = (0, _utils.ensureBinary)(data);\\n  var isBinary = (0, _utils.isDataBinary)(data);\\n\\n  var result = null;\\n  if (isBinary) {\\n    result = parseBinary(data);\\n  } else {\\n    result = parseASCII((0, _utils.ensureString)(data));\\n  }\\n  return result;\\n}\\n\\nfunction parseBinary(data) {\\n  var reader = new DataView(data);\\n  var faces = reader.getUint32(80, true);\\n  var dataOffset = 84;\\n  var faceLength = 12 * 4 + 2;\\n  var offset = 0;\\n\\n  var positions = new Float32Array(faces * 3 * 3);\\n  var normals = new Float32Array(faces * 3 * 3);\\n\\n  for (var face = 0; face < faces; face++) {\\n\\n    var start = dataOffset + face * faceLength;\\n\\n    for (var i = 1; i <= 3; i++) {\\n\\n      var vertexstart = start + i * 12;\\n\\n      positions[offset] = reader.getFloat32(vertexstart, true);\\n      positions[offset + 1] = reader.getFloat32(vertexstart + 4, true);\\n      positions[offset + 2] = reader.getFloat32(vertexstart + 8, true);\\n\\n      normals[offset] = reader.getFloat32(start, true);\\n      normals[offset + 1] = reader.getFloat32(start + 4, true);\\n      normals[offset + 2] = reader.getFloat32(start + 8, true);\\n      offset += 3;\\n    }\\n  }\\n  return { positions: positions, normals: normals };\\n}\\n\\n//ASCII stl parsing\\nfunction parseASCII(data) {\\n\\n  var normal, patternFace, patternNormal, patternVertex, result, text;\\n  patternFace = /facet([\\\\s\\\\S]*?)endfacet/g;\\n\\n  var posArray = [];\\n  var normArray = [];\\n  var indicesArray = [];\\n  var faces = 0;\\n\\n  while ((result = patternFace.exec(data)) !== null) {\\n    var length = 0;\\n\\n    text = result[0];\\n    patternNormal = /normal[\\\\s]+([\\\\-+]?[0-9]+\\\\.?[0-9]*([eE][\\\\-+]?[0-9]+)?)+[\\\\s]+([\\\\-+]?[0-9]*\\\\.?[0-9]+([eE][\\\\-+]?[0-9]+)?)+[\\\\s]+([\\\\-+]?[0-9]*\\\\.?[0-9]+([eE][\\\\-+]?[0-9]+)?)+/g;\\n\\n    while ((result = patternNormal.exec(text)) !== null) {\\n      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\\n      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\\n      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\\n    }\\n\\n    patternVertex = /vertex[\\\\s]+([\\\\-+]?[0-9]+\\\\.?[0-9]*([eE][\\\\-+]?[0-9]+)?)+[\\\\s]+([\\\\-+]?[0-9]*\\\\.?[0-9]+([eE][\\\\-+]?[0-9]+)?)+[\\\\s]+([\\\\-+]?[0-9]*\\\\.?[0-9]+([eE][\\\\-+]?[0-9]+)?)+/g;\\n\\n    while ((result = patternVertex.exec(text)) !== null) {\\n\\n      posArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\\n      length += 1;\\n    }\\n    faces += 1;\\n  }\\n\\n  var positions = new Float32Array(faces * 3 * 3);\\n  var normals = new Float32Array(faces * 3 * 3);\\n\\n  positions.set(posArray);\\n  normals.set(normArray);\\n\\n  return { positions: positions, normals: normals };\\n}\\n\\n},{\"./utils\":2}],2:[function(require,module,exports){\\n\"use strict\";\\n\\nObject.defineProperty(exports, \"__esModule\", {\\n  value: true\\n});\\nexports.ensureString = ensureString;\\nexports.ensureBinary = ensureBinary;\\nexports.isDataBinary = isDataBinary;\\nfunction ensureString(buf) {\\n\\n  if (typeof buf !== \"string\") {\\n    var array_buffer = new Uint8Array(buf);\\n    var str = \\'\\';\\n    for (var i = 0; i < buf.byteLength; i++) {\\n      str += String.fromCharCode(array_buffer[i]); // implicitly assumes little-endian\\n    }\\n    return str;\\n  } else {\\n    return buf;\\n  }\\n}\\n\\nfunction ensureBinary(buf) {\\n\\n  if (typeof buf === \"string\") {\\n    var array_buffer = new Uint8Array(buf.length);\\n    for (var i = 0; i < buf.length; i++) {\\n      array_buffer[i] = buf.charCodeAt(i) & 0xff; // implicitly assumes little-endian\\n    }\\n    return array_buffer.buffer || array_buffer;\\n  } else {\\n    return buf;\\n  }\\n}\\n\\nfunction isDataBinary(data) {\\n  var expect, face_size, n_faces, reader;\\n  reader = new DataView(data);\\n  face_size = 32 / 8 * 3 + 32 / 8 * 3 * 3 + 16 / 8;\\n\\n  n_faces = reader.getUint32(80, true);\\n  expect = 80 + 32 / 8 + n_faces * face_size;\\n  return expect === reader.byteLength;\\n}\\n\\n},{}],3:[function(require,module,exports){\\n\\'use strict\\';\\n\\nvar _parseHelpers = require(\\'./parseHelpers\\');\\n\\nself.onmessage = function (event) {\\n  var result = (0, _parseHelpers.parseSteps)(event.data.data);\\n\\n  var positions = result.positions.buffer;\\n  var normals = result.normals.buffer;\\n  self.postMessage({ positions: positions, normals: normals }, [positions, normals]);\\n  self.close();\\n}; //importScripts(\\'./stl-utils.js\\');\\n\\n},{\"./parseHelpers\":1}]},{},[3])'], { type: \"text/javascript\" }))); //browserify\n\t      worker.onmessage = function (event) {\n\t        var positions = new Float32Array(event.data.positions);\n\t        var normals = new Float32Array(event.data.normals);\n\t        var geometry = { positions: positions, normals: normals };\n\t\n\t        obs.onNext({ progress: 1, total: positions.length });\n\t        obs.onNext(geometry);\n\t        obs.onCompleted();\n\t      };\n\t      worker.onerror = function (event) {\n\t        obs.onError('filename:' + event.filename + ' lineno: ' + event.lineno + ' error: ' + event.message);\n\t      };\n\t\n\t      worker.postMessage({ data: data });\n\t      obs.catch(function (e) {\n\t        return worker.terminate();\n\t      });\n\t    })();\n\t  } else {\n\t    try {\n\t      var result = (0, _parseHelpers.parseSteps)(data);\n\t      obs.onNext({ progress: 1, total: result.positions.length });\n\t      obs.onNext(result);\n\t      obs.onCompleted();\n\t    } catch (error) {\n\t      obs.onError(error);\n\t    }\n\t  }\n\t\n\t  return obs;\n\t}\n\t\n\t}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\t},{\"./parseHelpers\":5,\"composite-detect\":2,\"fast.js/object/assign\":3}],5:[function(require,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\texports.parseSteps = parseSteps;\n\texports.parseBinary = parseBinary;\n\texports.parseASCII = parseASCII;\n\t\n\tvar _utils = require('./utils');\n\t\n\tfunction parseSteps(data) {\n\t  data = (0, _utils.ensureBinary)(data);\n\t  var isBinary = (0, _utils.isDataBinary)(data);\n\t\n\t  var result = null;\n\t  if (isBinary) {\n\t    result = parseBinary(data);\n\t  } else {\n\t    result = parseASCII((0, _utils.ensureString)(data));\n\t  }\n\t  return result;\n\t}\n\t\n\tfunction parseBinary(data) {\n\t  var reader = new DataView(data);\n\t  var faces = reader.getUint32(80, true);\n\t  var dataOffset = 84;\n\t  var faceLength = 12 * 4 + 2;\n\t  var offset = 0;\n\t\n\t  var positions = new Float32Array(faces * 3 * 3);\n\t  var normals = new Float32Array(faces * 3 * 3);\n\t\n\t  for (var face = 0; face < faces; face++) {\n\t\n\t    var start = dataOffset + face * faceLength;\n\t\n\t    for (var i = 1; i <= 3; i++) {\n\t\n\t      var vertexstart = start + i * 12;\n\t\n\t      positions[offset] = reader.getFloat32(vertexstart, true);\n\t      positions[offset + 1] = reader.getFloat32(vertexstart + 4, true);\n\t      positions[offset + 2] = reader.getFloat32(vertexstart + 8, true);\n\t\n\t      normals[offset] = reader.getFloat32(start, true);\n\t      normals[offset + 1] = reader.getFloat32(start + 4, true);\n\t      normals[offset + 2] = reader.getFloat32(start + 8, true);\n\t      offset += 3;\n\t    }\n\t  }\n\t  return { positions: positions, normals: normals };\n\t}\n\t\n\t//ASCII stl parsing\n\tfunction parseASCII(data) {\n\t\n\t  var normal, patternFace, patternNormal, patternVertex, result, text;\n\t  patternFace = /facet([\\s\\S]*?)endfacet/g;\n\t\n\t  var posArray = [];\n\t  var normArray = [];\n\t  var indicesArray = [];\n\t  var faces = 0;\n\t\n\t  while ((result = patternFace.exec(data)) !== null) {\n\t    var length = 0;\n\t\n\t    text = result[0];\n\t    patternNormal = /normal[\\s]+([\\-+]?[0-9]+\\.?[0-9]*([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+/g;\n\t\n\t    while ((result = patternNormal.exec(text)) !== null) {\n\t      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\n\t      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\n\t      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\n\t    }\n\t\n\t    patternVertex = /vertex[\\s]+([\\-+]?[0-9]+\\.?[0-9]*([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+/g;\n\t\n\t    while ((result = patternVertex.exec(text)) !== null) {\n\t\n\t      posArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\n\t      length += 1;\n\t    }\n\t    faces += 1;\n\t  }\n\t\n\t  var positions = new Float32Array(faces * 3 * 3);\n\t  var normals = new Float32Array(faces * 3 * 3);\n\t\n\t  positions.set(posArray);\n\t  normals.set(normArray);\n\t\n\t  return { positions: positions, normals: normals };\n\t}\n\t\n\t},{\"./utils\":6}],6:[function(require,module,exports){\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\texports.ensureString = ensureString;\n\texports.ensureBinary = ensureBinary;\n\texports.isDataBinary = isDataBinary;\n\tfunction ensureString(buf) {\n\t\n\t  if (typeof buf !== \"string\") {\n\t    var array_buffer = new Uint8Array(buf);\n\t    var str = '';\n\t    for (var i = 0; i < buf.byteLength; i++) {\n\t      str += String.fromCharCode(array_buffer[i]); // implicitly assumes little-endian\n\t    }\n\t    return str;\n\t  } else {\n\t    return buf;\n\t  }\n\t}\n\t\n\tfunction ensureBinary(buf) {\n\t\n\t  if (typeof buf === \"string\") {\n\t    var array_buffer = new Uint8Array(buf.length);\n\t    for (var i = 0; i < buf.length; i++) {\n\t      array_buffer[i] = buf.charCodeAt(i) & 0xff; // implicitly assumes little-endian\n\t    }\n\t    return array_buffer.buffer || array_buffer;\n\t  } else {\n\t    return buf;\n\t  }\n\t}\n\t\n\tfunction isDataBinary(data) {\n\t  var expect, face_size, n_faces, reader;\n\t  reader = new DataView(data);\n\t  face_size = 32 / 8 * 3 + 32 / 8 * 3 * 3 + 16 / 8;\n\t\n\t  n_faces = reader.getUint32(80, true);\n\t  expect = 80 + 32 / 8 + n_faces * face_size;\n\t  return expect === reader.byteLength;\n\t}\n\t\n\t},{}]},{},[4])(4)\n\t});\n\n\n/***/ },\n/* 28 */\n/***/ function(module, exports) {\n\n\tmodule.exports = require(\"gl\");\n\n/***/ },\n/* 29 */\n/***/ function(module, exports) {\n\n\tmodule.exports = require(\"pngjs\");\n\n/***/ },\n/* 30 */\n/***/ function(module, exports) {\n\n\tmodule.exports = require(\"ramda\");\n\n/***/ }\n/******/ ]);\n\n\n/** WEBPACK FOOTER **\n ** jam-headless.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./dist/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap f51d1ee20a1007488b49\n **/","module.exports = require(\"three\");\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"three\"\n ** module id = 1\n ** module chunks = 0\n **/","module.exports = require(\"rx\");\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"rx\"\n ** module id = 2\n ** module chunks = 0\n **/","module.exports = require(\"fs\");\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"fs\"\n ** module id = 3\n ** module chunks = 0\n **/","module.exports = require(\"glView-helpers\");\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"glView-helpers\"\n ** module id = 4\n ** module chunks = 0\n **/","var fs    = require('fs')\n\nexport default function bufferToPng(buffer, width, height, fileName){\n\n  function genOutput(inBuf, width, height){\n    let PNG = require('pngjs').PNG\n    let png = new PNG( {width, height} )\n\n    /*for (let i = 0; i < inBuf.length; ++i) {\n      png.data[i] = inBuf[i]\n    }*/\n    //vertical flip\n\n    for (let j = 0; j < height; ++j) {//from https://gist.github.com/bsergean\n      for (let i = 0; i < width; ++i) {\n\n        let k = j * width + i\n        let r = inBuf[4*k]\n        let g = inBuf[4*k + 1]\n        let b = inBuf[4*k + 2]\n        let a = inBuf[4*k + 3]\n\n        let m = (height - j + 1) * width + i\n        png.data[4*m]     = r\n        png.data[4*m + 1] = g\n        png.data[4*m + 2] = b\n        png.data[4*m + 3] = a\n\n      }\n    }\n    png.pack().pipe(fs.createWriteStream(fileName))\n  }\n\n  //this is just a helper\n  function log(inBuf, width, height){\n    var channels = inBuf.length / 4\n    for (var i = 0; i < channels; ++i) {\n      var r = inBuf[i*4]\n      var g = inBuf[i*4+1]\n      var b = inBuf[i*4+2]\n      var a = inBuf[i*4+3]\n\n      console.log(r,g,b,a)\n      console.log(\"//\")\n    }\n  }\n\n  genOutput(buffer, width, height)\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/bufferToPng.js\n **/","import THREE from 'three';\n\n\n/*\n *  @author zz85 / http://twitter.com/blurspline / http://www.lab4games.net/zz85/blog\n *\n *  A general perpose camera, for setting FOV, Lens Focal Length,\n *      and switching between perspective and orthographic views easily.\n *      Use this only if you do not wish to manage\n *      both a Orthographic and Perspective Camera\n *\n * some additional changes by kaosat-dev\n */\n\n\nvar CombinedCamera = function ( width, height, fov, near, far, orthoNear, orthoFar ) {\n\n    THREE.Camera.call( this );\n\n    this.fov = fov;\n\n    this.left = -width / 2;\n    this.right = width / 2\n    this.top = height / 2;\n    this.bottom = -height / 2;\n\n    // We could also handle the projectionMatrix internally, but just wanted to test nested camera objects\n\n    this.cameraO = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2,  orthoNear, orthoFar );\n    this.cameraP = new THREE.PerspectiveCamera( fov, width / height, near, far );\n\n    this.zoom = 1;\n\n    this.toPerspective();\n\n    var aspect = width/height;\n    \n    this.target = new THREE.Vector3();\n    this.defaultPosition = new THREE.Vector3();\n    \n    /**\n      Orientations:\n        front: +x \n        back:  -x\n        top/above : +z\n        bottom/under : -z\n        left: +y\n        right: -y \n    */\n    this.orientationMap = {\n      \"F\": new THREE.Vector3(1,0,0),\n      \"B\": new THREE.Vector3(-1,0,0),\n      \n      \"A\": new THREE.Vector3(0,0,1),\n      \"U\": new THREE.Vector3(0,0,-1),\n      \n      \"L\": new THREE.Vector3(0,1,0),\n      \"R\": new THREE.Vector3(0,-1,0),\n    }\n   \n   //we generate methods for each an every possible case\n   var orientationNameMap = {\n      \"F\":    \"Front\",\n      \"B\":    \"Back\",\n      \"L\":    \"Left\",\n      \"R\":    \"Right\",\n      \"A\":    \"Top\",\n      \"U\":    \"Bottom\",\n      \n      \"FL\":   \"FrontLeft\",\n      \"FR\":   \"FrontRight\",\n      \"FA\":   \"FrontTop\",\n      \"FU\":   \"FrontBottom\", \n  \n      \"BL\":   \"BackLeft\",\n      \"BR\":   \"BackRight\",\n      \"BA\":   \"BackTop\",\n      \"BU\":   \"BackBottom\", \n  \n      \"LA\":   \"LeftTop\",\n      \"LU\":   \"LeftBottom\",\n      \"RA\":   \"RightTop\",\n      \"RU\":   \"RightBottom\",\n  \n      \"FAL\":   \"FrontTopLeft\",\n      \"FAR\":   \"FrontTopRight\",\n      \"FUL\":   \"FrontBottomLeft\",\n      \"FUR\":   \"FrontBottomRight\",\n  \n      \"BAL\":   \"BackTopLeft\",\n      \"BAR\":   \"BackTopRight\",\n      \"BUL\":   \"BackBottomLeft\",\n      \"BUR\":   \"BackBottomRight\",\n    };\n    \n    var self = this;\n    function createOrientationFunct(methodName, orCode) {\n       self[methodName] = function(){\n        self.orientationGenerator(orCode);\n      }\n    }\n    \n    for(var shortOrientationName in orientationNameMap)\n    {\n      var orientation = orientationNameMap[shortOrientationName];\n      var methodName = \"to\"+orientation.charAt(0).toUpperCase() + orientation.slice(1)+\"View\";\n      createOrientationFunct( methodName, shortOrientationName );\n    }\n    \n};\n\nCombinedCamera.prototype = Object.create( THREE.Camera.prototype );\n\n\nCombinedCamera.prototype.lookAt = function () {\n\n    // This routine does not support cameras with rotated and/or translated parent(s)\n\n    var m1 = new THREE.Matrix4();\n\n    return function ( vector ) {\n        this.target = vector;\n        if(this.inOrthographicMode===true)\n        {\n            this.toOrthographic();\n        }\n        \n        m1.lookAt( this.position, vector, this.up );\n\n       this.quaternion.setFromRotationMatrix( m1 );\n\n    };\n    \n\n}();\n\n\nCombinedCamera.prototype.toPerspective = function () {\n\n    // Switches to the Perspective Camera\n\n    this.near = this.cameraP.near;\n    this.far = this.cameraP.far;\n\n    this.cameraP.fov =  this.fov / this.zoom ;\n\n    this.cameraP.updateProjectionMatrix();\n\n    this.projectionMatrix = this.cameraP.projectionMatrix;\n\n    this.inPerspectiveMode = true;\n    this.inOrthographicMode = false;\n\n};\n\nCombinedCamera.prototype.toOrthographic = function () {\n\n    // Switches to the Orthographic camera estimating viewport from Perspective\n\n    var fov = this.fov;\n    var aspect = this.cameraP.aspect;\n    var near = this.cameraP.near;\n    var far = this.cameraP.far;\n    \n    \n    //set the orthographic view rectangle to 0,0,width,height\n    //see here : http://stackoverflow.com/questions/13483775/set-zoomvalue-of-a-perspective-equal-to-perspective\n    if(this.target === null)\n    {\n      this.target = new THREE.Vector3();\n    }\n    var distance = new THREE.Vector3().subVectors(this.position,this.target).length()*0.3;\n    var width = Math.tan(fov) * distance * aspect;\n    var height = Math.tan (fov) * distance;\n    \n    var halfWidth = width;\n    var halfHeight = height;\n\n    this.cameraO.left = halfWidth;\n    this.cameraO.right = -halfWidth;\n    this.cameraO.top = -halfHeight;\n    this.cameraO.bottom = halfHeight;\n\n\n    this.cameraO.updateProjectionMatrix();\n\n    this.near = this.cameraO.near;\n    this.far = this.cameraO.far;\n    this.projectionMatrix = this.cameraO.projectionMatrix;\n\n    this.inPerspectiveMode = false;\n    this.inOrthographicMode = true;\n\n};\n\n\nCombinedCamera.prototype.setSize = function( width, height ) {\n\n    this.cameraP.aspect = width / height;\n    this.left = -width / 2;\n    this.right = width / 2\n    this.top = height / 2;\n    this.bottom = -height / 2;\n\n};\n\n\nCombinedCamera.prototype.setFov = function( fov ) {\n\n    this.fov = fov;\n\n    if ( this.inPerspectiveMode ) {\n\n        this.toPerspective();\n\n    } else {\n\n        this.toOrthographic();\n\n    }\n\n};\n\n// For mantaining similar API with PerspectiveCamera\n\nCombinedCamera.prototype.updateProjectionMatrix = function() {\n\n    if ( this.inPerspectiveMode ) {\n\n        this.toPerspective();\n\n    } else {\n\n        this.toPerspective();\n        this.toOrthographic();\n\n    }\n\n};\n\n/*\n* Uses Focal Length (in mm) to estimate and set FOV\n* 35mm (fullframe) camera is used if frame size is not specified;\n* Formula based on http://www.bobatkins.com/photography/technical/field_of_view.html\n*/\nCombinedCamera.prototype.setLens = function ( focalLength, frameHeight ) {\n\n    if ( frameHeight === undefined ) frameHeight = 24;\n\n    var fov = 2 * THREE.Math.radToDeg( Math.atan( frameHeight / ( focalLength * 2 ) ) );\n\n    this.setFov( fov );\n\n    return fov;\n};\n\n\nCombinedCamera.prototype.setZoom = function( zoom ) {\n\n    this.zoom = zoom;\n\n    if ( this.inPerspectiveMode ) {\n        this.toPerspective();\n    } else {\n        this.toOrthographic();\n    }\n    \n};\n\n\nCombinedCamera.prototype.toDiagonalView = function() {\n    this.position.copy( this.defaultPosition );\n    this.target = new THREE.Vector3();\n    this.lookAt( this.target );\n};\n\nCombinedCamera.prototype.orientationGenerator=function( name ){\n\n  //name is a string of letters of length 1 to 3 representing\n  // the desired orientation : ex : a: above, r: right, ar: above right\n  //, flb: front left bottom\n  \n  var offset = this.position.clone().sub(this.target);\n  var components = name;\n  //console.log(\"offset distance\",offset.length()); \n  \n  var combinedTransform = new THREE.Vector3();\n  for(var i=0;i<components.length;i++)\n  {\n    //console.log(\"handling\", components[i] );\n    var component = components[i];\n    var nPost = this.orientationMap[component].clone();//.multiplyScalar( offset.length() );\n    \n    combinedTransform.add( nPost );\n  }\n  combinedTransform.setLength( offset.length() );\n  //console.log(\"offset disance 2\",combinedTransform.length() );\n  this.position.copy( combinedTransform );\n\n  //console.log(\"offset disance 3\",this.position.clone().sub(this.target).length() );\n  this.lookAt( this.target );\n  //console.log(\"offset disance 4\",this.position.clone().sub(this.target).length() );\n}\n\n/*CombinedCamera.prototype.toFrontView = function() {\n    \n    var offset = this.position.clone().sub( this.target );\n    var nPost = new  THREE.Vector3();\n    nPost.y = -offset.length();\n    this.position.copy( nPost );\n    this.lookAt( this.target );\n};\n\nCombinedCamera.prototype.toFrontLeftView = function() {\n    //TODO: check posisitoning\n    var offset = this.position.clone().sub( this.target );\n    var nPost = new  THREE.Vector3();\n    nPost.y = -offset.length();\n    nPost.x = -offset.length();\n    this.position.copy( nPost );\n    this.lookAt( this.target );\n};\n\nCombinedCamera.prototype.toFrontRightView = function() {\n    //TODO: check posisitoning\n    var offset = this.position.clone().sub( this.target );\n    var nPost = new  THREE.Vector3();\n    nPost.y = -offset.length();\n    nPost.x = offset.length();\n    this.position.copy( nPost );\n    this.lookAt( this.target );\n};\n\nCombinedCamera.prototype.toFrontTopView = function() {\n    //TODO: check posisitoning\n    var offset = this.position.clone().sub( this.target );\n    var nPost = new  THREE.Vector3();\n    nPost.y = -offset.length();\n    nPost.z = offset.length();\n    this.position.copy( nPost );\n    this.lookAt( this.target );\n};\n\nCombinedCamera.prototype.toFrontBottomView = function() {\n    //TODO: check posisitoning\n    var offset = this.position.clone().sub( this.target );\n    var nPost = new  THREE.Vector3();\n    nPost.y = -offset.length();\n    nPost.z = -offset.length();\n    this.position.copy( nPost );\n    this.lookAt( this.target );\n};\n\nCombinedCamera.prototype.toBackView = function() {\n\n    var offset = this.position.clone().sub(this.target);\n    var nPost = new  THREE.Vector3();\n    nPost.y = offset.length();\n    this.position.copy(nPost);\n    this.lookAt(this.target);\n};\n\nCombinedCamera.prototype.toLeftView = function() {\n    \n    var offset = this.position.clone().sub(this.target);\n    var nPost = new  THREE.Vector3();\n    nPost.x = offset.length();\n    this.position.copy(nPost);\n    this.lookAt(this.target);\n    \n};\n\nCombinedCamera.prototype.toRightView = function() {\n    var offset = this.position.clone().sub(this.target);\n    var nPost = new  THREE.Vector3();\n    nPost.x = -offset.length();\n    this.position.copy( nPost );\n    this.lookAt(this.target );\n};\n\nCombinedCamera.prototype.toTopView = function() {\n    this.orientationGenerator( \"a\" );\n};\n\nCombinedCamera.prototype.toBottomView = function() {\n    var offset = this.position.clone().sub(this.target);\n    var nPost = new  THREE.Vector3();\n    nPost.z = -offset.length();\n    this.position.copy( nPost );\n    this.lookAt( this.target );\n};*/\n\nCombinedCamera.prototype.centerView = function() {\n    //var offset = new THREE.Vector3().sub(this.target.clone());\n    //this.position= new THREE.Vector3(100,100,200);\n    //this.target = new THREE.Vector3();\n   \n    this.position.copy( this.defaultPosition );\n    this.lookAt( this.target );\n};\n\nCombinedCamera.prototype.resetView = function() {\n    this.position.copy( this.defaultPosition );\n    this.target.copy( new THREE.Vector3() );\n};\n\n//export default CombinedCamera;\nmodule.exports = CombinedCamera;\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/deps/CombinedCamera.js\n **/","import THREE from 'three'\n\n/**\n * @author kaosat-dev\n * @author qiao / https://github.com/qiao\n * @author mrdoob / http://mrdoob.com\n * @author alteredq / http://alteredqualia.com/\n * @author WestLangley / http://github.com/WestLangley\n */\nvar OrbitControls = function ( object, domElement, upVector ) {\n\n    //this.object = object\n    this.objects = []\n    this.objectOptions = []\n    this.camStates = []\n\n    this.domElement = ( domElement !== undefined ) ? domElement : document\n    this.upVector = upVector || new THREE.Vector3(0,1,0)\n\n\n    // API\n    this.enabled = true\n\n    //this.center = new THREE.Vector3()\n    this.centers = []\n\n    this.userZoom = true\n    this.userZoomSpeed = 1.0\n\n    this.userRotate = true\n    this.userRotateSpeed = 1.0\n\n    this.userPan = true\n    this.userPanSpeed = 2.0\n\n    this.autoRotate = false\n    this.autoRotateSpeed = 2.0 // 30 seconds per round when fps is 60\n\n    this.minPolarAngle = 0 // radians\n    this.maxPolarAngle = Math.PI // radians\n\n    this.minDistance = 0.2\n    this.maxDistance = 600\n\n    this.active = false\n    this.mainPointerPressed = false\n\n    // internals\n\n    var scope = this\n\n    var EPS = 0.000001\n    var PIXELS_PER_ROUND = 1800\n\n    var phiDelta = 0\n    var thetaDelta = 0\n    var scale = 1\n    \n    var origPhiDelta = phiDelta\n    var origThetaDelta = thetaDelta\n    var origScale = scale\n\n    //to add control of multiple cameras\n    this.addObject = function( object, options){\n      if(this.objects.indexOf(object) != -1) return\n      const DEFAULTS = {userZoom:true, userPan:true, userRotate:true} \n      options = Object.assign({}, DEFAULTS, options)\n      \n      this.objects.push( object )\n      this.objectOptions.push(options)\n      this.centers.push( new THREE.Vector3() )\n      this.camStates.push( {phiDelta:0,thetaDelta:0,scale:1,lastPosition:new THREE.Vector3()} )\n    }\n\n    // events\n    var changeEvent = { type: 'change' }\n\n    this.update = function (dt) {\n        //this is a modified version, with inverted Y and Z (since we use camera.z => up)\n        //we also allow multiple objects/cameras\n        for(var i =0; i< this.objects.length;i++)\n        {\n          var object = this.objects[i]\n          var center = this.centers[i]\n          var camState = this.camStates[i]\n          \n          var curThetaDelta = camState.thetaDelta\n          var curPhiDelta   = camState.phiDelta\n          var curScale      = camState.scale\n          \n          var lastPosition = camState.lastPosition\n          \n          var position = object.position\n          var offset = position.clone().sub( center )\n\n          if(this.upVector.z == 1)\n          {\n            // angle from z-axis around y-axis, upVector : z\n            var theta = Math.atan2( offset.x, offset.y )\n            // angle from y-axis\n            var phi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.y * offset.y ), offset.z )\n          }\n          else\n          {\n            //in case of y up\n            var theta = Math.atan2( offset.x, offset.z )\n            var phi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.z * offset.z ), offset.y )\n            curThetaDelta = -(curThetaDelta)\n          }\n\n          if ( this.autoRotate ) {\n              //this.rotateLeft( getAutoRotationAngle() )\n              //PER camera\n              this.objects.map(function(object, index){\n                if(scope.objectOptions[index].userRotate){\n                  scope.camStates[index].thetaDelta += getAutoRotationAngle()\n                }\n              })   \n          }\n\n          theta += curThetaDelta\n          phi += curPhiDelta\n\n          // restrict phi to be between desired limits\n          phi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) )\n          // restrict phi to be betwee EPS and PI-EPS\n          phi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) )\n          //multiply by scaling effect\n          var radius = offset.length() * curScale\n          // restrict radius to be between desired limits\n          radius = Math.max( this.minDistance, Math.min( this.maxDistance, radius ) )\n\n          if(this.upVector.z == 1)\n          {\n            offset.x = radius * Math.sin( phi ) * Math.sin( theta )\n            offset.z = radius * Math.cos( phi )\n            offset.y = radius * Math.sin( phi ) * Math.cos( theta )\n          }\n          else\n          {\n            offset.x = radius * Math.sin( phi ) * Math.sin( theta )\n            offset.y = radius * Math.cos( phi )\n            offset.z = radius * Math.sin( phi ) * Math.cos( theta )\n          }\n\n          //\n          position.copy( center ).add( offset )\n          object.lookAt( center )\n\n          if ( lastPosition.distanceTo( object.position ) > 0 ) {\n              //this.active = true\n              this.dispatchEvent( changeEvent )\n\n              lastPosition.copy( object.position )\n              \n          }\n          else\n          {\n            //fireDeActivated()\n          }\n          \n          camState.thetaDelta /= 1.5\n          camState.phiDelta /= 1.5\n          camState.scale = 1\n        }\n    }\n\n    function getAutoRotationAngle() {\n      return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed\n    }\n\n    function getZoomScale() {\n      return Math.pow( 0.95, scope.userZoomSpeed )\n    }\n    \n    this.enable= function (){\n      scope.enabled = true\n      this.enabled = true\n    }\n    \n    this.disable = function(){\n      scope.enabled = false\n      this.enabled = false\n    }\n\n    this.reset = function(){\n      for(var i=0;i<this.objects.length;i++)\n      {\n        var center = this.centers[i]\n        center = new THREE.Vector3()\n      }\n      this.objects.map(function(object, index){\n        let center = this.centers[index]\n        center = new THREE.Vector3()\n        this.camStates[index].phiDelta   = origPhiDelta\n        this.camStates[index].thetaDelta = origThetaDelta \n        this.camStates[index].scale = origScale = scale\n      })\n\n      this.update()\n    } \n    \n    this.setObservables=function(observables){\n      let {dragMoves$, zooms$} = observables\n\n      let self = this\n\n      /* are these useful ?\n      scope.userZoomSpeed = 0.6\n\n      onPinch\n      */\n      function zoom(zoomDir, zoomScale, cameras){\n\n        if ( scope.enabled === false ) return\n        if ( scope.userZoom === false ) return\n\n        //PER camera\n        cameras.map(function(object, index){\n          if(scope.objectOptions[index].userZoom){\n\n            if(zoomDir < 0) scope.camStates[index].scale /= zoomScale\n            if(zoomDir > 0) scope.camStates[index].scale *= zoomScale\n          }\n        })  \n      }\n\n      function rotate(cameras, angle){\n        \n        if ( scope.enabled === false ) return\n        if ( scope.userRotate === false ) return\n\n        //PER camera\n        cameras.map(function(object, index){\n          if(scope.objectOptions[index].userRotate){\n            scope.camStates[index].thetaDelta += angle.x\n            scope.camStates[index].phiDelta   += angle.y\n\n          }\n        })   \n      }\n\n      //TODO: implement\n      function pan(cameras, offset){\n        //console.log(event)\n        var _origDist = distance.clone()\n\n         //do this PER camera\n        cameras.map(function(object, index){\n            if(scope.objectOptions[index].userPan){\n              let distance = _origDist.clone()\n              distance.transformDirection( object.matrix )\n              distance.multiplyScalar( scope.userPanSpeed )\n              \n              object.position.add( distance )\n              scope.centers[index].add( distance )\n            }\n          })  \n      }\n\n\n      dragMoves$\n        .subscribe(function(e){\n          let delta = e.delta\n\n          /*if ( angle === undefined ) {\n          angle = 2 * Math.PI /180  * scope.userRotateSpeed\n        }*/\n          let angle ={x:0,y:0} \n          angle.x = 2 * Math.PI * delta.x / PIXELS_PER_ROUND * scope.userRotateSpeed\n          angle.y = -2 * Math.PI * delta.y / PIXELS_PER_ROUND * scope.userRotateSpeed\n              \n          //console.log(\"rotate by angle\",angle)\n          /*if ( angle === undefined ) {\n            angle = 2 * Math.PI /180  * scope.userRotateSpeed\n          } */     \n          rotate(self.objects, angle)\n\n        })\n        //.subscribe(e=>e)//console.log(\"dragMoves\",e.delta))\n \n      zooms$\n        .subscribe(function(delta){\n          let zoomScale = undefined\n          if ( !zoomScale ) {\n            zoomScale = getZoomScale()\n          }\n          zoom(delta, zoomScale, self.objects)\n        })\n        //.subscribe(e=>e)//console.log(\"zoom\",e))\n    \n  }\n}\n\nOrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype )\n\nexport default OrbitControls\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/deps/OrbitControls.js\n **/","/**\n * @author mrdoob / http://mrdoob.com/\n * @author supereggbert / http://www.paulbrunt.co.uk/\n * @author julianwa / https://github.com/julianwa\n */\nimport THREE from 'three';\n//var THREE = require(\"three\"); //until it is done via the import syntax everywhere we have to use this\n\n\nTHREE.RenderableObject = function () {\n\n\tthis.id = 0;\n\n\tthis.object = null;\n\tthis.z = 0;\n};\n\n//\n\nTHREE.RenderableFace = function () {\n\n\tthis.id = 0;\n\n\tthis.v1 = new THREE.RenderableVertex();\n\tthis.v2 = new THREE.RenderableVertex();\n\tthis.v3 = new THREE.RenderableVertex();\n\n\tthis.normalModel = new THREE.Vector3();\n\n\tthis.vertexNormalsModel = [ new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3() ];\n\tthis.vertexNormalsLength = 0;\n\n\tthis.color = new THREE.Color();\n\tthis.material = null;\n\tthis.uvs = [ new THREE.Vector2(), new THREE.Vector2(), new THREE.Vector2() ];\n\n\tthis.z = 0;\n\n};\n\n//\n\nTHREE.RenderableVertex = function () {\n\n\tthis.position = new THREE.Vector3();\n\tthis.positionWorld = new THREE.Vector3();\n\tthis.positionScreen = new THREE.Vector4();\n\n\tthis.visible = true;\n\n};\n\nTHREE.RenderableVertex.prototype.copy = function ( vertex ) {\n\n\tthis.positionWorld.copy( vertex.positionWorld );\n\tthis.positionScreen.copy( vertex.positionScreen );\n\n};\n\n//\n\nTHREE.RenderableLine = function () {\n\n\tthis.id = 0;\n\n\tthis.v1 = new THREE.RenderableVertex();\n\tthis.v2 = new THREE.RenderableVertex();\n\n\tthis.vertexColors = [ new THREE.Color(), new THREE.Color() ];\n\tthis.material = null;\n\n\tthis.z = 0;\n\n};\n\n//\n\nTHREE.RenderableSprite = function () {\n\n\tthis.id = 0;\n\n\tthis.object = null;\n\n\tthis.x = 0;\n\tthis.y = 0;\n\tthis.z = 0;\n\n\tthis.rotation = 0;\n\tthis.scale = new THREE.Vector2();\n\n\tthis.material = null;\n\n};\n\n//\n\nTHREE.Projector = function () {\n\n\tvar _object, _objectCount, _objectPool = [], _objectPoolLength = 0,\n\t_vertex, _vertexCount, _vertexPool = [], _vertexPoolLength = 0,\n\t_face, _faceCount, _facePool = [], _facePoolLength = 0,\n\t_line, _lineCount, _linePool = [], _linePoolLength = 0,\n\t_sprite, _spriteCount, _spritePool = [], _spritePoolLength = 0,\n\n\t_renderData = { objects: [], lights: [], elements: [] },\n\n\t_vA = new THREE.Vector3(),\n\t_vB = new THREE.Vector3(),\n\t_vC = new THREE.Vector3(),\n\n\t_vector3 = new THREE.Vector3(),\n\t_vector4 = new THREE.Vector4(),\n\n\t_clipBox = new THREE.Box3( new THREE.Vector3( - 1, - 1, - 1 ), new THREE.Vector3( 1, 1, 1 ) ),\n\t_boundingBox = new THREE.Box3(),\n\t_points3 = new Array( 3 ),\n\t_points4 = new Array( 4 ),\n\n\t_viewMatrix = new THREE.Matrix4(),\n\t_viewProjectionMatrix = new THREE.Matrix4(),\n\n\t_modelMatrix,\n\t_modelViewProjectionMatrix = new THREE.Matrix4(),\n\n\t_normalMatrix = new THREE.Matrix3(),\n\n\t_frustum = new THREE.Frustum(),\n\n\t_clippedVertex1PositionScreen = new THREE.Vector4(),\n\t_clippedVertex2PositionScreen = new THREE.Vector4();\n\t\n\t//\n\n\tthis.projectVector = function ( vector, camera ) {\n\n\t\tconsole.warn( 'THREE.Projector: .projectVector() is now vector.project().' );\n\t\tvector.project( camera );\n\n\t};\n\n\tthis.unprojectVector = function ( vector, camera ) {\n\n\t\tconsole.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' );\n\t\tvector.unproject( camera );\n\n\t};\n\n\tthis.pickingRay = function ( vector, camera ) {\n\n\t\tconsole.error( 'THREE.Projector: .pickingRay() has been removed.' );\n\n\t};\n\t\n\t//\n\n\tvar RenderList = function () {\n\n\t\tvar normals = [];\n\t\tvar uvs = [];\n\n\t\tvar object = null;\n\t\tvar material = null;\n\n\t\tvar normalMatrix = new THREE.Matrix3();\n\n\t\tvar setObject = function ( value ) {\n\n\t\t\tobject = value;\n\t\t\tmaterial = object.material;\n\n\t\t\tnormalMatrix.getNormalMatrix( object.matrixWorld );\n\n\t\t\tnormals.length = 0;\n\t\t\tuvs.length = 0;\n\n\t\t};\n\n\t\tvar projectVertex = function ( vertex ) {\n\n\t\t\tvar position = vertex.position;\n\t\t\tvar positionWorld = vertex.positionWorld;\n\t\t\tvar positionScreen = vertex.positionScreen;\n\n\t\t\tpositionWorld.copy( position ).applyMatrix4( _modelMatrix );\n\t\t\tpositionScreen.copy( positionWorld ).applyMatrix4( _viewProjectionMatrix );\n\n\t\t\tvar invW = 1 / positionScreen.w;\n\n\t\t\tpositionScreen.x *= invW;\n\t\t\tpositionScreen.y *= invW;\n\t\t\tpositionScreen.z *= invW;\n\n\t\t\tvertex.visible = positionScreen.x >= - 1 && positionScreen.x <= 1 &&\n\t\t\t\t\t positionScreen.y >= - 1 && positionScreen.y <= 1 &&\n\t\t\t\t\t positionScreen.z >= - 1 && positionScreen.z <= 1;\n\n\t\t};\n\n\t\tvar pushVertex = function ( x, y, z ) {\n\n\t\t\t_vertex = getNextVertexInPool();\n\t\t\t_vertex.position.set( x, y, z );\n\n\t\t\tprojectVertex( _vertex );\n\n\t\t};\n\n\t\tvar pushNormal = function ( x, y, z ) {\n\n\t\t\tnormals.push( x, y, z );\n\n\t\t};\n\n\t\tvar pushUv = function ( x, y ) {\n\n\t\t\tuvs.push( x, y );\n\n\t\t};\n\n\t\tvar checkTriangleVisibility = function ( v1, v2, v3 ) {\n\n\t\t\tif ( v1.visible === true || v2.visible === true || v3.visible === true ) return true;\n\n\t\t\t_points3[ 0 ] = v1.positionScreen;\n\t\t\t_points3[ 1 ] = v2.positionScreen;\n\t\t\t_points3[ 2 ] = v3.positionScreen;\n\n\t\t\treturn _clipBox.isIntersectionBox( _boundingBox.setFromPoints( _points3 ) );\n\n\t\t};\n\n\t\tvar checkBackfaceCulling = function ( v1, v2, v3 ) {\n\n\t\t\treturn ( ( v3.positionScreen.x - v1.positionScreen.x ) *\n\t\t\t\t    ( v2.positionScreen.y - v1.positionScreen.y ) -\n\t\t\t\t    ( v3.positionScreen.y - v1.positionScreen.y ) *\n\t\t\t\t    ( v2.positionScreen.x - v1.positionScreen.x ) ) < 0;\n\n\t\t};\n\n\t\tvar pushLine = function ( a, b ) {\n\n\t\t\tvar v1 = _vertexPool[ a ];\n\t\t\tvar v2 = _vertexPool[ b ];\n\n\t\t\t_line = getNextLineInPool();\n\n\t\t\t_line.id = object.id;\n\t\t\t_line.v1.copy( v1 );\n\t\t\t_line.v2.copy( v2 );\n\t\t\t_line.z = ( v1.positionScreen.z + v2.positionScreen.z ) / 2;\n\n\t\t\t_line.material = object.material;\n\n\t\t\t_renderData.elements.push( _line );\n\n\t\t};\n\n\t\tvar pushTriangle = function ( a, b, c ) {\n\n\t\t\tvar v1 = _vertexPool[ a ];\n\t\t\tvar v2 = _vertexPool[ b ];\n\t\t\tvar v3 = _vertexPool[ c ];\n\n\t\t\tif ( checkTriangleVisibility( v1, v2, v3 ) === false ) return;\n\n\t\t\tif ( material.side === THREE.DoubleSide || checkBackfaceCulling( v1, v2, v3 ) === true ) {\n\n\t\t\t\t_face = getNextFaceInPool();\n\n\t\t\t\t_face.id = object.id;\n\t\t\t\t_face.v1.copy( v1 );\n\t\t\t\t_face.v2.copy( v2 );\n\t\t\t\t_face.v3.copy( v3 );\n\t\t\t\t_face.z = ( v1.positionScreen.z + v2.positionScreen.z + v3.positionScreen.z ) / 3;\n\n\t\t\t\tfor ( var i = 0; i < 3; i ++ ) {\n\n\t\t\t\t\tvar offset = arguments[ i ] * 3;\n\t\t\t\t\tvar normal = _face.vertexNormalsModel[ i ];\n\n\t\t\t\t\tnormal.set( normals[ offset ], normals[ offset + 1 ], normals[ offset + 2 ] );\n\t\t\t\t\tnormal.applyMatrix3( normalMatrix ).normalize();\n\n\t\t\t\t\tvar offset2 = arguments[ i ] * 2;\n\n\t\t\t\t\tvar uv = _face.uvs[ i ];\n\t\t\t\t\tuv.set( uvs[ offset2 ], uvs[ offset2 + 1 ] );\n\n\t\t\t\t}\n\n\t\t\t\t_face.vertexNormalsLength = 3;\n\n\t\t\t\t_face.material = object.material;\n\n\t\t\t\t_renderData.elements.push( _face );\n\n\t\t\t}\n\n\t\t};\n\n\t\treturn {\n\t\t\tsetObject: setObject,\n\t\t\tprojectVertex: projectVertex,\n\t\t\tcheckTriangleVisibility: checkTriangleVisibility,\n\t\t\tcheckBackfaceCulling: checkBackfaceCulling,\n\t\t\tpushVertex: pushVertex,\n\t\t\tpushNormal: pushNormal,\n\t\t\tpushUv: pushUv,\n\t\t\tpushLine: pushLine,\n\t\t\tpushTriangle: pushTriangle\n\t\t}\n\n\t};\n\n\tvar renderList = new RenderList();\n\n\tthis.projectScene = function ( scene, camera, sortObjects, sortElements ) {\n\n\t\t_faceCount = 0;\n\t\t_lineCount = 0;\n\t\t_spriteCount = 0;\n\n\t\t_renderData.elements.length = 0;\n\n\t\tif ( scene.autoUpdate === true ) scene.updateMatrixWorld();\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\n\t\t_viewMatrix.copy( camera.matrixWorldInverse.getInverse( camera.matrixWorld ) );\n\t\t_viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, _viewMatrix );\n\n\t\t_frustum.setFromMatrix( _viewProjectionMatrix );\n\n\t\t//\n\n\t\t_objectCount = 0;\n\n\t\t_renderData.objects.length = 0;\n\t\t_renderData.lights.length = 0;\n\n\t\tscene.traverseVisible( function ( object ) {\n\n\t\t\tif ( object instanceof THREE.Light ) {\n\n\t\t\t\t_renderData.lights.push( object );\n\n\t\t\t} else if ( object instanceof THREE.Mesh || object instanceof THREE.Line || object instanceof THREE.Sprite ) {\n\n\t\t\t\tif ( object.material.visible === false ) return;\n\n\t\t\t\tif ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) {\n\n\t\t\t\t\t_object = getNextObjectInPool();\n\t\t\t\t\t_object.id = object.id;\n\t\t\t\t\t_object.object = object;\n\n\t\t\t\t\tif ( object.renderDepth !== null ) {\n\n\t\t\t\t\t\t_object.z = object.renderDepth;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_vector3.setFromMatrixPosition( object.matrixWorld );\n\t\t\t\t\t\t_vector3.applyProjection( _viewProjectionMatrix );\n\t\t\t\t\t\t_object.z = _vector3.z;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_renderData.objects.push( _object );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} );\n\n\t\tif ( sortObjects === true ) {\n\n\t\t\t_renderData.objects.sort( painterSort );\n\n\t\t}\n\n\t\t//\n\n\t\tfor ( var o = 0, ol = _renderData.objects.length; o < ol; o ++ ) {\n\n\t\t\tvar object = _renderData.objects[ o ].object;\n\t\t\tvar geometry = object.geometry;\n\n\t\t\trenderList.setObject( object );\n\n\t\t\t_modelMatrix = object.matrixWorld;\n\n\t\t\t_vertexCount = 0;\n\n\t\t\tif ( object instanceof THREE.Mesh ) {\n\n\t\t\t\tif ( geometry instanceof THREE.BufferGeometry ) {\n\n\t\t\t\t\tvar attributes = geometry.attributes;\n\t\t\t\t\tvar offsets = geometry.offsets;\n\n\t\t\t\t\tif ( attributes.position === undefined ) continue;\n\n\t\t\t\t\tvar positions = attributes.position.array;\n\n\t\t\t\t\tfor ( var i = 0, l = positions.length; i < l; i += 3 ) {\n\n\t\t\t\t\t\trenderList.pushVertex( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( attributes.normal !== undefined ) {\n\n\t\t\t\t\t\tvar normals = attributes.normal.array;\n\n\t\t\t\t\t\tfor ( var i = 0, l = normals.length; i < l; i += 3 ) {\n\n\t\t\t\t\t\t\trenderList.pushNormal( normals[ i ], normals[ i + 1 ], normals[ i + 2 ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( attributes.uv !== undefined ) {\n\n\t\t\t\t\t\tvar uvs = attributes.uv.array;\n\n\t\t\t\t\t\tfor ( var i = 0, l = uvs.length; i < l; i += 2 ) {\n\n\t\t\t\t\t\t\trenderList.pushUv( uvs[ i ], uvs[ i + 1 ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( attributes.index !== undefined ) {\n\n\t\t\t\t\t\tvar indices = attributes.index.array;\n\n\t\t\t\t\t\tif ( offsets.length > 0 ) {\n\n\t\t\t\t\t\t\tfor ( var o = 0; o < offsets.length; o ++ ) {\n\n\t\t\t\t\t\t\t\tvar offset = offsets[ o ];\n\t\t\t\t\t\t\t\tvar index = offset.index;\n\n\t\t\t\t\t\t\t\tfor ( var i = offset.start, l = offset.start + offset.count; i < l; i += 3 ) {\n\n\t\t\t\t\t\t\t\t\trenderList.pushTriangle( indices[ i ] + index, indices[ i + 1 ] + index, indices[ i + 2 ] + index );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tfor ( var i = 0, l = indices.length; i < l; i += 3 ) {\n\n\t\t\t\t\t\t\t\trenderList.pushTriangle( indices[ i ], indices[ i + 1 ], indices[ i + 2 ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tfor ( var i = 0, l = positions.length / 3; i < l; i += 3 ) {\n\n\t\t\t\t\t\t\trenderList.pushTriangle( i, i + 1, i + 2 );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( geometry instanceof THREE.Geometry ) {\n\n\t\t\t\t\tvar vertices = geometry.vertices;\n\t\t\t\t\tvar faces = geometry.faces;\n\t\t\t\t\tvar faceVertexUvs = geometry.faceVertexUvs[ 0 ];\n\n\t\t\t\t\t_normalMatrix.getNormalMatrix( _modelMatrix );\n\n\t\t\t\t\tvar isFaceMaterial = object.material instanceof THREE.MeshFaceMaterial;\n\t\t\t\t\tvar objectMaterials = isFaceMaterial === true ? object.material : null;\n\n\t\t\t\t\tfor ( var v = 0, vl = vertices.length; v < vl; v ++ ) {\n\n\t\t\t\t\t\tvar vertex = vertices[ v ];\n\t\t\t\t\t\trenderList.pushVertex( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( var f = 0, fl = faces.length; f < fl; f ++ ) {\n\n\t\t\t\t\t\tvar face = faces[ f ];\n\n\t\t\t\t\t\tvar material = isFaceMaterial === true\n\t\t\t\t\t\t\t ? objectMaterials.materials[ face.materialIndex ]\n\t\t\t\t\t\t\t : object.material;\n\n\t\t\t\t\t\tif ( material === undefined ) continue;\n\n\t\t\t\t\t\tvar side = material.side;\n\n\t\t\t\t\t\tvar v1 = _vertexPool[ face.a ];\n\t\t\t\t\t\tvar v2 = _vertexPool[ face.b ];\n\t\t\t\t\t\tvar v3 = _vertexPool[ face.c ];\n\n\t\t\t\t\t\tif ( material.morphTargets === true ) {\n\n\t\t\t\t\t\t\tvar morphTargets = geometry.morphTargets;\n\t\t\t\t\t\t\tvar morphInfluences = object.morphTargetInfluences;\n\n\t\t\t\t\t\t\tvar v1p = v1.position;\n\t\t\t\t\t\t\tvar v2p = v2.position;\n\t\t\t\t\t\t\tvar v3p = v3.position;\n\n\t\t\t\t\t\t\t_vA.set( 0, 0, 0 );\n\t\t\t\t\t\t\t_vB.set( 0, 0, 0 );\n\t\t\t\t\t\t\t_vC.set( 0, 0, 0 );\n\n\t\t\t\t\t\t\tfor ( var t = 0, tl = morphTargets.length; t < tl; t ++ ) {\n\n\t\t\t\t\t\t\t\tvar influence = morphInfluences[ t ];\n\n\t\t\t\t\t\t\t\tif ( influence === 0 ) continue;\n\n\t\t\t\t\t\t\t\tvar targets = morphTargets[ t ].vertices;\n\n\t\t\t\t\t\t\t\t_vA.x += ( targets[ face.a ].x - v1p.x ) * influence;\n\t\t\t\t\t\t\t\t_vA.y += ( targets[ face.a ].y - v1p.y ) * influence;\n\t\t\t\t\t\t\t\t_vA.z += ( targets[ face.a ].z - v1p.z ) * influence;\n\n\t\t\t\t\t\t\t\t_vB.x += ( targets[ face.b ].x - v2p.x ) * influence;\n\t\t\t\t\t\t\t\t_vB.y += ( targets[ face.b ].y - v2p.y ) * influence;\n\t\t\t\t\t\t\t\t_vB.z += ( targets[ face.b ].z - v2p.z ) * influence;\n\n\t\t\t\t\t\t\t\t_vC.x += ( targets[ face.c ].x - v3p.x ) * influence;\n\t\t\t\t\t\t\t\t_vC.y += ( targets[ face.c ].y - v3p.y ) * influence;\n\t\t\t\t\t\t\t\t_vC.z += ( targets[ face.c ].z - v3p.z ) * influence;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tv1.position.add( _vA );\n\t\t\t\t\t\t\tv2.position.add( _vB );\n\t\t\t\t\t\t\tv3.position.add( _vC );\n\n\t\t\t\t\t\t\trenderList.projectVertex( v1 );\n\t\t\t\t\t\t\trenderList.projectVertex( v2 );\n\t\t\t\t\t\t\trenderList.projectVertex( v3 );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( renderList.checkTriangleVisibility( v1, v2, v3 ) === false ) continue;\n\n\t\t\t\t\t\tvar visible = renderList.checkBackfaceCulling( v1, v2, v3 );\n\n\t\t\t\t\t\tif ( side !== THREE.DoubleSide ) {\n\t\t\t\t\t\t\tif ( side === THREE.FrontSide && visible === false ) continue;\n\t\t\t\t\t\t\tif ( side === THREE.BackSide && visible === true ) continue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_face = getNextFaceInPool();\n\n\t\t\t\t\t\t_face.id = object.id;\n\t\t\t\t\t\t_face.v1.copy( v1 );\n\t\t\t\t\t\t_face.v2.copy( v2 );\n\t\t\t\t\t\t_face.v3.copy( v3 );\n\n\t\t\t\t\t\t_face.normalModel.copy( face.normal );\n\n\t\t\t\t\t\tif ( visible === false && ( side === THREE.BackSide || side === THREE.DoubleSide ) ) {\n\n\t\t\t\t\t\t\t_face.normalModel.negate();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_face.normalModel.applyMatrix3( _normalMatrix ).normalize();\n\n\t\t\t\t\t\tvar faceVertexNormals = face.vertexNormals;\n\n\t\t\t\t\t\tfor ( var n = 0, nl = Math.min( faceVertexNormals.length, 3 ); n < nl; n ++ ) {\n\n\t\t\t\t\t\t\tvar normalModel = _face.vertexNormalsModel[ n ];\n\t\t\t\t\t\t\tnormalModel.copy( faceVertexNormals[ n ] );\n\n\t\t\t\t\t\t\tif ( visible === false && ( side === THREE.BackSide || side === THREE.DoubleSide ) ) {\n\n\t\t\t\t\t\t\t\tnormalModel.negate();\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tnormalModel.applyMatrix3( _normalMatrix ).normalize();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_face.vertexNormalsLength = faceVertexNormals.length;\n\n\t\t\t\t\t\tvar vertexUvs = faceVertexUvs[ f ];\n\n\t\t\t\t\t\tif ( vertexUvs !== undefined ) {\n\n\t\t\t\t\t\t\tfor ( var u = 0; u < 3; u ++ ) {\n\n\t\t\t\t\t\t\t\t_face.uvs[ u ].copy( vertexUvs[ u ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_face.color = face.color;\n\t\t\t\t\t\t_face.material = material;\n\n\t\t\t\t\t\t_face.z = ( v1.positionScreen.z + v2.positionScreen.z + v3.positionScreen.z ) / 3;\n\n\t\t\t\t\t\t_renderData.elements.push( _face );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( object instanceof THREE.Line ) {\n\n\t\t\t\tif ( geometry instanceof THREE.BufferGeometry ) {\n\n\t\t\t\t\tvar attributes = geometry.attributes;\n\n\t\t\t\t\tif ( attributes.position !== undefined ) {\n\n\t\t\t\t\t\tvar positions = attributes.position.array;\n\n\t\t\t\t\t\tfor ( var i = 0, l = positions.length; i < l; i += 3 ) {\n\n\t\t\t\t\t\t\trenderList.pushVertex( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( attributes.index !== undefined ) {\n\n\t\t\t\t\t\t\tvar indices = attributes.index.array;\n\n\t\t\t\t\t\t\tfor ( var i = 0, l = indices.length; i < l; i += 2 ) {\n\n\t\t\t\t\t\t\t\trenderList.pushLine( indices[ i ], indices[ i + 1 ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tvar step = object.mode === THREE.LinePieces ? 2 : 1;\n\n\t\t\t\t\t\t\tfor ( var i = 0, l = ( positions.length / 3 ) - 1; i < l; i += step ) {\n\n\t\t\t\t\t\t\t\trenderList.pushLine( i, i + 1 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( geometry instanceof THREE.Geometry ) {\n\n\t\t\t\t\t_modelViewProjectionMatrix.multiplyMatrices( _viewProjectionMatrix, _modelMatrix );\n\n\t\t\t\t\tvar vertices = object.geometry.vertices;\n\n\t\t\t\t\tif ( vertices.length === 0 ) continue;\n\n\t\t\t\t\tv1 = getNextVertexInPool();\n\t\t\t\t\tv1.positionScreen.copy( vertices[ 0 ] ).applyMatrix4( _modelViewProjectionMatrix );\n\n\t\t\t\t\t// Handle LineStrip and LinePieces\n\t\t\t\t\tvar step = object.mode === THREE.LinePieces ? 2 : 1;\n\n\t\t\t\t\tfor ( var v = 1, vl = vertices.length; v < vl; v ++ ) {\n\n\t\t\t\t\t\tv1 = getNextVertexInPool();\n\t\t\t\t\t\tv1.positionScreen.copy( vertices[ v ] ).applyMatrix4( _modelViewProjectionMatrix );\n\n\t\t\t\t\t\tif ( ( v + 1 ) % step > 0 ) continue;\n\n\t\t\t\t\t\tv2 = _vertexPool[ _vertexCount - 2 ];\n\n\t\t\t\t\t\t_clippedVertex1PositionScreen.copy( v1.positionScreen );\n\t\t\t\t\t\t_clippedVertex2PositionScreen.copy( v2.positionScreen );\n\n\t\t\t\t\t\tif ( clipLine( _clippedVertex1PositionScreen, _clippedVertex2PositionScreen ) === true ) {\n\n\t\t\t\t\t\t\t// Perform the perspective divide\n\t\t\t\t\t\t\t_clippedVertex1PositionScreen.multiplyScalar( 1 / _clippedVertex1PositionScreen.w );\n\t\t\t\t\t\t\t_clippedVertex2PositionScreen.multiplyScalar( 1 / _clippedVertex2PositionScreen.w );\n\n\t\t\t\t\t\t\t_line = getNextLineInPool();\n\n\t\t\t\t\t\t\t_line.id = object.id;\n\t\t\t\t\t\t\t_line.v1.positionScreen.copy( _clippedVertex1PositionScreen );\n\t\t\t\t\t\t\t_line.v2.positionScreen.copy( _clippedVertex2PositionScreen );\n\n\t\t\t\t\t\t\t_line.z = Math.max( _clippedVertex1PositionScreen.z, _clippedVertex2PositionScreen.z );\n\n\t\t\t\t\t\t\t_line.material = object.material;\n\n\t\t\t\t\t\t\tif ( object.material.vertexColors === THREE.VertexColors ) {\n\n\t\t\t\t\t\t\t\t_line.vertexColors[ 0 ].copy( object.geometry.colors[ v ] );\n\t\t\t\t\t\t\t\t_line.vertexColors[ 1 ].copy( object.geometry.colors[ v - 1 ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t_renderData.elements.push( _line );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( object instanceof THREE.Sprite ) {\n\n\t\t\t\t_vector4.set( _modelMatrix.elements[ 12 ], _modelMatrix.elements[ 13 ], _modelMatrix.elements[ 14 ], 1 );\n\t\t\t\t_vector4.applyMatrix4( _viewProjectionMatrix );\n\n\t\t\t\tvar invW = 1 / _vector4.w;\n\n\t\t\t\t_vector4.z *= invW;\n\n\t\t\t\tif ( _vector4.z >= - 1 && _vector4.z <= 1 ) {\n\n\t\t\t\t\t_sprite = getNextSpriteInPool();\n\t\t\t\t\t_sprite.id = object.id;\n\t\t\t\t\t_sprite.x = _vector4.x * invW;\n\t\t\t\t\t_sprite.y = _vector4.y * invW;\n\t\t\t\t\t_sprite.z = _vector4.z;\n\t\t\t\t\t_sprite.object = object;\n\n\t\t\t\t\t_sprite.rotation = object.rotation;\n\n\t\t\t\t\t_sprite.scale.x = object.scale.x * Math.abs( _sprite.x - ( _vector4.x + camera.projectionMatrix.elements[ 0 ] ) / ( _vector4.w + camera.projectionMatrix.elements[ 12 ] ) );\n\t\t\t\t\t_sprite.scale.y = object.scale.y * Math.abs( _sprite.y - ( _vector4.y + camera.projectionMatrix.elements[ 5 ] ) / ( _vector4.w + camera.projectionMatrix.elements[ 13 ] ) );\n\n\t\t\t\t\t_sprite.material = object.material;\n\n\t\t\t\t\t_renderData.elements.push( _sprite );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( sortElements === true ) {\n\n\t\t\t_renderData.elements.sort( painterSort );\n\n\t\t}\n\n\t\treturn _renderData;\n\n\t};\n\n\t// Pools\n\n\tfunction getNextObjectInPool() {\n\n\t\tif ( _objectCount === _objectPoolLength ) {\n\n\t\t\tvar object = new THREE.RenderableObject();\n\t\t\t_objectPool.push( object );\n\t\t\t_objectPoolLength ++;\n\t\t\t_objectCount ++;\n\t\t\treturn object;\n\n\t\t}\n\n\t\treturn _objectPool[ _objectCount ++ ];\n\n\t}\n\n\tfunction getNextVertexInPool() {\n\n\t\tif ( _vertexCount === _vertexPoolLength ) {\n\n\t\t\tvar vertex = new THREE.RenderableVertex();\n\t\t\t_vertexPool.push( vertex );\n\t\t\t_vertexPoolLength ++;\n\t\t\t_vertexCount ++;\n\t\t\treturn vertex;\n\n\t\t}\n\n\t\treturn _vertexPool[ _vertexCount ++ ];\n\n\t}\n\n\tfunction getNextFaceInPool() {\n\n\t\tif ( _faceCount === _facePoolLength ) {\n\n\t\t\tvar face = new THREE.RenderableFace();\n\t\t\t_facePool.push( face );\n\t\t\t_facePoolLength ++;\n\t\t\t_faceCount ++;\n\t\t\treturn face;\n\n\t\t}\n\n\t\treturn _facePool[ _faceCount ++ ];\n\n\n\t}\n\n\tfunction getNextLineInPool() {\n\n\t\tif ( _lineCount === _linePoolLength ) {\n\n\t\t\tvar line = new THREE.RenderableLine();\n\t\t\t_linePool.push( line );\n\t\t\t_linePoolLength ++;\n\t\t\t_lineCount ++\n\t\t\treturn line;\n\n\t\t}\n\n\t\treturn _linePool[ _lineCount ++ ];\n\n\t}\n\n\tfunction getNextSpriteInPool() {\n\n\t\tif ( _spriteCount === _spritePoolLength ) {\n\n\t\t\tvar sprite = new THREE.RenderableSprite();\n\t\t\t_spritePool.push( sprite );\n\t\t\t_spritePoolLength ++;\n\t\t\t_spriteCount ++\n\t\t\treturn sprite;\n\n\t\t}\n\n\t\treturn _spritePool[ _spriteCount ++ ];\n\n\t}\n\n\t//\n\n\tfunction painterSort( a, b ) {\n\n\t\tif ( a.z !== b.z ) {\n\n\t\t\treturn b.z - a.z;\n\n\t\t} else if ( a.id !== b.id ) {\n\n\t\t\treturn a.id - b.id;\n\n\t\t} else {\n\n\t\t\treturn 0;\n\n\t\t}\n\n\t}\n\n\tfunction clipLine( s1, s2 ) {\n\n\t\tvar alpha1 = 0, alpha2 = 1,\n\n\t\t// Calculate the boundary coordinate of each vertex for the near and far clip planes,\n\t\t// Z = -1 and Z = +1, respectively.\n\t\tbc1near =  s1.z + s1.w,\n\t\tbc2near =  s2.z + s2.w,\n\t\tbc1far =  - s1.z + s1.w,\n\t\tbc2far =  - s2.z + s2.w;\n\n\t\tif ( bc1near >= 0 && bc2near >= 0 && bc1far >= 0 && bc2far >= 0 ) {\n\n\t\t\t// Both vertices lie entirely within all clip planes.\n\t\t\treturn true;\n\n\t\t} else if ( ( bc1near < 0 && bc2near < 0 ) || ( bc1far < 0 && bc2far < 0 ) ) {\n\n\t\t\t// Both vertices lie entirely outside one of the clip planes.\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\t// The line segment spans at least one clip plane.\n\n\t\t\tif ( bc1near < 0 ) {\n\n\t\t\t\t// v1 lies outside the near plane, v2 inside\n\t\t\t\talpha1 = Math.max( alpha1, bc1near / ( bc1near - bc2near ) );\n\n\t\t\t} else if ( bc2near < 0 ) {\n\n\t\t\t\t// v2 lies outside the near plane, v1 inside\n\t\t\t\talpha2 = Math.min( alpha2, bc1near / ( bc1near - bc2near ) );\n\n\t\t\t}\n\n\t\t\tif ( bc1far < 0 ) {\n\n\t\t\t\t// v1 lies outside the far plane, v2 inside\n\t\t\t\talpha1 = Math.max( alpha1, bc1far / ( bc1far - bc2far ) );\n\n\t\t\t} else if ( bc2far < 0 ) {\n\n\t\t\t\t// v2 lies outside the far plane, v2 inside\n\t\t\t\talpha2 = Math.min( alpha2, bc1far / ( bc1far - bc2far ) );\n\n\t\t\t}\n\n\t\t\tif ( alpha2 < alpha1 ) {\n\n\t\t\t\t// The line segment spans two boundaries, but is outside both of them.\n\t\t\t\t// (This can't happen when we're only clipping against just near/far but good\n\t\t\t\t//  to leave the check here for future usage if other clip planes are added.)\n\t\t\t\treturn false;\n\n\t\t\t} else {\n\n\t\t\t\t// Update the s1 and s2 vertices to match the clipped line segment.\n\t\t\t\ts1.lerp( s2, alpha1 );\n\t\t\t\ts2.lerp( s1, 1 - alpha2 );\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n};\n\n//module.exports = THREE.Projector;\nexport default THREE.Projector;\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/deps/Projector.js\n **/","import THREE from 'three'\nimport Projector from './Projector'\n\nfunction isRootNode(node){\n  return (node.selectTrickleUp === false && node.selectable === true)\n}\n\nfunction walkUp( node, checker ){\n  if(node){\n    if(checker(node)){\n      return node\n    }\n    if( node.parent)\n    {\n      return walkUp( node.parent, checker )\n    }\n  }\n  return undefined\n}\n\nexport function findSelectionRoot(node){\n  return walkUp(node, isRootNode)\n}\n\nexport function getCoordsFromPosSizeRect(inputs)\n{\n  let {pos,rect,width,height} = inputs\n  let x =   ( (pos.x - rect.left) / width) * 2 - 1\n  let y = - ( (pos.y - rect.top) / height) * 2 + 1\n  //v = new THREE.Vector3((x / this.viewWidth) * 2 - 1, -(y / this.viewHeight) * 2 + 1, 1)\n  return {x,y}\n}\n\nexport function pick(mouseCoords, camera, hiearchyRoot, ortho = false, precision=10){\n  let {x,y} = mouseCoords\n  let mousecoords = new THREE.Vector3(x,y,0.5)\n  let v = mousecoords\n  let intersects = []\n  \n  if( !ortho)\n  {\n    v.unproject( camera )\n    let fooV = v.clone()\n    let raycaster = new THREE.Raycaster(camera.position, v.sub(camera.position).normalize())\n    //raycaster.precision = 10\n    intersects = raycaster.intersectObjects(hiearchyRoot, true)\n  }\n  else\n  {\n    // use picking ray since it's an orthographic camera\n    //var ray = this.projector.pickingRay( v, this.camera )\n    //intersects = ray.intersectObjects( this.hiearchyRoot, true )\n    //see here:\n    THREE.Vector3.prototype.pickingRay = function ( camera ) {\n        let tan = Math.tan( 0.5 * THREE.Math.degToRad( camera.fov ) ) / camera.zoom\n\n        this.x *= tan * camera.aspect\n        this.y *= tan \n        this.z = - 1\n        return this.transformDirection( camera.matrixWorld )\n    }\n\n    let raycaster = new THREE.Raycaster()\n    v.pickingRay( camera )\n    raycaster.set( camera.position, v )\n    intersects = raycaster.intersectObjects(hiearchyRoot, true)\n  }\n  \n  //remove invisibles, dedupe ?? \n  //TODO: use transducers.js ?\n  intersects = intersects\n  .filter(intersect => intersect.object && intersect.object.visible ===true )//&& intersect.object.pickable)\n  .sort(function(a, b) {\n    return a.distance - b.distance\n  })\n  //.reverse()\n\n  return intersects\n}\n\n\n\nclass Selector{\n  constructor(){\n    this.projector = new THREE.Projector()\n    this.camera  = undefined\n    //for camera\n\t\tthis.isOrtho = false\n  }\n  \n  /*pick(event, rect, width, height, scene){\n    event.preventDefault()\n    //console.log(\"rect, width, height\",rect, width, height)\n    var x =   ( (event.clientX - rect.left) / width) * 2 - 1\n    var y = - ( (event.clientY - rect.top) / height) * 2 + 1\n\n    this.hiearchyRoot = scene.children\n\n    return this._pickInner( x, y, null, this.camera)\n  }*/\n\n  pickAlt(pos, rect, width, height, scene){\n    //console.log(\"rect, width, height\",rect, width, height)\n    var x =   ( (pos.x - rect.left) / width) * 2 - 1\n    var y = - ( (pos.y - rect.top) / height) * 2 + 1\n\n    this.hiearchyRoot = scene.children\n\n    return this._pickInner( x, y, null, this.camera)\n  } \n  \n  _pickInner( x, y, isOrtho, camera ){\n    isOrtho = isOrtho || this.isOrtho\n    camera  = camera  || this.camera\n    var mousecoords = new THREE.Vector3(x,y,0.5)\n\n    let intersects = []\n    //v = new THREE.Vector3((x / this.viewWidth) * 2 - 1, -(y / this.viewHeight) * 2 + 1, 1)\n    let v = mousecoords\n    if( !isOrtho)\n\t\t{\n\t\t  v.unproject( camera )\n\t\t  var v1 = v.clone()\n\t\t  var fooV = v.clone()\n\t\t  let raycaster = new THREE.Raycaster(camera.position, v.sub(camera.position).normalize())\n\t\t  //raycaster.precision = 10\n\t\t  intersects = raycaster.intersectObjects(this.hiearchyRoot, true)\n\t\t}\n\t\telse\n\t\t{\n  \t\t// use picking ray since it's an orthographic camera\n  \t\t//var ray = this.projector.pickingRay( v, this.camera )\n  \t\t//intersects = ray.intersectObjects( this.hiearchyRoot, true )\n  \t\t//see here:\n  \t\tTHREE.Vector3.prototype.pickingRay = function ( camera ) {\n          var tan = Math.tan( 0.5 * THREE.Math.degToRad( camera.fov ) ) / camera.zoom\n\n          this.x *= tan * camera.aspect\n          this.y *= tan \n          this.z = - 1\n\n          return this.transformDirection( camera.matrixWorld )\n      }\n\n      let raycaster = new THREE.Raycaster()\n      v.pickingRay( this.camera )\n      raycaster.set( this.camera.position, v )\n      intersects = raycaster.intersectObjects(this.hiearchyRoot, true)\n\t\t}\n\t\t\n\t\t//remove invisibles, dedupe \n    //TODO: use transducers.js\n\t\tintersects = intersects\n    .sort()\n    .filter( (intersect, pos) => {\n\t\t  return ( intersect.object && intersect.object.visible === true && !pos || intersect != intersects[pos - 1])\n\t\t})\n\n\t\treturn intersects\n    \n    /*\n    mousecoords.unproject(camera)\n    raycaster.ray.set( camera.position, mousecoords.sub( camera.position ).normalize() )\n\n    var intersections = raycaster.intersectObjects( this._THREEObject3D.children, true )\n    var firstintersection = ( intersections.length ) > 0 ? intersections[ 0 ] : null\n\n\t\tif (firstintersection !== null) {\n      var pickobject = firstintersection.object\n      if (typeof pickobject.userData !== 'undefined' &&\n          typeof pickobject.userData.props.onPick === 'function') {\n        pickobject.userData.props.onPick(event, firstintersection)\n      }\n    }*/\n  }\n\n}\n\n\nexport default Selector\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/deps/Selector.js\n **/","import THREE from 'three'\n/**\n * original @author stemkoski / http://github.com/stemkoski\n * modified by @kaosat-dev / http://github.com/kaosat-dev\n * Blend three textures additively\n * texel1 + texel2\n * + vec4(0.5, 0.75, 1.0, 1.0)\n */\n\nlet AdditiveBlendShader = {\n\n    uniforms: {\n    \n        \"tDiffuse1\": { type: \"t\", value: null },\n        \"tDiffuse2\": { type: \"t\", value: null },\n        \"tDiffuse3\": { type: \"t\", value: null },\n        \"normalThreshold\": { type: \"f\", value: 0.1 },\n        \"depthThreshold\": { type: \"f\", value: 0.05 },\n        \"strengh\"  : { type: \"f\", value: 0.4 },\n        \"color\"    : { type: \"c\", value: new THREE.Color( 0x000002 ) }\n    },\n\n    vertexShader: [\n\n        \"varying vec2 vUv;\",\n\n        \"void main() {\",\n\n            \"vUv = uv;\",\n            \"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n        \"}\"\n\n    ].join(\"\\n\"),\n\n    fragmentShader: [\n\n        \"uniform sampler2D tDiffuse1;\",\n        \"uniform sampler2D tDiffuse2;\",\n        \"uniform sampler2D tDiffuse3;\",\n        \"uniform float normalThreshold;\",\n        \"uniform float depthThreshold;\",\n        \"uniform float strengh;\",\n        \"uniform vec3 color;\",\n\n        \"varying vec2 vUv;\",\n\n        \"void main() {\",\n\n            \"vec4 colorTexel = texture2D( tDiffuse1, vUv );\",\n            \"vec4 normalTexel = texture2D( tDiffuse2, vUv );\",\n            \"vec4 depthTexel = texture2D( tDiffuse3, vUv );\",\n            \"gl_FragColor = colorTexel;\",\n            \"if( normalTexel.r >= normalThreshold || depthTexel.r >=depthThreshold) {\",\n            \"gl_FragColor= colorTexel*(1.0-strengh) + vec4(color[0], color[1], color[2],1);\",\n            \"}\",\n            \n        \"}\"\n\n    ].join(\"\\n\")\n\n};\n\nexport default AdditiveBlendShader\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/deps/post-process/AdditiveBlendShader.js\n **/","import THREE from 'three'\n\n/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Full-screen textured quad shader\n */\n\nTHREE.CopyShader = {\n\n  uniforms: {\n\n    \"tDiffuse\": { type: \"t\", value: null },\n    \"opacity\":  { type: \"f\", value: 1.0 }\n\n  },\n\n  vertexShader: [\n\n    \"varying vec2 vUv;\",\n\n    \"void main() {\",\n\n      \"vUv = uv;\",\n      \"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n    \"}\"\n\n  ].join(\"\\n\"),\n\n  fragmentShader: [\n\n    \"uniform float opacity;\",\n\n    \"uniform sampler2D tDiffuse;\",\n\n    \"varying vec2 vUv;\",\n\n    \"void main() {\",\n\n      \"vec4 texel = texture2D( tDiffuse, vUv );\",\n      \"gl_FragColor = opacity * texel;\",\n\n    \"}\"\n\n  ].join(\"\\n\")\n\n};\n\nexport default THREE.CopyShader;\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/deps/post-process/CopyShader.js\n **/","import THREE from 'three'\n/**\n * @author zz85 / https://github.com/zz85 | https://www.lab4games.net/zz85/blog\n *\n * Edge Detection Shader using Sobel filter\n * Based on http://rastergrid.com/blog/2011/01/frei-chen-edge-detector\n *\n * aspect: vec2 of (1/width, 1/height)\n */\n\nlet EdgeShader3 = {\n\n    uniforms: {\n\n        \"tDiffuse\": { type: \"t\", value: null },\n        \"aspect\":    { type: \"v2\", value: new THREE.Vector2( 512, 512 ) },\n    },\n\n    vertexShader: [\n\n        \"varying vec2 vUv;\",\n\n        \"void main() {\",\n\n            \"vUv = uv;\",\n            \"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n        \"}\"\n\n    ].join(\"\\n\"),\n\n    fragmentShader: [\n\n        \"uniform sampler2D tDiffuse;\",\n        \"varying vec2 vUv;\",\n        \"uniform vec2 aspect;\",\n\n\n        \"vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);\",\n\n        \"mat3 G[2];\",\n\n        \"const mat3 g0 = mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 );\",\n        \"const mat3 g1 = mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 );\",\n\n\n        \"void main(void)\",\n        \"{\",\n            \"mat3 I;\",\n            \"float cnv[2];\",\n            \"vec3 sample;\",\n\n            \"G[0] = g0;\",\n            \"G[1] = g1;\",\n\n            /* fetch the 3x3 neighbourhood and use the RGB vector's length as intensity value */\n            \"for (float i=0.0; i<3.0; i++)\",\n            \"for (float j=0.0; j<3.0; j++) {\",\n                \"sample = texture2D( tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;\",\n                \"I[int(i)][int(j)] = length(sample);\",\n            \"}\",\n\n            /* calculate the convolution values for all the masks */\n            \"for (int i=0; i<2; i++) {\",\n                \"float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\",\n                \"cnv[i] = dp3 * dp3; \",\n            \"}\",\n\n            \"gl_FragColor = vec4(0.5 * sqrt(cnv[0]*cnv[0]+cnv[1]*cnv[1]));\",\n        \"} \",\n\n    ].join(\"\\n\")\n\n}\n\nexport default EdgeShader3\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/deps/post-process/EdgeShader3.js\n **/","import THREE from 'three'\n/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.EffectComposer = function ( renderer, renderTarget ) {\n\n  this.renderer = renderer;\n\n  if ( renderTarget === undefined ) {\n\n    var pixelRatio = renderer.getPixelRatio();\n\n    var width  = Math.floor( renderer.context.canvas.width  / pixelRatio ) || 1;\n    var height = Math.floor( renderer.context.canvas.height / pixelRatio ) || 1;\n    var parameters = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat, stencilBuffer: false };\n\n    renderTarget = new THREE.WebGLRenderTarget( width, height, parameters );\n\n  }\n\n  this.renderTarget1 = renderTarget;\n  this.renderTarget2 = renderTarget.clone();\n\n  this.writeBuffer = this.renderTarget1;\n  this.readBuffer = this.renderTarget2;\n\n  this.passes = [];\n\n  if ( THREE.CopyShader === undefined )\n    console.error( \"THREE.EffectComposer relies on THREE.CopyShader\" );\n\n  this.copyPass = new THREE.ShaderPass( THREE.CopyShader );\n\n};\n\nTHREE.EffectComposer.prototype = {\n\n  swapBuffers: function() {\n\n    var tmp = this.readBuffer;\n    this.readBuffer = this.writeBuffer;\n    this.writeBuffer = tmp;\n\n  },\n\n  addPass: function ( pass ) {\n\n    this.passes.push( pass );\n\n  },\n\n  insertPass: function ( pass, index ) {\n\n    this.passes.splice( index, 0, pass );\n\n  },\n\n  render: function ( delta ) {\n\n    this.writeBuffer = this.renderTarget1;\n    this.readBuffer = this.renderTarget2;\n\n    var maskActive = false;\n\n    var pass, i, il = this.passes.length;\n\n    for ( i = 0; i < il; i ++ ) {\n\n      pass = this.passes[ i ];\n\n      if ( !pass.enabled ) continue;\n\n      pass.render( this.renderer, this.writeBuffer, this.readBuffer, delta, maskActive );\n\n      if ( pass.needsSwap ) {\n\n        if ( maskActive ) {\n\n          var context = this.renderer.context;\n\n          context.stencilFunc( context.NOTEQUAL, 1, 0xffffffff );\n\n          this.copyPass.render( this.renderer, this.writeBuffer, this.readBuffer, delta );\n\n          context.stencilFunc( context.EQUAL, 1, 0xffffffff );\n\n        }\n\n        this.swapBuffers();\n\n      }\n\n      if ( pass instanceof THREE.MaskPass ) {\n\n        maskActive = true;\n\n      } else if ( pass instanceof THREE.ClearMaskPass ) {\n\n        maskActive = false;\n\n      }\n\n    }\n\n  },\n\n  reset: function ( renderTarget ) {\n\n    if ( renderTarget === undefined ) {\n\n      renderTarget = this.renderTarget1.clone();\n\n      var pixelRatio = this.renderer.getPixelRatio();\n\n      renderTarget.width  = Math.floor( this.renderer.context.canvas.width  / pixelRatio );\n      renderTarget.height = Math.floor( this.renderer.context.canvas.height / pixelRatio );\n\n    }\n\n    this.renderTarget1 = renderTarget;\n    this.renderTarget2 = renderTarget.clone();\n\n    this.writeBuffer = this.renderTarget1;\n    this.readBuffer = this.renderTarget2;\n\n  },\n\n  setSize: function ( width, height ) {\n\n    var renderTarget = this.renderTarget1.clone();\n\n    renderTarget.width = width;\n    renderTarget.height = height;\n\n    this.reset( renderTarget );\n\n  }\n\n};\nexport default THREE.EffectComposer;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/deps/post-process/EffectComposer.js\n **/","import THREE from 'three'\n/**\n * @author alteredq / http://alteredqualia.com/\n * @author davidedc / http://www.sketchpatch.net/\n *\n * NVIDIA FXAA by Timothy Lottes\n * http://timothylottes.blogspot.com/2011/06/fxaa3-source-released.html\n * - WebGL port by @supereggbert\n * http://www.glge.org/demos/fxaa/\n */\n\nTHREE.FXAAShader = {\n\n  uniforms: {\n\n    \"tDiffuse\":   { type: \"t\", value: null },\n    \"resolution\": { type: \"v2\", value: new THREE.Vector2( 1 / 1024, 1 / 512 ) }\n\n  },\n\n  vertexShader: [\n\n    \"void main() {\",\n\n      \"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n    \"}\"\n\n  ].join(\"\\n\"),\n\n  fragmentShader: [\n\n    \"uniform sampler2D tDiffuse;\",\n    \"uniform vec2 resolution;\",\n\n    \"#define FXAA_REDUCE_MIN   (1.0/128.0)\",\n    \"#define FXAA_REDUCE_MUL   (1.0/8.0)\",\n    \"#define FXAA_SPAN_MAX     8.0\",\n\n    \"void main() {\",\n\n      \"vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;\",\n      \"vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;\",\n      \"vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;\",\n      \"vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;\",\n      \"vec4 rgbaM  = texture2D( tDiffuse,  gl_FragCoord.xy  * resolution );\",\n      \"vec3 rgbM  = rgbaM.xyz;\",\n      \"vec3 luma = vec3( 0.299, 0.587, 0.114 );\",\n\n      \"float lumaNW = dot( rgbNW, luma );\",\n      \"float lumaNE = dot( rgbNE, luma );\",\n      \"float lumaSW = dot( rgbSW, luma );\",\n      \"float lumaSE = dot( rgbSE, luma );\",\n      \"float lumaM  = dot( rgbM,  luma );\",\n      \"float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\",\n      \"float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\",\n\n      \"vec2 dir;\",\n      \"dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\",\n      \"dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));\",\n\n      \"float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\",\n\n      \"float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\",\n      \"dir = min( vec2( FXAA_SPAN_MAX,  FXAA_SPAN_MAX),\",\n          \"max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\",\n            \"dir * rcpDirMin)) * resolution;\",\n      \"vec4 rgbA = (1.0/2.0) * (\",\n          \"texture2D(tDiffuse,  gl_FragCoord.xy  * resolution + dir * (1.0/3.0 - 0.5)) +\",\n      \"texture2D(tDiffuse,  gl_FragCoord.xy  * resolution + dir * (2.0/3.0 - 0.5)));\",\n        \"vec4 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * (\",\n      \"texture2D(tDiffuse,  gl_FragCoord.xy  * resolution + dir * (0.0/3.0 - 0.5)) +\",\n          \"texture2D(tDiffuse,  gl_FragCoord.xy  * resolution + dir * (3.0/3.0 - 0.5)));\",\n        \"float lumaB = dot(rgbB, vec4(luma, 0.0));\",\n\n      \"if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {\",\n\n        \"gl_FragColor = rgbA;\",\n\n      \"} else {\",\n        \"gl_FragColor = rgbB;\",\n\n      \"}\",\n\n    \"}\"\n\n  ].join(\"\\n\")\n\n};\n\nexport default THREE.FXAAShader\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/deps/post-process/FXAAShader.js\n **/","import THREE from 'three'\n/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.MaskPass = function ( scene, camera ) {\n\n  this.scene = scene;\n  this.camera = camera;\n\n  this.enabled = true;\n  this.clear = true;\n  this.needsSwap = false;\n\n  this.inverse = false;\n\n};\n\nTHREE.MaskPass.prototype = {\n\n  render: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n    var context = renderer.context;\n\n    // don't update color or depth\n\n    context.colorMask( false, false, false, false );\n    context.depthMask( false );\n\n    // set up stencil\n\n    var writeValue, clearValue;\n\n    if ( this.inverse ) {\n\n      writeValue = 0;\n      clearValue = 1;\n\n    } else {\n\n      writeValue = 1;\n      clearValue = 0;\n\n    }\n\n    context.enable( context.STENCIL_TEST );\n    context.stencilOp( context.REPLACE, context.REPLACE, context.REPLACE );\n    context.stencilFunc( context.ALWAYS, writeValue, 0xffffffff );\n    context.clearStencil( clearValue );\n\n    // draw into the stencil buffer\n\n    renderer.render( this.scene, this.camera, readBuffer, this.clear );\n    renderer.render( this.scene, this.camera, writeBuffer, this.clear );\n\n    // re-enable update of color and depth\n\n    context.colorMask( true, true, true, true );\n    context.depthMask( true );\n\n    // only render where stencil is set to 1\n\n    context.stencilFunc( context.EQUAL, 1, 0xffffffff );  // draw if == 1\n    context.stencilOp( context.KEEP, context.KEEP, context.KEEP );\n\n  }\n\n};\n\n\nTHREE.ClearMaskPass = function () {\n\n  this.enabled = true;\n\n};\n\nTHREE.ClearMaskPass.prototype = {\n\n  render: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n    var context = renderer.context;\n\n    context.disable( context.STENCIL_TEST );\n\n  }\n\n};\n\nlet MaskPass = THREE.MaskPass;\nlet ClearMaskPass = THREE.ClearMaskPass;\nexport {MaskPass};\nexport {ClearMaskPass};\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/deps/post-process/MaskPass.js\n **/","import THREE from 'three'\n\n/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.RenderPass = function ( scene, camera, overrideMaterial, clearColor, clearAlpha ) {\n\n  this.scene = scene;\n  this.camera = camera;\n\n  this.overrideMaterial = overrideMaterial;\n\n  this.clearColor = clearColor;\n  this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 1;\n\n  this.oldClearColor = new THREE.Color();\n  this.oldClearAlpha = 1;\n\n  this.enabled = true;\n  this.clear = true;\n  this.needsSwap = false;\n\n};\n\nTHREE.RenderPass.prototype = {\n\n  render: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n    this.scene.overrideMaterial = this.overrideMaterial;\n\n    if ( this.clearColor ) {\n\n      this.oldClearColor.copy( renderer.getClearColor() );\n      this.oldClearAlpha = renderer.getClearAlpha();\n\n      renderer.setClearColor( this.clearColor, this.clearAlpha );\n\n    }\n\n    renderer.render( this.scene, this.camera, readBuffer, this.clear );\n\n    if ( this.clearColor ) {\n\n      renderer.setClearColor( this.oldClearColor, this.oldClearAlpha );\n\n    }\n\n    this.scene.overrideMaterial = null;\n\n  }\n\n};\n\nexport default THREE.RenderPass;\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/deps/post-process/RenderPass.js\n **/","import THREE from 'three'\n\n/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.ShaderPass = function ( shader, textureID ) {\n\n  this.textureID = ( textureID !== undefined ) ? textureID : \"tDiffuse\";\n\n  this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n  this.material = new THREE.ShaderMaterial( {\n\n          defines: shader.defines || {},\n    uniforms: this.uniforms,\n    vertexShader: shader.vertexShader,\n    fragmentShader: shader.fragmentShader\n\n  } );\n\n  this.renderToScreen = false;\n\n  this.enabled = true;\n  this.needsSwap = true;\n  this.clear = false;\n\n\n  this.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n  this.scene  = new THREE.Scene();\n\n  this.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), null );\n  this.scene.add( this.quad );\n\n};\n\nTHREE.ShaderPass.prototype = {\n\n  render: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n    if ( this.uniforms[ this.textureID ] ) {\n\n      this.uniforms[ this.textureID ].value = readBuffer;\n\n    }\n\n    this.quad.material = this.material;\n\n    if ( this.renderToScreen ) {\n\n      renderer.render( this.scene, this.camera );\n\n    } else {\n\n      renderer.render( this.scene, this.camera, writeBuffer, this.clear );\n\n    }\n\n  }\n\n};\n\nexport default THREE.ShaderPass;\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/deps/post-process/ShaderPass.js\n **/","import THREE from 'three'\n/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Vignette shader\n * based on PaintEffect postprocess from ro.me\n * http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js\n */\n\nTHREE.VignetteShader = {\n\n  uniforms: {\n\n    \"tDiffuse\": { type: \"t\", value: null },\n    \"offset\":   { type: \"f\", value: 1.0 },\n    \"darkness\": { type: \"f\", value: 1.0 }\n\n  },\n\n  vertexShader: [\n\n    \"varying vec2 vUv;\",\n\n    \"void main() {\",\n\n      \"vUv = uv;\",\n      \"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n    \"}\"\n\n  ].join(\"\\n\"),\n\n  fragmentShader: [\n\n    \"uniform float offset;\",\n    \"uniform float darkness;\",\n\n    \"uniform sampler2D tDiffuse;\",\n\n    \"varying vec2 vUv;\",\n\n    \"void main() {\",\n\n      // Eskil's vignette\n\n      \"vec4 texel = texture2D( tDiffuse, vUv );\",\n      \"vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );\",\n      \"gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );\",\n\n      /*\n      // alternative version from glfx.js\n      // this one makes more \"dusty\" look (as opposed to \"burned\")\n\n      \"vec4 color = texture2D( tDiffuse, vUv );\",\n      \"float dist = distance( vUv, vec2( 0.5 ) );\",\n      \"color.rgb *= smoothstep( 0.8, offset * 0.799, dist *( darkness + offset ) );\",\n      \"gl_FragColor = color;\",\n      */\n\n    \"}\"\n\n  ].join(\"\\n\")\n\n};\n\nexport default THREE.VignetteShader;\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/deps/post-process/vignetteShader.js\n **/","export const presets = {\n    renderer:{\n      shadowMapEnabled:true,\n      shadowMapAutoUpdate:true,\n      shadowMapSoft:true,\n      shadowMapType : undefined,//THREE.PCFSoftShadowMap,//THREE.PCFSoftShadowMap,//PCFShadowMap \n      autoUpdateScene : true,//Default ?\n      physicallyBasedShading : false,//Default ?\n      autoClear:true,//Default ?\n      gammaInput:false,\n      gammaOutput:false\n    },\n    cameras:[\n      {\n        name:\"mainCamera\",\n        pos:[75,75,145] ,//[100,-100,100]\n        up:[0,0,1],\n        lens:{\n          fov:45,\n          near:0.1,\n          far:20000,\n        }\n      }\n    ],\n    controls:[\n      {\n        up:[0,0,1],\n        rotateSpeed:2.0,\n        panSpeed:2.0,\n        zoomSpeed:2.0,\n        autoRotate:{\n          enabled:false,\n          speed:0.2\n        },\n        _enabled:true,\n        _active:true,\n      }\n    ],\n    scenes:{\n      \"main\":[\n        //{ type:\"hemisphereLight\", color:\"#FFFF33\", gndColor:\"#FF9480\", pos:[0, 0, 500], intensity:0.6 },\n        { type:\"hemisphereLight\", color:\"#FFEEEE\", gndColor:\"#FFFFEE\", pos:[0, 1200, 1500], intensity:0.8 },\n        { type:\"ambientLight\", color:\"#0x252525\", intensity:0.03 },\n        { type:\"directionalLight\", color:\"#262525\", intensity:0.2 , pos:[150, 150, 1500], castShadow:true, onlyShadow:true}\n        //{ type:\"directionalLight\", color:\"#FFFFFF\", intensity:0.2 , pos:[150,150,1500], castShadow:true, onlyShadow:true}\n      ],\n      \"helpers\":[\n        {type:\"LabeledGrid\"}\n      ]\n    }\n  }\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/presets.js\n **/","import view from './view'\nimport Rx from 'rx'\nimport fs from 'fs'\n\n//BIG hack, because parsers are browserified modules ...\nglobal.Rx = Rx\nconst stlParser = require(\"imports?Rx=rx!usco-stl-parser\")\nconst objParser = require(\"imports?Rx=rx!usco-obj-parser\")\n//import * as stlParser from 'usco-stl-parser'\n//import * as objParser from 'usco-obj-parser'\n\n\nimport {exists,getExtension,getNameAndExtension,isValidFile, isEmpty} from '../../utils/utils'\nimport {postProcessMesh,geometryFromBuffers} from '../../utils/meshUtils'\nimport {meshTools} from 'glView-helpers'\nconst centerMesh         = meshTools.centerMesh\n\n//TODO: refactor ,same as assetManager\nfunction postProcessParsedData(data){\n  let mesh = data \n  mesh = geometryFromBuffers(mesh)\n  mesh = postProcessMesh(mesh)\n  mesh = centerMesh(mesh)\n  return mesh\n}\n\n/*import makeHttpDriver     from '../../core/drivers/simpleHttpDriver'\nimport {requests,resources} from '../../utils/assetManager'\nlet httpDriver   = makeHttpDriver()*/\n\n\n//see http://stackoverflow.com/questions/8609289/convert-a-binary-nodejs-buffer-to-javascript-arraybuffer\nfunction toArrayBuffer(buffer) {\n  var ab = new ArrayBuffer(buffer.length)\n  var view = new Uint8Array(ab)\n  for (var i = 0; i < buffer.length; ++i) {\n      view[i] = buffer[i]\n  }\n  return ab\n}\n\n\n/////////deal with command line args etc\nlet args = process.argv.slice(2)\n\n\nif(args.length>0){\n\n  \n  //more advanced params handling , for later\n  /*\n    console.log(\"params\",args)\n    let params = args.reduce(function(cur,combo){\n    let [name,val]= cur.split(\"=\")\n    combo[name] = val\n  },{})*/\n\n  const uri = args[0]\n  const [width,height] = args[1].split(\"x\").map(e=>parseInt(e))\n\n  const {name,ext} = getNameAndExtension(uri)\n  const resolution = {width,height}\n  const outputPath = `${uri}.png`\n\n  console.log(\"Running renderer with params\", uri,resolution,outputPath)\n\n  let parsers = {}\n  parsers[\"stl\"] = stlParser.default\n  parsers[\"obj\"] = objParser.default\n\n  const data         = toArrayBuffer( fs.readFileSync(uri) )\n  const parse        = parsers[ext]\n  const parseOptions = {}\n  const parsedObs$   = parse(data, parseOptions)\n\n  const data$  = parsedObs$\n    .filter(e=>e.progress === undefined)//seperate out progress data\n    .map(postProcessParsedData)\n    .forEach(mesh => {\n      console.log(\"foooo\")\n      view({mesh,uri:outputPath,resolution})\n    })\n    \n  /*let uris = args\n  const requests$ = Rx.Observable.from(uris)\n   .map(function(uri){\n      return {\n        url:uri\n        ,method:'get'\n        ,type:'resource'\n      }\n    })\n\n  const responses$ = httpDriver(requests$)\n    responses$\n      .forEach(e=>console.log(\"responses\",e))\n  //resources()*/\n}\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/rendererCLI.js\n **/","import THREE from 'three'\nimport OrbitControls from './deps/OrbitControls'\nimport CombinedCamera from './deps/CombinedCamera'\n\nimport {take} from 'ramda'\nimport {pick, getCoordsFromPosSizeRect, findSelectionRoot} from './deps/Selector'\n\n\nexport function positionFromCoords(coords){return{position:{x:coords.x,y:coords.y},event:coords}}\nexport function targetObject(event){ return event.target.object}\nexport function isTransformTool(input){ return [\"translate\",\"rotate\",\"scale\",null,undefined].indexOf(input) > -1 }\n\nexport function selectionAt(event, mouseCoords, camera, hiearchyRoot){\n  //log.debug(\"selection at\",event)\n  //, container, selector, width, height, rootObject\n\n  //let intersects = selector.pickAlt({x:event.clientX,y:event.clientY}, rect, width, height, rootObject)\n  let intersects = pick(mouseCoords, camera, hiearchyRoot )//, ortho = false, precision=10)\n\n  let outEvent = {}\n  outEvent.clientX = event.clientX\n  outEvent.clientY = event.clientY\n  outEvent.offsetX = event.offsetX\n  outEvent.offsetY = event.offsetY\n  outEvent.x = event.x || event.clientX\n  outEvent.y = event.y ||Â event.clientY\n\n  outEvent.detail = {}\n  outEvent.detail.pickingInfos = intersects\n  return outEvent\n}\n\nexport function meshFrom(event){\n  let mesh = undefined\n  if( event && event.detail && event.detail.pickingInfos){\n    let [intersect] = take(1,event.detail.pickingInfos)//we actually only get the best match => DO NOT MODIFY original object\n    if(intersect && intersect.object) {\n      mesh = findSelectionRoot(intersect.object)//now we make sure that what we have is actually selectable\n    }\n  }\n  return mesh\n}\n\n////////////Various \"making\" functions , data/config in, (3d object) instances out \n//yup, like factories ! yikes !\n\n/*create a camera instance from the provided data*/\nexport function makeCamera( cameraData, params ){\n  //let cameraData = cameraData//TODO: merge with defaults using object.assign\n  const DEFAULTS ={\n    width:320,\n    height:240,\n    lens:{\n          fov:45,\n          near:0.1,\n          far:20000,\n    },\n    aspect: 320/240,\n    up:[0,0,1],\n    pos:[0,0,0]\n  }\n  cameraData = Object.assign({}, DEFAULTS, cameraData)\n\n\n  let camera = new CombinedCamera(\n        cameraData.width,\n        cameraData.height,\n        cameraData.lens.fov,\n        cameraData.lens.near,\n        cameraData.lens.far,\n        cameraData.lens.near,\n        cameraData.lens.far)\n\n  camera.up.fromArray( cameraData.up )  \n  camera.position.fromArray( cameraData.pos )\n  return camera\n}\n\n\n/*setup a controls instance from the provided data*/\nexport function makeControls( controlsData ){\n  let up = new THREE.Vector3().fromArray( controlsData.up )\n\n  //controlsData = controlsData//TODO: merge with defaults using object.assign\n  let controls = new OrbitControls(undefined, undefined, up )\n  controls.upVector = up\n  \n  controls.userPanSpeed = controlsData.panSpeed\n  controls.userZoomSpeed = controlsData.zoomSpeed\n  controls.userRotateSpeed = controlsData.rotateSpeed\n\n  controls.autoRotate = controlsData.autoRotate.enabled\n  controls.autoRotateSpeed = controlsData.autoRotate.speed\n  \n  return controls\n}\n\n/*create a light instance from the provided data*/\nexport function makeLight( lightData ){\n  let light = undefined\n  const DEFAULTS ={\n    color:\"#FFF\",\n    intensity:1,\n    pos: [0,0,0]\n  }\n  lightData = Object.assign({}, DEFAULTS, lightData)\n\n  switch(lightData.type){\n    case \"light\":\n       light = new THREE.Light(lightData.color)\n       light.intensity = lightData.intensity\n    break\n    case \"hemisphereLight\":\n      light = new THREE.HemisphereLight(lightData.color, lightData.gndColor, lightData.intensity)\n    break\n    case \"ambientLight\":\n      // ambient light does not have intensity, only color\n      let newColor = new THREE.Color( lightData.color )\n      newColor.r *= lightData.intensity\n      newColor.g *= lightData.intensity\n      newColor.b *= lightData.intensity\n      light = new THREE.AmbientLight( newColor )\n    break\n    case \"directionalLight\":\n      const dirLightDefaults = {\n        castShadow:false,\n        onlyShadow:false,\n\n        shadowMapWidth:2048,\n        shadowMapHeight:2048,\n        shadowCameraLeft:-500,\n        shadowCameraRight:500,\n        shadowCameraTop:500,\n        shadowCameraBottom:-500,\n        shadowCameraNear: 1200,\n        shadowCameraFar:5000,\n        shadowCameraFov:50,\n        shadowBias:0.0001,\n        shadowDarkness:0.3,\n        shadowCameraVisible:false\n      }\n      lightData = Object.assign({}, dirLightDefaults, lightData)\n      light = new THREE.DirectionalLight( lightData.color, lightData.intensity )\n      for(var key in lightData) {\n        if(light.hasOwnProperty(key)) {\n          light[key] = lightData[key]\n        }\n      }\n\n    break\n    default:\n      throw new Error(\"could not create light\")\n    break\n  }\n\n  light.position.fromArray( lightData.pos )\n\n  return light\n}\n\n\nfunction cameraWobble3dHint(camera, time=1500){\n  let camPos = camera.position.clone()\n  let target = camera.position.clone().add(new THREE.Vector3(-5,-10,-5))\n\n  let tween = new TWEEN.Tween( camPos )\n    .to( target , time )\n    .repeat( Infinity )\n    .delay( 500 )\n    .yoyo(true)\n    .easing( TWEEN.Easing.Cubic.InOut )\n    .onUpdate( function () {\n      camera.position.copy(camPos)\n    } )\n    .start()\n\n  let camRot = camera.rotation.clone()\n  //let rtarget = camera.rotation.clone().add(new THREE.Vector3(50,50,50))\n\n  /*let tween2 = new TWEEN.Tween( camRot )\n    .to( rtarget , time )\n    .repeat( Infinity )\n    .delay( 500 )\n    .yoyo(true)\n    .easing( TWEEN.Easing.Quadratic.InOut )\n    .onUpdate( function () {\n      camera.position.copy(camRot)\n    } )\n    .start()*/\n  return tween\n}\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/utils2.js\n **/","import THREE from 'three'\nimport {makeCamera, makeControls, makeLight, renderMeta\n} from './utils2'\nimport {presets} from './presets' //default configuration for lighting, cameras etc\n\nimport EffectComposer from './deps/post-process/EffectComposer'\nimport ShaderPass from './deps/post-process/ShaderPass'\nimport RenderPass from './deps/post-process/RenderPass'\nimport {ClearMaskPass, MaskPass} from './deps/post-process/MaskPass'\n\nimport CopyShader     from './deps/post-process/CopyShader'\nimport FXAAShader     from './deps/post-process/FXAAShader'\nimport vignetteShader from './deps/post-process/vignetteShader'\n\n\nimport EdgeShader3 from './deps/post-process/EdgeShader3'\nimport AdditiveBlendShader from './deps/post-process/AdditiveBlendShader'\n\n\nimport {planes,grids,annotations,objectEffects,CamViewControls} from 'glView-helpers'\nimport LabeledGrid from 'glView-helpers/lib/grids/LabeledGrid'\nlet zoomToFit      = objectEffects.zoomToFit\n\nimport bufferToPng from './bufferToPng'\n\nlet gl = require('gl')()//(width, height, { preserveDrawingBuffer: true })\n\n//console.log(\"helpers.grids\",helpers,helpers.grids)\n//let LabeledGrid = helpers.grids.LabeledGrid\nlet ShadowPlane    = planes.ShadowPlane\n\nfunction makeGlRendering(){\n}\n\n\n//Helpers for offline Rendering\n\nfunction contextToBuffer(gl, width, height, depth=4){\n  let buffer = new Uint8Array(width * height * depth)\n  gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buffer)\n  return buffer\n}\n\nfunction writeBufferToFile(buffer, width, height, path){\n  bufferToPng(buffer, width, height, path)\n}\n\nfunction writeContextToFile(context, width, height, depth, path=\"./test.png\"){\n  let buffer = contextToBuffer(context, width, height, depth)\n  writeBufferToFile( buffer, width, height, path )\n}\n\n//////////////////////////////////////////////////\n\n\nfunction setupPostProcess(renderer, camera, scene, params){\n\n  const {width, height, devicePixelRatio, renderToScreen} = params\n    ////////post processing\n    let renderTargetParameters = {\n        minFilter: THREE.LinearFilter,\n        magFilter: THREE.LinearFilter,\n        format: THREE.RGBAFormat,\n        stencilBuffer: true\n    }\n\n    let outScene = new THREE.Scene()\n    let maskScene = new THREE.Scene()\n\n    let renderTarget = new THREE.WebGLRenderTarget(width, height, renderTargetParameters)\n\n    //setup composer\n    let composer    = new EffectComposer(renderer)\n    composer.renderTarget1.stencilBuffer = true\n    composer.renderTarget2.stencilBuffer = true\n\n    let normal      = new RenderPass(scene, camera)\n    let outline     = new RenderPass(outScene, camera)\n    let maskPass        = new THREE.MaskPass(maskScene, camera)\n    maskPass.inverse = true\n    let clearMask   = new THREE.ClearMaskPass()\n    let copyPass     = new THREE.ShaderPass(THREE.CopyShader)\n    let fxaaPass     = new THREE.ShaderPass( THREE.FXAAShader )\n    let vignettePass = new THREE.ShaderPass( THREE.VignetteShader )\n\n    fxaaPass.uniforms[ 'resolution' ].value.set( 1 / width*devicePixelRatio, 1 / height*devicePixelRatio )\n    vignettePass.uniforms[ \"offset\" ].value = 0.95\n    vignettePass.uniforms[ \"darkness\" ].value = 0.9\n\n    renderer.autoClear = false\n    //renderer.autoClearStencil = false    \n    outline.clear = false  \n    //normal.clear = false    \n\n    composer.addPass(normal)\n    composer.addPass(maskPass)\n    composer.addPass(outline)\n    \n    composer.addPass(clearMask)\n    //composer.addPass(vignettePass)\n    //composer.addPass(fxaaPass)\n    composer.addPass(copyPass)\n\n    let lastPass = composer.passes[composer.passes.length-1]\n    lastPass.renderToScreen = renderToScreen\n    \n    return {composers:[composer], fxaaPass, outScene, maskScene}\n    \n\n\n    //return {composer:finalComposer, fxaaPass, outScene, maskScene, composers:[normalComposer,depthComposer,finalComposer]}\n  }\n\n  function setupPostProcess2(renderer, camera, scene, params){\n\n   //FIXME hack\n  if(!renderer.context.canvas){\n    renderer.context.canvas = {\n      width:params.width\n      ,height:params.height\n    }\n  }\n\n  let ppData = setupPostProcess(renderer, camera, scene, params)\n  //composer = ppData.composer\n  let composers = ppData.composers\n  /*fxaaPass = ppData.fxaaPass\n  outScene = ppData.outScene\n  maskScene = ppData.maskScene*/\n  return composers\n}\n\n///various helpers\n\nfunction makeOfflineCanvas(){\n  // mock object, not used in our test case, might be problematic for some workflow\n  let canvas = new Object()\n  canvas.addEventListener = function(e,b){\n    //only for contextLost\n    //console.log(\"canvas addEventListener\",e,b)\n  }\n  return canvas\n}\n\nfunction makeLiveCanvas(){\n  let canvas = document.createElement('canvas')\n  return canvas\n}\n\nfunction makeCanvas(){\n  if(typeof window !== 'undefined'){\n    return makeLiveCanvas()\n  }\n  return makeOfflineCanvas()\n}\n\nfunction handleResize (sizeInfos){\n  //log.debug(\"setting glView size\",sizeInfos)\n  console.log(\"setting glView size\",sizeInfos)\n  let {width,height,aspect} = sizeInfos\n\n  if(width >0 && height >0 && camera && renderer){\n    renderer.setSize( width, height )\n    camera.aspect = aspect\n    camera.setSize(width,height)\n    camera.updateProjectionMatrix()   \n    \n    let pixelRatio = window.devicePixelRatio || 1\n    fxaaPass.uniforms[ 'resolution' ].value.set (1 / (width * pixelRatio), 1 / (height * pixelRatio))\n    \n    composers.forEach( c=> {\n      c.reset()\n      c.setSize(width * pixelRatio, height * pixelRatio)\n    } )\n  }\n}\n\nfunction setupWindowSpecific(container, renderer, camera){\n  console.log(\"initializing into container\",container)\n  container.appendChild( renderer.domElement )\n\n  //controls are only needed for live aka browser mode\n  let controls = makeControls(config.controls[0])\n  let transformControls = new TransformControls( camera )\n  //controls, transformControls\n\n  //prevents zooming the 3d view from scrolling the window\n  preventScroll(container)\n  transformControls.setDomElement( container )\n\n  //more init\n  controls.setObservables( actions.filteredInteractions$ )\n  controls.addObject( camera )\n\n  //let pixelRatio = window.devicePixelRatio || 1\n  return {\n    updateables : [controls,transformControls]\n  }\n}\n\nfunction setupNodeSpecific(renderer, camera, scene){\n  camera.lookAt(scene.position)\n}\n\nfunction monkeyPatchGl(gl){\n\n  function checkObject(object) {\n    return typeof object === 'object' ||\n         (object       === void 0)\n  }\n\n  //Don't allow: \", $, `, @, \\, ', \\0\n  function isValidString(str) {\n      return !(/[\\\"\\$\\`\\@\\\\\\'\\0]/.test(str))\n  }\n\n  function checkWrapper(context, object, wrapper) {\n    if(!checkValid(object, wrapper)) {\n      setError(context, gl.INVALID_VALUE)\n      return false\n    } else if(!checkOwns(context, object)) {\n      setError(context, gl.INVALID_OPERATION)\n      return false\n    }\n    return true\n  }\n\n\n  function shaderSource(shader, source) {\n    if(!checkObject(shader)) {\n      throw new TypeError('shaderSource(WebGLShader, String)')\n    }\n    if(!shader || (!source && typeof source !== 'string')) {\n      setError(this, gl.INVALID_VALUE)\n      return\n    }\n    source += ''\n    if(!isValidString(source)) {\n      setError(this, gl.INVALID_VALUE)\n      return\n    } else if(checkWrapper(this, shader, WebGLShader)) {\n\n      //patch \n      if(source.indexOf( 'precision' ) >= 0){\n\n        //'#ifdef GL_ES',\n        var sourceChunks = source.split('\\n')\n        \n        sourceChunks.map(function(chunk){\n          console.log(\"chunk\",chunk)\n        })\n\n        //sourceChunks = sourceChunks.concat(['#endif'])\n        source = sourceChunks.concat('\\n')\n      }\n\n      _shaderSource.call(this, shader._|0, wrapShader(shader._type, source))\n      shader._source = source\n    }\n  }\n  //gl.shaderSource = shaderSource.bind(gl)\n  return gl\n\n  //gl.shaderSource()\n  //\n}\n\n\nfunction render(renderer, composers, camera, scene ){\n  composers.forEach(c=>c.render())\n  //renderer.render(scene, camera)\n  \n  /*let width = 640\n  let height = 480\n  let rtTexture = new THREE.WebGLRenderTarget(width, height, {\n    minFilter: THREE.LinearFilter,\n    magFilter: THREE.NearestFilter,\n    format: THREE.RGBAFormat\n  })\n\n  renderer.render(scene, camera, rtTexture, true)*/\n\n  //composer.passes[composer.passes.length-1].uniforms[ 'tDiffuse2' ].value = composers[0].renderTarget2\n  //composer.passes[composer.passes.length-1].uniforms[ 'tDiffuse3' ].value = composers[1].renderTarget2\n}\n\nfunction setupScene(scene, extras, config){\n  config.scenes[\"main\"]\n    //TODO , update to be more generic\n    .map(light=>makeLight( light ))\n    .forEach(light=>scene.add(light))\n\n  return scene\n}\n\nfunction setupRenderer(canvas, context, config){\n  const pixelRatio = 1\n  \n  let renderer = new THREE.WebGLRenderer( \n    {\n      antialias:false,  \n      preserveDrawingBuffer: true,\n      //width: 0,\n      //height: 0,\n      canvas,\n      context\n    })\n  renderer.setClearColor( \"#fff\" )\n  renderer.setPixelRatio( pixelRatio )\n  Object.keys(config.renderer).map(function(key){\n    //TODO add hasOwnProp check\n    renderer[key] = config.renderer[key]\n  }) \n  \n  console.log(\"renderer setup DONE\")\n\n  return renderer\n}\n\nfunction getDefaultsWindowSpecific(){\n  const params = {\n    width : window.innerWidth\n    ,height: window.innerHeight\n    ,pixelRatio:window.devicePixelRatio || 1\n  }\n  return params\n}\n\nfunction makeDefaults(data){\n  const params = {\n    width:resolution.width\n    ,height:resolution.height\n    ,devicePixelRatio:1\n    ,renderToScreen:(typeof window !== 'undefined')//FALSE if you want server side renders\n  }\n}\n\n//////////////////////////////////////////////////\n\nexport default function view(data){\n  let {mesh,uri,resolution} = data\n\n  let config = presets\n  const params = {\n    width:resolution.width\n    ,height:resolution.height\n    ,devicePixelRatio:1\n    ,renderToScreen:(typeof window !== 'undefined')//FALSE if you want server side renders\n  }\n\n  gl = monkeyPatchGl(gl)\n\n  let renderer = null\n  let composer = null\n  let composers = []\n  let outScene = null\n  let maskScene = null\n\n\n  let scene             = new THREE.Scene()\n  let dynamicInjector   = new THREE.Object3D()//all dynamic mapped objects reside here\n  scene.dynamicInjector = dynamicInjector\n  scene.add( dynamicInjector )\n\n  let camera   = makeCamera(config.cameras[0], params)\n   //let grid        = new LabeledGrid(200, 200, 10, config.cameras[0].up) //needs CANVAS....\n  let shadowPlane = new ShadowPlane(2000, 2000, null, config.cameras[0].up) \n\n  let material = new THREE.ShaderMaterial()\n\n  //material = new THREE.MeshBasicMaterial( { color: 0xf0ff00 } )\n  //material = new THREE.MeshPhongMaterial( { color: 0x17a9f5, specular: 0xffffff, shininess: 5, shading: THREE.FlatShading} )//NOT WORKING => black shape\n  //material = new THREE.MeshBasicMaterial( { color: 0xffaa00, transparent: true, blending: THREE.AdditiveBlending } ) //NOT WORKING => all white\n  //material = new THREE.MeshLambertMaterial( { color: 0xdddddd, shading: THREE.SmoothShading } )  //NOT WORKING => black shape\n  material = new THREE.MeshNormalMaterial( { shading: THREE.SmoothShading } ) //THIS WORKS\n  //material = new THREE.MeshBasicMaterial( { color: 0xffaa00, wireframe: true } )//THIS WORKS\n  //material = new THREE.MeshDepthMaterial() //NOT WORKING => all white\n  \n  //hack\n  mesh.material = material\n  dynamicInjector.add(mesh)\n\n  const sceneExtras = [camera, shadowPlane]\n\n  let canvas = makeCanvas()\n  renderer   = setupRenderer(canvas, gl, config)\n  scene      = setupScene(scene, sceneExtras, config)\n  composers  = setupPostProcess2(renderer, camera, scene, params)\n\n\n  //do context specific config\n  setupNodeSpecific(renderer, camera, scene)\n  //this is too hard coded\n  const targetNode = dynamicInjector\n  zoomToFit(targetNode, camera, new THREE.Vector3() )\n\n  ///do the actual rendering\n  render(renderer, composers, camera, scene)\n\n  //now we output to file\n  let _gl = renderer.getContext()\n  writeContextToFile(_gl, params.width, params.height,4,uri)//,4, path)\n}\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/webgl/view.js\n **/","import THREE from \"three\"\n\n//TODO: UNIFY api for parsers, this is redundant\nexport function postProcessMesh( shape ){\n\n  //geometry\n  if( !(shape instanceof THREE.Object3D) )\n  {\n    let material = new THREE.MeshPhongMaterial( { color: 0x17a9f5, specular: 0xffffff, shininess: 5, shading: THREE.FlatShading} )\n    shape = new THREE.Mesh(shape, material)\n  }\n\n  //FIXME  should this be handled by the asset manager or the parsers ? \n  //ie , this won't work for loaded hierarchies etc\n  let geometry = shape.geometry\n  if(geometry)\n  {\n    geometry.computeVertexNormals()//needed at least for .ply files\n    geometry.computeFaceNormals()\n  }\n\n  /* OLD STUFF, needs to be sorted out \n    var vs = require('./vertShader.vert')();\n    var fs = require('./fragShader.frag')();\n\n    var material = new THREE.RawShaderMaterial( {\n            uniforms: {\n              time: { type: \"f\", value: 1.0 }\n            },\n            vertexShader: vs,\n            fragmentShader: fs,\n            side: THREE.DoubleSide,\n            transparent: true\n\n          } );\n    var material = new this.defaultMaterialType({color:color, specular: 0xffffff, shininess: 2, shading: THREE.FlatShading});//,vertexColors: THREE.VertexColors\n  */\n\n\n\n  //Additional hack, only for buffer geometry\n  if(!geometry.morphTargets) geometry.morphTargets=[]\n  if(!geometry.morphNormals) geometry.morphNormals=[]\n  return shape\n}\n\n\nexport function geometryFromBuffers({positions,normals,indices,colors}){\n  let geometry = new THREE.BufferGeometry()\n\n  geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) )\n  geometry.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) )\n  \n  if(indices){\n    geometry.addAttribute( 'index', new THREE.BufferAttribute( indices, 1 ) )\n  }\n  if(colors){\n    geometry.addAttribute( 'color', new THREE.BufferAttribute( colors, 1 ) )\n  }\n\n  return geometry\n}\n\n\n//import Hashes from 'jshashes'\nexport function meshTohash(mesh){\n  //let SHA512 = new Hashes.SHA512\n  //geometry.vertices\n  /*for obj in meshLoader.loadMeshes(arg):\n    for mesh in obj._meshList:\n      hash.update(mesh.vertexes.tostring())*/\n\n  const modelHash = hash.hex()\n  return modelHash\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/utils/meshUtils.js\n **/","export function trim(string){\n  return String(string).replace(/^\\s+|\\s+$/g, '');\n}\n\nexport function exists(input){\n  return input !== null && input !== undefined\n}\n\n//utiity to determine if a string is empty, null, or full of whitespaces\nexport function isEmpty(str) {\n  if(! (typeof str === \"string\")) return false //UUUGH bad way of checking not a string\n  return (!str || /^\\s*$/.test(str) || str.length === 0 || !str.trim() )\n}\n\nexport function itemsEqual(a,b){\n  //perhaps an immutable library would not require such horrors?\n  if(JSON.stringify(a)===JSON.stringify(b)){\n    return true\n  }\n  return false\n}\n\n/*converts input data to array if it is not already an array*/\nexport function toArray(data){\n  if(!data) return []\n  if(data.constructor !== Array) return [data]\n  return data\n}\n\n/* JSON parse that always returns an object*/\nexport function safeJSONParse(str){\n  try{\n    return JSON.parse(str) || {} //from cycle.js\n  }catch(error){\n    throw new Error(\"Error parsing data\",JSON.stringify(str))\n  }\n}\n\n//file utils ??\nexport function getExtension(fname){\n  return fname.substr((~-fname.lastIndexOf(\".\") >>> 0) + 2).toLowerCase()\n}\n\nexport function getNameAndExtension(uri){\n  const _uriElems = uri.split(\"?\");\n  const name = _uriElems.shift().split(\"/\").pop()\n  const ext  = getExtension(uri)\n  return {name,ext}\n}\n\nexport function isValidFile(file){\n  return ((typeof file !== \"undefined\" && file !== null) && file instanceof File)\n}\n\n\n//TODO: taken from three.js ,do correct attribution\nexport function generateUUID() {\n\n  // http://www.broofa.com/Tools/Math.uuid.htm\n\n  let chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split( '' );\n  let uuid = new Array( 36 );\n  let rnd = 0, r;\n\n  return function () {\n\n    for ( let i = 0; i < 36; i ++ ) {\n\n      if ( i == 8 || i == 13 || i == 18 || i == 23 ) {\n\n        uuid[ i ] = '-';\n\n      } else if ( i == 14 ) {\n\n        uuid[ i ] = '4';\n\n      } else {\n\n        if ( rnd <= 0x02 ) rnd = 0x2000000 + ( Math.random() * 0x1000000 ) | 0;\n        r = rnd & 0xf;\n        rnd = rnd >> 4;\n        uuid[ i ] = chars[ ( i == 19 ) ? ( r & 0x3 ) | 0x8 : r ];\n\n      }\n    }\n    return uuid.join( '' )\n  }()\n}\n\n\n/** WEBPACK FOOTER **\n ** ./src/utils/utils.js\n **/","\"use strict\";\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _three = require(\"three\");\n\nvar _three2 = _interopRequireDefault(_three);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/*TODO:\n - refactor\n - use label helper\n*/\n\nvar LabeledGrid = (function (_THREE$Object3D) {\n  _inherits(LabeledGrid, _THREE$Object3D);\n\n  function LabeledGrid() {\n    var width = arguments.length <= 0 || arguments[0] === undefined ? 200 : arguments[0];\n    var length = arguments.length <= 1 || arguments[1] === undefined ? 200 : arguments[1];\n    var step = arguments.length <= 2 || arguments[2] === undefined ? 100 : arguments[2];\n    var upVector = arguments.length <= 3 || arguments[3] === undefined ? [0, 1, 0] : arguments[3];\n    var color = arguments.length <= 4 || arguments[4] === undefined ? 0x00baff : arguments[4];\n    var opacity = arguments.length <= 5 || arguments[5] === undefined ? 0.2 : arguments[5];\n    var text = arguments.length <= 6 || arguments[6] === undefined ? true : arguments[6];\n    var textColor = arguments.length <= 7 || arguments[7] === undefined ? \"#000000\" : arguments[7];\n    var textLocation = arguments.length <= 8 || arguments[8] === undefined ? \"center\" : arguments[8];\n\n    _classCallCheck(this, LabeledGrid);\n\n    var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(LabeledGrid).call(this));\n\n    _this.width = width;\n    _this.length = length;\n    _this.step = step;\n    _this.color = color;\n    _this.opacity = opacity;\n    _this.text = text;\n    _this.textColor = textColor;\n    _this.textLocation = textLocation;\n    _this.upVector = new _three2.default.Vector3().fromArray(upVector);\n\n    _this.name = \"grid\";\n\n    //TODO: clean this up\n    _this.marginSize = 10;\n    _this.stepSubDivisions = 10;\n\n    _this._drawGrid();\n\n    //default grid orientation is z up, rotate if not the case\n    var upVector = _this.upVector;\n    _this.up = upVector;\n    _this.lookAt(upVector);\n    return _this;\n  }\n\n  _createClass(LabeledGrid, [{\n    key: \"_drawGrid\",\n    value: function _drawGrid() {\n      var gridGeometry, gridMaterial, mainGridZ, planeFragmentShader, planeGeometry, planeMaterial, subGridGeometry, subGridMaterial, subGridZ;\n\n      //offset to avoid z fighting\n      mainGridZ = -0.05;\n      gridGeometry = new _three2.default.Geometry();\n      gridMaterial = new _three2.default.LineBasicMaterial({\n        color: new _three2.default.Color().setHex(this.color),\n        opacity: this.opacity,\n        linewidth: 2,\n        transparent: true\n      });\n\n      subGridZ = -0.05;\n      subGridGeometry = new _three2.default.Geometry();\n      subGridMaterial = new _three2.default.LineBasicMaterial({\n        color: new _three2.default.Color().setHex(this.color),\n        opacity: this.opacity / 2,\n        transparent: true\n      });\n\n      var step = this.step;\n      var stepSubDivisions = this.stepSubDivisions;\n      var width = this.width;\n      var length = this.length;\n\n      var centerBased = true;\n\n      if (centerBased) {\n        for (var i = 0; i <= width / 2; i += step / stepSubDivisions) {\n          subGridGeometry.vertices.push(new _three2.default.Vector3(-length / 2, i, subGridZ));\n          subGridGeometry.vertices.push(new _three2.default.Vector3(length / 2, i, subGridZ));\n\n          subGridGeometry.vertices.push(new _three2.default.Vector3(-length / 2, -i, subGridZ));\n          subGridGeometry.vertices.push(new _three2.default.Vector3(length / 2, -i, subGridZ));\n\n          if (i % step == 0) {\n            gridGeometry.vertices.push(new _three2.default.Vector3(-length / 2, i, mainGridZ));\n            gridGeometry.vertices.push(new _three2.default.Vector3(length / 2, i, mainGridZ));\n\n            gridGeometry.vertices.push(new _three2.default.Vector3(-length / 2, -i, mainGridZ));\n            gridGeometry.vertices.push(new _three2.default.Vector3(length / 2, -i, mainGridZ));\n          }\n        }\n        for (var i = 0; i <= length / 2; i += step / stepSubDivisions) {\n          subGridGeometry.vertices.push(new _three2.default.Vector3(i, -width / 2, subGridZ));\n          subGridGeometry.vertices.push(new _three2.default.Vector3(i, width / 2, subGridZ));\n\n          subGridGeometry.vertices.push(new _three2.default.Vector3(-i, -width / 2, subGridZ));\n          subGridGeometry.vertices.push(new _three2.default.Vector3(-i, width / 2, subGridZ));\n\n          if (i % step == 0) {\n            gridGeometry.vertices.push(new _three2.default.Vector3(i, -width / 2, mainGridZ));\n            gridGeometry.vertices.push(new _three2.default.Vector3(i, width / 2, mainGridZ));\n\n            gridGeometry.vertices.push(new _three2.default.Vector3(-i, -width / 2, mainGridZ));\n            gridGeometry.vertices.push(new _three2.default.Vector3(-i, width / 2, mainGridZ));\n          }\n        }\n      } else {\n        for (var i = -width / 2; i <= width / 2; i += step / stepSubDivisions) {\n          subGridGeometry.vertices.push(new _three2.default.Vector3(-length / 2, i, subGridZ));\n          subGridGeometry.vertices.push(new _three2.default.Vector3(length / 2, i, subGridZ));\n\n          if (i % step == 0) {\n            gridGeometry.vertices.push(new _three2.default.Vector3(-length / 2, i, mainGridZ));\n            gridGeometry.vertices.push(new _three2.default.Vector3(length / 2, i, mainGridZ));\n          }\n        }\n        for (var i = -length / 2; i <= length / 2; i += step / stepSubDivisions) {\n          subGridGeometry.vertices.push(new _three2.default.Vector3(i, -width / 2, subGridZ));\n          subGridGeometry.vertices.push(new _three2.default.Vector3(i, width / 2, subGridZ));\n\n          if (i % step == 0) {\n            gridGeometry.vertices.push(new _three2.default.Vector3(i, -width / 2, mainGridZ));\n            gridGeometry.vertices.push(new _three2.default.Vector3(i, width / 2, mainGridZ));\n          }\n        }\n      }\n\n      this.mainGrid = new _three2.default.Line(gridGeometry, gridMaterial, _three2.default.LinePieces);\n      //create sub grid geometry object\n      this.subGrid = new _three2.default.Line(subGridGeometry, subGridMaterial, _three2.default.LinePieces);\n\n      //create margin\n      var offsetWidth = width + this.marginSize;\n      var offsetLength = length + this.marginSize;\n\n      var marginGeometry = new _three2.default.Geometry();\n      marginGeometry.vertices.push(new _three2.default.Vector3(-length / 2, -width / 2, subGridZ));\n      marginGeometry.vertices.push(new _three2.default.Vector3(length / 2, -width / 2, subGridZ));\n\n      marginGeometry.vertices.push(new _three2.default.Vector3(length / 2, -width / 2, subGridZ));\n      marginGeometry.vertices.push(new _three2.default.Vector3(length / 2, width / 2, subGridZ));\n\n      marginGeometry.vertices.push(new _three2.default.Vector3(length / 2, width / 2, subGridZ));\n      marginGeometry.vertices.push(new _three2.default.Vector3(-length / 2, width / 2, subGridZ));\n\n      marginGeometry.vertices.push(new _three2.default.Vector3(-length / 2, width / 2, subGridZ));\n      marginGeometry.vertices.push(new _three2.default.Vector3(-length / 2, -width / 2, subGridZ));\n\n      marginGeometry.vertices.push(new _three2.default.Vector3(-offsetLength / 2, -offsetWidth / 2, subGridZ));\n      marginGeometry.vertices.push(new _three2.default.Vector3(offsetLength / 2, -offsetWidth / 2, subGridZ));\n\n      marginGeometry.vertices.push(new _three2.default.Vector3(offsetLength / 2, -offsetWidth / 2, subGridZ));\n      marginGeometry.vertices.push(new _three2.default.Vector3(offsetLength / 2, offsetWidth / 2, subGridZ));\n\n      marginGeometry.vertices.push(new _three2.default.Vector3(offsetLength / 2, offsetWidth / 2, subGridZ));\n      marginGeometry.vertices.push(new _three2.default.Vector3(-offsetLength / 2, offsetWidth / 2, subGridZ));\n\n      marginGeometry.vertices.push(new _three2.default.Vector3(-offsetLength / 2, offsetWidth / 2, subGridZ));\n      marginGeometry.vertices.push(new _three2.default.Vector3(-offsetLength / 2, -offsetWidth / 2, subGridZ));\n\n      var strongGridMaterial = new _three2.default.LineBasicMaterial({\n        color: new _three2.default.Color().setHex(this.color),\n        opacity: this.opacity * 2,\n        linewidth: 2,\n        transparent: true\n      });\n      this.margin = new _three2.default.Line(marginGeometry, strongGridMaterial, _three2.default.LinePieces);\n\n      //add all grids, subgrids, margins etc\n      this.add(this.mainGrid);\n      this.add(this.subGrid);\n      this.add(this.margin);\n\n      this._drawNumbering();\n    }\n  }, {\n    key: \"toggle\",\n    value: function toggle(_toggle) {\n      //apply visibility settings to all children\n      this.traverse(function (child) {\n        child.visible = _toggle;\n      });\n    }\n  }, {\n    key: \"setOpacity\",\n    value: function setOpacity(opacity) {\n      this.opacity = opacity;\n      this.mainGrid.material.opacity = opacity;\n      this.subGrid.material.opacity = opacity / 2;\n      this.margin.material.opacity = opacity * 2;\n    }\n  }, {\n    key: \"setColor\",\n    value: function setColor(color) {\n      this.color = color;\n      this.mainGrid.material.color = new _three2.default.Color().setHex(this.color);\n      this.subGrid.material.color = new _three2.default.Color().setHex(this.color);\n      this.margin.material.color = new _three2.default.Color().setHex(this.color);\n    }\n  }, {\n    key: \"toggleText\",\n    value: function toggleText(toggle) {\n      this.text = toggle;\n      var labels = this.labels.children;\n      for (var i = 0; i < this.labels.children.length; i++) {\n        var label = labels[i];\n        label.visible = toggle;\n      }\n    }\n  }, {\n    key: \"setTextColor\",\n    value: function setTextColor(color) {\n      this.textColor = color;\n      this._drawNumbering();\n    }\n  }, {\n    key: \"setTextLocation\",\n    value: function setTextLocation(location) {\n      this.textLocation = location;\n      return this._drawNumbering();\n    }\n  }, {\n    key: \"setUp\",\n    value: function setUp(upVector) {\n      this.upVector = upVector;\n      this.up = upVector;\n      this.lookAt(upVector);\n    }\n  }, {\n    key: \"resize\",\n    value: function resize(width, length) {\n      if (width && length) {\n        var width = Math.max(width, 10);\n        this.width = width;\n\n        var length = Math.max(length, 10);\n        this.length = length;\n\n        this.step = Math.max(this.step, 5);\n\n        this.remove(this.mainGrid);\n        this.remove(this.subGrid);\n        this.remove(this.margin);\n        //this.remove(this.plane);\n        return this._drawGrid();\n      }\n    }\n  }, {\n    key: \"_drawNumbering\",\n    value: function _drawNumbering() {\n      var label, sizeLabel, sizeLabel2, xLabelsLeft, xLabelsRight, yLabelsBack, yLabelsFront;\n      var step = this.step;\n\n      this._labelStore = {};\n\n      if (this.labels != null) {\n        this.mainGrid.remove(this.labels);\n      }\n      this.labels = new _three2.default.Object3D();\n\n      var width = this.width;\n      var length = this.length;\n      var numbering = this.numbering = \"centerBased\";\n\n      var labelsFront = new _three2.default.Object3D();\n      var labelsSideRight = new _three2.default.Object3D();\n\n      if (numbering == \"centerBased\") {\n        for (var i = 0; i <= width / 2; i += step) {\n          var sizeLabel = this.drawTextOnPlane(\"\" + i, 32);\n          var sizeLabel2 = sizeLabel.clone();\n\n          sizeLabel.position.set(length / 2, -i, 0.1);\n          sizeLabel.rotation.z = -Math.PI / 2;\n          labelsFront.add(sizeLabel);\n\n          sizeLabel2.position.set(length / 2, i, 0.1);\n          sizeLabel2.rotation.z = -Math.PI / 2;\n          labelsFront.add(sizeLabel2);\n        }\n\n        for (var i = 0; i <= length / 2; i += step) {\n          var sizeLabel = this.drawTextOnPlane(\"\" + i, 32);\n          var sizeLabel2 = sizeLabel.clone();\n\n          sizeLabel.position.set(-i, width / 2, 0.1);\n          //sizeLabel.rotation.z = -Math.PI / 2;\n          labelsSideRight.add(sizeLabel);\n\n          sizeLabel2.position.set(i, width / 2, 0.1);\n          //sizeLabel2.rotation.z = -Math.PI / 2;\n          labelsSideRight.add(sizeLabel2);\n        }\n\n        var labelsSideLeft = labelsSideRight.clone();\n        labelsSideLeft.rotation.z = -Math.PI;\n        //labelsSideLeft = labelsSideRight.clone().translateY(- width );\n\n        var labelsBack = labelsFront.clone();\n        labelsBack.rotation.z = -Math.PI;\n      }\n\n      /*if (this.textLocation === \"center\") {\n        yLabelsRight.translateY(- length/ 2);\n        xLabelsFront.translateX(- width / 2);\n      } else {\n        yLabelsLeft = yLabelsRight.clone().translateY( -width );\n        xLabelsBack = xLabelsFront.clone().translateX( -length );\n        \n        this.labels.add( yLabelsLeft );\n        this.labels.add( xLabelsBack) ;\n      }*/\n      //this.labels.add( yLabelsRight );\n      this.labels.add(labelsFront);\n      this.labels.add(labelsBack);\n\n      this.labels.add(labelsSideRight);\n      this.labels.add(labelsSideLeft);\n\n      //apply visibility settings to all labels\n      var textVisible = this.text;\n      this.labels.traverse(function (child) {\n        child.visible = textVisible;\n      });\n\n      this.mainGrid.add(this.labels);\n    }\n  }, {\n    key: \"drawTextOnPlane\",\n    value: function drawTextOnPlane(text, size) {\n      var canvas, context, material, plane, texture;\n\n      if (size == null) {\n        size = 256;\n      }\n\n      if (document) {\n        canvas = document.createElement('canvas');\n      } else {\n        canvas = {};\n      }\n\n      var size = 128;\n      canvas.width = size;\n      canvas.height = size;\n      context = canvas.getContext('2d');\n      context.font = \"18px sans-serif\";\n      context.textAlign = 'center';\n      context.fillStyle = this.textColor;\n      context.fillText(text, canvas.width / 2, canvas.height / 2);\n      context.strokeStyle = this.textColor;\n      context.strokeText(text, canvas.width / 2, canvas.height / 2);\n\n      texture = new _three2.default.Texture(canvas);\n      texture.needsUpdate = true;\n      texture.generateMipmaps = true;\n      texture.magFilter = _three2.default.LinearFilter;\n      texture.minFilter = _three2.default.LinearFilter;\n\n      material = new _three2.default.MeshBasicMaterial({\n        map: texture,\n        transparent: true,\n        color: 0xffffff,\n        alphaTest: 0.3\n      });\n      plane = new _three2.default.Mesh(new _three2.default.PlaneBufferGeometry(size / 8, size / 8), material);\n      plane.doubleSided = true;\n      plane.overdraw = true;\n\n      return plane;\n    }\n  }]);\n\n  return LabeledGrid;\n})(_three2.default.Object3D);\n\n//autoresize, disabled for now\n/*\nupdateGridSize() {\n      var max, maxX, maxY, min, minX, minY, size, subchild, _getBounds, _i, _len, _ref,\n        _this = this;\n      minX = 99999;\n      maxX = -99999;\n      minY = 99999;\n      maxY = -99999;\n      _getBounds = function(mesh) {\n        var bBox, subchild, _i, _len, _ref, _results;\n        if (mesh instanceof THREE.Mesh) {\n          mesh.geometry.computeBoundingBox();\n          bBox = mesh.geometry.boundingBox;\n          minX = Math.min(minX, bBox.min.x);\n          maxX = Math.max(maxX, bBox.max.x);\n          minY = Math.min(minY, bBox.min.y);\n          maxY = Math.max(maxY, bBox.max.y);\n          _ref = mesh.children;\n          _results = [];\n          for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n            subchild = _ref[_i];\n            _results.push(_getBounds(subchild));\n          }\n          return _results;\n        }\n      };\n      if (this.rootAssembly != null) {\n        _ref = this.rootAssembly.children;\n        for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n          subchild = _ref[_i];\n          if (subchild.name !== \"renderSubs\" && subchild.name !== \"connectors\") {\n            _getBounds(subchild);\n          }\n        }\n      }\n      max = Math.max(Math.max(maxX, maxY), 100);\n      min = Math.min(Math.min(minX, minY), -100);\n      size = (Math.max(max, Math.abs(min))) * 2;\n      size = Math.ceil(size / 10) * 10;\n      if (size >= 200) {\n        return this.resize(size);\n      }\n};\n*/\n\nexports.default = LabeledGrid;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/glView-helpers/lib/grids/LabeledGrid.js\n ** module id = 25\n ** module chunks = 0\n **/","/*** IMPORTS FROM imports-loader ***/\nvar Rx = require(\"rx\");\n\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.objParser = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n// shim for using process in browser\n\nvar process = module.exports = {};\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n    draining = false;\n    if (currentQueue.length) {\n        queue = currentQueue.concat(queue);\n    } else {\n        queueIndex = -1;\n    }\n    if (queue.length) {\n        drainQueue();\n    }\n}\n\nfunction drainQueue() {\n    if (draining) {\n        return;\n    }\n    var timeout = setTimeout(cleanUpNextTick);\n    draining = true;\n\n    var len = queue.length;\n    while(len) {\n        currentQueue = queue;\n        queue = [];\n        while (++queueIndex < len) {\n            if (currentQueue) {\n                currentQueue[queueIndex].run();\n            }\n        }\n        queueIndex = -1;\n        len = queue.length;\n    }\n    currentQueue = null;\n    draining = false;\n    clearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n    var args = new Array(arguments.length - 1);\n    if (arguments.length > 1) {\n        for (var i = 1; i < arguments.length; i++) {\n            args[i - 1] = arguments[i];\n        }\n    }\n    queue.push(new Item(fun, args));\n    if (queue.length === 1 && !draining) {\n        setTimeout(drainQueue, 0);\n    }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n    this.fun = fun;\n    this.array = array;\n}\nItem.prototype.run = function () {\n    this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n    throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n    throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],2:[function(require,module,exports){\n(function (process){\n(function () {\n  // Hueristics.\n  var isNode = typeof process !== 'undefined' && process.versions && !!process.versions.node;\n  var isBrowser = typeof window !== 'undefined';\n  var isModule = typeof module !== 'undefined' && !!module.exports;\n\n  // Export.\n  var detect = (isModule ? exports : (this.detect = {}));\n  detect.isNode = isNode;\n  detect.isBrowser = isBrowser;\n  detect.isModule = isModule;\n}).call(this);\n}).call(this,require('_process'))\n},{\"_process\":1}],3:[function(require,module,exports){\n'use strict';\n\n/**\n * Analogue of Object.assign().\n * Copies properties from one or more source objects to\n * a target object. Existing keys on the target object will be overwritten.\n *\n * > Note: This differs from spec in some important ways:\n * > 1. Will throw if passed non-objects, including `undefined` or `null` values.\n * > 2. Does not support the curious Exception handling behavior, exceptions are thrown immediately.\n * > For more details, see:\n * > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n *\n *\n *\n * @param  {Object} target      The target object to copy properties to.\n * @param  {Object} source, ... The source(s) to copy properties from.\n * @return {Object}             The updated target object.\n */\nmodule.exports = function fastAssign (target) {\n  var totalArgs = arguments.length,\n      source, i, totalKeys, keys, key, j;\n\n  for (i = 1; i < totalArgs; i++) {\n    source = arguments[i];\n    keys = Object.keys(source);\n    totalKeys = keys.length;\n    for (j = 0; j < totalKeys; j++) {\n      key = keys[j];\n      target[key] = source[key];\n    }\n  }\n  return target;\n};\n\n},{}],4:[function(require,module,exports){\n(function (global){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.inputDataType = exports.outputs = undefined;\nexports.default = parse;\n\nvar _compositeDetect = require('composite-detect');\n\nvar _compositeDetect2 = _interopRequireDefault(_compositeDetect);\n\nvar _assign = require('fast.js/object/assign');\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _rx = typeof window !== \"undefined\" ? window['Rx'] : typeof global !== \"undefined\" ? global['Rx'] : null;\n\nvar _rx2 = _interopRequireDefault(_rx);\n\nvar _obj = require('./obj');\n\nvar _obj2 = _interopRequireDefault(_obj);\n\nvar _parseHelpers = require('./parseHelpers');\n\nfunction _interopRequireDefault(obj) {\n  return obj && obj.__esModule ? obj : { default: obj };\n}\n\nvar outputs = exports.outputs = [\"geometry\"]; //to be able to auto determine data type(s) fetched by parser\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author kaosat-dev\n */\n\nvar inputDataType = exports.inputDataType = \"arrayBuffer\"; //to be able to set required input data type\n\nfunction parse(data) {\n  var parameters = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n  var defaults = {\n    useWorker: _compositeDetect2.default.isBrowser === true,\n    offsets: [0]\n  };\n  parameters = (0, _assign2.default)({}, defaults, parameters);\n\n  var _parameters = parameters;\n  var useWorker = _parameters.useWorker;\n  var offsets = _parameters.offsets;\n\n  var obs = new _rx2.default.ReplaySubject(1);\n\n  if (useWorker) {\n    (function () {\n      var worker = new Worker(window.URL.createObjectURL(new Blob(['(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error(\"Cannot find module \\'\"+o+\"\\'\")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\\n\"use strict\";\\n\\nObject.defineProperty(exports, \"__esModule\", {\\n\\tvalue: true\\n});\\nvar OBJ = function OBJ() {};\\n\\nOBJ.prototype = {\\n\\tconstructor: OBJ\\n};\\n\\nOBJ.prototype.parseIndex = function (index, type) {\\n\\n\\tindex = parseInt(index);\\n\\tvar dataArray = this.currentObject._attributes[type];\\n\\n\\treturn index >= 0 ? index - 1 : index + dataArray.length;\\n};\\n\\nOBJ.prototype._handle_face_line = function (rawData, rIndices, indices, type) {\\n\\tvar data = [];\\n\\n\\tvar tmpIdx = [];\\n\\tfor (var i = 0; i < rIndices.length; i++) {\\n\\t\\tvar idx = rIndices[i];\\n\\t\\t//console.log(data[ idx ]);\\n\\t\\t//data.push( parseInt( rawData[ idx] ) );\\n\\t\\tdata.push(this.parseIndex(rawData[idx], type));\\n\\t}\\n\\n\\tif (isNaN(data[3])) {\\n\\t\\tindices.push(data[0], data[1], data[2]);\\n\\t\\t//indices.push( this.parseIndex( data[ 0 ], type) , this.parseIndex( data[ 1 ], type) , this.parseIndex( data[ 2 ], type) );\\n\\t} else {\\n\\t\\t\\tindices.push(data[0], data[1], data[3], data[1], data[2], data[3]);\\n\\t\\t}\\n};\\n\\nOBJ.prototype._newObject = function () {\\n\\tvar currentObject = {};\\n\\tcurrentObject._attributes = {};\\n\\tcurrentObject._attributes[\"position\"] = [];\\n\\tcurrentObject._attributes[\"normal\"] = [];\\n\\tcurrentObject._attributes[\"uv\"] = [];\\n\\tcurrentObject._attributes[\"indices\"] = [];\\n\\tcurrentObject.faceCount = 0;\\n\\treturn currentObject;\\n};\\n\\nOBJ.prototype.getData = function (text) {\\n\\tvar vertex_pattern = /v( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)/;\\n\\t// vn float float float\\n\\tvar normal_pattern = /vn( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)/;\\n\\t// vt float float\\n\\tvar uv_pattern = /vt( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)( +[\\\\d|\\\\.|\\\\+|\\\\-|e]+)/;\\n\\t// f vertex vertex vertex ...\\n\\tvar face_pattern1 = /f( +\\\\d+)( +\\\\d+)( +\\\\d+)( +\\\\d+)?/;\\n\\t// f vertex/uv vertex/uv vertex/uv ...\\n\\tvar face_pattern2 = /f( +(\\\\d+)\\\\/(\\\\d+))( +(\\\\d+)\\\\/(\\\\d+))( +(\\\\d+)\\\\/(\\\\d+))( +(\\\\d+)\\\\/(\\\\d+))?/;\\n\\t// f vertex/uv/normal vertex/uv/normal vertex/uv/normal ...\\n\\tvar face_pattern3 = /f( +(\\\\d+)\\\\/(\\\\d+)\\\\/(\\\\d+))( +(\\\\d+)\\\\/(\\\\d+)\\\\/(\\\\d+))( +(\\\\d+)\\\\/(\\\\d+)\\\\/(\\\\d+))( +(\\\\d+)\\\\/(\\\\d+)\\\\/(\\\\d+))?/;\\n\\t// f vertex//normal vertex//normal vertex//normal ...\\n\\tvar face_pattern4 = /f( +(\\\\d+)\\\\/\\\\/(\\\\d+))( +(\\\\d+)\\\\/\\\\/(\\\\d+))( +(\\\\d+)\\\\/\\\\/(\\\\d+))( +(\\\\d+)\\\\/\\\\/(\\\\d+))?/;\\n\\n\\ttext = text.replace(/\\\\\\\\\\\\r\\\\n/g, \\'\\'); // handles line continuations\\n\\tvar lines = text.split(\\'\\\\n\\');\\n\\n\\tvar vertices = [];\\n\\tvar normals = [];\\n\\tvar uvs = [];\\n\\tvar indices = [];\\n\\tvar normIndices = [];\\n\\tvar uvIndices = [];\\n\\n\\tvar faceCount = 0;\\n\\tvar face_offset = 0;\\n\\n\\tvar defaultNormal = [1, 1, 1];\\n\\tvar defaultUv = [0, 0];\\n\\n\\tvar objects = [];\\n\\tvar textures = {};\\n\\tvar materials = {};\\n\\n\\tvar currentObject = this._newObject();\\n\\tthis.currentObject = currentObject;\\n\\tvar currentMaterial = {};\\n\\n\\tvertices = currentObject._attributes[\"position\"];\\n\\tnormals = currentObject._attributes[\"normal\"];\\n\\tuvs = currentObject._attributes[\"uv\"];\\n\\tindices = currentObject._attributes[\"indices\"];\\n\\n\\tfor (var i = 0; i < lines.length; i++) {\\n\\t\\tvar line = lines[i];\\n\\t\\tline = line.trim().toLowerCase(); //needed because of some \"exponent\" values in upper case\\n\\t\\tvar result;\\n\\n\\t\\t//console.log(line);\\n\\n\\t\\tif (line.length === 0 || line.charAt(0) === \\'#\\') {\\n\\t\\t\\tcontinue;\\n\\t\\t} else if ((result = vertex_pattern.exec(line)) !== null) {\\n\\t\\t\\t// [\"v 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\\n\\t\\t\\tvertices.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]));\\n\\t\\t} else if ((result = normal_pattern.exec(line)) !== null) {\\n\\t\\t\\t// [\"vn 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\\n\\t\\t\\tnormals.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]));\\n\\t\\t} else if ((result = uv_pattern.exec(line)) !== null) {\\n\\t\\t\\t// [\"vt 0.1 0.2\", \"0.1\", \"0.2\"]\\n\\t\\t\\tuvs.push(parseFloat(result[1]), parseFloat(result[2]));\\n\\t\\t} else if ((result = face_pattern1.exec(line)) !== null) {\\n\\t\\t\\t// [\"f 1 2 3\", \"1\", \"2\", \"3\", undefined]\\n\\t\\t\\t//console.log(\"result v1\");\\n\\t\\t\\tthis._handle_face_line(result, [1, 2, 3, 4], indices, \"position\");\\n\\t\\t\\t//faces, uvs, normals_inds, geometry,face_offset, normals, uvs\\n\\t\\t} else if ((result = face_pattern2.exec(line)) !== null) {\\n\\t\\t\\t\\t// [\"f 1/1 2/2 3/3\", \" 1/1\", \"1\", \"1\", \" 2/2\", \"2\", \"2\", \" 3/3\", \"3\", \"3\", undefined, undefined, undefined]\\n\\t\\t\\t\\t//console.log(\"result v2\");\\n\\t\\t\\t\\tthis._handle_face_line(result, [2, 5, 8, 11], indices, \"position\"); //2,5,8,11//possible winding order change of for some stuff11,8,5,2\\n\\t\\t\\t\\tthis._handle_face_line(result, [3, 6, 9, 12], uvIndices, \"uv\");\\n\\t\\t\\t} else if ((result = face_pattern3.exec(line)) !== null) {\\n\\t\\t\\t\\t// [\"f 1/1/1 2/2/2 3/3/3\", \" 1/1/1\", \"1\", \"1\", \"1\", \" 2/2/2\", \"2\", \"2\", \"2\", \" 3/3/3\", \"3\", \"3\", \"3\", undefined, undefined, undefined, undefined]\\n\\t\\t\\t\\t//console.log(\"result v3\");\\n\\t\\t\\t\\t//result[ 2 ], result[ 6 ], result[ 10 ], result[ 14 ]\\n\\t\\t\\t\\tthis._handle_face_line(result, [2, 6, 10, 14], indices, \"position\"); //2,6,10,14\\n\\t\\t\\t\\tthis._handle_face_line(result, [4, 8, 12, 16], normIndices, \"normal\");\\n\\t\\t\\t\\tthis._handle_face_line(result, [3, 7, 11, 15], uvIndices, \"uv\");\\n\\t\\t\\t} else if ((result = face_pattern4.exec(line)) !== null) {\\n\\t\\t\\t\\t//console.log(\"result v4\");\\n\\t\\t\\t\\t// [\"f 1//1 2//2 3//3\", \" 1//1\", \"1\", \"1\", \" 2//2\", \"2\", \"2\", \" 3//3\", \"3\", \"3\", undefined, undefined, undefined]\\n\\t\\t\\t\\tthis._handle_face_line(result, [2, 5, 8, 11], indices, \"position\");\\n\\t\\t\\t\\tthis._handle_face_line(result, [3, 6, 9, 12], normIndices, \"normal\");\\n\\t\\t\\t} else if (/^o /.test(line)) {\\n\\t\\t\\t\\t// object\\n\\t\\t\\t\\t//console.log(\"object\")\\n\\t\\t\\t\\tif (currentObject) {\\n\\t\\t\\t\\t\\t//if (!(geometry === undefined)) {\\n\\t\\t\\t\\t\\tface_offset = face_offset + vertices.length;\\n\\n\\t\\t\\t\\t\\t//console.log(\"oldobject\")\\n\\t\\t\\t\\t\\t//console.log( currentObject)\\n\\t\\t\\t\\t\\tcurrentObject.faceCount = indices.length;\\n\\n\\t\\t\\t\\t\\t//reset all for next object\\n\\t\\t\\t\\t\\tcurrentObject = this._newObject();\\n\\t\\t\\t\\t\\tcurrentObject.name = line.substring(2).trim();\\n\\t\\t\\t\\t\\tvertices = currentObject._attributes[\"position\"];\\n\\t\\t\\t\\t\\tnormals = currentObject._attributes[\"normal\"];\\n\\t\\t\\t\\t\\tuvs = currentObject._attributes[\"uv\"];\\n\\t\\t\\t\\t\\tindices = currentObject._attributes[\"indices\"];\\n\\t\\t\\t\\t\\tnormIndices = currentObject._attributes[\"normIndices\"];\\n\\t\\t\\t\\t\\tuvIndices = currentObject._attributes[\"uvIndices\"];\\n\\n\\t\\t\\t\\t\\tobjects.push(currentObject);\\n\\t\\t\\t\\t}\\n\\t\\t\\t} else if (/^g /.test(line)) {\\n\\t\\t\\t\\t// group\\n\\t\\t\\t\\t//console.log(\"group\");\\n\\t\\t\\t} else if (/^usemtl /.test(line)) {\\n\\t\\t\\t\\t\\t// material\\n\\t\\t\\t\\t\\tcurrentMaterial.name = line.substring(7).trim();\\n\\t\\t\\t\\t} else if (/^mtllib /.test(line)) {\\n\\t\\t\\t\\t\\t// mtl file\\n\\t\\t\\t\\t\\tcurrentMaterial = {};\\n\\t\\t\\t\\t} else if (/^s /.test(line)) {\\n\\t\\t\\t\\t\\t// smooth shading\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\t// console.log( \"OBJParser: Unhandled line \" + line );\\n\\t\\t\\t\\t\\t}\\n\\t}\\n\\n\\tif (objects.indexOf(currentObject) == -1) {\\n\\t\\tobjects.push(currentObject);\\n\\t}\\n\\tcurrentObject.faceCount = indices.length / 3;\\n\\n\\treturn {\\n\\t\\tobjects: objects\\n\\t};\\n};\\n\\n/*\\n  extracts data based on indices since obj has different indices for normals, uvs etc, while webgl does not\\n*/\\nOBJ.prototype._unindexData = function (object) {\\n\\tvar resultPositions = [];\\n\\tvar resultNormals = [];\\n\\tvar resultUv = [];\\n\\n\\tvar vertices = object._attributes[\"position\"];\\n\\tvar normals = object._attributes[\"normal\"];\\n\\tvar uvs = object._attributes[\"uv\"];\\n\\n\\tfor (var i = 0; i < object.indices.length; i++) {\\n\\t\\t//resultPositions.push( data. );\\n\\t}\\n};\\nexports.default = OBJ;\\n\\n},{}],2:[function(require,module,exports){\\n\\'use strict\\';\\n\\nvar _obj = require(\\'./obj\\');\\n\\nvar _obj2 = _interopRequireDefault(_obj);\\n\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\n\\nself.onmessage = function (event) {\\n\\n  var data = event.data;\\n  data = data.data;\\n\\n  var result = new _obj2.default().getData(data);\\n\\n  self.postMessage({ data: result });\\n  self.close();\\n};\\n\\n},{\"./obj\":1}]},{},[2])'], { type: \"text/javascript\" }))); //browserify\n\n      worker.onmessage = function (event) {\n        if (\"data\" in event.data) {\n          var data = event.data.data;\n          data.objects.forEach(function (modelData, index) {\n            obs.onNext({ progress: (index + 1) / Object.keys(data.objects).length, total: undefined });\n            obs.onNext((0, _parseHelpers.createModelBuffers)(modelData));\n          });\n          obs.onNext({ progress: 1, total: undefined });\n          obs.onCompleted();\n        } else if (\"progress\" in event.data) {\n          //console.log(\"got progress\", event.data.progress);\n          obs.onNext({ progress: event.data.progress, total: Math.NaN });\n        }\n      };\n      worker.onerror = function (event) {\n        obs.onError('filename:' + event.filename + ' lineno: ' + event.lineno + ' error: ' + event.message);\n      };\n      worker.postMessage({ data: data });\n      obs.catch(function (e) {\n        return worker.terminate();\n      });\n    })();\n  } else {\n    data = new _obj2.default().getData(data);\n\n    data.objects.forEach(function (modelData, index) {\n      obs.onNext({ progress: (index + 1) / Object.keys(data.objects).length, total: undefined });\n      obs.onNext((0, _parseHelpers.createModelBuffers)(modelData));\n    });\n\n    obs.onNext({ progress: 1, total: undefined });\n    obs.onCompleted();\n  }\n  return obs;\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"./obj\":5,\"./parseHelpers\":6,\"composite-detect\":2,\"fast.js/object/assign\":3}],5:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\nvar OBJ = function OBJ() {};\n\nOBJ.prototype = {\n\tconstructor: OBJ\n};\n\nOBJ.prototype.parseIndex = function (index, type) {\n\n\tindex = parseInt(index);\n\tvar dataArray = this.currentObject._attributes[type];\n\n\treturn index >= 0 ? index - 1 : index + dataArray.length;\n};\n\nOBJ.prototype._handle_face_line = function (rawData, rIndices, indices, type) {\n\tvar data = [];\n\n\tvar tmpIdx = [];\n\tfor (var i = 0; i < rIndices.length; i++) {\n\t\tvar idx = rIndices[i];\n\t\t//console.log(data[ idx ]);\n\t\t//data.push( parseInt( rawData[ idx] ) );\n\t\tdata.push(this.parseIndex(rawData[idx], type));\n\t}\n\n\tif (isNaN(data[3])) {\n\t\tindices.push(data[0], data[1], data[2]);\n\t\t//indices.push( this.parseIndex( data[ 0 ], type) , this.parseIndex( data[ 1 ], type) , this.parseIndex( data[ 2 ], type) );\n\t} else {\n\t\t\tindices.push(data[0], data[1], data[3], data[1], data[2], data[3]);\n\t\t}\n};\n\nOBJ.prototype._newObject = function () {\n\tvar currentObject = {};\n\tcurrentObject._attributes = {};\n\tcurrentObject._attributes[\"position\"] = [];\n\tcurrentObject._attributes[\"normal\"] = [];\n\tcurrentObject._attributes[\"uv\"] = [];\n\tcurrentObject._attributes[\"indices\"] = [];\n\tcurrentObject.faceCount = 0;\n\treturn currentObject;\n};\n\nOBJ.prototype.getData = function (text) {\n\tvar vertex_pattern = /v( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\t// vn float float float\n\tvar normal_pattern = /vn( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\t// vt float float\n\tvar uv_pattern = /vt( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\t// f vertex vertex vertex ...\n\tvar face_pattern1 = /f( +\\d+)( +\\d+)( +\\d+)( +\\d+)?/;\n\t// f vertex/uv vertex/uv vertex/uv ...\n\tvar face_pattern2 = /f( +(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+))?/;\n\t// f vertex/uv/normal vertex/uv/normal vertex/uv/normal ...\n\tvar face_pattern3 = /f( +(\\d+)\\/(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+)\\/(\\d+))?/;\n\t// f vertex//normal vertex//normal vertex//normal ...\n\tvar face_pattern4 = /f( +(\\d+)\\/\\/(\\d+))( +(\\d+)\\/\\/(\\d+))( +(\\d+)\\/\\/(\\d+))( +(\\d+)\\/\\/(\\d+))?/;\n\n\ttext = text.replace(/\\\\\\r\\n/g, ''); // handles line continuations\n\tvar lines = text.split('\\n');\n\n\tvar vertices = [];\n\tvar normals = [];\n\tvar uvs = [];\n\tvar indices = [];\n\tvar normIndices = [];\n\tvar uvIndices = [];\n\n\tvar faceCount = 0;\n\tvar face_offset = 0;\n\n\tvar defaultNormal = [1, 1, 1];\n\tvar defaultUv = [0, 0];\n\n\tvar objects = [];\n\tvar textures = {};\n\tvar materials = {};\n\n\tvar currentObject = this._newObject();\n\tthis.currentObject = currentObject;\n\tvar currentMaterial = {};\n\n\tvertices = currentObject._attributes[\"position\"];\n\tnormals = currentObject._attributes[\"normal\"];\n\tuvs = currentObject._attributes[\"uv\"];\n\tindices = currentObject._attributes[\"indices\"];\n\n\tfor (var i = 0; i < lines.length; i++) {\n\t\tvar line = lines[i];\n\t\tline = line.trim().toLowerCase(); //needed because of some \"exponent\" values in upper case\n\t\tvar result;\n\n\t\t//console.log(line);\n\n\t\tif (line.length === 0 || line.charAt(0) === '#') {\n\t\t\tcontinue;\n\t\t} else if ((result = vertex_pattern.exec(line)) !== null) {\n\t\t\t// [\"v 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\t\t\tvertices.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]));\n\t\t} else if ((result = normal_pattern.exec(line)) !== null) {\n\t\t\t// [\"vn 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\t\t\tnormals.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]));\n\t\t} else if ((result = uv_pattern.exec(line)) !== null) {\n\t\t\t// [\"vt 0.1 0.2\", \"0.1\", \"0.2\"]\n\t\t\tuvs.push(parseFloat(result[1]), parseFloat(result[2]));\n\t\t} else if ((result = face_pattern1.exec(line)) !== null) {\n\t\t\t// [\"f 1 2 3\", \"1\", \"2\", \"3\", undefined]\n\t\t\t//console.log(\"result v1\");\n\t\t\tthis._handle_face_line(result, [1, 2, 3, 4], indices, \"position\");\n\t\t\t//faces, uvs, normals_inds, geometry,face_offset, normals, uvs\n\t\t} else if ((result = face_pattern2.exec(line)) !== null) {\n\t\t\t\t// [\"f 1/1 2/2 3/3\", \" 1/1\", \"1\", \"1\", \" 2/2\", \"2\", \"2\", \" 3/3\", \"3\", \"3\", undefined, undefined, undefined]\n\t\t\t\t//console.log(\"result v2\");\n\t\t\t\tthis._handle_face_line(result, [2, 5, 8, 11], indices, \"position\"); //2,5,8,11//possible winding order change of for some stuff11,8,5,2\n\t\t\t\tthis._handle_face_line(result, [3, 6, 9, 12], uvIndices, \"uv\");\n\t\t\t} else if ((result = face_pattern3.exec(line)) !== null) {\n\t\t\t\t// [\"f 1/1/1 2/2/2 3/3/3\", \" 1/1/1\", \"1\", \"1\", \"1\", \" 2/2/2\", \"2\", \"2\", \"2\", \" 3/3/3\", \"3\", \"3\", \"3\", undefined, undefined, undefined, undefined]\n\t\t\t\t//console.log(\"result v3\");\n\t\t\t\t//result[ 2 ], result[ 6 ], result[ 10 ], result[ 14 ]\n\t\t\t\tthis._handle_face_line(result, [2, 6, 10, 14], indices, \"position\"); //2,6,10,14\n\t\t\t\tthis._handle_face_line(result, [4, 8, 12, 16], normIndices, \"normal\");\n\t\t\t\tthis._handle_face_line(result, [3, 7, 11, 15], uvIndices, \"uv\");\n\t\t\t} else if ((result = face_pattern4.exec(line)) !== null) {\n\t\t\t\t//console.log(\"result v4\");\n\t\t\t\t// [\"f 1//1 2//2 3//3\", \" 1//1\", \"1\", \"1\", \" 2//2\", \"2\", \"2\", \" 3//3\", \"3\", \"3\", undefined, undefined, undefined]\n\t\t\t\tthis._handle_face_line(result, [2, 5, 8, 11], indices, \"position\");\n\t\t\t\tthis._handle_face_line(result, [3, 6, 9, 12], normIndices, \"normal\");\n\t\t\t} else if (/^o /.test(line)) {\n\t\t\t\t// object\n\t\t\t\t//console.log(\"object\")\n\t\t\t\tif (currentObject) {\n\t\t\t\t\t//if (!(geometry === undefined)) {\n\t\t\t\t\tface_offset = face_offset + vertices.length;\n\n\t\t\t\t\t//console.log(\"oldobject\")\n\t\t\t\t\t//console.log( currentObject)\n\t\t\t\t\tcurrentObject.faceCount = indices.length;\n\n\t\t\t\t\t//reset all for next object\n\t\t\t\t\tcurrentObject = this._newObject();\n\t\t\t\t\tcurrentObject.name = line.substring(2).trim();\n\t\t\t\t\tvertices = currentObject._attributes[\"position\"];\n\t\t\t\t\tnormals = currentObject._attributes[\"normal\"];\n\t\t\t\t\tuvs = currentObject._attributes[\"uv\"];\n\t\t\t\t\tindices = currentObject._attributes[\"indices\"];\n\t\t\t\t\tnormIndices = currentObject._attributes[\"normIndices\"];\n\t\t\t\t\tuvIndices = currentObject._attributes[\"uvIndices\"];\n\n\t\t\t\t\tobjects.push(currentObject);\n\t\t\t\t}\n\t\t\t} else if (/^g /.test(line)) {\n\t\t\t\t// group\n\t\t\t\t//console.log(\"group\");\n\t\t\t} else if (/^usemtl /.test(line)) {\n\t\t\t\t\t// material\n\t\t\t\t\tcurrentMaterial.name = line.substring(7).trim();\n\t\t\t\t} else if (/^mtllib /.test(line)) {\n\t\t\t\t\t// mtl file\n\t\t\t\t\tcurrentMaterial = {};\n\t\t\t\t} else if (/^s /.test(line)) {\n\t\t\t\t\t// smooth shading\n\t\t\t\t} else {\n\t\t\t\t\t\t// console.log( \"OBJParser: Unhandled line \" + line );\n\t\t\t\t\t}\n\t}\n\n\tif (objects.indexOf(currentObject) == -1) {\n\t\tobjects.push(currentObject);\n\t}\n\tcurrentObject.faceCount = indices.length / 3;\n\n\treturn {\n\t\tobjects: objects\n\t};\n};\n\n/*\n  extracts data based on indices since obj has different indices for normals, uvs etc, while webgl does not\n*/\nOBJ.prototype._unindexData = function (object) {\n\tvar resultPositions = [];\n\tvar resultNormals = [];\n\tvar resultUv = [];\n\n\tvar vertices = object._attributes[\"position\"];\n\tvar normals = object._attributes[\"normal\"];\n\tvar uvs = object._attributes[\"uv\"];\n\n\tfor (var i = 0; i < object.indices.length; i++) {\n\t\t//resultPositions.push( data. );\n\t}\n};\nexports.default = OBJ;\n\n},{}],6:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.createModelBuffers = createModelBuffers;\n//TODO: potential candidate for re-use across parsers with a few changes\nfunction createModelBuffers(modelData) {\n  //console.log(\"creating model buffers\",modelData, modelData._attributes)\n\n  var faces = modelData.faceCount;\n  var colorSize = 3;\n\n  var positions = new Float32Array(faces * 3 * 3);\n  var normals = new Float32Array(faces * 3 * 3);\n  //let colors  = new Float32Array( faces *3 * colorSize )\n  var indices = new Uint32Array(faces * 3);\n\n  //vertices.set( modelData.position );\n  //normals.set( modelData.normal );\n  //indices.set( modelData.indices );\n\n  positions.set(modelData._attributes.position);\n  normals.set(modelData._attributes.normal);\n  indices.set(modelData._attributes.indices);\n\n  //materials = []\n  return { positions: positions, indices: indices, normals: normals };\n}\n\n/*\nOBJParser.prototype._parse = function( text )\n{\n  var object = new THREE.Object3D();\n  var geometry, material, mesh;\n  var face_offset = 0;\n\n  // create mesh if no objects in text\n  if ( /^o /gm.test( text ) === false ) {\n\n    geometry = new THREE.Geometry();\n    material = new THREE.MeshLambertMaterial();\n    mesh = new THREE.Mesh( geometry, material );\n    object.add( mesh );\n\n  }\n\n    var vertices = [];\n    var verticesCount = 0;\n    var normals = [];\n    var uvs = [];\n    // v float float float\n    var vertex_pattern = /v( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n    // vn float float float\n    var normal_pattern = /vn( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n    // vt float float\n    var uv_pattern = /vt( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n    // f vertex vertex vertex ...\n    var face_pattern1 = /f( +\\d+)( +\\d+)( +\\d+)( +\\d+)?/;\n    // f vertex/uv vertex/uv vertex/uv ...\n    var face_pattern2 = /f( +(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+))?/;\n    // f vertex/uv/normal vertex/uv/normal vertex/uv/normal ...\n    var face_pattern3 = /f( +(\\d+)\\/(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+)\\/(\\d+))( +(\\d+)\\/(\\d+)\\/(\\d+))?/;\n    // f vertex//normal vertex//normal vertex//normal ...\n    var face_pattern4 = /f( +(\\d+)\\/\\/(\\d+))( +(\\d+)\\/\\/(\\d+))( +(\\d+)\\/\\/(\\d+))( +(\\d+)\\/\\/(\\d+))?/\n\n    var lines = text.split( '\\n' );\n\n    for ( var i = 0; i < lines.length; i ++ ) {\n      var line = lines[ i ];\n      line = line.trim();\n      var result;\n\n      if ( line.length === 0 || line.charAt( 0 ) === '#' ) {\n        continue;\n      } else if ( ( result = vertex_pattern.exec( line ) ) !== null ) {\n        // [\"v 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n        geometry.vertices.push( vector(\n          parseFloat( result[ 1 ] ),\n          parseFloat( result[ 2 ] ),\n          parseFloat( result[ 3 ] )\n        ) );\n      } else if ( ( result = normal_pattern.exec( line ) ) !== null ) {\n        // [\"vn 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n        normals.push( vector(\n          parseFloat( result[ 1 ] ),\n          parseFloat( result[ 2 ] ),\n          parseFloat( result[ 3 ] )\n        ) );\n      } else if ( ( result = uv_pattern.exec( line ) ) !== null ) {\n        // [\"vt 0.1 0.2\", \"0.1\", \"0.2\"]\n        uvs.push( uv(\n          parseFloat( result[ 1 ] ),\n          parseFloat( result[ 2 ] )\n        ) );\n      } else if ( ( result = face_pattern1.exec( line ) ) !== null ) {\n        // [\"f 1 2 3\", \"1\", \"2\", \"3\", undefined]\n        handle_face_line([ result[ 1 ], result[ 2 ], result[ 3 ], result[ 4 ] ], geometry,face_offset, normals, uvs);\n      } else if ( ( result = face_pattern2.exec( line ) ) !== null ) {\n        // [\"f 1/1 2/2 3/3\", \" 1/1\", \"1\", \"1\", \" 2/2\", \"2\", \"2\", \" 3/3\", \"3\", \"3\", undefined, undefined, undefined]\n        handle_face_line(\n          [ result[ 2 ], result[ 5 ], result[ 8 ], result[ 11 ] ], //faces\n          [ result[ 3 ], result[ 6 ], result[ 9 ], result[ 12 ] ] //uv\n          , geometry, face_offset, normals, uvs\n        );\n      } else if ( ( result = face_pattern3.exec( line ) ) !== null ) {\n        // [\"f 1/1/1 2/2/2 3/3/3\", \" 1/1/1\", \"1\", \"1\", \"1\", \" 2/2/2\", \"2\", \"2\", \"2\", \" 3/3/3\", \"3\", \"3\", \"3\", undefined, undefined, undefined, undefined]\n        handle_face_line(\n          [ result[ 2 ], result[ 6 ], result[ 10 ], result[ 14 ] ], //faces\n          [ result[ 3 ], result[ 7 ], result[ 11 ], result[ 15 ] ], //uv\n          [ result[ 4 ], result[ 8 ], result[ 12 ], result[ 16 ] ] //normal\n          , geometry, face_offset, normals, uvs\n        );\n      } else if ( ( result = face_pattern4.exec( line ) ) !== null ) {\n        // [\"f 1//1 2//2 3//3\", \" 1//1\", \"1\", \"1\", \" 2//2\", \"2\", \"2\", \" 3//3\", \"3\", \"3\", undefined, undefined, undefined]\n        handle_face_line(\n          [ result[ 2 ], result[ 5 ], result[ 8 ], result[ 11 ] ], //faces\n          [ ], //uv\n          [ result[ 3 ], result[ 6 ], result[ 9 ], result[ 12 ] ] //normal\n          , geometry, face_offset, normals, uvs\n        );\n\n      } else if ( /^o /.test( line ) ) {\n        // object\n        if (!(geometry === undefined)) {\n          face_offset = face_offset + geometry.vertices.length;\n        }\n\n        geometry = new THREE.Geometry();\n        material = new THREE.MeshLambertMaterial();\n\n        mesh = new THREE.Mesh( geometry, material );\n        mesh.name = line.substring( 2 ).trim();\n        object.add( mesh );\n\n        verticesCount = 0;\n\n      } else if ( /^g /.test( line ) ) {\n        // group\n      } else if ( /^usemtl /.test( line ) ) {\n        // material\n        material.name = line.substring( 7 ).trim();\n      } else if ( /^mtllib /.test( line ) ) {\n        // mtl file\n      } else if ( /^s /.test( line ) ) {\n        // smooth shading\n      } else {\n        // console.log( \"OBJParser: Unhandled line \" + line );\n      }\n    }\n\n    for ( var i = 0, l = object.children.length; i < l; i ++ ) {\n      var geometry = object.children[ i ].geometry;\n    }\n\n    return object;\n}\n\n\n    function vector( x, y, z ) {\n      return new THREE.Vector3( x, y, z );\n    }\n\n    function uv( u, v ) {\n      return new THREE.Vector2( u, v );\n    }\n\n    function face3( a, b, c, normals ) {\n      return new THREE.Face3( a, b, c, normals );\n    }\n\n\n    function add_face( a, b, c, normals_inds, geometry ,face_offset, normals) {\n      if ( normals_inds === undefined ) {\n        geometry.faces.push( face3(\n          parseInt( a ) - (face_offset + 1),\n          parseInt( b ) - (face_offset + 1),\n          parseInt( c ) - (face_offset + 1)\n        ) );\n      } else {\n        geometry.faces.push( face3(\n          parseInt( a ) - (face_offset + 1),\n          parseInt( b ) - (face_offset + 1),\n          parseInt( c ) - (face_offset + 1),\n          [\n            normals[ parseInt( normals_inds[ 0 ] ) - 1 ].clone(),\n            normals[ parseInt( normals_inds[ 1 ] ) - 1 ].clone(),\n            normals[ parseInt( normals_inds[ 2 ] ) - 1 ].clone()\n          ]\n        ) );\n      }\n    }\n\n    function add_uvs( a, b, c, geometry , uvs) {\n      geometry.faceVertexUvs[ 0 ].push( [\n        uvs[ parseInt( a ) - 1 ].clone(),\n        uvs[ parseInt( b ) - 1 ].clone(),\n        uvs[ parseInt( c ) - 1 ].clone()\n      ] );\n    }\n\n    function handle_face_line(faces, uvs, normals_inds, geometry,face_offset, normals, uvs) {\n      if ( faces[ 3 ] === undefined ) {\n        add_face( faces[ 0 ], faces[ 1 ], faces[ 2 ], normals_inds, geometry,face_offset, normals );\n        if (!(uvs === undefined) && uvs.length > 0) {\n          add_uvs( uvs[ 0 ], uvs[ 1 ], uvs[ 2 ] , geometry , uvs);\n        }\n      } else {\n        if (!(normals_inds === undefined) && normals_inds.length > 0) {\n          add_face( faces[ 0 ], faces[ 1 ], faces[ 3 ], [ normals_inds[ 0 ], normals_inds[ 1 ], normals_inds[ 3 ] ], geometry,face_offset, normals);\n          add_face( faces[ 1 ], faces[ 2 ], faces[ 3 ], [ normals_inds[ 1 ], normals_inds[ 2 ], normals_inds[ 3 ] ], geometry,face_offset, normals);\n        } else {\n          add_face( faces[ 0 ], faces[ 1 ], faces[ 3 ], geometry,face_offset, normals);\n          add_face( faces[ 1 ], faces[ 2 ], faces[ 3 ], geometry,face_offset, normals);\n        }\n        if (!(uvs === undefined) && uvs.length > 0) {\n          add_uvs( uvs[ 0 ], uvs[ 1 ], uvs[ 3 ] , geometry,face_offset, normals);\n          add_uvs( uvs[ 1 ], uvs[ 2 ], uvs[ 3 ] , geometry,face_offset, normals);\n        }\n      }\n    }*/\n\n},{}]},{},[4])(4)\n});\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/imports-loader?Rx=rx!./~/usco-obj-parser/lib/obj-parser.js\n ** module id = 26\n ** module chunks = 0\n **/","/*** IMPORTS FROM imports-loader ***/\nvar Rx = require(\"rx\");\n\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.stlParser = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n// shim for using process in browser\n\nvar process = module.exports = {};\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n    draining = false;\n    if (currentQueue.length) {\n        queue = currentQueue.concat(queue);\n    } else {\n        queueIndex = -1;\n    }\n    if (queue.length) {\n        drainQueue();\n    }\n}\n\nfunction drainQueue() {\n    if (draining) {\n        return;\n    }\n    var timeout = setTimeout(cleanUpNextTick);\n    draining = true;\n\n    var len = queue.length;\n    while(len) {\n        currentQueue = queue;\n        queue = [];\n        while (++queueIndex < len) {\n            if (currentQueue) {\n                currentQueue[queueIndex].run();\n            }\n        }\n        queueIndex = -1;\n        len = queue.length;\n    }\n    currentQueue = null;\n    draining = false;\n    clearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n    var args = new Array(arguments.length - 1);\n    if (arguments.length > 1) {\n        for (var i = 1; i < arguments.length; i++) {\n            args[i - 1] = arguments[i];\n        }\n    }\n    queue.push(new Item(fun, args));\n    if (queue.length === 1 && !draining) {\n        setTimeout(drainQueue, 0);\n    }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n    this.fun = fun;\n    this.array = array;\n}\nItem.prototype.run = function () {\n    this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n    throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n    throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],2:[function(require,module,exports){\n(function (process){\n(function () {\n  // Hueristics.\n  var isNode = typeof process !== 'undefined' && process.versions && !!process.versions.node;\n  var isBrowser = typeof window !== 'undefined';\n  var isModule = typeof module !== 'undefined' && !!module.exports;\n\n  // Export.\n  var detect = (isModule ? exports : (this.detect = {}));\n  detect.isNode = isNode;\n  detect.isBrowser = isBrowser;\n  detect.isModule = isModule;\n}).call(this);\n}).call(this,require('_process'))\n},{\"_process\":1}],3:[function(require,module,exports){\n'use strict';\n\n/**\n * Analogue of Object.assign().\n * Copies properties from one or more source objects to\n * a target object. Existing keys on the target object will be overwritten.\n *\n * > Note: This differs from spec in some important ways:\n * > 1. Will throw if passed non-objects, including `undefined` or `null` values.\n * > 2. Does not support the curious Exception handling behavior, exceptions are thrown immediately.\n * > For more details, see:\n * > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n *\n *\n *\n * @param  {Object} target      The target object to copy properties to.\n * @param  {Object} source, ... The source(s) to copy properties from.\n * @return {Object}             The updated target object.\n */\nmodule.exports = function fastAssign (target) {\n  var totalArgs = arguments.length,\n      source, i, totalKeys, keys, key, j;\n\n  for (i = 1; i < totalArgs; i++) {\n    source = arguments[i];\n    keys = Object.keys(source);\n    totalKeys = keys.length;\n    for (j = 0; j < totalKeys; j++) {\n      key = keys[j];\n      target[key] = source[key];\n    }\n  }\n  return target;\n};\n\n},{}],4:[function(require,module,exports){\n(function (global){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.outputs = undefined;\nexports.default = parse;\n\nvar _compositeDetect = require('composite-detect');\n\nvar _compositeDetect2 = _interopRequireDefault(_compositeDetect);\n\nvar _assign = require('fast.js/object/assign');\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _rx = typeof window !== \"undefined\" ? window['Rx'] : typeof global !== \"undefined\" ? global['Rx'] : null;\n\nvar _rx2 = _interopRequireDefault(_rx);\n\nvar _parseHelpers = require('./parseHelpers');\n\nfunction _interopRequireDefault(obj) {\n  return obj && obj.__esModule ? obj : { default: obj };\n}\n\n/**\n * @author aleeper / http://adamleeper.com/\n * @author mrdoob / http://mrdoob.com/\n * @author gero3 / https://github.com/gero3\n * @author kaosat-dev / https://github.com/kaosat-dev\n *\n * Description: A THREE parser for STL ASCII files & BINARY, as created by Solidworks and other CAD programs.\n *\n * Supports both binary and ASCII encoded files, with automatic detection of type.\n *\n * Limitations:\n *  Binary decoding ignores header. There doesn't seem to be much of a use for it.\n *  There is perhaps some question as to how valid it is to always assume little-endian-ness.\n *  ASCII decoding assumes file is UTF-8. Seems to work for the examples...\n *\n * Usage:\n *  var parser = new STLParser();\n *  var loader = new THREE.XHRLoader( parser );\n *  loader.addEventListener( 'load', function ( event ) {\n *\n *    var geometry = event.content;\n *    scene.add( new THREE.Mesh( geometry ) );\n *\n *  } );\n *  loader.load( './models/stl/slotted_disk.stl' );\n */\n\n//var detectEnv = require(\"composite-detect\");\nvar outputs = exports.outputs = [\"geometry\"]; //to be able to auto determine data type(s) fetched by parser\n\nfunction parse(data) {\n  var parameters = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n  var defaults = {\n    useWorker: _compositeDetect2.default.isBrowser === true\n  };\n  parameters = (0, _assign2.default)({}, defaults, parameters);\n  var _parameters = parameters;\n  var useWorker = _parameters.useWorker;\n\n  var obs = new _rx2.default.ReplaySubject(1);\n\n  if (useWorker) {\n    (function () {\n      //var Worker = require(\"./worker.js\")//Webpack worker!\n      //var worker = new Worker\n\n      var worker = new Worker((window.URL || window.webkitURL || window.mozURL).createObjectURL(new Blob(['(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error(\"Cannot find module \\'\"+o+\"\\'\")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\\n\\'use strict\\';\\n\\nObject.defineProperty(exports, \"__esModule\", {\\n  value: true\\n});\\nexports.parseSteps = parseSteps;\\nexports.parseBinary = parseBinary;\\nexports.parseASCII = parseASCII;\\n\\nvar _utils = require(\\'./utils\\');\\n\\nfunction parseSteps(data) {\\n  data = (0, _utils.ensureBinary)(data);\\n  var isBinary = (0, _utils.isDataBinary)(data);\\n\\n  var result = null;\\n  if (isBinary) {\\n    result = parseBinary(data);\\n  } else {\\n    result = parseASCII((0, _utils.ensureString)(data));\\n  }\\n  return result;\\n}\\n\\nfunction parseBinary(data) {\\n  var reader = new DataView(data);\\n  var faces = reader.getUint32(80, true);\\n  var dataOffset = 84;\\n  var faceLength = 12 * 4 + 2;\\n  var offset = 0;\\n\\n  var positions = new Float32Array(faces * 3 * 3);\\n  var normals = new Float32Array(faces * 3 * 3);\\n\\n  for (var face = 0; face < faces; face++) {\\n\\n    var start = dataOffset + face * faceLength;\\n\\n    for (var i = 1; i <= 3; i++) {\\n\\n      var vertexstart = start + i * 12;\\n\\n      positions[offset] = reader.getFloat32(vertexstart, true);\\n      positions[offset + 1] = reader.getFloat32(vertexstart + 4, true);\\n      positions[offset + 2] = reader.getFloat32(vertexstart + 8, true);\\n\\n      normals[offset] = reader.getFloat32(start, true);\\n      normals[offset + 1] = reader.getFloat32(start + 4, true);\\n      normals[offset + 2] = reader.getFloat32(start + 8, true);\\n      offset += 3;\\n    }\\n  }\\n  return { positions: positions, normals: normals };\\n}\\n\\n//ASCII stl parsing\\nfunction parseASCII(data) {\\n\\n  var normal, patternFace, patternNormal, patternVertex, result, text;\\n  patternFace = /facet([\\\\s\\\\S]*?)endfacet/g;\\n\\n  var posArray = [];\\n  var normArray = [];\\n  var indicesArray = [];\\n  var faces = 0;\\n\\n  while ((result = patternFace.exec(data)) !== null) {\\n    var length = 0;\\n\\n    text = result[0];\\n    patternNormal = /normal[\\\\s]+([\\\\-+]?[0-9]+\\\\.?[0-9]*([eE][\\\\-+]?[0-9]+)?)+[\\\\s]+([\\\\-+]?[0-9]*\\\\.?[0-9]+([eE][\\\\-+]?[0-9]+)?)+[\\\\s]+([\\\\-+]?[0-9]*\\\\.?[0-9]+([eE][\\\\-+]?[0-9]+)?)+/g;\\n\\n    while ((result = patternNormal.exec(text)) !== null) {\\n      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\\n      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\\n      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\\n    }\\n\\n    patternVertex = /vertex[\\\\s]+([\\\\-+]?[0-9]+\\\\.?[0-9]*([eE][\\\\-+]?[0-9]+)?)+[\\\\s]+([\\\\-+]?[0-9]*\\\\.?[0-9]+([eE][\\\\-+]?[0-9]+)?)+[\\\\s]+([\\\\-+]?[0-9]*\\\\.?[0-9]+([eE][\\\\-+]?[0-9]+)?)+/g;\\n\\n    while ((result = patternVertex.exec(text)) !== null) {\\n\\n      posArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\\n      length += 1;\\n    }\\n    faces += 1;\\n  }\\n\\n  var positions = new Float32Array(faces * 3 * 3);\\n  var normals = new Float32Array(faces * 3 * 3);\\n\\n  positions.set(posArray);\\n  normals.set(normArray);\\n\\n  return { positions: positions, normals: normals };\\n}\\n\\n},{\"./utils\":2}],2:[function(require,module,exports){\\n\"use strict\";\\n\\nObject.defineProperty(exports, \"__esModule\", {\\n  value: true\\n});\\nexports.ensureString = ensureString;\\nexports.ensureBinary = ensureBinary;\\nexports.isDataBinary = isDataBinary;\\nfunction ensureString(buf) {\\n\\n  if (typeof buf !== \"string\") {\\n    var array_buffer = new Uint8Array(buf);\\n    var str = \\'\\';\\n    for (var i = 0; i < buf.byteLength; i++) {\\n      str += String.fromCharCode(array_buffer[i]); // implicitly assumes little-endian\\n    }\\n    return str;\\n  } else {\\n    return buf;\\n  }\\n}\\n\\nfunction ensureBinary(buf) {\\n\\n  if (typeof buf === \"string\") {\\n    var array_buffer = new Uint8Array(buf.length);\\n    for (var i = 0; i < buf.length; i++) {\\n      array_buffer[i] = buf.charCodeAt(i) & 0xff; // implicitly assumes little-endian\\n    }\\n    return array_buffer.buffer || array_buffer;\\n  } else {\\n    return buf;\\n  }\\n}\\n\\nfunction isDataBinary(data) {\\n  var expect, face_size, n_faces, reader;\\n  reader = new DataView(data);\\n  face_size = 32 / 8 * 3 + 32 / 8 * 3 * 3 + 16 / 8;\\n\\n  n_faces = reader.getUint32(80, true);\\n  expect = 80 + 32 / 8 + n_faces * face_size;\\n  return expect === reader.byteLength;\\n}\\n\\n},{}],3:[function(require,module,exports){\\n\\'use strict\\';\\n\\nvar _parseHelpers = require(\\'./parseHelpers\\');\\n\\nself.onmessage = function (event) {\\n  var result = (0, _parseHelpers.parseSteps)(event.data.data);\\n\\n  var positions = result.positions.buffer;\\n  var normals = result.normals.buffer;\\n  self.postMessage({ positions: positions, normals: normals }, [positions, normals]);\\n  self.close();\\n}; //importScripts(\\'./stl-utils.js\\');\\n\\n},{\"./parseHelpers\":1}]},{},[3])'], { type: \"text/javascript\" }))); //browserify\n      worker.onmessage = function (event) {\n        var positions = new Float32Array(event.data.positions);\n        var normals = new Float32Array(event.data.normals);\n        var geometry = { positions: positions, normals: normals };\n\n        obs.onNext({ progress: 1, total: positions.length });\n        obs.onNext(geometry);\n        obs.onCompleted();\n      };\n      worker.onerror = function (event) {\n        obs.onError('filename:' + event.filename + ' lineno: ' + event.lineno + ' error: ' + event.message);\n      };\n\n      worker.postMessage({ data: data });\n      obs.catch(function (e) {\n        return worker.terminate();\n      });\n    })();\n  } else {\n    try {\n      var result = (0, _parseHelpers.parseSteps)(data);\n      obs.onNext({ progress: 1, total: result.positions.length });\n      obs.onNext(result);\n      obs.onCompleted();\n    } catch (error) {\n      obs.onError(error);\n    }\n  }\n\n  return obs;\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"./parseHelpers\":5,\"composite-detect\":2,\"fast.js/object/assign\":3}],5:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.parseSteps = parseSteps;\nexports.parseBinary = parseBinary;\nexports.parseASCII = parseASCII;\n\nvar _utils = require('./utils');\n\nfunction parseSteps(data) {\n  data = (0, _utils.ensureBinary)(data);\n  var isBinary = (0, _utils.isDataBinary)(data);\n\n  var result = null;\n  if (isBinary) {\n    result = parseBinary(data);\n  } else {\n    result = parseASCII((0, _utils.ensureString)(data));\n  }\n  return result;\n}\n\nfunction parseBinary(data) {\n  var reader = new DataView(data);\n  var faces = reader.getUint32(80, true);\n  var dataOffset = 84;\n  var faceLength = 12 * 4 + 2;\n  var offset = 0;\n\n  var positions = new Float32Array(faces * 3 * 3);\n  var normals = new Float32Array(faces * 3 * 3);\n\n  for (var face = 0; face < faces; face++) {\n\n    var start = dataOffset + face * faceLength;\n\n    for (var i = 1; i <= 3; i++) {\n\n      var vertexstart = start + i * 12;\n\n      positions[offset] = reader.getFloat32(vertexstart, true);\n      positions[offset + 1] = reader.getFloat32(vertexstart + 4, true);\n      positions[offset + 2] = reader.getFloat32(vertexstart + 8, true);\n\n      normals[offset] = reader.getFloat32(start, true);\n      normals[offset + 1] = reader.getFloat32(start + 4, true);\n      normals[offset + 2] = reader.getFloat32(start + 8, true);\n      offset += 3;\n    }\n  }\n  return { positions: positions, normals: normals };\n}\n\n//ASCII stl parsing\nfunction parseASCII(data) {\n\n  var normal, patternFace, patternNormal, patternVertex, result, text;\n  patternFace = /facet([\\s\\S]*?)endfacet/g;\n\n  var posArray = [];\n  var normArray = [];\n  var indicesArray = [];\n  var faces = 0;\n\n  while ((result = patternFace.exec(data)) !== null) {\n    var length = 0;\n\n    text = result[0];\n    patternNormal = /normal[\\s]+([\\-+]?[0-9]+\\.?[0-9]*([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+/g;\n\n    while ((result = patternNormal.exec(text)) !== null) {\n      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\n      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\n      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\n    }\n\n    patternVertex = /vertex[\\s]+([\\-+]?[0-9]+\\.?[0-9]*([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+/g;\n\n    while ((result = patternVertex.exec(text)) !== null) {\n\n      posArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));\n      length += 1;\n    }\n    faces += 1;\n  }\n\n  var positions = new Float32Array(faces * 3 * 3);\n  var normals = new Float32Array(faces * 3 * 3);\n\n  positions.set(posArray);\n  normals.set(normArray);\n\n  return { positions: positions, normals: normals };\n}\n\n},{\"./utils\":6}],6:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ensureString = ensureString;\nexports.ensureBinary = ensureBinary;\nexports.isDataBinary = isDataBinary;\nfunction ensureString(buf) {\n\n  if (typeof buf !== \"string\") {\n    var array_buffer = new Uint8Array(buf);\n    var str = '';\n    for (var i = 0; i < buf.byteLength; i++) {\n      str += String.fromCharCode(array_buffer[i]); // implicitly assumes little-endian\n    }\n    return str;\n  } else {\n    return buf;\n  }\n}\n\nfunction ensureBinary(buf) {\n\n  if (typeof buf === \"string\") {\n    var array_buffer = new Uint8Array(buf.length);\n    for (var i = 0; i < buf.length; i++) {\n      array_buffer[i] = buf.charCodeAt(i) & 0xff; // implicitly assumes little-endian\n    }\n    return array_buffer.buffer || array_buffer;\n  } else {\n    return buf;\n  }\n}\n\nfunction isDataBinary(data) {\n  var expect, face_size, n_faces, reader;\n  reader = new DataView(data);\n  face_size = 32 / 8 * 3 + 32 / 8 * 3 * 3 + 16 / 8;\n\n  n_faces = reader.getUint32(80, true);\n  expect = 80 + 32 / 8 + n_faces * face_size;\n  return expect === reader.byteLength;\n}\n\n},{}]},{},[4])(4)\n});\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/imports-loader?Rx=rx!./~/usco-stl-parser/lib/stl-parser.js\n ** module id = 27\n ** module chunks = 0\n **/","module.exports = require(\"gl\");\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"gl\"\n ** module id = 28\n ** module chunks = 0\n **/","module.exports = require(\"pngjs\");\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"pngjs\"\n ** module id = 29\n ** module chunks = 0\n **/","module.exports = require(\"ramda\");\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"ramda\"\n ** module id = 30\n ** module chunks = 0\n **/"],"sourceRoot":""}