A description of a polygon composed of arbitrary coplanar positions.
参数名称 | 类型 | 描述信息 | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Object with the following properties:
|
使用示例:
const polygonGeometry = new Cesium.CoplanarPolygonGeometry({
polygonHierarchy: new Cesium.PolygonHierarchy(
Cesium.Cartesian3.fromDegreesArrayHeights([
-90.0, 30.0, 0.0,
-90.0, 30.0, 300000.0,
-80.0, 30.0, 300000.0,
-80.0, 30.0, 0.0
]))
});
成员(属性)
The number of elements used to pack the object into an array.
方法
static Cesium.CoplanarPolygonGeometry.createGeometry(polygonGeometry) → Geometry|undefined
Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
参数名称 | 类型 | 描述信息 |
---|---|---|
polygonGeometry |
CoplanarPolygonGeometry | A description of the polygon. |
返回值:
The computed vertices and indices.
static Cesium.CoplanarPolygonGeometry.fromPositions(options) → CoplanarPolygonGeometry
A description of a coplanar polygon from an array of positions.
参数名称 | 类型 | 描述信息 | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Object with the following properties:
|
返回值:
- PolygonGeometry#createGeometry
使用示例:
// create a polygon from points
const polygon = Cesium.CoplanarPolygonGeometry.fromPositions({
positions : Cesium.Cartesian3.fromDegreesArray([
-72.0, 40.0,
-70.0, 35.0,
-75.0, 30.0,
-70.0, 30.0,
-68.0, 40.0
])
});
const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
参考:
Stores the provided instance into the provided array.
参数名称 | 类型 | 默认值 | 描述信息 |
---|---|---|---|
value |
CoplanarPolygonGeometry | The value to pack. | |
array |
Array.<number> | The array to pack into. | |
startingIndex |
number |
0
|
可选 The index into the array at which to start packing the elements. |
返回值:
The array that was packed into
static Cesium.CoplanarPolygonGeometry.unpack(array, startingIndex, result) → CoplanarPolygonGeometry
Retrieves an instance from a packed array.
参数名称 | 类型 | 默认值 | 描述信息 |
---|---|---|---|
array |
Array.<number> | The packed array. | |
startingIndex |
number |
0
|
可选 The starting index of the element to be unpacked. |
result |
CoplanarPolygonGeometry | 可选 The object into which to store the result. |
返回值:
The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.