Skip to content

KBE3D / KBCore / Cesium / PolylineVolumeGeometry

类: PolylineVolumeGeometry

A description of a polyline with a volume (a 2D shape extruded along a polyline).

示例

ts
function computeCircle(radius) {
  const positions = [];
  for (let i = 0; i < 360; i++) {
    const radians = Cesium.Math.toRadians(i);
    positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
  }
  return positions;
}

const volume = new Cesium.PolylineVolumeGeometry({
  vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  polylinePositions : Cesium.Cartesian3.fromDegreesArray([
    -72.0, 40.0,
    -70.0, 35.0
  ]),
  shapePositions : computeCircle(100000.0)
});

参数

Object with the following properties:

参数

An array of Cartesian3 positions that define the center of the polyline volume.

参数

An array of Cartesian2 positions that define the shape to be extruded along the polyline

参数

The ellipsoid to be used as a reference.

参数

The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.

参数

The vertex attributes to be computed.

参数

Determines the style of the corners.

属性

packedLength

packedLength: number

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

方法

pack()

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

Stores the provided instance into the provided array.

参数

value

PolylineVolumeGeometry

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?: PolylineVolumeGeometry): PolylineVolumeGeometry

Retrieves an instance from a packed array.

参数

array

number[]

The packed array.

startingIndex?

number

The starting index of the element to be unpacked.

result?

PolylineVolumeGeometry

The object into which to store the result.

返回

PolylineVolumeGeometry

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


createGeometry()

static createGeometry(polylineVolumeGeometry: PolylineVolumeGeometry): Geometry | undefined

Computes the geometric representation of a polyline with a volume, including its vertices, indices, and a bounding sphere.

参数

polylineVolumeGeometry

PolylineVolumeGeometry

A description of the polyline volume.

返回

Geometry | undefined

The computed vertices and indices.

构造函数

构造函数

new PolylineVolumeGeometry(options: { polylinePositions: Cartesian3[]; shapePositions: Cartesian2[]; ellipsoid?: Ellipsoid; granularity?: number; vertexFormat?: VertexFormat; cornerType?: CornerType; }): PolylineVolumeGeometry

参数

options
polylinePositions

Cartesian3[]

shapePositions

Cartesian2[]

ellipsoid?

Ellipsoid

granularity?

number

vertexFormat?

VertexFormat

cornerType?

CornerType

返回

PolylineVolumeGeometry

KBE3D @3.0.0 Copyright © 2024-present KBE3D