管道基础大数据平台系统开发-【前端】-新系統界面
584911253@qq.com
2023-03-13 54c628248c5e0470f040f89f6eec3d5d451826cd
模型裁剪清除
已修改1个文件
16 ■■■■ 文件已修改
src/views/Synthesis/LeftMenu.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Synthesis/LeftMenu.vue
@@ -667,7 +667,8 @@
        value: '其他模型',
        label: '其他模型'
      }],
      targetY: 0.0,
      modelClip:false,
      clippingPlanes:null,
    };
  },
  methods: {
@@ -1519,9 +1520,12 @@
          //   window.MXModel=null;
          // } else {
          var that = this;
          that.modelClip = !that.modelClip;
          if (that.modelClip){
          if (window.model){
            that.modelClipping();
          }else {
            }
            else {
            var tileset = Viewer.scene.primitives.add(
                new Cesium.Cesium3DTileset({
                  name: res.cnName,
@@ -1539,6 +1543,10 @@
              that.modelClipping();
            });
            window.model = tileset
            }
          }
          else {
            Viewer.entities.removeAll();
          }
          // window.model = sgworld.Creator.create3DTilesets(
          //   "",
@@ -1722,9 +1730,10 @@
        planes: [ // ClippingPlane对象数组集合
          new Cesium.ClippingPlane( // 裁切面
              new Cesium.Cartesian3(0.0, 0.0, -1.0), // 法线方向
              0.0 // 原点到平面的最短距离,设置0就好
              0// 原点到平面的最短距离,设置0就好
          ),
        ],
        enabled:true,
        edgeWidth: 1.0, // 模型被裁切部分的截面线宽
      });
      let boundingSphere = window.model.boundingSphere;
@@ -1750,6 +1759,7 @@
        });
        planeEntities.push(planeEntity);
      }
      this.clippingPlanes = clippingPlanes;
      window.model.clippingPlanes = clippingPlanes;
      // Select plane when mouse down