Skip to content

KBE3D / KBCore / Cesium / PolylineVolumeOutlineGeometry

类: PolylineVolumeOutlineGeometry

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 volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({
  polylinePositions : Cesium.Cartesian3.fromDegreesArray([
    -72.0, 40.0,
    -70.0, 35.0
  ]),
  shapePositions : computeCircle(100000.0)
});

参数

Object with the following properties:

参数

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

参数

An array of 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.

参数

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: PolylineVolumeOutlineGeometry, array: number[], startingIndex?: number): number[]

Stores the provided instance into the provided array.

参数

value

PolylineVolumeOutlineGeometry

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

Retrieves an instance from a packed array.

参数

array

number[]

The packed array.

startingIndex?

number

The starting index of the element to be unpacked.

result?

PolylineVolumeOutlineGeometry

The object into which to store the result.

返回

PolylineVolumeOutlineGeometry

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


createGeometry()

static createGeometry(polylineVolumeOutlineGeometry: PolylineVolumeOutlineGeometry): Geometry | undefined

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

参数

polylineVolumeOutlineGeometry

PolylineVolumeOutlineGeometry

A description of the polyline volume outline.

返回

Geometry | undefined

The computed vertices and indices.

构造函数

构造函数

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

参数

options
polylinePositions

Cartesian3[]

shapePositions

Cartesian2[]

ellipsoid?

Ellipsoid

granularity?

number

cornerType?

CornerType

返回

PolylineVolumeOutlineGeometry

KBE3D @3.0.0 Copyright © 2024-present KBE3D