gl-draw 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/objects/index.js
CHANGED
|
@@ -129,4 +129,4 @@ void main() {
|
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
130
|
`).concat(c.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),te=function(t){"use strict";S(r,t);var i=B(r);function r(){j(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new c.Matrix4,Object.defineProperties(y(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(c.BufferGeometry);te.prototype.setMatrixWorld=function(t){this.matrixWorld=t},te.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},te.prototype.setPoints=function(t,i){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=i,this.positions=[],this.counters=[],t.length&&t[0]instanceof c.Vector3)for(var r=0;r<t.length;r++){var n=t[r],a=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<t.length;r+=3){var a=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ue(t,i){var r=new c.Matrix4,n=new c.Ray,a=new c.Sphere,e=new c.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(a,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var s=new c.Vector3,f=new c.Vector3,v=new c.Vector3,d=this instanceof c.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var x=m.array,_=g.position.array,M=g.width.array,h=0,R=x.length-1;h<R;h+=d){var k=x[h],oe=x[h+1];s.fromArray(_,k*3),f.fromArray(_,oe*3);var D=M[Math.floor(h/3)]!==void 0?M[Math.floor(h/3)]:1,de=t.params.Line.threshold+this.material.lineWidth*D/2,Pe=de*de,we=n.distanceSqToSegment(s,f,e,v);if(!(we>Pe)){e.applyMatrix4(this.matrixWorld);var ye=t.ray.origin.distanceTo(e);ye<t.near||ye>t.far||(i.push({distance:ye,point:v.clone().applyMatrix4(this.matrixWorld),index:h,face:null,faceIndex:null,object:this}),h=R)}}}}te.prototype.raycast=Ue,te.prototype.compareV3=function(t,i){var r=t*6,n=i*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},te.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},te.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(t-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=n*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.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(t,i,r,n,a){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=i?t.subarray?t.subarray(i,a&&i+a):t.slice(i,a&&i+a):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}te.prototype.advance=function(t){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;ze(i,0,r,0,a),ze(i,6,i,0,a-6),i[a-6]=t.x,i[a-5]=t.y,i[a-4]=t.z,i[a-3]=t.x,i[a-2]=t.y,i[a-1]=t.z,ze(i,6,n,0,a-6),n[a-6]=t.x,n[a-5]=t.y,n[a-4]=t.z,n[a-3]=t.x,n[a-2]=t.y,n[a-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},c.ShaderChunk.meshline_vert=Ae,c.ShaderChunk.meshline_frag=_e;var Re=function(t){"use strict";S(r,t);var i=B(r);function r(n){j(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.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 c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(y(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(n),a}return r}(c.ShaderMaterial);Re.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function Ke(t,i){if(t==null)return{};var r={},n=Object.keys(t),a,e;for(e=0;e<n.length;e++)a=n[e],!(i.indexOf(a)>=0)&&(r[a]=t[a]);return r}function Xe(t,i){if(t==null)return{};var r=Ke(t,i),n,a;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(a=0;a<e.length;a++)n=e[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Ye=require("popmotion"),Fe=require("three/examples/jsm//utils/BufferGeometryUtils"),Qe={nodes:[],color:new c.Color("red"),lineWidth:3,sizeAttenuation:0},Je=function(t){"use strict";S(r,t);var i=B(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},Qe,a),e}var n=r.prototype;return n.create=function(){var e=this,o=this.options,s=o.duration,f=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,g=o.nodes,x=o.nodesArr,_=Xe(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr"]),M=this.pencil.getSize(),h=M.width,R=M.height,k=new Re(O((0,A.Z)({},_),{resolution:new c.Vector2(h,R)}));if(this.material=k,g)this.createMesh(this.createGeometry(g),k);else if(x){var oe=Fe.mergeBufferGeometries(x.map(function(D){return e.createGeometry(D)}),!0);this.createMesh(oe,k)}},n.createGeometry=function(e){var o=this.options.setPointWidth,s=new c.BufferGeometry,f=new te;return s.setFromPoints(e),f.setGeometry(s,o),f},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,s=e.delay,f=e.onComplete,v=this.material.uniforms.offset,d=s!=null?s:0,m=(0,Ye.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:f,onUpdate:function(g){v.value.x=g.x}});this.tween=m},n.dispose=function(){ee(E(r.prototype),"dispose",this).call(this),this.tween.stop()},r}(he);function et(t){if(Array.isArray(t))return t}function tt(){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 ve(t,i){return et(t)||re(t,i)||H(t,i)||tt()}var Me=require("d3-array"),rt=require("earcut"),Ee=q.n(rt),nt=require("@turf/boolean-clockwise"),it=q.n(nt);function at(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var ot=require("delaunator"),st=q.n(ot),ut=require("@turf/boolean-point-in-polygon"),ct=q.n(ut),Oe=require("d3-geo"),lt=require("d3-geo-voronoi"),Ie=require("d3-scale");function ft(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Oe.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var s=(0,Oe.geoInterpolate)(a,e),f=1/Math.ceil(o/i),v=f;v<1;)n.push(s(v)),v+=f}n.push(a=e)}),n})}function ht(t){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,e=i.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),s=(1+Math.sqrt(5))/2,f=function(h){return h/s*360%360-180},v=function(h){return Math.acos(2*h/o-1)/Math.PI*180-90},d=function(h){return o*(Math.cos((h+90)*Math.PI/180)+1)/2},m=[e!==void 0?Math.ceil(d(e)):0,a!==void 0?Math.floor(d(a)):o-1],g=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(h){return h<=n}:n===void 0?function(h){return h>=r}:n>=r?function(h){return h>=r&&h<=n}:function(h){return h>=r||h<=n},x=[],_=m[0];_<=m[1];_++){var M=f(_);g(M)&&x.push([M,v(_)])}return x}function Be(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Oe.geoContains)(i,t):ct()(t,i)}function pt(t,i){var r={type:"Polygon",coordinates:t},n=ve((0,Oe.geoBounds)(r),2),a=ve(n[0],2),e=a[0],o=a[1],s=ve(n[1],2),f=s[0],v=s[1];if(Math.min(Math.abs(f-e),Math.abs(v-o))<i)return[];var d=e>f||v>=89||o<=-89;return ht(i,{minLng:e,maxLng:f,minLat:o,maxLat:v}).filter(function(m){return Be(m,r,d)})}function vt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=ft(t,n),e=(0,Me.merge)(a),o=pt(t,n),s=W(e).concat(W(o)),f={type:"Polygon",coordinates:t},v=ve((0,Oe.geoBounds)(f),2),d=ve(v[0],2),m=d[0],g=d[1],x=ve(v[1],2),_=x[0],M=x[1],h=m>_||M>=89||g<=-89,R=[];if(h){var k=(0,lt.geoVoronoi)(s).triangles(),oe=new Map(s.map(function(le,be){var ge=ve(le,2),fe=ge[0],Ce=ge[1];return["".concat(fe,"-").concat(Ce),be]}));k.features.forEach(function(le){var be,ge=le.geometry.coordinates[0].slice(0,3).reverse(),fe=[];if(ge.forEach(function(Le){var me=ve(Le,2),We=me[0],Mt=me[1],$e="".concat(We,"-").concat(Mt);oe.has($e)&&fe.push(oe.get($e))}),fe.length===3){if(fe.some(function(Le){return Le<e.length})){var Ce=le.properties.circumcenter;if(!Be(Ce,f,h))return}(be=R).push.apply(be,W(fe))}})}else if(o.length)for(var ye=function(le,be){var ge,fe=[2,1,0].map(function(me){return xe.triangles[le+me]}),Ce=fe.map(function(me){return s[me]});if(fe.some(function(me){return me<e.length})){var Le=[0,1].map(function(me){return(0,Me.mean)(Ce,function(We){return We[me]})});if(!Be(Le,f,h))return"continue"}(ge=R).push.apply(ge,W(fe))},xe=st().from(s),Se=0,je=xe.triangles.length;Se<je;Se+=3)ye(Se,je);else{var D=Ee().flatten(a),de=D.vertices,Pe=D.holes,we=Pe===void 0?[]:Pe;R=Ee()(de,we,2)}var Ve=(0,Ie.scaleLinear)((0,Me.extent)(s,function(le){return le[0]}),[0,1]),_t=(0,Ie.scaleLinear)((0,Me.extent)(s,function(le){return le[1]}),[0,1]),wt=s.map(function(le){var be=ve(le,2),ge=be[0],fe=be[1];return[Ve(ge),_t(fe)]}),xt={points:s,indices:R,uvs:wt};return{contour:a,triangles:xt}}var dt=vt,Ze=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ge(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=t.map(function(a){return a.map(function(e){var o=ve(e,2),s=o[0],f=o[1];return r?at(s,f,i):[s,f,i]})});return Ee().flatten(n)}function Ne(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ge(t,i,n),e=a.vertices,o=a.holes,s=Ge(t,r,n),f=s.vertices,v=(0,Me.merge)([f,e]),d=Math.round(f.length/3),m=new Set(o),g=0,x=[],_=0;_<d;_++){var M=_+1;if(M===d)M=g;else if(m.has(M)){var h=M;M=g,g=h}x.push(_,_+d,M+d),x.push(M+d,M,_)}for(var R=[],k=1;k>=0;k--)for(var oe=0;oe<d;oe+=1)R.push(oe/(d-1),k);return{indices:x,vertices:v,uvs:R,topVerts:f}}function He(t,i,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:n?t.indices:t.indices.slice().reverse(),vertices:Ge([t.points],i,a).vertices,uvs:r}}var mt=function(t){"use strict";S(r,t);var i=B(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};j(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,A.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=e.parameters,s=o.startHeight,f=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,g=o.curvatureResolution,x=o.cartesian,_=o.userDataRsoOffset;it()(n[0])||n[0].reverse();var M=dt(n,{resolution:g}),h=M.contour,R=M.triangles,k=(0,Me.merge)(R.uvs),oe=[],D=[],de=[],Pe=0,we=function(xe){var Se=Math.round(oe.length/3),je=de.length;oe=oe.concat(xe.vertices),D=D.concat(xe.uvs),de=de.concat(Se?xe.indices.map(function(Ve){return Ve+Se}):xe.indices),e.addGroup(je,de.length-je,Pe++)};if(m){var ye=Ne(h,s,f,x);we(ye),e.userData.rso=_?Ne(h,s,f+_,x):ye}return v&&we(He(R,s,k,!1,x)),d&&we(He(R,f,k,!0,x)),e.setIndex(de),e[Ze]("position",new c.Float32BufferAttribute(oe,3)),e[Ze]("uv",new c.Float32BufferAttribute(D,2)),e.computeVertexNormals(),e}return r}(c.BufferGeometry),gt=function(t){"use strict";S(r,t);var i=B(r);function r(a){j(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.startHeight,s=e.height,f=e.closedBottom,v=e.closedTop,d=e.curvatureResolution,m=e.userDataRsoOffset,g=e.cartesian,x=new mt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:m});this.createMesh(x,this.options.material)},r}(he),yt=q(977),bt=function(t){"use strict";S(r,t);var i=B(r);function r(a){j(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},a),e}var n=r.prototype;return n.create=function(){var e=this,o=this.options,s=o.points,f=o.pointsArr,v=o.material;if(s)this.createMesh(this.createGeometry(s),v);else if(f){var d=Fe.mergeBufferGeometries(f.map(function(m){return e.createGeometry(m)}),!0);this.createMesh(d,v)}},n.createGeometry=function(e){var o=this.options,s=o.split,f=o.depth;return new c.ExtrudeGeometry(new c.Shape(e),{depth:f,bevelEnabled:!1,UVGenerator:(0,yt.y)({split:s})})},r}(he)})(),module.exports=Te})();
|
|
132
|
+
`),te=function(t){"use strict";S(r,t);var i=B(r);function r(){j(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new c.Matrix4,Object.defineProperties(y(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(c.BufferGeometry);te.prototype.setMatrixWorld=function(t){this.matrixWorld=t},te.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},te.prototype.setPoints=function(t,i){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=i,this.positions=[],this.counters=[],t.length&&t[0]instanceof c.Vector3)for(var r=0;r<t.length;r++){var n=t[r],a=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<t.length;r+=3){var a=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ue(t,i){var r=new c.Matrix4,n=new c.Ray,a=new c.Sphere,e=new c.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(a,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var s=new c.Vector3,f=new c.Vector3,v=new c.Vector3,d=this instanceof c.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var x=m.array,_=g.position.array,M=g.width.array,h=0,R=x.length-1;h<R;h+=d){var k=x[h],oe=x[h+1];s.fromArray(_,k*3),f.fromArray(_,oe*3);var D=M[Math.floor(h/3)]!==void 0?M[Math.floor(h/3)]:1,de=t.params.Line.threshold+this.material.lineWidth*D/2,Pe=de*de,we=n.distanceSqToSegment(s,f,e,v);if(!(we>Pe)){e.applyMatrix4(this.matrixWorld);var ye=t.ray.origin.distanceTo(e);ye<t.near||ye>t.far||(i.push({distance:ye,point:v.clone().applyMatrix4(this.matrixWorld),index:h,face:null,faceIndex:null,object:this}),h=R)}}}}te.prototype.raycast=Ue,te.prototype.compareV3=function(t,i){var r=t*6,n=i*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},te.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},te.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(t-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=n*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.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(t,i,r,n,a){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=i?t.subarray?t.subarray(i,a&&i+a):t.slice(i,a&&i+a):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}te.prototype.advance=function(t){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;ze(i,0,r,0,a),ze(i,6,i,0,a-6),i[a-6]=t.x,i[a-5]=t.y,i[a-4]=t.z,i[a-3]=t.x,i[a-2]=t.y,i[a-1]=t.z,ze(i,6,n,0,a-6),n[a-6]=t.x,n[a-5]=t.y,n[a-4]=t.z,n[a-3]=t.x,n[a-2]=t.y,n[a-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},c.ShaderChunk.meshline_vert=Ae,c.ShaderChunk.meshline_frag=_e;var Re=function(t){"use strict";S(r,t);var i=B(r);function r(n){j(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.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 c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(y(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(n),a}return r}(c.ShaderMaterial);Re.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function Ke(t,i){if(t==null)return{};var r={},n=Object.keys(t),a,e;for(e=0;e<n.length;e++)a=n[e],!(i.indexOf(a)>=0)&&(r[a]=t[a]);return r}function Xe(t,i){if(t==null)return{};var r=Ke(t,i),n,a;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(a=0;a<e.length;a++)n=e[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Ye=require("popmotion"),Fe=require("three/examples/jsm//utils/BufferGeometryUtils"),Qe={color:new c.Color("red"),lineWidth:3,sizeAttenuation:0},Je=function(t){"use strict";S(r,t);var i=B(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},Qe,a),e}var n=r.prototype;return n.create=function(){var e=this,o=this.options,s=o.duration,f=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,g=o.nodes,x=o.nodesArr,_=Xe(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr"]),M=this.pencil.getSize(),h=M.width,R=M.height,k=new Re(O((0,A.Z)({},_),{resolution:new c.Vector2(h,R)}));if(this.material=k,g)this.createMesh(this.createGeometry(g),k);else if(x){var oe=Fe.mergeBufferGeometries(x.map(function(D){return e.createGeometry(D)}),!0);this.createMesh(oe,k)}},n.createGeometry=function(e){var o=this.options.setPointWidth,s=new c.BufferGeometry,f=new te;return s.setFromPoints(e),f.setGeometry(s,o),f},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,s=e.delay,f=e.onComplete,v=this.material.uniforms.offset,d=s!=null?s:0,m=(0,Ye.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:f,onUpdate:function(g){v.value.x=g.x}});this.tween=m},n.dispose=function(){var e;ee(E(r.prototype),"dispose",this).call(this),(e=this.tween)===null||e===void 0||e.stop()},r}(he);function et(t){if(Array.isArray(t))return t}function tt(){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 ve(t,i){return et(t)||re(t,i)||H(t,i)||tt()}var Me=require("d3-array"),rt=require("earcut"),Ee=q.n(rt),nt=require("@turf/boolean-clockwise"),it=q.n(nt);function at(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var ot=require("delaunator"),st=q.n(ot),ut=require("@turf/boolean-point-in-polygon"),ct=q.n(ut),Oe=require("d3-geo"),lt=require("d3-geo-voronoi"),Ie=require("d3-scale");function ft(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Oe.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var s=(0,Oe.geoInterpolate)(a,e),f=1/Math.ceil(o/i),v=f;v<1;)n.push(s(v)),v+=f}n.push(a=e)}),n})}function ht(t){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,e=i.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),s=(1+Math.sqrt(5))/2,f=function(h){return h/s*360%360-180},v=function(h){return Math.acos(2*h/o-1)/Math.PI*180-90},d=function(h){return o*(Math.cos((h+90)*Math.PI/180)+1)/2},m=[e!==void 0?Math.ceil(d(e)):0,a!==void 0?Math.floor(d(a)):o-1],g=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(h){return h<=n}:n===void 0?function(h){return h>=r}:n>=r?function(h){return h>=r&&h<=n}:function(h){return h>=r||h<=n},x=[],_=m[0];_<=m[1];_++){var M=f(_);g(M)&&x.push([M,v(_)])}return x}function Be(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Oe.geoContains)(i,t):ct()(t,i)}function pt(t,i){var r={type:"Polygon",coordinates:t},n=ve((0,Oe.geoBounds)(r),2),a=ve(n[0],2),e=a[0],o=a[1],s=ve(n[1],2),f=s[0],v=s[1];if(Math.min(Math.abs(f-e),Math.abs(v-o))<i)return[];var d=e>f||v>=89||o<=-89;return ht(i,{minLng:e,maxLng:f,minLat:o,maxLat:v}).filter(function(m){return Be(m,r,d)})}function vt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=ft(t,n),e=(0,Me.merge)(a),o=pt(t,n),s=W(e).concat(W(o)),f={type:"Polygon",coordinates:t},v=ve((0,Oe.geoBounds)(f),2),d=ve(v[0],2),m=d[0],g=d[1],x=ve(v[1],2),_=x[0],M=x[1],h=m>_||M>=89||g<=-89,R=[];if(h){var k=(0,lt.geoVoronoi)(s).triangles(),oe=new Map(s.map(function(le,be){var ge=ve(le,2),fe=ge[0],Ce=ge[1];return["".concat(fe,"-").concat(Ce),be]}));k.features.forEach(function(le){var be,ge=le.geometry.coordinates[0].slice(0,3).reverse(),fe=[];if(ge.forEach(function(Le){var me=ve(Le,2),We=me[0],Mt=me[1],$e="".concat(We,"-").concat(Mt);oe.has($e)&&fe.push(oe.get($e))}),fe.length===3){if(fe.some(function(Le){return Le<e.length})){var Ce=le.properties.circumcenter;if(!Be(Ce,f,h))return}(be=R).push.apply(be,W(fe))}})}else if(o.length)for(var ye=function(le,be){var ge,fe=[2,1,0].map(function(me){return xe.triangles[le+me]}),Ce=fe.map(function(me){return s[me]});if(fe.some(function(me){return me<e.length})){var Le=[0,1].map(function(me){return(0,Me.mean)(Ce,function(We){return We[me]})});if(!Be(Le,f,h))return"continue"}(ge=R).push.apply(ge,W(fe))},xe=st().from(s),Se=0,je=xe.triangles.length;Se<je;Se+=3)ye(Se,je);else{var D=Ee().flatten(a),de=D.vertices,Pe=D.holes,we=Pe===void 0?[]:Pe;R=Ee()(de,we,2)}var Ve=(0,Ie.scaleLinear)((0,Me.extent)(s,function(le){return le[0]}),[0,1]),_t=(0,Ie.scaleLinear)((0,Me.extent)(s,function(le){return le[1]}),[0,1]),wt=s.map(function(le){var be=ve(le,2),ge=be[0],fe=be[1];return[Ve(ge),_t(fe)]}),xt={points:s,indices:R,uvs:wt};return{contour:a,triangles:xt}}var dt=vt,Ze=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ge(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=t.map(function(a){return a.map(function(e){var o=ve(e,2),s=o[0],f=o[1];return r?at(s,f,i):[s,f,i]})});return Ee().flatten(n)}function Ne(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ge(t,i,n),e=a.vertices,o=a.holes,s=Ge(t,r,n),f=s.vertices,v=(0,Me.merge)([f,e]),d=Math.round(f.length/3),m=new Set(o),g=0,x=[],_=0;_<d;_++){var M=_+1;if(M===d)M=g;else if(m.has(M)){var h=M;M=g,g=h}x.push(_,_+d,M+d),x.push(M+d,M,_)}for(var R=[],k=1;k>=0;k--)for(var oe=0;oe<d;oe+=1)R.push(oe/(d-1),k);return{indices:x,vertices:v,uvs:R,topVerts:f}}function He(t,i,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:n?t.indices:t.indices.slice().reverse(),vertices:Ge([t.points],i,a).vertices,uvs:r}}var mt=function(t){"use strict";S(r,t);var i=B(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};j(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,A.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=e.parameters,s=o.startHeight,f=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,g=o.curvatureResolution,x=o.cartesian,_=o.userDataRsoOffset;it()(n[0])||n[0].reverse();var M=dt(n,{resolution:g}),h=M.contour,R=M.triangles,k=(0,Me.merge)(R.uvs),oe=[],D=[],de=[],Pe=0,we=function(xe){var Se=Math.round(oe.length/3),je=de.length;oe=oe.concat(xe.vertices),D=D.concat(xe.uvs),de=de.concat(Se?xe.indices.map(function(Ve){return Ve+Se}):xe.indices),e.addGroup(je,de.length-je,Pe++)};if(m){var ye=Ne(h,s,f,x);we(ye),e.userData.rso=_?Ne(h,s,f+_,x):ye}return v&&we(He(R,s,k,!1,x)),d&&we(He(R,f,k,!0,x)),e.setIndex(de),e[Ze]("position",new c.Float32BufferAttribute(oe,3)),e[Ze]("uv",new c.Float32BufferAttribute(D,2)),e.computeVertexNormals(),e}return r}(c.BufferGeometry),gt=function(t){"use strict";S(r,t);var i=B(r);function r(a){j(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.startHeight,s=e.height,f=e.closedBottom,v=e.closedTop,d=e.curvatureResolution,m=e.userDataRsoOffset,g=e.cartesian,x=new mt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:m});this.createMesh(x,this.options.material)},r}(he),yt=q(977),bt=function(t){"use strict";S(r,t);var i=B(r);function r(a){j(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},a),e}var n=r.prototype;return n.create=function(){var e=this,o=this.options,s=o.points,f=o.pointsArr,v=o.material;if(s)this.createMesh(this.createGeometry(s),v);else if(f){var d=Fe.mergeBufferGeometries(f.map(function(m){return e.createGeometry(m)}),!0);this.createMesh(d,v)}},n.createGeometry=function(e){var o=this.options,s=o.split,f=o.depth;return new c.ExtrudeGeometry(new c.Shape(e),{depth:f,bevelEnabled:!1,UVGenerator:(0,yt.y)({split:s})})},r}(he)})(),module.exports=Te})();
|
|
@@ -129,4 +129,4 @@ void main() {
|
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
130
|
`).concat(c.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),pe=function(e){"use strict";P(r,e);var n=T(r);function r(){C(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 c.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}(c.BufferGeometry);pe.prototype.setMatrixWorld=function(e){this.matrixWorld=e},pe.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},pe.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 c.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 c.Matrix4,i=new c.Ray,a=new c.Sphere,t=new c.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 s=new c.Vector3,f=new c.Vector3,v=new c.Vector3,d=this instanceof c.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var x=m.array,w=g.position.array,M=g.width.array,h=0,z=x.length-1;h<z;h+=d){var E=x[h],ae=x[h+1];s.fromArray(w,E*3),f.fromArray(w,ae*3);var I=M[Math.floor(h/3)]!==void 0?M[Math.floor(h/3)]:1,de=e.params.Line.threshold+this.material.lineWidth*I/2,Oe=de*de,Me=i.distanceSqToSegment(s,f,t,v);if(!(Me>Oe)){t.applyMatrix4(this.matrixWorld);var be=e.ray.origin.distanceTo(t);be<e.near||be>e.far||(n.push({distance:be,point:v.clone().applyMatrix4(this.matrixWorld),index:h,face:null,faceIndex:null,object:this}),h=z)}}}}pe.prototype.raycast=Ie,pe.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]},pe.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},pe.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 c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.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}pe.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},c.ShaderChunk.meshline_vert=tt,c.ShaderChunk.meshline_frag=rt;var De=function(e){"use strict";P(r,e);var n=T(r);function r(i){C(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.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 c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.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}(c.ShaderMaterial);De.prototype.copy=function(e){return c.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 nt(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 it(e,n){if(e==null)return{};var r=nt(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 at=e=>{var n={};return U.d(n,e),n},ir=e=>()=>e,ot=at({animate:()=>Vt.animate}),st=e=>{var n={};return U.d(n,e),n},ar=e=>()=>e,Ze=st({mergeBufferGeometries:()=>Wt.mergeBufferGeometries}),ut={nodes:[],color:new c.Color("red"),lineWidth:3,sizeAttenuation:0},ct=function(e){"use strict";P(r,e);var n=T(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},ut,a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,s=o.duration,f=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,g=o.nodes,x=o.nodesArr,w=it(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr"]),M=this.pencil.getSize(),h=M.width,z=M.height,E=new De(O((0,A.Z)({},w),{resolution:new c.Vector2(h,z)}));if(this.material=E,g)this.createMesh(this.createGeometry(g),E);else if(x){var ae=Ze.mergeBufferGeometries(x.map(function(I){return t.createGeometry(I)}),!0);this.createMesh(ae,E)}},i.createGeometry=function(t){var o=this.options.setPointWidth,s=new c.BufferGeometry,f=new pe;return s.setFromPoints(t),f.setGeometry(s,o),f},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,s=t.delay,f=t.onComplete,v=this.material.uniforms.offset,d=s!=null?s:0,m=(0,ot.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:f,onUpdate:function(g){v.value.x=g.x}});this.tween=m},i.dispose=function(){xe(b(r.prototype),"dispose",this).call(this),this.tween.stop()},r}(p);function lt(e){if(Array.isArray(e))return e}function ft(){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 ve(e,n){return lt(e)||X(e,n)||H(e,n)||ft()}var ht=e=>{var n={};return U.d(n,e),n},or=e=>()=>e,Pe=ht({extent:()=>Fe.extent,mean:()=>Fe.mean,merge:()=>Fe.merge}),pt=e=>{var n={};return U.d(n,e),n},sr=e=>()=>e,Ge=pt({default:()=>Ut.default}),vt=e=>{var n={};return U.d(n,e),n},ur=e=>()=>e,dt=vt({default:()=>Nt.default});function mt(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 _t=e=>{var n={};return U.d(n,e),n},cr=e=>()=>e,gt=_t({default:()=>Ft.default}),yt=e=>{var n={};return U.d(n,e),n},lr=e=>()=>e,bt=yt({default:()=>It.default}),wt=e=>{var n={};return U.d(n,e),n},fr=e=>()=>e,Ee=wt({geoBounds:()=>Re.geoBounds,geoContains:()=>Re.geoContains,geoDistance:()=>Re.geoDistance,geoInterpolate:()=>Re.geoInterpolate}),xt=e=>{var n={};return U.d(n,e),n},hr=e=>()=>e,At=xt({geoVoronoi:()=>Zt.geoVoronoi}),Mt=e=>{var n={};return U.d(n,e),n},pr=e=>()=>e,Xe=Mt({scaleLinear:()=>Xt.scaleLinear});function St(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Ee.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var s=(0,Ee.geoInterpolate)(a,t),f=1/Math.ceil(o/n),v=f;v<1;)i.push(s(v)),v+=f}i.push(a=t)}),i})}function Pt(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),s=(1+Math.sqrt(5))/2,f=function(h){return h/s*360%360-180},v=function(h){return Math.acos(2*h/o-1)/Math.PI*180-90},d=function(h){return o*(Math.cos((h+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],g=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(h){return h<=i}:i===void 0?function(h){return h>=r}:i>=r?function(h){return h>=r&&h<=i}:function(h){return h>=r||h<=i},x=[],w=m[0];w<=m[1];w++){var M=f(w);g(M)&&x.push([M,v(w)])}return x}function Ve(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Ee.geoContains)(n,e):(0,bt.default)(e,n)}function Ot(e,n){var r={type:"Polygon",coordinates:e},i=ve((0,Ee.geoBounds)(r),2),a=ve(i[0],2),t=a[0],o=a[1],s=ve(i[1],2),f=s[0],v=s[1];if(Math.min(Math.abs(f-t),Math.abs(v-o))<n)return[];var d=t>f||v>=89||o<=-89;return Pt(n,{minLng:t,maxLng:f,minLat:o,maxLat:v}).filter(function(m){return Ve(m,r,d)})}function Ct(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=St(e,i),t=(0,Pe.merge)(a),o=Ot(e,i),s=F(t).concat(F(o)),f={type:"Polygon",coordinates:e},v=ve((0,Ee.geoBounds)(f),2),d=ve(v[0],2),m=d[0],g=d[1],x=ve(v[1],2),w=x[0],M=x[1],h=m>w||M>=89||g<=-89,z=[];if(h){var E=(0,At.geoVoronoi)(s).triangles(),ae=new Map(s.map(function(ce,we){var ge=ve(ce,2),le=ge[0],ke=ge[1];return["".concat(le,"-").concat(ke),we]}));E.features.forEach(function(ce){var we,ge=ce.geometry.coordinates[0].slice(0,3).reverse(),le=[];if(ge.forEach(function(Be){var me=ve(Be,2),Ne=me[0],Dt=me[1],Ye="".concat(Ne,"-").concat(Dt);ae.has(Ye)&&le.push(ae.get(Ye))}),le.length===3){if(le.some(function(Be){return Be<t.length})){var ke=ce.properties.circumcenter;if(!Ve(ke,f,h))return}(we=z).push.apply(we,F(le))}})}else if(o.length)for(var be=function(ce,we){var ge,le=[2,1,0].map(function(me){return Se.triangles[ce+me]}),ke=le.map(function(me){return s[me]});if(le.some(function(me){return me<t.length})){var Be=[0,1].map(function(me){return(0,Pe.mean)(ke,function(Ne){return Ne[me]})});if(!Ve(Be,f,h))return"continue"}(ge=z).push.apply(ge,F(le))},Se=gt.default.from(s),Ce=0,je=Se.triangles.length;Ce<je;Ce+=3)be(Ce,je);else{var I=Ge.default.flatten(a),de=I.vertices,Oe=I.holes,Me=Oe===void 0?[]:Oe;z=(0,Ge.default)(de,Me,2)}var Ue=(0,Xe.scaleLinear)((0,Pe.extent)(s,function(ce){return ce[0]}),[0,1]),Tt=(0,Xe.scaleLinear)((0,Pe.extent)(s,function(ce){return ce[1]}),[0,1]),Rt=s.map(function(ce){var we=ve(ce,2),ge=we[0],le=we[1];return[Ue(ge),Tt(le)]}),zt={points:s,indices:z,uvs:Rt};return{contour:a,triangles:zt}}var Lt=Ct,He=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function We(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=ve(t,2),s=o[0],f=o[1];return r?mt(s,f,n):[s,f,n]})});return Ge.default.flatten(i)}function Ke(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=We(e,n,i),t=a.vertices,o=a.holes,s=We(e,r,i),f=s.vertices,v=(0,Pe.merge)([f,t]),d=Math.round(f.length/3),m=new Set(o),g=0,x=[],w=0;w<d;w++){var M=w+1;if(M===d)M=g;else if(m.has(M)){var h=M;M=g,g=h}x.push(w,w+d,M+d),x.push(M+d,M,w)}for(var z=[],E=1;E>=0;E--)for(var ae=0;ae<d;ae+=1)z.push(ae/(d-1),E);return{indices:x,vertices:v,uvs:z,topVerts:f}}function $e(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:We([e.points],n,a).vertices,uvs:r}}var Et=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]:{};C(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,A.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,s=o.startHeight,f=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,g=o.curvatureResolution,x=o.cartesian,w=o.userDataRsoOffset;(0,dt.default)(i[0])||i[0].reverse();var M=Lt(i,{resolution:g}),h=M.contour,z=M.triangles,E=(0,Pe.merge)(z.uvs),ae=[],I=[],de=[],Oe=0,Me=function(Se){var Ce=Math.round(ae.length/3),je=de.length;ae=ae.concat(Se.vertices),I=I.concat(Se.uvs),de=de.concat(Ce?Se.indices.map(function(Ue){return Ue+Ce}):Se.indices),t.addGroup(je,de.length-je,Oe++)};if(m){var be=Ke(h,s,f,x);Me(be),t.userData.rso=w?Ke(h,s,f+w,x):be}return v&&Me($e(z,s,E,!1,x)),d&&Me($e(z,f,E,!0,x)),t.setIndex(de),t[He]("position",new c.Float32BufferAttribute(ae,3)),t[He]("uv",new c.Float32BufferAttribute(I,2)),t.computeVertexNormals(),t}return r}(c.BufferGeometry),jt=function(e){"use strict";P(r,e);var n=T(r);function r(a){C(this,r);var t;return t=n.call(this),t.options=(0,A.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,s=t.height,f=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,g=t.cartesian,x=new Et(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:m});this.createMesh(x,this.options.material)},r}(p),kt=U(977),Bt=function(e){"use strict";P(r,e);var n=T(r);function r(a){C(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,s=o.points,f=o.pointsArr,v=o.material;if(s)this.createMesh(this.createGeometry(s),v);else if(f){var d=Ze.mergeBufferGeometries(f.map(function(m){return t.createGeometry(m)}),!0);this.createMesh(d,v)}},i.createGeometry=function(t){var o=this.options,s=o.split,f=o.depth;return new c.ExtrudeGeometry(new c.Shape(t),{depth:f,bevelEnabled:!1,UVGenerator:(0,kt.y)({split:s})})},r}(p)})();var Kt=fe.Ei,$t=fe.Yo,Yt=fe.Ee,Jt=fe.x1,Qt=fe.VJ,qt=fe.r7,er=fe.XA,tr=fe.NB,rr=fe.xv,nr=fe.nk;export{Kt as ConicPolygon,$t as ExtrudePolygon,Yt as Image,Jt as Line,Qt as MeshLine,qt as MeshLineMaterial,er as MeshLineRaycast,tr as Node,rr as Text,nr as Video};
|
|
132
|
+
`),pe=function(e){"use strict";P(r,e);var n=T(r);function r(){C(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 c.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}(c.BufferGeometry);pe.prototype.setMatrixWorld=function(e){this.matrixWorld=e},pe.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},pe.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 c.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 c.Matrix4,i=new c.Ray,a=new c.Sphere,t=new c.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 s=new c.Vector3,f=new c.Vector3,v=new c.Vector3,d=this instanceof c.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var x=m.array,w=g.position.array,M=g.width.array,h=0,z=x.length-1;h<z;h+=d){var E=x[h],ae=x[h+1];s.fromArray(w,E*3),f.fromArray(w,ae*3);var I=M[Math.floor(h/3)]!==void 0?M[Math.floor(h/3)]:1,de=e.params.Line.threshold+this.material.lineWidth*I/2,Oe=de*de,Me=i.distanceSqToSegment(s,f,t,v);if(!(Me>Oe)){t.applyMatrix4(this.matrixWorld);var be=e.ray.origin.distanceTo(t);be<e.near||be>e.far||(n.push({distance:be,point:v.clone().applyMatrix4(this.matrixWorld),index:h,face:null,faceIndex:null,object:this}),h=z)}}}}pe.prototype.raycast=Ie,pe.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]},pe.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},pe.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 c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.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}pe.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},c.ShaderChunk.meshline_vert=tt,c.ShaderChunk.meshline_frag=rt;var De=function(e){"use strict";P(r,e);var n=T(r);function r(i){C(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.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 c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.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}(c.ShaderMaterial);De.prototype.copy=function(e){return c.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 nt(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 it(e,n){if(e==null)return{};var r=nt(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 at=e=>{var n={};return U.d(n,e),n},ir=e=>()=>e,ot=at({animate:()=>Vt.animate}),st=e=>{var n={};return U.d(n,e),n},ar=e=>()=>e,Ze=st({mergeBufferGeometries:()=>Wt.mergeBufferGeometries}),ut={color:new c.Color("red"),lineWidth:3,sizeAttenuation:0},ct=function(e){"use strict";P(r,e);var n=T(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},ut,a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,s=o.duration,f=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,g=o.nodes,x=o.nodesArr,w=it(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr"]),M=this.pencil.getSize(),h=M.width,z=M.height,E=new De(O((0,A.Z)({},w),{resolution:new c.Vector2(h,z)}));if(this.material=E,g)this.createMesh(this.createGeometry(g),E);else if(x){var ae=Ze.mergeBufferGeometries(x.map(function(I){return t.createGeometry(I)}),!0);this.createMesh(ae,E)}},i.createGeometry=function(t){var o=this.options.setPointWidth,s=new c.BufferGeometry,f=new pe;return s.setFromPoints(t),f.setGeometry(s,o),f},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,s=t.delay,f=t.onComplete,v=this.material.uniforms.offset,d=s!=null?s:0,m=(0,ot.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:f,onUpdate:function(g){v.value.x=g.x}});this.tween=m},i.dispose=function(){var t;xe(b(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(p);function lt(e){if(Array.isArray(e))return e}function ft(){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 ve(e,n){return lt(e)||X(e,n)||H(e,n)||ft()}var ht=e=>{var n={};return U.d(n,e),n},or=e=>()=>e,Pe=ht({extent:()=>Fe.extent,mean:()=>Fe.mean,merge:()=>Fe.merge}),pt=e=>{var n={};return U.d(n,e),n},sr=e=>()=>e,Ge=pt({default:()=>Ut.default}),vt=e=>{var n={};return U.d(n,e),n},ur=e=>()=>e,dt=vt({default:()=>Nt.default});function mt(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 _t=e=>{var n={};return U.d(n,e),n},cr=e=>()=>e,gt=_t({default:()=>Ft.default}),yt=e=>{var n={};return U.d(n,e),n},lr=e=>()=>e,bt=yt({default:()=>It.default}),wt=e=>{var n={};return U.d(n,e),n},fr=e=>()=>e,Ee=wt({geoBounds:()=>Re.geoBounds,geoContains:()=>Re.geoContains,geoDistance:()=>Re.geoDistance,geoInterpolate:()=>Re.geoInterpolate}),xt=e=>{var n={};return U.d(n,e),n},hr=e=>()=>e,At=xt({geoVoronoi:()=>Zt.geoVoronoi}),Mt=e=>{var n={};return U.d(n,e),n},pr=e=>()=>e,Xe=Mt({scaleLinear:()=>Xt.scaleLinear});function St(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Ee.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var s=(0,Ee.geoInterpolate)(a,t),f=1/Math.ceil(o/n),v=f;v<1;)i.push(s(v)),v+=f}i.push(a=t)}),i})}function Pt(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),s=(1+Math.sqrt(5))/2,f=function(h){return h/s*360%360-180},v=function(h){return Math.acos(2*h/o-1)/Math.PI*180-90},d=function(h){return o*(Math.cos((h+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],g=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(h){return h<=i}:i===void 0?function(h){return h>=r}:i>=r?function(h){return h>=r&&h<=i}:function(h){return h>=r||h<=i},x=[],w=m[0];w<=m[1];w++){var M=f(w);g(M)&&x.push([M,v(w)])}return x}function Ve(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Ee.geoContains)(n,e):(0,bt.default)(e,n)}function Ot(e,n){var r={type:"Polygon",coordinates:e},i=ve((0,Ee.geoBounds)(r),2),a=ve(i[0],2),t=a[0],o=a[1],s=ve(i[1],2),f=s[0],v=s[1];if(Math.min(Math.abs(f-t),Math.abs(v-o))<n)return[];var d=t>f||v>=89||o<=-89;return Pt(n,{minLng:t,maxLng:f,minLat:o,maxLat:v}).filter(function(m){return Ve(m,r,d)})}function Ct(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=St(e,i),t=(0,Pe.merge)(a),o=Ot(e,i),s=F(t).concat(F(o)),f={type:"Polygon",coordinates:e},v=ve((0,Ee.geoBounds)(f),2),d=ve(v[0],2),m=d[0],g=d[1],x=ve(v[1],2),w=x[0],M=x[1],h=m>w||M>=89||g<=-89,z=[];if(h){var E=(0,At.geoVoronoi)(s).triangles(),ae=new Map(s.map(function(ce,we){var ge=ve(ce,2),le=ge[0],ke=ge[1];return["".concat(le,"-").concat(ke),we]}));E.features.forEach(function(ce){var we,ge=ce.geometry.coordinates[0].slice(0,3).reverse(),le=[];if(ge.forEach(function(Be){var me=ve(Be,2),Ne=me[0],Dt=me[1],Ye="".concat(Ne,"-").concat(Dt);ae.has(Ye)&&le.push(ae.get(Ye))}),le.length===3){if(le.some(function(Be){return Be<t.length})){var ke=ce.properties.circumcenter;if(!Ve(ke,f,h))return}(we=z).push.apply(we,F(le))}})}else if(o.length)for(var be=function(ce,we){var ge,le=[2,1,0].map(function(me){return Se.triangles[ce+me]}),ke=le.map(function(me){return s[me]});if(le.some(function(me){return me<t.length})){var Be=[0,1].map(function(me){return(0,Pe.mean)(ke,function(Ne){return Ne[me]})});if(!Ve(Be,f,h))return"continue"}(ge=z).push.apply(ge,F(le))},Se=gt.default.from(s),Ce=0,je=Se.triangles.length;Ce<je;Ce+=3)be(Ce,je);else{var I=Ge.default.flatten(a),de=I.vertices,Oe=I.holes,Me=Oe===void 0?[]:Oe;z=(0,Ge.default)(de,Me,2)}var Ue=(0,Xe.scaleLinear)((0,Pe.extent)(s,function(ce){return ce[0]}),[0,1]),Tt=(0,Xe.scaleLinear)((0,Pe.extent)(s,function(ce){return ce[1]}),[0,1]),Rt=s.map(function(ce){var we=ve(ce,2),ge=we[0],le=we[1];return[Ue(ge),Tt(le)]}),zt={points:s,indices:z,uvs:Rt};return{contour:a,triangles:zt}}var Lt=Ct,He=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function We(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=ve(t,2),s=o[0],f=o[1];return r?mt(s,f,n):[s,f,n]})});return Ge.default.flatten(i)}function Ke(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=We(e,n,i),t=a.vertices,o=a.holes,s=We(e,r,i),f=s.vertices,v=(0,Pe.merge)([f,t]),d=Math.round(f.length/3),m=new Set(o),g=0,x=[],w=0;w<d;w++){var M=w+1;if(M===d)M=g;else if(m.has(M)){var h=M;M=g,g=h}x.push(w,w+d,M+d),x.push(M+d,M,w)}for(var z=[],E=1;E>=0;E--)for(var ae=0;ae<d;ae+=1)z.push(ae/(d-1),E);return{indices:x,vertices:v,uvs:z,topVerts:f}}function $e(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:We([e.points],n,a).vertices,uvs:r}}var Et=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]:{};C(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,A.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,s=o.startHeight,f=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,g=o.curvatureResolution,x=o.cartesian,w=o.userDataRsoOffset;(0,dt.default)(i[0])||i[0].reverse();var M=Lt(i,{resolution:g}),h=M.contour,z=M.triangles,E=(0,Pe.merge)(z.uvs),ae=[],I=[],de=[],Oe=0,Me=function(Se){var Ce=Math.round(ae.length/3),je=de.length;ae=ae.concat(Se.vertices),I=I.concat(Se.uvs),de=de.concat(Ce?Se.indices.map(function(Ue){return Ue+Ce}):Se.indices),t.addGroup(je,de.length-je,Oe++)};if(m){var be=Ke(h,s,f,x);Me(be),t.userData.rso=w?Ke(h,s,f+w,x):be}return v&&Me($e(z,s,E,!1,x)),d&&Me($e(z,f,E,!0,x)),t.setIndex(de),t[He]("position",new c.Float32BufferAttribute(ae,3)),t[He]("uv",new c.Float32BufferAttribute(I,2)),t.computeVertexNormals(),t}return r}(c.BufferGeometry),jt=function(e){"use strict";P(r,e);var n=T(r);function r(a){C(this,r);var t;return t=n.call(this),t.options=(0,A.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,s=t.height,f=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,g=t.cartesian,x=new Et(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:m});this.createMesh(x,this.options.material)},r}(p),kt=U(977),Bt=function(e){"use strict";P(r,e);var n=T(r);function r(a){C(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,s=o.points,f=o.pointsArr,v=o.material;if(s)this.createMesh(this.createGeometry(s),v);else if(f){var d=Ze.mergeBufferGeometries(f.map(function(m){return t.createGeometry(m)}),!0);this.createMesh(d,v)}},i.createGeometry=function(t){var o=this.options,s=o.split,f=o.depth;return new c.ExtrudeGeometry(new c.Shape(t),{depth:f,bevelEnabled:!1,UVGenerator:(0,kt.y)({split:s})})},r}(p)})();var Kt=fe.Ei,$t=fe.Yo,Yt=fe.Ee,Jt=fe.x1,Qt=fe.VJ,qt=fe.r7,er=fe.XA,tr=fe.NB,rr=fe.xv,nr=fe.nk;export{Kt as ConicPolygon,$t as ExtrudePolygon,Yt as Image,Jt as Line,Qt as MeshLine,qt as MeshLineMaterial,er as MeshLineRaycast,tr as Node,rr as Text,nr as Video};
|