new Cesium.PolylineVolumeGeometry(options)

说明带有体积的多线(沿着多线挤压的2D形状).
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 The vertex attributes to be computed.
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

packedLength : number

用于将对象组合成数组的元素数量.

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 The index into the array at which to start packing the elements.
Returns:
装入的阵列

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

从组合的数组中获取实例 .
Name Type Default Description
array Array.<number> 装填的阵列.
startingIndex number 0 optional The starting index of the element to be unpacked.
result PolylineVolumeGeometry optional 存储结果的对象.
Returns:
如果不提供经修改的结果参数或一个新的PolylineVolumeGeometry实例.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.