Appearance
KBE3D / KBCore / Cesium / PolylineGeometry
类: PolylineGeometry
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. The polyline is capable of displaying with a material.
示例
ts
// A polyline with two connected line segments
const polyline = new Cesium.PolylineGeometry({
positions : Cesium.Cartesian3.fromDegreesArray([
0.0, 0.0,
5.0, 0.0,
5.0, 5.0
]),
width : 10.0
});
const geometry = Cesium.PolylineGeometry.createGeometry(polyline);参数
Object with the following properties:
参数
An array of Cartesian3 defining the positions in the polyline as a line strip.
参数
The width in pixels.
参数
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 vertex attributes to be computed.
参数
The ellipsoid to be used as a reference.
属性
packedLength
packedLength:
number
The number of elements used to pack the object into an array.
方法
pack()
staticpack(value:PolylineGeometry,array:number[],startingIndex?:number):number[]
Stores the provided instance into the provided array.
参数
value
PolylineGeometry
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()
staticunpack(array:number[],startingIndex?:number,result?:PolylineGeometry):PolylineGeometry
Retrieves an instance from a packed array.
参数
array
number[]
The packed array.
startingIndex?
number
The starting index of the element to be unpacked.
result?
PolylineGeometry
The object into which to store the result.
返回
PolylineGeometry
The modified result parameter or a new PolylineGeometry instance if one was not provided.
createGeometry()
staticcreateGeometry(polylineGeometry:PolylineGeometry):Geometry|undefined
Computes the geometric representation of a polyline, including its vertices, indices, and a bounding sphere.
参数
polylineGeometry
PolylineGeometry
A description of the polyline.
返回
Geometry | undefined
The computed vertices and indices.
构造函数
构造函数
new PolylineGeometry(
options: {positions:Cartesian3[];width?:number;colors?:Color[];colorsPerVertex?:boolean;arcType?:ArcType;granularity?:number;vertexFormat?:VertexFormat;ellipsoid?:Ellipsoid; }):PolylineGeometry
参数
options
positions
width?
number
colors?
Color[]
colorsPerVertex?
boolean
arcType?
granularity?
number
vertexFormat?
ellipsoid?
返回
PolylineGeometry
