PolylineVolumeGeometry

new Cesium.PolylineVolumeGeometry(options)

A description of a polyline with a volume (a 2D shape extruded along a polyline).
Name Type Description
options object 对象,具有以下属性:
Name Type Default Description
polylinePositions Array.<Cartesian3> An array of Cartesian3 positions that define the center of the polyline volume.
shapePositions Array.<Cartesian2> An array of Cartesian2 positions that define the shape to be extruded along the polyline
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid to be used as a reference.
granularity number CesiumMath.RADIANS_PER_DEGREE optional The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
vertexFormat VertexFormat VertexFormat.DEFAULT optional 要计算的顶点属性。
cornerType CornerType CornerType.ROUNDED optional Determines the style of the corners.
Example:
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)
});
Demo:
See:
  • PolylineVolumeGeometry#createGeometry

Members

用于将对象打包到数组中的元素数量。

Methods

static Cesium.PolylineVolumeGeometry.createGeometry(polylineVolumeGeometry)Geometry|undefined

计算具有体积的折线的几何表示,包括其顶点、索引和边界球体。
Name Type Description
polylineVolumeGeometry PolylineVolumeGeometry 多段线体积的描述。
Returns:
计算的顶点和索引。

static Cesium.PolylineVolumeGeometry.pack(value, array, startingIndex)Array.<number>

将提供的实例存储到提供的数组中。
Name Type Default Description
value PolylineVolumeGeometry 要打包的值。
array Array.<number> 要装入的数组。
startingIndex number 0 optional 开始打包元素的数组的索引。
Returns:
被装入的数组

static Cesium.PolylineVolumeGeometry.unpack(array, startingIndex, result)PolylineVolumeGeometry

从打包数组中检索实例。
Name Type Default Description
array Array.<number> 打包数组。
startingIndex number 0 optional 要解压缩的元素的起始索引。
result PolylineVolumeGeometry optional 要在其中存储结果的对象。
Returns:
修改后的结果参数 or a new PolylineVolumeGeometry instance if one was not provided.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.