三维场景裁剪工具集
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
viewer |
Viewer | 三维视图对象 | ||||||
layers |
Array.<MapGISM3DSet> | |||||||
options |
Object |
optional
可选参数
|
Members
是否支持开挖地形 打开后通过
CuttingTool#createModelCuttingVolume
和 CuttingTool#createModelCuttingPlaneFromPolyline
创建的裁剪体会同时对地形做裁剪。
CuttingTool#createModelCuttingPlaneFromPolyline
添加地形支持时由于缺少高度所以不会开启剖切面封边
-
Default Value:
false
Methods
通过包围面,创建裁剪体
Name | Type | Description |
---|---|---|
normals |
Array.<Cartesian3> | 面法线数组 |
originalPoints |
Array.<Cartesian3> | 面中心点数组 |
layer |
MapGISM3DSet | 要裁剪的M3D |
options |
Object | 可选参数 |
修改辅助剖切面颜色
Name | Type | Default | Description |
---|---|---|---|
color |
Color |
Color.WHITE.withAlpha(0.5)
|
optional 辅助面颜色 |
创建模型裁剪面
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
normal |
Cartesian3 | 裁剪面的法线 | ||||||||||||||||||||||||||||
options |
Object |
optional
可选参数
|
通过直线,绘制模型裁剪面
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pointA |
Cartesian3 | 直线起始点 A,必须为角度制的经纬度值 | ||||||||||||||||||||||||
pointB |
Cartesian3 | 直线终止点 B,必须为角度制的经纬度值 | ||||||||||||||||||||||||
options |
Object |
optional
可选参数
|
通过折线,绘制模型裁剪面,请提两个以上的点,否则不执行剖切分析。
Name | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
positions |
Array.<Cartesian3> | 折线的点坐标 | ||||||||
options |
Object |
optional
可选参数
|
多边形几何裁剪
通过边界区域,以及高程,构建裁剪几何体。支持凹多边形裁剪,但对封边效果支持不好
通过边界区域,以及高程,构建裁剪几何体。支持凹多边形裁剪,但对封边效果支持不好
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
positions |
Array | 区域边界点数组,点需要按照顺时针方向选取。要求是经纬度坐标 | ||||||||||||||||
minHeight |
Number | 最小高程 | ||||||||||||||||
maxHeight |
Number | 最大高程 | ||||||||||||||||
options |
Object |
可选参数
|
Example:
var cutTool = new Cesium.CuttingTool(viewer, layerList);
var positions = [
113.0406, 30.0378,
113.0595, 30.0378,
113.0595, 30.0297,
113.0762, 30.0297,
113.0762, 30.0179,
113.0595, 30.0179,
113.0595, 30.0099,
113.0406, 30.0099
];
cutTool.createModelCuttingPolygon(positions, -1000, 500, {
//裁剪方向,false:原方向,true反方向
unionClippingRegions: false,
//配置裁剪体的颜色,以及透明度
color: new Cesium.Color(1, 1, 1, 0.2),
//是否显示裁剪体
showCuttingPlane: true
})
通过边界区域,以及最小最大高程,构建裁剪体
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
positions |
Array.<Cartesian3> | 区域边界点数组,点需要按照顺时针方向选取 | ||||||||||||||||||||||||
minHeight |
Number | 最小高程 | ||||||||||||||||||||||||
maxHeight |
Number | 最大高程 | ||||||||||||||||||||||||
options |
Object |
可选参数
|
开关当前被CuttingTool管理的裁剪体
Name | Type | Description |
---|---|---|
value |
Boolean |
移除所有裁剪面
Example:
var cutTool = new Cesium.CuttingTool(viewer, layerList);
cutTool.removeAll();
显示或隐藏所有辅助剖切面(体)
Name | Type | Default | Description |
---|---|---|---|
showPlane |
Boolean |
true
|
optional 显示或隐藏所有辅助剖切面(体),true为显示所有辅助剖切面(体),false为隐藏所有辅助剖切面(体) |