PolygonPipeline

Polygon geometry processing functions, including triangulation and subdivision.

Methods

static Cesium.PolygonPipeline.computeArea2D()

Throws:

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:

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:

static Cesium.PolygonPipeline.computeWindingOrder2D() → WindingOrder

Returns:
The winding order.
Throws:

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

static Cesium.PolygonPipeline.triangulate(positions, holes) → Array.<number>

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
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.