xzw 8 meses atrás
pai
commit
5cc3a27d29

+ 15 - 4
public/lib/potree/potree.js

@@ -42180,7 +42180,6 @@
 	var arrowCountMax = 100; //箭头总数不能超过这个值。 The count value passed into the constructor represents the maximum number of instances of this mesh. You can change the number of instances at runtime to an integer value in the range [0, count].If you need more instances than the original count value, you have to create a new InstancedMesh.
 	var lastArrowCamPos,
 	  lastArrowCount = 0;
-	var pathOpacity = 0.5;
 	var depthProps = {
 	  useDepth: true,
 	  //startClipDis  : 0.5,
@@ -42372,7 +42371,7 @@
 	      //和measure不同的是它的边是连在一起的一整条
 	      this.edge = new Mesh(voidGeometry, new DepthBasicMaterial($.extend({}, depthProps, {
 	        color: this.pathColor || '#fff',
-	        opacity: pathOpacity,
+	        opacity: 0.4,
 	        side: 2,
 	        transparent: true,
 	        fadeFar: this.fadeFar
@@ -42563,9 +42562,11 @@
 	    this.hideArrowUntilUpdate();
 	  }
 	  setPathColor(color) {
+	    var _this$arrows;
 	    if (this.pathColor == color) return;
 	    this.pathColor = color;
 	    this.edge.material.color.set(color);
+	    (_this$arrows = this.arrows) === null || _this$arrows === void 0 || _this$arrows.material.color.set(color);
 	    this.endCaps[0].children[0].material.color.set(color);
 	    viewer.dispatchEvent('content_changed');
 	  }
@@ -42578,6 +42579,7 @@
 	    var geo;
 	    var points = this.getDifferentPoint(this.points);
 	    var len = points.length;
+	    this.edge.geometry.dispose();
 	    if (len <= 1) {
 	      geo = voidGeometry;
 	    } else {
@@ -42959,20 +42961,29 @@
 	    viewer.dispatchEvent('content_changed');
 	  }
 	  dispose() {
+	    var _this$arrows2, _this$arrows3;
 	    super.dispose();
 	    this.titleLabel.dispose();
 	    this.markerLabels.forEach(e => e.dispose());
+	    (_this$arrows2 = this.arrows) === null || _this$arrows2 === void 0 || _this$arrows2.dispose();
+	    (_this$arrows3 = this.arrows) === null || _this$arrows3 === void 0 || _this$arrows3.material.dispose();
+	    this.edge.geometry.dispose();
+	    this.edge.material.dispose();
 	  }
 	  setArrowDisplay(show) {
 	    if (show) {
 	      if (!this.arrows) {
 	        var map = texLoader$7.load(Potree.resourcePath + '/textures/arrow.png');
-	        map.anisotropy = 2;
+	        //map.anisotropy = 2
+	        map.generateMipmaps = false;
+	        map.minFilter = LinearFilter; //防止边缘黑边
+
 	        var material = new DepthBasicMaterial(Object.assign({}, depthProps, {
 	          map,
 	          transparent: true,
 	          side: 2,
-	          fadeFar: this.fadeFar
+	          fadeFar: this.fadeFar,
+	          color: this.pathColor || '#fff'
 	        }));
 	        //let material = new THREE.MeshBasicMaterial({map )})
 	        this.arrows = new InstancedMesh(planeGeo$2, material, arrowCountMax); //会自动向shader添加define和instanceMatrix

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
public/lib/potree/potree.js.map


+ 2 - 2
src/sdk/cover/index.js

@@ -1329,9 +1329,9 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                 info.dataset_points = props.points.map(e=>e.position)
                 path = viewer.measuringTool.createMeasureFromData(info);
                 
-                path.points_dataset.forEach((id,i)=>{
+                path.points_datasets.forEach((id,i)=>{
                     if(id == void 0){ //当该点不在任何模型上时,dataset_point记录的其实是point,现在还原
-                        path.points[i] = info.dataset_points[i] 
+                        path.points[i] = new THREE.Vector3().copy(info.dataset_points[i])
                         path.dataset_points[i] = null 
                     }
                 })