Skip to content

KBE3D / KBCore / Cesium / SimplePolylineGeometry

类: SimplePolylineGeometry

A description of a polyline modeled as a line strip; the first two positions define a line segment, and each additional position defines a line segment from the previous position.

示例

ts
// A polyline with two connected line segments
const polyline = new Cesium.SimplePolylineGeometry({
  positions : Cesium.Cartesian3.fromDegreesArray([
    0.0, 0.0,
    5.0, 0.0,
    5.0, 5.0
  ])
});
const geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline);

参数

Object with the following properties:

参数

An array of Cartesian3 defining the positions in the polyline as a line strip.

参数

An Array of Color defining the per vertex or per segment colors.

参数

A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.

参数

The type of line the polyline segments must follow.

参数

The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.

参数

The ellipsoid to be used as a reference.

属性

packedLength

packedLength: number

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

方法

pack()

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

Stores the provided instance into the provided array.

参数

value

SimplePolylineGeometry

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

Retrieves an instance from a packed array.

参数

array

number[]

The packed array.

startingIndex?

number

The starting index of the element to be unpacked.

result?

SimplePolylineGeometry

The object into which to store the result.

返回

SimplePolylineGeometry

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


createGeometry()

static createGeometry(simplePolylineGeometry: SimplePolylineGeometry): Geometry | undefined

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

参数

simplePolylineGeometry

SimplePolylineGeometry

A description of the polyline.

返回

Geometry | undefined

The computed vertices and indices.

构造函数

构造函数

new SimplePolylineGeometry(options: { positions: Cartesian3[]; colors?: Color[]; colorsPerVertex?: boolean; arcType?: ArcType; granularity?: number; ellipsoid?: Ellipsoid; }): SimplePolylineGeometry

参数

options
positions

Cartesian3[]

colors?

Color[]

colorsPerVertex?

boolean

arcType?

ArcType

granularity?

number

ellipsoid?

Ellipsoid

返回

SimplePolylineGeometry

KBE3D @3.0.0 Copyright © 2024-present KBE3D