PolylineVolumeOutlineGeometry

new Cesium.PolylineVolumeOutlineGeometry(options)

描述具有体积的折线(沿折线拉伸的 2D 形状)。
Name Type Description
options object 具有以下属性的对象:
Name Type Default Description
polylinePositions Array.<Cartesian3> 定义折线体积中心的位置数组。
shapePositions Array.<Cartesian2> 定义沿折线拉伸的形状的位置数组。
ellipsoid Ellipsoid Ellipsoid.default optional 用作参考的椭球体。
granularity number CesiumMath.RADIANS_PER_DEGREE optional 每个纬度和经度之间的距离(以弧度为单位)。确定缓冲区中的位置数。
cornerType CornerType CornerType.ROUNDED optional 确定拐角的样式。
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 volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({
  polylinePositions : Cesium.Cartesian3.fromDegreesArray([
    -72.0, 40.0,
    -70.0, 35.0
  ]),
  shapePositions : computeCircle(100000.0)
});
See:
  • PolylineVolumeOutlineGeometry#createGeometry

Members

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

Methods

static Cesium.PolylineVolumeOutlineGeometry.createGeometry(polylineVolumeOutlineGeometry)Geometry|undefined

计算具有体积的折线轮廓的几何表示,包括其顶点、索引和包围球。
Name Type Description
polylineVolumeOutlineGeometry PolylineVolumeOutlineGeometry 折线体积轮廓的描述。
Returns:
计算出的顶点和索引。

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

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

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

从打包的数组中检索实例。
Name Type Default Description
array Array.<number> 打包的数组。
startingIndex number 0 optional 要解包元素的起始索引。
result PolylineVolumeOutlineGeometry optional 用于存储结果的对象。
Returns:
修改后的 result 参数,如果未提供,则为新的 PolylineVolumeOutlineGeometry 实例。
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.