@loaders.gl/obj
Advanced tools
Comparing version 1.3.0 to 1.3.1
123
dist/dist.js
@@ -137,3 +137,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,u,"next",t)}function u(t){r(a,o,i,s,u,"throw",t)}s(void 0)})}}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(e){return"function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},n(e)}t.exports=n},function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=c;return function(o,i){if(n===f)throw new Error("Generator is already running");if(n===v){if("throw"===o)throw i;return F()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===c)throw n=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var u=l(t,e,r);if("normal"===u.type){if(n=r.done?v:h,u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=v,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var c="suspendedStart",h="suspendedYield",f="executing",v="completed",p={};function y(){}function d(){}function m(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(_([])));x&&x!==r&&n.call(x,i)&&(g=x);var w=m.prototype=y.prototype=Object.create(g);function j(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(r,o){function i(){return new Promise(function(e,i){!function e(r,o,i,a){var s=l(t[r],t,o);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(c).then(function(t){u.value=t,i(u)},function(t){return e("throw",t,i,a)})}a(s.arg)}(r,o,e,i)})}return e=e?e.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return p;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function _(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:F}}function F(){return{value:e,done:!0}}return d.prototype=w.constructor=m,m.constructor=d,m[s]=d.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},j(L.prototype),L.prototype[a]=function(){return this},t.AsyncIterator=L,t.async=function(e,r,n,o){var i=new L(u(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(w),w[s]="Generator",w[i]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:_(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e);var n=r(1),o=r.n(n),i=r(2),a=r.n(i),s=/^[og]\s*(.+)?/,u=/^mtllib /,l=/^usemtl /,c=function(){function t(e){var r=e.index,n=e.name,i=void 0===n?"":n,a=e.mtllib,s=e.smooth,u=e.groupStart;o()(this,t),this.index=r,this.name=i,this.mtllib=a,this.smooth=s,this.groupStart=u,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return a()(t,[{key:"clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new t({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),t}(),h=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o()(this,t),this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}return a()(t,[{key:"startMaterial",value:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var n=new c({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}},{key:"currentMaterial",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:"_finalize",value:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}}]),t}(),f=function(){function t(){o()(this,t),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}return a()(t,[{key:"startObject",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);var r=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new h(t),this.object.fromDeclaration=e,r&&r.name&&"function"==typeof r.clone){var n=r.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)}},{key:"finalize",value:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:"parseVertexIndex",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:"parseNormalIndex",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:"parseUVIndex",value:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}},{key:"addVertex",value:function(t,e,r){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addVertexPoint",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:"addVertexLine",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:"addNormal",value:function(t,e,r){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addColor",value:function(t,e,r){var n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addUV",value:function(t,e,r){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}},{key:"addUVLine",value:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}},{key:"addFace",value:function(t,e,r,n,o,i,a,s,u){var l=this.vertices.length,c=this.parseVertexIndex(t,l),h=this.parseVertexIndex(e,l),f=this.parseVertexIndex(r,l);if(this.addVertex(c,h,f),void 0!==n&&""!==n){var v=this.uvs.length;c=this.parseUVIndex(n,v),h=this.parseUVIndex(o,v),f=this.parseUVIndex(i,v),this.addUV(c,h,f)}if(void 0!==a&&""!==a){var p=this.normals.length;c=this.parseNormalIndex(a,p),h=a===s?c:this.parseNormalIndex(s,p),f=a===u?c:this.parseNormalIndex(u,p),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}},{key:"addPointGeometry",value:function(t){this.object.geometry.type="Points";var e=this.vertices.length,r=!0,n=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var s=i.value;this.addVertexPoint(this.parseVertexIndex(s,e))}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}}},{key:"addLineGeometry",value:function(t,e){this.object.geometry.type="Line";var r=this.vertices.length,n=this.uvs.length,o=!0,i=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value;this.addVertexLine(this.parseVertexIndex(l,r))}}catch(t){i=!0,a=t}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}var c=!0,h=!1,f=void 0;try{for(var v,p=e[Symbol.iterator]();!(c=(v=p.next()).done);c=!0){var y=v.value;this.addUVLine(this.parseUVIndex(y,n))}}catch(t){h=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(h)throw f}}}}]),t}(),v=function(t){var e=new f;-1!==t.indexOf("\r\n")&&(t=t.replace(/\r\n/g,"\n")),-1!==t.indexOf("\\\n")&&(t=t.replace(/\\\n/g,""));for(var r=t.split("\n"),n="",o="",i=[],a="function"==typeof"".trimLeft,c=0,h=r.length;c<h;c++)if(n=r[c],0!==(n=a?n.trimLeft():n.trim()).length&&"#"!==(o=n.charAt(0)))if("v"===o){var v=n.split(/\s+/);switch(v[0]){case"v":e.vertices.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3])),8===v.length&&e.colors.push(parseFloat(v[4]),parseFloat(v[5]),parseFloat(v[6]));break;case"vn":e.normals.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3]));break;case"vt":e.uvs.push(parseFloat(v[1]),parseFloat(v[2]))}}else if("f"===o){for(var p=n.substr(1).trim().split(/\s+/),y=[],d=0,m=p.length;d<m;d++){var g=p[d];if(g.length>0){var b=g.split("/");y.push(b)}}for(var x=y[0],w=1,j=y.length-1;w<j;w++){var L=y[w],O=y[w+1];e.addFace(x[0],L[0],O[0],x[1],L[1],O[1],x[2],L[2],O[2])}}else if("l"===o){var S=n.substring(1).trim().split(" "),k=void 0,E=[];if(-1===n.indexOf("/"))k=S;else{k=[];for(var _=0,F=S.length;_<F;_++){var I=S[_].split("/");""!==I[0]&&k.push(I[0]),""!==I[1]&&E.push(I[1])}}e.addLineGeometry(k,E)}else if("p"===o){var P=n.substr(1).trim().split(" ");e.addPointGeometry(P)}else if(null!==(i=s.exec(n))){var V=(" "+i[0].substr(1).trim()).substr(1);e.startObject(V)}else if(l.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(u.test(n))e.materialLibraries.push(n.substring(7).trim());else{if("s"!==o){if("\0"===n)continue;throw new Error('Unexpected line: "'.concat(n,'"'))}if((i=n.split(" ")).length>1){var N=i[1].trim().toLowerCase();e.object.smooth="0"!==N&&"off"!==N}else e.object.smooth=!0;var A=e.object.currentMaterial();A&&(A.smooth=e.object.smooth)}e.finalize();var T=[],C=[],M=!0,z=!1,G=void 0;try{for(var R,U=e.objects[Symbol.iterator]();!(M=(R=U.next()).done);M=!0){var D=R.value,B=D.geometry;if(0!==B.vertices.length){var X={header:{vertexCount:B.vertices.length/3},attributes:{}};switch(B.type){case"Points":X.mode=0;break;case"Line":X.mode=1;break;default:X.mode=4}X.attributes.POSITION={value:new Float32Array(B.vertices),size:3},B.normals.length>0&&(X.attributes.NORMAL={value:new Float32Array(B.normals),size:3}),B.colors.length>0&&(X.attributes.COLOR_0={value:new Float32Array(B.colors),size:3}),B.uvs.length>0&&(X.attributes.TEXCOORD_0={value:new Float32Array(B.uvs),size:2}),X.materials=[];var Y=!0,J=!1,q=void 0;try{for(var H,K=D.materials[Symbol.iterator]();!(Y=(H=K.next()).done);Y=!0){var Q=H.value,W={name:Q.name,flatShading:!Q.smooth};X.materials.push(W),C.push(W)}}catch(t){J=!0,q=t}finally{try{Y||null==K.return||K.return()}finally{if(J)throw q}}X.name=D.name,T.push(X)}}}catch(t){z=!0,G=t}finally{try{M||null==U.return||U.return()}finally{if(z)throw G}}return{meshes:T,materials:C}};function p(t,e){var r,n,o,i=new Float32Array(3*e),a=0,s=!0,u=!1,l=void 0;try{for(var c,h=t[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var f=c.value.attributes,v=f.POSITION,p=f.NORMAL,y=f.COLOR_0,d=f.TEXCOORD_0;i.set(v.value,3*a),p&&(r=r||new Float32Array(3*e)).set(p.value,3*a),y&&(n=n||new Float32Array(3*e)).set(y.value,3*a),d&&(o=o||new Float32Array(2*e)).set(d.value,2*a),a+=v.value.length/3}}catch(t){u=!0,l=t}finally{try{s||null==h.return||h.return()}finally{if(u)throw l}}var m={};return m.POSITION={value:i,size:3},r&&(m.NORMAL={value:r,size:3}),n&&(m.COLOR_0={value:n,size:3}),o&&(m.TEXCOORD_0={value:o,size:2}),m}var y={name:"OBJ",extensions:["obj"],testText:function(t){return"v"===t[0]},parseTextSync:function(t){var e=v(t).meshes,r=e.reduce(function(t,e){return t+e.header.vertexCount},0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:p(e,r)}}},d=r(0),m=r.n(d),g=r(3),b=r.n(g),x=r(4),w=r.n(x);function j(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(t instanceof ArrayBuffer)n.add(t);else if(t.buffer&&t.buffer instanceof ArrayBuffer)n.add(t.buffer);else if(e&&"object"===w()(t))for(var o in t)j(t[o],e,n)}else;return void 0===r?Array.from(n):null}function L(t,e,r,n,o){return O.apply(this,arguments)}function O(){return(O=b()(m.a.mark(function t(e,r,n,o,i){var a,s,u;return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.parseSync&&!e.parse){t.next=5;break}a=r,s=e.parseSync||e.parse,t.next=12;break;case 5:if(!e.parseTextSync){t.next=11;break}u=new TextDecoder,a=u.decode(r),s=e.parseTextSync,t.next=12;break;case 11:throw new Error("Could not load data with ".concat(e.name," loader"));case 12:return t.next=14,s(a,i);case 14:return t.abrupt("return",t.sent);case 15:case"end":return t.stop()}},t)}))).apply(this,arguments)}function S(t,e){return t&&"process"===t.type&&"loaders.gl"===t.source}!function(t){if("undefined"!=typeof self){self.onmessage=function(){var e=b()(m.a.mark(function e(r){var n,o,i,a,s,u,l,c,h,f;return m.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.data,e.prev=1,S(n,t.name)){e.next=4;break}return e.abrupt("return");case 4:return o=n.arraybuffer,i=n.byteOffset,a=void 0===i?0:i,s=n.byteLength,u=void 0===s?0:s,l=n.options,c=void 0===l?{}:l,e.next=7,L(t,o,a,u,c);case 7:h=e.sent,f=j(h),self.postMessage({type:"done",result:h},f),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 15:case"end":return e.stop()}},e,null,[[1,12]])}));return function(t){return e.apply(this,arguments)}}();var e=0;self.parse=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(o,i){var a=e++;self.addEventListener("message",function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case"process-done":self.removeEventListener("message",t),o(r.result);break;case"process-error":self.removeEventListener("message",t),i(r.message)}}),self.postMessage({type:"process",id:a,arraybuffer:t,options:r,url:n},[t])})}}}(y)}]); | ||
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,u,"next",t)}function u(t){r(a,o,i,s,u,"throw",t)}s(void 0)})}}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(e){return"function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},n(e)}t.exports=n},function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=c;return function(o,i){if(n===f)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return F()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===c)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var u=l(t,e,r);if("normal"===u.type){if(n=r.done?p:h,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var c="suspendedStart",h="suspendedYield",f="executing",p="completed",v={};function y(){}function d(){}function m(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(_([])));x&&x!==r&&n.call(x,i)&&(g=x);var w=m.prototype=y.prototype=Object.create(g);function j(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(r,o){function i(){return new Promise(function(e,i){!function e(r,o,i,a){var s=l(t[r],t,o);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(c).then(function(t){u.value=t,i(u)},function(t){return e("throw",t,i,a)})}a(s.arg)}(r,o,e,i)})}return e=e?e.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function _(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:F}}function F(){return{value:e,done:!0}}return d.prototype=w.constructor=m,m.constructor=d,m[s]=d.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},j(L.prototype),L.prototype[a]=function(){return this},t.AsyncIterator=L,t.async=function(e,r,n,o){var i=new L(u(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(w),w[s]="Generator",w[i]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:_(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),i=r(1),a=r.n(i),s=r(2),u=r.n(s),l=r(3),c=r.n(l),h=/^[og]\s*(.+)?/,f=/^mtllib /,p=/^usemtl /,v=function(){function t(e){var r=e.index,n=e.name,o=void 0===n?"":n,i=e.mtllib,a=e.smooth,s=e.groupStart;u()(this,t),this.index=r,this.name=o,this.mtllib=i,this.smooth=a,this.groupStart=s,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return c()(t,[{key:"clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new t({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),t}(),y=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u()(this,t),this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}return c()(t,[{key:"startMaterial",value:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var n=new v({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}},{key:"currentMaterial",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:"_finalize",value:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}}]),t}(),d=function(){function t(){u()(this,t),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}return c()(t,[{key:"startObject",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);var r=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new y(t),this.object.fromDeclaration=e,r&&r.name&&"function"==typeof r.clone){var n=r.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)}},{key:"finalize",value:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:"parseVertexIndex",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:"parseNormalIndex",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:"parseUVIndex",value:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}},{key:"addVertex",value:function(t,e,r){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addVertexPoint",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:"addVertexLine",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:"addNormal",value:function(t,e,r){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addColor",value:function(t,e,r){var n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addUV",value:function(t,e,r){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}},{key:"addUVLine",value:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}},{key:"addFace",value:function(t,e,r,n,o,i,a,s,u){var l=this.vertices.length,c=this.parseVertexIndex(t,l),h=this.parseVertexIndex(e,l),f=this.parseVertexIndex(r,l);if(this.addVertex(c,h,f),void 0!==n&&""!==n){var p=this.uvs.length;c=this.parseUVIndex(n,p),h=this.parseUVIndex(o,p),f=this.parseUVIndex(i,p),this.addUV(c,h,f)}if(void 0!==a&&""!==a){var v=this.normals.length;c=this.parseNormalIndex(a,v),h=a===s?c:this.parseNormalIndex(s,v),f=a===u?c:this.parseNormalIndex(u,v),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}},{key:"addPointGeometry",value:function(t){this.object.geometry.type="Points";var e=this.vertices.length,r=!0,n=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var s=i.value;this.addVertexPoint(this.parseVertexIndex(s,e))}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}}},{key:"addLineGeometry",value:function(t,e){this.object.geometry.type="Line";var r=this.vertices.length,n=this.uvs.length,o=!0,i=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value;this.addVertexLine(this.parseVertexIndex(l,r))}}catch(t){i=!0,a=t}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}var c=!0,h=!1,f=void 0;try{for(var p,v=e[Symbol.iterator]();!(c=(p=v.next()).done);c=!0){var y=p.value;this.addUVLine(this.parseUVIndex(y,n))}}catch(t){h=!0,f=t}finally{try{c||null==v.return||v.return()}finally{if(h)throw f}}}}]),t}(),m=function(t){var e=new d;-1!==t.indexOf("\r\n")&&(t=t.replace(/\r\n/g,"\n")),-1!==t.indexOf("\\\n")&&(t=t.replace(/\\\n/g,""));for(var r=t.split("\n"),n="",o="",i=[],a="function"==typeof"".trimLeft,s=0,u=r.length;s<u;s++)if(n=r[s],0!==(n=a?n.trimLeft():n.trim()).length&&"#"!==(o=n.charAt(0)))if("v"===o){var l=n.split(/\s+/);switch(l[0]){case"v":e.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),8===l.length&&e.colors.push(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6]));break;case"vn":e.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case"vt":e.uvs.push(parseFloat(l[1]),parseFloat(l[2]))}}else if("f"===o){for(var c=n.substr(1).trim().split(/\s+/),v=[],y=0,m=c.length;y<m;y++){var g=c[y];if(g.length>0){var b=g.split("/");v.push(b)}}for(var x=v[0],w=1,j=v.length-1;w<j;w++){var L=v[w],O=v[w+1];e.addFace(x[0],L[0],O[0],x[1],L[1],O[1],x[2],L[2],O[2])}}else if("l"===o){var k=n.substring(1).trim().split(" "),S=void 0,E=[];if(-1===n.indexOf("/"))S=k;else{S=[];for(var _=0,F=k.length;_<F;_++){var I=k[_].split("/");""!==I[0]&&S.push(I[0]),""!==I[1]&&E.push(I[1])}}e.addLineGeometry(S,E)}else if("p"===o){var P=n.substr(1).trim().split(" ");e.addPointGeometry(P)}else if(null!==(i=h.exec(n))){var T=(" "+i[0].substr(1).trim()).substr(1);e.startObject(T)}else if(p.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(f.test(n))e.materialLibraries.push(n.substring(7).trim());else{if("s"!==o){if("\0"===n)continue;throw new Error('Unexpected line: "'.concat(n,'"'))}if((i=n.split(" ")).length>1){var V=i[1].trim().toLowerCase();e.object.smooth="0"!==V&&"off"!==V}else e.object.smooth=!0;var N=e.object.currentMaterial();N&&(N.smooth=e.object.smooth)}e.finalize();var A=[],C=[],M=!0,z=!1,G=void 0;try{for(var R,U=e.objects[Symbol.iterator]();!(M=(R=U.next()).done);M=!0){var D=R.value,B=D.geometry;if(0!==B.vertices.length){var X={header:{vertexCount:B.vertices.length/3},attributes:{}};switch(B.type){case"Points":X.mode=0;break;case"Line":X.mode=1;break;default:X.mode=4}X.attributes.POSITION={value:new Float32Array(B.vertices),size:3},B.normals.length>0&&(X.attributes.NORMAL={value:new Float32Array(B.normals),size:3}),B.colors.length>0&&(X.attributes.COLOR_0={value:new Float32Array(B.colors),size:3}),B.uvs.length>0&&(X.attributes.TEXCOORD_0={value:new Float32Array(B.uvs),size:2}),X.materials=[];var Y=!0,J=!1,q=void 0;try{for(var H,K=D.materials[Symbol.iterator]();!(Y=(H=K.next()).done);Y=!0){var Q=H.value,W={name:Q.name,flatShading:!Q.smooth};X.materials.push(W),C.push(W)}}catch(t){J=!0,q=t}finally{try{Y||null==K.return||K.return()}finally{if(J)throw q}}X.name=D.name,A.push(X)}}}catch(t){z=!0,G=t}finally{try{M||null==U.return||U.return()}finally{if(z)throw G}}return{meshes:A,materials:C}};function g(t){var e=m(t).meshes,r=e.reduce(function(t,e){return t+e.header.vertexCount},0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:b(e,r)}}function b(t,e){var r,n,o,i=new Float32Array(3*e),a=0,s=!0,u=!1,l=void 0;try{for(var c,h=t[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var f=c.value.attributes,p=f.POSITION,v=f.NORMAL,y=f.COLOR_0,d=f.TEXCOORD_0;i.set(p.value,3*a),v&&(r=r||new Float32Array(3*e)).set(v.value,3*a),y&&(n=n||new Float32Array(3*e)).set(y.value,3*a),d&&(o=o||new Float32Array(2*e)).set(d.value,2*a),a+=p.value.length/3}}catch(t){u=!0,l=t}finally{try{s||null==h.return||h.return()}finally{if(u)throw l}}var m={};return m.POSITION={value:i,size:3},r&&(m.NORMAL={value:r,size:3}),n&&(m.COLOR_0={value:n,size:3}),o&&(m.TEXCOORD_0={value:o,size:2}),m}var x,w={name:"OBJ",extensions:["obj"],mimeType:"text/plain",parse:(x=a()(o.a.mark(function t(e,r){return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",g((new TextDecoder).decode(e)));case 1:case"end":return t.stop()}},t)})),function(t,e){return x.apply(this,arguments)}),parseTextSync:g,testText:function(t){return"v"===t[0]}};var j=r(4),L=r.n(j);function O(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(t instanceof ArrayBuffer)n.add(t);else if(t.buffer&&t.buffer instanceof ArrayBuffer)n.add(t.buffer);else if(e&&"object"===L()(t))for(var o in t)O(t[o],e,n)}else;return void 0===r?Array.from(n):null}function k(t,e,r,n,o){return S.apply(this,arguments)}function S(){return(S=a()(o.a.mark(function t(e,r,n,i,a){var s,u,l;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.parseSync&&!e.parse){t.next=5;break}s=r,u=e.parseSync||e.parse,t.next=12;break;case 5:if(!e.parseTextSync){t.next=11;break}l=new TextDecoder,s=l.decode(r),u=e.parseTextSync,t.next=12;break;case 11:throw new Error("Could not load data with ".concat(e.name," loader"));case 12:return t.next=14,u(s,a);case 14:return t.abrupt("return",t.sent);case 15:case"end":return t.stop()}},t)}))).apply(this,arguments)}function E(t,e){return t&&"process"===t.type&&"loaders.gl"===t.source}!function(t){if("undefined"!=typeof self){self.onmessage=function(){var e=a()(o.a.mark(function e(r){var n,i,a,s,u,l,c,h,f,p;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.data,e.prev=1,E(n,t.name)){e.next=4;break}return e.abrupt("return");case 4:return i=n.arraybuffer,a=n.byteOffset,s=void 0===a?0:a,u=n.byteLength,l=void 0===u?0:u,c=n.options,h=void 0===c?{}:c,e.next=7,k(t,i,s,l,h);case 7:f=e.sent,p=O(f),self.postMessage({type:"done",result:f},p),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 15:case"end":return e.stop()}},e,null,[[1,12]])}));return function(t){return e.apply(this,arguments)}}();var e=0;self.parse=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(o,i){var a=e++;self.addEventListener("message",function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case"process-done":self.removeEventListener("message",t),o(r.result);break;case"process-error":self.removeEventListener("message",t),i(r.message)}}),self.postMessage({type:"process",id:a,arraybuffer:t,options:r,url:n},[t])})}}}(w)}]); | ||
@@ -183,6 +183,6 @@ /***/ }), | ||
/***/ "./src/load-obj.js": | ||
/*!*************************!*\ | ||
!*** ./src/load-obj.js ***! | ||
\*************************/ | ||
/***/ "./src/lib/load-obj.js": | ||
/*!*****************************!*\ | ||
!*** ./src/lib/load-obj.js ***! | ||
\*****************************/ | ||
/*! exports provided: default */ | ||
@@ -194,3 +194,3 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return loadOBJ; }); | ||
/* harmony import */ var _parse_obj__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse-obj */ "./src/parse-obj.js"); | ||
/* harmony import */ var _parse_obj__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse-obj */ "./src/lib/parse-obj.js"); | ||
@@ -267,6 +267,6 @@ | ||
/***/ "./src/obj-loader.js": | ||
/*!***************************!*\ | ||
!*** ./src/obj-loader.js ***! | ||
\***************************/ | ||
/***/ "./src/lib/parse-obj.js": | ||
/*!******************************!*\ | ||
!*** ./src/lib/parse-obj.js ***! | ||
\******************************/ | ||
/*! exports provided: default */ | ||
@@ -277,52 +277,2 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var _load_obj__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./load-obj */ "./src/load-obj.js"); | ||
function testOBJFile(text) { | ||
// There could be comment line first | ||
return text[0] === 'v'; | ||
} | ||
/* harmony default export */ __webpack_exports__["default"] = ({ | ||
name: 'OBJ', | ||
extensions: ['obj'], | ||
testText: testOBJFile, | ||
parseTextSync: _load_obj__WEBPACK_IMPORTED_MODULE_0__["default"] | ||
}); | ||
/***/ }), | ||
/***/ "./src/obj-worker-loader.js": | ||
/*!**********************************!*\ | ||
!*** ./src/obj-worker-loader.js ***! | ||
\**********************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var _dist_obj_loader_worker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dist/obj-loader.worker.js */ "./dist/obj-loader.worker.js"); | ||
/* harmony import */ var _dist_obj_loader_worker_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dist_obj_loader_worker_js__WEBPACK_IMPORTED_MODULE_0__); | ||
// The bundled worker is imported as an inline string | ||
/* harmony default export */ __webpack_exports__["default"] = ({ | ||
name: 'OBJ', | ||
extensions: ['obj'], | ||
worker: (_dist_obj_loader_worker_js__WEBPACK_IMPORTED_MODULE_0___default()) | ||
}); | ||
/***/ }), | ||
/***/ "./src/parse-obj.js": | ||
/*!**************************!*\ | ||
!*** ./src/parse-obj.js ***! | ||
\**************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
// OBJ Loader, adapted from THREE.js (MIT license) | ||
@@ -854,2 +804,55 @@ // | ||
/***/ }), | ||
/***/ "./src/obj-loader.js": | ||
/*!***************************!*\ | ||
!*** ./src/obj-loader.js ***! | ||
\***************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var _lib_load_obj__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/load-obj */ "./src/lib/load-obj.js"); | ||
/* global TextDecoder */ | ||
/* harmony default export */ __webpack_exports__["default"] = ({ | ||
name: 'OBJ', | ||
extensions: ['obj'], | ||
mimeType: 'text/plain', | ||
parse: async (arrayBuffer, options) => Object(_lib_load_obj__WEBPACK_IMPORTED_MODULE_0__["default"])(new TextDecoder().decode(arrayBuffer), options), | ||
parseTextSync: _lib_load_obj__WEBPACK_IMPORTED_MODULE_0__["default"], | ||
testText: testOBJFile | ||
}); | ||
function testOBJFile(text) { | ||
// TODO - There could be comment line first | ||
return text[0] === 'v'; | ||
} | ||
/***/ }), | ||
/***/ "./src/obj-worker-loader.js": | ||
/*!**********************************!*\ | ||
!*** ./src/obj-worker-loader.js ***! | ||
\**********************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var _dist_obj_loader_worker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dist/obj-loader.worker.js */ "./dist/obj-loader.worker.js"); | ||
/* harmony import */ var _dist_obj_loader_worker_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dist_obj_loader_worker_js__WEBPACK_IMPORTED_MODULE_0__); | ||
// The bundled worker is imported as an inline string | ||
/* harmony default export */ __webpack_exports__["default"] = ({ | ||
name: 'OBJ', | ||
extensions: ['obj'], | ||
worker: (_dist_obj_loader_worker_js__WEBPACK_IMPORTED_MODULE_0___default()) | ||
}); | ||
/***/ }) | ||
@@ -856,0 +859,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e){!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){function r(t,e,r,n,o,i,s){try{var a=t[i](s),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var s=t.apply(e,n);function a(t){r(s,o,i,a,l,"next",t)}function l(t){r(s,o,i,a,l,"throw",t)}a(void 0)})}}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(e){return"function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},n(e)}t.exports=n},function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function l(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),s=new _(n||[]);return i._invoke=function(t,e,r){var n=c;return function(o,i){if(n===f)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=L(s,r);if(a){if(a===d)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===c)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var l=u(t,e,r);if("normal"===l.type){if(n=r.done?p:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n=p,r.method="throw",r.arg=l.arg)}}}(t,r,s),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var c="suspendedStart",h="suspendedYield",f="executing",p="completed",d={};function v(){}function m(){}function y(){}var b={};b[i]=function(){return this};var g=Object.getPrototypeOf,x=g&&g(g(F([])));x&&x!==r&&n.call(x,i)&&(b=x);var w=y.prototype=v.prototype=Object.create(b);function j(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function O(t){var e;this._invoke=function(r,o){function i(){return new Promise(function(e,i){!function e(r,o,i,s){var a=u(t[r],t,o);if("throw"!==a.type){var l=a.arg,c=l.value;return c&&"object"==typeof c&&n.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,i,s)},function(t){e("throw",t,i,s)}):Promise.resolve(c).then(function(t){l.value=t,i(l)},function(t){return e("throw",t,i,s)})}s(a.arg)}(r,o,e,i)})}return e=e?e.then(i,i):i()}}function L(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=u(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function F(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return s.next=s}}return{next:k}}function k(){return{value:e,done:!0}}return m.prototype=w.constructor=y,y.constructor=m,y[a]=m.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},j(O.prototype),O.prototype[s]=function(){return this},t.AsyncIterator=O,t.async=function(e,r,n,o){var i=new O(l(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(w),w[a]="Generator",w[i]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=F,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return a.type="throw",a.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var l=n.call(s,"catchLoc"),u=n.call(s,"finallyLoc");if(l&&u){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:F(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e);var n=r(1),o=r.n(n),i=r(2),s=r.n(i),a=/^[og]\s*(.+)?/,l=/^mtllib /,u=/^usemtl /,c=function(){function t(e){var r=e.index,n=e.name,i=void 0===n?"":n,s=e.mtllib,a=e.smooth,l=e.groupStart;o()(this,t),this.index=r,this.name=i,this.mtllib=s,this.smooth=a,this.groupStart=l,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return s()(t,[{key:"clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new t({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),t}(),h=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o()(this,t),this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}return s()(t,[{key:"startMaterial",value:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var n=new c({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}},{key:"currentMaterial",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:"_finalize",value:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}}]),t}(),f=function(){function t(){o()(this,t),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}return s()(t,[{key:"startObject",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);var r=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new h(t),this.object.fromDeclaration=e,r&&r.name&&"function"==typeof r.clone){var n=r.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)}},{key:"finalize",value:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:"parseVertexIndex",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:"parseNormalIndex",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:"parseUVIndex",value:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}},{key:"addVertex",value:function(t,e,r){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addVertexPoint",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:"addVertexLine",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:"addNormal",value:function(t,e,r){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addColor",value:function(t,e,r){var n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addUV",value:function(t,e,r){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}},{key:"addUVLine",value:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}},{key:"addFace",value:function(t,e,r,n,o,i,s,a,l){var u=this.vertices.length,c=this.parseVertexIndex(t,u),h=this.parseVertexIndex(e,u),f=this.parseVertexIndex(r,u);if(this.addVertex(c,h,f),void 0!==n&&""!==n){var p=this.uvs.length;c=this.parseUVIndex(n,p),h=this.parseUVIndex(o,p),f=this.parseUVIndex(i,p),this.addUV(c,h,f)}if(void 0!==s&&""!==s){var d=this.normals.length;c=this.parseNormalIndex(s,d),h=s===a?c:this.parseNormalIndex(a,d),f=s===l?c:this.parseNormalIndex(l,d),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}},{key:"addPointGeometry",value:function(t){this.object.geometry.type="Points";var e=this.vertices.length,r=!0,n=!1,o=void 0;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done);r=!0){var a=i.value;this.addVertexPoint(this.parseVertexIndex(a,e))}}catch(t){n=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(n)throw o}}}},{key:"addLineGeometry",value:function(t,e){this.object.geometry.type="Line";var r=this.vertices.length,n=this.uvs.length,o=!0,i=!1,s=void 0;try{for(var a,l=t[Symbol.iterator]();!(o=(a=l.next()).done);o=!0){var u=a.value;this.addVertexLine(this.parseVertexIndex(u,r))}}catch(t){i=!0,s=t}finally{try{o||null==l.return||l.return()}finally{if(i)throw s}}var c=!0,h=!1,f=void 0;try{for(var p,d=e[Symbol.iterator]();!(c=(p=d.next()).done);c=!0){var v=p.value;this.addUVLine(this.parseUVIndex(v,n))}}catch(t){h=!0,f=t}finally{try{c||null==d.return||d.return()}finally{if(h)throw f}}}}]),t}();function p(t,e){var r,n,o,i=new Float32Array(3*e),s=0,a=!0,l=!1,u=void 0;try{for(var c,h=t[Symbol.iterator]();!(a=(c=h.next()).done);a=!0){var f=c.value.attributes,p=f.POSITION,d=f.NORMAL,v=f.COLOR_0,m=f.TEXCOORD_0;i.set(p.value,3*s),d&&(r=r||new Float32Array(3*e)).set(d.value,3*s),v&&(n=n||new Float32Array(3*e)).set(v.value,3*s),m&&(o=o||new Float32Array(2*e)).set(m.value,2*s),s+=p.value.length/3}}catch(t){l=!0,u=t}finally{try{a||null==h.return||h.return()}finally{if(l)throw u}}var y={};return y.POSITION={value:i,size:3},r&&(y.NORMAL={value:r,size:3}),n&&(y.COLOR_0={value:n,size:3}),o&&(y.TEXCOORD_0={value:o,size:2}),y}var d={name:"OBJ",extensions:["obj"],testText:function(t){return"v"===t[0]},parseTextSync:function(t){var e=function(t){var e=new f;-1!==t.indexOf("\r\n")&&(t=t.replace(/\r\n/g,"\n")),-1!==t.indexOf("\\\n")&&(t=t.replace(/\\\n/g,""));for(var r=t.split("\n"),n="",o="",i=[],s="function"==typeof"".trimLeft,c=0,h=r.length;c<h;c++)if(n=r[c],0!==(n=s?n.trimLeft():n.trim()).length&&"#"!==(o=n.charAt(0)))if("v"===o){var p=n.split(/\s+/);switch(p[0]){case"v":e.vertices.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3])),8===p.length&&e.colors.push(parseFloat(p[4]),parseFloat(p[5]),parseFloat(p[6]));break;case"vn":e.normals.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3]));break;case"vt":e.uvs.push(parseFloat(p[1]),parseFloat(p[2]))}}else if("f"===o){for(var d=n.substr(1).trim().split(/\s+/),v=[],m=0,y=d.length;m<y;m++){var b=d[m];if(b.length>0){var g=b.split("/");v.push(g)}}for(var x=v[0],w=1,j=v.length-1;w<j;w++){var O=v[w],L=v[w+1];e.addFace(x[0],O[0],L[0],x[1],O[1],L[1],x[2],O[2],L[2])}}else if("l"===o){var S=n.substring(1).trim().split(" "),I=void 0,_=[];if(-1===n.indexOf("/"))I=S;else{I=[];for(var F=0,k=S.length;F<k;F++){var E=S[F].split("/");""!==E[0]&&I.push(E[0]),""!==E[1]&&_.push(E[1])}}e.addLineGeometry(I,_)}else if("p"===o){var V=n.substr(1).trim().split(" ");e.addPointGeometry(V)}else if(null!==(i=a.exec(n))){var P=(" "+i[0].substr(1).trim()).substr(1);e.startObject(P)}else if(u.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(l.test(n))e.materialLibraries.push(n.substring(7).trim());else{if("s"!==o){if("\0"===n)continue;throw new Error('Unexpected line: "'.concat(n,'"'))}if((i=n.split(" ")).length>1){var C=i[1].trim().toLowerCase();e.object.smooth="0"!==C&&"off"!==C}else e.object.smooth=!0;var A=e.object.currentMaterial();A&&(A.smooth=e.object.smooth)}e.finalize();var z=[],N=[],M=!0,T=!1,R=void 0;try{for(var U,G=e.objects[Symbol.iterator]();!(M=(U=G.next()).done);M=!0){var D=U.value,B=D.geometry;if(0!==B.vertices.length){var X={header:{vertexCount:B.vertices.length/3},attributes:{}};switch(B.type){case"Points":X.mode=0;break;case"Line":X.mode=1;break;default:X.mode=4}X.attributes.POSITION={value:new Float32Array(B.vertices),size:3},B.normals.length>0&&(X.attributes.NORMAL={value:new Float32Array(B.normals),size:3}),B.colors.length>0&&(X.attributes.COLOR_0={value:new Float32Array(B.colors),size:3}),B.uvs.length>0&&(X.attributes.TEXCOORD_0={value:new Float32Array(B.uvs),size:2}),X.materials=[];var J=!0,Y=!1,W=void 0;try{for(var $,q=D.materials[Symbol.iterator]();!(J=($=q.next()).done);J=!0){var H=$.value,K={name:H.name,flatShading:!H.smooth};X.materials.push(K),N.push(K)}}catch(t){Y=!0,W=t}finally{try{J||null==q.return||q.return()}finally{if(Y)throw W}}X.name=D.name,z.push(X)}}}catch(t){T=!0,R=t}finally{try{M||null==G.return||G.return()}finally{if(T)throw R}}return{meshes:z,materials:N}}(t).meshes,r=e.reduce(function(t,e){return t+e.header.vertexCount},0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:p(e,r)}}},v=r(0),m=r.n(v),y=r(3),b=r.n(y),g=r(4),x=r.n(g);function w(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t)if(t instanceof ArrayBuffer)n.add(t);else if(t.buffer&&t.buffer instanceof ArrayBuffer)n.add(t.buffer);else if(e&&"object"===x()(t))for(var o in t)w(t[o],e,n);return void 0===r?Array.from(n):null}function j(t,e,r,n,o){return O.apply(this,arguments)}function O(){return(O=b()(m.a.mark(function t(e,r,n,o,i){var s,a,l;return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.parseSync&&!e.parse){t.next=5;break}s=r,a=e.parseSync||e.parse,t.next=12;break;case 5:if(!e.parseTextSync){t.next=11;break}l=new TextDecoder,s=l.decode(r),a=e.parseTextSync,t.next=12;break;case 11:throw new Error("Could not load data with ".concat(e.name," loader"));case 12:return t.next=14,a(s,i);case 14:return t.abrupt("return",t.sent);case 15:case"end":return t.stop()}},t)}))).apply(this,arguments)}function L(t,e){return t&&"process"===t.type&&"loaders.gl"===t.source}!function(t){if("undefined"!=typeof self){self.onmessage=function(){var e=b()(m.a.mark(function e(r){var n,o,i,s,a,l,u,c,h,f;return m.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.data,e.prev=1,L(n)){e.next=4;break}return e.abrupt("return");case 4:return o=n.arraybuffer,i=n.byteOffset,s=void 0===i?0:i,a=n.byteLength,l=void 0===a?0:a,u=n.options,c=void 0===u?{}:u,e.next=7,j(t,o,s,l,c);case 7:h=e.sent,f=w(h),self.postMessage({type:"done",result:h},f),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 15:case"end":return e.stop()}},e,null,[[1,12]])}));return function(t){return e.apply(this,arguments)}}();var e=0;self.parse=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(o,i){var s=e++;self.addEventListener("message",function t(e){var r=e.data;if(r&&r.id===s)switch(r.type){case"process-done":self.removeEventListener("message",t),o(r.result);break;case"process-error":self.removeEventListener("message",t),i(r.message)}}),self.postMessage({type:"process",id:s,arraybuffer:t,options:r,url:n},[t])})}}}(d)}])},function(t,e,r){(function(e){const n=r(3),o="undefined"==typeof window?e:window;o.loaders=o.loaders||{},t.exports=Object.assign(o.loaders,n)}).call(this,r(2))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";r.r(e);const n=/^[og]\s*(.+)?/,o=/^mtllib /,i=/^usemtl /;class s{constructor({index:t,name:e="",mtllib:r,smooth:n,groupStart:o}){this.index=t,this.name=e,this.mtllib=r,this.smooth=n,this.groupStart=o,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}clone(t=this.index){return new s({index:t,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}class a{constructor(t=""){this.name=t,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}startMaterial(t,e){const r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);const n=new s({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}currentMaterial(){if(this.materials.length>0)return this.materials[this.materials.length-1]}_finalize(t){const e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(let t=this.materials.length-1;t>=0;t--)this.materials[t].groupCount<=0&&this.materials.splice(t,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}}class l{constructor(){this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}startObject(t,e=!0){if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);const r=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new a(t),this.object.fromDeclaration=e,r&&r.name&&"function"==typeof r.clone){const t=r.clone(0);t.inherited=!0,this.object.materials.push(t)}this.objects.push(this.object)}finalize(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)}parseVertexIndex(t,e){const r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}parseNormalIndex(t,e){const r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}parseUVIndex(t,e){const r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}addVertex(t,e,r){const n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}addVertexPoint(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}addVertexLine(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}addNormal(t,e,r){const n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}addColor(t,e,r){const n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}addUV(t,e,r){const n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}addUVLine(t){const e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}addFace(t,e,r,n,o,i,s,a,l){const u=this.vertices.length;let c=this.parseVertexIndex(t,u),h=this.parseVertexIndex(e,u),f=this.parseVertexIndex(r,u);if(this.addVertex(c,h,f),void 0!==n&&""!==n){const t=this.uvs.length;c=this.parseUVIndex(n,t),h=this.parseUVIndex(o,t),f=this.parseUVIndex(i,t),this.addUV(c,h,f)}if(void 0!==s&&""!==s){const t=this.normals.length;c=this.parseNormalIndex(s,t),h=s===a?c:this.parseNormalIndex(a,t),f=s===l?c:this.parseNormalIndex(l,t),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}addPointGeometry(t){this.object.geometry.type="Points";const e=this.vertices.length;for(const r of t)this.addVertexPoint(this.parseVertexIndex(r,e))}addLineGeometry(t,e){this.object.geometry.type="Line";const r=this.vertices.length,n=this.uvs.length;for(const e of t)this.addVertexLine(this.parseVertexIndex(e,r));for(const t of e)this.addUVLine(this.parseUVIndex(t,n))}}var u=t=>{const e=new l;-1!==t.indexOf("\r\n")&&(t=t.replace(/\r\n/g,"\n")),-1!==t.indexOf("\\\n")&&(t=t.replace(/\\\n/g,""));const r=t.split("\n");let s="",a="",u=0,c=[];const h="function"==typeof"".trimLeft;for(let t=0,l=r.length;t<l;t++)if(s=r[t],0!==(u=(s=h?s.trimLeft():s.trim()).length)&&"#"!==(a=s.charAt(0)))if("v"===a){const t=s.split(/\s+/);switch(t[0]){case"v":e.vertices.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),8===t.length&&e.colors.push(parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]));break;case"vn":e.normals.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]));break;case"vt":e.uvs.push(parseFloat(t[1]),parseFloat(t[2]))}}else if("f"===a){const t=s.substr(1).trim().split(/\s+/),r=[];for(let e=0,n=t.length;e<n;e++){const n=t[e];if(n.length>0){const t=n.split("/");r.push(t)}}const n=r[0];for(let t=1,o=r.length-1;t<o;t++){const o=r[t],i=r[t+1];e.addFace(n[0],o[0],i[0],n[1],o[1],i[1],n[2],o[2],i[2])}}else if("l"===a){const t=s.substring(1).trim().split(" ");let r;const n=[];if(-1===s.indexOf("/"))r=t;else{r=[];for(let e=0,o=t.length;e<o;e++){const o=t[e].split("/");""!==o[0]&&r.push(o[0]),""!==o[1]&&n.push(o[1])}}e.addLineGeometry(r,n)}else if("p"===a){const t=s.substr(1).trim().split(" ");e.addPointGeometry(t)}else if(null!==(c=n.exec(s))){const t=(" "+c[0].substr(1).trim()).substr(1);e.startObject(t)}else if(i.test(s))e.object.startMaterial(s.substring(7).trim(),e.materialLibraries);else if(o.test(s))e.materialLibraries.push(s.substring(7).trim());else{if("s"!==a){if("\0"===s)continue;throw new Error(`Unexpected line: "${s}"`)}{if((c=s.split(" ")).length>1){const t=c[1].trim().toLowerCase();e.object.smooth="0"!==t&&"off"!==t}else e.object.smooth=!0;const t=e.object.currentMaterial();t&&(t.smooth=e.object.smooth)}}e.finalize();const f=[],p=[];for(const t of e.objects){const{geometry:e}=t;if(0===e.vertices.length)continue;const r={header:{vertexCount:e.vertices.length/3},attributes:{}};switch(e.type){case"Points":r.mode=0;break;case"Line":r.mode=1;break;default:r.mode=4}r.attributes.POSITION={value:new Float32Array(e.vertices),size:3},e.normals.length>0&&(r.attributes.NORMAL={value:new Float32Array(e.normals),size:3}),e.colors.length>0&&(r.attributes.COLOR_0={value:new Float32Array(e.colors),size:3}),e.uvs.length>0&&(r.attributes.TEXCOORD_0={value:new Float32Array(e.uvs),size:2}),r.materials=[];for(const e of t.materials){const t={name:e.name,flatShading:!e.smooth};r.materials.push(t),p.push(t)}r.name=t.name,f.push(r)}return{meshes:f,materials:p}};function c(t,e){const r=new Float32Array(3*e);let n,o,i,s=0;for(const a of t){const{POSITION:t,NORMAL:l,COLOR_0:u,TEXCOORD_0:c}=a.attributes;r.set(t.value,3*s),l&&(n=n||new Float32Array(3*e)).set(l.value,3*s),u&&(o=o||new Float32Array(3*e)).set(u.value,3*s),c&&(i=i||new Float32Array(2*e)).set(c.value,2*s),s+=t.value.length/3}const a={};return a.POSITION={value:r,size:3},n&&(a.NORMAL={value:n,size:3}),o&&(a.COLOR_0={value:o,size:3}),i&&(a.TEXCOORD_0={value:i,size:2}),a}var h={name:"OBJ",extensions:["obj"],testText:function(t){return"v"===t[0]},parseTextSync:function(t){const{meshes:e}=u(t),r=e.reduce((t,e)=>t+e.header.vertexCount,0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:c(e,r)}}},f=r(0),p={name:"OBJ",extensions:["obj"],worker:r.n(f).a};r.d(e,"OBJLoader",function(){return h}),r.d(e,"OBJWorkerLoader",function(){return p})}])}); | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e){!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){function r(t,e,r,n,o,i,s){try{var a=t[i](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var s=t.apply(e,n);function a(t){r(s,o,i,a,u,"next",t)}function u(t){r(s,o,i,a,u,"throw",t)}a(void 0)})}}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(e){return"function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},n(e)}t.exports=n},function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function u(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),s=new _(n||[]);return i._invoke=function(t,e,r){var n=c;return function(o,i){if(n===f)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=L(s,r);if(a){if(a===d)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===c)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var u=l(t,e,r);if("normal"===u.type){if(n=r.done?p:h,u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(t,r,s),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var c="suspendedStart",h="suspendedYield",f="executing",p="completed",d={};function v(){}function m(){}function y(){}var b={};b[i]=function(){return this};var g=Object.getPrototypeOf,x=g&&g(g(F([])));x&&x!==r&&n.call(x,i)&&(b=x);var w=y.prototype=v.prototype=Object.create(b);function j(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function O(t){var e;this._invoke=function(r,o){function i(){return new Promise(function(e,i){!function e(r,o,i,s){var a=l(t[r],t,o);if("throw"!==a.type){var u=a.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,i,s)},function(t){e("throw",t,i,s)}):Promise.resolve(c).then(function(t){u.value=t,i(u)},function(t){return e("throw",t,i,s)})}s(a.arg)}(r,o,e,i)})}return e=e?e.then(i,i):i()}}function L(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function F(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return s.next=s}}return{next:k}}function k(){return{value:e,done:!0}}return m.prototype=w.constructor=y,y.constructor=m,y[a]=m.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},j(O.prototype),O.prototype[s]=function(){return this},t.AsyncIterator=O,t.async=function(e,r,n,o){var i=new O(u(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(w),w[a]="Generator",w[i]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=F,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return a.type="throw",a.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(u&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:F(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),i=r(1),s=r.n(i),a=r(2),u=r.n(a),l=r(3),c=r.n(l),h=/^[og]\s*(.+)?/,f=/^mtllib /,p=/^usemtl /,d=function(){function t(e){var r=e.index,n=e.name,o=void 0===n?"":n,i=e.mtllib,s=e.smooth,a=e.groupStart;u()(this,t),this.index=r,this.name=o,this.mtllib=i,this.smooth=s,this.groupStart=a,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return c()(t,[{key:"clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new t({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),t}(),v=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u()(this,t),this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}return c()(t,[{key:"startMaterial",value:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var n=new d({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}},{key:"currentMaterial",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:"_finalize",value:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}}]),t}(),m=function(){function t(){u()(this,t),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}return c()(t,[{key:"startObject",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);var r=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new v(t),this.object.fromDeclaration=e,r&&r.name&&"function"==typeof r.clone){var n=r.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)}},{key:"finalize",value:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:"parseVertexIndex",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:"parseNormalIndex",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:"parseUVIndex",value:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}},{key:"addVertex",value:function(t,e,r){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addVertexPoint",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:"addVertexLine",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:"addNormal",value:function(t,e,r){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addColor",value:function(t,e,r){var n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addUV",value:function(t,e,r){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}},{key:"addUVLine",value:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}},{key:"addFace",value:function(t,e,r,n,o,i,s,a,u){var l=this.vertices.length,c=this.parseVertexIndex(t,l),h=this.parseVertexIndex(e,l),f=this.parseVertexIndex(r,l);if(this.addVertex(c,h,f),void 0!==n&&""!==n){var p=this.uvs.length;c=this.parseUVIndex(n,p),h=this.parseUVIndex(o,p),f=this.parseUVIndex(i,p),this.addUV(c,h,f)}if(void 0!==s&&""!==s){var d=this.normals.length;c=this.parseNormalIndex(s,d),h=s===a?c:this.parseNormalIndex(a,d),f=s===u?c:this.parseNormalIndex(u,d),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}},{key:"addPointGeometry",value:function(t){this.object.geometry.type="Points";var e=this.vertices.length,r=!0,n=!1,o=void 0;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done);r=!0){var a=i.value;this.addVertexPoint(this.parseVertexIndex(a,e))}}catch(t){n=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(n)throw o}}}},{key:"addLineGeometry",value:function(t,e){this.object.geometry.type="Line";var r=this.vertices.length,n=this.uvs.length,o=!0,i=!1,s=void 0;try{for(var a,u=t[Symbol.iterator]();!(o=(a=u.next()).done);o=!0){var l=a.value;this.addVertexLine(this.parseVertexIndex(l,r))}}catch(t){i=!0,s=t}finally{try{o||null==u.return||u.return()}finally{if(i)throw s}}var c=!0,h=!1,f=void 0;try{for(var p,d=e[Symbol.iterator]();!(c=(p=d.next()).done);c=!0){var v=p.value;this.addUVLine(this.parseUVIndex(v,n))}}catch(t){h=!0,f=t}finally{try{c||null==d.return||d.return()}finally{if(h)throw f}}}}]),t}(),y=function(t){var e=new m;-1!==t.indexOf("\r\n")&&(t=t.replace(/\r\n/g,"\n")),-1!==t.indexOf("\\\n")&&(t=t.replace(/\\\n/g,""));for(var r=t.split("\n"),n="",o="",i=[],s="function"==typeof"".trimLeft,a=0,u=r.length;a<u;a++)if(n=r[a],0!==(n=s?n.trimLeft():n.trim()).length&&"#"!==(o=n.charAt(0)))if("v"===o){var l=n.split(/\s+/);switch(l[0]){case"v":e.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),8===l.length&&e.colors.push(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6]));break;case"vn":e.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case"vt":e.uvs.push(parseFloat(l[1]),parseFloat(l[2]))}}else if("f"===o){for(var c=n.substr(1).trim().split(/\s+/),d=[],v=0,y=c.length;v<y;v++){var b=c[v];if(b.length>0){var g=b.split("/");d.push(g)}}for(var x=d[0],w=1,j=d.length-1;w<j;w++){var O=d[w],L=d[w+1];e.addFace(x[0],O[0],L[0],x[1],O[1],L[1],x[2],O[2],L[2])}}else if("l"===o){var S=n.substring(1).trim().split(" "),I=void 0,_=[];if(-1===n.indexOf("/"))I=S;else{I=[];for(var F=0,k=S.length;F<k;F++){var E=S[F].split("/");""!==E[0]&&I.push(E[0]),""!==E[1]&&_.push(E[1])}}e.addLineGeometry(I,_)}else if("p"===o){var V=n.substr(1).trim().split(" ");e.addPointGeometry(V)}else if(null!==(i=h.exec(n))){var P=(" "+i[0].substr(1).trim()).substr(1);e.startObject(P)}else if(p.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(f.test(n))e.materialLibraries.push(n.substring(7).trim());else{if("s"!==o){if("\0"===n)continue;throw new Error('Unexpected line: "'.concat(n,'"'))}if((i=n.split(" ")).length>1){var C=i[1].trim().toLowerCase();e.object.smooth="0"!==C&&"off"!==C}else e.object.smooth=!0;var A=e.object.currentMaterial();A&&(A.smooth=e.object.smooth)}e.finalize();var T=[],z=[],N=!0,M=!1,R=void 0;try{for(var U,D=e.objects[Symbol.iterator]();!(N=(U=D.next()).done);N=!0){var G=U.value,B=G.geometry;if(0!==B.vertices.length){var X={header:{vertexCount:B.vertices.length/3},attributes:{}};switch(B.type){case"Points":X.mode=0;break;case"Line":X.mode=1;break;default:X.mode=4}X.attributes.POSITION={value:new Float32Array(B.vertices),size:3},B.normals.length>0&&(X.attributes.NORMAL={value:new Float32Array(B.normals),size:3}),B.colors.length>0&&(X.attributes.COLOR_0={value:new Float32Array(B.colors),size:3}),B.uvs.length>0&&(X.attributes.TEXCOORD_0={value:new Float32Array(B.uvs),size:2}),X.materials=[];var J=!0,Y=!1,W=void 0;try{for(var $,q=G.materials[Symbol.iterator]();!(J=($=q.next()).done);J=!0){var H=$.value,K={name:H.name,flatShading:!H.smooth};X.materials.push(K),z.push(K)}}catch(t){Y=!0,W=t}finally{try{J||null==q.return||q.return()}finally{if(Y)throw W}}X.name=G.name,T.push(X)}}}catch(t){M=!0,R=t}finally{try{N||null==D.return||D.return()}finally{if(M)throw R}}return{meshes:T,materials:z}};function b(t){var e=y(t).meshes,r=e.reduce(function(t,e){return t+e.header.vertexCount},0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:g(e,r)}}function g(t,e){var r,n,o,i=new Float32Array(3*e),s=0,a=!0,u=!1,l=void 0;try{for(var c,h=t[Symbol.iterator]();!(a=(c=h.next()).done);a=!0){var f=c.value.attributes,p=f.POSITION,d=f.NORMAL,v=f.COLOR_0,m=f.TEXCOORD_0;i.set(p.value,3*s),d&&(r=r||new Float32Array(3*e)).set(d.value,3*s),v&&(n=n||new Float32Array(3*e)).set(v.value,3*s),m&&(o=o||new Float32Array(2*e)).set(m.value,2*s),s+=p.value.length/3}}catch(t){u=!0,l=t}finally{try{a||null==h.return||h.return()}finally{if(u)throw l}}var y={};return y.POSITION={value:i,size:3},r&&(y.NORMAL={value:r,size:3}),n&&(y.COLOR_0={value:n,size:3}),o&&(y.TEXCOORD_0={value:o,size:2}),y}var x,w={name:"OBJ",extensions:["obj"],mimeType:"text/plain",parse:(x=s()(o.a.mark(function t(e,r){return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",b((new TextDecoder).decode(e)));case 1:case"end":return t.stop()}},t)})),function(t,e){return x.apply(this,arguments)}),parseTextSync:b,testText:function(t){return"v"===t[0]}},j=r(4),O=r.n(j);function L(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t)if(t instanceof ArrayBuffer)n.add(t);else if(t.buffer&&t.buffer instanceof ArrayBuffer)n.add(t.buffer);else if(e&&"object"===O()(t))for(var o in t)L(t[o],e,n);return void 0===r?Array.from(n):null}function S(t,e,r,n,o){return I.apply(this,arguments)}function I(){return(I=s()(o.a.mark(function t(e,r,n,i,s){var a,u,l;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.parseSync&&!e.parse){t.next=5;break}a=r,u=e.parseSync||e.parse,t.next=12;break;case 5:if(!e.parseTextSync){t.next=11;break}l=new TextDecoder,a=l.decode(r),u=e.parseTextSync,t.next=12;break;case 11:throw new Error("Could not load data with ".concat(e.name," loader"));case 12:return t.next=14,u(a,s);case 14:return t.abrupt("return",t.sent);case 15:case"end":return t.stop()}},t)}))).apply(this,arguments)}function _(t,e){return t&&"process"===t.type&&"loaders.gl"===t.source}!function(t){if("undefined"!=typeof self){self.onmessage=function(){var e=s()(o.a.mark(function e(r){var n,i,s,a,u,l,c,h,f,p;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.data,e.prev=1,_(n)){e.next=4;break}return e.abrupt("return");case 4:return i=n.arraybuffer,s=n.byteOffset,a=void 0===s?0:s,u=n.byteLength,l=void 0===u?0:u,c=n.options,h=void 0===c?{}:c,e.next=7,S(t,i,a,l,h);case 7:f=e.sent,p=L(f),self.postMessage({type:"done",result:f},p),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 15:case"end":return e.stop()}},e,null,[[1,12]])}));return function(t){return e.apply(this,arguments)}}();var e=0;self.parse=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(o,i){var s=e++;self.addEventListener("message",function t(e){var r=e.data;if(r&&r.id===s)switch(r.type){case"process-done":self.removeEventListener("message",t),o(r.result);break;case"process-error":self.removeEventListener("message",t),i(r.message)}}),self.postMessage({type:"process",id:s,arraybuffer:t,options:r,url:n},[t])})}}}(w)}])},function(t,e,r){(function(e){const n=r(3),o="undefined"==typeof window?e:window;o.loaders=o.loaders||{},t.exports=Object.assign(o.loaders,n)}).call(this,r(2))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";r.r(e);const n=/^[og]\s*(.+)?/,o=/^mtllib /,i=/^usemtl /;class s{constructor({index:t,name:e="",mtllib:r,smooth:n,groupStart:o}){this.index=t,this.name=e,this.mtllib=r,this.smooth=n,this.groupStart=o,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}clone(t=this.index){return new s({index:t,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}class a{constructor(t=""){this.name=t,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}startMaterial(t,e){const r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);const n=new s({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}currentMaterial(){if(this.materials.length>0)return this.materials[this.materials.length-1]}_finalize(t){const e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(let t=this.materials.length-1;t>=0;t--)this.materials[t].groupCount<=0&&this.materials.splice(t,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}}class u{constructor(){this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}startObject(t,e=!0){if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);const r=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new a(t),this.object.fromDeclaration=e,r&&r.name&&"function"==typeof r.clone){const t=r.clone(0);t.inherited=!0,this.object.materials.push(t)}this.objects.push(this.object)}finalize(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)}parseVertexIndex(t,e){const r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}parseNormalIndex(t,e){const r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}parseUVIndex(t,e){const r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}addVertex(t,e,r){const n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}addVertexPoint(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}addVertexLine(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}addNormal(t,e,r){const n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}addColor(t,e,r){const n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}addUV(t,e,r){const n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}addUVLine(t){const e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}addFace(t,e,r,n,o,i,s,a,u){const l=this.vertices.length;let c=this.parseVertexIndex(t,l),h=this.parseVertexIndex(e,l),f=this.parseVertexIndex(r,l);if(this.addVertex(c,h,f),void 0!==n&&""!==n){const t=this.uvs.length;c=this.parseUVIndex(n,t),h=this.parseUVIndex(o,t),f=this.parseUVIndex(i,t),this.addUV(c,h,f)}if(void 0!==s&&""!==s){const t=this.normals.length;c=this.parseNormalIndex(s,t),h=s===a?c:this.parseNormalIndex(a,t),f=s===u?c:this.parseNormalIndex(u,t),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}addPointGeometry(t){this.object.geometry.type="Points";const e=this.vertices.length;for(const r of t)this.addVertexPoint(this.parseVertexIndex(r,e))}addLineGeometry(t,e){this.object.geometry.type="Line";const r=this.vertices.length,n=this.uvs.length;for(const e of t)this.addVertexLine(this.parseVertexIndex(e,r));for(const t of e)this.addUVLine(this.parseUVIndex(t,n))}}var l=t=>{const e=new u;-1!==t.indexOf("\r\n")&&(t=t.replace(/\r\n/g,"\n")),-1!==t.indexOf("\\\n")&&(t=t.replace(/\\\n/g,""));const r=t.split("\n");let s="",a="",l=0,c=[];const h="function"==typeof"".trimLeft;for(let t=0,u=r.length;t<u;t++)if(s=r[t],0!==(l=(s=h?s.trimLeft():s.trim()).length)&&"#"!==(a=s.charAt(0)))if("v"===a){const t=s.split(/\s+/);switch(t[0]){case"v":e.vertices.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),8===t.length&&e.colors.push(parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]));break;case"vn":e.normals.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]));break;case"vt":e.uvs.push(parseFloat(t[1]),parseFloat(t[2]))}}else if("f"===a){const t=s.substr(1).trim().split(/\s+/),r=[];for(let e=0,n=t.length;e<n;e++){const n=t[e];if(n.length>0){const t=n.split("/");r.push(t)}}const n=r[0];for(let t=1,o=r.length-1;t<o;t++){const o=r[t],i=r[t+1];e.addFace(n[0],o[0],i[0],n[1],o[1],i[1],n[2],o[2],i[2])}}else if("l"===a){const t=s.substring(1).trim().split(" ");let r;const n=[];if(-1===s.indexOf("/"))r=t;else{r=[];for(let e=0,o=t.length;e<o;e++){const o=t[e].split("/");""!==o[0]&&r.push(o[0]),""!==o[1]&&n.push(o[1])}}e.addLineGeometry(r,n)}else if("p"===a){const t=s.substr(1).trim().split(" ");e.addPointGeometry(t)}else if(null!==(c=n.exec(s))){const t=(" "+c[0].substr(1).trim()).substr(1);e.startObject(t)}else if(i.test(s))e.object.startMaterial(s.substring(7).trim(),e.materialLibraries);else if(o.test(s))e.materialLibraries.push(s.substring(7).trim());else{if("s"!==a){if("\0"===s)continue;throw new Error(`Unexpected line: "${s}"`)}{if((c=s.split(" ")).length>1){const t=c[1].trim().toLowerCase();e.object.smooth="0"!==t&&"off"!==t}else e.object.smooth=!0;const t=e.object.currentMaterial();t&&(t.smooth=e.object.smooth)}}e.finalize();const f=[],p=[];for(const t of e.objects){const{geometry:e}=t;if(0===e.vertices.length)continue;const r={header:{vertexCount:e.vertices.length/3},attributes:{}};switch(e.type){case"Points":r.mode=0;break;case"Line":r.mode=1;break;default:r.mode=4}r.attributes.POSITION={value:new Float32Array(e.vertices),size:3},e.normals.length>0&&(r.attributes.NORMAL={value:new Float32Array(e.normals),size:3}),e.colors.length>0&&(r.attributes.COLOR_0={value:new Float32Array(e.colors),size:3}),e.uvs.length>0&&(r.attributes.TEXCOORD_0={value:new Float32Array(e.uvs),size:2}),r.materials=[];for(const e of t.materials){const t={name:e.name,flatShading:!e.smooth};r.materials.push(t),p.push(t)}r.name=t.name,f.push(r)}return{meshes:f,materials:p}};function c(t){const{meshes:e}=l(t),r=e.reduce((t,e)=>t+e.header.vertexCount,0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:h(e,r)}}function h(t,e){const r=new Float32Array(3*e);let n,o,i,s=0;for(const a of t){const{POSITION:t,NORMAL:u,COLOR_0:l,TEXCOORD_0:c}=a.attributes;r.set(t.value,3*s),u&&(n=n||new Float32Array(3*e)).set(u.value,3*s),l&&(o=o||new Float32Array(3*e)).set(l.value,3*s),c&&(i=i||new Float32Array(2*e)).set(c.value,2*s),s+=t.value.length/3}const a={};return a.POSITION={value:r,size:3},n&&(a.NORMAL={value:n,size:3}),o&&(a.COLOR_0={value:o,size:3}),i&&(a.TEXCOORD_0={value:i,size:2}),a}var f={name:"OBJ",extensions:["obj"],mimeType:"text/plain",parse:async(t,e)=>c((new TextDecoder).decode(t)),parseTextSync:c,testText:function(t){return"v"===t[0]}};var p=r(0),d={name:"OBJ",extensions:["obj"],worker:r.n(p).a};r.d(e,"OBJLoader",function(){return f}),r.d(e,"OBJWorkerLoader",function(){return d})}])}); |
@@ -10,15 +10,42 @@ "use strict"; | ||
var _loadObj = _interopRequireDefault(require("./load-obj")); | ||
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); | ||
function testOBJFile(text) { | ||
return text[0] === 'v'; | ||
} | ||
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); | ||
var _loadObj = _interopRequireDefault(require("./lib/load-obj")); | ||
var _default = { | ||
name: 'OBJ', | ||
extensions: ['obj'], | ||
testText: testOBJFile, | ||
parseTextSync: _loadObj["default"] | ||
mimeType: 'text/plain', | ||
parse: function () { | ||
var _parse = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(arrayBuffer, options) { | ||
return _regenerator["default"].wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
return _context.abrupt("return", (0, _loadObj["default"])(new TextDecoder().decode(arrayBuffer), options)); | ||
case 1: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee); | ||
})); | ||
function parse(_x, _x2) { | ||
return _parse.apply(this, arguments); | ||
} | ||
return parse; | ||
}(), | ||
parseTextSync: _loadObj["default"], | ||
testText: testOBJFile | ||
}; | ||
exports["default"] = _default; | ||
function testOBJFile(text) { | ||
return text[0] === 'v'; | ||
} | ||
//# sourceMappingURL=obj-loader.js.map |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports["default"] = void 0; | ||
var worker = "!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,\"a\",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p=\"\",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,u,\"next\",t)}function u(t){r(a,o,i,s,u,\"throw\",t)}s(void 0)})}}},function(t,e){function r(t){return(r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function n(e){return\"function\"==typeof Symbol&&\"symbol\"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":r(t)},n(e)}t.exports=n},function(t,e,r){var n=function(t){\"use strict\";var e,r=Object.prototype,n=r.hasOwnProperty,o=\"function\"==typeof Symbol?Symbol:{},i=o.iterator||\"@@iterator\",a=o.asyncIterator||\"@@asyncIterator\",s=o.toStringTag||\"@@toStringTag\";function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=c;return function(o,i){if(n===f)throw new Error(\"Generator is already running\");if(n===v){if(\"throw\"===o)throw i;return F()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===p)continue;return s}}if(\"next\"===r.method)r.sent=r._sent=r.arg;else if(\"throw\"===r.method){if(n===c)throw n=v,r.arg;r.dispatchException(r.arg)}else\"return\"===r.method&&r.abrupt(\"return\",r.arg);n=f;var u=l(t,e,r);if(\"normal\"===u.type){if(n=r.done?v:h,u.arg===p)continue;return{value:u.arg,done:r.done}}\"throw\"===u.type&&(n=v,r.method=\"throw\",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}t.wrap=u;var c=\"suspendedStart\",h=\"suspendedYield\",f=\"executing\",v=\"completed\",p={};function y(){}function d(){}function m(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(_([])));x&&x!==r&&n.call(x,i)&&(g=x);var w=m.prototype=y.prototype=Object.create(g);function j(t){[\"next\",\"throw\",\"return\"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(r,o){function i(){return new Promise(function(e,i){!function e(r,o,i,a){var s=l(t[r],t,o);if(\"throw\"!==s.type){var u=s.arg,c=u.value;return c&&\"object\"==typeof c&&n.call(c,\"__await\")?Promise.resolve(c.__await).then(function(t){e(\"next\",t,i,a)},function(t){e(\"throw\",t,i,a)}):Promise.resolve(c).then(function(t){u.value=t,i(u)},function(t){return e(\"throw\",t,i,a)})}a(s.arg)}(r,o,e,i)})}return e=e?e.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,\"throw\"===r.method){if(t.iterator.return&&(r.method=\"return\",r.arg=e,O(t,r),\"throw\"===r.method))return p;r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a 'throw' method\")}return p}var o=l(n,t.iterator,r.arg);if(\"throw\"===o.type)return r.method=\"throw\",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=e),r.delegate=null,p):i:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,p)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(S,this),this.reset(!0)}function _(t){if(t){var r=t[i];if(r)return r.call(t);if(\"function\"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:F}}function F(){return{value:e,done:!0}}return d.prototype=w.constructor=m,m.constructor=d,m[s]=d.displayName=\"GeneratorFunction\",t.isGeneratorFunction=function(t){var e=\"function\"==typeof t&&t.constructor;return!!e&&(e===d||\"GeneratorFunction\"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s in t||(t[s]=\"GeneratorFunction\")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},j(L.prototype),L.prototype[a]=function(){return this},t.AsyncIterator=L,t.async=function(e,r,n,o){var i=new L(u(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(w),w[s]=\"Generator\",w[i]=function(){return this},w.toString=function(){return\"[object Generator]\"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method=\"next\",this.arg=e,this.tryEntries.forEach(k),!t)for(var r in this)\"t\"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(\"throw\"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type=\"throw\",s.arg=t,r.next=n,o&&(r.method=\"next\",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),l=n.call(a,\"finallyLoc\");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error(\"try statement without catch or finally\");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev<o.finallyLoc){var i=o;break}}i&&(\"break\"===t||\"continue\"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method=\"next\",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if(\"throw\"===t.type)throw t.arg;return\"break\"===t.type||\"continue\"===t.type?this.next=t.arg:\"return\"===t.type?(this.rval=this.arg=t.arg,this.method=\"return\",this.next=\"end\"):\"normal\"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;k(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:_(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function(\"r\",\"regeneratorRuntime = r\")(n)}},function(t,e,r){\"use strict\";r.r(e);var n=r(1),o=r.n(n),i=r(2),a=r.n(i),s=/^[og]\\s*(.+)?/,u=/^mtllib /,l=/^usemtl /,c=function(){function t(e){var r=e.index,n=e.name,i=void 0===n?\"\":n,a=e.mtllib,s=e.smooth,u=e.groupStart;o()(this,t),this.index=r,this.name=i,this.mtllib=a,this.smooth=s,this.groupStart=u,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return a()(t,[{key:\"clone\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new t({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),t}(),h=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";o()(this,t),this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}return a()(t,[{key:\"startMaterial\",value:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var n=new c({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:\"\",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}},{key:\"currentMaterial\",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:\"_finalize\",value:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return t&&0===this.materials.length&&this.materials.push({name:\"\",smooth:this.smooth}),e}}]),t}(),f=function(){function t(){o()(this,t),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject(\"\",!1)}return a()(t,[{key:\"startObject\",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);var r=this.object&&\"function\"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&\"function\"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new h(t),this.object.fromDeclaration=e,r&&r.name&&\"function\"==typeof r.clone){var n=r.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)}},{key:\"finalize\",value:function(){this.object&&\"function\"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:\"parseVertexIndex\",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:\"parseNormalIndex\",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:\"parseUVIndex\",value:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}},{key:\"addVertex\",value:function(t,e,r){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addVertexPoint\",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:\"addVertexLine\",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:\"addNormal\",value:function(t,e,r){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addColor\",value:function(t,e,r){var n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addUV\",value:function(t,e,r){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}},{key:\"addUVLine\",value:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}},{key:\"addFace\",value:function(t,e,r,n,o,i,a,s,u){var l=this.vertices.length,c=this.parseVertexIndex(t,l),h=this.parseVertexIndex(e,l),f=this.parseVertexIndex(r,l);if(this.addVertex(c,h,f),void 0!==n&&\"\"!==n){var v=this.uvs.length;c=this.parseUVIndex(n,v),h=this.parseUVIndex(o,v),f=this.parseUVIndex(i,v),this.addUV(c,h,f)}if(void 0!==a&&\"\"!==a){var p=this.normals.length;c=this.parseNormalIndex(a,p),h=a===s?c:this.parseNormalIndex(s,p),f=a===u?c:this.parseNormalIndex(u,p),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}},{key:\"addPointGeometry\",value:function(t){this.object.geometry.type=\"Points\";var e=this.vertices.length,r=!0,n=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var s=i.value;this.addVertexPoint(this.parseVertexIndex(s,e))}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}}},{key:\"addLineGeometry\",value:function(t,e){this.object.geometry.type=\"Line\";var r=this.vertices.length,n=this.uvs.length,o=!0,i=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value;this.addVertexLine(this.parseVertexIndex(l,r))}}catch(t){i=!0,a=t}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}var c=!0,h=!1,f=void 0;try{for(var v,p=e[Symbol.iterator]();!(c=(v=p.next()).done);c=!0){var y=v.value;this.addUVLine(this.parseUVIndex(y,n))}}catch(t){h=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(h)throw f}}}}]),t}(),v=function(t){var e=new f;-1!==t.indexOf(\"\\r\\n\")&&(t=t.replace(/\\r\\n/g,\"\\n\")),-1!==t.indexOf(\"\\\\\\n\")&&(t=t.replace(/\\\\\\n/g,\"\"));for(var r=t.split(\"\\n\"),n=\"\",o=\"\",i=[],a=\"function\"==typeof\"\".trimLeft,c=0,h=r.length;c<h;c++)if(n=r[c],0!==(n=a?n.trimLeft():n.trim()).length&&\"#\"!==(o=n.charAt(0)))if(\"v\"===o){var v=n.split(/\\s+/);switch(v[0]){case\"v\":e.vertices.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3])),8===v.length&&e.colors.push(parseFloat(v[4]),parseFloat(v[5]),parseFloat(v[6]));break;case\"vn\":e.normals.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3]));break;case\"vt\":e.uvs.push(parseFloat(v[1]),parseFloat(v[2]))}}else if(\"f\"===o){for(var p=n.substr(1).trim().split(/\\s+/),y=[],d=0,m=p.length;d<m;d++){var g=p[d];if(g.length>0){var b=g.split(\"/\");y.push(b)}}for(var x=y[0],w=1,j=y.length-1;w<j;w++){var L=y[w],O=y[w+1];e.addFace(x[0],L[0],O[0],x[1],L[1],O[1],x[2],L[2],O[2])}}else if(\"l\"===o){var S=n.substring(1).trim().split(\" \"),k=void 0,E=[];if(-1===n.indexOf(\"/\"))k=S;else{k=[];for(var _=0,F=S.length;_<F;_++){var I=S[_].split(\"/\");\"\"!==I[0]&&k.push(I[0]),\"\"!==I[1]&&E.push(I[1])}}e.addLineGeometry(k,E)}else if(\"p\"===o){var P=n.substr(1).trim().split(\" \");e.addPointGeometry(P)}else if(null!==(i=s.exec(n))){var V=(\" \"+i[0].substr(1).trim()).substr(1);e.startObject(V)}else if(l.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(u.test(n))e.materialLibraries.push(n.substring(7).trim());else{if(\"s\"!==o){if(\"\\0\"===n)continue;throw new Error('Unexpected line: \"'.concat(n,'\"'))}if((i=n.split(\" \")).length>1){var N=i[1].trim().toLowerCase();e.object.smooth=\"0\"!==N&&\"off\"!==N}else e.object.smooth=!0;var A=e.object.currentMaterial();A&&(A.smooth=e.object.smooth)}e.finalize();var T=[],C=[],M=!0,z=!1,G=void 0;try{for(var R,U=e.objects[Symbol.iterator]();!(M=(R=U.next()).done);M=!0){var D=R.value,B=D.geometry;if(0!==B.vertices.length){var X={header:{vertexCount:B.vertices.length/3},attributes:{}};switch(B.type){case\"Points\":X.mode=0;break;case\"Line\":X.mode=1;break;default:X.mode=4}X.attributes.POSITION={value:new Float32Array(B.vertices),size:3},B.normals.length>0&&(X.attributes.NORMAL={value:new Float32Array(B.normals),size:3}),B.colors.length>0&&(X.attributes.COLOR_0={value:new Float32Array(B.colors),size:3}),B.uvs.length>0&&(X.attributes.TEXCOORD_0={value:new Float32Array(B.uvs),size:2}),X.materials=[];var Y=!0,J=!1,q=void 0;try{for(var H,K=D.materials[Symbol.iterator]();!(Y=(H=K.next()).done);Y=!0){var Q=H.value,W={name:Q.name,flatShading:!Q.smooth};X.materials.push(W),C.push(W)}}catch(t){J=!0,q=t}finally{try{Y||null==K.return||K.return()}finally{if(J)throw q}}X.name=D.name,T.push(X)}}}catch(t){z=!0,G=t}finally{try{M||null==U.return||U.return()}finally{if(z)throw G}}return{meshes:T,materials:C}};function p(t,e){var r,n,o,i=new Float32Array(3*e),a=0,s=!0,u=!1,l=void 0;try{for(var c,h=t[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var f=c.value.attributes,v=f.POSITION,p=f.NORMAL,y=f.COLOR_0,d=f.TEXCOORD_0;i.set(v.value,3*a),p&&(r=r||new Float32Array(3*e)).set(p.value,3*a),y&&(n=n||new Float32Array(3*e)).set(y.value,3*a),d&&(o=o||new Float32Array(2*e)).set(d.value,2*a),a+=v.value.length/3}}catch(t){u=!0,l=t}finally{try{s||null==h.return||h.return()}finally{if(u)throw l}}var m={};return m.POSITION={value:i,size:3},r&&(m.NORMAL={value:r,size:3}),n&&(m.COLOR_0={value:n,size:3}),o&&(m.TEXCOORD_0={value:o,size:2}),m}var y={name:\"OBJ\",extensions:[\"obj\"],testText:function(t){return\"v\"===t[0]},parseTextSync:function(t){var e=v(t).meshes,r=e.reduce(function(t,e){return t+e.header.vertexCount},0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:p(e,r)}}},d=r(0),m=r.n(d),g=r(3),b=r.n(g),x=r(4),w=r.n(x);function j(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(t instanceof ArrayBuffer)n.add(t);else if(t.buffer&&t.buffer instanceof ArrayBuffer)n.add(t.buffer);else if(e&&\"object\"===w()(t))for(var o in t)j(t[o],e,n)}else;return void 0===r?Array.from(n):null}function L(t,e,r,n,o){return O.apply(this,arguments)}function O(){return(O=b()(m.a.mark(function t(e,r,n,o,i){var a,s,u;return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.parseSync&&!e.parse){t.next=5;break}a=r,s=e.parseSync||e.parse,t.next=12;break;case 5:if(!e.parseTextSync){t.next=11;break}u=new TextDecoder,a=u.decode(r),s=e.parseTextSync,t.next=12;break;case 11:throw new Error(\"Could not load data with \".concat(e.name,\" loader\"));case 12:return t.next=14,s(a,i);case 14:return t.abrupt(\"return\",t.sent);case 15:case\"end\":return t.stop()}},t)}))).apply(this,arguments)}function S(t,e){return t&&\"process\"===t.type&&\"loaders.gl\"===t.source}!function(t){if(\"undefined\"!=typeof self){self.onmessage=function(){var e=b()(m.a.mark(function e(r){var n,o,i,a,s,u,l,c,h,f;return m.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.data,e.prev=1,S(n,t.name)){e.next=4;break}return e.abrupt(\"return\");case 4:return o=n.arraybuffer,i=n.byteOffset,a=void 0===i?0:i,s=n.byteLength,u=void 0===s?0:s,l=n.options,c=void 0===l?{}:l,e.next=7,L(t,o,a,u,c);case 7:h=e.sent,f=j(h),self.postMessage({type:\"done\",result:h},f),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),self.postMessage({type:\"error\",message:e.t0.message});case 15:case\"end\":return e.stop()}},e,null,[[1,12]])}));return function(t){return e.apply(this,arguments)}}();var e=0;self.parse=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(o,i){var a=e++;self.addEventListener(\"message\",function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case\"process-done\":self.removeEventListener(\"message\",t),o(r.result);break;case\"process-error\":self.removeEventListener(\"message\",t),i(r.message)}}),self.postMessage({type:\"process\",id:a,arraybuffer:t,options:r,url:n},[t])})}}}(y)}]);"; | ||
var worker = "!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,\"a\",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p=\"\",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,u,\"next\",t)}function u(t){r(a,o,i,s,u,\"throw\",t)}s(void 0)})}}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){function r(t){return(r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function n(e){return\"function\"==typeof Symbol&&\"symbol\"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":r(t)},n(e)}t.exports=n},function(t,e,r){var n=function(t){\"use strict\";var e,r=Object.prototype,n=r.hasOwnProperty,o=\"function\"==typeof Symbol?Symbol:{},i=o.iterator||\"@@iterator\",a=o.asyncIterator||\"@@asyncIterator\",s=o.toStringTag||\"@@toStringTag\";function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=c;return function(o,i){if(n===f)throw new Error(\"Generator is already running\");if(n===p){if(\"throw\"===o)throw i;return F()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===v)continue;return s}}if(\"next\"===r.method)r.sent=r._sent=r.arg;else if(\"throw\"===r.method){if(n===c)throw n=p,r.arg;r.dispatchException(r.arg)}else\"return\"===r.method&&r.abrupt(\"return\",r.arg);n=f;var u=l(t,e,r);if(\"normal\"===u.type){if(n=r.done?p:h,u.arg===v)continue;return{value:u.arg,done:r.done}}\"throw\"===u.type&&(n=p,r.method=\"throw\",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}t.wrap=u;var c=\"suspendedStart\",h=\"suspendedYield\",f=\"executing\",p=\"completed\",v={};function y(){}function d(){}function m(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(_([])));x&&x!==r&&n.call(x,i)&&(g=x);var w=m.prototype=y.prototype=Object.create(g);function j(t){[\"next\",\"throw\",\"return\"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(r,o){function i(){return new Promise(function(e,i){!function e(r,o,i,a){var s=l(t[r],t,o);if(\"throw\"!==s.type){var u=s.arg,c=u.value;return c&&\"object\"==typeof c&&n.call(c,\"__await\")?Promise.resolve(c.__await).then(function(t){e(\"next\",t,i,a)},function(t){e(\"throw\",t,i,a)}):Promise.resolve(c).then(function(t){u.value=t,i(u)},function(t){return e(\"throw\",t,i,a)})}a(s.arg)}(r,o,e,i)})}return e=e?e.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,\"throw\"===r.method){if(t.iterator.return&&(r.method=\"return\",r.arg=e,O(t,r),\"throw\"===r.method))return v;r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a 'throw' method\")}return v}var o=l(n,t.iterator,r.arg);if(\"throw\"===o.type)return r.method=\"throw\",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=e),r.delegate=null,v):i:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(k,this),this.reset(!0)}function _(t){if(t){var r=t[i];if(r)return r.call(t);if(\"function\"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:F}}function F(){return{value:e,done:!0}}return d.prototype=w.constructor=m,m.constructor=d,m[s]=d.displayName=\"GeneratorFunction\",t.isGeneratorFunction=function(t){var e=\"function\"==typeof t&&t.constructor;return!!e&&(e===d||\"GeneratorFunction\"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s in t||(t[s]=\"GeneratorFunction\")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},j(L.prototype),L.prototype[a]=function(){return this},t.AsyncIterator=L,t.async=function(e,r,n,o){var i=new L(u(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(w),w[s]=\"Generator\",w[i]=function(){return this},w.toString=function(){return\"[object Generator]\"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method=\"next\",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)\"t\"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(\"throw\"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type=\"throw\",s.arg=t,r.next=n,o&&(r.method=\"next\",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),l=n.call(a,\"finallyLoc\");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error(\"try statement without catch or finally\");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev<o.finallyLoc){var i=o;break}}i&&(\"break\"===t||\"continue\"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method=\"next\",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if(\"throw\"===t.type)throw t.arg;return\"break\"===t.type||\"continue\"===t.type?this.next=t.arg:\"return\"===t.type?(this.rval=this.arg=t.arg,this.method=\"return\",this.next=\"end\"):\"normal\"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;S(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:_(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function(\"r\",\"regeneratorRuntime = r\")(n)}},function(t,e,r){\"use strict\";r.r(e);var n=r(0),o=r.n(n),i=r(1),a=r.n(i),s=r(2),u=r.n(s),l=r(3),c=r.n(l),h=/^[og]\\s*(.+)?/,f=/^mtllib /,p=/^usemtl /,v=function(){function t(e){var r=e.index,n=e.name,o=void 0===n?\"\":n,i=e.mtllib,a=e.smooth,s=e.groupStart;u()(this,t),this.index=r,this.name=o,this.mtllib=i,this.smooth=a,this.groupStart=s,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return c()(t,[{key:\"clone\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new t({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),t}(),y=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";u()(this,t),this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}return c()(t,[{key:\"startMaterial\",value:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var n=new v({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:\"\",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}},{key:\"currentMaterial\",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:\"_finalize\",value:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return t&&0===this.materials.length&&this.materials.push({name:\"\",smooth:this.smooth}),e}}]),t}(),d=function(){function t(){u()(this,t),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject(\"\",!1)}return c()(t,[{key:\"startObject\",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);var r=this.object&&\"function\"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&\"function\"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new y(t),this.object.fromDeclaration=e,r&&r.name&&\"function\"==typeof r.clone){var n=r.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)}},{key:\"finalize\",value:function(){this.object&&\"function\"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:\"parseVertexIndex\",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:\"parseNormalIndex\",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:\"parseUVIndex\",value:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}},{key:\"addVertex\",value:function(t,e,r){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addVertexPoint\",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:\"addVertexLine\",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:\"addNormal\",value:function(t,e,r){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addColor\",value:function(t,e,r){var n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addUV\",value:function(t,e,r){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}},{key:\"addUVLine\",value:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}},{key:\"addFace\",value:function(t,e,r,n,o,i,a,s,u){var l=this.vertices.length,c=this.parseVertexIndex(t,l),h=this.parseVertexIndex(e,l),f=this.parseVertexIndex(r,l);if(this.addVertex(c,h,f),void 0!==n&&\"\"!==n){var p=this.uvs.length;c=this.parseUVIndex(n,p),h=this.parseUVIndex(o,p),f=this.parseUVIndex(i,p),this.addUV(c,h,f)}if(void 0!==a&&\"\"!==a){var v=this.normals.length;c=this.parseNormalIndex(a,v),h=a===s?c:this.parseNormalIndex(s,v),f=a===u?c:this.parseNormalIndex(u,v),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}},{key:\"addPointGeometry\",value:function(t){this.object.geometry.type=\"Points\";var e=this.vertices.length,r=!0,n=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var s=i.value;this.addVertexPoint(this.parseVertexIndex(s,e))}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}}},{key:\"addLineGeometry\",value:function(t,e){this.object.geometry.type=\"Line\";var r=this.vertices.length,n=this.uvs.length,o=!0,i=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value;this.addVertexLine(this.parseVertexIndex(l,r))}}catch(t){i=!0,a=t}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}var c=!0,h=!1,f=void 0;try{for(var p,v=e[Symbol.iterator]();!(c=(p=v.next()).done);c=!0){var y=p.value;this.addUVLine(this.parseUVIndex(y,n))}}catch(t){h=!0,f=t}finally{try{c||null==v.return||v.return()}finally{if(h)throw f}}}}]),t}(),m=function(t){var e=new d;-1!==t.indexOf(\"\\r\\n\")&&(t=t.replace(/\\r\\n/g,\"\\n\")),-1!==t.indexOf(\"\\\\\\n\")&&(t=t.replace(/\\\\\\n/g,\"\"));for(var r=t.split(\"\\n\"),n=\"\",o=\"\",i=[],a=\"function\"==typeof\"\".trimLeft,s=0,u=r.length;s<u;s++)if(n=r[s],0!==(n=a?n.trimLeft():n.trim()).length&&\"#\"!==(o=n.charAt(0)))if(\"v\"===o){var l=n.split(/\\s+/);switch(l[0]){case\"v\":e.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),8===l.length&&e.colors.push(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6]));break;case\"vn\":e.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case\"vt\":e.uvs.push(parseFloat(l[1]),parseFloat(l[2]))}}else if(\"f\"===o){for(var c=n.substr(1).trim().split(/\\s+/),v=[],y=0,m=c.length;y<m;y++){var g=c[y];if(g.length>0){var b=g.split(\"/\");v.push(b)}}for(var x=v[0],w=1,j=v.length-1;w<j;w++){var L=v[w],O=v[w+1];e.addFace(x[0],L[0],O[0],x[1],L[1],O[1],x[2],L[2],O[2])}}else if(\"l\"===o){var k=n.substring(1).trim().split(\" \"),S=void 0,E=[];if(-1===n.indexOf(\"/\"))S=k;else{S=[];for(var _=0,F=k.length;_<F;_++){var I=k[_].split(\"/\");\"\"!==I[0]&&S.push(I[0]),\"\"!==I[1]&&E.push(I[1])}}e.addLineGeometry(S,E)}else if(\"p\"===o){var P=n.substr(1).trim().split(\" \");e.addPointGeometry(P)}else if(null!==(i=h.exec(n))){var T=(\" \"+i[0].substr(1).trim()).substr(1);e.startObject(T)}else if(p.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(f.test(n))e.materialLibraries.push(n.substring(7).trim());else{if(\"s\"!==o){if(\"\\0\"===n)continue;throw new Error('Unexpected line: \"'.concat(n,'\"'))}if((i=n.split(\" \")).length>1){var V=i[1].trim().toLowerCase();e.object.smooth=\"0\"!==V&&\"off\"!==V}else e.object.smooth=!0;var N=e.object.currentMaterial();N&&(N.smooth=e.object.smooth)}e.finalize();var A=[],C=[],M=!0,z=!1,G=void 0;try{for(var R,U=e.objects[Symbol.iterator]();!(M=(R=U.next()).done);M=!0){var D=R.value,B=D.geometry;if(0!==B.vertices.length){var X={header:{vertexCount:B.vertices.length/3},attributes:{}};switch(B.type){case\"Points\":X.mode=0;break;case\"Line\":X.mode=1;break;default:X.mode=4}X.attributes.POSITION={value:new Float32Array(B.vertices),size:3},B.normals.length>0&&(X.attributes.NORMAL={value:new Float32Array(B.normals),size:3}),B.colors.length>0&&(X.attributes.COLOR_0={value:new Float32Array(B.colors),size:3}),B.uvs.length>0&&(X.attributes.TEXCOORD_0={value:new Float32Array(B.uvs),size:2}),X.materials=[];var Y=!0,J=!1,q=void 0;try{for(var H,K=D.materials[Symbol.iterator]();!(Y=(H=K.next()).done);Y=!0){var Q=H.value,W={name:Q.name,flatShading:!Q.smooth};X.materials.push(W),C.push(W)}}catch(t){J=!0,q=t}finally{try{Y||null==K.return||K.return()}finally{if(J)throw q}}X.name=D.name,A.push(X)}}}catch(t){z=!0,G=t}finally{try{M||null==U.return||U.return()}finally{if(z)throw G}}return{meshes:A,materials:C}};function g(t){var e=m(t).meshes,r=e.reduce(function(t,e){return t+e.header.vertexCount},0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:b(e,r)}}function b(t,e){var r,n,o,i=new Float32Array(3*e),a=0,s=!0,u=!1,l=void 0;try{for(var c,h=t[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var f=c.value.attributes,p=f.POSITION,v=f.NORMAL,y=f.COLOR_0,d=f.TEXCOORD_0;i.set(p.value,3*a),v&&(r=r||new Float32Array(3*e)).set(v.value,3*a),y&&(n=n||new Float32Array(3*e)).set(y.value,3*a),d&&(o=o||new Float32Array(2*e)).set(d.value,2*a),a+=p.value.length/3}}catch(t){u=!0,l=t}finally{try{s||null==h.return||h.return()}finally{if(u)throw l}}var m={};return m.POSITION={value:i,size:3},r&&(m.NORMAL={value:r,size:3}),n&&(m.COLOR_0={value:n,size:3}),o&&(m.TEXCOORD_0={value:o,size:2}),m}var x,w={name:\"OBJ\",extensions:[\"obj\"],mimeType:\"text/plain\",parse:(x=a()(o.a.mark(function t(e,r){return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt(\"return\",g((new TextDecoder).decode(e)));case 1:case\"end\":return t.stop()}},t)})),function(t,e){return x.apply(this,arguments)}),parseTextSync:g,testText:function(t){return\"v\"===t[0]}};var j=r(4),L=r.n(j);function O(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(t instanceof ArrayBuffer)n.add(t);else if(t.buffer&&t.buffer instanceof ArrayBuffer)n.add(t.buffer);else if(e&&\"object\"===L()(t))for(var o in t)O(t[o],e,n)}else;return void 0===r?Array.from(n):null}function k(t,e,r,n,o){return S.apply(this,arguments)}function S(){return(S=a()(o.a.mark(function t(e,r,n,i,a){var s,u,l;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.parseSync&&!e.parse){t.next=5;break}s=r,u=e.parseSync||e.parse,t.next=12;break;case 5:if(!e.parseTextSync){t.next=11;break}l=new TextDecoder,s=l.decode(r),u=e.parseTextSync,t.next=12;break;case 11:throw new Error(\"Could not load data with \".concat(e.name,\" loader\"));case 12:return t.next=14,u(s,a);case 14:return t.abrupt(\"return\",t.sent);case 15:case\"end\":return t.stop()}},t)}))).apply(this,arguments)}function E(t,e){return t&&\"process\"===t.type&&\"loaders.gl\"===t.source}!function(t){if(\"undefined\"!=typeof self){self.onmessage=function(){var e=a()(o.a.mark(function e(r){var n,i,a,s,u,l,c,h,f,p;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.data,e.prev=1,E(n,t.name)){e.next=4;break}return e.abrupt(\"return\");case 4:return i=n.arraybuffer,a=n.byteOffset,s=void 0===a?0:a,u=n.byteLength,l=void 0===u?0:u,c=n.options,h=void 0===c?{}:c,e.next=7,k(t,i,s,l,h);case 7:f=e.sent,p=O(f),self.postMessage({type:\"done\",result:f},p),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),self.postMessage({type:\"error\",message:e.t0.message});case 15:case\"end\":return e.stop()}},e,null,[[1,12]])}));return function(t){return e.apply(this,arguments)}}();var e=0;self.parse=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(o,i){var a=e++;self.addEventListener(\"message\",function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case\"process-done\":self.removeEventListener(\"message\",t),o(r.result);break;case\"process-error\":self.removeEventListener(\"message\",t),i(r.message)}}),self.postMessage({type:\"process\",id:a,arraybuffer:t,options:r,url:n},[t])})}}}(w)}]);"; | ||
var _default = { | ||
@@ -10,0 +10,0 @@ name: 'OBJ', |
@@ -1,2 +0,10 @@ | ||
import loadOBJ from './load-obj'; | ||
import loadOBJ from './lib/load-obj'; | ||
export default { | ||
name: 'OBJ', | ||
extensions: ['obj'], | ||
mimeType: 'text/plain', | ||
parse: async (arrayBuffer, options) => loadOBJ(new TextDecoder().decode(arrayBuffer), options), | ||
parseTextSync: loadOBJ, | ||
testText: testOBJFile | ||
}; | ||
@@ -6,9 +14,2 @@ function testOBJFile(text) { | ||
} | ||
export default { | ||
name: 'OBJ', | ||
extensions: ['obj'], | ||
testText: testOBJFile, | ||
parseTextSync: loadOBJ | ||
}; | ||
//# sourceMappingURL=obj-loader.js.map |
@@ -1,2 +0,2 @@ | ||
const worker = "!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,\"a\",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p=\"\",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,u,\"next\",t)}function u(t){r(a,o,i,s,u,\"throw\",t)}s(void 0)})}}},function(t,e){function r(t){return(r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function n(e){return\"function\"==typeof Symbol&&\"symbol\"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":r(t)},n(e)}t.exports=n},function(t,e,r){var n=function(t){\"use strict\";var e,r=Object.prototype,n=r.hasOwnProperty,o=\"function\"==typeof Symbol?Symbol:{},i=o.iterator||\"@@iterator\",a=o.asyncIterator||\"@@asyncIterator\",s=o.toStringTag||\"@@toStringTag\";function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=c;return function(o,i){if(n===f)throw new Error(\"Generator is already running\");if(n===v){if(\"throw\"===o)throw i;return F()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===p)continue;return s}}if(\"next\"===r.method)r.sent=r._sent=r.arg;else if(\"throw\"===r.method){if(n===c)throw n=v,r.arg;r.dispatchException(r.arg)}else\"return\"===r.method&&r.abrupt(\"return\",r.arg);n=f;var u=l(t,e,r);if(\"normal\"===u.type){if(n=r.done?v:h,u.arg===p)continue;return{value:u.arg,done:r.done}}\"throw\"===u.type&&(n=v,r.method=\"throw\",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}t.wrap=u;var c=\"suspendedStart\",h=\"suspendedYield\",f=\"executing\",v=\"completed\",p={};function y(){}function d(){}function m(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(_([])));x&&x!==r&&n.call(x,i)&&(g=x);var w=m.prototype=y.prototype=Object.create(g);function j(t){[\"next\",\"throw\",\"return\"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(r,o){function i(){return new Promise(function(e,i){!function e(r,o,i,a){var s=l(t[r],t,o);if(\"throw\"!==s.type){var u=s.arg,c=u.value;return c&&\"object\"==typeof c&&n.call(c,\"__await\")?Promise.resolve(c.__await).then(function(t){e(\"next\",t,i,a)},function(t){e(\"throw\",t,i,a)}):Promise.resolve(c).then(function(t){u.value=t,i(u)},function(t){return e(\"throw\",t,i,a)})}a(s.arg)}(r,o,e,i)})}return e=e?e.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,\"throw\"===r.method){if(t.iterator.return&&(r.method=\"return\",r.arg=e,O(t,r),\"throw\"===r.method))return p;r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a 'throw' method\")}return p}var o=l(n,t.iterator,r.arg);if(\"throw\"===o.type)return r.method=\"throw\",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=e),r.delegate=null,p):i:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,p)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(S,this),this.reset(!0)}function _(t){if(t){var r=t[i];if(r)return r.call(t);if(\"function\"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:F}}function F(){return{value:e,done:!0}}return d.prototype=w.constructor=m,m.constructor=d,m[s]=d.displayName=\"GeneratorFunction\",t.isGeneratorFunction=function(t){var e=\"function\"==typeof t&&t.constructor;return!!e&&(e===d||\"GeneratorFunction\"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s in t||(t[s]=\"GeneratorFunction\")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},j(L.prototype),L.prototype[a]=function(){return this},t.AsyncIterator=L,t.async=function(e,r,n,o){var i=new L(u(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(w),w[s]=\"Generator\",w[i]=function(){return this},w.toString=function(){return\"[object Generator]\"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method=\"next\",this.arg=e,this.tryEntries.forEach(k),!t)for(var r in this)\"t\"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(\"throw\"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type=\"throw\",s.arg=t,r.next=n,o&&(r.method=\"next\",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),l=n.call(a,\"finallyLoc\");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error(\"try statement without catch or finally\");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev<o.finallyLoc){var i=o;break}}i&&(\"break\"===t||\"continue\"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method=\"next\",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if(\"throw\"===t.type)throw t.arg;return\"break\"===t.type||\"continue\"===t.type?this.next=t.arg:\"return\"===t.type?(this.rval=this.arg=t.arg,this.method=\"return\",this.next=\"end\"):\"normal\"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;k(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:_(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function(\"r\",\"regeneratorRuntime = r\")(n)}},function(t,e,r){\"use strict\";r.r(e);var n=r(1),o=r.n(n),i=r(2),a=r.n(i),s=/^[og]\\s*(.+)?/,u=/^mtllib /,l=/^usemtl /,c=function(){function t(e){var r=e.index,n=e.name,i=void 0===n?\"\":n,a=e.mtllib,s=e.smooth,u=e.groupStart;o()(this,t),this.index=r,this.name=i,this.mtllib=a,this.smooth=s,this.groupStart=u,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return a()(t,[{key:\"clone\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new t({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),t}(),h=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";o()(this,t),this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}return a()(t,[{key:\"startMaterial\",value:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var n=new c({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:\"\",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}},{key:\"currentMaterial\",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:\"_finalize\",value:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return t&&0===this.materials.length&&this.materials.push({name:\"\",smooth:this.smooth}),e}}]),t}(),f=function(){function t(){o()(this,t),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject(\"\",!1)}return a()(t,[{key:\"startObject\",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);var r=this.object&&\"function\"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&\"function\"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new h(t),this.object.fromDeclaration=e,r&&r.name&&\"function\"==typeof r.clone){var n=r.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)}},{key:\"finalize\",value:function(){this.object&&\"function\"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:\"parseVertexIndex\",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:\"parseNormalIndex\",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:\"parseUVIndex\",value:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}},{key:\"addVertex\",value:function(t,e,r){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addVertexPoint\",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:\"addVertexLine\",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:\"addNormal\",value:function(t,e,r){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addColor\",value:function(t,e,r){var n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addUV\",value:function(t,e,r){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}},{key:\"addUVLine\",value:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}},{key:\"addFace\",value:function(t,e,r,n,o,i,a,s,u){var l=this.vertices.length,c=this.parseVertexIndex(t,l),h=this.parseVertexIndex(e,l),f=this.parseVertexIndex(r,l);if(this.addVertex(c,h,f),void 0!==n&&\"\"!==n){var v=this.uvs.length;c=this.parseUVIndex(n,v),h=this.parseUVIndex(o,v),f=this.parseUVIndex(i,v),this.addUV(c,h,f)}if(void 0!==a&&\"\"!==a){var p=this.normals.length;c=this.parseNormalIndex(a,p),h=a===s?c:this.parseNormalIndex(s,p),f=a===u?c:this.parseNormalIndex(u,p),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}},{key:\"addPointGeometry\",value:function(t){this.object.geometry.type=\"Points\";var e=this.vertices.length,r=!0,n=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var s=i.value;this.addVertexPoint(this.parseVertexIndex(s,e))}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}}},{key:\"addLineGeometry\",value:function(t,e){this.object.geometry.type=\"Line\";var r=this.vertices.length,n=this.uvs.length,o=!0,i=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value;this.addVertexLine(this.parseVertexIndex(l,r))}}catch(t){i=!0,a=t}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}var c=!0,h=!1,f=void 0;try{for(var v,p=e[Symbol.iterator]();!(c=(v=p.next()).done);c=!0){var y=v.value;this.addUVLine(this.parseUVIndex(y,n))}}catch(t){h=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(h)throw f}}}}]),t}(),v=function(t){var e=new f;-1!==t.indexOf(\"\\r\\n\")&&(t=t.replace(/\\r\\n/g,\"\\n\")),-1!==t.indexOf(\"\\\\\\n\")&&(t=t.replace(/\\\\\\n/g,\"\"));for(var r=t.split(\"\\n\"),n=\"\",o=\"\",i=[],a=\"function\"==typeof\"\".trimLeft,c=0,h=r.length;c<h;c++)if(n=r[c],0!==(n=a?n.trimLeft():n.trim()).length&&\"#\"!==(o=n.charAt(0)))if(\"v\"===o){var v=n.split(/\\s+/);switch(v[0]){case\"v\":e.vertices.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3])),8===v.length&&e.colors.push(parseFloat(v[4]),parseFloat(v[5]),parseFloat(v[6]));break;case\"vn\":e.normals.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3]));break;case\"vt\":e.uvs.push(parseFloat(v[1]),parseFloat(v[2]))}}else if(\"f\"===o){for(var p=n.substr(1).trim().split(/\\s+/),y=[],d=0,m=p.length;d<m;d++){var g=p[d];if(g.length>0){var b=g.split(\"/\");y.push(b)}}for(var x=y[0],w=1,j=y.length-1;w<j;w++){var L=y[w],O=y[w+1];e.addFace(x[0],L[0],O[0],x[1],L[1],O[1],x[2],L[2],O[2])}}else if(\"l\"===o){var S=n.substring(1).trim().split(\" \"),k=void 0,E=[];if(-1===n.indexOf(\"/\"))k=S;else{k=[];for(var _=0,F=S.length;_<F;_++){var I=S[_].split(\"/\");\"\"!==I[0]&&k.push(I[0]),\"\"!==I[1]&&E.push(I[1])}}e.addLineGeometry(k,E)}else if(\"p\"===o){var P=n.substr(1).trim().split(\" \");e.addPointGeometry(P)}else if(null!==(i=s.exec(n))){var V=(\" \"+i[0].substr(1).trim()).substr(1);e.startObject(V)}else if(l.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(u.test(n))e.materialLibraries.push(n.substring(7).trim());else{if(\"s\"!==o){if(\"\\0\"===n)continue;throw new Error('Unexpected line: \"'.concat(n,'\"'))}if((i=n.split(\" \")).length>1){var N=i[1].trim().toLowerCase();e.object.smooth=\"0\"!==N&&\"off\"!==N}else e.object.smooth=!0;var A=e.object.currentMaterial();A&&(A.smooth=e.object.smooth)}e.finalize();var T=[],C=[],M=!0,z=!1,G=void 0;try{for(var R,U=e.objects[Symbol.iterator]();!(M=(R=U.next()).done);M=!0){var D=R.value,B=D.geometry;if(0!==B.vertices.length){var X={header:{vertexCount:B.vertices.length/3},attributes:{}};switch(B.type){case\"Points\":X.mode=0;break;case\"Line\":X.mode=1;break;default:X.mode=4}X.attributes.POSITION={value:new Float32Array(B.vertices),size:3},B.normals.length>0&&(X.attributes.NORMAL={value:new Float32Array(B.normals),size:3}),B.colors.length>0&&(X.attributes.COLOR_0={value:new Float32Array(B.colors),size:3}),B.uvs.length>0&&(X.attributes.TEXCOORD_0={value:new Float32Array(B.uvs),size:2}),X.materials=[];var Y=!0,J=!1,q=void 0;try{for(var H,K=D.materials[Symbol.iterator]();!(Y=(H=K.next()).done);Y=!0){var Q=H.value,W={name:Q.name,flatShading:!Q.smooth};X.materials.push(W),C.push(W)}}catch(t){J=!0,q=t}finally{try{Y||null==K.return||K.return()}finally{if(J)throw q}}X.name=D.name,T.push(X)}}}catch(t){z=!0,G=t}finally{try{M||null==U.return||U.return()}finally{if(z)throw G}}return{meshes:T,materials:C}};function p(t,e){var r,n,o,i=new Float32Array(3*e),a=0,s=!0,u=!1,l=void 0;try{for(var c,h=t[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var f=c.value.attributes,v=f.POSITION,p=f.NORMAL,y=f.COLOR_0,d=f.TEXCOORD_0;i.set(v.value,3*a),p&&(r=r||new Float32Array(3*e)).set(p.value,3*a),y&&(n=n||new Float32Array(3*e)).set(y.value,3*a),d&&(o=o||new Float32Array(2*e)).set(d.value,2*a),a+=v.value.length/3}}catch(t){u=!0,l=t}finally{try{s||null==h.return||h.return()}finally{if(u)throw l}}var m={};return m.POSITION={value:i,size:3},r&&(m.NORMAL={value:r,size:3}),n&&(m.COLOR_0={value:n,size:3}),o&&(m.TEXCOORD_0={value:o,size:2}),m}var y={name:\"OBJ\",extensions:[\"obj\"],testText:function(t){return\"v\"===t[0]},parseTextSync:function(t){var e=v(t).meshes,r=e.reduce(function(t,e){return t+e.header.vertexCount},0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:p(e,r)}}},d=r(0),m=r.n(d),g=r(3),b=r.n(g),x=r(4),w=r.n(x);function j(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(t instanceof ArrayBuffer)n.add(t);else if(t.buffer&&t.buffer instanceof ArrayBuffer)n.add(t.buffer);else if(e&&\"object\"===w()(t))for(var o in t)j(t[o],e,n)}else;return void 0===r?Array.from(n):null}function L(t,e,r,n,o){return O.apply(this,arguments)}function O(){return(O=b()(m.a.mark(function t(e,r,n,o,i){var a,s,u;return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.parseSync&&!e.parse){t.next=5;break}a=r,s=e.parseSync||e.parse,t.next=12;break;case 5:if(!e.parseTextSync){t.next=11;break}u=new TextDecoder,a=u.decode(r),s=e.parseTextSync,t.next=12;break;case 11:throw new Error(\"Could not load data with \".concat(e.name,\" loader\"));case 12:return t.next=14,s(a,i);case 14:return t.abrupt(\"return\",t.sent);case 15:case\"end\":return t.stop()}},t)}))).apply(this,arguments)}function S(t,e){return t&&\"process\"===t.type&&\"loaders.gl\"===t.source}!function(t){if(\"undefined\"!=typeof self){self.onmessage=function(){var e=b()(m.a.mark(function e(r){var n,o,i,a,s,u,l,c,h,f;return m.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.data,e.prev=1,S(n,t.name)){e.next=4;break}return e.abrupt(\"return\");case 4:return o=n.arraybuffer,i=n.byteOffset,a=void 0===i?0:i,s=n.byteLength,u=void 0===s?0:s,l=n.options,c=void 0===l?{}:l,e.next=7,L(t,o,a,u,c);case 7:h=e.sent,f=j(h),self.postMessage({type:\"done\",result:h},f),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),self.postMessage({type:\"error\",message:e.t0.message});case 15:case\"end\":return e.stop()}},e,null,[[1,12]])}));return function(t){return e.apply(this,arguments)}}();var e=0;self.parse=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(o,i){var a=e++;self.addEventListener(\"message\",function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case\"process-done\":self.removeEventListener(\"message\",t),o(r.result);break;case\"process-error\":self.removeEventListener(\"message\",t),i(r.message)}}),self.postMessage({type:\"process\",id:a,arraybuffer:t,options:r,url:n},[t])})}}}(y)}]);"; | ||
const worker = "!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,\"a\",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p=\"\",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,u,\"next\",t)}function u(t){r(a,o,i,s,u,\"throw\",t)}s(void 0)})}}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){function r(t){return(r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function n(e){return\"function\"==typeof Symbol&&\"symbol\"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":r(t)},n(e)}t.exports=n},function(t,e,r){var n=function(t){\"use strict\";var e,r=Object.prototype,n=r.hasOwnProperty,o=\"function\"==typeof Symbol?Symbol:{},i=o.iterator||\"@@iterator\",a=o.asyncIterator||\"@@asyncIterator\",s=o.toStringTag||\"@@toStringTag\";function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=c;return function(o,i){if(n===f)throw new Error(\"Generator is already running\");if(n===p){if(\"throw\"===o)throw i;return F()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===v)continue;return s}}if(\"next\"===r.method)r.sent=r._sent=r.arg;else if(\"throw\"===r.method){if(n===c)throw n=p,r.arg;r.dispatchException(r.arg)}else\"return\"===r.method&&r.abrupt(\"return\",r.arg);n=f;var u=l(t,e,r);if(\"normal\"===u.type){if(n=r.done?p:h,u.arg===v)continue;return{value:u.arg,done:r.done}}\"throw\"===u.type&&(n=p,r.method=\"throw\",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}t.wrap=u;var c=\"suspendedStart\",h=\"suspendedYield\",f=\"executing\",p=\"completed\",v={};function y(){}function d(){}function m(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(_([])));x&&x!==r&&n.call(x,i)&&(g=x);var w=m.prototype=y.prototype=Object.create(g);function j(t){[\"next\",\"throw\",\"return\"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(r,o){function i(){return new Promise(function(e,i){!function e(r,o,i,a){var s=l(t[r],t,o);if(\"throw\"!==s.type){var u=s.arg,c=u.value;return c&&\"object\"==typeof c&&n.call(c,\"__await\")?Promise.resolve(c.__await).then(function(t){e(\"next\",t,i,a)},function(t){e(\"throw\",t,i,a)}):Promise.resolve(c).then(function(t){u.value=t,i(u)},function(t){return e(\"throw\",t,i,a)})}a(s.arg)}(r,o,e,i)})}return e=e?e.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,\"throw\"===r.method){if(t.iterator.return&&(r.method=\"return\",r.arg=e,O(t,r),\"throw\"===r.method))return v;r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a 'throw' method\")}return v}var o=l(n,t.iterator,r.arg);if(\"throw\"===o.type)return r.method=\"throw\",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=e),r.delegate=null,v):i:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(k,this),this.reset(!0)}function _(t){if(t){var r=t[i];if(r)return r.call(t);if(\"function\"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:F}}function F(){return{value:e,done:!0}}return d.prototype=w.constructor=m,m.constructor=d,m[s]=d.displayName=\"GeneratorFunction\",t.isGeneratorFunction=function(t){var e=\"function\"==typeof t&&t.constructor;return!!e&&(e===d||\"GeneratorFunction\"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s in t||(t[s]=\"GeneratorFunction\")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},j(L.prototype),L.prototype[a]=function(){return this},t.AsyncIterator=L,t.async=function(e,r,n,o){var i=new L(u(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(w),w[s]=\"Generator\",w[i]=function(){return this},w.toString=function(){return\"[object Generator]\"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method=\"next\",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)\"t\"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(\"throw\"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type=\"throw\",s.arg=t,r.next=n,o&&(r.method=\"next\",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),l=n.call(a,\"finallyLoc\");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error(\"try statement without catch or finally\");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev<o.finallyLoc){var i=o;break}}i&&(\"break\"===t||\"continue\"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method=\"next\",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if(\"throw\"===t.type)throw t.arg;return\"break\"===t.type||\"continue\"===t.type?this.next=t.arg:\"return\"===t.type?(this.rval=this.arg=t.arg,this.method=\"return\",this.next=\"end\"):\"normal\"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;S(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:_(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function(\"r\",\"regeneratorRuntime = r\")(n)}},function(t,e,r){\"use strict\";r.r(e);var n=r(0),o=r.n(n),i=r(1),a=r.n(i),s=r(2),u=r.n(s),l=r(3),c=r.n(l),h=/^[og]\\s*(.+)?/,f=/^mtllib /,p=/^usemtl /,v=function(){function t(e){var r=e.index,n=e.name,o=void 0===n?\"\":n,i=e.mtllib,a=e.smooth,s=e.groupStart;u()(this,t),this.index=r,this.name=o,this.mtllib=i,this.smooth=a,this.groupStart=s,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return c()(t,[{key:\"clone\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new t({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),t}(),y=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";u()(this,t),this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}return c()(t,[{key:\"startMaterial\",value:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var n=new v({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:\"\",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}},{key:\"currentMaterial\",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:\"_finalize\",value:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return t&&0===this.materials.length&&this.materials.push({name:\"\",smooth:this.smooth}),e}}]),t}(),d=function(){function t(){u()(this,t),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject(\"\",!1)}return c()(t,[{key:\"startObject\",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);var r=this.object&&\"function\"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&\"function\"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new y(t),this.object.fromDeclaration=e,r&&r.name&&\"function\"==typeof r.clone){var n=r.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)}},{key:\"finalize\",value:function(){this.object&&\"function\"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:\"parseVertexIndex\",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:\"parseNormalIndex\",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:\"parseUVIndex\",value:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}},{key:\"addVertex\",value:function(t,e,r){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addVertexPoint\",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:\"addVertexLine\",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:\"addNormal\",value:function(t,e,r){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addColor\",value:function(t,e,r){var n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addUV\",value:function(t,e,r){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}},{key:\"addUVLine\",value:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}},{key:\"addFace\",value:function(t,e,r,n,o,i,a,s,u){var l=this.vertices.length,c=this.parseVertexIndex(t,l),h=this.parseVertexIndex(e,l),f=this.parseVertexIndex(r,l);if(this.addVertex(c,h,f),void 0!==n&&\"\"!==n){var p=this.uvs.length;c=this.parseUVIndex(n,p),h=this.parseUVIndex(o,p),f=this.parseUVIndex(i,p),this.addUV(c,h,f)}if(void 0!==a&&\"\"!==a){var v=this.normals.length;c=this.parseNormalIndex(a,v),h=a===s?c:this.parseNormalIndex(s,v),f=a===u?c:this.parseNormalIndex(u,v),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}},{key:\"addPointGeometry\",value:function(t){this.object.geometry.type=\"Points\";var e=this.vertices.length,r=!0,n=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var s=i.value;this.addVertexPoint(this.parseVertexIndex(s,e))}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}}},{key:\"addLineGeometry\",value:function(t,e){this.object.geometry.type=\"Line\";var r=this.vertices.length,n=this.uvs.length,o=!0,i=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value;this.addVertexLine(this.parseVertexIndex(l,r))}}catch(t){i=!0,a=t}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}var c=!0,h=!1,f=void 0;try{for(var p,v=e[Symbol.iterator]();!(c=(p=v.next()).done);c=!0){var y=p.value;this.addUVLine(this.parseUVIndex(y,n))}}catch(t){h=!0,f=t}finally{try{c||null==v.return||v.return()}finally{if(h)throw f}}}}]),t}(),m=function(t){var e=new d;-1!==t.indexOf(\"\\r\\n\")&&(t=t.replace(/\\r\\n/g,\"\\n\")),-1!==t.indexOf(\"\\\\\\n\")&&(t=t.replace(/\\\\\\n/g,\"\"));for(var r=t.split(\"\\n\"),n=\"\",o=\"\",i=[],a=\"function\"==typeof\"\".trimLeft,s=0,u=r.length;s<u;s++)if(n=r[s],0!==(n=a?n.trimLeft():n.trim()).length&&\"#\"!==(o=n.charAt(0)))if(\"v\"===o){var l=n.split(/\\s+/);switch(l[0]){case\"v\":e.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),8===l.length&&e.colors.push(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6]));break;case\"vn\":e.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case\"vt\":e.uvs.push(parseFloat(l[1]),parseFloat(l[2]))}}else if(\"f\"===o){for(var c=n.substr(1).trim().split(/\\s+/),v=[],y=0,m=c.length;y<m;y++){var g=c[y];if(g.length>0){var b=g.split(\"/\");v.push(b)}}for(var x=v[0],w=1,j=v.length-1;w<j;w++){var L=v[w],O=v[w+1];e.addFace(x[0],L[0],O[0],x[1],L[1],O[1],x[2],L[2],O[2])}}else if(\"l\"===o){var k=n.substring(1).trim().split(\" \"),S=void 0,E=[];if(-1===n.indexOf(\"/\"))S=k;else{S=[];for(var _=0,F=k.length;_<F;_++){var I=k[_].split(\"/\");\"\"!==I[0]&&S.push(I[0]),\"\"!==I[1]&&E.push(I[1])}}e.addLineGeometry(S,E)}else if(\"p\"===o){var P=n.substr(1).trim().split(\" \");e.addPointGeometry(P)}else if(null!==(i=h.exec(n))){var T=(\" \"+i[0].substr(1).trim()).substr(1);e.startObject(T)}else if(p.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(f.test(n))e.materialLibraries.push(n.substring(7).trim());else{if(\"s\"!==o){if(\"\\0\"===n)continue;throw new Error('Unexpected line: \"'.concat(n,'\"'))}if((i=n.split(\" \")).length>1){var V=i[1].trim().toLowerCase();e.object.smooth=\"0\"!==V&&\"off\"!==V}else e.object.smooth=!0;var N=e.object.currentMaterial();N&&(N.smooth=e.object.smooth)}e.finalize();var A=[],C=[],M=!0,z=!1,G=void 0;try{for(var R,U=e.objects[Symbol.iterator]();!(M=(R=U.next()).done);M=!0){var D=R.value,B=D.geometry;if(0!==B.vertices.length){var X={header:{vertexCount:B.vertices.length/3},attributes:{}};switch(B.type){case\"Points\":X.mode=0;break;case\"Line\":X.mode=1;break;default:X.mode=4}X.attributes.POSITION={value:new Float32Array(B.vertices),size:3},B.normals.length>0&&(X.attributes.NORMAL={value:new Float32Array(B.normals),size:3}),B.colors.length>0&&(X.attributes.COLOR_0={value:new Float32Array(B.colors),size:3}),B.uvs.length>0&&(X.attributes.TEXCOORD_0={value:new Float32Array(B.uvs),size:2}),X.materials=[];var Y=!0,J=!1,q=void 0;try{for(var H,K=D.materials[Symbol.iterator]();!(Y=(H=K.next()).done);Y=!0){var Q=H.value,W={name:Q.name,flatShading:!Q.smooth};X.materials.push(W),C.push(W)}}catch(t){J=!0,q=t}finally{try{Y||null==K.return||K.return()}finally{if(J)throw q}}X.name=D.name,A.push(X)}}}catch(t){z=!0,G=t}finally{try{M||null==U.return||U.return()}finally{if(z)throw G}}return{meshes:A,materials:C}};function g(t){var e=m(t).meshes,r=e.reduce(function(t,e){return t+e.header.vertexCount},0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:b(e,r)}}function b(t,e){var r,n,o,i=new Float32Array(3*e),a=0,s=!0,u=!1,l=void 0;try{for(var c,h=t[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var f=c.value.attributes,p=f.POSITION,v=f.NORMAL,y=f.COLOR_0,d=f.TEXCOORD_0;i.set(p.value,3*a),v&&(r=r||new Float32Array(3*e)).set(v.value,3*a),y&&(n=n||new Float32Array(3*e)).set(y.value,3*a),d&&(o=o||new Float32Array(2*e)).set(d.value,2*a),a+=p.value.length/3}}catch(t){u=!0,l=t}finally{try{s||null==h.return||h.return()}finally{if(u)throw l}}var m={};return m.POSITION={value:i,size:3},r&&(m.NORMAL={value:r,size:3}),n&&(m.COLOR_0={value:n,size:3}),o&&(m.TEXCOORD_0={value:o,size:2}),m}var x,w={name:\"OBJ\",extensions:[\"obj\"],mimeType:\"text/plain\",parse:(x=a()(o.a.mark(function t(e,r){return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt(\"return\",g((new TextDecoder).decode(e)));case 1:case\"end\":return t.stop()}},t)})),function(t,e){return x.apply(this,arguments)}),parseTextSync:g,testText:function(t){return\"v\"===t[0]}};var j=r(4),L=r.n(j);function O(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(t instanceof ArrayBuffer)n.add(t);else if(t.buffer&&t.buffer instanceof ArrayBuffer)n.add(t.buffer);else if(e&&\"object\"===L()(t))for(var o in t)O(t[o],e,n)}else;return void 0===r?Array.from(n):null}function k(t,e,r,n,o){return S.apply(this,arguments)}function S(){return(S=a()(o.a.mark(function t(e,r,n,i,a){var s,u,l;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.parseSync&&!e.parse){t.next=5;break}s=r,u=e.parseSync||e.parse,t.next=12;break;case 5:if(!e.parseTextSync){t.next=11;break}l=new TextDecoder,s=l.decode(r),u=e.parseTextSync,t.next=12;break;case 11:throw new Error(\"Could not load data with \".concat(e.name,\" loader\"));case 12:return t.next=14,u(s,a);case 14:return t.abrupt(\"return\",t.sent);case 15:case\"end\":return t.stop()}},t)}))).apply(this,arguments)}function E(t,e){return t&&\"process\"===t.type&&\"loaders.gl\"===t.source}!function(t){if(\"undefined\"!=typeof self){self.onmessage=function(){var e=a()(o.a.mark(function e(r){var n,i,a,s,u,l,c,h,f,p;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.data,e.prev=1,E(n,t.name)){e.next=4;break}return e.abrupt(\"return\");case 4:return i=n.arraybuffer,a=n.byteOffset,s=void 0===a?0:a,u=n.byteLength,l=void 0===u?0:u,c=n.options,h=void 0===c?{}:c,e.next=7,k(t,i,s,l,h);case 7:f=e.sent,p=O(f),self.postMessage({type:\"done\",result:f},p),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),self.postMessage({type:\"error\",message:e.t0.message});case 15:case\"end\":return e.stop()}},e,null,[[1,12]])}));return function(t){return e.apply(this,arguments)}}();var e=0;self.parse=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(o,i){var a=e++;self.addEventListener(\"message\",function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case\"process-done\":self.removeEventListener(\"message\",t),o(r.result);break;case\"process-error\":self.removeEventListener(\"message\",t),i(r.message)}}),self.postMessage({type:\"process\",id:a,arraybuffer:t,options:r,url:n},[t])})}}}(w)}]);"; | ||
export default { | ||
@@ -3,0 +3,0 @@ name: 'OBJ', |
@@ -1,13 +0,37 @@ | ||
import loadOBJ from './load-obj'; | ||
import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
import loadOBJ from './lib/load-obj'; | ||
export default { | ||
name: 'OBJ', | ||
extensions: ['obj'], | ||
mimeType: 'text/plain', | ||
parse: function () { | ||
var _parse = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(arrayBuffer, options) { | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
return _context.abrupt("return", loadOBJ(new TextDecoder().decode(arrayBuffer), options)); | ||
case 1: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee); | ||
})); | ||
function parse(_x, _x2) { | ||
return _parse.apply(this, arguments); | ||
} | ||
return parse; | ||
}(), | ||
parseTextSync: loadOBJ, | ||
testText: testOBJFile | ||
}; | ||
function testOBJFile(text) { | ||
return text[0] === 'v'; | ||
} | ||
export default { | ||
name: 'OBJ', | ||
extensions: ['obj'], | ||
testText: testOBJFile, | ||
parseTextSync: loadOBJ | ||
}; | ||
//# sourceMappingURL=obj-loader.js.map |
@@ -1,2 +0,2 @@ | ||
var worker = "!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,\"a\",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p=\"\",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,u,\"next\",t)}function u(t){r(a,o,i,s,u,\"throw\",t)}s(void 0)})}}},function(t,e){function r(t){return(r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function n(e){return\"function\"==typeof Symbol&&\"symbol\"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":r(t)},n(e)}t.exports=n},function(t,e,r){var n=function(t){\"use strict\";var e,r=Object.prototype,n=r.hasOwnProperty,o=\"function\"==typeof Symbol?Symbol:{},i=o.iterator||\"@@iterator\",a=o.asyncIterator||\"@@asyncIterator\",s=o.toStringTag||\"@@toStringTag\";function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=c;return function(o,i){if(n===f)throw new Error(\"Generator is already running\");if(n===v){if(\"throw\"===o)throw i;return F()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===p)continue;return s}}if(\"next\"===r.method)r.sent=r._sent=r.arg;else if(\"throw\"===r.method){if(n===c)throw n=v,r.arg;r.dispatchException(r.arg)}else\"return\"===r.method&&r.abrupt(\"return\",r.arg);n=f;var u=l(t,e,r);if(\"normal\"===u.type){if(n=r.done?v:h,u.arg===p)continue;return{value:u.arg,done:r.done}}\"throw\"===u.type&&(n=v,r.method=\"throw\",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}t.wrap=u;var c=\"suspendedStart\",h=\"suspendedYield\",f=\"executing\",v=\"completed\",p={};function y(){}function d(){}function m(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(_([])));x&&x!==r&&n.call(x,i)&&(g=x);var w=m.prototype=y.prototype=Object.create(g);function j(t){[\"next\",\"throw\",\"return\"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(r,o){function i(){return new Promise(function(e,i){!function e(r,o,i,a){var s=l(t[r],t,o);if(\"throw\"!==s.type){var u=s.arg,c=u.value;return c&&\"object\"==typeof c&&n.call(c,\"__await\")?Promise.resolve(c.__await).then(function(t){e(\"next\",t,i,a)},function(t){e(\"throw\",t,i,a)}):Promise.resolve(c).then(function(t){u.value=t,i(u)},function(t){return e(\"throw\",t,i,a)})}a(s.arg)}(r,o,e,i)})}return e=e?e.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,\"throw\"===r.method){if(t.iterator.return&&(r.method=\"return\",r.arg=e,O(t,r),\"throw\"===r.method))return p;r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a 'throw' method\")}return p}var o=l(n,t.iterator,r.arg);if(\"throw\"===o.type)return r.method=\"throw\",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=e),r.delegate=null,p):i:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,p)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(S,this),this.reset(!0)}function _(t){if(t){var r=t[i];if(r)return r.call(t);if(\"function\"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:F}}function F(){return{value:e,done:!0}}return d.prototype=w.constructor=m,m.constructor=d,m[s]=d.displayName=\"GeneratorFunction\",t.isGeneratorFunction=function(t){var e=\"function\"==typeof t&&t.constructor;return!!e&&(e===d||\"GeneratorFunction\"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s in t||(t[s]=\"GeneratorFunction\")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},j(L.prototype),L.prototype[a]=function(){return this},t.AsyncIterator=L,t.async=function(e,r,n,o){var i=new L(u(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(w),w[s]=\"Generator\",w[i]=function(){return this},w.toString=function(){return\"[object Generator]\"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method=\"next\",this.arg=e,this.tryEntries.forEach(k),!t)for(var r in this)\"t\"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(\"throw\"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type=\"throw\",s.arg=t,r.next=n,o&&(r.method=\"next\",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),l=n.call(a,\"finallyLoc\");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error(\"try statement without catch or finally\");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev<o.finallyLoc){var i=o;break}}i&&(\"break\"===t||\"continue\"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method=\"next\",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if(\"throw\"===t.type)throw t.arg;return\"break\"===t.type||\"continue\"===t.type?this.next=t.arg:\"return\"===t.type?(this.rval=this.arg=t.arg,this.method=\"return\",this.next=\"end\"):\"normal\"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;k(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:_(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function(\"r\",\"regeneratorRuntime = r\")(n)}},function(t,e,r){\"use strict\";r.r(e);var n=r(1),o=r.n(n),i=r(2),a=r.n(i),s=/^[og]\\s*(.+)?/,u=/^mtllib /,l=/^usemtl /,c=function(){function t(e){var r=e.index,n=e.name,i=void 0===n?\"\":n,a=e.mtllib,s=e.smooth,u=e.groupStart;o()(this,t),this.index=r,this.name=i,this.mtllib=a,this.smooth=s,this.groupStart=u,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return a()(t,[{key:\"clone\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new t({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),t}(),h=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";o()(this,t),this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}return a()(t,[{key:\"startMaterial\",value:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var n=new c({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:\"\",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}},{key:\"currentMaterial\",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:\"_finalize\",value:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return t&&0===this.materials.length&&this.materials.push({name:\"\",smooth:this.smooth}),e}}]),t}(),f=function(){function t(){o()(this,t),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject(\"\",!1)}return a()(t,[{key:\"startObject\",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);var r=this.object&&\"function\"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&\"function\"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new h(t),this.object.fromDeclaration=e,r&&r.name&&\"function\"==typeof r.clone){var n=r.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)}},{key:\"finalize\",value:function(){this.object&&\"function\"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:\"parseVertexIndex\",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:\"parseNormalIndex\",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:\"parseUVIndex\",value:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}},{key:\"addVertex\",value:function(t,e,r){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addVertexPoint\",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:\"addVertexLine\",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:\"addNormal\",value:function(t,e,r){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addColor\",value:function(t,e,r){var n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addUV\",value:function(t,e,r){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}},{key:\"addUVLine\",value:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}},{key:\"addFace\",value:function(t,e,r,n,o,i,a,s,u){var l=this.vertices.length,c=this.parseVertexIndex(t,l),h=this.parseVertexIndex(e,l),f=this.parseVertexIndex(r,l);if(this.addVertex(c,h,f),void 0!==n&&\"\"!==n){var v=this.uvs.length;c=this.parseUVIndex(n,v),h=this.parseUVIndex(o,v),f=this.parseUVIndex(i,v),this.addUV(c,h,f)}if(void 0!==a&&\"\"!==a){var p=this.normals.length;c=this.parseNormalIndex(a,p),h=a===s?c:this.parseNormalIndex(s,p),f=a===u?c:this.parseNormalIndex(u,p),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}},{key:\"addPointGeometry\",value:function(t){this.object.geometry.type=\"Points\";var e=this.vertices.length,r=!0,n=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var s=i.value;this.addVertexPoint(this.parseVertexIndex(s,e))}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}}},{key:\"addLineGeometry\",value:function(t,e){this.object.geometry.type=\"Line\";var r=this.vertices.length,n=this.uvs.length,o=!0,i=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value;this.addVertexLine(this.parseVertexIndex(l,r))}}catch(t){i=!0,a=t}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}var c=!0,h=!1,f=void 0;try{for(var v,p=e[Symbol.iterator]();!(c=(v=p.next()).done);c=!0){var y=v.value;this.addUVLine(this.parseUVIndex(y,n))}}catch(t){h=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(h)throw f}}}}]),t}(),v=function(t){var e=new f;-1!==t.indexOf(\"\\r\\n\")&&(t=t.replace(/\\r\\n/g,\"\\n\")),-1!==t.indexOf(\"\\\\\\n\")&&(t=t.replace(/\\\\\\n/g,\"\"));for(var r=t.split(\"\\n\"),n=\"\",o=\"\",i=[],a=\"function\"==typeof\"\".trimLeft,c=0,h=r.length;c<h;c++)if(n=r[c],0!==(n=a?n.trimLeft():n.trim()).length&&\"#\"!==(o=n.charAt(0)))if(\"v\"===o){var v=n.split(/\\s+/);switch(v[0]){case\"v\":e.vertices.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3])),8===v.length&&e.colors.push(parseFloat(v[4]),parseFloat(v[5]),parseFloat(v[6]));break;case\"vn\":e.normals.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3]));break;case\"vt\":e.uvs.push(parseFloat(v[1]),parseFloat(v[2]))}}else if(\"f\"===o){for(var p=n.substr(1).trim().split(/\\s+/),y=[],d=0,m=p.length;d<m;d++){var g=p[d];if(g.length>0){var b=g.split(\"/\");y.push(b)}}for(var x=y[0],w=1,j=y.length-1;w<j;w++){var L=y[w],O=y[w+1];e.addFace(x[0],L[0],O[0],x[1],L[1],O[1],x[2],L[2],O[2])}}else if(\"l\"===o){var S=n.substring(1).trim().split(\" \"),k=void 0,E=[];if(-1===n.indexOf(\"/\"))k=S;else{k=[];for(var _=0,F=S.length;_<F;_++){var I=S[_].split(\"/\");\"\"!==I[0]&&k.push(I[0]),\"\"!==I[1]&&E.push(I[1])}}e.addLineGeometry(k,E)}else if(\"p\"===o){var P=n.substr(1).trim().split(\" \");e.addPointGeometry(P)}else if(null!==(i=s.exec(n))){var V=(\" \"+i[0].substr(1).trim()).substr(1);e.startObject(V)}else if(l.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(u.test(n))e.materialLibraries.push(n.substring(7).trim());else{if(\"s\"!==o){if(\"\\0\"===n)continue;throw new Error('Unexpected line: \"'.concat(n,'\"'))}if((i=n.split(\" \")).length>1){var N=i[1].trim().toLowerCase();e.object.smooth=\"0\"!==N&&\"off\"!==N}else e.object.smooth=!0;var A=e.object.currentMaterial();A&&(A.smooth=e.object.smooth)}e.finalize();var T=[],C=[],M=!0,z=!1,G=void 0;try{for(var R,U=e.objects[Symbol.iterator]();!(M=(R=U.next()).done);M=!0){var D=R.value,B=D.geometry;if(0!==B.vertices.length){var X={header:{vertexCount:B.vertices.length/3},attributes:{}};switch(B.type){case\"Points\":X.mode=0;break;case\"Line\":X.mode=1;break;default:X.mode=4}X.attributes.POSITION={value:new Float32Array(B.vertices),size:3},B.normals.length>0&&(X.attributes.NORMAL={value:new Float32Array(B.normals),size:3}),B.colors.length>0&&(X.attributes.COLOR_0={value:new Float32Array(B.colors),size:3}),B.uvs.length>0&&(X.attributes.TEXCOORD_0={value:new Float32Array(B.uvs),size:2}),X.materials=[];var Y=!0,J=!1,q=void 0;try{for(var H,K=D.materials[Symbol.iterator]();!(Y=(H=K.next()).done);Y=!0){var Q=H.value,W={name:Q.name,flatShading:!Q.smooth};X.materials.push(W),C.push(W)}}catch(t){J=!0,q=t}finally{try{Y||null==K.return||K.return()}finally{if(J)throw q}}X.name=D.name,T.push(X)}}}catch(t){z=!0,G=t}finally{try{M||null==U.return||U.return()}finally{if(z)throw G}}return{meshes:T,materials:C}};function p(t,e){var r,n,o,i=new Float32Array(3*e),a=0,s=!0,u=!1,l=void 0;try{for(var c,h=t[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var f=c.value.attributes,v=f.POSITION,p=f.NORMAL,y=f.COLOR_0,d=f.TEXCOORD_0;i.set(v.value,3*a),p&&(r=r||new Float32Array(3*e)).set(p.value,3*a),y&&(n=n||new Float32Array(3*e)).set(y.value,3*a),d&&(o=o||new Float32Array(2*e)).set(d.value,2*a),a+=v.value.length/3}}catch(t){u=!0,l=t}finally{try{s||null==h.return||h.return()}finally{if(u)throw l}}var m={};return m.POSITION={value:i,size:3},r&&(m.NORMAL={value:r,size:3}),n&&(m.COLOR_0={value:n,size:3}),o&&(m.TEXCOORD_0={value:o,size:2}),m}var y={name:\"OBJ\",extensions:[\"obj\"],testText:function(t){return\"v\"===t[0]},parseTextSync:function(t){var e=v(t).meshes,r=e.reduce(function(t,e){return t+e.header.vertexCount},0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:p(e,r)}}},d=r(0),m=r.n(d),g=r(3),b=r.n(g),x=r(4),w=r.n(x);function j(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(t instanceof ArrayBuffer)n.add(t);else if(t.buffer&&t.buffer instanceof ArrayBuffer)n.add(t.buffer);else if(e&&\"object\"===w()(t))for(var o in t)j(t[o],e,n)}else;return void 0===r?Array.from(n):null}function L(t,e,r,n,o){return O.apply(this,arguments)}function O(){return(O=b()(m.a.mark(function t(e,r,n,o,i){var a,s,u;return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.parseSync&&!e.parse){t.next=5;break}a=r,s=e.parseSync||e.parse,t.next=12;break;case 5:if(!e.parseTextSync){t.next=11;break}u=new TextDecoder,a=u.decode(r),s=e.parseTextSync,t.next=12;break;case 11:throw new Error(\"Could not load data with \".concat(e.name,\" loader\"));case 12:return t.next=14,s(a,i);case 14:return t.abrupt(\"return\",t.sent);case 15:case\"end\":return t.stop()}},t)}))).apply(this,arguments)}function S(t,e){return t&&\"process\"===t.type&&\"loaders.gl\"===t.source}!function(t){if(\"undefined\"!=typeof self){self.onmessage=function(){var e=b()(m.a.mark(function e(r){var n,o,i,a,s,u,l,c,h,f;return m.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.data,e.prev=1,S(n,t.name)){e.next=4;break}return e.abrupt(\"return\");case 4:return o=n.arraybuffer,i=n.byteOffset,a=void 0===i?0:i,s=n.byteLength,u=void 0===s?0:s,l=n.options,c=void 0===l?{}:l,e.next=7,L(t,o,a,u,c);case 7:h=e.sent,f=j(h),self.postMessage({type:\"done\",result:h},f),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),self.postMessage({type:\"error\",message:e.t0.message});case 15:case\"end\":return e.stop()}},e,null,[[1,12]])}));return function(t){return e.apply(this,arguments)}}();var e=0;self.parse=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(o,i){var a=e++;self.addEventListener(\"message\",function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case\"process-done\":self.removeEventListener(\"message\",t),o(r.result);break;case\"process-error\":self.removeEventListener(\"message\",t),i(r.message)}}),self.postMessage({type:\"process\",id:a,arraybuffer:t,options:r,url:n},[t])})}}}(y)}]);"; | ||
var worker = "!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,\"a\",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p=\"\",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,u,\"next\",t)}function u(t){r(a,o,i,s,u,\"throw\",t)}s(void 0)})}}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){function r(t){return(r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function n(e){return\"function\"==typeof Symbol&&\"symbol\"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":r(t)},n(e)}t.exports=n},function(t,e,r){var n=function(t){\"use strict\";var e,r=Object.prototype,n=r.hasOwnProperty,o=\"function\"==typeof Symbol?Symbol:{},i=o.iterator||\"@@iterator\",a=o.asyncIterator||\"@@asyncIterator\",s=o.toStringTag||\"@@toStringTag\";function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=c;return function(o,i){if(n===f)throw new Error(\"Generator is already running\");if(n===p){if(\"throw\"===o)throw i;return F()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===v)continue;return s}}if(\"next\"===r.method)r.sent=r._sent=r.arg;else if(\"throw\"===r.method){if(n===c)throw n=p,r.arg;r.dispatchException(r.arg)}else\"return\"===r.method&&r.abrupt(\"return\",r.arg);n=f;var u=l(t,e,r);if(\"normal\"===u.type){if(n=r.done?p:h,u.arg===v)continue;return{value:u.arg,done:r.done}}\"throw\"===u.type&&(n=p,r.method=\"throw\",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}t.wrap=u;var c=\"suspendedStart\",h=\"suspendedYield\",f=\"executing\",p=\"completed\",v={};function y(){}function d(){}function m(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(_([])));x&&x!==r&&n.call(x,i)&&(g=x);var w=m.prototype=y.prototype=Object.create(g);function j(t){[\"next\",\"throw\",\"return\"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(r,o){function i(){return new Promise(function(e,i){!function e(r,o,i,a){var s=l(t[r],t,o);if(\"throw\"!==s.type){var u=s.arg,c=u.value;return c&&\"object\"==typeof c&&n.call(c,\"__await\")?Promise.resolve(c.__await).then(function(t){e(\"next\",t,i,a)},function(t){e(\"throw\",t,i,a)}):Promise.resolve(c).then(function(t){u.value=t,i(u)},function(t){return e(\"throw\",t,i,a)})}a(s.arg)}(r,o,e,i)})}return e=e?e.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,\"throw\"===r.method){if(t.iterator.return&&(r.method=\"return\",r.arg=e,O(t,r),\"throw\"===r.method))return v;r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a 'throw' method\")}return v}var o=l(n,t.iterator,r.arg);if(\"throw\"===o.type)return r.method=\"throw\",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=e),r.delegate=null,v):i:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(k,this),this.reset(!0)}function _(t){if(t){var r=t[i];if(r)return r.call(t);if(\"function\"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:F}}function F(){return{value:e,done:!0}}return d.prototype=w.constructor=m,m.constructor=d,m[s]=d.displayName=\"GeneratorFunction\",t.isGeneratorFunction=function(t){var e=\"function\"==typeof t&&t.constructor;return!!e&&(e===d||\"GeneratorFunction\"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s in t||(t[s]=\"GeneratorFunction\")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},j(L.prototype),L.prototype[a]=function(){return this},t.AsyncIterator=L,t.async=function(e,r,n,o){var i=new L(u(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(w),w[s]=\"Generator\",w[i]=function(){return this},w.toString=function(){return\"[object Generator]\"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method=\"next\",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)\"t\"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(\"throw\"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type=\"throw\",s.arg=t,r.next=n,o&&(r.method=\"next\",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),l=n.call(a,\"finallyLoc\");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error(\"try statement without catch or finally\");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev<o.finallyLoc){var i=o;break}}i&&(\"break\"===t||\"continue\"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method=\"next\",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if(\"throw\"===t.type)throw t.arg;return\"break\"===t.type||\"continue\"===t.type?this.next=t.arg:\"return\"===t.type?(this.rval=this.arg=t.arg,this.method=\"return\",this.next=\"end\"):\"normal\"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;S(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:_(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function(\"r\",\"regeneratorRuntime = r\")(n)}},function(t,e,r){\"use strict\";r.r(e);var n=r(0),o=r.n(n),i=r(1),a=r.n(i),s=r(2),u=r.n(s),l=r(3),c=r.n(l),h=/^[og]\\s*(.+)?/,f=/^mtllib /,p=/^usemtl /,v=function(){function t(e){var r=e.index,n=e.name,o=void 0===n?\"\":n,i=e.mtllib,a=e.smooth,s=e.groupStart;u()(this,t),this.index=r,this.name=o,this.mtllib=i,this.smooth=a,this.groupStart=s,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return c()(t,[{key:\"clone\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new t({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),t}(),y=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";u()(this,t),this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}return c()(t,[{key:\"startMaterial\",value:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var n=new v({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:\"\",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}},{key:\"currentMaterial\",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:\"_finalize\",value:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return t&&0===this.materials.length&&this.materials.push({name:\"\",smooth:this.smooth}),e}}]),t}(),d=function(){function t(){u()(this,t),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject(\"\",!1)}return c()(t,[{key:\"startObject\",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);var r=this.object&&\"function\"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&\"function\"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new y(t),this.object.fromDeclaration=e,r&&r.name&&\"function\"==typeof r.clone){var n=r.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)}},{key:\"finalize\",value:function(){this.object&&\"function\"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:\"parseVertexIndex\",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:\"parseNormalIndex\",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:\"parseUVIndex\",value:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}},{key:\"addVertex\",value:function(t,e,r){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addVertexPoint\",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:\"addVertexLine\",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:\"addNormal\",value:function(t,e,r){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addColor\",value:function(t,e,r){var n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:\"addUV\",value:function(t,e,r){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}},{key:\"addUVLine\",value:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}},{key:\"addFace\",value:function(t,e,r,n,o,i,a,s,u){var l=this.vertices.length,c=this.parseVertexIndex(t,l),h=this.parseVertexIndex(e,l),f=this.parseVertexIndex(r,l);if(this.addVertex(c,h,f),void 0!==n&&\"\"!==n){var p=this.uvs.length;c=this.parseUVIndex(n,p),h=this.parseUVIndex(o,p),f=this.parseUVIndex(i,p),this.addUV(c,h,f)}if(void 0!==a&&\"\"!==a){var v=this.normals.length;c=this.parseNormalIndex(a,v),h=a===s?c:this.parseNormalIndex(s,v),f=a===u?c:this.parseNormalIndex(u,v),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}},{key:\"addPointGeometry\",value:function(t){this.object.geometry.type=\"Points\";var e=this.vertices.length,r=!0,n=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var s=i.value;this.addVertexPoint(this.parseVertexIndex(s,e))}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}}},{key:\"addLineGeometry\",value:function(t,e){this.object.geometry.type=\"Line\";var r=this.vertices.length,n=this.uvs.length,o=!0,i=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value;this.addVertexLine(this.parseVertexIndex(l,r))}}catch(t){i=!0,a=t}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}var c=!0,h=!1,f=void 0;try{for(var p,v=e[Symbol.iterator]();!(c=(p=v.next()).done);c=!0){var y=p.value;this.addUVLine(this.parseUVIndex(y,n))}}catch(t){h=!0,f=t}finally{try{c||null==v.return||v.return()}finally{if(h)throw f}}}}]),t}(),m=function(t){var e=new d;-1!==t.indexOf(\"\\r\\n\")&&(t=t.replace(/\\r\\n/g,\"\\n\")),-1!==t.indexOf(\"\\\\\\n\")&&(t=t.replace(/\\\\\\n/g,\"\"));for(var r=t.split(\"\\n\"),n=\"\",o=\"\",i=[],a=\"function\"==typeof\"\".trimLeft,s=0,u=r.length;s<u;s++)if(n=r[s],0!==(n=a?n.trimLeft():n.trim()).length&&\"#\"!==(o=n.charAt(0)))if(\"v\"===o){var l=n.split(/\\s+/);switch(l[0]){case\"v\":e.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),8===l.length&&e.colors.push(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6]));break;case\"vn\":e.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case\"vt\":e.uvs.push(parseFloat(l[1]),parseFloat(l[2]))}}else if(\"f\"===o){for(var c=n.substr(1).trim().split(/\\s+/),v=[],y=0,m=c.length;y<m;y++){var g=c[y];if(g.length>0){var b=g.split(\"/\");v.push(b)}}for(var x=v[0],w=1,j=v.length-1;w<j;w++){var L=v[w],O=v[w+1];e.addFace(x[0],L[0],O[0],x[1],L[1],O[1],x[2],L[2],O[2])}}else if(\"l\"===o){var k=n.substring(1).trim().split(\" \"),S=void 0,E=[];if(-1===n.indexOf(\"/\"))S=k;else{S=[];for(var _=0,F=k.length;_<F;_++){var I=k[_].split(\"/\");\"\"!==I[0]&&S.push(I[0]),\"\"!==I[1]&&E.push(I[1])}}e.addLineGeometry(S,E)}else if(\"p\"===o){var P=n.substr(1).trim().split(\" \");e.addPointGeometry(P)}else if(null!==(i=h.exec(n))){var T=(\" \"+i[0].substr(1).trim()).substr(1);e.startObject(T)}else if(p.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(f.test(n))e.materialLibraries.push(n.substring(7).trim());else{if(\"s\"!==o){if(\"\\0\"===n)continue;throw new Error('Unexpected line: \"'.concat(n,'\"'))}if((i=n.split(\" \")).length>1){var V=i[1].trim().toLowerCase();e.object.smooth=\"0\"!==V&&\"off\"!==V}else e.object.smooth=!0;var N=e.object.currentMaterial();N&&(N.smooth=e.object.smooth)}e.finalize();var A=[],C=[],M=!0,z=!1,G=void 0;try{for(var R,U=e.objects[Symbol.iterator]();!(M=(R=U.next()).done);M=!0){var D=R.value,B=D.geometry;if(0!==B.vertices.length){var X={header:{vertexCount:B.vertices.length/3},attributes:{}};switch(B.type){case\"Points\":X.mode=0;break;case\"Line\":X.mode=1;break;default:X.mode=4}X.attributes.POSITION={value:new Float32Array(B.vertices),size:3},B.normals.length>0&&(X.attributes.NORMAL={value:new Float32Array(B.normals),size:3}),B.colors.length>0&&(X.attributes.COLOR_0={value:new Float32Array(B.colors),size:3}),B.uvs.length>0&&(X.attributes.TEXCOORD_0={value:new Float32Array(B.uvs),size:2}),X.materials=[];var Y=!0,J=!1,q=void 0;try{for(var H,K=D.materials[Symbol.iterator]();!(Y=(H=K.next()).done);Y=!0){var Q=H.value,W={name:Q.name,flatShading:!Q.smooth};X.materials.push(W),C.push(W)}}catch(t){J=!0,q=t}finally{try{Y||null==K.return||K.return()}finally{if(J)throw q}}X.name=D.name,A.push(X)}}}catch(t){z=!0,G=t}finally{try{M||null==U.return||U.return()}finally{if(z)throw G}}return{meshes:A,materials:C}};function g(t){var e=m(t).meshes,r=e.reduce(function(t,e){return t+e.header.vertexCount},0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:b(e,r)}}function b(t,e){var r,n,o,i=new Float32Array(3*e),a=0,s=!0,u=!1,l=void 0;try{for(var c,h=t[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var f=c.value.attributes,p=f.POSITION,v=f.NORMAL,y=f.COLOR_0,d=f.TEXCOORD_0;i.set(p.value,3*a),v&&(r=r||new Float32Array(3*e)).set(v.value,3*a),y&&(n=n||new Float32Array(3*e)).set(y.value,3*a),d&&(o=o||new Float32Array(2*e)).set(d.value,2*a),a+=p.value.length/3}}catch(t){u=!0,l=t}finally{try{s||null==h.return||h.return()}finally{if(u)throw l}}var m={};return m.POSITION={value:i,size:3},r&&(m.NORMAL={value:r,size:3}),n&&(m.COLOR_0={value:n,size:3}),o&&(m.TEXCOORD_0={value:o,size:2}),m}var x,w={name:\"OBJ\",extensions:[\"obj\"],mimeType:\"text/plain\",parse:(x=a()(o.a.mark(function t(e,r){return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt(\"return\",g((new TextDecoder).decode(e)));case 1:case\"end\":return t.stop()}},t)})),function(t,e){return x.apply(this,arguments)}),parseTextSync:g,testText:function(t){return\"v\"===t[0]}};var j=r(4),L=r.n(j);function O(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(t instanceof ArrayBuffer)n.add(t);else if(t.buffer&&t.buffer instanceof ArrayBuffer)n.add(t.buffer);else if(e&&\"object\"===L()(t))for(var o in t)O(t[o],e,n)}else;return void 0===r?Array.from(n):null}function k(t,e,r,n,o){return S.apply(this,arguments)}function S(){return(S=a()(o.a.mark(function t(e,r,n,i,a){var s,u,l;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.parseSync&&!e.parse){t.next=5;break}s=r,u=e.parseSync||e.parse,t.next=12;break;case 5:if(!e.parseTextSync){t.next=11;break}l=new TextDecoder,s=l.decode(r),u=e.parseTextSync,t.next=12;break;case 11:throw new Error(\"Could not load data with \".concat(e.name,\" loader\"));case 12:return t.next=14,u(s,a);case 14:return t.abrupt(\"return\",t.sent);case 15:case\"end\":return t.stop()}},t)}))).apply(this,arguments)}function E(t,e){return t&&\"process\"===t.type&&\"loaders.gl\"===t.source}!function(t){if(\"undefined\"!=typeof self){self.onmessage=function(){var e=a()(o.a.mark(function e(r){var n,i,a,s,u,l,c,h,f,p;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.data,e.prev=1,E(n,t.name)){e.next=4;break}return e.abrupt(\"return\");case 4:return i=n.arraybuffer,a=n.byteOffset,s=void 0===a?0:a,u=n.byteLength,l=void 0===u?0:u,c=n.options,h=void 0===c?{}:c,e.next=7,k(t,i,s,l,h);case 7:f=e.sent,p=O(f),self.postMessage({type:\"done\",result:f},p),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),self.postMessage({type:\"error\",message:e.t0.message});case 15:case\"end\":return e.stop()}},e,null,[[1,12]])}));return function(t){return e.apply(this,arguments)}}();var e=0;self.parse=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(o,i){var a=e++;self.addEventListener(\"message\",function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case\"process-done\":self.removeEventListener(\"message\",t),o(r.result);break;case\"process-error\":self.removeEventListener(\"message\",t),i(r.message)}}),self.postMessage({type:\"process\",id:a,arraybuffer:t,options:r,url:n},[t])})}}}(w)}]);"; | ||
export default { | ||
@@ -3,0 +3,0 @@ name: 'OBJ', |
@@ -1,1 +0,1 @@ | ||
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,u,"next",t)}function u(t){r(a,o,i,s,u,"throw",t)}s(void 0)})}}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(e){return"function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},n(e)}t.exports=n},function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=c;return function(o,i){if(n===f)throw new Error("Generator is already running");if(n===v){if("throw"===o)throw i;return F()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===c)throw n=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var u=l(t,e,r);if("normal"===u.type){if(n=r.done?v:h,u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=v,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var c="suspendedStart",h="suspendedYield",f="executing",v="completed",p={};function y(){}function d(){}function m(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(_([])));x&&x!==r&&n.call(x,i)&&(g=x);var w=m.prototype=y.prototype=Object.create(g);function j(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(r,o){function i(){return new Promise(function(e,i){!function e(r,o,i,a){var s=l(t[r],t,o);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(c).then(function(t){u.value=t,i(u)},function(t){return e("throw",t,i,a)})}a(s.arg)}(r,o,e,i)})}return e=e?e.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return p;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function _(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:F}}function F(){return{value:e,done:!0}}return d.prototype=w.constructor=m,m.constructor=d,m[s]=d.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},j(L.prototype),L.prototype[a]=function(){return this},t.AsyncIterator=L,t.async=function(e,r,n,o){var i=new L(u(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(w),w[s]="Generator",w[i]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:_(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e);var n=r(1),o=r.n(n),i=r(2),a=r.n(i),s=/^[og]\s*(.+)?/,u=/^mtllib /,l=/^usemtl /,c=function(){function t(e){var r=e.index,n=e.name,i=void 0===n?"":n,a=e.mtllib,s=e.smooth,u=e.groupStart;o()(this,t),this.index=r,this.name=i,this.mtllib=a,this.smooth=s,this.groupStart=u,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return a()(t,[{key:"clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new t({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),t}(),h=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o()(this,t),this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}return a()(t,[{key:"startMaterial",value:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var n=new c({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}},{key:"currentMaterial",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:"_finalize",value:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}}]),t}(),f=function(){function t(){o()(this,t),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}return a()(t,[{key:"startObject",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);var r=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new h(t),this.object.fromDeclaration=e,r&&r.name&&"function"==typeof r.clone){var n=r.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)}},{key:"finalize",value:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:"parseVertexIndex",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:"parseNormalIndex",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:"parseUVIndex",value:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}},{key:"addVertex",value:function(t,e,r){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addVertexPoint",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:"addVertexLine",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:"addNormal",value:function(t,e,r){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addColor",value:function(t,e,r){var n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addUV",value:function(t,e,r){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}},{key:"addUVLine",value:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}},{key:"addFace",value:function(t,e,r,n,o,i,a,s,u){var l=this.vertices.length,c=this.parseVertexIndex(t,l),h=this.parseVertexIndex(e,l),f=this.parseVertexIndex(r,l);if(this.addVertex(c,h,f),void 0!==n&&""!==n){var v=this.uvs.length;c=this.parseUVIndex(n,v),h=this.parseUVIndex(o,v),f=this.parseUVIndex(i,v),this.addUV(c,h,f)}if(void 0!==a&&""!==a){var p=this.normals.length;c=this.parseNormalIndex(a,p),h=a===s?c:this.parseNormalIndex(s,p),f=a===u?c:this.parseNormalIndex(u,p),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}},{key:"addPointGeometry",value:function(t){this.object.geometry.type="Points";var e=this.vertices.length,r=!0,n=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var s=i.value;this.addVertexPoint(this.parseVertexIndex(s,e))}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}}},{key:"addLineGeometry",value:function(t,e){this.object.geometry.type="Line";var r=this.vertices.length,n=this.uvs.length,o=!0,i=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value;this.addVertexLine(this.parseVertexIndex(l,r))}}catch(t){i=!0,a=t}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}var c=!0,h=!1,f=void 0;try{for(var v,p=e[Symbol.iterator]();!(c=(v=p.next()).done);c=!0){var y=v.value;this.addUVLine(this.parseUVIndex(y,n))}}catch(t){h=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(h)throw f}}}}]),t}(),v=function(t){var e=new f;-1!==t.indexOf("\r\n")&&(t=t.replace(/\r\n/g,"\n")),-1!==t.indexOf("\\\n")&&(t=t.replace(/\\\n/g,""));for(var r=t.split("\n"),n="",o="",i=[],a="function"==typeof"".trimLeft,c=0,h=r.length;c<h;c++)if(n=r[c],0!==(n=a?n.trimLeft():n.trim()).length&&"#"!==(o=n.charAt(0)))if("v"===o){var v=n.split(/\s+/);switch(v[0]){case"v":e.vertices.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3])),8===v.length&&e.colors.push(parseFloat(v[4]),parseFloat(v[5]),parseFloat(v[6]));break;case"vn":e.normals.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3]));break;case"vt":e.uvs.push(parseFloat(v[1]),parseFloat(v[2]))}}else if("f"===o){for(var p=n.substr(1).trim().split(/\s+/),y=[],d=0,m=p.length;d<m;d++){var g=p[d];if(g.length>0){var b=g.split("/");y.push(b)}}for(var x=y[0],w=1,j=y.length-1;w<j;w++){var L=y[w],O=y[w+1];e.addFace(x[0],L[0],O[0],x[1],L[1],O[1],x[2],L[2],O[2])}}else if("l"===o){var S=n.substring(1).trim().split(" "),k=void 0,E=[];if(-1===n.indexOf("/"))k=S;else{k=[];for(var _=0,F=S.length;_<F;_++){var I=S[_].split("/");""!==I[0]&&k.push(I[0]),""!==I[1]&&E.push(I[1])}}e.addLineGeometry(k,E)}else if("p"===o){var P=n.substr(1).trim().split(" ");e.addPointGeometry(P)}else if(null!==(i=s.exec(n))){var V=(" "+i[0].substr(1).trim()).substr(1);e.startObject(V)}else if(l.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(u.test(n))e.materialLibraries.push(n.substring(7).trim());else{if("s"!==o){if("\0"===n)continue;throw new Error('Unexpected line: "'.concat(n,'"'))}if((i=n.split(" ")).length>1){var N=i[1].trim().toLowerCase();e.object.smooth="0"!==N&&"off"!==N}else e.object.smooth=!0;var A=e.object.currentMaterial();A&&(A.smooth=e.object.smooth)}e.finalize();var T=[],C=[],M=!0,z=!1,G=void 0;try{for(var R,U=e.objects[Symbol.iterator]();!(M=(R=U.next()).done);M=!0){var D=R.value,B=D.geometry;if(0!==B.vertices.length){var X={header:{vertexCount:B.vertices.length/3},attributes:{}};switch(B.type){case"Points":X.mode=0;break;case"Line":X.mode=1;break;default:X.mode=4}X.attributes.POSITION={value:new Float32Array(B.vertices),size:3},B.normals.length>0&&(X.attributes.NORMAL={value:new Float32Array(B.normals),size:3}),B.colors.length>0&&(X.attributes.COLOR_0={value:new Float32Array(B.colors),size:3}),B.uvs.length>0&&(X.attributes.TEXCOORD_0={value:new Float32Array(B.uvs),size:2}),X.materials=[];var Y=!0,J=!1,q=void 0;try{for(var H,K=D.materials[Symbol.iterator]();!(Y=(H=K.next()).done);Y=!0){var Q=H.value,W={name:Q.name,flatShading:!Q.smooth};X.materials.push(W),C.push(W)}}catch(t){J=!0,q=t}finally{try{Y||null==K.return||K.return()}finally{if(J)throw q}}X.name=D.name,T.push(X)}}}catch(t){z=!0,G=t}finally{try{M||null==U.return||U.return()}finally{if(z)throw G}}return{meshes:T,materials:C}};function p(t,e){var r,n,o,i=new Float32Array(3*e),a=0,s=!0,u=!1,l=void 0;try{for(var c,h=t[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var f=c.value.attributes,v=f.POSITION,p=f.NORMAL,y=f.COLOR_0,d=f.TEXCOORD_0;i.set(v.value,3*a),p&&(r=r||new Float32Array(3*e)).set(p.value,3*a),y&&(n=n||new Float32Array(3*e)).set(y.value,3*a),d&&(o=o||new Float32Array(2*e)).set(d.value,2*a),a+=v.value.length/3}}catch(t){u=!0,l=t}finally{try{s||null==h.return||h.return()}finally{if(u)throw l}}var m={};return m.POSITION={value:i,size:3},r&&(m.NORMAL={value:r,size:3}),n&&(m.COLOR_0={value:n,size:3}),o&&(m.TEXCOORD_0={value:o,size:2}),m}var y={name:"OBJ",extensions:["obj"],testText:function(t){return"v"===t[0]},parseTextSync:function(t){var e=v(t).meshes,r=e.reduce(function(t,e){return t+e.header.vertexCount},0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:p(e,r)}}},d=r(0),m=r.n(d),g=r(3),b=r.n(g),x=r(4),w=r.n(x);function j(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(t instanceof ArrayBuffer)n.add(t);else if(t.buffer&&t.buffer instanceof ArrayBuffer)n.add(t.buffer);else if(e&&"object"===w()(t))for(var o in t)j(t[o],e,n)}else;return void 0===r?Array.from(n):null}function L(t,e,r,n,o){return O.apply(this,arguments)}function O(){return(O=b()(m.a.mark(function t(e,r,n,o,i){var a,s,u;return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.parseSync&&!e.parse){t.next=5;break}a=r,s=e.parseSync||e.parse,t.next=12;break;case 5:if(!e.parseTextSync){t.next=11;break}u=new TextDecoder,a=u.decode(r),s=e.parseTextSync,t.next=12;break;case 11:throw new Error("Could not load data with ".concat(e.name," loader"));case 12:return t.next=14,s(a,i);case 14:return t.abrupt("return",t.sent);case 15:case"end":return t.stop()}},t)}))).apply(this,arguments)}function S(t,e){return t&&"process"===t.type&&"loaders.gl"===t.source}!function(t){if("undefined"!=typeof self){self.onmessage=function(){var e=b()(m.a.mark(function e(r){var n,o,i,a,s,u,l,c,h,f;return m.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.data,e.prev=1,S(n,t.name)){e.next=4;break}return e.abrupt("return");case 4:return o=n.arraybuffer,i=n.byteOffset,a=void 0===i?0:i,s=n.byteLength,u=void 0===s?0:s,l=n.options,c=void 0===l?{}:l,e.next=7,L(t,o,a,u,c);case 7:h=e.sent,f=j(h),self.postMessage({type:"done",result:h},f),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 15:case"end":return e.stop()}},e,null,[[1,12]])}));return function(t){return e.apply(this,arguments)}}();var e=0;self.parse=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(o,i){var a=e++;self.addEventListener("message",function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case"process-done":self.removeEventListener("message",t),o(r.result);break;case"process-error":self.removeEventListener("message",t),i(r.message)}}),self.postMessage({type:"process",id:a,arraybuffer:t,options:r,url:n},[t])})}}}(y)}]); | ||
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,u,"next",t)}function u(t){r(a,o,i,s,u,"throw",t)}s(void 0)})}}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(e){return"function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},n(e)}t.exports=n},function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=c;return function(o,i){if(n===f)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return F()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===c)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var u=l(t,e,r);if("normal"===u.type){if(n=r.done?p:h,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var c="suspendedStart",h="suspendedYield",f="executing",p="completed",v={};function y(){}function d(){}function m(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(_([])));x&&x!==r&&n.call(x,i)&&(g=x);var w=m.prototype=y.prototype=Object.create(g);function j(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(r,o){function i(){return new Promise(function(e,i){!function e(r,o,i,a){var s=l(t[r],t,o);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(c).then(function(t){u.value=t,i(u)},function(t){return e("throw",t,i,a)})}a(s.arg)}(r,o,e,i)})}return e=e?e.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function _(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:F}}function F(){return{value:e,done:!0}}return d.prototype=w.constructor=m,m.constructor=d,m[s]=d.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},j(L.prototype),L.prototype[a]=function(){return this},t.AsyncIterator=L,t.async=function(e,r,n,o){var i=new L(u(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(w),w[s]="Generator",w[i]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:_(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),i=r(1),a=r.n(i),s=r(2),u=r.n(s),l=r(3),c=r.n(l),h=/^[og]\s*(.+)?/,f=/^mtllib /,p=/^usemtl /,v=function(){function t(e){var r=e.index,n=e.name,o=void 0===n?"":n,i=e.mtllib,a=e.smooth,s=e.groupStart;u()(this,t),this.index=r,this.name=o,this.mtllib=i,this.smooth=a,this.groupStart=s,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return c()(t,[{key:"clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new t({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),t}(),y=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u()(this,t),this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0}return c()(t,[{key:"startMaterial",value:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var n=new v({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0});return this.materials.push(n),n}},{key:"currentMaterial",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:"_finalize",value:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}}]),t}(),d=function(){function t(){u()(this,t),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}return c()(t,[{key:"startObject",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);var r=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new y(t),this.object.fromDeclaration=e,r&&r.name&&"function"==typeof r.clone){var n=r.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)}},{key:"finalize",value:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:"parseVertexIndex",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:"parseNormalIndex",value:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)}},{key:"parseUVIndex",value:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)}},{key:"addVertex",value:function(t,e,r){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addVertexPoint",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:"addVertexLine",value:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}},{key:"addNormal",value:function(t,e,r){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addColor",value:function(t,e,r){var n=this.colors,o=this.object.geometry.colors;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[r+0],n[r+1],n[r+2])}},{key:"addUV",value:function(t,e,r){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[r+0],n[r+1])}},{key:"addUVLine",value:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}},{key:"addFace",value:function(t,e,r,n,o,i,a,s,u){var l=this.vertices.length,c=this.parseVertexIndex(t,l),h=this.parseVertexIndex(e,l),f=this.parseVertexIndex(r,l);if(this.addVertex(c,h,f),void 0!==n&&""!==n){var p=this.uvs.length;c=this.parseUVIndex(n,p),h=this.parseUVIndex(o,p),f=this.parseUVIndex(i,p),this.addUV(c,h,f)}if(void 0!==a&&""!==a){var v=this.normals.length;c=this.parseNormalIndex(a,v),h=a===s?c:this.parseNormalIndex(s,v),f=a===u?c:this.parseNormalIndex(u,v),this.addNormal(c,h,f)}this.colors.length>0&&this.addColor(c,h,f)}},{key:"addPointGeometry",value:function(t){this.object.geometry.type="Points";var e=this.vertices.length,r=!0,n=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var s=i.value;this.addVertexPoint(this.parseVertexIndex(s,e))}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}}},{key:"addLineGeometry",value:function(t,e){this.object.geometry.type="Line";var r=this.vertices.length,n=this.uvs.length,o=!0,i=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value;this.addVertexLine(this.parseVertexIndex(l,r))}}catch(t){i=!0,a=t}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}var c=!0,h=!1,f=void 0;try{for(var p,v=e[Symbol.iterator]();!(c=(p=v.next()).done);c=!0){var y=p.value;this.addUVLine(this.parseUVIndex(y,n))}}catch(t){h=!0,f=t}finally{try{c||null==v.return||v.return()}finally{if(h)throw f}}}}]),t}(),m=function(t){var e=new d;-1!==t.indexOf("\r\n")&&(t=t.replace(/\r\n/g,"\n")),-1!==t.indexOf("\\\n")&&(t=t.replace(/\\\n/g,""));for(var r=t.split("\n"),n="",o="",i=[],a="function"==typeof"".trimLeft,s=0,u=r.length;s<u;s++)if(n=r[s],0!==(n=a?n.trimLeft():n.trim()).length&&"#"!==(o=n.charAt(0)))if("v"===o){var l=n.split(/\s+/);switch(l[0]){case"v":e.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),8===l.length&&e.colors.push(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6]));break;case"vn":e.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case"vt":e.uvs.push(parseFloat(l[1]),parseFloat(l[2]))}}else if("f"===o){for(var c=n.substr(1).trim().split(/\s+/),v=[],y=0,m=c.length;y<m;y++){var g=c[y];if(g.length>0){var b=g.split("/");v.push(b)}}for(var x=v[0],w=1,j=v.length-1;w<j;w++){var L=v[w],O=v[w+1];e.addFace(x[0],L[0],O[0],x[1],L[1],O[1],x[2],L[2],O[2])}}else if("l"===o){var k=n.substring(1).trim().split(" "),S=void 0,E=[];if(-1===n.indexOf("/"))S=k;else{S=[];for(var _=0,F=k.length;_<F;_++){var I=k[_].split("/");""!==I[0]&&S.push(I[0]),""!==I[1]&&E.push(I[1])}}e.addLineGeometry(S,E)}else if("p"===o){var P=n.substr(1).trim().split(" ");e.addPointGeometry(P)}else if(null!==(i=h.exec(n))){var T=(" "+i[0].substr(1).trim()).substr(1);e.startObject(T)}else if(p.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(f.test(n))e.materialLibraries.push(n.substring(7).trim());else{if("s"!==o){if("\0"===n)continue;throw new Error('Unexpected line: "'.concat(n,'"'))}if((i=n.split(" ")).length>1){var V=i[1].trim().toLowerCase();e.object.smooth="0"!==V&&"off"!==V}else e.object.smooth=!0;var N=e.object.currentMaterial();N&&(N.smooth=e.object.smooth)}e.finalize();var A=[],C=[],M=!0,z=!1,G=void 0;try{for(var R,U=e.objects[Symbol.iterator]();!(M=(R=U.next()).done);M=!0){var D=R.value,B=D.geometry;if(0!==B.vertices.length){var X={header:{vertexCount:B.vertices.length/3},attributes:{}};switch(B.type){case"Points":X.mode=0;break;case"Line":X.mode=1;break;default:X.mode=4}X.attributes.POSITION={value:new Float32Array(B.vertices),size:3},B.normals.length>0&&(X.attributes.NORMAL={value:new Float32Array(B.normals),size:3}),B.colors.length>0&&(X.attributes.COLOR_0={value:new Float32Array(B.colors),size:3}),B.uvs.length>0&&(X.attributes.TEXCOORD_0={value:new Float32Array(B.uvs),size:2}),X.materials=[];var Y=!0,J=!1,q=void 0;try{for(var H,K=D.materials[Symbol.iterator]();!(Y=(H=K.next()).done);Y=!0){var Q=H.value,W={name:Q.name,flatShading:!Q.smooth};X.materials.push(W),C.push(W)}}catch(t){J=!0,q=t}finally{try{Y||null==K.return||K.return()}finally{if(J)throw q}}X.name=D.name,A.push(X)}}}catch(t){z=!0,G=t}finally{try{M||null==U.return||U.return()}finally{if(z)throw G}}return{meshes:A,materials:C}};function g(t){var e=m(t).meshes,r=e.reduce(function(t,e){return t+e.header.vertexCount},0);return{loaderData:{header:{}},header:{vertexCount:r},mode:4,attributes:b(e,r)}}function b(t,e){var r,n,o,i=new Float32Array(3*e),a=0,s=!0,u=!1,l=void 0;try{for(var c,h=t[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var f=c.value.attributes,p=f.POSITION,v=f.NORMAL,y=f.COLOR_0,d=f.TEXCOORD_0;i.set(p.value,3*a),v&&(r=r||new Float32Array(3*e)).set(v.value,3*a),y&&(n=n||new Float32Array(3*e)).set(y.value,3*a),d&&(o=o||new Float32Array(2*e)).set(d.value,2*a),a+=p.value.length/3}}catch(t){u=!0,l=t}finally{try{s||null==h.return||h.return()}finally{if(u)throw l}}var m={};return m.POSITION={value:i,size:3},r&&(m.NORMAL={value:r,size:3}),n&&(m.COLOR_0={value:n,size:3}),o&&(m.TEXCOORD_0={value:o,size:2}),m}var x,w={name:"OBJ",extensions:["obj"],mimeType:"text/plain",parse:(x=a()(o.a.mark(function t(e,r){return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",g((new TextDecoder).decode(e)));case 1:case"end":return t.stop()}},t)})),function(t,e){return x.apply(this,arguments)}),parseTextSync:g,testText:function(t){return"v"===t[0]}};var j=r(4),L=r.n(j);function O(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(t instanceof ArrayBuffer)n.add(t);else if(t.buffer&&t.buffer instanceof ArrayBuffer)n.add(t.buffer);else if(e&&"object"===L()(t))for(var o in t)O(t[o],e,n)}else;return void 0===r?Array.from(n):null}function k(t,e,r,n,o){return S.apply(this,arguments)}function S(){return(S=a()(o.a.mark(function t(e,r,n,i,a){var s,u,l;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.parseSync&&!e.parse){t.next=5;break}s=r,u=e.parseSync||e.parse,t.next=12;break;case 5:if(!e.parseTextSync){t.next=11;break}l=new TextDecoder,s=l.decode(r),u=e.parseTextSync,t.next=12;break;case 11:throw new Error("Could not load data with ".concat(e.name," loader"));case 12:return t.next=14,u(s,a);case 14:return t.abrupt("return",t.sent);case 15:case"end":return t.stop()}},t)}))).apply(this,arguments)}function E(t,e){return t&&"process"===t.type&&"loaders.gl"===t.source}!function(t){if("undefined"!=typeof self){self.onmessage=function(){var e=a()(o.a.mark(function e(r){var n,i,a,s,u,l,c,h,f,p;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.data,e.prev=1,E(n,t.name)){e.next=4;break}return e.abrupt("return");case 4:return i=n.arraybuffer,a=n.byteOffset,s=void 0===a?0:a,u=n.byteLength,l=void 0===u?0:u,c=n.options,h=void 0===c?{}:c,e.next=7,k(t,i,s,l,h);case 7:f=e.sent,p=O(f),self.postMessage({type:"done",result:f},p),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 15:case"end":return e.stop()}},e,null,[[1,12]])}));return function(t){return e.apply(this,arguments)}}();var e=0;self.parse=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(o,i){var a=e++;self.addEventListener("message",function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case"process-done":self.removeEventListener("message",t),o(r.result);break;case"process-error":self.removeEventListener("message",t),i(r.message)}}),self.postMessage({type:"process",id:a,arraybuffer:t,options:r,url:n},[t])})}}}(w)}]); |
{ | ||
"name": "@loaders.gl/obj", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Framework-independent loader for the OBJ format", | ||
@@ -37,5 +37,5 @@ "license": "MIT", | ||
"@babel/runtime": "^7.3.1", | ||
"@loaders.gl/loader-utils": "1.3.0" | ||
"@loaders.gl/loader-utils": "1.3.1" | ||
}, | ||
"gitHead": "4d3e7ecfc49016fdeb3a37d5432d35c7f6ce3e30" | ||
"gitHead": "d1e0103b82f81c574f7acba46b645ab9d74e3f06" | ||
} |
@@ -1,13 +0,16 @@ | ||
import loadOBJ from './load-obj'; | ||
/* global TextDecoder */ | ||
import loadOBJ from './lib/load-obj'; | ||
function testOBJFile(text) { | ||
// There could be comment line first | ||
return text[0] === 'v'; | ||
} | ||
export default { | ||
name: 'OBJ', | ||
extensions: ['obj'], | ||
testText: testOBJFile, | ||
parseTextSync: loadOBJ | ||
mimeType: 'text/plain', | ||
parse: async (arrayBuffer, options) => loadOBJ(new TextDecoder().decode(arrayBuffer), options), | ||
parseTextSync: loadOBJ, | ||
testText: testOBJFile | ||
}; | ||
function testOBJFile(text) { | ||
// TODO - There could be comment line first | ||
return text[0] === 'v'; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
358728
3336
1
+ Added@loaders.gl/loader-utils@1.3.1(transitive)
- Removed@loaders.gl/loader-utils@1.3.0(transitive)