Polygon geometry processing functions, including triangulation and subdivision.
Methods
Throws:
-
DeveloperError : At least three positions are required.
static Cesium.PolygonPipeline.computeRhumbLineSubdivision(ellipsoid, positions, indices, texcoords, granularity)
Subdivides positions on rhumb lines and raises points to the surface of the ellipsoid.
| Name | Type | Default | Description |
|---|---|---|---|
ellipsoid |
Ellipsoid | The ellipsoid the polygon in on. | |
positions |
Array.<Cartesian3> |
An array of Cartesian3 positions of the polygon. |
|
indices |
Array.<number> | An array of indices that determines the triangles in the polygon. | |
texcoords |
Array.<Cartesian2> |
An optional array of Cartesian2 texture coordinates of the polygon. |
|
granularity |
number |
CesiumMath.RADIANS_PER_DEGREE
|
optional The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. |
Throws:
-
DeveloperError : At least three indices are required.
-
DeveloperError : The number of indices must be divisable by three.
-
DeveloperError : Granularity must be greater than zero.
static Cesium.PolygonPipeline.computeSubdivision(ellipsoid, positions, indices, texcoords, granularity)
Subdivides positions and raises points to the surface of the ellipsoid.
| Name | Type | Default | Description |
|---|---|---|---|
ellipsoid |
Ellipsoid | The ellipsoid the polygon in on. | |
positions |
Array.<Cartesian3> |
An array of Cartesian3 positions of the polygon. |
|
indices |
Array.<number> | An array of indices that determines the triangles in the polygon. | |
texcoords |
Array.<Cartesian2> |
An optional array of Cartesian2 texture coordinates of the polygon. |
|
granularity |
number |
CesiumMath.RADIANS_PER_DEGREE
|
optional The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. |
Throws:
-
DeveloperError : At least three indices are required.
-
DeveloperError : The number of indices must be divisable by three.
-
DeveloperError : Granularity must be greater than zero.
static Cesium.PolygonPipeline.computeWindingOrder2D() → WindingOrder
Returns:
The winding order.
Throws:
-
DeveloperError : At least three positions are required.
static Cesium.PolygonPipeline.scaleToGeodeticHeight(positions, height, ellipsoid, scaleToSurface) → Array.<number>
Scales each position of a geometry's position attribute to a height, in place.
| Name | Type | Default | Description |
|---|---|---|---|
positions |
Array.<number> | The array of numbers representing the positions to be scaled | |
height |
number |
0.0
|
optional The desired height to add to the positions |
ellipsoid |
Ellipsoid |
Ellipsoid.default
|
optional The ellipsoid on which the positions lie. |
scaleToSurface |
boolean |
true
|
optional
true if the positions need to be scaled to the surface before the height is added. |
Returns:
The input array of positions, scaled to height
Triangulate a polygon.
| Name | Type | Description |
|---|---|---|
positions |
Array.<Cartesian2> | Cartesian2 array containing the vertices of the polygon |
holes |
Array.<number> | optional An array of the staring indices of the holes. |
Returns:
Index array representing triangles that fill the polygon
