@aibee/crc-bmap 0.12.29 → 0.12.30
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/lib/index.cjs
CHANGED
|
@@ -7979,7 +7979,7 @@ void main() {
|
|
|
7979
7979
|
gl_FragColor = vec4(vColor, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
|
|
7980
7980
|
}
|
|
7981
7981
|
}
|
|
7982
|
-
`,A=-1/0,C=1/0,e=this.geometry.getAttribute("position");if(e)for(let n=0;n<e.count;n++){let r=e.getZ(n);r>A&&(A=r),r<C&&(C=r)}let i=new jg.ShaderMaterial({uniforms:{maxZ:{value:A},uColor:{value:new jg.Color(this.options[0].fillColor)},uGradualColor1:{value:new jg.Color(gA(this.options[0].fillColor,.99))},uGradualColor2:{value:new jg.Color(gA(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:C}},vertexShader:g,fragmentShader:I,transparent:!0});this.material=i}initLineMaterial(){let{strokeColor:g,strokeOpacity:I}=this.options[0],A=R.createLineMaterial({color:g,opacity:I});return this.lineMaterial=A,A}getBorderPoints(g){let{height:I,deltaHeight:A,geometry:C}=g,e=[],i=I+(A||0),{coords:n}=C;for(let r=0;r<n.length;r++){let o=n[r];for(let s=0;s<o.length;s++){let a=o[s],u=s+1===o.length?o[0]:o[s+1];e.push(new jg.Vector3(a[0],a[1],i)),e.push(new jg.Vector3(u[0],u[1],i))}}return e}initLineGeometry(){let g=this.options.map(I=>{let A=this.getBorderPoints(I);return new jg.BufferGeometry().setFromPoints(A)});this.lineGeometry=(0,w2.mergeGeometries)(g)}createBorder(){let g=new jg.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=g,this.add(g),g}setOpacity(g,I){I===void 0&&(I=!1),I?this.material.uniforms.uOpacity.value=g:this.material.uniforms.uOpacity.value=Math.min(g,this.originFillOpacity),this.material.needsUpdate=!0}init(){return m(this,null,function*(){yield this.initGeometry(),this.initMaterial();let g=new jg.Mesh(this.geometry,this.material);this.add(g),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry())})}dispose(){var g,I,A;(g=this.geometry)==null||g.dispose(),(I=this.material)==null||I.dispose(),(A=this.lineGeometry)==null||A.dispose(),this.clear()}constructor(g,I){super(),this.context=g,this.options=I,this.originFillOpacity=1,I.length&&(this.originFillOpacity=I[0].fillOpacity,this.init())}};var Dz=l(W(),1),wz=l(_(),1);var gg=require("three");var mr={id:"",uuid:"",iconUrl:"",name:"",airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0,centerCoords:[0,0],secondWidth:0,secondHeight:0,secondRotate:0},sC=class extends gg.Object3D{init(){return m(this,null,function*(){let g=this.options.reduce((C,e)=>{let{iconUrl:i}=e;return C.has(i)||C.set(i,[]),C.get(i).push(e),C},new Map),I=Array.from(g.values());(yield Promise.all(I.map(C=>m(this,null,function*(){let e=C[0].iconUrl,i=yield wg.getTextureByUrl(e);return new gg.MeshBasicMaterial({map:i,transparent:!0,alphaTest:.2,side:gg.FrontSide})})))).forEach((C,e)=>{let i=new gg.InstancedMesh(this.geometry,C,I[e].length);I[e].forEach((n,r)=>{let o=new gg.Matrix4().compose(new gg.Vector3(n.centerCoords[0],n.centerCoords[1],n.deltaHeight+n.airHeight+n.height),new gg.Quaternion().setFromAxisAngle(new gg.Vector3(0,0,1),n.secondRotate),new gg.Vector3(n.secondWidth,n.secondHeight,1));i.setMatrixAt(r,o)}),this.add(i)}),this.position.z+=.004})}setOpacity(g){this.children.forEach(I=>{I.material.opacity=g,I.material.needsUpdate=!0})}dispose(){U(this),this.clear()}constructor(g,I){super(),this.context=g,this.geometry=new gg.ShapeGeometry(new gg.Shape([new gg.Vector2(-.5,-.5),new gg.Vector2(-.5,.5),new gg.Vector2(.5,.5),new gg.Vector2(.5,-.5)])),this.options=I.map(C=>D({},mr,C));let A=new gg.Float32BufferAttribute([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",A),this.init()}};var lC=require("three");var e4={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0,center_x:0,center_y:0},qu=class extends lC.Object3D{loadModel(){return m(this,null,function*(){let g=yield Fg.loadModel(this.options.url);g.scene.rotation.set(Math.PI/2,0,0);let A=new lC.Box3().setFromObject(g.scene).getSize(new lC.Vector3),C=Math.max(A.x,A.y),e=this.options.width/C;this.scale.set(e,e,e),this.add(g.scene),this.position.set(this.options.center_x,this.options.center_y,0),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=g,this.rotateZ(this.options.rotate)})}meshSetMaterial(g){g instanceof lC.Mesh&&(g.frustumCulled=!1,g.castShadow=!0,g.material.emissiveIntensity*=.95,g.material.emissive=g.material.color,g.material.emissiveMap=g.material.map),g.children.forEach(A=>{this.meshSetMaterial(A)})}dispose(){U(this),this.model=null}constructor(g,I){super(),this.context=g,this.model=null,this.options=Object.assign({},e4,I),this.loadModel()}};var Kz=l(W(),1),zg=require("three"),B2=require("three/examples/jsm/utils/BufferGeometryUtils.js");var M2=require("three/examples/jsm/lines/LineSegments2.js"),v2=require("three/examples/jsm/lines/LineSegmentsGeometry.js");var gi=class extends zg.Object3D{initGeometry(){return m(this,null,function*(){this.geometry=yield VI.GetMergedShapeGeometry(this.options)})}initMaterial(){let g=R.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=g,g}initLineMaterial(){let{strokeColor:g,strokeOpacity:I}=this.options[0],A=R.createLineMaterial({color:g,opacity:I,vertexColors:!0});return this.lineMaterial=A,A}getBorderPoints(g){let{deltaHeight:I,geometry:A}=g,C=[],e=I||0,{coords:i}=A;for(let n=0;n<i.length;n++){let r=i[n];for(let o=0;o<r.length;o++){let s=r[o],a=o+1===r.length?r[0]:r[o+1];C.push(new zg.Vector3(s[0],s[1],e)),C.push(new zg.Vector3(a[0],a[1],e))}}return C}initDoubleLine(){let g=this.options.filter(I=>{var A,C;return I.double&&((C=I.geometry.otherCoords)==null||(A=C[1])==null?void 0:A.length)});g.length&&[!0,!1].forEach(I=>{let A=g.filter(o=>o.dashed===I);if(!A.length)return;let C=R.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:I,resolution:new zg.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),e=[],i=[];A.forEach(o=>{let s=o.geometry.otherCoords[1],a=o.airHeight+(o.deltaHeight||0)+.01,u=new zg.Color(o.secondColor);for(let c=0;c<s.length-1;c++){let h=s[c],f=s[c+1];e.push(h[0],h[1],a,f[0],f[1],a),i.push(u.r,u.g,u.b,u.r,u.g,u.b)}});let n=new v2.LineSegmentsGeometry;n.setPositions(e),n.setColors(i);let r=new M2.LineSegments2(n,C);r.computeLineDistances(),r.position.z+=.01,this.add(r),this.doubleLines.push(r)})}initLineGeometry(){let g=this.options.map(I=>{let A=this.getBorderPoints(I);return new zg.BufferGeometry().setFromPoints(A)});this.lineGeometry=(0,B2.mergeGeometries)(g)}createBorder(){let g=new zg.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=g,this.add(g),g}init(){return m(this,null,function*(){yield this.initGeometry(),this.initMaterial();let g=new zg.Mesh(this.geometry,this.material);this.add(g),this.initDoubleLine(),this.position.z+=.02+(this.options[0].deltaHeight||0)})}dispose(){var g,I;(g=this.geometry)==null||g.dispose(),(I=this.lineGeometry)==null||I.dispose(),this.doubleLines.map(A=>A.geometry.dispose()),this.clear()}constructor(g,I){super(),this.context=g,this.options=I,this.doubleLines=[],I.length&&this.init()}};var jz=l(W(),1),vg=require("three");var $u=class extends vg.Object3D{initMergedElement(){let g=new vg.ObjectLoader,I=g.parseGeometries([this.mergedElement.mergedGeometry]);if(this.geometry=I[this.mergedElement.mergedGeometry.uuid],this.initMaterial(),this.initMesh(),this.mesh.position.z=(this.mergedElement.deltaHeight||0)+this.mergedElement.airHeight,this.mergedElement.lineGeometry){let A=g.parseGeometries([this.mergedElement.lineGeometry]);this.lineGeometry=A[this.mergedElement.lineGeometry.uuid],this.initLineMaterial(),this.createBorder()}}init(){return m(this,null,function*(){this.geometry=yield this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return m(this,null,function*(){let g=yield VI.GetMergeGeometry(this.options);return this.dispatchEvent({type:"init-geometry",geometry:g}),g})}initMaterial(){let g=`
|
|
7982
|
+
`,A=-1/0,C=1/0,e=this.geometry.getAttribute("position");if(e)for(let n=0;n<e.count;n++){let r=e.getZ(n);r>A&&(A=r),r<C&&(C=r)}let i=new jg.ShaderMaterial({uniforms:{maxZ:{value:A},uColor:{value:new jg.Color(this.options[0].fillColor)},uGradualColor1:{value:new jg.Color(gA(this.options[0].fillColor,.99))},uGradualColor2:{value:new jg.Color(gA(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:C}},vertexShader:g,fragmentShader:I,transparent:!0});this.material=i}initLineMaterial(){let{strokeColor:g,strokeOpacity:I}=this.options[0],A=R.createLineMaterial({color:g,opacity:I});return this.lineMaterial=A,A}getBorderPoints(g){let{height:I,deltaHeight:A,geometry:C}=g,e=[],i=I+(A||0),{coords:n}=C;for(let r=0;r<n.length;r++){let o=n[r];for(let s=0;s<o.length;s++){let a=o[s],u=s+1===o.length?o[0]:o[s+1];e.push(new jg.Vector3(a[0],a[1],i)),e.push(new jg.Vector3(u[0],u[1],i))}}return e}initLineGeometry(){let g=this.options.map(I=>{let A=this.getBorderPoints(I);return new jg.BufferGeometry().setFromPoints(A)});this.lineGeometry=(0,w2.mergeGeometries)(g)}createBorder(){let g=new jg.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=g,this.add(g),g}setOpacity(g,I){I===void 0&&(I=!1),I?this.material.uniforms.uOpacity.value=g:this.material.uniforms.uOpacity.value=Math.min(g,this.originFillOpacity),this.material.needsUpdate=!0}init(){return m(this,null,function*(){yield this.initGeometry(),this.initMaterial();let g=new jg.Mesh(this.geometry,this.material);this.add(g),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry())})}dispose(){var g,I,A;(g=this.geometry)==null||g.dispose(),(I=this.material)==null||I.dispose(),(A=this.lineGeometry)==null||A.dispose(),this.clear()}constructor(g,I){super(),this.context=g,this.options=I,this.originFillOpacity=1,I.length&&(this.originFillOpacity=I[0].fillOpacity,this.init())}};var Dz=l(W(),1),wz=l(_(),1);var gg=require("three");var mr={id:"",uuid:"",iconUrl:"",name:"",airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0,centerCoords:[0,0],secondWidth:0,secondHeight:0,secondRotate:0},sC=class extends gg.Object3D{init(){return m(this,null,function*(){let g=this.options.reduce((C,e)=>{let{iconUrl:i}=e;return C.has(i)||C.set(i,[]),C.get(i).push(e),C},new Map),I=Array.from(g.values());(yield Promise.all(I.map(C=>m(this,null,function*(){let e=C[0].iconUrl,i=yield wg.getTextureByUrl(e);return new gg.MeshBasicMaterial({map:i,transparent:!0,alphaTest:.2,side:gg.FrontSide})})))).forEach((C,e)=>{let i=new gg.InstancedMesh(this.geometry,C,I[e].length);I[e].forEach((n,r)=>{let o=new gg.Matrix4().compose(new gg.Vector3(n.centerCoords[0],n.centerCoords[1],n.deltaHeight+n.airHeight+n.height),new gg.Quaternion().setFromAxisAngle(new gg.Vector3(0,0,1),n.secondRotate),new gg.Vector3(n.secondWidth,n.secondHeight,1));i.setMatrixAt(r,o)}),this.add(i)}),this.position.z+=.004})}setOpacity(g){this.children.forEach(I=>{I.material.opacity=g,I.material.needsUpdate=!0})}dispose(){U(this),this.clear()}constructor(g,I){super(),this.context=g,this.geometry=new gg.ShapeGeometry(new gg.Shape([new gg.Vector2(-.5,-.5),new gg.Vector2(-.5,.5),new gg.Vector2(.5,.5),new gg.Vector2(.5,-.5)])),this.options=I.map(C=>D({},mr,C));let A=new gg.Float32BufferAttribute([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",A),this.init()}};var lC=require("three");var e4={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0,center_x:0,center_y:0},qu=class extends lC.Object3D{loadModel(){return m(this,null,function*(){let g=yield Fg.loadModel(this.options.url);g.scene.rotation.set(Math.PI/2,0,0);let A=new lC.Box3().setFromObject(g.scene).getSize(new lC.Vector3),C=Math.max(A.x,A.y),e=this.options.width/C;this.scale.set(e,e,e),this.add(g.scene),this.position.set(this.options.center_x,this.options.center_y,0),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=g,this.rotateZ(this.options.rotate),this.dispatchEvent({type:"load-model-end",object:g})})}meshSetMaterial(g){g instanceof lC.Mesh&&(g.frustumCulled=!1,g.castShadow=!0,g.material.emissiveIntensity*=.95,g.material.emissive=g.material.color,g.material.emissiveMap=g.material.map),g.children.forEach(A=>{this.meshSetMaterial(A)})}dispose(){U(this),this.model=null,this._listeners={}}constructor(g,I){super(),this.context=g,this.model=null,this.options=Object.assign({},e4,I),this.loadModel()}};var Kz=l(W(),1),zg=require("three"),B2=require("three/examples/jsm/utils/BufferGeometryUtils.js");var M2=require("three/examples/jsm/lines/LineSegments2.js"),v2=require("three/examples/jsm/lines/LineSegmentsGeometry.js");var gi=class extends zg.Object3D{initGeometry(){return m(this,null,function*(){this.geometry=yield VI.GetMergedShapeGeometry(this.options)})}initMaterial(){let g=R.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=g,g}initLineMaterial(){let{strokeColor:g,strokeOpacity:I}=this.options[0],A=R.createLineMaterial({color:g,opacity:I,vertexColors:!0});return this.lineMaterial=A,A}getBorderPoints(g){let{deltaHeight:I,geometry:A}=g,C=[],e=I||0,{coords:i}=A;for(let n=0;n<i.length;n++){let r=i[n];for(let o=0;o<r.length;o++){let s=r[o],a=o+1===r.length?r[0]:r[o+1];C.push(new zg.Vector3(s[0],s[1],e)),C.push(new zg.Vector3(a[0],a[1],e))}}return C}initDoubleLine(){let g=this.options.filter(I=>{var A,C;return I.double&&((C=I.geometry.otherCoords)==null||(A=C[1])==null?void 0:A.length)});g.length&&[!0,!1].forEach(I=>{let A=g.filter(o=>o.dashed===I);if(!A.length)return;let C=R.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:I,resolution:new zg.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),e=[],i=[];A.forEach(o=>{let s=o.geometry.otherCoords[1],a=o.airHeight+(o.deltaHeight||0)+.01,u=new zg.Color(o.secondColor);for(let c=0;c<s.length-1;c++){let h=s[c],f=s[c+1];e.push(h[0],h[1],a,f[0],f[1],a),i.push(u.r,u.g,u.b,u.r,u.g,u.b)}});let n=new v2.LineSegmentsGeometry;n.setPositions(e),n.setColors(i);let r=new M2.LineSegments2(n,C);r.computeLineDistances(),r.position.z+=.01,this.add(r),this.doubleLines.push(r)})}initLineGeometry(){let g=this.options.map(I=>{let A=this.getBorderPoints(I);return new zg.BufferGeometry().setFromPoints(A)});this.lineGeometry=(0,B2.mergeGeometries)(g)}createBorder(){let g=new zg.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=g,this.add(g),g}init(){return m(this,null,function*(){yield this.initGeometry(),this.initMaterial();let g=new zg.Mesh(this.geometry,this.material);this.add(g),this.initDoubleLine(),this.position.z+=.02+(this.options[0].deltaHeight||0)})}dispose(){var g,I;(g=this.geometry)==null||g.dispose(),(I=this.lineGeometry)==null||I.dispose(),this.doubleLines.map(A=>A.geometry.dispose()),this.clear()}constructor(g,I){super(),this.context=g,this.options=I,this.doubleLines=[],I.length&&this.init()}};var jz=l(W(),1),vg=require("three");var $u=class extends vg.Object3D{initMergedElement(){let g=new vg.ObjectLoader,I=g.parseGeometries([this.mergedElement.mergedGeometry]);if(this.geometry=I[this.mergedElement.mergedGeometry.uuid],this.initMaterial(),this.initMesh(),this.mesh.position.z=(this.mergedElement.deltaHeight||0)+this.mergedElement.airHeight,this.mergedElement.lineGeometry){let A=g.parseGeometries([this.mergedElement.lineGeometry]);this.lineGeometry=A[this.mergedElement.lineGeometry.uuid],this.initLineMaterial(),this.createBorder()}}init(){return m(this,null,function*(){this.geometry=yield this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return m(this,null,function*(){let g=yield VI.GetMergeGeometry(this.options);return this.dispatchEvent({type:"init-geometry",geometry:g}),g})}initMaterial(){let g=`
|
|
7983
7983
|
varying vec3 vPosition; // \u7528\u4E8E\u4F20\u9012\u9876\u70B9\u7684\u4F4D\u7F6E\u7ED9\u7247\u6BB5\u7740\u8272\u5668
|
|
7984
7984
|
uniform float maxZ; // \u58F0\u660E\u4E00\u4E2Auniform\u53D8\u91CF
|
|
7985
7985
|
uniform vec3 uColor;
|
package/lib/index.esm.min.js
CHANGED
|
@@ -7979,7 +7979,7 @@ void main() {
|
|
|
7979
7979
|
gl_FragColor = vec4(vColor, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
|
|
7980
7980
|
}
|
|
7981
7981
|
}
|
|
7982
|
-
`,A=-1/0,C=1/0,e=this.geometry.getAttribute("position");if(e)for(let n=0;n<e.count;n++){let r=e.getZ(n);r>A&&(A=r),r<C&&(C=r)}let i=new nN({uniforms:{maxZ:{value:A},uColor:{value:new fu(this.options[0].fillColor)},uGradualColor1:{value:new fu(RI(this.options[0].fillColor,.99))},uGradualColor2:{value:new fu(RI(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:C}},vertexShader:g,fragmentShader:I,transparent:!0});this.material=i}initLineMaterial(){let{strokeColor:g,strokeOpacity:I}=this.options[0],A=O.createLineMaterial({color:g,opacity:I});return this.lineMaterial=A,A}getBorderPoints(g){let{height:I,deltaHeight:A,geometry:C}=g,e=[],i=I+(A||0),{coords:n}=C;for(let r=0;r<n.length;r++){let o=n[r];for(let s=0;s<o.length;s++){let a=o[s],u=s+1===o.length?o[0]:o[s+1];e.push(new Yw(a[0],a[1],i)),e.push(new Yw(u[0],u[1],i))}}return e}initLineGeometry(){let g=this.options.map(I=>{let A=this.getBorderPoints(I);return new CN().setFromPoints(A)});this.lineGeometry=rN(g)}createBorder(){let g=new tN(this.lineGeometry,this.lineMaterial);return this.LineMesh=g,this.add(g),g}setOpacity(g,I){I===void 0&&(I=!1),I?this.material.uniforms.uOpacity.value=g:this.material.uniforms.uOpacity.value=Math.min(g,this.originFillOpacity),this.material.needsUpdate=!0}init(){return m(this,null,function*(){yield this.initGeometry(),this.initMaterial();let g=new eN(this.geometry,this.material);this.add(g),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry())})}dispose(){var g,I,A;(g=this.geometry)==null||g.dispose(),(I=this.material)==null||I.dispose(),(A=this.lineGeometry)==null||A.dispose(),this.clear()}constructor(g,I){super(),this.context=g,this.options=I,this.originFillOpacity=1,I.length&&(this.originFillOpacity=I[0].fillOpacity,this.init())}};var wq=l(j(),1),Bq=l(P(),1);import{Float32BufferAttribute as oN,FrontSide as sN,InstancedMesh as aN,Matrix4 as uN,MeshBasicMaterial as lN,Object3D as cN,Quaternion as hN,Shape as pN,ShapeGeometry as fN,Vector2 as _n,Vector3 as du}from"three";var mu={id:"",uuid:"",iconUrl:"",name:"",airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0,centerCoords:[0,0],secondWidth:0,secondHeight:0,secondRotate:0},CC=class extends cN{init(){return m(this,null,function*(){let g=this.options.reduce((C,e)=>{let{iconUrl:i}=e;return C.has(i)||C.set(i,[]),C.get(i).push(e),C},new Map),I=Array.from(g.values());(yield Promise.all(I.map(C=>m(this,null,function*(){let e=C[0].iconUrl,i=yield ag.getTextureByUrl(e);return new lN({map:i,transparent:!0,alphaTest:.2,side:sN})})))).forEach((C,e)=>{let i=new aN(this.geometry,C,I[e].length);I[e].forEach((n,r)=>{let o=new uN().compose(new du(n.centerCoords[0],n.centerCoords[1],n.deltaHeight+n.airHeight+n.height),new hN().setFromAxisAngle(new du(0,0,1),n.secondRotate),new du(n.secondWidth,n.secondHeight,1));i.setMatrixAt(r,o)}),this.add(i)}),this.position.z+=.004})}setOpacity(g){this.children.forEach(I=>{I.material.opacity=g,I.material.needsUpdate=!0})}dispose(){H(this),this.clear()}constructor(g,I){super(),this.context=g,this.geometry=new fN(new pN([new _n(-.5,-.5),new _n(-.5,.5),new _n(.5,.5),new _n(.5,-.5)])),this.options=I.map(C=>D({},mu,C));let A=new oN([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",A),this.init()}};import{Box3 as dN,Mesh as mN,Object3D as yN,Vector3 as SN}from"three";var DN={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0,center_x:0,center_y:0},jw=class extends yN{loadModel(){return m(this,null,function*(){let g=yield dg.loadModel(this.options.url);g.scene.rotation.set(Math.PI/2,0,0);let A=new dN().setFromObject(g.scene).getSize(new SN),C=Math.max(A.x,A.y),e=this.options.width/C;this.scale.set(e,e,e),this.add(g.scene),this.position.set(this.options.center_x,this.options.center_y,0),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=g,this.rotateZ(this.options.rotate)})}meshSetMaterial(g){g instanceof mN&&(g.frustumCulled=!1,g.castShadow=!0,g.material.emissiveIntensity*=.95,g.material.emissive=g.material.color,g.material.emissiveMap=g.material.map),g.children.forEach(A=>{this.meshSetMaterial(A)})}dispose(){H(this),this.model=null}constructor(g,I){super(),this.context=g,this.model=null,this.options=Object.assign({},DN,I),this.loadModel()}};var Oq=l(j(),1);import{BufferGeometry as wN,Color as BN,LineSegments as MN,Mesh as vN,Object3D as PN,Vector2 as _N,Vector3 as Rw}from"three";import{mergeGeometries as EN}from"three/examples/jsm/utils/BufferGeometryUtils.js";import{LineSegments2 as bN}from"three/examples/jsm/lines/LineSegments2.js";import{LineSegmentsGeometry as xN}from"three/examples/jsm/lines/LineSegmentsGeometry.js";var En=class extends PN{initGeometry(){return m(this,null,function*(){this.geometry=yield dI.GetMergedShapeGeometry(this.options)})}initMaterial(){let g=O.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=g,g}initLineMaterial(){let{strokeColor:g,strokeOpacity:I}=this.options[0],A=O.createLineMaterial({color:g,opacity:I,vertexColors:!0});return this.lineMaterial=A,A}getBorderPoints(g){let{deltaHeight:I,geometry:A}=g,C=[],e=I||0,{coords:i}=A;for(let n=0;n<i.length;n++){let r=i[n];for(let o=0;o<r.length;o++){let s=r[o],a=o+1===r.length?r[0]:r[o+1];C.push(new Rw(s[0],s[1],e)),C.push(new Rw(a[0],a[1],e))}}return C}initDoubleLine(){let g=this.options.filter(I=>{var A,C;return I.double&&((C=I.geometry.otherCoords)==null||(A=C[1])==null?void 0:A.length)});g.length&&[!0,!1].forEach(I=>{let A=g.filter(o=>o.dashed===I);if(!A.length)return;let C=O.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:I,resolution:new _N(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),e=[],i=[];A.forEach(o=>{let s=o.geometry.otherCoords[1],a=o.airHeight+(o.deltaHeight||0)+.01,u=new BN(o.secondColor);for(let c=0;c<s.length-1;c++){let h=s[c],f=s[c+1];e.push(h[0],h[1],a,f[0],f[1],a),i.push(u.r,u.g,u.b,u.r,u.g,u.b)}});let n=new xN;n.setPositions(e),n.setColors(i);let r=new bN(n,C);r.computeLineDistances(),r.position.z+=.01,this.add(r),this.doubleLines.push(r)})}initLineGeometry(){let g=this.options.map(I=>{let A=this.getBorderPoints(I);return new wN().setFromPoints(A)});this.lineGeometry=EN(g)}createBorder(){let g=new MN(this.lineGeometry,this.lineMaterial);return this.LineMesh=g,this.add(g),g}init(){return m(this,null,function*(){yield this.initGeometry(),this.initMaterial();let g=new vN(this.geometry,this.material);this.add(g),this.initDoubleLine(),this.position.z+=.02+(this.options[0].deltaHeight||0)})}dispose(){var g,I;(g=this.geometry)==null||g.dispose(),(I=this.lineGeometry)==null||I.dispose(),this.doubleLines.map(A=>A.geometry.dispose()),this.clear()}constructor(g,I){super(),this.context=g,this.options=I,this.doubleLines=[],I.length&&this.init()}};var Hq=l(j(),1);import{Object3D as KN,Mesh as GN,Vector3 as Nw,BufferGeometry as TN,LineSegments as ON,ShaderMaterial as YN,Color as Ww,ObjectLoader as jN}from"three";var Fw=class extends KN{initMergedElement(){let g=new jN,I=g.parseGeometries([this.mergedElement.mergedGeometry]);if(this.geometry=I[this.mergedElement.mergedGeometry.uuid],this.initMaterial(),this.initMesh(),this.mesh.position.z=(this.mergedElement.deltaHeight||0)+this.mergedElement.airHeight,this.mergedElement.lineGeometry){let A=g.parseGeometries([this.mergedElement.lineGeometry]);this.lineGeometry=A[this.mergedElement.lineGeometry.uuid],this.initLineMaterial(),this.createBorder()}}init(){return m(this,null,function*(){this.geometry=yield this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return m(this,null,function*(){let g=yield dI.GetMergeGeometry(this.options);return this.dispatchEvent({type:"init-geometry",geometry:g}),g})}initMaterial(){let g=`
|
|
7982
|
+
`,A=-1/0,C=1/0,e=this.geometry.getAttribute("position");if(e)for(let n=0;n<e.count;n++){let r=e.getZ(n);r>A&&(A=r),r<C&&(C=r)}let i=new nN({uniforms:{maxZ:{value:A},uColor:{value:new fu(this.options[0].fillColor)},uGradualColor1:{value:new fu(RI(this.options[0].fillColor,.99))},uGradualColor2:{value:new fu(RI(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:C}},vertexShader:g,fragmentShader:I,transparent:!0});this.material=i}initLineMaterial(){let{strokeColor:g,strokeOpacity:I}=this.options[0],A=O.createLineMaterial({color:g,opacity:I});return this.lineMaterial=A,A}getBorderPoints(g){let{height:I,deltaHeight:A,geometry:C}=g,e=[],i=I+(A||0),{coords:n}=C;for(let r=0;r<n.length;r++){let o=n[r];for(let s=0;s<o.length;s++){let a=o[s],u=s+1===o.length?o[0]:o[s+1];e.push(new Yw(a[0],a[1],i)),e.push(new Yw(u[0],u[1],i))}}return e}initLineGeometry(){let g=this.options.map(I=>{let A=this.getBorderPoints(I);return new CN().setFromPoints(A)});this.lineGeometry=rN(g)}createBorder(){let g=new tN(this.lineGeometry,this.lineMaterial);return this.LineMesh=g,this.add(g),g}setOpacity(g,I){I===void 0&&(I=!1),I?this.material.uniforms.uOpacity.value=g:this.material.uniforms.uOpacity.value=Math.min(g,this.originFillOpacity),this.material.needsUpdate=!0}init(){return m(this,null,function*(){yield this.initGeometry(),this.initMaterial();let g=new eN(this.geometry,this.material);this.add(g),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry())})}dispose(){var g,I,A;(g=this.geometry)==null||g.dispose(),(I=this.material)==null||I.dispose(),(A=this.lineGeometry)==null||A.dispose(),this.clear()}constructor(g,I){super(),this.context=g,this.options=I,this.originFillOpacity=1,I.length&&(this.originFillOpacity=I[0].fillOpacity,this.init())}};var wq=l(j(),1),Bq=l(P(),1);import{Float32BufferAttribute as oN,FrontSide as sN,InstancedMesh as aN,Matrix4 as uN,MeshBasicMaterial as lN,Object3D as cN,Quaternion as hN,Shape as pN,ShapeGeometry as fN,Vector2 as _n,Vector3 as du}from"three";var mu={id:"",uuid:"",iconUrl:"",name:"",airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0,centerCoords:[0,0],secondWidth:0,secondHeight:0,secondRotate:0},CC=class extends cN{init(){return m(this,null,function*(){let g=this.options.reduce((C,e)=>{let{iconUrl:i}=e;return C.has(i)||C.set(i,[]),C.get(i).push(e),C},new Map),I=Array.from(g.values());(yield Promise.all(I.map(C=>m(this,null,function*(){let e=C[0].iconUrl,i=yield ag.getTextureByUrl(e);return new lN({map:i,transparent:!0,alphaTest:.2,side:sN})})))).forEach((C,e)=>{let i=new aN(this.geometry,C,I[e].length);I[e].forEach((n,r)=>{let o=new uN().compose(new du(n.centerCoords[0],n.centerCoords[1],n.deltaHeight+n.airHeight+n.height),new hN().setFromAxisAngle(new du(0,0,1),n.secondRotate),new du(n.secondWidth,n.secondHeight,1));i.setMatrixAt(r,o)}),this.add(i)}),this.position.z+=.004})}setOpacity(g){this.children.forEach(I=>{I.material.opacity=g,I.material.needsUpdate=!0})}dispose(){H(this),this.clear()}constructor(g,I){super(),this.context=g,this.geometry=new fN(new pN([new _n(-.5,-.5),new _n(-.5,.5),new _n(.5,.5),new _n(.5,-.5)])),this.options=I.map(C=>D({},mu,C));let A=new oN([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",A),this.init()}};import{Box3 as dN,Mesh as mN,Object3D as yN,Vector3 as SN}from"three";var DN={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0,center_x:0,center_y:0},jw=class extends yN{loadModel(){return m(this,null,function*(){let g=yield dg.loadModel(this.options.url);g.scene.rotation.set(Math.PI/2,0,0);let A=new dN().setFromObject(g.scene).getSize(new SN),C=Math.max(A.x,A.y),e=this.options.width/C;this.scale.set(e,e,e),this.add(g.scene),this.position.set(this.options.center_x,this.options.center_y,0),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=g,this.rotateZ(this.options.rotate),this.dispatchEvent({type:"load-model-end",object:g})})}meshSetMaterial(g){g instanceof mN&&(g.frustumCulled=!1,g.castShadow=!0,g.material.emissiveIntensity*=.95,g.material.emissive=g.material.color,g.material.emissiveMap=g.material.map),g.children.forEach(A=>{this.meshSetMaterial(A)})}dispose(){H(this),this.model=null,this._listeners={}}constructor(g,I){super(),this.context=g,this.model=null,this.options=Object.assign({},DN,I),this.loadModel()}};var Oq=l(j(),1);import{BufferGeometry as wN,Color as BN,LineSegments as MN,Mesh as vN,Object3D as PN,Vector2 as _N,Vector3 as Rw}from"three";import{mergeGeometries as EN}from"three/examples/jsm/utils/BufferGeometryUtils.js";import{LineSegments2 as bN}from"three/examples/jsm/lines/LineSegments2.js";import{LineSegmentsGeometry as xN}from"three/examples/jsm/lines/LineSegmentsGeometry.js";var En=class extends PN{initGeometry(){return m(this,null,function*(){this.geometry=yield dI.GetMergedShapeGeometry(this.options)})}initMaterial(){let g=O.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=g,g}initLineMaterial(){let{strokeColor:g,strokeOpacity:I}=this.options[0],A=O.createLineMaterial({color:g,opacity:I,vertexColors:!0});return this.lineMaterial=A,A}getBorderPoints(g){let{deltaHeight:I,geometry:A}=g,C=[],e=I||0,{coords:i}=A;for(let n=0;n<i.length;n++){let r=i[n];for(let o=0;o<r.length;o++){let s=r[o],a=o+1===r.length?r[0]:r[o+1];C.push(new Rw(s[0],s[1],e)),C.push(new Rw(a[0],a[1],e))}}return C}initDoubleLine(){let g=this.options.filter(I=>{var A,C;return I.double&&((C=I.geometry.otherCoords)==null||(A=C[1])==null?void 0:A.length)});g.length&&[!0,!1].forEach(I=>{let A=g.filter(o=>o.dashed===I);if(!A.length)return;let C=O.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:I,resolution:new _N(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),e=[],i=[];A.forEach(o=>{let s=o.geometry.otherCoords[1],a=o.airHeight+(o.deltaHeight||0)+.01,u=new BN(o.secondColor);for(let c=0;c<s.length-1;c++){let h=s[c],f=s[c+1];e.push(h[0],h[1],a,f[0],f[1],a),i.push(u.r,u.g,u.b,u.r,u.g,u.b)}});let n=new xN;n.setPositions(e),n.setColors(i);let r=new bN(n,C);r.computeLineDistances(),r.position.z+=.01,this.add(r),this.doubleLines.push(r)})}initLineGeometry(){let g=this.options.map(I=>{let A=this.getBorderPoints(I);return new wN().setFromPoints(A)});this.lineGeometry=EN(g)}createBorder(){let g=new MN(this.lineGeometry,this.lineMaterial);return this.LineMesh=g,this.add(g),g}init(){return m(this,null,function*(){yield this.initGeometry(),this.initMaterial();let g=new vN(this.geometry,this.material);this.add(g),this.initDoubleLine(),this.position.z+=.02+(this.options[0].deltaHeight||0)})}dispose(){var g,I;(g=this.geometry)==null||g.dispose(),(I=this.lineGeometry)==null||I.dispose(),this.doubleLines.map(A=>A.geometry.dispose()),this.clear()}constructor(g,I){super(),this.context=g,this.options=I,this.doubleLines=[],I.length&&this.init()}};var Hq=l(j(),1);import{Object3D as KN,Mesh as GN,Vector3 as Nw,BufferGeometry as TN,LineSegments as ON,ShaderMaterial as YN,Color as Ww,ObjectLoader as jN}from"three";var Fw=class extends KN{initMergedElement(){let g=new jN,I=g.parseGeometries([this.mergedElement.mergedGeometry]);if(this.geometry=I[this.mergedElement.mergedGeometry.uuid],this.initMaterial(),this.initMesh(),this.mesh.position.z=(this.mergedElement.deltaHeight||0)+this.mergedElement.airHeight,this.mergedElement.lineGeometry){let A=g.parseGeometries([this.mergedElement.lineGeometry]);this.lineGeometry=A[this.mergedElement.lineGeometry.uuid],this.initLineMaterial(),this.createBorder()}}init(){return m(this,null,function*(){this.geometry=yield this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return m(this,null,function*(){let g=yield dI.GetMergeGeometry(this.options);return this.dispatchEvent({type:"init-geometry",geometry:g}),g})}initMaterial(){let g=`
|
|
7983
7983
|
varying vec3 vPosition; // \u7528\u4E8E\u4F20\u9012\u9876\u70B9\u7684\u4F4D\u7F6E\u7ED9\u7247\u6BB5\u7740\u8272\u5668
|
|
7984
7984
|
uniform float maxZ; // \u58F0\u660E\u4E00\u4E2Auniform\u53D8\u91CF
|
|
7985
7985
|
uniform vec3 uColor;
|
|
@@ -7979,7 +7979,7 @@ void main() {
|
|
|
7979
7979
|
gl_FragColor = vec4(vColor, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
|
|
7980
7980
|
}
|
|
7981
7981
|
}
|
|
7982
|
-
`,n=-1/0,r=1/0,o=this.geometry.getAttribute("position");if(o)for(let a=0;a<o.count;a++){let u=o.getZ(a);u>n&&(n=u),u<r&&(r=u)}let s=new Xz({uniforms:{maxZ:{value:n},uColor:{value:new vh(this.options[0].fillColor)},uGradualColor1:{value:new vh(Be(this.options[0].fillColor,.99))},uGradualColor2:{value:new vh(Be(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:r}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=s}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],n=D.createLineMaterial({color:t,opacity:e});return this.lineMaterial=n,n}getBorderPoints(t){let{height:e,deltaHeight:n,geometry:r}=t,o=[],s=e+(n||0),{coords:a}=r;for(let u=0;u<a.length;u++){let l=a[u];for(let c=0;c<l.length;c++){let h=l[c],p=c+1===l.length?l[0]:l[c+1];o.push(new T3(h[0],h[1],s)),o.push(new T3(p[0],p[1],s))}}return o}initLineGeometry(){let t=this.options.map(e=>{let n=this.getBorderPoints(e);return new Vz().setFromPoints(n)});this.lineGeometry=jz(t)}createBorder(){let t=new Hz(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1),e?this.material.uniforms.uOpacity.value=t:this.material.uniforms.uOpacity.value=Math.min(t,this.originFillOpacity),this.material.needsUpdate=!0}init(){return y(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new Wz(this.geometry,this.material);this.add(t),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry())})}dispose(){var t,e,n;(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.lineGeometry)==null||n.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originFillOpacity=1,e.length&&(this.originFillOpacity=e[0].fillOpacity,this.init())}};var V$=f(F(),1),H$=f(A(),1);import{Float32BufferAttribute as Yz,FrontSide as Zz,InstancedMesh as Kz,Matrix4 as $z,MeshBasicMaterial as Jz,Object3D as Qz,Quaternion as tG,Shape as eG,ShapeGeometry as nG,Vector2 as Ra,Vector3 as _h}from"three";var yh={id:"",uuid:"",iconUrl:"",name:"",airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0,centerCoords:[0,0],secondWidth:0,secondHeight:0,secondRotate:0},ir=class extends Qz{init(){return y(this,null,function*(){let t=this.options.reduce((r,o)=>{let{iconUrl:s}=o;return r.has(s)||r.set(s,[]),r.get(s).push(o),r},new Map),e=Array.from(t.values());(yield Promise.all(e.map(r=>y(this,null,function*(){let o=r[0].iconUrl,s=yield ht.getTextureByUrl(o);return new Jz({map:s,transparent:!0,alphaTest:.2,side:Zz})})))).forEach((r,o)=>{let s=new Kz(this.geometry,r,e[o].length);e[o].forEach((a,u)=>{let l=new $z().compose(new _h(a.centerCoords[0],a.centerCoords[1],a.deltaHeight+a.airHeight+a.height),new tG().setFromAxisAngle(new _h(0,0,1),a.secondRotate),new _h(a.secondWidth,a.secondHeight,1));s.setMatrixAt(u,l)}),this.add(s)}),this.position.z+=.004})}setOpacity(t){this.children.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){W(this),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new nG(new eG([new Ra(-.5,-.5),new Ra(-.5,.5),new Ra(.5,.5),new Ra(.5,-.5)])),this.options=e.map(r=>S({},yh,r));let n=new Yz([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",n),this.init()}};import{Box3 as rG,Mesh as iG,Object3D as oG,Vector3 as sG}from"three";var aG={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0,center_x:0,center_y:0},A3=class extends oG{loadModel(){return y(this,null,function*(){let t=yield _t.loadModel(this.options.url);t.scene.rotation.set(Math.PI/2,0,0);let n=new rG().setFromObject(t.scene).getSize(new sG),r=Math.max(n.x,n.y),o=this.options.width/r;this.scale.set(o,o,o),this.add(t.scene),this.position.set(this.options.center_x,this.options.center_y,0),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t,this.rotateZ(this.options.rotate)})}meshSetMaterial(t){t instanceof iG&&(t.frustumCulled=!1,t.castShadow=!0,t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map),t.children.forEach(n=>{this.meshSetMaterial(n)})}dispose(){W(this),this.model=null}constructor(t,e){super(),this.context=t,this.model=null,this.options=Object.assign({},aG,e),this.loadModel()}};var tJ=f(F(),1);import{BufferGeometry as uG,Color as lG,LineSegments as cG,Mesh as hG,Object3D as pG,Vector2 as fG,Vector3 as C3}from"three";import{mergeGeometries as dG}from"three/examples/jsm/utils/BufferGeometryUtils.js";import{LineSegments2 as gG}from"three/examples/jsm/lines/LineSegments2.js";import{LineSegmentsGeometry as mG}from"three/examples/jsm/lines/LineSegmentsGeometry.js";var Pa=class extends pG{initGeometry(){return y(this,null,function*(){this.geometry=yield _e.GetMergedShapeGeometry(this.options)})}initMaterial(){let t=D.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],n=D.createLineMaterial({color:t,opacity:e,vertexColors:!0});return this.lineMaterial=n,n}getBorderPoints(t){let{deltaHeight:e,geometry:n}=t,r=[],o=e||0,{coords:s}=n;for(let a=0;a<s.length;a++){let u=s[a];for(let l=0;l<u.length;l++){let c=u[l],h=l+1===u.length?u[0]:u[l+1];r.push(new C3(c[0],c[1],o)),r.push(new C3(h[0],h[1],o))}}return r}initDoubleLine(){let t=this.options.filter(e=>{var n,r;return e.double&&((r=e.geometry.otherCoords)==null||(n=r[1])==null?void 0:n.length)});t.length&&[!0,!1].forEach(e=>{let n=t.filter(l=>l.dashed===e);if(!n.length)return;let r=D.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:e,resolution:new fG(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),o=[],s=[];n.forEach(l=>{let c=l.geometry.otherCoords[1],h=l.airHeight+(l.deltaHeight||0)+.01,p=new lG(l.secondColor);for(let d=0;d<c.length-1;d++){let g=c[d],v=c[d+1];o.push(g[0],g[1],h,v[0],v[1],h),s.push(p.r,p.g,p.b,p.r,p.g,p.b)}});let a=new mG;a.setPositions(o),a.setColors(s);let u=new gG(a,r);u.computeLineDistances(),u.position.z+=.01,this.add(u),this.doubleLines.push(u)})}initLineGeometry(){let t=this.options.map(e=>{let n=this.getBorderPoints(e);return new uG().setFromPoints(n)});this.lineGeometry=dG(t)}createBorder(){let t=new cG(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){return y(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new hG(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02+(this.options[0].deltaHeight||0)})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(n=>n.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],e.length&&this.init()}};var lJ=f(F(),1);import{Object3D as vG,Mesh as _G,Vector3 as R3,BufferGeometry as yG,LineSegments as xG,ShaderMaterial as EG,Color as P3,ObjectLoader as SG}from"three";var I3=class extends vG{initMergedElement(){let t=new SG,e=t.parseGeometries([this.mergedElement.mergedGeometry]);if(this.geometry=e[this.mergedElement.mergedGeometry.uuid],this.initMaterial(),this.initMesh(),this.mesh.position.z=(this.mergedElement.deltaHeight||0)+this.mergedElement.airHeight,this.mergedElement.lineGeometry){let n=t.parseGeometries([this.mergedElement.lineGeometry]);this.lineGeometry=n[this.mergedElement.lineGeometry.uuid],this.initLineMaterial(),this.createBorder()}}init(){return y(this,null,function*(){this.geometry=yield this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return y(this,null,function*(){let t=yield _e.GetMergeGeometry(this.options);return this.dispatchEvent({type:"init-geometry",geometry:t}),t})}initMaterial(){let t=`
|
|
7982
|
+
`,n=-1/0,r=1/0,o=this.geometry.getAttribute("position");if(o)for(let a=0;a<o.count;a++){let u=o.getZ(a);u>n&&(n=u),u<r&&(r=u)}let s=new Xz({uniforms:{maxZ:{value:n},uColor:{value:new vh(this.options[0].fillColor)},uGradualColor1:{value:new vh(Be(this.options[0].fillColor,.99))},uGradualColor2:{value:new vh(Be(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:r}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=s}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],n=D.createLineMaterial({color:t,opacity:e});return this.lineMaterial=n,n}getBorderPoints(t){let{height:e,deltaHeight:n,geometry:r}=t,o=[],s=e+(n||0),{coords:a}=r;for(let u=0;u<a.length;u++){let l=a[u];for(let c=0;c<l.length;c++){let h=l[c],p=c+1===l.length?l[0]:l[c+1];o.push(new T3(h[0],h[1],s)),o.push(new T3(p[0],p[1],s))}}return o}initLineGeometry(){let t=this.options.map(e=>{let n=this.getBorderPoints(e);return new Vz().setFromPoints(n)});this.lineGeometry=jz(t)}createBorder(){let t=new Hz(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1),e?this.material.uniforms.uOpacity.value=t:this.material.uniforms.uOpacity.value=Math.min(t,this.originFillOpacity),this.material.needsUpdate=!0}init(){return y(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new Wz(this.geometry,this.material);this.add(t),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry())})}dispose(){var t,e,n;(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.lineGeometry)==null||n.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originFillOpacity=1,e.length&&(this.originFillOpacity=e[0].fillOpacity,this.init())}};var V$=f(F(),1),H$=f(A(),1);import{Float32BufferAttribute as Yz,FrontSide as Zz,InstancedMesh as Kz,Matrix4 as $z,MeshBasicMaterial as Jz,Object3D as Qz,Quaternion as tG,Shape as eG,ShapeGeometry as nG,Vector2 as Ra,Vector3 as _h}from"three";var yh={id:"",uuid:"",iconUrl:"",name:"",airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0,centerCoords:[0,0],secondWidth:0,secondHeight:0,secondRotate:0},ir=class extends Qz{init(){return y(this,null,function*(){let t=this.options.reduce((r,o)=>{let{iconUrl:s}=o;return r.has(s)||r.set(s,[]),r.get(s).push(o),r},new Map),e=Array.from(t.values());(yield Promise.all(e.map(r=>y(this,null,function*(){let o=r[0].iconUrl,s=yield ht.getTextureByUrl(o);return new Jz({map:s,transparent:!0,alphaTest:.2,side:Zz})})))).forEach((r,o)=>{let s=new Kz(this.geometry,r,e[o].length);e[o].forEach((a,u)=>{let l=new $z().compose(new _h(a.centerCoords[0],a.centerCoords[1],a.deltaHeight+a.airHeight+a.height),new tG().setFromAxisAngle(new _h(0,0,1),a.secondRotate),new _h(a.secondWidth,a.secondHeight,1));s.setMatrixAt(u,l)}),this.add(s)}),this.position.z+=.004})}setOpacity(t){this.children.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){W(this),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new nG(new eG([new Ra(-.5,-.5),new Ra(-.5,.5),new Ra(.5,.5),new Ra(.5,-.5)])),this.options=e.map(r=>S({},yh,r));let n=new Yz([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",n),this.init()}};import{Box3 as rG,Mesh as iG,Object3D as oG,Vector3 as sG}from"three";var aG={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0,center_x:0,center_y:0},A3=class extends oG{loadModel(){return y(this,null,function*(){let t=yield _t.loadModel(this.options.url);t.scene.rotation.set(Math.PI/2,0,0);let n=new rG().setFromObject(t.scene).getSize(new sG),r=Math.max(n.x,n.y),o=this.options.width/r;this.scale.set(o,o,o),this.add(t.scene),this.position.set(this.options.center_x,this.options.center_y,0),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t,this.rotateZ(this.options.rotate),this.dispatchEvent({type:"load-model-end",object:t})})}meshSetMaterial(t){t instanceof iG&&(t.frustumCulled=!1,t.castShadow=!0,t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map),t.children.forEach(n=>{this.meshSetMaterial(n)})}dispose(){W(this),this.model=null,this._listeners={}}constructor(t,e){super(),this.context=t,this.model=null,this.options=Object.assign({},aG,e),this.loadModel()}};var tJ=f(F(),1);import{BufferGeometry as uG,Color as lG,LineSegments as cG,Mesh as hG,Object3D as pG,Vector2 as fG,Vector3 as C3}from"three";import{mergeGeometries as dG}from"three/examples/jsm/utils/BufferGeometryUtils.js";import{LineSegments2 as gG}from"three/examples/jsm/lines/LineSegments2.js";import{LineSegmentsGeometry as mG}from"three/examples/jsm/lines/LineSegmentsGeometry.js";var Pa=class extends pG{initGeometry(){return y(this,null,function*(){this.geometry=yield _e.GetMergedShapeGeometry(this.options)})}initMaterial(){let t=D.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],n=D.createLineMaterial({color:t,opacity:e,vertexColors:!0});return this.lineMaterial=n,n}getBorderPoints(t){let{deltaHeight:e,geometry:n}=t,r=[],o=e||0,{coords:s}=n;for(let a=0;a<s.length;a++){let u=s[a];for(let l=0;l<u.length;l++){let c=u[l],h=l+1===u.length?u[0]:u[l+1];r.push(new C3(c[0],c[1],o)),r.push(new C3(h[0],h[1],o))}}return r}initDoubleLine(){let t=this.options.filter(e=>{var n,r;return e.double&&((r=e.geometry.otherCoords)==null||(n=r[1])==null?void 0:n.length)});t.length&&[!0,!1].forEach(e=>{let n=t.filter(l=>l.dashed===e);if(!n.length)return;let r=D.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:e,resolution:new fG(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),o=[],s=[];n.forEach(l=>{let c=l.geometry.otherCoords[1],h=l.airHeight+(l.deltaHeight||0)+.01,p=new lG(l.secondColor);for(let d=0;d<c.length-1;d++){let g=c[d],v=c[d+1];o.push(g[0],g[1],h,v[0],v[1],h),s.push(p.r,p.g,p.b,p.r,p.g,p.b)}});let a=new mG;a.setPositions(o),a.setColors(s);let u=new gG(a,r);u.computeLineDistances(),u.position.z+=.01,this.add(u),this.doubleLines.push(u)})}initLineGeometry(){let t=this.options.map(e=>{let n=this.getBorderPoints(e);return new uG().setFromPoints(n)});this.lineGeometry=dG(t)}createBorder(){let t=new cG(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){return y(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new hG(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02+(this.options[0].deltaHeight||0)})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(n=>n.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],e.length&&this.init()}};var lJ=f(F(),1);import{Object3D as vG,Mesh as _G,Vector3 as R3,BufferGeometry as yG,LineSegments as xG,ShaderMaterial as EG,Color as P3,ObjectLoader as SG}from"three";var I3=class extends vG{initMergedElement(){let t=new SG,e=t.parseGeometries([this.mergedElement.mergedGeometry]);if(this.geometry=e[this.mergedElement.mergedGeometry.uuid],this.initMaterial(),this.initMesh(),this.mesh.position.z=(this.mergedElement.deltaHeight||0)+this.mergedElement.airHeight,this.mergedElement.lineGeometry){let n=t.parseGeometries([this.mergedElement.lineGeometry]);this.lineGeometry=n[this.mergedElement.lineGeometry.uuid],this.initLineMaterial(),this.createBorder()}}init(){return y(this,null,function*(){this.geometry=yield this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return y(this,null,function*(){let t=yield _e.GetMergeGeometry(this.options);return this.dispatchEvent({type:"init-geometry",geometry:t}),t})}initMaterial(){let t=`
|
|
7983
7983
|
varying vec3 vPosition; // \u7528\u4E8E\u4F20\u9012\u9876\u70B9\u7684\u4F4D\u7F6E\u7ED9\u7247\u6BB5\u7740\u8272\u5668
|
|
7984
7984
|
uniform float maxZ; // \u58F0\u660E\u4E00\u4E2Auniform\u53D8\u91CF
|
|
7985
7985
|
uniform vec3 uColor;
|
package/lib/index.online.min.js
CHANGED
|
@@ -12171,7 +12171,7 @@ void main() {
|
|
|
12171
12171
|
gl_FragColor = vec4(vColor, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
|
|
12172
12172
|
}
|
|
12173
12173
|
}
|
|
12174
|
-
`,n=-1/0,i=1/0,o=this.geometry.getAttribute("position");if(o)for(let l=0;l<o.count;l++){let c=o.getZ(l);c>n&&(n=c),c<i&&(i=c)}let a=new gr({uniforms:{maxZ:{value:n},uColor:{value:new ne(this.options[0].fillColor)},uGradualColor1:{value:new ne(J0(this.options[0].fillColor,.99))},uGradualColor2:{value:new ne(J0(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:i}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=a}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],n=hn.createLineMaterial({color:t,opacity:e});return this.lineMaterial=n,n}getBorderPoints(t){let{height:e,deltaHeight:n,geometry:i}=t,o=[],a=e+(n||0),{coords:l}=i;for(let c=0;c<l.length;c++){let f=l[c];for(let g=0;g<f.length;g++){let m=f[g],v=g+1===f.length?f[0]:f[g+1];o.push(new G(m[0],m[1],a)),o.push(new G(v[0],v[1],a))}}return o}initLineGeometry(){let t=this.options.map(e=>{let n=this.getBorderPoints(e);return new qe().setFromPoints(n)});this.lineGeometry=Rh(t)}createBorder(){let t=new Yi(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1),e?this.material.uniforms.uOpacity.value=t:this.material.uniforms.uOpacity.value=Math.min(t,this.originFillOpacity),this.material.needsUpdate=!0}init(){return Tt(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new en(this.geometry,this.material);this.add(t),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry())})}dispose(){var t,e,n;(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.lineGeometry)==null||n.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originFillOpacity=1,e.length&&(this.originFillOpacity=e[0].fillOpacity,this.init())}};var aee=H(En(),1),uee=H(ze(),1);var A6={id:"",uuid:"",iconUrl:"",name:"",airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0,centerCoords:[0,0],secondWidth:0,secondHeight:0,secondRotate:0},Fh=class extends Se{init(){return Tt(this,null,function*(){let t=this.options.reduce((i,o)=>{let{iconUrl:a}=o;return i.has(a)||i.set(a,[]),i.get(a).push(o),i},new Map),e=Array.from(t.values());(yield Promise.all(e.map(i=>Tt(this,null,function*(){let o=i[0].iconUrl,a=yield Mo.getTextureByUrl(o);return new yi({map:a,transparent:!0,alphaTest:.2,side:ys})})))).forEach((i,o)=>{let a=new Gs(this.geometry,i,e[o].length);e[o].forEach((l,c)=>{let f=new Ie().compose(new G(l.centerCoords[0],l.centerCoords[1],l.deltaHeight+l.airHeight+l.height),new Xi().setFromAxisAngle(new G(0,0,1),l.secondRotate),new G(l.secondWidth,l.secondHeight,1));a.setMatrixAt(c,f)}),this.add(a)}),this.position.z+=.004})}setOpacity(t){this.children.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){Lr(this),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new Tf(new Qu([new ft(-.5,-.5),new ft(-.5,.5),new ft(.5,.5),new ft(.5,-.5)])),this.options=e.map(i=>ee({},A6,i));let n=new We([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",n),this.init()}};var xbt={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0,center_x:0,center_y:0},PR=class extends Se{loadModel(){return Tt(this,null,function*(){let t=yield Ms.loadModel(this.options.url);t.scene.rotation.set(Math.PI/2,0,0);let n=new Fe().setFromObject(t.scene).getSize(new G),i=Math.max(n.x,n.y),o=this.options.width/i;this.scale.set(o,o,o),this.add(t.scene),this.position.set(this.options.center_x,this.options.center_y,0),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t,this.rotateZ(this.options.rotate)})}meshSetMaterial(t){t instanceof en&&(t.frustumCulled=!1,t.castShadow=!0,t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map),t.children.forEach(n=>{this.meshSetMaterial(n)})}dispose(){Lr(this),this.model=null}constructor(t,e){super(),this.context=t,this.model=null,this.options=Object.assign({},xbt,e),this.loadModel()}};var wee=H(En(),1);var UY=new Fe,C6=new G,_0=class extends km{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";let t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],e=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new We(t,3)),this.setAttribute("uv",new We(e,2))}applyMatrix4(t){let e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return e!==void 0&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));let n=new If(e,6,1);return this.setAttribute("instanceStart",new ns(n,3,0)),this.setAttribute("instanceEnd",new ns(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));let n=new If(e,6,1);return this.setAttribute("instanceColorStart",new ns(n,3,0)),this.setAttribute("instanceColorEnd",new ns(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new Dm(t.geometry)),this}fromLineSegments(t){let e=t.geometry;return this.setPositions(e.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Fe);let t=this.attributes.instanceStart,e=this.attributes.instanceEnd;t!==void 0&&e!==void 0&&(this.boundingBox.setFromBufferAttribute(t),UY.setFromBufferAttribute(e),this.boundingBox.union(UY))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ai),this.boundingBox===null&&this.computeBoundingBox();let t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(t!==void 0&&e!==void 0){let n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let o=0,a=t.count;o<a;o++)C6.fromBufferAttribute(t,o),i=Math.max(i,n.distanceToSquared(C6)),C6.fromBufferAttribute(e,o),i=Math.max(i,n.distanceToSquared(C6));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}};var FY=new G,BY=new G,us=new Sr,ls=new Sr,sl=new Sr,IR=new G,LR=new Ie,cs=new ex,zY=new G,R6=new Fe,P6=new ai,al=new Sr,ul,hp;function GY(r,t,e){return al.set(0,0,-t,1).applyMatrix4(r.projectionMatrix),al.multiplyScalar(1/al.w),al.x=hp/e.width,al.y=hp/e.height,al.applyMatrix4(r.projectionMatrixInverse),al.multiplyScalar(1/al.w),Math.abs(Math.max(al.x,al.y))}function Ebt(r,t){let e=r.matrixWorld,n=r.geometry,i=n.attributes.instanceStart,o=n.attributes.instanceEnd,a=Math.min(n.instanceCount,i.count);for(let l=0,c=a;l<c;l++){cs.start.fromBufferAttribute(i,l),cs.end.fromBufferAttribute(o,l),cs.applyMatrix4(e);let f=new G,g=new G;ul.distanceSqToSegment(cs.start,cs.end,g,f),g.distanceTo(f)<hp*.5&&t.push({point:g,pointOnLine:f,distance:ul.origin.distanceTo(g),object:r,face:null,faceIndex:l,uv:null,uv1:null})}}function Sbt(r,t,e){let n=t.projectionMatrix,o=r.material.resolution,a=r.matrixWorld,l=r.geometry,c=l.attributes.instanceStart,f=l.attributes.instanceEnd,g=Math.min(l.instanceCount,c.count),m=-t.near;ul.at(1,sl),sl.w=1,sl.applyMatrix4(t.matrixWorldInverse),sl.applyMatrix4(n),sl.multiplyScalar(1/sl.w),sl.x*=o.x/2,sl.y*=o.y/2,sl.z=0,IR.copy(sl),LR.multiplyMatrices(t.matrixWorldInverse,a);for(let v=0,x=g;v<x;v++){if(us.fromBufferAttribute(c,v),ls.fromBufferAttribute(f,v),us.w=1,ls.w=1,us.applyMatrix4(LR),ls.applyMatrix4(LR),us.z>m&&ls.z>m)continue;if(us.z>m){let A=us.z-ls.z,P=(us.z-m)/A;us.lerp(ls,P)}else if(ls.z>m){let A=ls.z-us.z,P=(ls.z-m)/A;ls.lerp(us,P)}us.applyMatrix4(n),ls.applyMatrix4(n),us.multiplyScalar(1/us.w),ls.multiplyScalar(1/ls.w),us.x*=o.x/2,us.y*=o.y/2,ls.x*=o.x/2,ls.y*=o.y/2,cs.start.copy(us),cs.start.z=0,cs.end.copy(ls),cs.end.z=0;let w=cs.closestPointToPointParameter(IR,!0);cs.at(w,zY);let E=vd.lerp(us.z,ls.z,w),b=E>=-1&&E<=1,C=IR.distanceTo(zY)<hp*.5;if(b&&C){cs.start.fromBufferAttribute(c,v),cs.end.fromBufferAttribute(f,v),cs.start.applyMatrix4(a),cs.end.applyMatrix4(a);let A=new G,P=new G;ul.distanceSqToSegment(cs.start,cs.end,P,A),e.push({point:P,pointOnLine:A,distance:ul.origin.distanceTo(P),object:r,face:null,faceIndex:v,uv:null,uv1:null})}}}var _c=class extends en{constructor(t=new _0,e=new Au({color:Math.random()*16777215})){super(t,e),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){let t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.count);for(let a=0,l=0,c=e.count;a<c;a++,l+=2)FY.fromBufferAttribute(e,a),BY.fromBufferAttribute(n,a),i[l]=l===0?0:i[l-1],i[l+1]=i[l]+FY.distanceTo(BY);let o=new If(i,2,1);return t.setAttribute("instanceDistanceStart",new ns(o,1,0)),t.setAttribute("instanceDistanceEnd",new ns(o,1,1)),this}raycast(t,e){let n=this.material.worldUnits,i=t.camera;i===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');let o=t.params.Line2!==void 0&&t.params.Line2.threshold||0;ul=t.ray;let a=this.matrixWorld,l=this.geometry,c=this.material;hp=c.linewidth+o,l.boundingSphere===null&&l.computeBoundingSphere(),P6.copy(l.boundingSphere).applyMatrix4(a);let f;if(n)f=hp*.5;else{let m=Math.max(i.near,P6.distanceToPoint(ul.origin));f=GY(i,m,c.resolution)}if(P6.radius+=f,ul.intersectsSphere(P6)===!1)return;l.boundingBox===null&&l.computeBoundingBox(),R6.copy(l.boundingBox).applyMatrix4(a);let g;if(n)g=hp*.5;else{let m=Math.max(i.near,R6.distanceToPoint(ul.origin));g=GY(i,m,c.resolution)}R6.expandByScalar(g),ul.intersectsBox(R6)!==!1&&(n?Ebt(this,e):Sbt(this,i,e))}};var m_=class extends Se{initGeometry(){return Tt(this,null,function*(){this.geometry=yield v0.GetMergedShapeGeometry(this.options)})}initMaterial(){let t=hn.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],n=hn.createLineMaterial({color:t,opacity:e,vertexColors:!0});return this.lineMaterial=n,n}getBorderPoints(t){let{deltaHeight:e,geometry:n}=t,i=[],o=e||0,{coords:a}=n;for(let l=0;l<a.length;l++){let c=a[l];for(let f=0;f<c.length;f++){let g=c[f],m=f+1===c.length?c[0]:c[f+1];i.push(new G(g[0],g[1],o)),i.push(new G(m[0],m[1],o))}}return i}initDoubleLine(){let t=this.options.filter(e=>{var n,i;return e.double&&((i=e.geometry.otherCoords)==null||(n=i[1])==null?void 0:n.length)});t.length&&[!0,!1].forEach(e=>{let n=t.filter(f=>f.dashed===e);if(!n.length)return;let i=hn.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:e,resolution:new ft(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),o=[],a=[];n.forEach(f=>{let g=f.geometry.otherCoords[1],m=f.airHeight+(f.deltaHeight||0)+.01,v=new ne(f.secondColor);for(let x=0;x<g.length-1;x++){let S=g[x],w=g[x+1];o.push(S[0],S[1],m,w[0],w[1],m),a.push(v.r,v.g,v.b,v.r,v.g,v.b)}});let l=new _0;l.setPositions(o),l.setColors(a);let c=new _c(l,i);c.computeLineDistances(),c.position.z+=.01,this.add(c),this.doubleLines.push(c)})}initLineGeometry(){let t=this.options.map(e=>{let n=this.getBorderPoints(e);return new qe().setFromPoints(n)});this.lineGeometry=Rh(t)}createBorder(){let t=new Yi(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){return Tt(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new en(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02+(this.options[0].deltaHeight||0)})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(n=>n.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],e.length&&this.init()}};var Oee=H(En(),1);var NR=class extends Se{initMergedElement(){let t=new Mu,e=t.parseGeometries([this.mergedElement.mergedGeometry]);if(this.geometry=e[this.mergedElement.mergedGeometry.uuid],this.initMaterial(),this.initMesh(),this.mesh.position.z=(this.mergedElement.deltaHeight||0)+this.mergedElement.airHeight,this.mergedElement.lineGeometry){let n=t.parseGeometries([this.mergedElement.lineGeometry]);this.lineGeometry=n[this.mergedElement.lineGeometry.uuid],this.initLineMaterial(),this.createBorder()}}init(){return Tt(this,null,function*(){this.geometry=yield this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return Tt(this,null,function*(){let t=yield v0.GetMergeGeometry(this.options);return this.dispatchEvent({type:"init-geometry",geometry:t}),t})}initMaterial(){let t=`
|
|
12174
|
+
`,n=-1/0,i=1/0,o=this.geometry.getAttribute("position");if(o)for(let l=0;l<o.count;l++){let c=o.getZ(l);c>n&&(n=c),c<i&&(i=c)}let a=new gr({uniforms:{maxZ:{value:n},uColor:{value:new ne(this.options[0].fillColor)},uGradualColor1:{value:new ne(J0(this.options[0].fillColor,.99))},uGradualColor2:{value:new ne(J0(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:i}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=a}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],n=hn.createLineMaterial({color:t,opacity:e});return this.lineMaterial=n,n}getBorderPoints(t){let{height:e,deltaHeight:n,geometry:i}=t,o=[],a=e+(n||0),{coords:l}=i;for(let c=0;c<l.length;c++){let f=l[c];for(let g=0;g<f.length;g++){let m=f[g],v=g+1===f.length?f[0]:f[g+1];o.push(new G(m[0],m[1],a)),o.push(new G(v[0],v[1],a))}}return o}initLineGeometry(){let t=this.options.map(e=>{let n=this.getBorderPoints(e);return new qe().setFromPoints(n)});this.lineGeometry=Rh(t)}createBorder(){let t=new Yi(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1),e?this.material.uniforms.uOpacity.value=t:this.material.uniforms.uOpacity.value=Math.min(t,this.originFillOpacity),this.material.needsUpdate=!0}init(){return Tt(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new en(this.geometry,this.material);this.add(t),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry())})}dispose(){var t,e,n;(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.lineGeometry)==null||n.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originFillOpacity=1,e.length&&(this.originFillOpacity=e[0].fillOpacity,this.init())}};var aee=H(En(),1),uee=H(ze(),1);var A6={id:"",uuid:"",iconUrl:"",name:"",airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0,centerCoords:[0,0],secondWidth:0,secondHeight:0,secondRotate:0},Fh=class extends Se{init(){return Tt(this,null,function*(){let t=this.options.reduce((i,o)=>{let{iconUrl:a}=o;return i.has(a)||i.set(a,[]),i.get(a).push(o),i},new Map),e=Array.from(t.values());(yield Promise.all(e.map(i=>Tt(this,null,function*(){let o=i[0].iconUrl,a=yield Mo.getTextureByUrl(o);return new yi({map:a,transparent:!0,alphaTest:.2,side:ys})})))).forEach((i,o)=>{let a=new Gs(this.geometry,i,e[o].length);e[o].forEach((l,c)=>{let f=new Ie().compose(new G(l.centerCoords[0],l.centerCoords[1],l.deltaHeight+l.airHeight+l.height),new Xi().setFromAxisAngle(new G(0,0,1),l.secondRotate),new G(l.secondWidth,l.secondHeight,1));a.setMatrixAt(c,f)}),this.add(a)}),this.position.z+=.004})}setOpacity(t){this.children.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){Lr(this),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new Tf(new Qu([new ft(-.5,-.5),new ft(-.5,.5),new ft(.5,.5),new ft(.5,-.5)])),this.options=e.map(i=>ee({},A6,i));let n=new We([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",n),this.init()}};var xbt={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0,center_x:0,center_y:0},PR=class extends Se{loadModel(){return Tt(this,null,function*(){let t=yield Ms.loadModel(this.options.url);t.scene.rotation.set(Math.PI/2,0,0);let n=new Fe().setFromObject(t.scene).getSize(new G),i=Math.max(n.x,n.y),o=this.options.width/i;this.scale.set(o,o,o),this.add(t.scene),this.position.set(this.options.center_x,this.options.center_y,0),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t,this.rotateZ(this.options.rotate),this.dispatchEvent({type:"load-model-end",object:t})})}meshSetMaterial(t){t instanceof en&&(t.frustumCulled=!1,t.castShadow=!0,t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map),t.children.forEach(n=>{this.meshSetMaterial(n)})}dispose(){Lr(this),this.model=null,this._listeners={}}constructor(t,e){super(),this.context=t,this.model=null,this.options=Object.assign({},xbt,e),this.loadModel()}};var wee=H(En(),1);var UY=new Fe,C6=new G,_0=class extends km{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";let t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],e=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new We(t,3)),this.setAttribute("uv",new We(e,2))}applyMatrix4(t){let e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return e!==void 0&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));let n=new If(e,6,1);return this.setAttribute("instanceStart",new ns(n,3,0)),this.setAttribute("instanceEnd",new ns(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));let n=new If(e,6,1);return this.setAttribute("instanceColorStart",new ns(n,3,0)),this.setAttribute("instanceColorEnd",new ns(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new Dm(t.geometry)),this}fromLineSegments(t){let e=t.geometry;return this.setPositions(e.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Fe);let t=this.attributes.instanceStart,e=this.attributes.instanceEnd;t!==void 0&&e!==void 0&&(this.boundingBox.setFromBufferAttribute(t),UY.setFromBufferAttribute(e),this.boundingBox.union(UY))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ai),this.boundingBox===null&&this.computeBoundingBox();let t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(t!==void 0&&e!==void 0){let n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let o=0,a=t.count;o<a;o++)C6.fromBufferAttribute(t,o),i=Math.max(i,n.distanceToSquared(C6)),C6.fromBufferAttribute(e,o),i=Math.max(i,n.distanceToSquared(C6));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}};var FY=new G,BY=new G,us=new Sr,ls=new Sr,sl=new Sr,IR=new G,LR=new Ie,cs=new ex,zY=new G,R6=new Fe,P6=new ai,al=new Sr,ul,hp;function GY(r,t,e){return al.set(0,0,-t,1).applyMatrix4(r.projectionMatrix),al.multiplyScalar(1/al.w),al.x=hp/e.width,al.y=hp/e.height,al.applyMatrix4(r.projectionMatrixInverse),al.multiplyScalar(1/al.w),Math.abs(Math.max(al.x,al.y))}function Ebt(r,t){let e=r.matrixWorld,n=r.geometry,i=n.attributes.instanceStart,o=n.attributes.instanceEnd,a=Math.min(n.instanceCount,i.count);for(let l=0,c=a;l<c;l++){cs.start.fromBufferAttribute(i,l),cs.end.fromBufferAttribute(o,l),cs.applyMatrix4(e);let f=new G,g=new G;ul.distanceSqToSegment(cs.start,cs.end,g,f),g.distanceTo(f)<hp*.5&&t.push({point:g,pointOnLine:f,distance:ul.origin.distanceTo(g),object:r,face:null,faceIndex:l,uv:null,uv1:null})}}function Sbt(r,t,e){let n=t.projectionMatrix,o=r.material.resolution,a=r.matrixWorld,l=r.geometry,c=l.attributes.instanceStart,f=l.attributes.instanceEnd,g=Math.min(l.instanceCount,c.count),m=-t.near;ul.at(1,sl),sl.w=1,sl.applyMatrix4(t.matrixWorldInverse),sl.applyMatrix4(n),sl.multiplyScalar(1/sl.w),sl.x*=o.x/2,sl.y*=o.y/2,sl.z=0,IR.copy(sl),LR.multiplyMatrices(t.matrixWorldInverse,a);for(let v=0,x=g;v<x;v++){if(us.fromBufferAttribute(c,v),ls.fromBufferAttribute(f,v),us.w=1,ls.w=1,us.applyMatrix4(LR),ls.applyMatrix4(LR),us.z>m&&ls.z>m)continue;if(us.z>m){let A=us.z-ls.z,P=(us.z-m)/A;us.lerp(ls,P)}else if(ls.z>m){let A=ls.z-us.z,P=(ls.z-m)/A;ls.lerp(us,P)}us.applyMatrix4(n),ls.applyMatrix4(n),us.multiplyScalar(1/us.w),ls.multiplyScalar(1/ls.w),us.x*=o.x/2,us.y*=o.y/2,ls.x*=o.x/2,ls.y*=o.y/2,cs.start.copy(us),cs.start.z=0,cs.end.copy(ls),cs.end.z=0;let w=cs.closestPointToPointParameter(IR,!0);cs.at(w,zY);let E=vd.lerp(us.z,ls.z,w),b=E>=-1&&E<=1,C=IR.distanceTo(zY)<hp*.5;if(b&&C){cs.start.fromBufferAttribute(c,v),cs.end.fromBufferAttribute(f,v),cs.start.applyMatrix4(a),cs.end.applyMatrix4(a);let A=new G,P=new G;ul.distanceSqToSegment(cs.start,cs.end,P,A),e.push({point:P,pointOnLine:A,distance:ul.origin.distanceTo(P),object:r,face:null,faceIndex:v,uv:null,uv1:null})}}}var _c=class extends en{constructor(t=new _0,e=new Au({color:Math.random()*16777215})){super(t,e),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){let t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.count);for(let a=0,l=0,c=e.count;a<c;a++,l+=2)FY.fromBufferAttribute(e,a),BY.fromBufferAttribute(n,a),i[l]=l===0?0:i[l-1],i[l+1]=i[l]+FY.distanceTo(BY);let o=new If(i,2,1);return t.setAttribute("instanceDistanceStart",new ns(o,1,0)),t.setAttribute("instanceDistanceEnd",new ns(o,1,1)),this}raycast(t,e){let n=this.material.worldUnits,i=t.camera;i===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');let o=t.params.Line2!==void 0&&t.params.Line2.threshold||0;ul=t.ray;let a=this.matrixWorld,l=this.geometry,c=this.material;hp=c.linewidth+o,l.boundingSphere===null&&l.computeBoundingSphere(),P6.copy(l.boundingSphere).applyMatrix4(a);let f;if(n)f=hp*.5;else{let m=Math.max(i.near,P6.distanceToPoint(ul.origin));f=GY(i,m,c.resolution)}if(P6.radius+=f,ul.intersectsSphere(P6)===!1)return;l.boundingBox===null&&l.computeBoundingBox(),R6.copy(l.boundingBox).applyMatrix4(a);let g;if(n)g=hp*.5;else{let m=Math.max(i.near,R6.distanceToPoint(ul.origin));g=GY(i,m,c.resolution)}R6.expandByScalar(g),ul.intersectsBox(R6)!==!1&&(n?Ebt(this,e):Sbt(this,i,e))}};var m_=class extends Se{initGeometry(){return Tt(this,null,function*(){this.geometry=yield v0.GetMergedShapeGeometry(this.options)})}initMaterial(){let t=hn.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],n=hn.createLineMaterial({color:t,opacity:e,vertexColors:!0});return this.lineMaterial=n,n}getBorderPoints(t){let{deltaHeight:e,geometry:n}=t,i=[],o=e||0,{coords:a}=n;for(let l=0;l<a.length;l++){let c=a[l];for(let f=0;f<c.length;f++){let g=c[f],m=f+1===c.length?c[0]:c[f+1];i.push(new G(g[0],g[1],o)),i.push(new G(m[0],m[1],o))}}return i}initDoubleLine(){let t=this.options.filter(e=>{var n,i;return e.double&&((i=e.geometry.otherCoords)==null||(n=i[1])==null?void 0:n.length)});t.length&&[!0,!1].forEach(e=>{let n=t.filter(f=>f.dashed===e);if(!n.length)return;let i=hn.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:e,resolution:new ft(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),o=[],a=[];n.forEach(f=>{let g=f.geometry.otherCoords[1],m=f.airHeight+(f.deltaHeight||0)+.01,v=new ne(f.secondColor);for(let x=0;x<g.length-1;x++){let S=g[x],w=g[x+1];o.push(S[0],S[1],m,w[0],w[1],m),a.push(v.r,v.g,v.b,v.r,v.g,v.b)}});let l=new _0;l.setPositions(o),l.setColors(a);let c=new _c(l,i);c.computeLineDistances(),c.position.z+=.01,this.add(c),this.doubleLines.push(c)})}initLineGeometry(){let t=this.options.map(e=>{let n=this.getBorderPoints(e);return new qe().setFromPoints(n)});this.lineGeometry=Rh(t)}createBorder(){let t=new Yi(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){return Tt(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new en(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02+(this.options[0].deltaHeight||0)})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(n=>n.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],e.length&&this.init()}};var Oee=H(En(),1);var NR=class extends Se{initMergedElement(){let t=new Mu,e=t.parseGeometries([this.mergedElement.mergedGeometry]);if(this.geometry=e[this.mergedElement.mergedGeometry.uuid],this.initMaterial(),this.initMesh(),this.mesh.position.z=(this.mergedElement.deltaHeight||0)+this.mergedElement.airHeight,this.mergedElement.lineGeometry){let n=t.parseGeometries([this.mergedElement.lineGeometry]);this.lineGeometry=n[this.mergedElement.lineGeometry.uuid],this.initLineMaterial(),this.createBorder()}}init(){return Tt(this,null,function*(){this.geometry=yield this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return Tt(this,null,function*(){let t=yield v0.GetMergeGeometry(this.options);return this.dispatchEvent({type:"init-geometry",geometry:t}),t})}initMaterial(){let t=`
|
|
12175
12175
|
varying vec3 vPosition; // \u7528\u4E8E\u4F20\u9012\u9876\u70B9\u7684\u4F4D\u7F6E\u7ED9\u7247\u6BB5\u7740\u8272\u5668
|
|
12176
12176
|
uniform float maxZ; // \u58F0\u660E\u4E00\u4E2Auniform\u53D8\u91CF
|
|
12177
12177
|
uniform vec3 uColor;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Object3D } from "three";
|
|
1
|
+
import { Object3D, Object3DEventMap } from "three";
|
|
2
2
|
import { Context } from "../context/context";
|
|
3
3
|
import { GLTF } from "three/examples/jsm/loaders/GLTFLoader";
|
|
4
4
|
import { PolygonGeometry } from "../types";
|
|
@@ -13,7 +13,12 @@ export interface GlbModelOptions {
|
|
|
13
13
|
center_x: number;
|
|
14
14
|
center_y: number;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type GlbModelEventMap = {
|
|
17
|
+
"load-model-end": {
|
|
18
|
+
object: GLTF;
|
|
19
|
+
};
|
|
20
|
+
} & Object3DEventMap;
|
|
21
|
+
export declare class GlbModel extends Object3D<GlbModelEventMap> {
|
|
17
22
|
context: Context;
|
|
18
23
|
model: GLTF | null;
|
|
19
24
|
options: GlbModelOptions;
|