gl-draw 0.0.26 → 0.0.27
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
|
@@ -168,4 +168,4 @@ void main() {
|
|
|
168
168
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
169
169
|
`).concat(a.ShaderChunk.fog_fragment,`
|
|
170
170
|
}
|
|
171
|
-
`),x=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(){(0,V.Z)(this,u);var g;return g=w.call(this),g.isMeshLine=!0,g.type="MeshLine",g.positions=[],g.previous=[],g.next=[],g.side=[],g.width=[],g.indices_array=[],g.uvs=[],g.counters=[],g._points=[],g._geom=null,g.widthCallback=null,g.matrixWorld=new a.Matrix4,Object.defineProperties((0,k.Z)(g),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(i){this.setGeometry(i,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(i){this.setPoints(i,this.widthCallback)}}}),g}return u}(a.BufferGeometry);x.prototype.setMatrixWorld=function(l){this.matrixWorld=l},x.prototype.setGeometry=function(l,w){this._geometry=l,this.setPoints(l.getAttribute("position").array,w)},x.prototype.setPoints=function(l,w){if(!(l instanceof Float32Array)&&!(l instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=l,this.widthCallback=w,this.positions=[],this.counters=[],l.length&&l[0]instanceof a.Vector3)for(var u=0;u<l.length;u++){var g=l[u],b=u/l.length;this.positions.push(g.x,g.y,g.z),this.positions.push(g.x,g.y,g.z),this.counters.push(b),this.counters.push(b)}else for(var u=0;u<l.length;u+=3){var b=u/l.length;this.positions.push(l[u],l[u+1],l[u+2]),this.positions.push(l[u],l[u+1],l[u+2]),this.counters.push(b),this.counters.push(b)}this.process()};function R(l,w){var u=new a.Matrix4,g=new a.Ray,b=new a.Sphere,i=new a.Vector3,y=this.geometry;if(y.boundingSphere||y.computeBoundingSphere(),b.copy(y.boundingSphere),b.applyMatrix4(this.matrixWorld),l.ray.intersectSphere(b,i)!==!1){u.copy(this.matrixWorld).invert(),g.copy(l.ray).applyMatrix4(u);var C=new a.Vector3,v=new a.Vector3,f=new a.Vector3,s=this instanceof a.LineSegments?2:1,e=y.index,r=y.attributes;if(e!==null)for(var n=e.array,o=r.position.array,c=r.width.array,t=0,P=n.length-1;t<P;t+=s){var L=n[t],Z=n[t+1];C.fromArray(o,L*3),v.fromArray(o,Z*3);var M=c[Math.floor(t/3)]!==void 0?c[Math.floor(t/3)]:1,F=l.params.Line.threshold+this.material.lineWidth*M/2,Y=F*F,Q=g.distanceSqToSegment(C,v,i,f);if(!(Q>Y)){i.applyMatrix4(this.matrixWorld);var ne=l.ray.origin.distanceTo(i);ne<l.near||ne>l.far||(w.push({distance:ne,point:f.clone().applyMatrix4(this.matrixWorld),index:t,face:null,faceIndex:null,object:this}),t=P)}}}}x.prototype.raycast=R,x.prototype.compareV3=function(l,w){var u=l*6,g=w*6;return this.positions[u]===this.positions[g]&&this.positions[u+1]===this.positions[g+1]&&this.positions[u+2]===this.positions[g+2]},x.prototype.copyV3=function(l){var w=l*6;return[this.positions[w],this.positions[w+1],this.positions[w+2]]},x.prototype.process=function(){var l=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var w,u;this.compareV3(0,l-1)?u=this.copyV3(l-2):u=this.copyV3(0),this.previous.push(u[0],u[1],u[2]),this.previous.push(u[0],u[1],u[2]);for(var g=0;g<l;g++){if(this.side.push(1),this.side.push(-1),this.widthCallback?w=this.widthCallback(g/(l-1)):w=1,this.width.push(w),this.width.push(w),this.uvs.push(g/(l-1),0),this.uvs.push(g/(l-1),1),g<l-1){u=this.copyV3(g),this.previous.push(u[0],u[1],u[2]),this.previous.push(u[0],u[1],u[2]);var b=g*2;this.indices_array.push(b,b+1,b+2),this.indices_array.push(b+2,b+1,b+3)}g>0&&(u=this.copyV3(g),this.next.push(u[0],u[1],u[2]),this.next.push(u[0],u[1],u[2]))}this.compareV3(l-1,0)?u=this.copyV3(1):u=this.copyV3(l-1),this.next.push(u[0],u[1],u[2]),this.next.push(u[0],u[1],u[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new a.BufferAttribute(new Float32Array(this.positions),3),previous:new a.BufferAttribute(new Float32Array(this.previous),3),next:new a.BufferAttribute(new Float32Array(this.next),3),side:new a.BufferAttribute(new Float32Array(this.side),1),width:new a.BufferAttribute(new Float32Array(this.width),1),uv:new a.BufferAttribute(new Float32Array(this.uvs),2),index:new a.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new a.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 U(l,w,u,g,b){var i;if(l=l.subarray||l.slice?l:l.buffer,u=u.subarray||u.slice?u:u.buffer,l=w?l.subarray?l.subarray(w,b&&w+b):l.slice(w,b&&w+b):l,u.set)u.set(l,g);else for(i=0;i<l.length;i++)u[i+g]=l[i];return u}x.prototype.advance=function(l){var w=this._attributes.position.array,u=this._attributes.previous.array,g=this._attributes.next.array,b=w.length;U(w,0,u,0,b),U(w,6,w,0,b-6),w[b-6]=l.x,w[b-5]=l.y,w[b-4]=l.z,w[b-3]=l.x,w[b-2]=l.y,w[b-1]=l.z,U(w,6,g,0,b-6),g[b-6]=l.x,g[b-5]=l.y,g[b-4]=l.z,g[b-3]=l.x,g[b-2]=l.y,g[b-1]=l.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},a.ShaderChunk.meshline_vert=_,a.ShaderChunk.meshline_frag=m;var H=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(g){(0,V.Z)(this,u);var b;return b=w.call(this,{uniforms:Object.assign({},a.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new a.Color(16777215)},opacity:{value:1},resolution:{value:new a.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 a.Vector2(1,1)},offset:{value:new a.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new a.Vector2(0,0)},lightColor:{value:new a.Color(16777215)}}),vertexShader:a.ShaderChunk.meshline_vert,fragmentShader:a.ShaderChunk.meshline_frag}),b.isMeshLineMaterial=!0,b.type="MeshLineMaterial",Object.defineProperties((0,k.Z)(b),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(y){this.uniforms.lineWidth.value=y}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(y){this.uniforms.lineLightAnimation.value=y}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(y){this.uniforms.map.value=y}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(y){this.uniforms.useMap.value=y}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(y){this.uniforms.alphaMap.value=y}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(y){this.uniforms.useAlphaMap.value=y}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(y){this.uniforms.color.value=y}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(y){this.uniforms.lightColor.value=y}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(y){this.uniforms.time.value=y}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(y){this.uniforms.uCenter.value=y}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(y){this.uniforms.size.value=y}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(y){this.uniforms.opacity.value=y}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(y){this.uniforms.resolution.value.copy(y)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(y){this.uniforms.sizeAttenuation.value=y}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(y){this.uniforms.dashArray.value=y,this.useDash=y!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(y){this.uniforms.dashOffset.value=y}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(y){this.uniforms.dashRatio.value=y}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(y){this.uniforms.useDash.value=y}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(y){this.uniforms.visibility.value=y}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(y){this.uniforms.alphaTest.value=y}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(y){this.uniforms.repeat.value.copy(y)}}}),b.setValues(g),b}return u}(a.ShaderMaterial);H.prototype.copy=function(l){return a.ShaderMaterial.prototype.copy.call(this,l),this.lineWidth=l.lineWidth,this.map=l.map,this.useMap=l.useMap,this.alphaMap=l.alphaMap,this.useAlphaMap=l.useAlphaMap,this.color.copy(l.color),this.opacity=l.opacity,this.resolution.copy(l.resolution),this.sizeAttenuation=l.sizeAttenuation,this.dashArray.copy(l.dashArray),this.dashOffset.copy(l.dashOffset),this.dashRatio.copy(l.dashRatio),this.useDash=l.useDash,this.visibility=l.visibility,this.alphaTest=l.alphaTest,this.repeat.copy(l.repeat),this};var X=q(607),ie=q(494),pe=q.n(ie),xe={nodes:[],color:new a.Color("red"),lineWidth:3,sizeAttenuation:0},me=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,V.Z)(this,u);var i;return i=w.call(this),i.geometry=new a.BufferGeometry,i.meshline=new x,i.options=(0,d.Z)({},xe,b),i}var g=u.prototype;return g.create=function(){var i=this.options,y=i.nodes,C=i.duration,v=i.delay,f=i.onComplete,s=i.setPointWidth,e=(0,X.Z)(i,["nodes","duration","delay","onComplete","setPointWidth"]),r=this.pencil.getSize(),n=r.width,o=r.height;delete e.key,this.geometry.setFromPoints(y),this.meshline.setGeometry(this.geometry,s);var c=new H((0,E.Z)((0,d.Z)({},e),{resolution:new a.Vector2(n,o)}));this.material=c,this.createMesh(this.meshline,c)},g.resize=function(i,y){this.material.uniforms.resolution.value.set(i,y)},g.animate=function(){var i=this.options,y=i.duration,C=i.delay,v=i.onComplete,f=this.material.uniforms.offset,s=new(pe()).Tween(f.value).to({x:0},y!=null?y:1e3).delay(C!=null?C:0).repeat(1/0);v&&s.onComplete(v),s.start(),this.tween=s},g.dispose=function(){se((0,$.Z)(u.prototype),"dispose",this).call(this),this.tween&&pe().remove(this.tween)},u}(p.ZP),Ce=q(639);function Re(l){if(Array.isArray(l))return l}var O=q(375);function S(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var D=q(566);function W(l,w){return Re(l)||(0,O.Z)(l,w)||(0,D.Z)(l,w)||S()}var I=require("d3-array"),ae=require("earcut"),le=q.n(ae),ue=require("@turf/boolean-clockwise"),fe=q.n(ue);function he(l,w){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,g=(90-w)*Math.PI/180,b=(90-l)*Math.PI/180;return[u*Math.sin(g)*Math.cos(b),u*Math.cos(g),u*Math.sin(g)*Math.sin(b)]}var ge=q(342),Me=require("delaunator"),we=q.n(Me),Ne=require("@turf/boolean-point-in-polygon"),tt=q.n(Ne),Ae=require("d3-geo"),Te=require("d3-geo-voronoi"),Be=require("d3-scale");function He(l,w){return l.map(function(u){var g=[],b;return u.forEach(function(i){if(b){var y=(0,Ae.geoDistance)(i,b)*180/Math.PI;if(y>w)for(var C=(0,Ae.geoInterpolate)(b,i),v=1/Math.ceil(y/w),f=v;f<1;)g.push(C(f)),f+=v}g.push(b=i)}),g})}function Xe(l){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=w.minLng,g=w.maxLng,b=w.minLat,i=w.maxLat,y=Math.round(Math.pow(360/l,2)/Math.PI),C=(1+Math.sqrt(5))/2,v=function(t){return t/C*360%360-180},f=function(t){return Math.acos(2*t/y-1)/Math.PI*180-90},s=function(t){return y*(Math.cos((t+90)*Math.PI/180)+1)/2},e=[i!==void 0?Math.ceil(s(i)):0,b!==void 0?Math.floor(s(b)):y-1],r=u===void 0&&g===void 0?function(){return!0}:u===void 0?function(t){return t<=g}:g===void 0?function(t){return t>=u}:g>=u?function(t){return t>=u&&t<=g}:function(t){return t>=u||t<=g},n=[],o=e[0];o<=e[1];o++){var c=v(o);r(c)&&n.push([c,f(o)])}return n}function De(l,w){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return u?(0,Ae.geoContains)(w,l):tt()(l,w)}function Ke(l,w){var u={type:"Polygon",coordinates:l},g=W((0,Ae.geoBounds)(u),2),b=W(g[0],2),i=b[0],y=b[1],C=W(g[1],2),v=C[0],f=C[1];if(Math.min(Math.abs(v-i),Math.abs(f-y))<w)return[];var s=i>v||f>=89||y<=-89;return Xe(w,{minLng:i,maxLng:v,minLat:y,maxLat:f}).filter(function(e){return De(e,u,s)})}function Ve(l){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=w.resolution,g=u===void 0?1/0:u,b=He(l,g),i=(0,I.merge)(b),y=Ke(l,g),C=(0,ge.Z)(i).concat((0,ge.Z)(y)),v={type:"Polygon",coordinates:l},f=W((0,Ae.geoBounds)(v),2),s=W(f[0],2),e=s[0],r=s[1],n=W(f[1],2),o=n[0],c=n[1],t=e>o||c>=89||r<=-89,P=[];if(t){var L=(0,Te.geoVoronoi)(C).triangles(),Z=new Map(C.map(function(ve,_e){var Pe=W(ve,2),be=Pe[0],Oe=Pe[1];return["".concat(be,"-").concat(Oe),_e]}));L.features.forEach(function(ve){var _e,Pe=ve.geometry.coordinates[0].slice(0,3).reverse(),be=[];if(Pe.forEach(function(Ee){var Se=W(Ee,2),qe=Se[0],it=Se[1],rt="".concat(qe,"-").concat(it);Z.has(rt)&&be.push(Z.get(rt))}),be.length===3){if(be.some(function(Ee){return Ee<i.length})){var Oe=ve.properties.circumcenter;if(!De(Oe,v,t))return}(_e=P).push.apply(_e,(0,ge.Z)(be))}})}else if(y.length)for(var ne=function(ve,_e){var Pe,be=[2,1,0].map(function(Se){return re.triangles[ve+Se]}),Oe=be.map(function(Se){return C[Se]});if(be.some(function(Se){return Se<i.length})){var Ee=[0,1].map(function(Se){return(0,I.mean)(Oe,function(qe){return qe[Se]})});if(!De(Ee,v,t))return"continue"}(Pe=P).push.apply(Pe,(0,ge.Z)(be))},re=we().from(C),de=0,ce=re.triangles.length;de<ce;de+=3)ne(de,ce);else{var M=le().flatten(b),F=M.vertices,Y=M.holes,Q=Y===void 0?[]:Y;P=le()(F,Q,2)}var ye=(0,Be.scaleLinear)((0,I.extent)(C,function(ve){return ve[0]}),[0,1]),je=(0,Be.scaleLinear)((0,I.extent)(C,function(ve){return ve[1]}),[0,1]),Le=C.map(function(ve){var _e=W(ve,2),Pe=_e[0],be=_e[1];return[ye(Pe),je(be)]}),ze={points:C,indices:P,uvs:Le};return{contour:b,triangles:ze}}var Fe=Ve,Ze=new a.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function ke(l,w){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,g=l.map(function(b){return b.map(function(i){var y=W(i,2),C=y[0],v=y[1];return u?he(C,v,w):[C,v,w]})});return le().flatten(g)}function Ue(l,w,u){for(var g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,b=ke(l,w,g),i=b.vertices,y=b.holes,C=ke(l,u,g),v=C.vertices,f=(0,I.merge)([v,i]),s=Math.round(v.length/3),e=new Set(y),r=0,n=[],o=0;o<s;o++){var c=o+1;if(c===s)c=r;else if(e.has(c)){var t=c;c=r,r=t}n.push(o,o+s,c+s),n.push(c+s,c,o)}for(var P=[],L=1;L>=0;L--)for(var Z=0;Z<s;Z+=1)P.push(Z/(s-1),L);return{indices:n,vertices:f,uvs:P,topVerts:v}}function We(l,w,u){var g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,b=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:g?l.indices:l.indices.slice().reverse(),vertices:ke([l.points],w,b).vertices,uvs:u}}var Ye=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(g){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,V.Z)(this,u);var i;i=w.call(this),i.type="PolygonBufferGeometry",i.parameters=(0,d.Z)({},{polygonGeoJson:g,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},b);var y=i.parameters,C=y.startHeight,v=y.endHeight,f=y.closedBottom,s=y.closedTop,e=y.includeSides,r=y.curvatureResolution,n=y.cartesian,o=y.userDataRsoOffset;fe()(g[0])||g[0].reverse();var c=Fe(g,{resolution:r}),t=c.contour,P=c.triangles,L=(0,I.merge)(P.uvs),Z=[],M=[],F=[],Y=0,Q=function(re){var de=Math.round(Z.length/3),ce=F.length;Z=Z.concat(re.vertices),M=M.concat(re.uvs),F=F.concat(de?re.indices.map(function(ye){return ye+de}):re.indices),i.addGroup(ce,F.length-ce,Y++)};if(e){var ne=Ue(t,C,v,n);Q(ne),i.userData.rso=o?Ue(t,C,v+o,n):ne}return f&&Q(We(P,C,L,!1,n)),s&&Q(We(P,v,L,!0,n)),i.setIndex(F),i[Ze]("position",new a.Float32BufferAttribute(Z,3)),i[Ze]("uv",new a.Float32BufferAttribute(M,2)),i.computeVertexNormals(),i}return u}(a.BufferGeometry),Qe=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(b){(0,V.Z)(this,u);var i;return i=w.call(this),i.options=(0,d.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},b),i}var g=u.prototype;return g.create=function(){var i=this.options,y=i.startHeight,C=i.height,v=i.closedBottom,f=i.closedTop,s=i.curvatureResolution,e=i.userDataRsoOffset,r=i.cartesian,n=new Ye(this.options.geojson,{startHeight:y,endHeight:y+C,closedBottom:v,closedTop:f,curvatureResolution:s,cartesian:r,userDataRsoOffset:e});this.createMesh(n,this.options.material)},u}(Ce.BaseObject),Ge=new Map,$e={generateTopUV:function(l,w,u,g,b){var i=w[u*3],y=w[u*3+1],C=w[g*3],v=w[g*3+1],f=w[b*3],s=w[b*3+1],e;if(Ge.has(l))e=Ge.get(l);else{var r,n,o,c,t=l.parameters.shapes.getPoints();e={minX:(r=Math).min.apply(r,(0,ge.Z)(t.map(function(Z){var M=Z.x;return M}))),maxX:(n=Math).max.apply(n,(0,ge.Z)(t.map(function(Z){var M=Z.x;return M}))),minY:(o=Math).min.apply(o,(0,ge.Z)(t.map(function(Z){var M=Z.y;return M}))),maxY:(c=Math).max.apply(c,(0,ge.Z)(t.map(function(Z){var M=Z.y;return M})))},Ge.set(l,e)}var P=e.maxX-e.minX,L=e.maxY-e.minY;return[new a.Vector2((i-e.minX)/P,1-(y-e.minY)/L),new a.Vector2((C-e.minX)/P,1-(v-e.minY)/L),new a.Vector2((f-e.minX)/P,1-(s-e.minY)/L)]},generateSideWallUV:function(l,w,u,g,b,i){var y=w[u*3],C=w[u*3+1],v=w[u*3+2],f=w[g*3],s=w[g*3+1],e=w[g*3+2],r=w[b*3],n=w[b*3+1],o=w[b*3+2],c=w[i*3],t=w[i*3+1],P=w[i*3+2];return Math.abs(C-s)<.01?[new a.Vector2(y,1-v),new a.Vector2(f,1-e),new a.Vector2(r,1-o),new a.Vector2(c,1-P)]:[new a.Vector2(C,1-v),new a.Vector2(s,1-e),new a.Vector2(n,1-o),new a.Vector2(t,1-P)]}},Je=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(b){(0,V.Z)(this,u);var i;return i=w.call(this),i.options=(0,d.Z)({},b),i}var g=u.prototype;return g.create=function(){var i=this.options,y=i.pts,C=i.depth,v=i.material,f=new a.ExtrudeBufferGeometry(new a.Shape(y),{depth:C,bevelEnabled:!1,UVGenerator:$e});this.createMesh(f,v)},u}(Ce.BaseObject)})(),module.exports=Ie})();
|
|
171
|
+
`),x=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(){(0,V.Z)(this,u);var g;return g=w.call(this),g.isMeshLine=!0,g.type="MeshLine",g.positions=[],g.previous=[],g.next=[],g.side=[],g.width=[],g.indices_array=[],g.uvs=[],g.counters=[],g._points=[],g._geom=null,g.widthCallback=null,g.matrixWorld=new a.Matrix4,Object.defineProperties((0,k.Z)(g),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(i){this.setGeometry(i,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(i){this.setPoints(i,this.widthCallback)}}}),g}return u}(a.BufferGeometry);x.prototype.setMatrixWorld=function(l){this.matrixWorld=l},x.prototype.setGeometry=function(l,w){this._geometry=l,this.setPoints(l.getAttribute("position").array,w)},x.prototype.setPoints=function(l,w){if(!(l instanceof Float32Array)&&!(l instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=l,this.widthCallback=w,this.positions=[],this.counters=[],l.length&&l[0]instanceof a.Vector3)for(var u=0;u<l.length;u++){var g=l[u],b=u/l.length;this.positions.push(g.x,g.y,g.z),this.positions.push(g.x,g.y,g.z),this.counters.push(b),this.counters.push(b)}else for(var u=0;u<l.length;u+=3){var b=u/l.length;this.positions.push(l[u],l[u+1],l[u+2]),this.positions.push(l[u],l[u+1],l[u+2]),this.counters.push(b),this.counters.push(b)}this.process()};function R(l,w){var u=new a.Matrix4,g=new a.Ray,b=new a.Sphere,i=new a.Vector3,y=this.geometry;if(y.boundingSphere||y.computeBoundingSphere(),b.copy(y.boundingSphere),b.applyMatrix4(this.matrixWorld),l.ray.intersectSphere(b,i)!==!1){u.copy(this.matrixWorld).invert(),g.copy(l.ray).applyMatrix4(u);var C=new a.Vector3,v=new a.Vector3,f=new a.Vector3,s=this instanceof a.LineSegments?2:1,e=y.index,r=y.attributes;if(e!==null)for(var n=e.array,o=r.position.array,c=r.width.array,t=0,P=n.length-1;t<P;t+=s){var L=n[t],Z=n[t+1];C.fromArray(o,L*3),v.fromArray(o,Z*3);var M=c[Math.floor(t/3)]!==void 0?c[Math.floor(t/3)]:1,F=l.params.Line.threshold+this.material.lineWidth*M/2,Y=F*F,Q=g.distanceSqToSegment(C,v,i,f);if(!(Q>Y)){i.applyMatrix4(this.matrixWorld);var ne=l.ray.origin.distanceTo(i);ne<l.near||ne>l.far||(w.push({distance:ne,point:f.clone().applyMatrix4(this.matrixWorld),index:t,face:null,faceIndex:null,object:this}),t=P)}}}}x.prototype.raycast=R,x.prototype.compareV3=function(l,w){var u=l*6,g=w*6;return this.positions[u]===this.positions[g]&&this.positions[u+1]===this.positions[g+1]&&this.positions[u+2]===this.positions[g+2]},x.prototype.copyV3=function(l){var w=l*6;return[this.positions[w],this.positions[w+1],this.positions[w+2]]},x.prototype.process=function(){var l=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var w,u;this.compareV3(0,l-1)?u=this.copyV3(l-2):u=this.copyV3(0),this.previous.push(u[0],u[1],u[2]),this.previous.push(u[0],u[1],u[2]);for(var g=0;g<l;g++){if(this.side.push(1),this.side.push(-1),this.widthCallback?w=this.widthCallback(g/(l-1)):w=1,this.width.push(w),this.width.push(w),this.uvs.push(g/(l-1),0),this.uvs.push(g/(l-1),1),g<l-1){u=this.copyV3(g),this.previous.push(u[0],u[1],u[2]),this.previous.push(u[0],u[1],u[2]);var b=g*2;this.indices_array.push(b,b+1,b+2),this.indices_array.push(b+2,b+1,b+3)}g>0&&(u=this.copyV3(g),this.next.push(u[0],u[1],u[2]),this.next.push(u[0],u[1],u[2]))}this.compareV3(l-1,0)?u=this.copyV3(1):u=this.copyV3(l-1),this.next.push(u[0],u[1],u[2]),this.next.push(u[0],u[1],u[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new a.BufferAttribute(new Float32Array(this.positions),3),previous:new a.BufferAttribute(new Float32Array(this.previous),3),next:new a.BufferAttribute(new Float32Array(this.next),3),side:new a.BufferAttribute(new Float32Array(this.side),1),width:new a.BufferAttribute(new Float32Array(this.width),1),uv:new a.BufferAttribute(new Float32Array(this.uvs),2),index:new a.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new a.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 U(l,w,u,g,b){var i;if(l=l.subarray||l.slice?l:l.buffer,u=u.subarray||u.slice?u:u.buffer,l=w?l.subarray?l.subarray(w,b&&w+b):l.slice(w,b&&w+b):l,u.set)u.set(l,g);else for(i=0;i<l.length;i++)u[i+g]=l[i];return u}x.prototype.advance=function(l){var w=this._attributes.position.array,u=this._attributes.previous.array,g=this._attributes.next.array,b=w.length;U(w,0,u,0,b),U(w,6,w,0,b-6),w[b-6]=l.x,w[b-5]=l.y,w[b-4]=l.z,w[b-3]=l.x,w[b-2]=l.y,w[b-1]=l.z,U(w,6,g,0,b-6),g[b-6]=l.x,g[b-5]=l.y,g[b-4]=l.z,g[b-3]=l.x,g[b-2]=l.y,g[b-1]=l.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},a.ShaderChunk.meshline_vert=_,a.ShaderChunk.meshline_frag=m;var H=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(g){(0,V.Z)(this,u);var b;return b=w.call(this,{uniforms:Object.assign({},a.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new a.Color(16777215)},opacity:{value:1},resolution:{value:new a.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 a.Vector2(1,1)},offset:{value:new a.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new a.Vector2(0,0)},lightColor:{value:new a.Color(16777215)}}),vertexShader:a.ShaderChunk.meshline_vert,fragmentShader:a.ShaderChunk.meshline_frag}),b.isMeshLineMaterial=!0,b.type="MeshLineMaterial",Object.defineProperties((0,k.Z)(b),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(y){this.uniforms.lineWidth.value=y}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(y){this.uniforms.lineLightAnimation.value=y}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(y){this.uniforms.map.value=y}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(y){this.uniforms.useMap.value=y}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(y){this.uniforms.alphaMap.value=y}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(y){this.uniforms.useAlphaMap.value=y}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(y){this.uniforms.color.value=y}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(y){this.uniforms.lightColor.value=y}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(y){this.uniforms.time.value=y}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(y){this.uniforms.uCenter.value=y}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(y){this.uniforms.size.value=y}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(y){this.uniforms.opacity.value=y}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(y){this.uniforms.resolution.value.copy(y)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(y){this.uniforms.sizeAttenuation.value=y}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(y){this.uniforms.dashArray.value=y,this.useDash=y!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(y){this.uniforms.dashOffset.value=y}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(y){this.uniforms.dashRatio.value=y}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(y){this.uniforms.useDash.value=y}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(y){this.uniforms.visibility.value=y}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(y){this.uniforms.alphaTest.value=y}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(y){this.uniforms.repeat.value.copy(y)}}}),b.setValues(g),b}return u}(a.ShaderMaterial);H.prototype.copy=function(l){return a.ShaderMaterial.prototype.copy.call(this,l),this.lineWidth=l.lineWidth,this.map=l.map,this.useMap=l.useMap,this.alphaMap=l.alphaMap,this.useAlphaMap=l.useAlphaMap,this.color.copy(l.color),this.opacity=l.opacity,this.resolution.copy(l.resolution),this.sizeAttenuation=l.sizeAttenuation,this.dashArray.copy(l.dashArray),this.dashOffset.copy(l.dashOffset),this.dashRatio.copy(l.dashRatio),this.useDash=l.useDash,this.visibility=l.visibility,this.alphaTest=l.alphaTest,this.repeat.copy(l.repeat),this};var X=q(607),ie=q(494),pe=q.n(ie),xe={nodes:[],color:new a.Color("red"),lineWidth:3,sizeAttenuation:0},me=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,V.Z)(this,u);var i;return i=w.call(this),i.geometry=new a.BufferGeometry,i.meshline=new x,i.options=(0,d.Z)({},xe,b),i}var g=u.prototype;return g.create=function(){var i=this.options,y=i.nodes,C=i.duration,v=i.delay,f=i.onComplete,s=i.setPointWidth,e=(0,X.Z)(i,["nodes","duration","delay","onComplete","setPointWidth"]),r=this.pencil.getSize(),n=r.width,o=r.height;delete e.key,this.geometry.setFromPoints(y),this.meshline.setGeometry(this.geometry,s);var c=new H((0,E.Z)((0,d.Z)({},e),{resolution:new a.Vector2(n,o)}));this.material=c,this.createMesh(this.meshline,c)},g.resize=function(i,y){this.material.uniforms.resolution.value.set(i,y)},g.animate=function(){var i=this.options,y=i.duration,C=i.delay,v=i.onComplete,f=this.material.uniforms.offset,s=new(pe()).Tween(f.value).to({x:0},y!=null?y:1e3).delay(C!=null?C:0).repeat(1/0);v&&s.onComplete(v),s.start(),this.tween=s},g.dispose=function(){se((0,$.Z)(u.prototype),"dispose",this).call(this),this.tween&&pe().remove(this.tween)},u}(p.ZP),Ce=q(639);function Re(l){if(Array.isArray(l))return l}var O=q(375);function S(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var D=q(566);function W(l,w){return Re(l)||(0,O.Z)(l,w)||(0,D.Z)(l,w)||S()}var I=require("d3-array"),ae=require("earcut"),le=q.n(ae),ue=require("@turf/boolean-clockwise"),fe=q.n(ue);function he(l,w){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,g=(90-w)*Math.PI/180,b=(90-l)*Math.PI/180;return[u*Math.sin(g)*Math.cos(b),u*Math.cos(g),u*Math.sin(g)*Math.sin(b)]}var ge=q(342),Me=require("delaunator"),we=q.n(Me),Ne=require("@turf/boolean-point-in-polygon"),tt=q.n(Ne),Ae=require("d3-geo"),Te=require("d3-geo-voronoi"),Be=require("d3-scale");function He(l,w){return l.map(function(u){var g=[],b;return u.forEach(function(i){if(b){var y=(0,Ae.geoDistance)(i,b)*180/Math.PI;if(y>w)for(var C=(0,Ae.geoInterpolate)(b,i),v=1/Math.ceil(y/w),f=v;f<1;)g.push(C(f)),f+=v}g.push(b=i)}),g})}function Xe(l){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=w.minLng,g=w.maxLng,b=w.minLat,i=w.maxLat,y=Math.round(Math.pow(360/l,2)/Math.PI),C=(1+Math.sqrt(5))/2,v=function(t){return t/C*360%360-180},f=function(t){return Math.acos(2*t/y-1)/Math.PI*180-90},s=function(t){return y*(Math.cos((t+90)*Math.PI/180)+1)/2},e=[i!==void 0?Math.ceil(s(i)):0,b!==void 0?Math.floor(s(b)):y-1],r=u===void 0&&g===void 0?function(){return!0}:u===void 0?function(t){return t<=g}:g===void 0?function(t){return t>=u}:g>=u?function(t){return t>=u&&t<=g}:function(t){return t>=u||t<=g},n=[],o=e[0];o<=e[1];o++){var c=v(o);r(c)&&n.push([c,f(o)])}return n}function De(l,w){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return u?(0,Ae.geoContains)(w,l):tt()(l,w)}function Ke(l,w){var u={type:"Polygon",coordinates:l},g=W((0,Ae.geoBounds)(u),2),b=W(g[0],2),i=b[0],y=b[1],C=W(g[1],2),v=C[0],f=C[1];if(Math.min(Math.abs(v-i),Math.abs(f-y))<w)return[];var s=i>v||f>=89||y<=-89;return Xe(w,{minLng:i,maxLng:v,minLat:y,maxLat:f}).filter(function(e){return De(e,u,s)})}function Ve(l){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=w.resolution,g=u===void 0?1/0:u,b=He(l,g),i=(0,I.merge)(b),y=Ke(l,g),C=(0,ge.Z)(i).concat((0,ge.Z)(y)),v={type:"Polygon",coordinates:l},f=W((0,Ae.geoBounds)(v),2),s=W(f[0],2),e=s[0],r=s[1],n=W(f[1],2),o=n[0],c=n[1],t=e>o||c>=89||r<=-89,P=[];if(t){var L=(0,Te.geoVoronoi)(C).triangles(),Z=new Map(C.map(function(ve,_e){var Pe=W(ve,2),be=Pe[0],Oe=Pe[1];return["".concat(be,"-").concat(Oe),_e]}));L.features.forEach(function(ve){var _e,Pe=ve.geometry.coordinates[0].slice(0,3).reverse(),be=[];if(Pe.forEach(function(Ee){var Se=W(Ee,2),qe=Se[0],it=Se[1],rt="".concat(qe,"-").concat(it);Z.has(rt)&&be.push(Z.get(rt))}),be.length===3){if(be.some(function(Ee){return Ee<i.length})){var Oe=ve.properties.circumcenter;if(!De(Oe,v,t))return}(_e=P).push.apply(_e,(0,ge.Z)(be))}})}else if(y.length)for(var ne=function(ve,_e){var Pe,be=[2,1,0].map(function(Se){return re.triangles[ve+Se]}),Oe=be.map(function(Se){return C[Se]});if(be.some(function(Se){return Se<i.length})){var Ee=[0,1].map(function(Se){return(0,I.mean)(Oe,function(qe){return qe[Se]})});if(!De(Ee,v,t))return"continue"}(Pe=P).push.apply(Pe,(0,ge.Z)(be))},re=we().from(C),de=0,ce=re.triangles.length;de<ce;de+=3)ne(de,ce);else{var M=le().flatten(b),F=M.vertices,Y=M.holes,Q=Y===void 0?[]:Y;P=le()(F,Q,2)}var ye=(0,Be.scaleLinear)((0,I.extent)(C,function(ve){return ve[0]}),[0,1]),je=(0,Be.scaleLinear)((0,I.extent)(C,function(ve){return ve[1]}),[0,1]),Le=C.map(function(ve){var _e=W(ve,2),Pe=_e[0],be=_e[1];return[ye(Pe),je(be)]}),ze={points:C,indices:P,uvs:Le};return{contour:b,triangles:ze}}var Fe=Ve,Ze=new a.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function ke(l,w){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,g=l.map(function(b){return b.map(function(i){var y=W(i,2),C=y[0],v=y[1];return u?he(C,v,w):[C,v,w]})});return le().flatten(g)}function Ue(l,w,u){for(var g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,b=ke(l,w,g),i=b.vertices,y=b.holes,C=ke(l,u,g),v=C.vertices,f=(0,I.merge)([v,i]),s=Math.round(v.length/3),e=new Set(y),r=0,n=[],o=0;o<s;o++){var c=o+1;if(c===s)c=r;else if(e.has(c)){var t=c;c=r,r=t}n.push(o,o+s,c+s),n.push(c+s,c,o)}for(var P=[],L=1;L>=0;L--)for(var Z=0;Z<s;Z+=1)P.push(Z/(s-1),L);return{indices:n,vertices:f,uvs:P,topVerts:v}}function We(l,w,u){var g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,b=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:g?l.indices:l.indices.slice().reverse(),vertices:ke([l.points],w,b).vertices,uvs:u}}var Ye=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(g){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,V.Z)(this,u);var i;i=w.call(this),i.type="PolygonBufferGeometry",i.parameters=(0,d.Z)({},{polygonGeoJson:g,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},b);var y=i.parameters,C=y.startHeight,v=y.endHeight,f=y.closedBottom,s=y.closedTop,e=y.includeSides,r=y.curvatureResolution,n=y.cartesian,o=y.userDataRsoOffset;fe()(g[0])||g[0].reverse();var c=Fe(g,{resolution:r}),t=c.contour,P=c.triangles,L=(0,I.merge)(P.uvs),Z=[],M=[],F=[],Y=0,Q=function(re){var de=Math.round(Z.length/3),ce=F.length;Z=Z.concat(re.vertices),M=M.concat(re.uvs),F=F.concat(de?re.indices.map(function(ye){return ye+de}):re.indices),i.addGroup(ce,F.length-ce,Y++)};if(e){var ne=Ue(t,C,v,n);Q(ne),i.userData.rso=o?Ue(t,C,v+o,n):ne}return f&&Q(We(P,C,L,!1,n)),s&&Q(We(P,v,L,!0,n)),i.setIndex(F),i[Ze]("position",new a.Float32BufferAttribute(Z,3)),i[Ze]("uv",new a.Float32BufferAttribute(M,2)),i.computeVertexNormals(),i}return u}(a.BufferGeometry),Qe=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(b){(0,V.Z)(this,u);var i;return i=w.call(this),i.options=(0,d.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},b),i}var g=u.prototype;return g.create=function(){var i=this.options,y=i.startHeight,C=i.height,v=i.closedBottom,f=i.closedTop,s=i.curvatureResolution,e=i.userDataRsoOffset,r=i.cartesian,n=new Ye(this.options.geojson,{startHeight:y,endHeight:y+C,closedBottom:v,closedTop:f,curvatureResolution:s,cartesian:r,userDataRsoOffset:e});this.createMesh(n,this.options.material)},u}(Ce.BaseObject),Ge=new Map,$e={generateTopUV:function(l,w,u,g,b){var i=w[u*3],y=w[u*3+1],C=w[g*3],v=w[g*3+1],f=w[b*3],s=w[b*3+1],e;if(Ge.has(l))e=Ge.get(l);else{var r,n,o,c,t=l.parameters.shapes.getPoints();e={minX:(r=Math).min.apply(r,(0,ge.Z)(t.map(function(Z){var M=Z.x;return M}))),maxX:(n=Math).max.apply(n,(0,ge.Z)(t.map(function(Z){var M=Z.x;return M}))),minY:(o=Math).min.apply(o,(0,ge.Z)(t.map(function(Z){var M=Z.y;return M}))),maxY:(c=Math).max.apply(c,(0,ge.Z)(t.map(function(Z){var M=Z.y;return M})))},Ge.set(l,e)}var P=e.maxX-e.minX,L=e.maxY-e.minY;return[new a.Vector2((i-e.minX)/P,1-(y-e.minY)/L),new a.Vector2((C-e.minX)/P,1-(v-e.minY)/L),new a.Vector2((f-e.minX)/P,1-(s-e.minY)/L)]},generateSideWallUV:function(l,w,u,g,b,i){var y=w[u*3],C=w[u*3+1],v=w[u*3+2],f=w[g*3],s=w[g*3+1],e=w[g*3+2],r=w[b*3],n=w[b*3+1],o=w[b*3+2],c=w[i*3],t=w[i*3+1],P=w[i*3+2];return Math.abs(C-s)<.01?[new a.Vector2(y,1-v),new a.Vector2(f,1-e),new a.Vector2(r,1-o),new a.Vector2(c,1-P)]:[new a.Vector2(C,1-v),new a.Vector2(s,1-e),new a.Vector2(n,1-o),new a.Vector2(t,1-P)]}},Je=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(b){(0,V.Z)(this,u);var i;return i=w.call(this),i.options=(0,d.Z)({},b),i}var g=u.prototype;return g.create=function(){var i=this.options,y=i.points,C=i.depth,v=i.material,f=new a.ExtrudeBufferGeometry(new a.Shape(y),{depth:C,bevelEnabled:!1,UVGenerator:$e});this.createMesh(f,v)},u}(Ce.BaseObject)})(),module.exports=Ie})();
|