xzw 7 miesięcy temu
rodzic
commit
d4db09d84d

+ 2 - 1
src/custom/modules/panos/Images360.js

@@ -1475,7 +1475,8 @@ export class Images360 extends THREE.EventDispatcher{
     isNeighbour(pano0, pano1, {dontCompute, onlyUseTex,  computeDirFirst, computeTwoDir}={}){//是否之间没有遮挡(在加载visibles之前,自己算) 最好pano0是currentPano
          
         if(!pano0 || !pano1 )return
-        if(!viewer.scene.pointclouds.some(e=>e.hasDepthTex) || Potree.settings.editType == 'pano')return true //点云编辑页设置exist true但不恢复的话,得不到depthTex。 则Neighbours很难算。所以现在先全部可走。
+        if(!Potree.settings.editType && !viewer.scene.pointclouds.some(e=>e.hasDepthTex) || Potree.settings.editType == 'pano')return true //点云编辑页设置exist true但不恢复的话,得不到depthTex。 则Neighbours很难算。所以现在先全部可走。
+        if(Potree.settings.editType == 'merge' && pano0.pointcloud != pano1.pointcloud)return true
         let margin = 0.1;
         
         let map0 = this.neighbourMap[pano0.id]; //主

+ 12 - 4
src/custom/objects/tool/Path.js

@@ -541,9 +541,15 @@ export class Path extends ctrlPolygon{
             
     }
     
+    reDraw(){
+        this.pauseUpdateEdge = true
+        super.reDraw()
+        this.pauseUpdateEdge = false
+        this.updateEdge()
+    } 
     
     updateEdge(){ 
-        if(this.lastUpdatePoints_ && Potree.Common.ifSame(this.lastUpdatePoints_,this.points) && this.halfPathWidth == this.lastHalfPathWidth) return //没变 不更新
+        if(this.pauseUpdateEdge || this.lastUpdatePoints_ && Potree.Common.ifSame(this.lastUpdatePoints_,this.points) && this.halfPathWidth == this.lastHalfPathWidth) return //没变 不更新
         //this.edge.geometry = MeshDraw.getExtrudeGeo(edgeExtrudePoints, null,  {extrudePath: this.points, openEnded:true, shapeDontClose:true/* , dontSmooth:true, steps: this.points.length-1 */})
         //getExtrudeGeo是平滑过的曲线,和设计不一样,且容易翻转,转角有时候细分过少
         
@@ -622,7 +628,8 @@ export class Path extends ctrlPolygon{
                 let sideVec     //该点两边对应的向量
                 let uvX  
                 if(i==0 || i==count-1){ 
-                    sideVec = new THREE.Vector3().copy(math.getNormal2d({p1: i==0 ? B : O, p2: i==0 ? O : A})).setZ(0).multiplyScalar(this.halfPathWidth)  //垂线
+                    let nor = math.getNormal2d({p1: i==0 ? B : O, p2: i==0 ? O : A}) || new THREE.Vector3(1,0,0)
+                    sideVec = new THREE.Vector3().copy(nor).setZ(0).multiplyScalar(this.halfPathWidth)  //垂线
                     uvX = i==0 ? 0 : 1 //percent of length 
                 }else{ 
                     let OA = new THREE.Vector3().subVectors(A,O).setZ(0).normalize()    //只保证俯视角度正确。(如果两点有高度差,该段四个点不会在同一平面,看起来有扭转,有的地方会肥大,但从俯视角度看是正确的。)
@@ -630,7 +637,8 @@ export class Path extends ctrlPolygon{
                     let angle = math.getAngle(OA, OB, 'z') 
                   
                     if(math.closeTo(angle,0,1e-4) || math.closeTo(angle,Math.PI,1e-4) || math.closeTo(angle, -Math.PI,1e-4)){ //这时候直接加两个向量算出的平分线不准,故直接找垂线
-                        sideVec = new THREE.Vector3().copy(math.getNormal2d({p1: O, p2: A})).setZ(0).multiplyScalar(this.halfPathWidth)  //垂线
+                        let nor = math.getNormal2d({p1: O, p2: A}) || new THREE.Vector3(1,0,0)
+                        sideVec = new THREE.Vector3().copy(nor).setZ(0).multiplyScalar(this.halfPathWidth)  //垂线
                         //console.log('接近0或180',angle, sideVec)
                     }else{
                         let midVecLength = this.halfPathWidth / Math.sin(angle/2)   
@@ -1264,7 +1272,7 @@ export class Path extends ctrlPolygon{
 
 Path.prototype.cloneMarker = Measure.prototype.cloneMarker
 Path.prototype.updateDatasetBelong = Measure.prototype.updateDatasetBelong 
-Path.prototype.reDraw = Measure.prototype.reDraw
+//Path.prototype.reDraw = Measure.prototype.reDraw
 /* 
 没有intersect的点的dataset_point怎么赋值
 

+ 1 - 1
src/custom/start.js

@@ -1034,7 +1034,7 @@ export function mergeEditStart(dom, mapDom){
                 if(!model.isPointcloud){ //有经纬度    3dtiles
                     prop.baseRotation && model.rotation.copy(prop.baseRotation) //有的需要翻转90度 
                     
-                    if(prop.raw?.convertType){//带坐标的osgb,原本给cesium用的,把在球面的转为平面的坐标
+                    if(prop.raw?.convertType && model.fileType == '3dtiles' && (prop.raw?.wgs84 || prop.raw?.gcj02)){//新的软件转出的带坐标的osgb,原本给cesium用的,把在球面的转为平面的坐标
                          
                         let center = new THREE.Vector3().fromArray(model.runtime.getTileset().tileset.root.transform.slice(12,15))
                          

+ 30 - 3
src/custom/viewer/ViewerNew.js

@@ -91,7 +91,7 @@ import RenderPass from '../materials/postprocessing/RenderPass.js'
 import FXAAShader from "../materials/postprocessing/FXAAShader.js"
 import OutlinePass from "../materials/postprocessing/OutlinePass.js"
 import BasicMaterial from '../materials/BasicMaterial.js'  
-     
+import DepthBasicMaterial from '../materials/DepthBasicMaterial.js'  
         
         
 //import {RoomEnvironment} from './RoomEnvironment.js'
@@ -581,7 +581,7 @@ export class Viewer extends ViewerBase{
                         }, 1000);  
                     })
                     
-                    this.map3d.sceneGroup.position.z = -20
+                    this.map3d.sceneGroup.position.z = -0.1
                     this.addEventListener('setLonlat',(e)=>{
                         this.map3d.disabled = false
                         Potree.settings.cameraFar = 80000000 
@@ -6631,7 +6631,10 @@ export class Viewer extends ViewerBase{
                         circlePts.push(new THREE.Vector2(radius * Math.cos(angle),   radius * Math.sin(angle) ))
                     }
                     
-                    var mat = new THREE.MeshStandardMaterial({color,   /* wireframe:true,   depthTest:false,*/  roughness:0.9,metalness:0.3}) 
+                    //var mat = new THREE.MeshStandardMaterial({color,   /* wireframe:true,   depthTest:false,*/  roughness:0.9,metalness:0.3}) 
+                    var mat = new DepthBasicMaterial( {color , useDepth:false })
+                    
+                    
                     let linePath = path.map(e=>{
                         e instanceof Array && (e = new THREE.Vector3().fromArray(e))
                         let pos 
@@ -6665,6 +6668,30 @@ export class Viewer extends ViewerBase{
                         })
                     }
                     
+                    
+                    
+                    {
+                        mat.defines.mapOverlay = true
+                        let map = new THREE.TextureLoader().load( Potree.resourcePath+'/textures/rectangle.png',()=>{
+                            viewer.dispatchEvent('content_changed')
+                        }) 
+                        mat.uniforms.mapColor.value.set('#f00')
+                        map.anisotropy = 2
+                        map.wrapS = THREE.RepeatWrapping 
+                        map.wrapT = THREE.RepeatWrapping
+                        /* map.repeat.set(10,1.3)  
+                        map.offset.set(0,-0.15) */
+                        mat.map = map  
+                         
+                        //mat.map.repeat.x = Math.round(this.totalLength / this.halfPathWidth * 0.5) * (this.reverse ? -1 : 1)
+                        mat.map.needsUpdate = true
+                        mat.setUV()
+                        
+                    }
+                    
+                    
+                    
+                    
                 }