gl-draw 0.1.5 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import*as F from"three";import*as Y from"idb-keyval";var Q={666:function(v){var c=function(o){"use strict";var s=Object.prototype,u=s.hasOwnProperty,a,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",f=r.asyncIterator||"@@asyncIterator",_=r.toStringTag||"@@toStringTag";function d(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(t,i,p){return t[i]=p}}function g(e,t,i,p){var l=t&&t.prototype instanceof Z?t:Z,C=Object.create(l.prototype),V=new M(p||[]);return C._invoke=h(e,i,V),C}o.wrap=g;function k(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(p){return{type:"throw",arg:p}}}var L="suspendedStart",B="suspendedYield",D="executing",S="completed",T={};function Z(){}function A(){}function G(){}var K={};d(K,n,function(){return this});var I=Object.getPrototypeOf,j=I&&I(I(W([])));j&&j!==s&&u.call(j,n)&&(K=j);var w=G.prototype=Z.prototype=Object.create(K);A.prototype=G,d(w,"constructor",G),d(G,"constructor",A),A.displayName=d(G,_,"GeneratorFunction");function E(e){["next","throw","return"].forEach(function(t){d(e,t,function(i){return this._invoke(t,i)})})}o.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===A||(t.displayName||t.name)==="GeneratorFunction":!1},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,G):(e.__proto__=G,d(e,_,"GeneratorFunction")),e.prototype=Object.create(w),e},o.awrap=function(e){return{__await:e}};function m(e,t){function i(C,V,U,R){var z=k(e[C],e,V);if(z.type==="throw")R(z.arg);else{var J=z.arg,$=J.value;return $&&typeof $=="object"&&u.call($,"__await")?t.resolve($.__await).then(function(N){i("next",N,U,R)},function(N){i("throw",N,U,R)}):t.resolve($).then(function(N){J.value=N,U(J)},function(N){return i("throw",N,U,R)})}}var p;function l(C,V){function U(){return new t(function(R,z){i(C,V,R,z)})}return p=p?p.then(U,U):U()}this._invoke=l}E(m.prototype),d(m.prototype,f,function(){return this}),o.AsyncIterator=m,o.async=function(e,t,i,p,l){l===void 0&&(l=Promise);var C=new m(g(e,t,i,p),l);return o.isGeneratorFunction(t)?C:C.next().then(function(V){return V.done?V.value:C.next()})};function h(e,t,i){var p=L;return function(C,V){if(p===D)throw new Error("Generator is already running");if(p===S){if(C==="throw")throw V;return X()}for(i.method=C,i.arg=V;;){var U=i.delegate;if(U){var R=O(U,i);if(R){if(R===T)continue;return R}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(p===L)throw p=S,i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);p=D;var z=k(e,t,i);if(z.type==="normal"){if(p=i.done?S:B,z.arg===T)continue;return{value:z.arg,done:i.done}}else z.type==="throw"&&(p=S,i.method="throw",i.arg=z.arg)}}}function O(e,t){var i=e.iterator[t.method];if(i===a){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=a,O(e,t),t.method==="throw"))return T;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var p=k(i,e.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,T;var l=p.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,T;if(l.done)t[e.resultName]=l.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=a);else return l;return t.delegate=null,T}E(w),d(w,_,"Generator"),d(w,n,function(){return this}),d(w,"toString",function(){return"[object Generator]"});function y(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function b(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(y,this),this.reset(!0)}o.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function p(){for(;t.length;){var l=t.pop();if(l in e)return p.value=l,p.done=!1,p}return p.done=!0,p}};function W(e){if(e){var t=e[n];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var i=-1,p=function l(){for(;++i<e.length;)if(u.call(e,i))return l.value=e[i],l.done=!1,l;return l.value=a,l.done=!0,l};return p.next=p}}return{next:X}}o.values=W;function X(){return{value:a,done:!0}}return M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(b),!e)for(var t in this)t.charAt(0)==="t"&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=a)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(R,z){return C.type="throw",C.arg=e,t.next=R,z&&(t.method="next",t.arg=a),!!z}for(var p=this.tryEntries.length-1;p>=0;--p){var l=this.tryEntries[p],C=l.completion;if(l.tryLoc==="root")return i("end");if(l.tryLoc<=this.prev){var V=u.call(l,"catchLoc"),U=u.call(l,"finallyLoc");if(V&&U){if(this.prev<l.catchLoc)return i(l.catchLoc,!0);if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else if(V){if(this.prev<l.catchLoc)return i(l.catchLoc,!0)}else if(U){if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var p=this.tryEntries[i];if(p.tryLoc<=this.prev&&u.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var l=p;break}}l&&(e==="break"||e==="continue")&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var C=l?l.completion:{};return C.type=e,C.arg=t,l?(this.method="next",this.next=l.finallyLoc,T):this.complete(C)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),T},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),b(i),T}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var p=i.completion;if(p.type==="throw"){var l=p.arg;b(i)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:W(e),resultName:t,nextLoc:i},this.method==="next"&&(this.arg=a),T}},o}(v.exports);try{regeneratorRuntime=c}catch(o){typeof globalThis=="object"?globalThis.regeneratorRuntime=c:Function("r","regeneratorRuntime = r")(c)}},182:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u){if(u.geometry&&u.geometry.dispose(),u.material){var a=Array.isArray(u.material)?u.material:[u.material];a.forEach(function(r){var n,f,_,d,g,k,L,B,D,S,T,Z,A;(n=r.map)===null||n===void 0||n.dispose(),(f=r.lightMap)===null||f===void 0||f.dispose(),(_=r.bumpMap)===null||_===void 0||_.dispose(),(d=r.normalMap)===null||d===void 0||d.dispose(),(g=r.specularMap)===null||g===void 0||g.dispose(),(k=r.envMap)===null||k===void 0||k.dispose(),(L=r.alphaMap)===null||L===void 0||L.dispose(),(B=r.aoMap)===null||B===void 0||B.dispose(),(D=r.displacementMap)===null||D===void 0||D.dispose(),(S=r.emissiveMap)===null||S===void 0||S.dispose(),(T=r.gradientMap)===null||T===void 0||T.dispose(),(Z=r.metalnessMap)===null||Z===void 0||Z.dispose(),(A=r.roughnessMap)===null||A===void 0||A.dispose(),r.dispose()})}}},794:function(v,c,o){o.d(c,{U:function(){return u},v:function(){return s}});var s=function(a){for(var r=a.offsetLeft,n=a.offsetParent;n!==null;)r+=n.offsetLeft,n=n.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollLeft:f=document.documentElement.scrollLeft,r-f},u=function(a){for(var r=a.offsetTop,n=a.offsetParent;n!==null;)r+=n.offsetTop,n=n.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollTop:f=document.documentElement.scrollTop,r-f}},975:function(v,c,o){o.d(c,{Z:function(){return u}});function s(a){return Object.prototype.toString.call(a)==="[object Object]"}function u(a){if(s(a)===!1)return!1;var r=a.constructor;if(r===void 0)return!0;var n=r.prototype;return!(s(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)}},653:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(620);function u(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(f,_){n.resolve=f,n.reject=_}),a&&(n.promise=(0,s.Z)(n.promise,r)),n}},226:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-a)*Math.PI/180,f=(90-u)*Math.PI/180;return[r*Math.sin(n)*Math.cos(f),r*Math.cos(n),r*Math.sin(n)*Math.sin(f)]}},688:function(v,c,o){o.d(c,{Z:function(){return a}});var s=o(438),u=function(){"use strict";function r(f){(0,s.Z)(this,r),this.onTick_=f,this.cancelPending_=null}var n=r.prototype;return n.tickAfter=function(_){var d=this;this.stop();var g=!0,k;this.cancelPending_=function(){clearTimeout(k),g=!1};var L=function(){g&&d.onTick_()};return k=window.setTimeout(L,_),this},n.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},r}(),a=function(){"use strict";function r(f){(0,s.Z)(this,r),this.onTick_=f,this.ticker_=null}var n=r.prototype;return n.tickNow=function(){return this.stop(),this.onTick_(),this},n.tickAfter=function(_){var d=this;return this.stop(),this.ticker_=new u(function(){d.onTick_()}).tickAfter(_),this},n.tickEvery=function(_){var d=this;return this.stop(),this.ticker_=new u(function(){var g;(g=d.ticker_)===null||g===void 0||g.tickAfter(_),d.onTick_()}).tickAfter(_),this},n.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},r}()},620:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(42);function u(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a.then(function(n){return(0,s.Z)({err:null,res:n},r)}).catch(function(n){return(0,s.Z)({err:n,res:void 0},r)})}},977:function(v,c,o){o.d(c,{C:function(){return r},y:function(){return a}});var s=o(949),u=new Map,a=function(n){return{generateTopUV:function(f,_,d,g,k){var L=_[d*3],B=_[d*3+1],D=_[g*3],S=_[g*3+1],T=_[k*3],Z=_[k*3+1],A;if(u.has(f))A=u.get(f);else{var G=n&&n.Box3||new s.Box3;if(!n||!n.Box3){var K=f.parameters.shapes.getPoints();G.setFromArray(K.map(function(E){return[E.x,E.y,0]}).flat())}var I=G.getSize(new s.Vector3);A={box:G,size:I},u.set(f,A)}var j=A.box,w=A.size;return[new s.Vector2((L-j.min.x)/w.x,(B-j.min.y)/w.y),new s.Vector2((D-j.min.x)/w.x,(S-j.min.y)/w.y),new s.Vector2((T-j.min.x)/w.x,(Z-j.min.y)/w.y)]},generateSideWallUV:function(f,_,d,g,k,L){var B=_[d*3],D=_[d*3+1],S=_[d*3+2],T=_[g*3],Z=_[g*3+1],A=_[g*3+2],G=_[k*3],K=_[k*3+1],I=_[k*3+2],j=_[L*3],w=_[L*3+1],E=_[L*3+2],m;if(u.has(_))m=u.get(_);else{var h=new s.Box3;h.setFromArray(_);var O=h.getSize(new s.Vector3);m={box:h,size:O},u.set(_,m)}var y=m.box,b=m.size;return Math.abs(D-Z)<.01?[new s.Vector2((B-y.min.x)/b.x,(S-y.min.z)/b.z),new s.Vector2((T-y.min.x)/b.x,(A-y.min.z)/b.z),new s.Vector2((G-y.min.x)/b.x,(I-y.min.z)/b.z),new s.Vector2((j-y.min.x)/b.x,(E-y.min.z)/b.z)]:[new s.Vector2((D-y.min.y)/b.x,(S-y.min.z)/b.z),new s.Vector2((Z-y.min.y)/b.x,(A-y.min.z)/b.z),new s.Vector2((K-y.min.y)/b.x,(I-y.min.z)/b.z),new s.Vector2((w-y.min.y)/b.x,(E-y.min.z)/b.z)]}}},r=function(){u.clear()}},949:function(v,c,o){var s=a=>{var r={};return o.d(r,a),r},u=a=>()=>a;v.exports=s({Box3:()=>F.Box3,Vector2:()=>F.Vector2,Vector3:()=>F.Vector3,sRGBEncoding:()=>F.sRGBEncoding})},943:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){(a==null||a>u.length)&&(a=u.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=u[r];return n}},982:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(943);function u(a){if(Array.isArray(a))return(0,s.Z)(a)}},568:function(v,c,o){o.d(c,{Z:function(){return u}});function s(a,r,n,f,_,d,g){try{var k=a[d](g),L=k.value}catch(B){n(B);return}k.done?r(L):Promise.resolve(L).then(f,_)}function u(a){return function(){var r=this,n=arguments;return new Promise(function(f,_){var d=a.apply(r,n);function g(L){s(d,f,_,g,k,"next",L)}function k(L){s(d,f,_,g,k,"throw",L)}g(void 0)})}}},438:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){if(!(u instanceof a))throw new TypeError("Cannot call a class as a function")}},924:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a,r){return a in u?Object.defineProperty(u,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):u[a]=r,u}},375:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}},270:function(v,c,o){o.d(c,{Z:function(){return s}});function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},42:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(924);function u(a){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{},f=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(f=f.concat(Object.getOwnPropertySymbols(n).filter(function(_){return Object.getOwnPropertyDescriptor(n,_).enumerable}))),f.forEach(function(_){(0,s.Z)(a,_,n[_])})}return a}},342:function(v,c,o){o.d(c,{Z:function(){return n}});var s=o(982),u=o(375),a=o(270),r=o(566);function n(f){return(0,s.Z)(f)||(0,u.Z)(f)||(0,r.Z)(f)||(0,a.Z)()}},566:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(943);function u(a,r){if(!!a){if(typeof a=="string")return(0,s.Z)(a,r);var n=Object.prototype.toString.call(a).slice(8,-1);if(n==="Object"&&a.constructor&&(n=a.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return(0,s.Z)(a,r)}}}},H={};function P(v){var c=H[v];if(c!==void 0)return c.exports;var o=H[v]={exports:{}};return Q[v](o,o.exports,P),o.exports}(function(){P.n=function(v){var c=v&&v.__esModule?function(){return v.default}:function(){return v};return P.d(c,{a:c}),c}})(),function(){P.d=function(v,c){for(var o in c)P.o(c,o)&&!P.o(v,o)&&Object.defineProperty(v,o,{enumerable:!0,get:c[o]})}}(),function(){P.o=function(v,c){return Object.prototype.hasOwnProperty.call(v,c)}}();var x={};(function(){P.d(x,{qo:function(){return _},B7:function(){return o.Z},CL:function(){return j.C},eK:function(){return G},LK:function(){return A},ZL:function(){return L},wf:function(){return g.Z},lJ:function(){return K},vP:function(){return I.v},Up:function(){return I.U},y_:function(){return j.y},PO:function(){return B.Z},Mf:function(){return v.Z},Rl:function(){return d.Z},to:function(){return c.Z}});var v=P(653),c=P(620),o=P(688),s=P(568),u=P(438),a=P(42),r=P(342),n=P(666),f=P.n(n),_=function(){"use strict";function w(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,u.Z)(this,w),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,a.Z)({},{isdev:!1},m)}var E=w.prototype;return E.start=function(){return this.isPlaying?this:(this.index=0,this.isPlaying=!0,this.play())},E.stop1=function(){return this.isPlaying?(this.isPlaying=!1,this.repeatCount=0,this):this},E.stop=function(){return this.traverse(function(h){return h.stop1()}),this},E.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},E.play=function(){var h=this;return(0,s.Z)(f().mark(function O(){var y;return f().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(y=h.chainedList[h.index],!(y&&h.isPlaying)){M.next=9;break}return M.next=4,Promise.all(y.map(function(W){return typeof W=="function"?W(h.repeatCount):W.start()}));case 4:return h.index+=1,M.next=7,h.play();case 7:M.next=17;break;case 9:if(!(!y&&h.isPlaying&&h.repeatCount<h.repeatNum)){M.next=16;break}return h.repeatCount+=1,h.index=0,M.next=14,h.play();case 14:M.next=17;break;case 16:!y&&h.isPlaying&&h.repeatCount===h.repeatNum&&h.stop();case 17:case"end":return M.stop()}},O)}))()},E.chain=function(){for(var h=arguments.length,O=new Array(h),y=0;y<h;y++)O[y]=arguments[y];var b=this;return(0,r.Z)(O).forEach(function(M){M instanceof w&&b.children.push(M)}),this.chainedList.push((0,r.Z)(O)),this},E.repeat=function(h){return this.repeatNum=h,this},E.timeout=function(h){return this.chain(function(){return new Promise(function(O){return setTimeout(O,h)})}),this},E.traverse=function(h){h(this),this.children.forEach(function(O){O.traverse(h)})},w}(),d=P(226),g=P(182),k=P(949);function L(w){if(w.material){var E=Array.isArray(w.material)?w.material:[w.material];E.forEach(function(m){var h,O;(h=m.color)===null||h===void 0||h.convertSRGBToLinear(),(O=m.emissive)===null||O===void 0||O.convertSRGBToLinear(),m.map&&(m.map.encoding=k.sRGBEncoding),m.emissiveMap&&(m.emissiveMap.encoding=k.sRGBEncoding)})}}var B=P(975),D=P(924),S=w=>{var E={};return P.d(E,w),E},T=w=>()=>w,Z=S({clear:()=>Y.clear,del:()=>Y.del,get:()=>Y.get,set:()=>Y.set}),A=Z.del,G=Z.clear,K=function(){var w=(0,s.Z)(f().mark(function E(m,h){var O,y,b,M,W,X;return f().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return O=h.version,t.next=4,(0,Z.get)(m);case 4:if(b=t.sent,!(b&&b[O])){t.next=9;break}y=b[O],t.next=15;break;case 9:return t.next=11,(0,c.Z)(fetch(m).then(function(i){if(i.ok)return i.blob();throw new Error}));case 11:M=t.sent,W=M.res,X=M.err,X||(y=W,(0,Z.set)(m,(0,D.Z)({},O,W)));case 15:return t.abrupt("return",y?{url:URL.createObjectURL(y)}:{url:m});case 16:case"end":return t.stop()}},E)}));return function(m,h){return w.apply(this,arguments)}}(),I=P(794),j=P(977)})();var q=x.qo,tt=x.B7,et=x.CL,rt=x.eK,nt=x.LK,ot=x.ZL,at=x.wf,it=x.lJ,ut=x.vP,st=x.Up,ct=x.y_,ft=x.PO,_t=x.Mf,lt=x.Rl,pt=x.to;export{q as Chain,tt as Timer,et as claerUVGenerator,rt as clearAllCache,nt as clearCache,ot as colorCorrection,at as disposeMesh,it as getCache,ut as getElementViewLeft,st as getElementViewTop,ct as getUVGenerator,ft as isPlainObject,_t as makePromiseCreator,lt as polar2Cartesian,pt as to};
1
+ import*as F from"three";import*as Y from"idb-keyval";var Q={666:function(v){var c=function(o){"use strict";var s=Object.prototype,u=s.hasOwnProperty,a,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",f=r.asyncIterator||"@@asyncIterator",_=r.toStringTag||"@@toStringTag";function d(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(t,i,p){return t[i]=p}}function g(e,t,i,p){var l=t&&t.prototype instanceof Z?t:Z,C=Object.create(l.prototype),V=new M(p||[]);return C._invoke=h(e,i,V),C}o.wrap=g;function k(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(p){return{type:"throw",arg:p}}}var L="suspendedStart",D="suspendedYield",R="executing",S="completed",T={};function Z(){}function A(){}function G(){}var K={};d(K,n,function(){return this});var I=Object.getPrototypeOf,j=I&&I(I(W([])));j&&j!==s&&u.call(j,n)&&(K=j);var w=G.prototype=Z.prototype=Object.create(K);A.prototype=G,d(w,"constructor",G),d(G,"constructor",A),A.displayName=d(G,_,"GeneratorFunction");function E(e){["next","throw","return"].forEach(function(t){d(e,t,function(i){return this._invoke(t,i)})})}o.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===A||(t.displayName||t.name)==="GeneratorFunction":!1},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,G):(e.__proto__=G,d(e,_,"GeneratorFunction")),e.prototype=Object.create(w),e},o.awrap=function(e){return{__await:e}};function m(e,t){function i(C,V,U,B){var z=k(e[C],e,V);if(z.type==="throw")B(z.arg);else{var J=z.arg,$=J.value;return $&&typeof $=="object"&&u.call($,"__await")?t.resolve($.__await).then(function(N){i("next",N,U,B)},function(N){i("throw",N,U,B)}):t.resolve($).then(function(N){J.value=N,U(J)},function(N){return i("throw",N,U,B)})}}var p;function l(C,V){function U(){return new t(function(B,z){i(C,V,B,z)})}return p=p?p.then(U,U):U()}this._invoke=l}E(m.prototype),d(m.prototype,f,function(){return this}),o.AsyncIterator=m,o.async=function(e,t,i,p,l){l===void 0&&(l=Promise);var C=new m(g(e,t,i,p),l);return o.isGeneratorFunction(t)?C:C.next().then(function(V){return V.done?V.value:C.next()})};function h(e,t,i){var p=L;return function(C,V){if(p===R)throw new Error("Generator is already running");if(p===S){if(C==="throw")throw V;return X()}for(i.method=C,i.arg=V;;){var U=i.delegate;if(U){var B=O(U,i);if(B){if(B===T)continue;return B}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(p===L)throw p=S,i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);p=R;var z=k(e,t,i);if(z.type==="normal"){if(p=i.done?S:D,z.arg===T)continue;return{value:z.arg,done:i.done}}else z.type==="throw"&&(p=S,i.method="throw",i.arg=z.arg)}}}function O(e,t){var i=e.iterator[t.method];if(i===a){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=a,O(e,t),t.method==="throw"))return T;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var p=k(i,e.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,T;var l=p.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,T;if(l.done)t[e.resultName]=l.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=a);else return l;return t.delegate=null,T}E(w),d(w,_,"Generator"),d(w,n,function(){return this}),d(w,"toString",function(){return"[object Generator]"});function y(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function b(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(y,this),this.reset(!0)}o.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function p(){for(;t.length;){var l=t.pop();if(l in e)return p.value=l,p.done=!1,p}return p.done=!0,p}};function W(e){if(e){var t=e[n];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var i=-1,p=function l(){for(;++i<e.length;)if(u.call(e,i))return l.value=e[i],l.done=!1,l;return l.value=a,l.done=!0,l};return p.next=p}}return{next:X}}o.values=W;function X(){return{value:a,done:!0}}return M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(b),!e)for(var t in this)t.charAt(0)==="t"&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=a)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(B,z){return C.type="throw",C.arg=e,t.next=B,z&&(t.method="next",t.arg=a),!!z}for(var p=this.tryEntries.length-1;p>=0;--p){var l=this.tryEntries[p],C=l.completion;if(l.tryLoc==="root")return i("end");if(l.tryLoc<=this.prev){var V=u.call(l,"catchLoc"),U=u.call(l,"finallyLoc");if(V&&U){if(this.prev<l.catchLoc)return i(l.catchLoc,!0);if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else if(V){if(this.prev<l.catchLoc)return i(l.catchLoc,!0)}else if(U){if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var p=this.tryEntries[i];if(p.tryLoc<=this.prev&&u.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var l=p;break}}l&&(e==="break"||e==="continue")&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var C=l?l.completion:{};return C.type=e,C.arg=t,l?(this.method="next",this.next=l.finallyLoc,T):this.complete(C)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),T},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),b(i),T}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var p=i.completion;if(p.type==="throw"){var l=p.arg;b(i)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:W(e),resultName:t,nextLoc:i},this.method==="next"&&(this.arg=a),T}},o}(v.exports);try{regeneratorRuntime=c}catch(o){typeof globalThis=="object"?globalThis.regeneratorRuntime=c:Function("r","regeneratorRuntime = r")(c)}},182:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u){if(u.geometry&&u.geometry.dispose(),u.material){var a=Array.isArray(u.material)?u.material:[u.material];a.forEach(function(r){var n,f,_,d,g,k,L,D,R,S,T,Z,A;(n=r.map)===null||n===void 0||n.dispose(),(f=r.lightMap)===null||f===void 0||f.dispose(),(_=r.bumpMap)===null||_===void 0||_.dispose(),(d=r.normalMap)===null||d===void 0||d.dispose(),(g=r.specularMap)===null||g===void 0||g.dispose(),(k=r.envMap)===null||k===void 0||k.dispose(),(L=r.alphaMap)===null||L===void 0||L.dispose(),(D=r.aoMap)===null||D===void 0||D.dispose(),(R=r.displacementMap)===null||R===void 0||R.dispose(),(S=r.emissiveMap)===null||S===void 0||S.dispose(),(T=r.gradientMap)===null||T===void 0||T.dispose(),(Z=r.metalnessMap)===null||Z===void 0||Z.dispose(),(A=r.roughnessMap)===null||A===void 0||A.dispose(),r.dispose()})}}},794:function(v,c,o){o.d(c,{U:function(){return u},v:function(){return s}});var s=function(a){for(var r=a.offsetLeft,n=a.offsetParent;n!==null;)r+=n.offsetLeft,n=n.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollLeft:f=document.documentElement.scrollLeft,r-f},u=function(a){for(var r=a.offsetTop,n=a.offsetParent;n!==null;)r+=n.offsetTop,n=n.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollTop:f=document.documentElement.scrollTop,r-f}},975:function(v,c,o){o.d(c,{Z:function(){return u}});function s(a){return Object.prototype.toString.call(a)==="[object Object]"}function u(a){if(s(a)===!1)return!1;var r=a.constructor;if(r===void 0)return!0;var n=r.prototype;return!(s(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)}},653:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(620);function u(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(f,_){n.resolve=f,n.reject=_}),a&&(n.promise=(0,s.Z)(n.promise,r)),n}},226:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-a)*Math.PI/180,f=(90-u)*Math.PI/180;return[r*Math.sin(n)*Math.cos(f),r*Math.cos(n),r*Math.sin(n)*Math.sin(f)]}},688:function(v,c,o){o.d(c,{Z:function(){return a}});var s=o(438),u=function(){"use strict";function r(f){(0,s.Z)(this,r),this.onTick_=f,this.cancelPending_=null}var n=r.prototype;return n.tickAfter=function(_){var d=this;this.stop();var g=!0,k;this.cancelPending_=function(){clearTimeout(k),g=!1};var L=function(){g&&d.onTick_()};return k=window.setTimeout(L,_),this},n.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},r}(),a=function(){"use strict";function r(f){(0,s.Z)(this,r),this.onTick_=f,this.ticker_=null}var n=r.prototype;return n.tickNow=function(){return this.stop(),this.onTick_(),this},n.tickAfter=function(_){var d=this;return this.stop(),this.ticker_=new u(function(){d.onTick_()}).tickAfter(_),this},n.tickEvery=function(_){var d=this;return this.stop(),this.ticker_=new u(function(){var g;(g=d.ticker_)===null||g===void 0||g.tickAfter(_),d.onTick_()}).tickAfter(_),this},n.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},r}()},620:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(42);function u(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a.then(function(n){return(0,s.Z)({err:null,res:n},r)}).catch(function(n){return(0,s.Z)({err:n,res:void 0},r)})}},977:function(v,c,o){o.d(c,{C:function(){return r},y:function(){return a}});var s=o(949),u=new Map,a=function(n){return{generateTopUV:function(f,_,d,g,k){var L=_[d*3],D=_[d*3+1],R=_[g*3],S=_[g*3+1],T=_[k*3],Z=_[k*3+1],A;if(u.has(f))A=u.get(f);else{var G=n&&n.box3||new s.Box3;if(!n||!n.box3){var K=f.parameters.shapes.getPoints();G.setFromArray(K.map(function(E){return[E.x,E.y,0]}).flat())}var I=G.getSize(new s.Vector3);A={box:G,size:I},u.set(f,A)}var j=A.box,w=A.size;return[new s.Vector2((L-j.min.x)/w.x,(D-j.min.y)/w.y),new s.Vector2((R-j.min.x)/w.x,(S-j.min.y)/w.y),new s.Vector2((T-j.min.x)/w.x,(Z-j.min.y)/w.y)]},generateSideWallUV:function(f,_,d,g,k,L){var D=_[d*3],R=_[d*3+1],S=_[d*3+2],T=_[g*3],Z=_[g*3+1],A=_[g*3+2],G=_[k*3],K=_[k*3+1],I=_[k*3+2],j=_[L*3],w=_[L*3+1],E=_[L*3+2],m;if(u.has(_))m=u.get(_);else{var h=new s.Box3;h.setFromArray(_);var O=h.getSize(new s.Vector3);m={box:h,size:O},u.set(_,m)}var y=m.box,b=m.size;return Math.abs(R-Z)<.01?[new s.Vector2((D-y.min.x)/b.x,(S-y.min.z)/b.z),new s.Vector2((T-y.min.x)/b.x,(A-y.min.z)/b.z),new s.Vector2((G-y.min.x)/b.x,(I-y.min.z)/b.z),new s.Vector2((j-y.min.x)/b.x,(E-y.min.z)/b.z)]:[new s.Vector2((R-y.min.y)/b.x,(S-y.min.z)/b.z),new s.Vector2((Z-y.min.y)/b.x,(A-y.min.z)/b.z),new s.Vector2((K-y.min.y)/b.x,(I-y.min.z)/b.z),new s.Vector2((w-y.min.y)/b.x,(E-y.min.z)/b.z)]}}},r=function(){u.clear()}},949:function(v,c,o){var s=a=>{var r={};return o.d(r,a),r},u=a=>()=>a;v.exports=s({Box3:()=>F.Box3,Vector2:()=>F.Vector2,Vector3:()=>F.Vector3,sRGBEncoding:()=>F.sRGBEncoding})},943:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){(a==null||a>u.length)&&(a=u.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=u[r];return n}},982:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(943);function u(a){if(Array.isArray(a))return(0,s.Z)(a)}},568:function(v,c,o){o.d(c,{Z:function(){return u}});function s(a,r,n,f,_,d,g){try{var k=a[d](g),L=k.value}catch(D){n(D);return}k.done?r(L):Promise.resolve(L).then(f,_)}function u(a){return function(){var r=this,n=arguments;return new Promise(function(f,_){var d=a.apply(r,n);function g(L){s(d,f,_,g,k,"next",L)}function k(L){s(d,f,_,g,k,"throw",L)}g(void 0)})}}},438:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){if(!(u instanceof a))throw new TypeError("Cannot call a class as a function")}},924:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a,r){return a in u?Object.defineProperty(u,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):u[a]=r,u}},375:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}},270:function(v,c,o){o.d(c,{Z:function(){return s}});function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},42:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(924);function u(a){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{},f=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(f=f.concat(Object.getOwnPropertySymbols(n).filter(function(_){return Object.getOwnPropertyDescriptor(n,_).enumerable}))),f.forEach(function(_){(0,s.Z)(a,_,n[_])})}return a}},342:function(v,c,o){o.d(c,{Z:function(){return n}});var s=o(982),u=o(375),a=o(270),r=o(566);function n(f){return(0,s.Z)(f)||(0,u.Z)(f)||(0,r.Z)(f)||(0,a.Z)()}},566:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(943);function u(a,r){if(!!a){if(typeof a=="string")return(0,s.Z)(a,r);var n=Object.prototype.toString.call(a).slice(8,-1);if(n==="Object"&&a.constructor&&(n=a.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return(0,s.Z)(a,r)}}}},H={};function P(v){var c=H[v];if(c!==void 0)return c.exports;var o=H[v]={exports:{}};return Q[v](o,o.exports,P),o.exports}(function(){P.n=function(v){var c=v&&v.__esModule?function(){return v.default}:function(){return v};return P.d(c,{a:c}),c}})(),function(){P.d=function(v,c){for(var o in c)P.o(c,o)&&!P.o(v,o)&&Object.defineProperty(v,o,{enumerable:!0,get:c[o]})}}(),function(){P.o=function(v,c){return Object.prototype.hasOwnProperty.call(v,c)}}();var x={};(function(){P.d(x,{qo:function(){return _},B7:function(){return o.Z},CL:function(){return j.C},eK:function(){return G},LK:function(){return A},ZL:function(){return L},wf:function(){return g.Z},lJ:function(){return K},vP:function(){return I.v},Up:function(){return I.U},y_:function(){return j.y},PO:function(){return D.Z},Mf:function(){return v.Z},Rl:function(){return d.Z},to:function(){return c.Z}});var v=P(653),c=P(620),o=P(688),s=P(568),u=P(438),a=P(42),r=P(342),n=P(666),f=P.n(n),_=function(){"use strict";function w(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,u.Z)(this,w),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,a.Z)({},{isdev:!1},m)}var E=w.prototype;return E.start=function(){return this.isPlaying?this:(this.index=0,this.isPlaying=!0,this.play())},E.stop1=function(){return this.isPlaying?(this.isPlaying=!1,this.repeatCount=0,this):this},E.stop=function(){return this.traverse(function(h){return h.stop1()}),this},E.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},E.play=function(){var h=this;return(0,s.Z)(f().mark(function O(){var y;return f().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(y=h.chainedList[h.index],!(y&&h.isPlaying)){M.next=9;break}return M.next=4,Promise.all(y.map(function(W){return typeof W=="function"?W(h.repeatCount):W.start()}));case 4:return h.index+=1,M.next=7,h.play();case 7:M.next=17;break;case 9:if(!(!y&&h.isPlaying&&h.repeatCount<h.repeatNum)){M.next=16;break}return h.repeatCount+=1,h.index=0,M.next=14,h.play();case 14:M.next=17;break;case 16:!y&&h.isPlaying&&h.repeatCount===h.repeatNum&&h.stop();case 17:case"end":return M.stop()}},O)}))()},E.chain=function(){for(var h=arguments.length,O=new Array(h),y=0;y<h;y++)O[y]=arguments[y];var b=this;return(0,r.Z)(O).forEach(function(M){M instanceof w&&b.children.push(M)}),this.chainedList.push((0,r.Z)(O)),this},E.repeat=function(h){return this.repeatNum=h,this},E.timeout=function(h){return this.chain(function(){return new Promise(function(O){return setTimeout(O,h)})}),this},E.traverse=function(h){h(this),this.children.forEach(function(O){O.traverse(h)})},w}(),d=P(226),g=P(182),k=P(949);function L(w){if(w.material){var E=Array.isArray(w.material)?w.material:[w.material];E.forEach(function(m){var h,O;(h=m.color)===null||h===void 0||h.convertSRGBToLinear(),(O=m.emissive)===null||O===void 0||O.convertSRGBToLinear(),m.map&&(m.map.encoding=k.sRGBEncoding),m.emissiveMap&&(m.emissiveMap.encoding=k.sRGBEncoding)})}}var D=P(975),R=P(924),S=w=>{var E={};return P.d(E,w),E},T=w=>()=>w,Z=S({clear:()=>Y.clear,del:()=>Y.del,get:()=>Y.get,set:()=>Y.set}),A=Z.del,G=Z.clear,K=function(){var w=(0,s.Z)(f().mark(function E(m,h){var O,y,b,M,W,X;return f().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return O=h.version,t.next=4,(0,Z.get)(m);case 4:if(b=t.sent,!(b&&b[O])){t.next=9;break}y=b[O],t.next=15;break;case 9:return t.next=11,(0,c.Z)(fetch(m).then(function(i){if(i.ok)return i.blob();throw new Error}));case 11:M=t.sent,W=M.res,X=M.err,X||(y=W,(0,Z.set)(m,(0,R.Z)({},O,W)));case 15:return t.abrupt("return",y?{url:URL.createObjectURL(y)}:{url:m});case 16:case"end":return t.stop()}},E)}));return function(m,h){return w.apply(this,arguments)}}(),I=P(794),j=P(977)})();var q=x.qo,tt=x.B7,et=x.CL,rt=x.eK,nt=x.LK,ot=x.ZL,at=x.wf,it=x.lJ,ut=x.vP,st=x.Up,ct=x.y_,ft=x.PO,_t=x.Mf,lt=x.Rl,pt=x.to;export{q as Chain,tt as Timer,et as claerUVGenerator,rt as clearAllCache,nt as clearCache,ot as colorCorrection,at as disposeMesh,it as getCache,ut as getElementViewLeft,st as getElementViewTop,ct as getUVGenerator,ft as isPlainObject,_t as makePromiseCreator,lt as polar2Cartesian,pt as to};
@@ -1,6 +1,6 @@
1
1
  import * as THREE from 'three';
2
2
  export declare const getUVGenerator: (options?: {
3
- Box3?: THREE.Box3;
3
+ box3?: THREE.Box3;
4
4
  }) => {
5
5
  generateTopUV(geometry: any, vertices: number[], indexA: number, indexB: number, indexC: number): THREE.Vector2[];
6
6
  generateSideWallUV(geometry: any, vertices: number[], indexA: number, indexB: number, indexC: number, indexD: number): THREE.Vector2[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gl-draw",
3
- "version": "0.1.5",
3
+ "version": "0.1.8",
4
4
  "author": "gitplus <hstits@gmail.com>",
5
5
  "scripts": {
6
6
  "start": "PORT=3002 bundler-dev",