# Clip

创建剖切

let screenSpaceHandler = new Cesium.ScreenSpaceEventHandler(
  viewer.scene.canvas
);
screenSpaceHandler.setInputAction((movement) => {
  // console.log(movement)
  let pickRes = pick(movement.position);
  if (!(pickRes.position instanceof Cesium.Cartesian3)) return;
  let size =
    Cesium.Cartesian3.distance(pickRes.position, viewer.camera.position) / 3;
  let options = {
    size: new Cesium.Cartesian2(size, size * 2),
  };
  let tranformHelper = new GeowayGlobe.T_Z_R_XYZ_S_XY_TranformHelper({
    viewer,
    position: pickRes.position,
    options,
  });
  this.clip = new GeowayGlobe.Clip({
    viewer,
    helper: tranformHelper,
    models: [tileset],
  });
  screenSpaceHandler.destroy();
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

# Clip options 构造属性

属性 说明 类型 默认值
viewer 地球实例 Object viewer
models 剖切的模型 Array Null
helper 辅助控件 Array Null