new PolylineVolumeGeometry()
用于创建沿折线路径挤压二维形状的三维几何体,适用于可视化管道、围栏、隧道等中空结构。
| Name | Type | Default | Description |
|---|---|---|---|
options.polylinePositions |
Array.<Cartesian3> |
定义折线体中心的 |
|
options.shapePositions |
Array.<Cartesian2> |
|
|
options.ellipsoid |
Ellipsoid | Ellipsoid.WGS84 |
可选
用作参照的椭球体。 |
options.granularity |
Number | Math.RADIANS_PER_DEGREE |
可选
每个经纬度之间的距离(以弧度为单位)。确定buffer中的位置数。 |
options.vertexFormat |
VertexFormat | VertexFormat.DEFAULT |
可选
要计算的顶点属性。 |
options.cornerType |
CornerType | CornerType.ROUNDED |
可选
确定边角的样式。 |
- See:
-
- PolylineVolumeGeometry#createGeometry
Example
function computeCircle(radius) {
var positions = [];
for (var i = 0; i < 360; i++) {
var radians = SuperMap3D.Math.toRadians(i);
positions.push(new SuperMap3D.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
}
return positions;
}
var volume = new SuperMap3D.PolylineVolumeGeometry({
vertexFormat : SuperMap3D.VertexFormat.POSITION_ONLY,
polylinePositions : SuperMap3D.Cartesian3.fromDegreesArray([
-72.0, 40.0,
-70.0, 35.0
]),
shapePositions : computeCircle(100000.0)
});
Members
-
packedLengthNumber
-
用于将对象打包到数组中的元素个数。
Methods
-
static createGeometry(polylineVolumeGeometry){Geometry|undefined}
-
计算具有体积的折线的几何表示,包括其顶点、索引和包围球。
Name Type Description polylineVolumeGeometryPolylineVolumeGeometry 描述多段线体积。
Returns:
Type Description Geometry | undefined 计算出的顶点和索引。 -
static pack(value, array, startingIndex){Array.<Number>}
-
将提供的实例存储到提供的数组中。
Name Type Default Description valuePolylineVolumeGeometry 要打包的值。
arrayArray.<Number> 要装入的数组。
startingIndexNumber 0 可选 开始打包元素的数组的索引。
Returns:
Type Description Array.<Number> 被装入的数组。 -
static unpack(array, startingIndex, result){PolylineVolumeGeometry}
-
从打包数组中检索实例。
Name Type Default Description arrayArray.<Number> 打包数组。
startingIndexNumber 0 可选 要解压缩的元素的起始索引。
resultPolylineVolumeGeometry 可选 要在其中存储结果的对象。
Returns:
Type Description PolylineVolumeGeometry 修改后的结果参数或新的PolylineVolumeGeometry实例(如果没有提供)。