gl-draw 0.3.9 → 0.3.11
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/index.js +1 -1
- package/dist/index.module.js +1 -1
- package/dist/objects/fix.d.ts +2 -0
- package/dist/objects/index.js +3 -3
- package/dist/objects/index.module.js +3 -3
- package/dist/workers/extrudePolygon.js +131 -131
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as et from"idb-keyval";import*as W from"three";import*as Vt from"three/examples/jsm/renderers/CSS2DRenderer";import*as tt from"three/examples/jsm/renderers/CSS3DRenderer";import*as Ut from"popmotion";import*as Nt from"three/examples/jsm//utils/BufferGeometryUtils";import*as Fe from"d3-array";import*as Ft from"earcut";import*as It from"@turf/boolean-clockwise";import*as Zt from"delaunator";import*as Xt from"@turf/boolean-point-in-polygon";import*as Re from"d3-geo";import*as Ht from"d3-geo-voronoi";import*as Kt from"d3-scale";var $t={666:function(L){var j=function(w){"use strict";var P=Object.prototype,M=P.hasOwnProperty,B,O=typeof Symbol=="function"?Symbol:{},T=O.iterator||"@@iterator",Z=O.asyncIterator||"@@asyncIterator",x=O.toStringTag||"@@toStringTag";function k(f,u,p){return Object.defineProperty(f,u,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[u]}try{k({},"")}catch(f){k=function(u,p,S){return u[p]=S}}function Y(f,u,p,S){var g=u&&u.prototype instanceof ie?u:ie,Q=Object.create(g.prototype),K=new Se(S||[]);return Q._invoke=ue(f,p,K),Q}w.wrap=Y;function J(f,u,p){try{return{type:"normal",arg:f.call(u,p)}}catch(S){return{type:"throw",arg:S}}}var R="suspendedStart",s="suspendedYield",oe="executing",re="completed",$={};function ie(){}function G(){}function F(){}var D={};k(D,T,function(){return this});var X=Object.getPrototypeOf,U=X&&X(X(Te([])));U&&U!==P&&M.call(U,T)&&(D=U);var H=F.prototype=ie.prototype=Object.create(D);G.prototype=F,k(H,"constructor",F),k(F,"constructor",G),G.displayName=k(F,x,"GeneratorFunction");function I(f){["next","throw","return"].forEach(function(u){k(f,u,function(p){return this._invoke(u,p)})})}w.isGeneratorFunction=function(f){var u=typeof f=="function"&&f.constructor;return u?u===G||(u.displayName||u.name)==="GeneratorFunction":!1},w.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,F):(f.__proto__=F,k(f,x,"GeneratorFunction")),f.prototype=Object.create(H),f},w.awrap=function(f){return{__await:f}};function q(f,u){function p(Q,K,ae,se){var ne=J(f[Q],f,K);if(ne.type==="throw")se(ne.arg);else{var Oe=ne.arg,Ce=Oe.value;return Ce&&typeof Ce=="object"&&M.call(Ce,"__await")?u.resolve(Ce.__await).then(function(xe){p("next",xe,ae,se)},function(xe){p("throw",xe,ae,se)}):u.resolve(Ce).then(function(xe){Oe.value=xe,ae(Oe)},function(xe){return p("throw",xe,ae,se)})}}var S;function g(Q,K){function ae(){return new u(function(se,ne){p(Q,K,se,ne)})}return S=S?S.then(ae,ae):ae()}this._invoke=g}I(q.prototype),k(q.prototype,Z,function(){return this}),w.AsyncIterator=q,w.async=function(f,u,p,S,g){g===void 0&&(g=Promise);var Q=new q(Y(f,u,p,S),g);return w.isGeneratorFunction(u)?Q:Q.next().then(function(K){return K.done?K.value:Q.next()})};function ue(f,u,p){var S=R;return function(Q,K){if(S===oe)throw new Error("Generator is already running");if(S===re){if(Q==="throw")throw K;return Le()}for(p.method=Q,p.arg=K;;){var ae=p.delegate;if(ae){var se=_e(ae,p);if(se){if(se===$)continue;return se}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(S===R)throw S=re,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);S=oe;var ne=J(f,u,p);if(ne.type==="normal"){if(S=p.done?re:s,ne.arg===$)continue;return{value:ne.arg,done:p.done}}else ne.type==="throw"&&(S=re,p.method="throw",p.arg=ne.arg)}}}function _e(f,u){var p=f.iterator[u.method];if(p===B){if(u.delegate=null,u.method==="throw"){if(f.iterator.return&&(u.method="return",u.arg=B,_e(f,u),u.method==="throw"))return $;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return $}var S=J(p,f.iterator,u.arg);if(S.type==="throw")return u.method="throw",u.arg=S.arg,u.delegate=null,$;var g=S.arg;if(!g)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,$;if(g.done)u[f.resultName]=g.value,u.next=f.nextLoc,u.method!=="return"&&(u.method="next",u.arg=B);else return g;return u.delegate=null,$}I(H),k(H,x,"Generator"),k(H,T,function(){return this}),k(H,"toString",function(){return"[object Generator]"});function ee(f){var u={tryLoc:f[0]};1 in f&&(u.catchLoc=f[1]),2 in f&&(u.finallyLoc=f[2],u.afterLoc=f[3]),this.tryEntries.push(u)}function z(f){var u=f.completion||{};u.type="normal",delete u.arg,f.completion=u}function Se(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(ee,this),this.reset(!0)}w.keys=function(f){var u=[];for(var p in f)u.push(p);return u.reverse(),function S(){for(;u.length;){var g=u.pop();if(g in f)return S.value=g,S.done=!1,S}return S.done=!0,S}};function Te(f){if(f){var u=f[T];if(u)return u.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,S=function g(){for(;++p<f.length;)if(M.call(f,p))return g.value=f[p],g.done=!1,g;return g.value=B,g.done=!0,g};return S.next=S}}return{next:Le}}w.values=Te;function Le(){return{value:B,done:!0}}return Se.prototype={constructor:Se,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=B,this.done=!1,this.delegate=null,this.method="next",this.arg=B,this.tryEntries.forEach(z),!f)for(var u in this)u.charAt(0)==="t"&&M.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=B)},stop:function(){this.done=!0;var f=this.tryEntries[0],u=f.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var u=this;function p(se,ne){return Q.type="throw",Q.arg=f,u.next=se,ne&&(u.method="next",u.arg=B),!!ne}for(var S=this.tryEntries.length-1;S>=0;--S){var g=this.tryEntries[S],Q=g.completion;if(g.tryLoc==="root")return p("end");if(g.tryLoc<=this.prev){var K=M.call(g,"catchLoc"),ae=M.call(g,"finallyLoc");if(K&&ae){if(this.prev<g.catchLoc)return p(g.catchLoc,!0);if(this.prev<g.finallyLoc)return p(g.finallyLoc)}else if(K){if(this.prev<g.catchLoc)return p(g.catchLoc,!0)}else if(ae){if(this.prev<g.finallyLoc)return p(g.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,u){for(var p=this.tryEntries.length-1;p>=0;--p){var S=this.tryEntries[p];if(S.tryLoc<=this.prev&&M.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var g=S;break}}g&&(f==="break"||f==="continue")&&g.tryLoc<=u&&u<=g.finallyLoc&&(g=null);var Q=g?g.completion:{};return Q.type=f,Q.arg=u,g?(this.method="next",this.next=g.finallyLoc,$):this.complete(Q)},complete:function(f,u){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&u&&(this.next=u),$},finish:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.finallyLoc===f)return this.complete(p.completion,p.afterLoc),z(p),$}},catch:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.tryLoc===f){var S=p.completion;if(S.type==="throw"){var g=S.arg;z(p)}return g}}throw new Error("illegal catch attempt")},delegateYield:function(f,u,p){return this.delegate={iterator:Te(f),resultName:u,nextLoc:p},this.method==="next"&&(this.arg=B),$}},w}(L.exports);try{regeneratorRuntime=j}catch(w){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},695:function(L,j,w){w.d(j,{Z:function(){return P}});function P(M){if(M.geometry&&M.geometry.dispose(),M.material){var B=Array.isArray(M.material)?M.material:[M.material];B.forEach(function(O){var T,Z,x,k,Y,J,R,s,oe,re,$,ie,G;(T=O.map)===null||T===void 0||T.dispose(),(Z=O.lightMap)===null||Z===void 0||Z.dispose(),(x=O.bumpMap)===null||x===void 0||x.dispose(),(k=O.normalMap)===null||k===void 0||k.dispose(),(Y=O.specularMap)===null||Y===void 0||Y.dispose(),(J=O.envMap)===null||J===void 0||J.dispose(),(R=O.alphaMap)===null||R===void 0||R.dispose(),(s=O.aoMap)===null||s===void 0||s.dispose(),(oe=O.displacementMap)===null||oe===void 0||oe.dispose(),(re=O.emissiveMap)===null||re===void 0||re.dispose(),($=O.gradientMap)===null||$===void 0||$.dispose(),(ie=O.metalnessMap)===null||ie===void 0||ie.dispose(),(G=O.roughnessMap)===null||G===void 0||G.dispose(),O.dispose()})}}},521:function(L,j,w){w.d(j,{wf:function(){return O.Z}});var P=w(666),M=w.n(P),B=null,O=w(695),T=w(949);function Z(G){if(G.material){var F=Array.isArray(G.material)?G.material:[G.material];F.forEach(function(D){var X,U;(X=D.color)===null||X===void 0||X.convertSRGBToLinear(),(U=D.emissive)===null||U===void 0||U.convertSRGBToLinear(),D.map&&(D.map.encoding=THREE.sRGBEncoding),D.emissiveMap&&(D.emissiveMap.encoding=THREE.sRGBEncoding)})}}var x=w(568),k=w(924),Y=G=>{var F={};return w.d(F,G),F},J=G=>()=>G,R=Y({get:()=>et.get,set:()=>et.set}),s=w(484),oe=null,re=null,$=function(){var G=(0,x.Z)(M().mark(function F(D,X){var U,H,I,q,ue,_e;return M().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return U=X.version,z.next=4,(0,R.get)(D);case 4:if(I=z.sent,!(I&&I[U])){z.next=9;break}H=I[U],z.next=15;break;case 9:return z.next=11,(0,s.Z)(fetch(D).then(function(Se){if(Se.ok)return Se.blob();throw new Error}));case 11:q=z.sent,ue=q.res,_e=q.err,_e||(H=ue,(0,R.set)(D,(0,k.Z)({},U,ue)));case 15:return z.abrupt("return",H?{url:URL.createObjectURL(H)}:{url:D});case 16:case"end":return z.stop()}},F)}));return function(D,X){return G.apply(this,arguments)}}(),ie=w(705)},484:function(L,j,w){w.d(j,{Z:function(){return M}});var P=w(42);function M(B){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return B.then(function(T){return(0,P.Z)({err:null,res:T},O)}).catch(function(T){return(0,P.Z)({err:T,res:void 0},O)})}},705:function(L,j,w){w.d(j,{C:function(){return O},y:function(){return B}});var P=w(949),M=new Map,B=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(Z,x,k,Y,J){var R=x[k*3],s=x[k*3+1],oe=x[Y*3],re=x[Y*3+1],$=x[J*3],ie=x[J*3+1],G;if(M.has(Z))G=M.get(Z);else{var F=T.box3||new P.Box3;if(!T.box3){var D=Z.parameters.shapes.getPoints();F.setFromArray(D.map(function(q){return[q.x,q.y,0]}).flat())}var X=F.getSize(new P.Vector3);T.split&&(X.y/=T.split),G={box:F,size:X},M.set(Z,G)}var U=G.box,H=G.size,I=T.split?1-T.split:0;return[new P.Vector2((R-U.min.x)/H.x,(s-U.min.y)/H.y+I),new P.Vector2((oe-U.min.x)/H.x,(re-U.min.y)/H.y+I),new P.Vector2(($-U.min.x)/H.x,(ie-U.min.y)/H.y+I)]},generateSideWallUV:function(Z,x,k,Y,J,R){var s=x[k*3],oe=x[k*3+1],re=x[k*3+2],$=x[Y*3],ie=x[Y*3+1],G=x[Y*3+2],F=x[J*3],D=x[J*3+1],X=x[J*3+2],U=x[R*3],H=x[R*3+1],I=x[R*3+2],q;if(M.has(x))q=M.get(x);else{var ue=new P.Box3;ue.setFromArray(x);var _e=ue.getSize(new P.Vector3);T.split&&(_e.z/=1-T.split),q={box:ue,size:_e},M.set(x,q)}var ee=q.box,z=q.size;return Math.abs(oe-ie)<Math.abs(s-$)?[new P.Vector2((s-ee.min.x)/z.x,(re-ee.min.z)/z.z),new P.Vector2(($-ee.min.x)/z.x,(G-ee.min.z)/z.z),new P.Vector2((F-ee.min.x)/z.x,(X-ee.min.z)/z.z),new P.Vector2((U-ee.min.x)/z.x,(I-ee.min.z)/z.z)]:[new P.Vector2((oe-ee.min.y)/z.x,(re-ee.min.z)/z.z),new P.Vector2((ie-ee.min.y)/z.x,(G-ee.min.z)/z.z),new P.Vector2((D-ee.min.y)/z.x,(X-ee.min.z)/z.z),new P.Vector2((H-ee.min.y)/z.x,(I-ee.min.z)/z.z)]}}},O=function(){M.clear()}},949:function(L,j,w){var P=B=>{var O={};return w.d(O,B),O},M=B=>()=>B;L.exports=P({Box3:()=>W.Box3,BufferAttribute:()=>W.BufferAttribute,BufferGeometry:()=>W.BufferGeometry,CanvasTexture:()=>W.CanvasTexture,Color:()=>W.Color,DoubleSide:()=>W.DoubleSide,ExtrudeGeometry:()=>W.ExtrudeGeometry,Float32BufferAttribute:()=>W.Float32BufferAttribute,Group:()=>W.Group,LineSegments:()=>W.LineSegments,Matrix4:()=>W.Matrix4,Mesh:()=>W.Mesh,MeshBasicMaterial:()=>W.MeshBasicMaterial,NormalBlending:()=>W.NormalBlending,PlaneBufferGeometry:()=>W.PlaneBufferGeometry,PlaneGeometry:()=>W.PlaneGeometry,Points:()=>W.Points,RGBAFormat:()=>W.RGBAFormat,Ray:()=>W.Ray,ShaderChunk:()=>W.ShaderChunk,ShaderMaterial:()=>W.ShaderMaterial,Shape:()=>W.Shape,Sphere:()=>W.Sphere,Sprite:()=>W.Sprite,SpriteMaterial:()=>W.SpriteMaterial,Texture:()=>W.Texture,TextureLoader:()=>W.TextureLoader,UniformsLib:()=>W.UniformsLib,Vector2:()=>W.Vector2,Vector3:()=>W.Vector3,VideoTexture:()=>W.VideoTexture})},568:function(L,j,w){w.d(j,{Z:function(){return M}});function P(B,O,T,Z,x,k,Y){try{var J=B[k](Y),R=J.value}catch(s){T(s);return}J.done?O(R):Promise.resolve(R).then(Z,x)}function M(B){return function(){var O=this,T=arguments;return new Promise(function(Z,x){var k=B.apply(O,T);function Y(R){P(k,Z,x,Y,J,"next",R)}function J(R){P(k,Z,x,Y,J,"throw",R)}Y(void 0)})}}},924:function(L,j,w){w.d(j,{Z:function(){return P}});function P(M,B,O){return B in M?Object.defineProperty(M,B,{value:O,enumerable:!0,configurable:!0,writable:!0}):M[B]=O,M}},42:function(L,j,w){w.d(j,{Z:function(){return M}});var P=w(924);function M(B){for(var O=1;O<arguments.length;O++){var T=arguments[O]!=null?arguments[O]:{},Z=Object.keys(T);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(T).filter(function(x){return Object.getOwnPropertyDescriptor(T,x).enumerable}))),Z.forEach(function(x){(0,P.Z)(B,x,T[x])})}return B}}},rt={};function N(L){var j=rt[L];if(j!==void 0)return j.exports;var w=rt[L]={exports:{}};return $t[L](w,w.exports,N),w.exports}(function(){N.n=function(L){var j=L&&L.__esModule?function(){return L.default}:function(){return L};return N.d(j,{a:j}),j}})(),function(){N.d=function(L,j){for(var w in j)N.o(j,w)&&!N.o(L,w)&&Object.defineProperty(L,w,{enumerable:!0,get:j[w]})}}(),function(){N.o=function(L,j){return Object.prototype.hasOwnProperty.call(L,j)}}();var me={};(function(){N.d(me,{Ei:function(){return Tt},Yo:function(){return Rt},Ee:function(){return ae},x1:function(){return ht},VJ:function(){return ge},r7:function(){return Ge},XA:function(){return Ie},NB:function(){return nt},xv:function(){return S},nk:function(){return Ce}});function L(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function j(e,n){return j=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},j(e,n)}function w(e,n){return j(e,n)}function P(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&w(e,n)}var M=N(42);function B(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function O(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function T(){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(e){return!1}}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(e)}function x(e){return Z(e)}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y(e){return e&&e.constructor===Symbol?"symbol":typeof e}function J(e,n){return n&&(Y(n)==="object"||typeof n=="function")?n:k(e)}function R(e){var n=T();return function(){var i=x(e),a;if(n){var t=x(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return J(this,a)}}var s=N(949);function oe(){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(e){return!1}}function re(e,n,r){return oe()?re=Reflect.construct:re=function(a,t,o){var c=[null];c.push.apply(c,t);var h=Function.bind.apply(a,c),v=new h;return o&&w(v,o.prototype),v},re.apply(null,arguments)}function $(e,n,r){return re.apply(null,arguments)}function ie(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function G(e,n,r){return n&&ie(e.prototype,n),r&&ie(e,r),e}function F(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function D(e){if(Array.isArray(e))return F(e)}function X(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function U(){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 H(e,n){if(!!e){if(typeof e=="string")return F(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F(e,n)}}function I(e){return D(e)||X(e)||H(e)||U()}var q=N(484);function ue(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(i,a){r.resolve=i,r.reject=a}),e&&(r.promise=(0,q.Z)(r.promise,n)),r}var _e=e=>{var n={};return N.d(n,e),n},ee=e=>()=>e,z=_e({CSS2DObject:()=>Vt.CSS2DObject}),Se=e=>{var n={};return N.d(n,e),n},Te=e=>()=>e,Le=Se({CSS3DObject:()=>tt.CSS3DObject,CSS3DSprite:()=>tt.CSS3DSprite}),f=N(521),u=function(e){e&&((0,f.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||u(n)}))},p=function(){"use strict";function e(){L(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=ue(),this.visible=!1}var n=e.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(i,a){},n.resize=function(i,a){},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 i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=$(s.Mesh,I(a)),this},n.createGroup=function(){return this.object3d=new s.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=$(s.Points,I(a)),this},n.createCSS2DObject=function(i){return this.object3d=new z.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new Le.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new Le.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new s.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,I(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,I(a)),this},n.getSize=function(){var i=new s.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new s.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){u(this.object3d)},G(e,[{key:"parent",get:function(){var i=this.object3d.parent;return(i==null?void 0:i.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(i){return i.userData.BaseObject_}).filter(function(i){return!!i})}}]),e}(),S=function(e){"use strict";P(r,e);var n=R(r);function r(a){L(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,M.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,c=t.lookAt,h=t.sprite,v=t.text,d=t.sizeAttenuation;if(h){var m=new s.Sprite(new s.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var _=new s.MeshBasicMaterial({side:s.DoubleSide,transparent:!0}),b=new s.PlaneGeometry(1,1,1,1);this.createMesh(b,_)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},i.setText=function(t,o){var c=(0,M.Z)(O((0,M.Z)({},this.options),{text:t}),o||{}),h=c.text,v=c.fontSize,d=c.fontFamily,m=c.fontWeight,_=c.flipX,b=c.scale,y=this.canvas;y.width=v*h.length*2,y.height=v;var A=y.getContext("2d");A.font="".concat(m," ").concat(v,"px/1 ").concat(d);var l=A.measureText(h).width;y.width=l,this.width=l,A=y.getContext("2d"),A.clearRect(0,0,y.width,y.height),_&&A.scale(-1,1),A.font="".concat(m," ").concat(v,"px/1 ").concat(d),A.textBaseline="middle",A.fillStyle="#ffffff",A.fillText(h,_?l*-1:0,y.height/2),A.restore();var C=new s.Texture(y);C.anisotropy=16,C.needsUpdate=!0;var E=this.object3d;E.material.map&&E.material.map.dispose(),E.material.map=C,E.material.needsUpdate=!0,E.scale.set(C.image.width*b,C.image.height*b,1)},r}(p),g=N(568),Q=N(666),K=N.n(Q),ae=function(e){"use strict";P(r,e);var n=R(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=a,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,g.Z)(K().mark(function o(){var c,h,v,d,m,_,b,y,A,l;return K().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return c=t.options,h=c.transparent,v=c.blending,d=c.src,m=c.depthWrite,_=c.alphaTest,b=c.sprite,y=c.sizeAttenuation,E.next=3,new s.TextureLoader().loadAsync(d);case 3:return A=E.sent,l=b?new s.SpriteMaterial({map:A,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:_!=null?_:0,sizeAttenuation:y!=null?y:!0}):new s.MeshBasicMaterial({map:A,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:_!=null?_:0}),E.abrupt("return",l);case 6:case"end":return E.stop()}},o)}))()},i.create=function(){var t=this;return(0,g.Z)(K().mark(function o(){var c,h,v,d,m,_,b,y;return K().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,_=c.sprite,!(m&&!m.get(d))){l.next=7;break}return m.init(d),l.next=5,t.getMaterial();case 5:b=l.sent,m.set(d,b);case 7:if(!m){l.next=13;break}return l.next=10,m.get(d);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:y=l.t0,t.texture=y.map,_?t.createSprite(y):t.createMesh(new s.PlaneBufferGeometry(1,1),y),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(p);function se(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=x(e),e!==null););return e}function ne(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?ne=Reflect.get:ne=function(a,t,o){var c=se(a,t);if(!!c){var h=Object.getOwnPropertyDescriptor(c,t);return h.get?h.get.call(o||a):h.value}},ne(e,n,r)}function Oe(e,n,r){return ne(e,n,r)}var Ce=function(e){"use strict";P(r,e);var n=R(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,c=t.transparent,h=t.blending,v=t.depthWrite,d=t.format,m=t.autoPlay,_=t.loop,b=t.alphaTest,y=t.sprite,A=ue(),l=document.createElement("video");return l.addEventListener("loadedmetadata",function(){var C=new s.VideoTexture(l);C.format=d!=null?d:s.RGBAFormat,C.needsUpdate=!0;var E=y?new s.SpriteMaterial({map:C,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new s.MeshBasicMaterial({map:C,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});A.resolve(E)},!1),l.src=o,l.muted=!0,l.autoplay=m,l.loop=_,l.preload="auto",A.promise},i.create=function(){var t=this;return(0,g.Z)(K().mark(function o(){var c,h,v,d,m,_,b,y;return K().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,_=c.sprite,!(m&&!m.get(d))){l.next=7;break}return m.init(d),l.next=5,t.getMaterial();case 5:b=l.sent,m.set(d,b);case 7:if(!m){l.next=13;break}return l.next=10,m.get(d);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:y=l.t0,t.video=y.map.image,_?t.createSprite(y):t.createMesh(new s.PlaneBufferGeometry(1,1),y),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),Oe(x(r.prototype),"dispose",this).call(this)},r}(p),xe=function(e){"use strict";P(r,e);var n=R(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,c=t.children,h=t.onClick,v=t.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(c),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(m){m.addEventListener("click",h)}),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,g.Z)(K().mark(function o(){var c,h,v,d;return K().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return c=document.createElement("canvas"),c.width=256,c.height=256,h=c.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new s.CanvasTexture(c),d=new s.SpriteMaterial({map:v,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),_.abrupt("return",d);case 9:case"end":return _.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,c=o===void 0?!1:o,h=t.scale,v=h===void 0?new s.Vector3(1,1,1):h,d=t.position,m=d===void 0?new s.Vector3(0,0,0):d,_=t.cache,b=this;return(0,g.Z)(K().mark(function y(){var A,l,C,E;return K().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(A="node-create-pick-object",!(_&&!_.get(A))){V.next=7;break}return _.init(A),V.next=5,b.getMaterial(c);case 5:l=V.sent,_.set(A,l);case 7:if(!_){V.next=13;break}return V.next=10,_.get(A);case 10:V.t0=V.sent,V.next=16;break;case 13:return V.next=15,b.getMaterial(c);case 15:V.t0=V.sent;case 16:C=V.t0,E=new s.Sprite(C),E.scale.set(C.map.image.width*v.x,C.map.image.height*v.y,1),E.position.copy(m),b.add(E),b.pickObject=E;case 22:case"end":return V.stop()}},y)}))()},i.dispose=function(){var t=this.options.onClick;t&&this.clickTarge.forEach(function(o){o.removeEventListener("click",t)}),Oe(x(r.prototype),"dispose",this).call(this)},G(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.clickTarge;if(o){var c=o.map(function(h){return I(t.element.querySelectorAll(h))}).flat();return c}return[this.element]}}]),r}(p),nt=xe,it=`
|
|
1
|
+
import*as tt from"idb-keyval";import*as It from"three";import*as Ft from"three/examples/jsm/renderers/CSS2DRenderer";import*as rt from"three/examples/jsm/renderers/CSS3DRenderer";import*as nt from"popmotion";import*as Zt from"three/examples/jsm//utils/BufferGeometryUtils";import*as Ie from"d3-array";import*as Xt from"earcut";import*as Ht from"@turf/boolean-clockwise";import*as Kt from"delaunator";import*as $t from"@turf/boolean-point-in-polygon";import*as Te from"d3-geo";import*as Yt from"d3-geo-voronoi";import*as Jt from"d3-scale";var Qt={666:function(L){var j=function(w){"use strict";var P=Object.prototype,x=P.hasOwnProperty,W,O=typeof Symbol=="function"?Symbol:{},R=O.iterator||"@@iterator",F=O.asyncIterator||"@@asyncIterator",A=O.toStringTag||"@@toStringTag";function k(f,u,p){return Object.defineProperty(f,u,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[u]}try{k({},"")}catch(f){k=function(u,p,S){return u[p]=S}}function $(f,u,p,S){var g=u&&u.prototype instanceof ie?u:ie,J=Object.create(g.prototype),H=new Me(S||[]);return J._invoke=se(f,p,H),J}w.wrap=$;function Y(f,u,p){try{return{type:"normal",arg:f.call(u,p)}}catch(S){return{type:"throw",arg:S}}}var T="suspendedStart",s="suspendedYield",ae="executing",te="completed",K={};function ie(){}function z(){}function N(){}var D={};k(D,R,function(){return this});var Z=Object.getPrototypeOf,U=Z&&Z(Z(Re([])));U&&U!==P&&x.call(U,R)&&(D=U);var X=N.prototype=ie.prototype=Object.create(D);z.prototype=N,k(X,"constructor",N),k(N,"constructor",z),z.displayName=k(N,A,"GeneratorFunction");function I(f){["next","throw","return"].forEach(function(u){k(f,u,function(p){return this._invoke(u,p)})})}w.isGeneratorFunction=function(f){var u=typeof f=="function"&&f.constructor;return u?u===z||(u.displayName||u.name)==="GeneratorFunction":!1},w.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,N):(f.__proto__=N,k(f,A,"GeneratorFunction")),f.prototype=Object.create(X),f},w.awrap=function(f){return{__await:f}};function Q(f,u){function p(J,H,re,oe){var ne=Y(f[J],f,H);if(ne.type==="throw")oe(ne.arg);else{var Ee=ne.arg,Se=Ee.value;return Se&&typeof Se=="object"&&x.call(Se,"__await")?u.resolve(Se.__await).then(function(ce){p("next",ce,re,oe)},function(ce){p("throw",ce,re,oe)}):u.resolve(Se).then(function(ce){Ee.value=ce,re(Ee)},function(ce){return p("throw",ce,re,oe)})}}var S;function g(J,H){function re(){return new u(function(oe,ne){p(J,H,oe,ne)})}return S=S?S.then(re,re):re()}this._invoke=g}I(Q.prototype),k(Q.prototype,F,function(){return this}),w.AsyncIterator=Q,w.async=function(f,u,p,S,g){g===void 0&&(g=Promise);var J=new Q($(f,u,p,S),g);return w.isGeneratorFunction(u)?J:J.next().then(function(H){return H.done?H.value:J.next()})};function se(f,u,p){var S=T;return function(J,H){if(S===ae)throw new Error("Generator is already running");if(S===te){if(J==="throw")throw H;return Ce()}for(p.method=J,p.arg=H;;){var re=p.delegate;if(re){var oe=_e(re,p);if(oe){if(oe===K)continue;return oe}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(S===T)throw S=te,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);S=ae;var ne=Y(f,u,p);if(ne.type==="normal"){if(S=p.done?te:s,ne.arg===K)continue;return{value:ne.arg,done:p.done}}else ne.type==="throw"&&(S=te,p.method="throw",p.arg=ne.arg)}}}function _e(f,u){var p=f.iterator[u.method];if(p===W){if(u.delegate=null,u.method==="throw"){if(f.iterator.return&&(u.method="return",u.arg=W,_e(f,u),u.method==="throw"))return K;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return K}var S=Y(p,f.iterator,u.arg);if(S.type==="throw")return u.method="throw",u.arg=S.arg,u.delegate=null,K;var g=S.arg;if(!g)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,K;if(g.done)u[f.resultName]=g.value,u.next=f.nextLoc,u.method!=="return"&&(u.method="next",u.arg=W);else return g;return u.delegate=null,K}I(X),k(X,A,"Generator"),k(X,R,function(){return this}),k(X,"toString",function(){return"[object Generator]"});function q(f){var u={tryLoc:f[0]};1 in f&&(u.catchLoc=f[1]),2 in f&&(u.finallyLoc=f[2],u.afterLoc=f[3]),this.tryEntries.push(u)}function B(f){var u=f.completion||{};u.type="normal",delete u.arg,f.completion=u}function Me(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(q,this),this.reset(!0)}w.keys=function(f){var u=[];for(var p in f)u.push(p);return u.reverse(),function S(){for(;u.length;){var g=u.pop();if(g in f)return S.value=g,S.done=!1,S}return S.done=!0,S}};function Re(f){if(f){var u=f[R];if(u)return u.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,S=function g(){for(;++p<f.length;)if(x.call(f,p))return g.value=f[p],g.done=!1,g;return g.value=W,g.done=!0,g};return S.next=S}}return{next:Ce}}w.values=Re;function Ce(){return{value:W,done:!0}}return Me.prototype={constructor:Me,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=W,this.done=!1,this.delegate=null,this.method="next",this.arg=W,this.tryEntries.forEach(B),!f)for(var u in this)u.charAt(0)==="t"&&x.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=W)},stop:function(){this.done=!0;var f=this.tryEntries[0],u=f.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var u=this;function p(oe,ne){return J.type="throw",J.arg=f,u.next=oe,ne&&(u.method="next",u.arg=W),!!ne}for(var S=this.tryEntries.length-1;S>=0;--S){var g=this.tryEntries[S],J=g.completion;if(g.tryLoc==="root")return p("end");if(g.tryLoc<=this.prev){var H=x.call(g,"catchLoc"),re=x.call(g,"finallyLoc");if(H&&re){if(this.prev<g.catchLoc)return p(g.catchLoc,!0);if(this.prev<g.finallyLoc)return p(g.finallyLoc)}else if(H){if(this.prev<g.catchLoc)return p(g.catchLoc,!0)}else if(re){if(this.prev<g.finallyLoc)return p(g.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,u){for(var p=this.tryEntries.length-1;p>=0;--p){var S=this.tryEntries[p];if(S.tryLoc<=this.prev&&x.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var g=S;break}}g&&(f==="break"||f==="continue")&&g.tryLoc<=u&&u<=g.finallyLoc&&(g=null);var J=g?g.completion:{};return J.type=f,J.arg=u,g?(this.method="next",this.next=g.finallyLoc,K):this.complete(J)},complete:function(f,u){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&u&&(this.next=u),K},finish:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.finallyLoc===f)return this.complete(p.completion,p.afterLoc),B(p),K}},catch:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.tryLoc===f){var S=p.completion;if(S.type==="throw"){var g=S.arg;B(p)}return g}}throw new Error("illegal catch attempt")},delegateYield:function(f,u,p){return this.delegate={iterator:Re(f),resultName:u,nextLoc:p},this.method==="next"&&(this.arg=W),K}},w}(L.exports);try{regeneratorRuntime=j}catch(w){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},695:function(L,j,w){w.d(j,{Z:function(){return P}});function P(x){if(x.geometry&&x.geometry.dispose(),x.material){var W=Array.isArray(x.material)?x.material:[x.material];W.forEach(function(O){var R,F,A,k,$,Y,T,s,ae,te,K,ie,z;(R=O.map)===null||R===void 0||R.dispose(),(F=O.lightMap)===null||F===void 0||F.dispose(),(A=O.bumpMap)===null||A===void 0||A.dispose(),(k=O.normalMap)===null||k===void 0||k.dispose(),($=O.specularMap)===null||$===void 0||$.dispose(),(Y=O.envMap)===null||Y===void 0||Y.dispose(),(T=O.alphaMap)===null||T===void 0||T.dispose(),(s=O.aoMap)===null||s===void 0||s.dispose(),(ae=O.displacementMap)===null||ae===void 0||ae.dispose(),(te=O.emissiveMap)===null||te===void 0||te.dispose(),(K=O.gradientMap)===null||K===void 0||K.dispose(),(ie=O.metalnessMap)===null||ie===void 0||ie.dispose(),(z=O.roughnessMap)===null||z===void 0||z.dispose(),O.dispose()})}}},521:function(L,j,w){w.d(j,{wf:function(){return O.Z}});var P=w(666),x=w.n(P),W=null,O=w(695),R=w(949);function F(z){if(z.material){var N=Array.isArray(z.material)?z.material:[z.material];N.forEach(function(D){var Z,U;(Z=D.color)===null||Z===void 0||Z.convertSRGBToLinear(),(U=D.emissive)===null||U===void 0||U.convertSRGBToLinear(),D.map&&(D.map.encoding=THREE.sRGBEncoding),D.emissiveMap&&(D.emissiveMap.encoding=THREE.sRGBEncoding)})}}var A=w(568),k=w(924),$=z=>{var N={};return w.d(N,z),N},Y=z=>()=>z,T=$({get:()=>tt.get,set:()=>tt.set}),s=w(484),ae=null,te=null,K=function(){var z=(0,A.Z)(x().mark(function N(D,Z){var U,X,I,Q,se,_e;return x().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return U=Z.version,B.next=4,(0,T.get)(D);case 4:if(I=B.sent,!(I&&I[U])){B.next=9;break}X=I[U],B.next=15;break;case 9:return B.next=11,(0,s.Z)(fetch(D).then(function(Me){if(Me.ok)return Me.blob();throw new Error}));case 11:Q=B.sent,se=Q.res,_e=Q.err,_e||(X=se,(0,T.set)(D,(0,k.Z)({},U,se)));case 15:return B.abrupt("return",X?{url:URL.createObjectURL(X)}:{url:D});case 16:case"end":return B.stop()}},N)}));return function(D,Z){return z.apply(this,arguments)}}(),ie=w(705)},484:function(L,j,w){w.d(j,{Z:function(){return x}});var P=w(42);function x(W){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return W.then(function(R){return(0,P.Z)({err:null,res:R},O)}).catch(function(R){return(0,P.Z)({err:R,res:void 0},O)})}},705:function(L,j,w){w.d(j,{C:function(){return O},y:function(){return W}});var P=w(949),x=new Map,W=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(F,A,k,$,Y){var T=A[k*3],s=A[k*3+1],ae=A[$*3],te=A[$*3+1],K=A[Y*3],ie=A[Y*3+1],z;if(x.has(F))z=x.get(F);else{var N=R.box3||new P.Box3;if(!R.box3){var D=F.parameters.shapes.getPoints();N.setFromArray(D.map(function(Q){return[Q.x,Q.y,0]}).flat())}var Z=N.getSize(new P.Vector3);R.split&&(Z.y/=R.split),z={box:N,size:Z},x.set(F,z)}var U=z.box,X=z.size,I=R.split?1-R.split:0;return[new P.Vector2((T-U.min.x)/X.x,(s-U.min.y)/X.y+I),new P.Vector2((ae-U.min.x)/X.x,(te-U.min.y)/X.y+I),new P.Vector2((K-U.min.x)/X.x,(ie-U.min.y)/X.y+I)]},generateSideWallUV:function(F,A,k,$,Y,T){var s=A[k*3],ae=A[k*3+1],te=A[k*3+2],K=A[$*3],ie=A[$*3+1],z=A[$*3+2],N=A[Y*3],D=A[Y*3+1],Z=A[Y*3+2],U=A[T*3],X=A[T*3+1],I=A[T*3+2],Q;if(x.has(A))Q=x.get(A);else{var se=new P.Box3;se.setFromArray(A);var _e=se.getSize(new P.Vector3);R.split&&(_e.z/=1-R.split),Q={box:se,size:_e},x.set(A,Q)}var q=Q.box,B=Q.size;return Math.abs(ae-ie)<Math.abs(s-K)?[new P.Vector2((s-q.min.x)/B.x,(te-q.min.z)/B.z),new P.Vector2((K-q.min.x)/B.x,(z-q.min.z)/B.z),new P.Vector2((N-q.min.x)/B.x,(Z-q.min.z)/B.z),new P.Vector2((U-q.min.x)/B.x,(I-q.min.z)/B.z)]:[new P.Vector2((ae-q.min.y)/B.x,(te-q.min.z)/B.z),new P.Vector2((ie-q.min.y)/B.x,(z-q.min.z)/B.z),new P.Vector2((D-q.min.y)/B.x,(Z-q.min.z)/B.z),new P.Vector2((X-q.min.y)/B.x,(I-q.min.z)/B.z)]}}},O=function(){x.clear()}},949:function(L){var j=P=>{var x={};return V.d(x,P),x},w=P=>()=>P;L.exports=It},568:function(L,j,w){w.d(j,{Z:function(){return x}});function P(W,O,R,F,A,k,$){try{var Y=W[k]($),T=Y.value}catch(s){R(s);return}Y.done?O(T):Promise.resolve(T).then(F,A)}function x(W){return function(){var O=this,R=arguments;return new Promise(function(F,A){var k=W.apply(O,R);function $(T){P(k,F,A,$,Y,"next",T)}function Y(T){P(k,F,A,$,Y,"throw",T)}$(void 0)})}}},924:function(L,j,w){w.d(j,{Z:function(){return P}});function P(x,W,O){return W in x?Object.defineProperty(x,W,{value:O,enumerable:!0,configurable:!0,writable:!0}):x[W]=O,x}},42:function(L,j,w){w.d(j,{Z:function(){return x}});var P=w(924);function x(W){for(var O=1;O<arguments.length;O++){var R=arguments[O]!=null?arguments[O]:{},F=Object.keys(R);typeof Object.getOwnPropertySymbols=="function"&&(F=F.concat(Object.getOwnPropertySymbols(R).filter(function(A){return Object.getOwnPropertyDescriptor(R,A).enumerable}))),F.forEach(function(A){(0,P.Z)(W,A,R[A])})}return W}}},it={};function V(L){var j=it[L];if(j!==void 0)return j.exports;var w=it[L]={exports:{}};return Qt[L](w,w.exports,V),w.exports}(function(){V.n=function(L){var j=L&&L.__esModule?function(){return L.default}:function(){return L};return V.d(j,{a:j}),j}})(),function(){V.d=function(L,j){for(var w in j)V.o(j,w)&&!V.o(L,w)&&Object.defineProperty(L,w,{enumerable:!0,get:j[w]})}}(),function(){V.o=function(L,j){return Object.prototype.hasOwnProperty.call(L,j)}}();var me={};(function(){V.d(me,{Ei:function(){return Dt},Yo:function(){return Wt},Ee:function(){return Ee},x1:function(){return dt},VJ:function(){return ge},r7:function(){return De},XA:function(){return Fe},NB:function(){return st},xv:function(){return S},nk:function(){return at}});function L(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function j(e,n){return j=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},j(e,n)}function w(e,n){return j(e,n)}function P(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&w(e,n)}var x=V(42);function W(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function O(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function R(){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(e){return!1}}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},F(e)}function A(e){return F(e)}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $(e){return e&&e.constructor===Symbol?"symbol":typeof e}function Y(e,n){return n&&($(n)==="object"||typeof n=="function")?n:k(e)}function T(e){var n=R();return function(){var i=A(e),a;if(n){var t=A(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return Y(this,a)}}var s=V(949);function ae(){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(e){return!1}}function te(e,n,r){return ae()?te=Reflect.construct:te=function(a,t,o){var c=[null];c.push.apply(c,t);var h=Function.bind.apply(a,c),v=new h;return o&&w(v,o.prototype),v},te.apply(null,arguments)}function K(e,n,r){return te.apply(null,arguments)}function ie(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function z(e,n,r){return n&&ie(e.prototype,n),r&&ie(e,r),e}function N(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function D(e){if(Array.isArray(e))return N(e)}function Z(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function U(){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 X(e,n){if(!!e){if(typeof e=="string")return N(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return N(e,n)}}function I(e){return D(e)||Z(e)||X(e)||U()}var Q=V(484);function se(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(i,a){r.resolve=i,r.reject=a}),e&&(r.promise=(0,Q.Z)(r.promise,n)),r}var _e=e=>{var n={};return V.d(n,e),n},q=e=>()=>e,B=_e({CSS2DObject:()=>Ft.CSS2DObject}),Me=e=>{var n={};return V.d(n,e),n},Re=e=>()=>e,Ce=Me({CSS3DObject:()=>rt.CSS3DObject,CSS3DSprite:()=>rt.CSS3DSprite}),f=V(521),u=function(e){e&&((0,f.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||u(n)}))},p=function(){"use strict";function e(){L(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=se(),this.visible=!1}var n=e.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(i,a){},n.resize=function(i,a){},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 i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=K(s.Mesh,I(a)),this},n.createGroup=function(){return this.object3d=new s.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=K(s.Points,I(a)),this},n.createCSS2DObject=function(i){return this.object3d=new B.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new Ce.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new Ce.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new s.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,I(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,I(a)),this},n.getSize=function(){var i=new s.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new s.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){u(this.object3d)},z(e,[{key:"parent",get:function(){var i=this.object3d.parent;return(i==null?void 0:i.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(i){return i.userData.BaseObject_}).filter(function(i){return!!i})}}]),e}(),S=function(e){"use strict";P(r,e);var n=T(r);function r(a){L(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,x.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,c=t.lookAt,h=t.sprite,v=t.text,d=t.sizeAttenuation;if(h){var m=new s.Sprite(new s.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var _=new s.MeshBasicMaterial({side:s.DoubleSide,transparent:!0}),b=new s.PlaneGeometry(1,1,1,1);this.createMesh(b,_)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},i.setText=function(t,o){var c=(0,x.Z)(O((0,x.Z)({},this.options),{text:t}),o||{}),h=c.text,v=c.fontSize,d=c.fontFamily,m=c.fontWeight,_=c.flipX,b=c.scale,y=this.canvas;y.width=v*h.length*2,y.height=v;var M=y.getContext("2d");M.font="".concat(m," ").concat(v,"px/1 ").concat(d);var l=M.measureText(h).width;y.width=l,this.width=l,M=y.getContext("2d"),M.clearRect(0,0,y.width,y.height),_&&M.scale(-1,1),M.font="".concat(m," ").concat(v,"px/1 ").concat(d),M.textBaseline="middle",M.fillStyle="#ffffff",M.fillText(h,_?l*-1:0,y.height/2),M.restore();var C=new s.Texture(y);C.anisotropy=16,C.needsUpdate=!0;var E=this.object3d;E.material.map&&E.material.map.dispose(),E.material.map=C,E.material.needsUpdate=!0,E.scale.set(C.image.width*b,C.image.height*b,1)},r}(p),g=V(568),J=V(666),H=V.n(J),re=+s.REVISION<144,oe=re?"ExtrudeBufferGeometry":"ExtrudeGeometry",ne=re?"PlaneBufferGeometry":"PlaneGeometry",Ee=function(e){"use strict";P(r,e);var n=T(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=a,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,g.Z)(H().mark(function o(){var c,h,v,d,m,_,b,y,M,l;return H().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return c=t.options,h=c.transparent,v=c.blending,d=c.src,m=c.depthWrite,_=c.alphaTest,b=c.sprite,y=c.sizeAttenuation,E.next=3,new s.TextureLoader().loadAsync(d);case 3:return M=E.sent,l=b?new s.SpriteMaterial({map:M,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:_!=null?_:0,sizeAttenuation:y!=null?y:!0}):new s.MeshBasicMaterial({map:M,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:_!=null?_:0}),E.abrupt("return",l);case 6:case"end":return E.stop()}},o)}))()},i.create=function(){var t=this;return(0,g.Z)(H().mark(function o(){var c,h,v,d,m,_,b,y;return H().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,_=c.sprite,!(m&&!m.get(d))){l.next=7;break}return m.init(d),l.next=5,t.getMaterial();case 5:b=l.sent,m.set(d,b);case 7:if(!m){l.next=13;break}return l.next=10,m.get(d);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:y=l.t0,t.texture=y.map,_?t.createSprite(y):t.createMesh(new s[ne](1,1),y),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(p);function Se(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=A(e),e!==null););return e}function ce(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?ce=Reflect.get:ce=function(a,t,o){var c=Se(a,t);if(!!c){var h=Object.getOwnPropertyDescriptor(c,t);return h.get?h.get.call(o||a):h.value}},ce(e,n,r)}function Be(e,n,r){return ce(e,n,r)}var at=function(e){"use strict";P(r,e);var n=T(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,c=t.transparent,h=t.blending,v=t.depthWrite,d=t.format,m=t.autoPlay,_=t.loop,b=t.alphaTest,y=t.sprite,M=se(),l=document.createElement("video");return l.addEventListener("loadedmetadata",function(){var C=new s.VideoTexture(l);C.format=d!=null?d:s.RGBAFormat,C.needsUpdate=!0;var E=y?new s.SpriteMaterial({map:C,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new s.MeshBasicMaterial({map:C,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});M.resolve(E)},!1),l.src=o,l.muted=!0,l.autoplay=m,l.loop=_,l.preload="auto",M.promise},i.create=function(){var t=this;return(0,g.Z)(H().mark(function o(){var c,h,v,d,m,_,b,y;return H().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,_=c.sprite,!(m&&!m.get(d))){l.next=7;break}return m.init(d),l.next=5,t.getMaterial();case 5:b=l.sent,m.set(d,b);case 7:if(!m){l.next=13;break}return l.next=10,m.get(d);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:y=l.t0,t.video=y.map.image,_?t.createSprite(y):t.createMesh(new s[ne](1,1),y),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),Be(A(r.prototype),"dispose",this).call(this)},r}(p),ot=function(e){"use strict";P(r,e);var n=T(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,c=t.children,h=t.onClick,v=t.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(c),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(m){m.addEventListener("click",h)}),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,g.Z)(H().mark(function o(){var c,h,v,d;return H().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return c=document.createElement("canvas"),c.width=256,c.height=256,h=c.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new s.CanvasTexture(c),d=new s.SpriteMaterial({map:v,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),_.abrupt("return",d);case 9:case"end":return _.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,c=o===void 0?!1:o,h=t.scale,v=h===void 0?new s.Vector3(1,1,1):h,d=t.position,m=d===void 0?new s.Vector3(0,0,0):d,_=t.cache,b=this;return(0,g.Z)(H().mark(function y(){var M,l,C,E;return H().wrap(function(G){for(;;)switch(G.prev=G.next){case 0:if(M="node-create-pick-object",!(_&&!_.get(M))){G.next=7;break}return _.init(M),G.next=5,b.getMaterial(c);case 5:l=G.sent,_.set(M,l);case 7:if(!_){G.next=13;break}return G.next=10,_.get(M);case 10:G.t0=G.sent,G.next=16;break;case 13:return G.next=15,b.getMaterial(c);case 15:G.t0=G.sent;case 16:C=G.t0,E=new s.Sprite(C),E.scale.set(C.map.image.width*v.x,C.map.image.height*v.y,1),E.position.copy(m),b.add(E),b.pickObject=E;case 22:case"end":return G.stop()}},y)}))()},i.dispose=function(){var t=this.options.onClick;t&&this.clickTarge.forEach(function(o){o.removeEventListener("click",t)}),Be(A(r.prototype),"dispose",this).call(this)},z(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.clickTarge;if(o){var c=o.map(function(h){return I(t.element.querySelectorAll(h))}).flat();return c}return[this.element]}}]),r}(p),st=ot,ut=`
|
|
2
2
|
`.concat(s.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
3
|
`).concat(s.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
@@ -95,7 +95,7 @@ import*as et from"idb-keyval";import*as W from"three";import*as Vt from"three/ex
|
|
|
95
95
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
96
96
|
`).concat(s.ShaderChunk.fog_vertex,`
|
|
97
97
|
}
|
|
98
|
-
`),
|
|
98
|
+
`),ct=`
|
|
99
99
|
`.concat(s.ShaderChunk.fog_pars_fragment,`
|
|
100
100
|
`).concat(s.ShaderChunk.logdepthbuf_pars_fragment,`
|
|
101
101
|
|
|
@@ -129,4 +129,4 @@ void main() {
|
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
130
|
`).concat(s.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),ge=function(e){"use strict";P(r,e);var n=R(r);function r(){L(this,r);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new s.Matrix4,Object.defineProperties(k(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(s.BufferGeometry);ge.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ge.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},ge.prototype.setPoints=function(e,n){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=n,this.positions=[],this.counters=[],e.length&&e[0]instanceof s.Vector3)for(var r=0;r<e.length;r++){var i=e[r],a=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ie(e,n){var r=new s.Matrix4,i=new s.Ray,a=new s.Sphere,t=new s.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),i.copy(e.ray).applyMatrix4(r);var c=new s.Vector3,h=new s.Vector3,v=new s.Vector3,d=this instanceof s.LineSegments?2:1,m=o.index,_=o.attributes;if(m!==null)for(var b=m.array,y=_.position.array,A=_.width.array,l=0,C=b.length-1;l<C;l+=d){var E=b[l],te=b[l+1];c.fromArray(y,E*3),h.fromArray(y,te*3);var V=A[Math.floor(l/3)]!==void 0?A[Math.floor(l/3)]:1,le=e.params.Line.threshold+this.material.lineWidth*V/2,de=le*le,Ae=i.distanceSqToSegment(c,h,t,v);if(!(Ae>de)){t.applyMatrix4(this.matrixWorld);var fe=e.ray.origin.distanceTo(t);fe<e.near||fe>e.far||(n.push({distance:fe,point:v.clone().applyMatrix4(this.matrixWorld),index:l,face:null,faceIndex:null,object:this}),l=C)}}}}ge.prototype.raycast=Ie,ge.prototype.compareV3=function(e,n){var r=e*6,i=n*6;return this.positions[r]===this.positions[i]&&this.positions[r+1]===this.positions[i+1]&&this.positions[r+2]===this.positions[i+2]},ge.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},ge.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,r;this.compareV3(0,e-1)?r=this.copyV3(e-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 i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(e-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(r=this.copyV3(i),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-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 s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.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 ze(e,n,r,i,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=n?e.subarray?e.subarray(n,a&&n+a):e.slice(n,a&&n+a):e,r.set)r.set(e,i);else for(t=0;t<e.length;t++)r[t+i]=e[t];return r}ge.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;ze(n,0,r,0,a),ze(n,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,ze(n,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=it,s.ShaderChunk.meshline_frag=at;var Ge=function(e){"use strict";P(r,e);var n=R(r);function r(i){L(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.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 s.Vector2(1,1)},offset:{value:new s.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new s.Vector2(0,0)},lightColor:{value:new s.Color(16777215)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(k(a),{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)}}}),a.setValues(i),a}return r}(s.ShaderMaterial);Ge.prototype.copy=function(e){return s.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function ot(e,n){if(e==null)return{};var r={},i=Object.keys(e),a,t;for(t=0;t<i.length;t++)a=i[t],!(n.indexOf(a)>=0)&&(r[a]=e[a]);return r}function st(e,n){if(e==null)return{};var r=ot(e,n),i,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)i=t[a],!(n.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}var ut=e=>{var n={};return N.d(n,e),n},or=e=>()=>e,ct=ut({animate:()=>Ut.animate}),lt=e=>{var n={};return N.d(n,e),n},sr=e=>()=>e,Ze=lt({mergeBufferGeometries:()=>Nt.mergeBufferGeometries});function Xe(e){var n=e.setPointWidth,r=e.nodes,i=new s.BufferGeometry,a=new ge;return i.setFromPoints(r),a.setGeometry(i,n),a}var ft={color:new s.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},ht=function(e){"use strict";P(r,e);var n=R(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},ft,a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,c=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,_=o.nodes,b=o.nodesArr,y=o.coordinatesArr,A=o.projection,l=o.workerController,C=o.useGroups,E=st(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","workerController","useGroups"]),te=this.pencil.getSize(),V=te.width,le=te.height,de=new Ge(O((0,M.Z)({},E),{resolution:new s.Vector2(V,le)}));if(this.material=de,_)this.createMesh(Xe({nodes:_,setPointWidth:d}),de);else if(b){var Ae=Ze.mergeBufferGeometries(b.map(function(fe){return Xe({nodes:fe,setPointWidth:d})}),C!=null?C:!1);this.createMesh(Ae,de)}else if(y&&l)return new Promise(function(fe){l.postMessage({coordinatesArr:y,projection:A,useGroups:C},function(ce){var be=new s.BufferGeometry;Object.keys(ce).forEach(function(he){he==="index"?be.setIndex(new s.BufferAttribute(ce[he].array,ce[he].itemSize)):be.setAttribute(he,new s.BufferAttribute(ce[he].array,ce[he].itemSize))}),t.createMesh(be,de),fe("")})})},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,c=t.delay,h=t.onComplete,v=this.material.uniforms.offset,d=c!=null?c:0,m=(0,ct.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,onUpdate:function(_){v.value.x=_.x}});this.tween=m},i.dispose=function(){var t;Oe(x(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(p);function pt(e){if(Array.isArray(e))return e}function vt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ye(e,n){return pt(e)||X(e,n)||H(e,n)||vt()}var dt=e=>{var n={};return N.d(n,e),n},ur=e=>()=>e,Ee=dt({extent:()=>Fe.extent,mean:()=>Fe.mean,merge:()=>Fe.merge}),mt=e=>{var n={};return N.d(n,e),n},cr=e=>()=>e,De=mt({default:()=>Ft.default}),_t=e=>{var n={};return N.d(n,e),n},lr=e=>()=>e,gt=_t({default:()=>It.default});function yt(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-n)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(i)*Math.cos(a),r*Math.cos(i),r*Math.sin(i)*Math.sin(a)]}var bt=e=>{var n={};return N.d(n,e),n},fr=e=>()=>e,wt=bt({default:()=>Zt.default}),xt=e=>{var n={};return N.d(n,e),n},hr=e=>()=>e,At=xt({default:()=>Xt.default}),Mt=e=>{var n={};return N.d(n,e),n},pr=e=>()=>e,je=Mt({geoBounds:()=>Re.geoBounds,geoContains:()=>Re.geoContains,geoDistance:()=>Re.geoDistance,geoInterpolate:()=>Re.geoInterpolate}),St=e=>{var n={};return N.d(n,e),n},vr=e=>()=>e,Pt=St({geoVoronoi:()=>Ht.geoVoronoi}),Ot=e=>{var n={};return N.d(n,e),n},dr=e=>()=>e,He=Ot({scaleLinear:()=>Kt.scaleLinear});function Ct(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,je.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var c=(0,je.geoInterpolate)(a,t),h=1/Math.ceil(o/n),v=h;v<1;)i.push(c(v)),v+=h}i.push(a=t)}),i})}function Et(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),c=(1+Math.sqrt(5))/2,h=function(l){return l/c*360%360-180},v=function(l){return Math.acos(2*l/o-1)/Math.PI*180-90},d=function(l){return o*(Math.cos((l+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],_=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(l){return l<=i}:i===void 0?function(l){return l>=r}:i>=r?function(l){return l>=r&&l<=i}:function(l){return l>=r||l<=i},b=[],y=m[0];y<=m[1];y++){var A=h(y);_(A)&&b.push([A,v(y)])}return b}function We(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,je.geoContains)(n,e):(0,At.default)(e,n)}function Lt(e,n){var r={type:"Polygon",coordinates:e},i=ye((0,je.geoBounds)(r),2),a=ye(i[0],2),t=a[0],o=a[1],c=ye(i[1],2),h=c[0],v=c[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<n)return[];var d=t>h||v>=89||o<=-89;return Et(n,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(m){return We(m,r,d)})}function jt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=Ct(e,i),t=(0,Ee.merge)(a),o=Lt(e,i),c=I(t).concat(I(o)),h={type:"Polygon",coordinates:e},v=ye((0,je.geoBounds)(h),2),d=ye(v[0],2),m=d[0],_=d[1],b=ye(v[1],2),y=b[0],A=b[1],l=m>y||A>=89||_<=-89,C=[];if(l){var E=(0,Pt.geoVoronoi)(c).triangles(),te=new Map(c.map(function(pe,Pe){var Me=ye(pe,2),ve=Me[0],Be=Me[1];return["".concat(ve,"-").concat(Be),Pe]}));E.features.forEach(function(pe){var Pe,Me=pe.geometry.coordinates[0].slice(0,3).reverse(),ve=[];if(Me.forEach(function(ke){var we=ye(ke,2),Ne=we[0],Wt=we[1],qe="".concat(Ne,"-").concat(Wt);te.has(qe)&&ve.push(te.get(qe))}),ve.length===3){if(ve.some(function(ke){return ke<t.length})){var Be=pe.properties.circumcenter;if(!We(Be,h,l))return}(Pe=C).push.apply(Pe,I(ve))}})}else if(o.length)for(var fe=function(pe,Pe){var Me,ve=[2,1,0].map(function(we){return ce.triangles[pe+we]}),Be=ve.map(function(we){return c[we]});if(ve.some(function(we){return we<t.length})){var ke=[0,1].map(function(we){return(0,Ee.mean)(Be,function(Ne){return Ne[we]})});if(!We(ke,h,l))return"continue"}(Me=C).push.apply(Me,I(ve))},ce=wt.default.from(c),be=0,he=ce.triangles.length;be<he;be+=3)fe(be,he);else{var V=De.default.flatten(a),le=V.vertices,de=V.holes,Ae=de===void 0?[]:de;C=(0,De.default)(le,Ae,2)}var Ue=(0,He.scaleLinear)((0,Ee.extent)(c,function(pe){return pe[0]}),[0,1]),zt=(0,He.scaleLinear)((0,Ee.extent)(c,function(pe){return pe[1]}),[0,1]),Gt=c.map(function(pe){var Pe=ye(pe,2),Me=Pe[0],ve=Pe[1];return[Ue(Me),zt(ve)]}),Dt={points:c,indices:C,uvs:Gt};return{contour:a,triangles:Dt}}var Bt=jt,Ke=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ve(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=ye(t,2),c=o[0],h=o[1];return r?yt(c,h,n):[c,h,n]})});return De.default.flatten(i)}function $e(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ve(e,n,i),t=a.vertices,o=a.holes,c=Ve(e,r,i),h=c.vertices,v=(0,Ee.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),_=0,b=[],y=0;y<d;y++){var A=y+1;if(A===d)A=_;else if(m.has(A)){var l=A;A=_,_=l}b.push(y,y+d,A+d),b.push(A+d,A,y)}for(var C=[],E=1;E>=0;E--)for(var te=0;te<d;te+=1)C.push(te/(d-1),E);return{indices:b,vertices:v,uvs:C,topVerts:h}}function Ye(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:Ve([e.points],n,a).vertices,uvs:r}}var kt=function(e){"use strict";P(r,e);var n=R(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};L(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,M.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,c=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,_=o.curvatureResolution,b=o.cartesian,y=o.userDataRsoOffset;(0,gt.default)(i[0])||i[0].reverse();var A=Bt(i,{resolution:_}),l=A.contour,C=A.triangles,E=(0,Ee.merge)(C.uvs),te=[],V=[],le=[],de=0,Ae=function(ce){var be=Math.round(te.length/3),he=le.length;te=te.concat(ce.vertices),V=V.concat(ce.uvs),le=le.concat(be?ce.indices.map(function(Ue){return Ue+be}):ce.indices),t.addGroup(he,le.length-he,de++)};if(m){var fe=$e(l,c,h,b);Ae(fe),t.userData.rso=y?$e(l,c,h+y,b):fe}return v&&Ae(Ye(C,c,E,!1,b)),d&&Ae(Ye(C,h,E,!0,b)),t.setIndex(le),t[Ke]("position",new s.Float32BufferAttribute(te,3)),t[Ke]("uv",new s.Float32BufferAttribute(V,2)),t.computeVertexNormals(),t}return r}(s.BufferGeometry),Tt=function(e){"use strict";P(r,e);var n=R(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,c=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,_=t.cartesian,b=new kt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:_,userDataRsoOffset:m});this.createMesh(b,this.options.material)},r}(p),Je=N(705);function Qe(e){var n=e.split,r=e.depth,i=e.points,a=new s.ExtrudeGeometry(new s.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,Je.y)({split:n})});return(0,Je.C)(),a}var Rt=function(e){"use strict";P(r,e);var n=R(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,c=o.points,h=o.pointsArr,v=o.coordinatesArr,d=o.material,m=o.useGroups,_=o.depth,b=o.split,y=o.workerController,A=o.projection;if(c)this.createMesh(Qe({points:c,depth:_,split:b}),d);else if(h){var l=Ze.mergeBufferGeometries(h.map(function(C){return Qe({points:C,depth:_,split:b})}),m!=null?m:!1);this.createMesh(l,d)}else if(v&&y)return new Promise(function(C){y.postMessage({coordinatesArr:v,depth:_,split:b,useGroups:m,projection:A},function(E){var te=new s.BufferGeometry;Object.keys(E).forEach(function(V){te.setAttribute(V,new s.BufferAttribute(E[V].array,E[V].itemSize))}),t.createMesh(te,d),C("")})})},r}(p)})();var Yt=me.Ei,Jt=me.Yo,Qt=me.Ee,qt=me.x1,er=me.VJ,tr=me.r7,rr=me.XA,nr=me.NB,ir=me.xv,ar=me.nk;export{Yt as ConicPolygon,Jt as ExtrudePolygon,Qt as Image,qt as Line,er as MeshLine,tr as MeshLineMaterial,rr as MeshLineRaycast,nr as Node,ir as Text,ar as Video};
|
|
132
|
+
`),ge=function(e){"use strict";P(r,e);var n=T(r);function r(){L(this,r);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new s.Matrix4,Object.defineProperties(k(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(s.BufferGeometry);ge.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ge.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},ge.prototype.setPoints=function(e,n){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=n,this.positions=[],this.counters=[],e.length&&e[0]instanceof s.Vector3)for(var r=0;r<e.length;r++){var i=e[r],a=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Fe(e,n){var r=new s.Matrix4,i=new s.Ray,a=new s.Sphere,t=new s.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),i.copy(e.ray).applyMatrix4(r);var c=new s.Vector3,h=new s.Vector3,v=new s.Vector3,d=this instanceof s.LineSegments?2:1,m=o.index,_=o.attributes;if(m!==null)for(var b=m.array,y=_.position.array,M=_.width.array,l=0,C=b.length-1;l<C;l+=d){var E=b[l],ee=b[l+1];c.fromArray(y,E*3),h.fromArray(y,ee*3);var G=M[Math.floor(l/3)]!==void 0?M[Math.floor(l/3)]:1,le=e.params.Line.threshold+this.material.lineWidth*G/2,de=le*le,xe=i.distanceSqToSegment(c,h,t,v);if(!(xe>de)){t.applyMatrix4(this.matrixWorld);var fe=e.ray.origin.distanceTo(t);fe<e.near||fe>e.far||(n.push({distance:fe,point:v.clone().applyMatrix4(this.matrixWorld),index:l,face:null,faceIndex:null,object:this}),l=C)}}}}ge.prototype.raycast=Fe,ge.prototype.compareV3=function(e,n){var r=e*6,i=n*6;return this.positions[r]===this.positions[i]&&this.positions[r+1]===this.positions[i+1]&&this.positions[r+2]===this.positions[i+2]},ge.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},ge.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,r;this.compareV3(0,e-1)?r=this.copyV3(e-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 i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(e-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(r=this.copyV3(i),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-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 s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.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 ze(e,n,r,i,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=n?e.subarray?e.subarray(n,a&&n+a):e.slice(n,a&&n+a):e,r.set)r.set(e,i);else for(t=0;t<e.length;t++)r[t+i]=e[t];return r}ge.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;ze(n,0,r,0,a),ze(n,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,ze(n,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=ut,s.ShaderChunk.meshline_frag=ct;var De=function(e){"use strict";P(r,e);var n=T(r);function r(i){L(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.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 s.Vector2(1,1)},offset:{value:new s.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new s.Vector2(0,0)},lightColor:{value:new s.Color(16777215)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(k(a),{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)}}}),a.setValues(i),a}return r}(s.ShaderMaterial);De.prototype.copy=function(e){return s.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function lt(e,n){if(e==null)return{};var r={},i=Object.keys(e),a,t;for(t=0;t<i.length;t++)a=i[t],!(n.indexOf(a)>=0)&&(r[a]=e[a]);return r}function ft(e,n){if(e==null)return{};var r=lt(e,n),i,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)i=t[a],!(n.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}var ht=e=>{var n={};return V.d(n,e),n},cr=e=>()=>e,Ze=ht({animate:()=>nt.animate,linear:()=>nt.linear}),pt=e=>{var n={};return V.d(n,e),n},lr=e=>()=>e,Xe=pt({mergeBufferGeometries:()=>Zt.mergeBufferGeometries});function He(e){var n=e.setPointWidth,r=e.nodes,i=new s.BufferGeometry,a=new ge;return i.setFromPoints(r),a.setGeometry(i,n),a}var vt={color:new s.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},dt=function(e){"use strict";P(r,e);var n=T(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},vt,a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,c=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,_=o.nodes,b=o.nodesArr,y=o.coordinatesArr,M=o.projection,l=o.workerController,C=o.useGroups,E=ft(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","workerController","useGroups"]),ee=this.pencil.getSize(),G=ee.width,le=ee.height,de=new De(O((0,x.Z)({},E),{resolution:new s.Vector2(G,le)}));if(this.material=de,_)this.createMesh(He({nodes:_,setPointWidth:d}),de);else if(b){var xe=Xe.mergeBufferGeometries(b.map(function(fe){return He({nodes:fe,setPointWidth:d})}),C!=null?C:!1);this.createMesh(xe,de)}else if(y&&l)return new Promise(function(fe){l.postMessage({coordinatesArr:y,projection:M,useGroups:C},function(ue){var be=new s.BufferGeometry;Object.keys(ue).forEach(function(he){he==="index"?be.setIndex(new s.BufferAttribute(ue[he].array,ue[he].itemSize)):be.setAttribute(he,new s.BufferAttribute(ue[he].array,ue[he].itemSize))}),t.createMesh(be,de),fe("")})})},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,c=t.delay,h=t.onComplete,v=this.material.uniforms.offset,d=c!=null?c:0,m=(0,Ze.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:Ze.linear,onUpdate:function(_){v.value.x=_.x}});this.tween=m},i.dispose=function(){var t;Be(A(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(p);function mt(e){if(Array.isArray(e))return e}function _t(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ye(e,n){return mt(e)||Z(e,n)||X(e,n)||_t()}var gt=e=>{var n={};return V.d(n,e),n},fr=e=>()=>e,Oe=gt({extent:()=>Ie.extent,mean:()=>Ie.mean,merge:()=>Ie.merge}),yt=e=>{var n={};return V.d(n,e),n},hr=e=>()=>e,We=yt({default:()=>Xt.default}),bt=e=>{var n={};return V.d(n,e),n},pr=e=>()=>e,wt=bt({default:()=>Ht.default});function xt(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-n)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(i)*Math.cos(a),r*Math.cos(i),r*Math.sin(i)*Math.sin(a)]}var At=e=>{var n={};return V.d(n,e),n},vr=e=>()=>e,Mt=At({default:()=>Kt.default}),Pt=e=>{var n={};return V.d(n,e),n},dr=e=>()=>e,St=Pt({default:()=>$t.default}),Ot=e=>{var n={};return V.d(n,e),n},mr=e=>()=>e,Le=Ot({geoBounds:()=>Te.geoBounds,geoContains:()=>Te.geoContains,geoDistance:()=>Te.geoDistance,geoInterpolate:()=>Te.geoInterpolate}),Ct=e=>{var n={};return V.d(n,e),n},_r=e=>()=>e,Et=Ct({geoVoronoi:()=>Yt.geoVoronoi}),Lt=e=>{var n={};return V.d(n,e),n},gr=e=>()=>e,Ke=Lt({scaleLinear:()=>Jt.scaleLinear});function jt(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Le.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var c=(0,Le.geoInterpolate)(a,t),h=1/Math.ceil(o/n),v=h;v<1;)i.push(c(v)),v+=h}i.push(a=t)}),i})}function kt(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),c=(1+Math.sqrt(5))/2,h=function(l){return l/c*360%360-180},v=function(l){return Math.acos(2*l/o-1)/Math.PI*180-90},d=function(l){return o*(Math.cos((l+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],_=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(l){return l<=i}:i===void 0?function(l){return l>=r}:i>=r?function(l){return l>=r&&l<=i}:function(l){return l>=r||l<=i},b=[],y=m[0];y<=m[1];y++){var M=h(y);_(M)&&b.push([M,v(y)])}return b}function Ge(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Le.geoContains)(n,e):(0,St.default)(e,n)}function Rt(e,n){var r={type:"Polygon",coordinates:e},i=ye((0,Le.geoBounds)(r),2),a=ye(i[0],2),t=a[0],o=a[1],c=ye(i[1],2),h=c[0],v=c[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<n)return[];var d=t>h||v>=89||o<=-89;return kt(n,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(m){return Ge(m,r,d)})}function Tt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=jt(e,i),t=(0,Oe.merge)(a),o=Rt(e,i),c=I(t).concat(I(o)),h={type:"Polygon",coordinates:e},v=ye((0,Le.geoBounds)(h),2),d=ye(v[0],2),m=d[0],_=d[1],b=ye(v[1],2),y=b[0],M=b[1],l=m>y||M>=89||_<=-89,C=[];if(l){var E=(0,Et.geoVoronoi)(c).triangles(),ee=new Map(c.map(function(pe,Pe){var Ae=ye(pe,2),ve=Ae[0],je=Ae[1];return["".concat(ve,"-").concat(je),Pe]}));E.features.forEach(function(pe){var Pe,Ae=pe.geometry.coordinates[0].slice(0,3).reverse(),ve=[];if(Ae.forEach(function(ke){var we=ye(ke,2),Ne=we[0],Nt=we[1],et="".concat(Ne,"-").concat(Nt);ee.has(et)&&ve.push(ee.get(et))}),ve.length===3){if(ve.some(function(ke){return ke<t.length})){var je=pe.properties.circumcenter;if(!Ge(je,h,l))return}(Pe=C).push.apply(Pe,I(ve))}})}else if(o.length)for(var fe=function(pe,Pe){var Ae,ve=[2,1,0].map(function(we){return ue.triangles[pe+we]}),je=ve.map(function(we){return c[we]});if(ve.some(function(we){return we<t.length})){var ke=[0,1].map(function(we){return(0,Oe.mean)(je,function(Ne){return Ne[we]})});if(!Ge(ke,h,l))return"continue"}(Ae=C).push.apply(Ae,I(ve))},ue=Mt.default.from(c),be=0,he=ue.triangles.length;be<he;be+=3)fe(be,he);else{var G=We.default.flatten(a),le=G.vertices,de=G.holes,xe=de===void 0?[]:de;C=(0,We.default)(le,xe,2)}var Ue=(0,Ke.scaleLinear)((0,Oe.extent)(c,function(pe){return pe[0]}),[0,1]),Gt=(0,Ke.scaleLinear)((0,Oe.extent)(c,function(pe){return pe[1]}),[0,1]),Vt=c.map(function(pe){var Pe=ye(pe,2),Ae=Pe[0],ve=Pe[1];return[Ue(Ae),Gt(ve)]}),Ut={points:c,indices:C,uvs:Vt};return{contour:a,triangles:Ut}}var Bt=Tt,$e=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ve(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=ye(t,2),c=o[0],h=o[1];return r?xt(c,h,n):[c,h,n]})});return We.default.flatten(i)}function Ye(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ve(e,n,i),t=a.vertices,o=a.holes,c=Ve(e,r,i),h=c.vertices,v=(0,Oe.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),_=0,b=[],y=0;y<d;y++){var M=y+1;if(M===d)M=_;else if(m.has(M)){var l=M;M=_,_=l}b.push(y,y+d,M+d),b.push(M+d,M,y)}for(var C=[],E=1;E>=0;E--)for(var ee=0;ee<d;ee+=1)C.push(ee/(d-1),E);return{indices:b,vertices:v,uvs:C,topVerts:h}}function Je(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:Ve([e.points],n,a).vertices,uvs:r}}var zt=function(e){"use strict";P(r,e);var n=T(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};L(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,x.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,c=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,_=o.curvatureResolution,b=o.cartesian,y=o.userDataRsoOffset;(0,wt.default)(i[0])||i[0].reverse();var M=Bt(i,{resolution:_}),l=M.contour,C=M.triangles,E=(0,Oe.merge)(C.uvs),ee=[],G=[],le=[],de=0,xe=function(ue){var be=Math.round(ee.length/3),he=le.length;ee=ee.concat(ue.vertices),G=G.concat(ue.uvs),le=le.concat(be?ue.indices.map(function(Ue){return Ue+be}):ue.indices),t.addGroup(he,le.length-he,de++)};if(m){var fe=Ye(l,c,h,b);xe(fe),t.userData.rso=y?Ye(l,c,h+y,b):fe}return v&&xe(Je(C,c,E,!1,b)),d&&xe(Je(C,h,E,!0,b)),t.setIndex(le),t[$e]("position",new s.Float32BufferAttribute(ee,3)),t[$e]("uv",new s.Float32BufferAttribute(G,2)),t.computeVertexNormals(),t}return r}(s.BufferGeometry),Dt=function(e){"use strict";P(r,e);var n=T(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,c=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,_=t.cartesian,b=new zt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:_,userDataRsoOffset:m});this.createMesh(b,this.options.material)},r}(p),Qe=V(705);function qe(e){var n=e.split,r=e.depth,i=e.points,a=new s[oe](new s.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,Qe.y)({split:n})});return(0,Qe.C)(),a}var Wt=function(e){"use strict";P(r,e);var n=T(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,c=o.points,h=o.pointsArr,v=o.coordinatesArr,d=o.material,m=o.useGroups,_=o.depth,b=o.split,y=o.workerController,M=o.projection;if(c)this.createMesh(qe({points:c,depth:_,split:b}),d);else if(h){var l=Xe.mergeBufferGeometries(h.map(function(C){return qe({points:C,depth:_,split:b})}),m!=null?m:!1);this.createMesh(l,d)}else if(v&&y)return new Promise(function(C){y.postMessage({coordinatesArr:v,depth:_,split:b,useGroups:m,projection:M},function(E){var ee=new s.BufferGeometry;Object.keys(E).forEach(function(G){ee.setAttribute(G,new s.BufferAttribute(E[G].array,E[G].itemSize))}),t.createMesh(ee,d),C("")})})},r}(p)})();var qt=me.Ei,er=me.Yo,tr=me.Ee,rr=me.x1,nr=me.VJ,ir=me.r7,ar=me.XA,or=me.NB,sr=me.xv,ur=me.nk;export{qt as ConicPolygon,er as ExtrudePolygon,tr as Image,rr as Line,nr as MeshLine,ir as MeshLineMaterial,ar as MeshLineRaycast,or as Node,sr as Text,ur as Video};
|