xzw 2 роки тому
батько
коміт
6801221898

+ 81 - 36
public/static/lib/potree/potree.js

@@ -70509,9 +70509,9 @@ void main()
 
 		},
 	    
-		moveLine: function (line, posArr) {
+		moveLine: function (line, posArr ) {
 	        if(posArr.length == 0)return
-	        posArr = dealPosArr(posArr);
+	        if(!line.uncontinuous)posArr = dealPosArr(posArr);
 	        let position = [];
 	        posArr.forEach(e=>position.push(e.x,e.y,e.z));
 	        line.geometry.setAttribute('position', new Float32BufferAttribute(/* new Float32Array( */position/* ) */, 3));
@@ -70568,7 +70568,9 @@ void main()
 			var matLine = o.material || this.createFatLineMat(o);
 			var line = new Line2( geometry, matLine );
 			//line.computeLineDistances();
-	         
+	        line.uncontinuous = o.uncontinuous; //线不连续,由线段组成
+	        
+	        
 			line.scale.set( 1, 1, 1 );
 			line.renderOrder = 2;
 	        
@@ -70583,7 +70585,7 @@ void main()
 		moveFatLine: function(line, posArr){
 			var geometry = line.geometry;
 	        var positions = [];
-	        posArr = dealPosArr(posArr);
+	        line.uncontinuous || (posArr = dealPosArr(posArr));
 	        posArr.forEach(e=>{positions.push(...e.toArray());});
 	         
 			 
@@ -85592,6 +85594,7 @@ void main()
 	    2: 0xffffff,//0x00ff80, //可见
 	    3: 0xffc23b,//0xff3158, //不可见
 	    4: 0xffffff, //
+	    highlight: 0x0000ff,
 	};
 
 	class Volume$1 extends Object3D {
@@ -85715,34 +85718,60 @@ void main()
 
 				boxFrameGeometry.vertices.push(
 
-					// bottom
-					new Vector3$1(-0.5, -0.5, 0.5),
-					new Vector3$1(0.5, -0.5, 0.5),
-					new Vector3$1(0.5, -0.5, 0.5),
-					new Vector3$1(0.5, -0.5, -0.5),
+					/* // bottom
+					new Vector3(-0.5, -0.5, 0.5),
+					new Vector3(0.5, -0.5, 0.5),
+					new Vector3(0.5, -0.5, 0.5),
+					new Vector3(0.5, -0.5, -0.5),
+					new Vector3(0.5, -0.5, -0.5),
+					new Vector3(-0.5, -0.5, -0.5),
+					new Vector3(-0.5, -0.5, -0.5),
+					new Vector3(-0.5, -0.5, 0.5),
+					// top
+					new Vector3(-0.5, 0.5, 0.5),
+					new Vector3(0.5, 0.5, 0.5),
+					new Vector3(0.5, 0.5, 0.5),
+					new Vector3(0.5, 0.5, -0.5),
+					new Vector3(0.5, 0.5, -0.5),
+					new Vector3(-0.5, 0.5, -0.5),
+					new Vector3(-0.5, 0.5, -0.5),
+					new Vector3(-0.5, 0.5, 0.5),
+					// sides
+					new Vector3(-0.5, -0.5, 0.5),
+					new Vector3(-0.5, 0.5, 0.5),
+					new Vector3(0.5, -0.5, 0.5),
+					new Vector3(0.5, 0.5, 0.5),
+					new Vector3(0.5, -0.5, -0.5),
+					new Vector3(0.5, 0.5, -0.5),
+					new Vector3(-0.5, -0.5, -0.5),
+					new Vector3(-0.5, 0.5, -0.5), */
+	                // bottom
+					new Vector3$1(-0.5, 0.5,-0.5,),
+					new Vector3$1(0.5, 0.5, -0.5),
+					new Vector3$1(0.5, 0.5,-0.5),
+					new Vector3$1(0.5, -0.5,-0.5),
 					new Vector3$1(0.5, -0.5, -0.5),
 					new Vector3$1(-0.5, -0.5, -0.5),
-					new Vector3$1(-0.5, -0.5, -0.5),
-					new Vector3$1(-0.5, -0.5, 0.5),
+					new Vector3$1(-0.5, -0.5,-0.5),
+					new Vector3$1(-0.5, 0.5,-0.5),
 					// top
 					new Vector3$1(-0.5, 0.5, 0.5),
 					new Vector3$1(0.5, 0.5, 0.5),
 					new Vector3$1(0.5, 0.5, 0.5),
-					new Vector3$1(0.5, 0.5, -0.5),
-					new Vector3$1(0.5, 0.5, -0.5),
-					new Vector3$1(-0.5, 0.5, -0.5),
-					new Vector3$1(-0.5, 0.5, -0.5),
+					new Vector3$1(0.5, -0.5, 0.5),
+					new Vector3$1(0.5, -0.5, 0.5),
+					new Vector3$1(-0.5, -0.5, 0.5),
+					new Vector3$1(-0.5, -0.5, 0.5),
 					new Vector3$1(-0.5, 0.5, 0.5),
 					// sides
-					new Vector3$1(-0.5, -0.5, 0.5),
+					new Vector3$1(-0.5, 0.5, -0.5),
 					new Vector3$1(-0.5, 0.5, 0.5),
-					new Vector3$1(0.5, -0.5, 0.5),
+					new Vector3$1(0.5, 0.5, -0.5),
 					new Vector3$1(0.5, 0.5, 0.5),
 					new Vector3$1(0.5, -0.5, -0.5),
-					new Vector3$1(0.5, 0.5, -0.5),
+					new Vector3$1(0.5, -0.5, 0.5),
 					new Vector3$1(-0.5, -0.5, -0.5),
-					new Vector3$1(-0.5, 0.5, -0.5),
-
+					new Vector3$1(-0.5, -0.5, 0.5),
 				);
 
 			}
@@ -85770,11 +85799,24 @@ void main()
 			//this.frame = new THREE.LineSegments(boxFrameGeometry, new THREE.LineBasicMaterial({color: colors[this.clipTask], opacity:LineOpacity.default/* 0xff2050 */}));
 			this.frame = LineDraw.createFatLine(
 	                boxFrameGeometry.vertices,  
-	                {dashed:true, dashSize:0.1, gapSize:0.1, opacity: 0.5, color: colors[this.clipTask], opacity:LineOpacity.default, lineWidth:2,  dontAlwaysSeen:true}   );
-	                      
+	                {dashed:true, dashSize:0.02, gapSize:0.02, opacity: 0.5,  lineWidth:2, color: colors[this.clipTask],  dontAlwaysSeen:true}   );
+	         
+	        this.frameHorizon =  
+	            LineDraw.createFatLine(
+	                boxFrameGeometry.vertices.slice(0,16),  
+	                { opacity: 1,  lineWidth:2, color: colors['highlight'],   dontAlwaysSeen:true}   );
+	        this.frameVertical = LineDraw.createFatLine(
+	            boxFrameGeometry.vertices.slice(16,24),  
+	            { opacity: 1,  lineWidth:2, color: colors['highlight'],   uncontinuous:true, dontAlwaysSeen:true}   );
+	        this.frameHorizon.visible = false;
+	        this.frameVertical.visible = false; 
+	        this.add(this.frameHorizon); 
+	        this.add(this.frameVertical); 
+
+
+	        this.boxFrameGeometry = boxFrameGeometry;
 	        // this.frame.mode = THREE.Lines;
-			this.add(this.frame);
-	        this.frame.computeLineDistances();
+			this.add(this.frame); 
 			this.update();  
 		}
 
@@ -85794,7 +85836,7 @@ void main()
 	        this.box.material.color.set(colors[this.clipTask]);
 	        this.frame.material.color.set(colors[this.clipTask]);
 	        this.frame.material.opacity = this.selected ? LineOpacity.selected : LineOpacity.default;
-	        this.frame.material.lineWidth = this.selected ? 2 : 1;
+	       
 		}
 
 		raycast (raycaster, intersects) {
@@ -103368,18 +103410,26 @@ ENDSEC
 	    },
 
 
+
+	    updateBoxLine(){
+	        
+	    },
+
 	    setBoxPose(){
+	        const min = 0.01;//0的话相当于没有box所以不能为0
 	        //box底部不变,永远在bound的底部。但top会根据height改变
 	        let boxData = this.getBoxData();
 	        let bound = viewer.bound.boundingBox.clone();
-	        let scale = viewer.bound.boundSize.clone().setZ(boxData.height);
+	        let scale = viewer.bound.boundSize.clone().setZ(Math.max(min,boxData.height)); 
 	        let pos = viewer.bound.center.clone().setZ(bound.min.z + boxData.height/2);
 	        let rotation = new Euler(0,0,boxData.rotAngle);
-	        scale.setX(scale.x*boxData.scaleXY).setY(scale.y*boxData.scaleXY);
+	        scale.setX(Math.max(min,scale.x*boxData.scaleXY)).setY(Math.max(min,scale.y*boxData.scaleXY));
 	        
 	        this.box.position.copy(pos);
 	        this.box.rotation.copy(rotation);
 	        this.box.scale.copy(scale);
+	        
+	        this.updateBoxLine();
 	    },
 
 	    //暂定为在手动设置旋转之前 , 如果有基准线,使用基准线的旋转角。 
@@ -103483,21 +103533,16 @@ ENDSEC
 	    
 
 	    
-	     
+	    //这三个调试用
 	    setRot(rotAngle){
 	        this.boxData.rotAngle = rotAngle;
 	        this.box.rotation.set(0,0, this.boxData.rotAngle); 
-	    },
-	    
+	    }, 
 	    setScale(s){
 	        this.boxData.scaleXY = s;
 	        this.box.scale.x = viewer.bound.boundSize.x * s;
-	        this.box.scale.y = viewer.bound.boundSize.y * s;
-	        
-	        
-	        
-	    },
-	    
+	        this.box.scale.y = viewer.bound.boundSize.y * s; 
+	    }, 
 	    setHeight(v){
 	        this.boxData.height = v; 
 	        this.box.scale.z = v; 

Різницю між файлами не показано, бо вона завелика
+ 1 - 1
public/static/lib/potree/potree.js.map


+ 24 - 3
src/sdk/laser/core/enter.js

@@ -857,11 +857,32 @@ var enter = ({
 
 
             enterCropSetting(){
-                viewer.modules.Clip.enter()
+                let Clip = viewer.modules.Clip
+                Clip.enter()
                 return { 
                     quit(){
-                        viewer.modules.Clip.leave()
-                    }
+                        Clip.leave()
+                    },
+                    enterSetScale(){
+                        Clip.box.frameHorizon.visible = true
+                    },
+                    leaveSetScale(){
+                        Clip.box.frameHorizon.visible = false
+                    },
+                    enterSetTop(){
+                        Clip.box.frameVertical.visible = true
+                    },
+                    leaveSetTop(){
+                        Clip.box.frameVertical.visible = false
+                    },
+                    enterSetRotate(){
+                        Clip.box.frameHorizon.visible = true
+                        Clip.box.frameVertical.visible = true
+                    },
+                    leaveSetRotate(){
+                        Clip.box.frameHorizon.visible = false
+                        Clip.box.frameVertical.visible = false
+                    },
                 }
             },