gl-draw 0.0.17 → 0.0.18
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.
package/dist/objects/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var Me={666:function(A){var C=function(b){"use strict";var R=Object.prototype,M=R.hasOwnProperty,T,S=typeof Symbol=="function"?Symbol:{},z=S.iterator||"@@iterator",Z=S.asyncIterator||"@@asyncIterator",E=S.toStringTag||"@@toStringTag";function L(c,s,f){return Object.defineProperty(c,s,{value:f,enumerable:!0,configurable:!0,writable:!0}),c[s]}try{L({},"")}catch(c){L=function(s,f,d){return s[f]=d}}function $(c,s,f,d){var m=s&&s.prototype instanceof x?s:x,k=Object.create(m.prototype),Y=new de(d||[]);return k._invoke=J(c,f,Y),k}b.wrap=$;function H(c,s,f){try{return{type:"normal",arg:c.call(s,f)}}catch(d){return{type:"throw",arg:d}}}var G="suspendedStart",l="suspendedYield",ie="executing",U="completed",B={};function x(){}function V(){}function D(){}var q={};L(q,z,function(){return this});var ee=Object.getPrototypeOf,te=ee&&ee(ee(ce([])));te&&te!==R&&M.call(te,z)&&(q=te);var Q=D.prototype=x.prototype=Object.create(q);V.prototype=D,L(Q,"constructor",D),L(D,"constructor",V),V.displayName=L(D,E,"GeneratorFunction");function re(c){["next","throw","return"].forEach(function(s){L(c,s,function(f){return this._invoke(s,f)})})}b.isGeneratorFunction=function(c){var s=typeof c=="function"&&c.constructor;return s?s===V||(s.displayName||s.name)==="GeneratorFunction":!1},b.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,D):(c.__proto__=D,L(c,E,"GeneratorFunction")),c.prototype=Object.create(Q),c},b.awrap=function(c){return{__await:c}};function oe(c,s){function f(k,Y,K,X){var I=H(c[k],c,Y);if(I.type==="throw")X(I.arg);else{var me=I.arg,ue=me.value;return ue&&typeof ue=="object"&&M.call(ue,"__await")?s.resolve(ue.__await).then(function(ae){f("next",ae,K,X)},function(ae){f("throw",ae,K,X)}):s.resolve(ue).then(function(ae){me.value=ae,K(me)},function(ae){return f("throw",ae,K,X)})}}var d;function m(k,Y){function K(){return new s(function(X,I){f(k,Y,X,I)})}return d=d?d.then(K,K):K()}this._invoke=m}re(oe.prototype),L(oe.prototype,Z,function(){return this}),b.AsyncIterator=oe,b.async=function(c,s,f,d,m){m===void 0&&(m=Promise);var k=new oe($(c,s,f,d),m);return b.isGeneratorFunction(s)?k:k.next().then(function(Y){return Y.done?Y.value:k.next()})};function J(c,s,f){var d=G;return function(k,Y){if(d===ie)throw new Error("Generator is already running");if(d===U){if(k==="throw")throw Y;return ye()}for(f.method=k,f.arg=Y;;){var K=f.delegate;if(K){var X=se(K,f);if(X){if(X===B)continue;return X}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(d===G)throw d=U,f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);d=ie;var I=H(c,s,f);if(I.type==="normal"){if(d=f.done?U:l,I.arg===B)continue;return{value:I.arg,done:f.done}}else I.type==="throw"&&(d=U,f.method="throw",f.arg=I.arg)}}}function se(c,s){var f=c.iterator[s.method];if(f===T){if(s.delegate=null,s.method==="throw"){if(c.iterator.return&&(s.method="return",s.arg=T,se(c,s),s.method==="throw"))return B;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return B}var d=H(f,c.iterator,s.arg);if(d.type==="throw")return s.method="throw",s.arg=d.arg,s.delegate=null,B;var m=d.arg;if(!m)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,B;if(m.done)s[c.resultName]=m.value,s.next=c.nextLoc,s.method!=="return"&&(s.method="next",s.arg=T);else return m;return s.delegate=null,B}re(Q),L(Q,E,"Generator"),L(Q,z,function(){return this}),L(Q,"toString",function(){return"[object Generator]"});function pe(c){var s={tryLoc:c[0]};1 in c&&(s.catchLoc=c[1]),2 in c&&(s.finallyLoc=c[2],s.afterLoc=c[3]),this.tryEntries.push(s)}function ve(c){var s=c.completion||{};s.type="normal",delete s.arg,c.completion=s}function de(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(pe,this),this.reset(!0)}b.keys=function(c){var s=[];for(var f in c)s.push(f);return s.reverse(),function d(){for(;s.length;){var m=s.pop();if(m in c)return d.value=m,d.done=!1,d}return d.done=!0,d}};function ce(c){if(c){var s=c[z];if(s)return s.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length)){var f=-1,d=function m(){for(;++f<c.length;)if(M.call(c,f))return m.value=c[f],m.done=!1,m;return m.value=T,m.done=!0,m};return d.next=d}}return{next:ye}}b.values=ce;function ye(){return{value:T,done:!0}}return de.prototype={constructor:de,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach(ve),!c)for(var s in this)s.charAt(0)==="t"&&M.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=T)},stop:function(){this.done=!0;var c=this.tryEntries[0],s=c.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var s=this;function f(X,I){return k.type="throw",k.arg=c,s.next=X,I&&(s.method="next",s.arg=T),!!I}for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d],k=m.completion;if(m.tryLoc==="root")return f("end");if(m.tryLoc<=this.prev){var Y=M.call(m,"catchLoc"),K=M.call(m,"finallyLoc");if(Y&&K){if(this.prev<m.catchLoc)return f(m.catchLoc,!0);if(this.prev<m.finallyLoc)return f(m.finallyLoc)}else if(Y){if(this.prev<m.catchLoc)return f(m.catchLoc,!0)}else if(K){if(this.prev<m.finallyLoc)return f(m.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(c,s){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&M.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var m=d;break}}m&&(c==="break"||c==="continue")&&m.tryLoc<=s&&s<=m.finallyLoc&&(m=null);var k=m?m.completion:{};return k.type=c,k.arg=s,m?(this.method="next",this.next=m.finallyLoc,B):this.complete(k)},complete:function(c,s){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&s&&(this.next=s),B},finish:function(c){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===c)return this.complete(f.completion,f.afterLoc),ve(f),B}},catch:function(c){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===c){var d=f.completion;if(d.type==="throw"){var m=d.arg;ve(f)}return m}}throw new Error("illegal catch attempt")},delegateYield:function(c,s,f){return this.delegate={iterator:ce(c),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=T),B}},b}(A.exports);try{regeneratorRuntime=C}catch(b){typeof globalThis=="object"?globalThis.regeneratorRuntime=C:Function("r","regeneratorRuntime = r")(C)}},695:function(A,C,b){"use strict";b.d(C,{Z:function(){return R}});function R(M){if(M.geometry&&M.geometry.dispose(),M.material){var T=Array.isArray(M.material)?M.material:[M.material];T.forEach(function(S){var z,Z,E,L,$,H,G,l,ie,U,B,x,V;(z=S.map)===null||z===void 0||z.dispose(),(Z=S.lightMap)===null||Z===void 0||Z.dispose(),(E=S.bumpMap)===null||E===void 0||E.dispose(),(L=S.normalMap)===null||L===void 0||L.dispose(),($=S.specularMap)===null||$===void 0||$.dispose(),(H=S.envMap)===null||H===void 0||H.dispose(),(G=S.alphaMap)===null||G===void 0||G.dispose(),(l=S.aoMap)===null||l===void 0||l.dispose(),(ie=S.displacementMap)===null||ie===void 0||ie.dispose(),(U=S.emissiveMap)===null||U===void 0||U.dispose(),(B=S.gradientMap)===null||B===void 0||B.dispose(),(x=S.metalnessMap)===null||x===void 0||x.dispose(),(V=S.roughnessMap)===null||V===void 0||V.dispose(),S.dispose()})}}},519:function(A,C,b){"use strict";b.d(C,{disposeMesh:function(){return S.Z}});var R=b(666),M=b.n(R),T=null,S=b(695),z=b(644);function Z(U){if(U.material){var B=Array.isArray(U.material)?U.material:[U.material];B.forEach(function(x){var V,D;(V=x.color)===null||V===void 0||V.convertSRGBToLinear(),(D=x.emissive)===null||D===void 0||D.convertSRGBToLinear(),x.map&&(x.map.encoding=THREE.sRGBEncoding),x.emissiveMap&&(x.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=b(568),L=b(924),$=require("idb-keyval"),H=b(484),G=null,l=null,ie=function(){var U=(0,E.Z)(M().mark(function B(x,V){var D,q,ee,te,Q,re;return M().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return D=V.version,J.next=4,(0,$.get)(x);case 4:if(ee=J.sent,!(ee&&ee[D])){J.next=9;break}q=ee[D],J.next=15;break;case 9:return J.next=11,(0,H.Z)(fetch(x).then(function(se){if(se.ok)return se.blob();throw new Error}));case 11:te=J.sent,Q=te.res,re=te.err,re||(q=Q,(0,$.set)(x,(0,L.Z)({},D,Q)));case 15:return J.abrupt("return",q?{url:URL.createObjectURL(q)}:{url:x});case 16:case"end":return J.stop()}},B)}));return function(x,V){return U.apply(this,arguments)}}()},484:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});var R=b(42);function M(T){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.then(function(z){return(0,R.Z)({err:null,res:z},S)}).catch(function(z){return(0,R.Z)({err:z,res:void 0},S)})}},644:function(A){"use strict";A.exports=require("three")},568:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});function R(T,S,z,Z,E,L,$){try{var H=T[L]($),G=H.value}catch(l){z(l);return}H.done?S(G):Promise.resolve(G).then(Z,E)}function M(T){return function(){var S=this,z=arguments;return new Promise(function(Z,E){var L=T.apply(S,z);function $(G){R(L,Z,E,$,H,"next",G)}function H(G){R(L,Z,E,$,H,"throw",G)}$(void 0)})}}},924:function(A,C,b){"use strict";b.d(C,{Z:function(){return R}});function R(M,T,S){return T in M?Object.defineProperty(M,T,{value:S,enumerable:!0,configurable:!0,writable:!0}):M[T]=S,M}},42:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});var R=b(924);function M(T){for(var S=1;S<arguments.length;S++){var z=arguments[S]!=null?arguments[S]:{},Z=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(z).filter(function(E){return Object.getOwnPropertyDescriptor(z,E).enumerable}))),Z.forEach(function(E){(0,R.Z)(T,E,z[E])})}return T}}},Se={};function N(A){var C=Se[A];if(C!==void 0)return C.exports;var b=Se[A]={exports:{}};return Me[A](b,b.exports,N),b.exports}(function(){N.n=function(A){var C=A&&A.__esModule?function(){return A.default}:function(){return A};return N.d(C,{a:C}),C}})(),function(){N.d=function(A,C){for(var b in C)N.o(C,b)&&!N.o(A,b)&&Object.defineProperty(A,b,{enumerable:!0,get:C[b]})}}(),function(){N.o=function(A,C){return Object.prototype.hasOwnProperty.call(A,C)}}(),function(){N.r=function(A){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})}}();var be={};(function(){"use strict";N.r(be),N.d(be,{Image:function(){return Y},Line:function(){return Le},MeshLine:function(){return ne},MeshLineMaterial:function(){return we},MeshLineRaycast:function(){return Ae},Node:function(){return ae},Text:function(){return f},Video:function(){return me}});function A(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function C(t,a){return C=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},C(t,a)}function b(t,a){return C(t,a)}function R(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&b(t,a)}var M=N(42);function T(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);a&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function S(t,a){return a=a!=null?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):T(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}),t}function z(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(t)}function E(t){return Z(t)}function L(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $(t){return t&&t.constructor===Symbol?"symbol":typeof t}function H(t,a){return a&&($(a)==="object"||typeof a=="function")?a:L(t)}function G(t){var a=z();return function(){var n=E(t),i;if(a){var e=E(this).constructor;i=Reflect.construct(n,arguments,e)}else i=n.apply(this,arguments);return H(this,i)}}var l=N(644);function ie(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function U(t,a,r){return ie()?U=Reflect.construct:U=function(i,e,o){var u=[null];u.push.apply(u,e);var h=Function.bind.apply(i,u),p=new h;return o&&b(p,o.prototype),p},U.apply(null,arguments)}function B(t,a,r){return U.apply(null,arguments)}function x(t,a){for(var r=0;r<a.length;r++){var n=a[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function V(t,a,r){return a&&x(t.prototype,a),r&&x(t,r),t}function D(t,a){(a==null||a>t.length)&&(a=t.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=t[r];return n}function q(t){if(Array.isArray(t))return D(t)}function ee(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function te(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Q(t,a){if(!!t){if(typeof t=="string")return D(t,a);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return D(t,a)}}function re(t){return q(t)||ee(t)||Q(t)||te()}var oe=N(484);function J(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,i){r.resolve=n,r.reject=i}),t&&(r.promise=(0,oe.Z)(r.promise,a)),r}var se=require("@tweenjs/tween.js"),pe=N.n(se),ve=function(){"use strict";function t(){A(this,t),this.guiParams={}}var a=t.prototype;return a.showGuiParams=function(n){var i=this;!n||Object.keys(this.guiParams).forEach(function(e){var o=n.addFolder(e),u=i.guiParams[e];Object.keys(u).forEach(function(h){var p=u[h],_=p.min,y=p.max,g=p.step,P=p.name,w=p.to,O=p.paramMap,v=p.items,F=p.value,W=p.target,ge=h.toLowerCase().indexOf("color")>-1,j,le=typeof F=="undefined"&&W,he=le?W():u[h],fe=le?h:"value";v?j=o.add(he,fe,v):ge?j=o.addColor(he,fe):j=o.add(he,fe),j=j.name(P||h),typeof _!="undefined"&&(j=j.min(_)),typeof y!="undefined"&&(j=j.max(y)),typeof g!="undefined"&&(j=j.step(g)),j=j.onChange(function(){i.setGuiTargetValue(e,h,he[fe],O)}),(w||le)&&j.listen()})})},a.setGuiTargetValue=function(n,i,e,o){var u=this.guiParams[n][i],h=u.onChange,p=u.target,_=u.value,y=i.toLowerCase().indexOf("color")>-1,g=typeof _=="undefined"&&p;if(p&&!g){var P=p();Array.isArray(P)||(P=[P]),P.forEach(function(w){if(!!w)if(y)try{w[o||i].set(e)}catch(O){i!=="color"&&!o&&console.warn("".concat(i," is not a color,set paramMap"))}else w[o||i]=e})}h&&h(e)},a.setGuiTargetValueByParams=function(){var n=this;Object.keys(this.guiParams).forEach(function(i){Object.keys(n.guiParams[i]).forEach(function(e){var o=n.guiParams[i][e];typeof o.value!="undefined"&&n.setGuiTargetValue(i,e,o.value,o.paramMap)})})},a.guiParamTween=function(n,i,e){var o=e.duration,u=o===void 0?0:o,h=this,p=this.guiParams[n][i],_=p.to,y=p.paramMap,g=y===void 0?"":y;return new(pe()).Tween(this.guiParams[n][i]).to({value:_},u).onUpdate(function(P){h.setGuiTargetValue(n,i,P.value,g)})},t}(),de=require("three/examples/jsm/renderers/CSS2DRenderer"),ce=require("three/examples/jsm/renderers/CSS3DRenderer"),ye=N(519),c=function(t){t&&((0,ye.disposeMesh)(t),t.children.forEach(function(a){a.userData.BaseObject_||c(a)}))},s=function(t){"use strict";R(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.objecttype__="BaseObject",e.userData={},e.pm=J(),e.visible=!1,e}var n=r.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,o){},n.resize=function(e,o){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=B(l.Mesh,re(o)),this},n.createGroup=function(){return this.object3d=new l.Group,this},n.createPoints=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=B(l.Points,re(o)),this},n.createCSS2DObject=function(e){return this.object3d=new de.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new ce.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new ce.CSS3DSprite(e),this},n.createSprite=function(e){return this.object3d=new l.Sprite(e),this},n.add=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).add.apply(h,re(o)),this},n.remove=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).remove.apply(h,re(o)),this},n.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(o){o.traverse(e)})},n.dispose=function(){c(this.object3d)},V(r,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),r}(ve),f=function(t){"use strict";R(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.width=0,e.options=(0,M.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},i),e}var n=r.prototype;return n.init=function(){var e=document.createElement("canvas");this.canvas=e},n.create=function(){var e=this.options,o=e.position,u=e.lookAt,h=e.sprite,p=e.text,_=e.sizeAttenuation;if(h){var y=new l.Sprite(new l.SpriteMaterial({transparent:!0,sizeAttenuation:_}));this.object3d=y}else{var g=new l.MeshBasicMaterial({side:l.DoubleSide,transparent:!0}),P=new l.PlaneGeometry(1,1,1,1);this.createMesh(P,g)}this.object3d.position.copy(o),u&&this.object3d.lookAt(u),this.setText(p)},n.setText=function(e,o){var u=(0,M.Z)(S((0,M.Z)({},this.options),{text:e}),o||{}),h=u.text,p=u.fontSize,_=u.fontFamily,y=u.fontWeight,g=u.flipX,P=u.scale,w=this.canvas;w.width=p*h.length*2,w.height=p;var O=w.getContext("2d");O.font="".concat(y," ").concat(p,"px/1 ").concat(_);var v=O.measureText(h).width;w.width=v,this.width=v,O=w.getContext("2d"),O.clearRect(0,0,w.width,w.height),g&&O.scale(-1,1),O.font="".concat(y," ").concat(p,"px/1 ").concat(_),O.textBaseline="middle",O.fillStyle="#ffffff",O.fillText(h,g?v*-1:0,w.height/2),O.restore();var F=new l.Texture(w);F.anisotropy=16,F.needsUpdate=!0;var W=this.object3d;W.material.map&&W.material.map.dispose(),W.material.map=F,W.material.needsUpdate=!0,W.scale.set(F.image.width*P,F.image.height*P,1)},r}(s),d=N(568),m=N(666),k=N.n(m),Y=function(t){"use strict";R(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=i,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,d.Z)(k().mark(function o(){var u,h,p,_,y,g,P,w,O,v;return k().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return u=e.options,h=u.transparent,p=u.blending,_=u.src,y=u.depthWrite,g=u.alphaTest,P=u.sprite,w=u.sizeAttenuation,W.next=3,new l.TextureLoader().loadAsync(_);case 3:return O=W.sent,v=P?new l.SpriteMaterial({map:O,transparent:h!=null?h:!1,blending:p!=null?p:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:g!=null?g:0,sizeAttenuation:w!=null?w:!0}):new l.MeshBasicMaterial({map:O,transparent:h!=null?h:!1,blending:p!=null?p:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:g!=null?g:0}),W.abrupt("return",v);case 6:case"end":return W.stop()}},o)}))()},n.create=function(){var e=this;return(0,d.Z)(k().mark(function o(){var u,h,p,_,y,g,P,w;return k().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,_=u.src,y=u.cache,g=u.sprite,!(y&&!y.get(_))){v.next=7;break}return y.init(_),v.next=5,e.getMaterial();case 5:P=v.sent,y.set(_,P);case 7:if(!y){v.next=13;break}return v.next=10,y.get(_);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.texture=w.map,g?e.createSprite(w):e.createMesh(new l.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(w.map.image.width*h,w.map.image.height*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},r}(s);function K(t,a){for(;!Object.prototype.hasOwnProperty.call(t,a)&&(t=E(t),t!==null););return t}function X(t,a,r){return typeof Reflect!="undefined"&&Reflect.get?X=Reflect.get:X=function(i,e,o){var u=K(i,e);if(!!u){var h=Object.getOwnPropertyDescriptor(u,e);return h.get?h.get.call(o||i):h.value}},X(t,a,r)}function I(t,a,r){return X(t,a,r)}var me=function(t){"use strict";R(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=(0,M.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,u=e.transparent,h=e.blending,p=e.depthWrite,_=e.format,y=e.autoPlay,g=e.loop,P=e.alphaTest,w=e.sprite,O=J(),v=document.createElement("video");return v.addEventListener("loadedmetadata",function(){var F=new l.VideoTexture(v);F.format=_!=null?_:l.RGBAFormat,F.needsUpdate=!0;var W=w?new l.SpriteMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0}):new l.MeshBasicMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0});O.resolve(W)},!1),v.src=o,v.muted=!0,v.autoplay=y,v.loop=g,v.preload="auto",O.promise},n.create=function(){var e=this;return(0,d.Z)(k().mark(function o(){var u,h,p,_,y,g,P,w;return k().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,_=u.src,y=u.cache,g=u.sprite,!(y&&!y.get(_))){v.next=7;break}return y.init(_),v.next=5,e.getMaterial();case 5:P=v.sent,y.set(_,P);case 7:if(!y){v.next=13;break}return v.next=10,y.get(_);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.video=w.map.image,g?e.createSprite(w):e.createMesh(new l.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(e.video.videoWidth*h,e.video.videoHeight*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),I(E(r.prototype),"dispose",this).call(this)},r}(s),ue=function(t){"use strict";R(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=(0,M.Z)({},i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,u=e.children,h=e.onClick,p=document.createElement("div");p.appendChild(u),this.createCSS2DObject(p),o&&this.object3d.position.copy(o),h&&p.addEventListener("click",h)},n.getMaterial=function(e){return(0,d.Z)(k().mark(function o(){var u,h,p,_;return k().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return u=document.createElement("canvas"),u.width=256,u.height=256,h=u.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),p=new l.CanvasTexture(u),_=new l.SpriteMaterial({map:p,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",_);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,u=o===void 0?!1:o,h=e.scale,p=h===void 0?new l.Vector3(1,1,1):h,_=e.position,y=_===void 0?new l.Vector3(0,0,0):_,g=e.cache,P=this;return(0,d.Z)(k().mark(function w(){var O,v,F,W;return k().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(O="node-create-pick-object",!(g&&!g.get(O))){j.next=7;break}return g.init(O),j.next=5,P.getMaterial(u);case 5:v=j.sent,g.set(O,v);case 7:if(!g){j.next=13;break}return j.next=10,g.get(O);case 10:j.t0=j.sent,j.next=16;break;case 13:return j.next=15,P.getMaterial(u);case 15:j.t0=j.sent;case 16:F=j.t0,W=new l.Sprite(F),W.scale.set(F.map.image.width*p.x,F.map.image.height*p.y,1),W.position.copy(y),P.add(W),P.pickObject=W;case 22:case"end":return j.stop()}},w)}))()},n.dispose=function(){var e=this.options.onClick;if(e){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",e)}I(E(r.prototype),"dispose",this).call(this)},r}(s),ae=ue,Oe=`
|
|
1
|
+
(function(){var Ae={666:function(S){var C=function(_){"use strict";var R=Object.prototype,A=R.hasOwnProperty,T,x=typeof Symbol=="function"?Symbol:{},z=x.iterator||"@@iterator",Z=x.asyncIterator||"@@asyncIterator",E=x.toStringTag||"@@toStringTag";function L(c,s,f){return Object.defineProperty(c,s,{value:f,enumerable:!0,configurable:!0,writable:!0}),c[s]}try{L({},"")}catch(c){L=function(s,f,d){return s[f]=d}}function $(c,s,f,d){var m=s&&s.prototype instanceof O?s:O,k=Object.create(m.prototype),Y=new de(d||[]);return k._invoke=J(c,f,Y),k}_.wrap=$;function H(c,s,f){try{return{type:"normal",arg:c.call(s,f)}}catch(d){return{type:"throw",arg:d}}}var G="suspendedStart",l="suspendedYield",ie="executing",U="completed",D={};function O(){}function V(){}function B(){}var q={};L(q,z,function(){return this});var ee=Object.getPrototypeOf,te=ee&&ee(ee(ce([])));te&&te!==R&&A.call(te,z)&&(q=te);var Q=B.prototype=O.prototype=Object.create(q);V.prototype=B,L(Q,"constructor",B),L(B,"constructor",V),V.displayName=L(B,E,"GeneratorFunction");function re(c){["next","throw","return"].forEach(function(s){L(c,s,function(f){return this._invoke(s,f)})})}_.isGeneratorFunction=function(c){var s=typeof c=="function"&&c.constructor;return s?s===V||(s.displayName||s.name)==="GeneratorFunction":!1},_.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,B):(c.__proto__=B,L(c,E,"GeneratorFunction")),c.prototype=Object.create(Q),c},_.awrap=function(c){return{__await:c}};function oe(c,s){function f(k,Y,K,X){var N=H(c[k],c,Y);if(N.type==="throw")X(N.arg);else{var me=N.arg,ue=me.value;return ue&&typeof ue=="object"&&A.call(ue,"__await")?s.resolve(ue.__await).then(function(ae){f("next",ae,K,X)},function(ae){f("throw",ae,K,X)}):s.resolve(ue).then(function(ae){me.value=ae,K(me)},function(ae){return f("throw",ae,K,X)})}}var d;function m(k,Y){function K(){return new s(function(X,N){f(k,Y,X,N)})}return d=d?d.then(K,K):K()}this._invoke=m}re(oe.prototype),L(oe.prototype,Z,function(){return this}),_.AsyncIterator=oe,_.async=function(c,s,f,d,m){m===void 0&&(m=Promise);var k=new oe($(c,s,f,d),m);return _.isGeneratorFunction(s)?k:k.next().then(function(Y){return Y.done?Y.value:k.next()})};function J(c,s,f){var d=G;return function(k,Y){if(d===ie)throw new Error("Generator is already running");if(d===U){if(k==="throw")throw Y;return ye()}for(f.method=k,f.arg=Y;;){var K=f.delegate;if(K){var X=se(K,f);if(X){if(X===D)continue;return X}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(d===G)throw d=U,f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);d=ie;var N=H(c,s,f);if(N.type==="normal"){if(d=f.done?U:l,N.arg===D)continue;return{value:N.arg,done:f.done}}else N.type==="throw"&&(d=U,f.method="throw",f.arg=N.arg)}}}function se(c,s){var f=c.iterator[s.method];if(f===T){if(s.delegate=null,s.method==="throw"){if(c.iterator.return&&(s.method="return",s.arg=T,se(c,s),s.method==="throw"))return D;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return D}var d=H(f,c.iterator,s.arg);if(d.type==="throw")return s.method="throw",s.arg=d.arg,s.delegate=null,D;var m=d.arg;if(!m)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,D;if(m.done)s[c.resultName]=m.value,s.next=c.nextLoc,s.method!=="return"&&(s.method="next",s.arg=T);else return m;return s.delegate=null,D}re(Q),L(Q,E,"Generator"),L(Q,z,function(){return this}),L(Q,"toString",function(){return"[object Generator]"});function pe(c){var s={tryLoc:c[0]};1 in c&&(s.catchLoc=c[1]),2 in c&&(s.finallyLoc=c[2],s.afterLoc=c[3]),this.tryEntries.push(s)}function ve(c){var s=c.completion||{};s.type="normal",delete s.arg,c.completion=s}function de(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(pe,this),this.reset(!0)}_.keys=function(c){var s=[];for(var f in c)s.push(f);return s.reverse(),function d(){for(;s.length;){var m=s.pop();if(m in c)return d.value=m,d.done=!1,d}return d.done=!0,d}};function ce(c){if(c){var s=c[z];if(s)return s.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length)){var f=-1,d=function m(){for(;++f<c.length;)if(A.call(c,f))return m.value=c[f],m.done=!1,m;return m.value=T,m.done=!0,m};return d.next=d}}return{next:ye}}_.values=ce;function ye(){return{value:T,done:!0}}return de.prototype={constructor:de,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach(ve),!c)for(var s in this)s.charAt(0)==="t"&&A.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=T)},stop:function(){this.done=!0;var c=this.tryEntries[0],s=c.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var s=this;function f(X,N){return k.type="throw",k.arg=c,s.next=X,N&&(s.method="next",s.arg=T),!!N}for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d],k=m.completion;if(m.tryLoc==="root")return f("end");if(m.tryLoc<=this.prev){var Y=A.call(m,"catchLoc"),K=A.call(m,"finallyLoc");if(Y&&K){if(this.prev<m.catchLoc)return f(m.catchLoc,!0);if(this.prev<m.finallyLoc)return f(m.finallyLoc)}else if(Y){if(this.prev<m.catchLoc)return f(m.catchLoc,!0)}else if(K){if(this.prev<m.finallyLoc)return f(m.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(c,s){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&A.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var m=d;break}}m&&(c==="break"||c==="continue")&&m.tryLoc<=s&&s<=m.finallyLoc&&(m=null);var k=m?m.completion:{};return k.type=c,k.arg=s,m?(this.method="next",this.next=m.finallyLoc,D):this.complete(k)},complete:function(c,s){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&s&&(this.next=s),D},finish:function(c){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===c)return this.complete(f.completion,f.afterLoc),ve(f),D}},catch:function(c){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===c){var d=f.completion;if(d.type==="throw"){var m=d.arg;ve(f)}return m}}throw new Error("illegal catch attempt")},delegateYield:function(c,s,f){return this.delegate={iterator:ce(c),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=T),D}},_}(S.exports);try{regeneratorRuntime=C}catch(_){typeof globalThis=="object"?globalThis.regeneratorRuntime=C:Function("r","regeneratorRuntime = r")(C)}},695:function(S,C,_){"use strict";_.d(C,{Z:function(){return R}});function R(A){if(A.geometry&&A.geometry.dispose(),A.material){var T=Array.isArray(A.material)?A.material:[A.material];T.forEach(function(x){var z,Z,E,L,$,H,G,l,ie,U,D,O,V;(z=x.map)===null||z===void 0||z.dispose(),(Z=x.lightMap)===null||Z===void 0||Z.dispose(),(E=x.bumpMap)===null||E===void 0||E.dispose(),(L=x.normalMap)===null||L===void 0||L.dispose(),($=x.specularMap)===null||$===void 0||$.dispose(),(H=x.envMap)===null||H===void 0||H.dispose(),(G=x.alphaMap)===null||G===void 0||G.dispose(),(l=x.aoMap)===null||l===void 0||l.dispose(),(ie=x.displacementMap)===null||ie===void 0||ie.dispose(),(U=x.emissiveMap)===null||U===void 0||U.dispose(),(D=x.gradientMap)===null||D===void 0||D.dispose(),(O=x.metalnessMap)===null||O===void 0||O.dispose(),(V=x.roughnessMap)===null||V===void 0||V.dispose(),x.dispose()})}}},519:function(S,C,_){"use strict";_.d(C,{disposeMesh:function(){return x.Z}});var R=_(666),A=_.n(R),T=null,x=_(695),z=_(644);function Z(U){if(U.material){var D=Array.isArray(U.material)?U.material:[U.material];D.forEach(function(O){var V,B;(V=O.color)===null||V===void 0||V.convertSRGBToLinear(),(B=O.emissive)===null||B===void 0||B.convertSRGBToLinear(),O.map&&(O.map.encoding=THREE.sRGBEncoding),O.emissiveMap&&(O.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=_(568),L=_(924),$=require("idb-keyval"),H=_(484),G=null,l=null,ie=function(){var U=(0,E.Z)(A().mark(function D(O,V){var B,q,ee,te,Q,re;return A().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return B=V.version,J.next=4,(0,$.get)(O);case 4:if(ee=J.sent,!(ee&&ee[B])){J.next=9;break}q=ee[B],J.next=15;break;case 9:return J.next=11,(0,H.Z)(fetch(O).then(function(se){if(se.ok)return se.blob();throw new Error}));case 11:te=J.sent,Q=te.res,re=te.err,re||(q=Q,(0,$.set)(O,(0,L.Z)({},B,Q)));case 15:return J.abrupt("return",q?{url:URL.createObjectURL(q)}:{url:O});case 16:case"end":return J.stop()}},D)}));return function(O,V){return U.apply(this,arguments)}}()},484:function(S,C,_){"use strict";_.d(C,{Z:function(){return A}});var R=_(42);function A(T){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.then(function(z){return(0,R.Z)({err:null,res:z},x)}).catch(function(z){return(0,R.Z)({err:z,res:void 0},x)})}},644:function(S){"use strict";S.exports=require("three")},568:function(S,C,_){"use strict";_.d(C,{Z:function(){return A}});function R(T,x,z,Z,E,L,$){try{var H=T[L]($),G=H.value}catch(l){z(l);return}H.done?x(G):Promise.resolve(G).then(Z,E)}function A(T){return function(){var x=this,z=arguments;return new Promise(function(Z,E){var L=T.apply(x,z);function $(G){R(L,Z,E,$,H,"next",G)}function H(G){R(L,Z,E,$,H,"throw",G)}$(void 0)})}}},924:function(S,C,_){"use strict";_.d(C,{Z:function(){return R}});function R(A,T,x){return T in A?Object.defineProperty(A,T,{value:x,enumerable:!0,configurable:!0,writable:!0}):A[T]=x,A}},42:function(S,C,_){"use strict";_.d(C,{Z:function(){return A}});var R=_(924);function A(T){for(var x=1;x<arguments.length;x++){var z=arguments[x]!=null?arguments[x]:{},Z=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(z).filter(function(E){return Object.getOwnPropertyDescriptor(z,E).enumerable}))),Z.forEach(function(E){(0,R.Z)(T,E,z[E])})}return T}}},xe={};function I(S){var C=xe[S];if(C!==void 0)return C.exports;var _=xe[S]={exports:{}};return Ae[S](_,_.exports,I),_.exports}(function(){I.n=function(S){var C=S&&S.__esModule?function(){return S.default}:function(){return S};return I.d(C,{a:C}),C}})(),function(){I.d=function(S,C){for(var _ in C)I.o(C,_)&&!I.o(S,_)&&Object.defineProperty(S,_,{enumerable:!0,get:C[_]})}}(),function(){I.o=function(S,C){return Object.prototype.hasOwnProperty.call(S,C)}}(),function(){I.r=function(S){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(S,"__esModule",{value:!0})}}();var be={};(function(){"use strict";I.r(be),I.d(be,{Image:function(){return Y},Line:function(){return Le},MeshLine:function(){return ne},MeshLineMaterial:function(){return we},MeshLineRaycast:function(){return Se},Node:function(){return ae},Text:function(){return f},Video:function(){return me}});function S(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function C(t,a){return C=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},C(t,a)}function _(t,a){return C(t,a)}function R(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&_(t,a)}var A=I(42);function T(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);a&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function x(t,a){return a=a!=null?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):T(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}),t}function z(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(t)}function E(t){return Z(t)}function L(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $(t){return t&&t.constructor===Symbol?"symbol":typeof t}function H(t,a){return a&&($(a)==="object"||typeof a=="function")?a:L(t)}function G(t){var a=z();return function(){var n=E(t),i;if(a){var e=E(this).constructor;i=Reflect.construct(n,arguments,e)}else i=n.apply(this,arguments);return H(this,i)}}var l=I(644);function ie(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function U(t,a,r){return ie()?U=Reflect.construct:U=function(i,e,o){var u=[null];u.push.apply(u,e);var h=Function.bind.apply(i,u),p=new h;return o&&_(p,o.prototype),p},U.apply(null,arguments)}function D(t,a,r){return U.apply(null,arguments)}function O(t,a){for(var r=0;r<a.length;r++){var n=a[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function V(t,a,r){return a&&O(t.prototype,a),r&&O(t,r),t}function B(t,a){(a==null||a>t.length)&&(a=t.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=t[r];return n}function q(t){if(Array.isArray(t))return B(t)}function ee(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function te(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Q(t,a){if(!!t){if(typeof t=="string")return B(t,a);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(t,a)}}function re(t){return q(t)||ee(t)||Q(t)||te()}var oe=I(484);function J(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,i){r.resolve=n,r.reject=i}),t&&(r.promise=(0,oe.Z)(r.promise,a)),r}var se=require("@tweenjs/tween.js"),pe=I.n(se),ve=function(){"use strict";function t(){S(this,t),this.guiParams={}}var a=t.prototype;return a.showGuiParams=function(n){var i=this;!n||Object.keys(this.guiParams).forEach(function(e){var o=n.addFolder(e),u=i.guiParams[e];Object.keys(u).forEach(function(h){var p=u[h],y=p.min,g=p.max,b=p.step,P=p.name,w=p.to,M=p.paramMap,v=p.items,F=p.value,W=p.target,ge=h.toLowerCase().indexOf("color")>-1,j,le=typeof F=="undefined"&&W,he=le?W():u[h],fe=le?h:"value";v?j=o.add(he,fe,v):ge?j=o.addColor(he,fe):j=o.add(he,fe),j=j.name(P||h),typeof y!="undefined"&&(j=j.min(y)),typeof g!="undefined"&&(j=j.max(g)),typeof b!="undefined"&&(j=j.step(b)),j=j.onChange(function(){i.setGuiTargetValue(e,h,he[fe],M)}),(w||le)&&j.listen()})})},a.setGuiTargetValue=function(n,i,e,o){var u=this.guiParams[n][i],h=u.onChange,p=u.target,y=u.value,g=i.toLowerCase().indexOf("color")>-1,b=typeof y=="undefined"&&p;if(p&&!b){var P=p();Array.isArray(P)||(P=[P]),P.forEach(function(w){if(!!w)if(g)try{w[o||i].set(e)}catch(M){i!=="color"&&!o&&console.warn("".concat(i," is not a color,set paramMap"))}else w[o||i]=e})}h&&h(e)},a.setGuiTargetValueByParams=function(){var n=this;Object.keys(this.guiParams).forEach(function(i){Object.keys(n.guiParams[i]).forEach(function(e){var o=n.guiParams[i][e];typeof o.value!="undefined"&&n.setGuiTargetValue(i,e,o.value,o.paramMap)})})},a.guiParamTween=function(n,i,e){var o=e.duration,u=o===void 0?0:o,h=this,p=this.guiParams[n][i],y=p.to,g=p.paramMap,b=g===void 0?"":g;return new(pe()).Tween(this.guiParams[n][i]).to({value:y},u).onUpdate(function(P){h.setGuiTargetValue(n,i,P.value,b)})},t}(),de=require("three/examples/jsm/renderers/CSS2DRenderer"),ce=require("three/examples/jsm/renderers/CSS3DRenderer"),ye=I(519),c=function(t){t&&((0,ye.disposeMesh)(t),t.children.forEach(function(a){a.userData.BaseObject_||c(a)}))},s=function(t){"use strict";R(r,t);var a=G(r);function r(i){S(this,r);var e;return e=a.call(this),e.objecttype__="BaseObject",e.userData={},e.pm=J(),e.visible=!1,e}var n=r.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,o){},n.resize=function(e,o){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=D(l.Mesh,re(o)),this},n.createGroup=function(){return this.object3d=new l.Group,this},n.createPoints=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=D(l.Points,re(o)),this},n.createCSS2DObject=function(e){return this.object3d=new de.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new ce.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new ce.CSS3DSprite(e),this},n.createSprite=function(e){return this.object3d=new l.Sprite(e),this},n.add=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).add.apply(h,re(o)),this},n.remove=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).remove.apply(h,re(o)),this},n.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(o){o.traverse(e)})},n.dispose=function(){c(this.object3d)},V(r,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),r}(ve),f=function(t){"use strict";R(r,t);var a=G(r);function r(i){S(this,r);var e;return e=a.call(this),e.width=0,e.options=(0,A.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},i),e}var n=r.prototype;return n.init=function(){var e=document.createElement("canvas");this.canvas=e},n.create=function(){var e=this.options,o=e.position,u=e.lookAt,h=e.sprite,p=e.text,y=e.sizeAttenuation;if(h){var g=new l.Sprite(new l.SpriteMaterial({transparent:!0,sizeAttenuation:y}));this.object3d=g}else{var b=new l.MeshBasicMaterial({side:l.DoubleSide,transparent:!0}),P=new l.PlaneGeometry(1,1,1,1);this.createMesh(P,b)}this.object3d.position.copy(o),u&&this.object3d.lookAt(u),this.setText(p)},n.setText=function(e,o){var u=(0,A.Z)(x((0,A.Z)({},this.options),{text:e}),o||{}),h=u.text,p=u.fontSize,y=u.fontFamily,g=u.fontWeight,b=u.flipX,P=u.scale,w=this.canvas;w.width=p*h.length*2,w.height=p;var M=w.getContext("2d");M.font="".concat(g," ").concat(p,"px/1 ").concat(y);var v=M.measureText(h).width;w.width=v,this.width=v,M=w.getContext("2d"),M.clearRect(0,0,w.width,w.height),b&&M.scale(-1,1),M.font="".concat(g," ").concat(p,"px/1 ").concat(y),M.textBaseline="middle",M.fillStyle="#ffffff",M.fillText(h,b?v*-1:0,w.height/2),M.restore();var F=new l.Texture(w);F.anisotropy=16,F.needsUpdate=!0;var W=this.object3d;W.material.map&&W.material.map.dispose(),W.material.map=F,W.material.needsUpdate=!0,W.scale.set(F.image.width*P,F.image.height*P,1)},r}(s),d=I(568),m=I(666),k=I.n(m),Y=function(t){"use strict";R(r,t);var a=G(r);function r(i){S(this,r);var e;return e=a.call(this),e.options=i,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,d.Z)(k().mark(function o(){var u,h,p,y,g,b,P,w,M,v;return k().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return u=e.options,h=u.transparent,p=u.blending,y=u.src,g=u.depthWrite,b=u.alphaTest,P=u.sprite,w=u.sizeAttenuation,W.next=3,new l.TextureLoader().loadAsync(y);case 3:return M=W.sent,v=P?new l.SpriteMaterial({map:M,transparent:h!=null?h:!1,blending:p!=null?p:l.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:b!=null?b:0,sizeAttenuation:w!=null?w:!0}):new l.MeshBasicMaterial({map:M,transparent:h!=null?h:!1,blending:p!=null?p:l.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:b!=null?b:0}),W.abrupt("return",v);case 6:case"end":return W.stop()}},o)}))()},n.create=function(){var e=this;return(0,d.Z)(k().mark(function o(){var u,h,p,y,g,b,P,w;return k().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,y=u.src,g=u.cache,b=u.sprite,!(g&&!g.get(y))){v.next=7;break}return g.init(y),v.next=5,e.getMaterial();case 5:P=v.sent,g.set(y,P);case 7:if(!g){v.next=13;break}return v.next=10,g.get(y);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.texture=w.map,b?e.createSprite(w):e.createMesh(new l.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(w.map.image.width*h,w.map.image.height*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},r}(s);function K(t,a){for(;!Object.prototype.hasOwnProperty.call(t,a)&&(t=E(t),t!==null););return t}function X(t,a,r){return typeof Reflect!="undefined"&&Reflect.get?X=Reflect.get:X=function(i,e,o){var u=K(i,e);if(!!u){var h=Object.getOwnPropertyDescriptor(u,e);return h.get?h.get.call(o||i):h.value}},X(t,a,r)}function N(t,a,r){return X(t,a,r)}var me=function(t){"use strict";R(r,t);var a=G(r);function r(i){S(this,r);var e;return e=a.call(this),e.options=(0,A.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,u=e.transparent,h=e.blending,p=e.depthWrite,y=e.format,g=e.autoPlay,b=e.loop,P=e.alphaTest,w=e.sprite,M=J(),v=document.createElement("video");return v.addEventListener("loadedmetadata",function(){var F=new l.VideoTexture(v);F.format=y!=null?y:l.RGBAFormat,F.needsUpdate=!0;var W=w?new l.SpriteMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0}):new l.MeshBasicMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0});M.resolve(W)},!1),v.src=o,v.muted=!0,v.autoplay=g,v.loop=b,v.preload="auto",M.promise},n.create=function(){var e=this;return(0,d.Z)(k().mark(function o(){var u,h,p,y,g,b,P,w;return k().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,y=u.src,g=u.cache,b=u.sprite,!(g&&!g.get(y))){v.next=7;break}return g.init(y),v.next=5,e.getMaterial();case 5:P=v.sent,g.set(y,P);case 7:if(!g){v.next=13;break}return v.next=10,g.get(y);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.video=w.map.image,b?e.createSprite(w):e.createMesh(new l.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(e.video.videoWidth*h,e.video.videoHeight*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),N(E(r.prototype),"dispose",this).call(this)},r}(s),ue=function(t){"use strict";R(r,t);var a=G(r);function r(i){S(this,r);var e;return e=a.call(this),e.options=(0,A.Z)({},i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,u=e.children,h=e.onClick,p=e.zIndexFix,y=document.createElement("div");y.appendChild(u),this.createCSS2DObject(y),o&&this.object3d.position.copy(o),h&&y.addEventListener("click",h),p&&(this.object3d.userData.zIndexFix=p)},n.getMaterial=function(e){return(0,d.Z)(k().mark(function o(){var u,h,p,y;return k().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return u=document.createElement("canvas"),u.width=256,u.height=256,h=u.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),p=new l.CanvasTexture(u),y=new l.SpriteMaterial({map:p,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),b.abrupt("return",y);case 9:case"end":return b.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,u=o===void 0?!1:o,h=e.scale,p=h===void 0?new l.Vector3(1,1,1):h,y=e.position,g=y===void 0?new l.Vector3(0,0,0):y,b=e.cache,P=this;return(0,d.Z)(k().mark(function w(){var M,v,F,W;return k().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(M="node-create-pick-object",!(b&&!b.get(M))){j.next=7;break}return b.init(M),j.next=5,P.getMaterial(u);case 5:v=j.sent,b.set(M,v);case 7:if(!b){j.next=13;break}return j.next=10,b.get(M);case 10:j.t0=j.sent,j.next=16;break;case 13:return j.next=15,P.getMaterial(u);case 15:j.t0=j.sent;case 16:F=j.t0,W=new l.Sprite(F),W.scale.set(F.map.image.width*p.x,F.map.image.height*p.y,1),W.position.copy(g),P.add(W),P.pickObject=W;case 22:case"end":return j.stop()}},w)}))()},n.dispose=function(){var e=this.options.onClick;if(e){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",e)}N(E(r.prototype),"dispose",this).call(this)},r}(s),ae=ue,Me=`
|
|
2
2
|
`.concat(l.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
3
|
`).concat(l.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
96
96
|
`).concat(l.ShaderChunk.fog_vertex,`
|
|
97
97
|
}
|
|
98
|
-
`),
|
|
98
|
+
`),Oe=`
|
|
99
99
|
`.concat(l.ShaderChunk.fog_pars_fragment,`
|
|
100
100
|
`).concat(l.ShaderChunk.logdepthbuf_pars_fragment,`
|
|
101
101
|
|
|
@@ -129,4 +129,4 @@ void main() {
|
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
130
|
`).concat(l.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),ne=function(t){"use strict";R(r,t);var a=G(r);function r(){A(this,r);var n;return n=a.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new l.Matrix4,Object.defineProperties(L(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(l.BufferGeometry);ne.prototype.setMatrixWorld=function(t){this.matrixWorld=t},ne.prototype.setGeometry=function(t,a){this._geometry=t,this.setPoints(t.getAttribute("position").array,a)},ne.prototype.setPoints=function(t,a){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=a,this.positions=[],this.counters=[],t.length&&t[0]instanceof l.Vector3)for(var r=0;r<t.length;r++){var n=t[r],i=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(i),this.counters.push(i)}else for(var r=0;r<t.length;r+=3){var i=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(i),this.counters.push(i)}this.process()};function Ae(t,a){var r=new l.Matrix4,n=new l.Ray,i=new l.Sphere,e=new l.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),i.copy(o.boundingSphere),i.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(i,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var u=new l.Vector3,h=new l.Vector3,p=new l.Vector3,_=this instanceof l.LineSegments?2:1,y=o.index,g=o.attributes;if(y!==null)for(var P=y.array,w=g.position.array,O=g.width.array,v=0,F=P.length-1;v<F;v+=_){var W=P[v],ge=P[v+1];u.fromArray(w,W*3),h.fromArray(w,ge*3);var j=O[Math.floor(v/3)]!==void 0?O[Math.floor(v/3)]:1,le=t.params.Line.threshold+this.material.lineWidth*j/2,he=le*le,fe=n.distanceSqToSegment(u,h,e,p);if(!(fe>he)){e.applyMatrix4(this.matrixWorld);var Pe=t.ray.origin.distanceTo(e);Pe<t.near||Pe>t.far||(a.push({distance:Pe,point:p.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}),v=F)}}}}ne.prototype.raycast=Ae,ne.prototype.compareV3=function(t,a){var r=t*6,n=a*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},ne.prototype.copyV3=function(t){var a=t*6;return[this.positions[a],this.positions[a+1],this.positions[a+2]]},ne.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var a,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?a=this.widthCallback(n/(t-1)):a=1,this.width.push(a),this.width.push(a),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var i=n*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new l.BufferAttribute(new Float32Array(this.positions),3),previous:new l.BufferAttribute(new Float32Array(this.previous),3),next:new l.BufferAttribute(new Float32Array(this.next),3),side:new l.BufferAttribute(new Float32Array(this.side),1),width:new l.BufferAttribute(new Float32Array(this.width),1),uv:new l.BufferAttribute(new Float32Array(this.uvs),2),index:new l.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new l.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function _e(t,a,r,n,i){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=a?t.subarray?t.subarray(a,i&&a+i):t.slice(a,i&&a+i):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}ne.prototype.advance=function(t){var a=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,i=a.length;_e(a,0,r,0,i),_e(a,6,a,0,i-6),a[i-6]=t.x,a[i-5]=t.y,a[i-4]=t.z,a[i-3]=t.x,a[i-2]=t.y,a[i-1]=t.z,_e(a,6,n,0,i-6),n[i-6]=t.x,n[i-5]=t.y,n[i-4]=t.z,n[i-3]=t.x,n[i-2]=t.y,n[i-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},l.ShaderChunk.meshline_vert=Oe,l.ShaderChunk.meshline_frag=xe;var we=function(t){"use strict";R(r,t);var a=G(r);function r(n){A(this,r);var i;return i=a.call(this,{uniforms:Object.assign({},l.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new l.Color(16777215)},opacity:{value:1},resolution:{value:new l.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new l.Vector2(1,1)},offset:{value:new l.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new l.Vector2(0,0)},lightColor:{value:new l.Color(16777215)}}),vertexShader:l.ShaderChunk.meshline_vert,fragmentShader:l.ShaderChunk.meshline_frag}),i.isMeshLineMaterial=!0,i.type="MeshLineMaterial",Object.defineProperties(L(i),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),i.setValues(n),i}return r}(l.ShaderMaterial);we.prototype.copy=function(t){return l.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function Ce(t,a){if(t==null)return{};var r={},n=Object.keys(t),i,e;for(e=0;e<n.length;e++)i=n[e],!(a.indexOf(i)>=0)&&(r[i]=t[i]);return r}function je(t,a){if(t==null)return{};var r=Ce(t,a),n,i;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(i=0;i<e.length;i++)n=e[i],!(a.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var ke={nodes:[],color:new l.Color("red"),lineWidth:3,sizeAttenuation:0},Te=function(t){"use strict";R(r,t);var a=G(r);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,r);var e;return e=a.call(this),e.geometry=new l.BufferGeometry,e.meshline=new ne,e.options=(0,M.Z)({},ke,i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.nodes,u=e.duration,h=e.delay,p=e.onComplete,_=e.setPointWidth,y=je(e,["nodes","duration","delay","onComplete","setPointWidth"]),g=this.pencil.getSize(),P=g.width,w=g.height;delete y.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,_);var O=new we(S((0,M.Z)({},y),{resolution:new l.Vector2(P,w)}));this.material=O,this.createMesh(this.meshline,O)},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,u=e.delay,h=e.onComplete,p=this.material.uniforms.offset,_=new(pe()).Tween(p.value).to({x:0},o!=null?o:1e3).delay(u!=null?u:0).repeat(1/0);h&&_.onComplete(h),_.start(),this.tween=_},n.dispose=function(){I(E(r.prototype),"dispose",this).call(this),this.tween&&pe().remove(this.tween)},r}(s),Le=Te})(),module.exports=be})();
|
|
132
|
+
`),ne=function(t){"use strict";R(r,t);var a=G(r);function r(){S(this,r);var n;return n=a.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new l.Matrix4,Object.defineProperties(L(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(l.BufferGeometry);ne.prototype.setMatrixWorld=function(t){this.matrixWorld=t},ne.prototype.setGeometry=function(t,a){this._geometry=t,this.setPoints(t.getAttribute("position").array,a)},ne.prototype.setPoints=function(t,a){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=a,this.positions=[],this.counters=[],t.length&&t[0]instanceof l.Vector3)for(var r=0;r<t.length;r++){var n=t[r],i=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(i),this.counters.push(i)}else for(var r=0;r<t.length;r+=3){var i=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(i),this.counters.push(i)}this.process()};function Se(t,a){var r=new l.Matrix4,n=new l.Ray,i=new l.Sphere,e=new l.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),i.copy(o.boundingSphere),i.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(i,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var u=new l.Vector3,h=new l.Vector3,p=new l.Vector3,y=this instanceof l.LineSegments?2:1,g=o.index,b=o.attributes;if(g!==null)for(var P=g.array,w=b.position.array,M=b.width.array,v=0,F=P.length-1;v<F;v+=y){var W=P[v],ge=P[v+1];u.fromArray(w,W*3),h.fromArray(w,ge*3);var j=M[Math.floor(v/3)]!==void 0?M[Math.floor(v/3)]:1,le=t.params.Line.threshold+this.material.lineWidth*j/2,he=le*le,fe=n.distanceSqToSegment(u,h,e,p);if(!(fe>he)){e.applyMatrix4(this.matrixWorld);var Pe=t.ray.origin.distanceTo(e);Pe<t.near||Pe>t.far||(a.push({distance:Pe,point:p.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}),v=F)}}}}ne.prototype.raycast=Se,ne.prototype.compareV3=function(t,a){var r=t*6,n=a*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},ne.prototype.copyV3=function(t){var a=t*6;return[this.positions[a],this.positions[a+1],this.positions[a+2]]},ne.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var a,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?a=this.widthCallback(n/(t-1)):a=1,this.width.push(a),this.width.push(a),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var i=n*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new l.BufferAttribute(new Float32Array(this.positions),3),previous:new l.BufferAttribute(new Float32Array(this.previous),3),next:new l.BufferAttribute(new Float32Array(this.next),3),side:new l.BufferAttribute(new Float32Array(this.side),1),width:new l.BufferAttribute(new Float32Array(this.width),1),uv:new l.BufferAttribute(new Float32Array(this.uvs),2),index:new l.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new l.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function _e(t,a,r,n,i){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=a?t.subarray?t.subarray(a,i&&a+i):t.slice(a,i&&a+i):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}ne.prototype.advance=function(t){var a=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,i=a.length;_e(a,0,r,0,i),_e(a,6,a,0,i-6),a[i-6]=t.x,a[i-5]=t.y,a[i-4]=t.z,a[i-3]=t.x,a[i-2]=t.y,a[i-1]=t.z,_e(a,6,n,0,i-6),n[i-6]=t.x,n[i-5]=t.y,n[i-4]=t.z,n[i-3]=t.x,n[i-2]=t.y,n[i-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},l.ShaderChunk.meshline_vert=Me,l.ShaderChunk.meshline_frag=Oe;var we=function(t){"use strict";R(r,t);var a=G(r);function r(n){S(this,r);var i;return i=a.call(this,{uniforms:Object.assign({},l.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new l.Color(16777215)},opacity:{value:1},resolution:{value:new l.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new l.Vector2(1,1)},offset:{value:new l.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new l.Vector2(0,0)},lightColor:{value:new l.Color(16777215)}}),vertexShader:l.ShaderChunk.meshline_vert,fragmentShader:l.ShaderChunk.meshline_frag}),i.isMeshLineMaterial=!0,i.type="MeshLineMaterial",Object.defineProperties(L(i),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),i.setValues(n),i}return r}(l.ShaderMaterial);we.prototype.copy=function(t){return l.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function Ce(t,a){if(t==null)return{};var r={},n=Object.keys(t),i,e;for(e=0;e<n.length;e++)i=n[e],!(a.indexOf(i)>=0)&&(r[i]=t[i]);return r}function je(t,a){if(t==null)return{};var r=Ce(t,a),n,i;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(i=0;i<e.length;i++)n=e[i],!(a.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var ke={nodes:[],color:new l.Color("red"),lineWidth:3,sizeAttenuation:0},Te=function(t){"use strict";R(r,t);var a=G(r);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};S(this,r);var e;return e=a.call(this),e.geometry=new l.BufferGeometry,e.meshline=new ne,e.options=(0,A.Z)({},ke,i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.nodes,u=e.duration,h=e.delay,p=e.onComplete,y=e.setPointWidth,g=je(e,["nodes","duration","delay","onComplete","setPointWidth"]),b=this.pencil.getSize(),P=b.width,w=b.height;delete g.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,y);var M=new we(x((0,A.Z)({},g),{resolution:new l.Vector2(P,w)}));this.material=M,this.createMesh(this.meshline,M)},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,u=e.delay,h=e.onComplete,p=this.material.uniforms.offset,y=new(pe()).Tween(p.value).to({x:0},o!=null?o:1e3).delay(u!=null?u:0).repeat(1/0);h&&y.onComplete(h),y.start(),this.tween=y},n.dispose=function(){N(E(r.prototype),"dispose",this).call(this),this.tween&&pe().remove(this.tween)},r}(s),Le=Te})(),module.exports=be})();
|