Skip to content

KBE3D / KBCore / Cesium / CoplanarPolygonGeometry

类: CoplanarPolygonGeometry

A description of a polygon composed of arbitrary coplanar positions.

示例

ts
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
  ]))
});

参数

Object with the following properties:

参数

A polygon hierarchy that can include holes.

参数

The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.

参数

The vertex attributes to be computed.

参数

The ellipsoid to be used as a reference.

参数

Texture coordinates as a PolygonHierarchy of Cartesian2 points.

属性

packedLength

packedLength: number

The number of elements used to pack the object into an array.

方法

fromPositions()

static fromPositions(options: { positions: Cartesian3[]; vertexFormat?: VertexFormat; stRotation?: number; ellipsoid?: Ellipsoid; textureCoordinates?: PolygonHierarchy; }): CoplanarPolygonGeometry

A description of a coplanar polygon from an array of positions.

参数

options

Object with the following properties:

positions

Cartesian3[]

An array of positions that defined the corner points of the polygon.

vertexFormat?

VertexFormat

The vertex attributes to be computed.

stRotation?

number

The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.

ellipsoid?

Ellipsoid

The ellipsoid to be used as a reference.

textureCoordinates?

PolygonHierarchy

Texture coordinates as a PolygonHierarchy of Cartesian2 points.

返回

CoplanarPolygonGeometry

示例

ts
// 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);

pack()

static pack(value: CoplanarPolygonGeometry, array: number[], startingIndex?: number): number[]

Stores the provided instance into the provided array.

参数

value

CoplanarPolygonGeometry

The value to pack.

array

number[]

The array to pack into.

startingIndex?

number

The index into the array at which to start packing the elements.

返回

number[]

The array that was packed into


unpack()

static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonGeometry): CoplanarPolygonGeometry

Retrieves an instance from a packed array.

参数

array

number[]

The packed array.

startingIndex?

number

The starting index of the element to be unpacked.

result?

CoplanarPolygonGeometry

The object into which to store the result.

返回

CoplanarPolygonGeometry

The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.


createGeometry()

static createGeometry(polygonGeometry: CoplanarPolygonGeometry): 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.

返回

Geometry | undefined

The computed vertices and indices.

构造函数

构造函数

new CoplanarPolygonGeometry(options: { polygonHierarchy: PolygonHierarchy; stRotation?: number; vertexFormat?: VertexFormat; ellipsoid?: Ellipsoid; textureCoordinates?: PolygonHierarchy; }): CoplanarPolygonGeometry

参数

options
polygonHierarchy

PolygonHierarchy

stRotation?

number

vertexFormat?

VertexFormat

ellipsoid?

Ellipsoid

textureCoordinates?

PolygonHierarchy

返回

CoplanarPolygonGeometry

KBE3D @3.0.0 Copyright © 2024-present KBE3D