CoplanarPolygonGeometry

new Cesium.CoplanarPolygonGeometry(options)

A description of a polygon composed of arbitrary coplanar positions.
Name Type Description
options Object Object with the following properties:
Name Type Default Description
polygonHierarchy PolygonHierarchy A polygon hierarchy that can include holes.
stRotation Number 0.0 optional The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
vertexFormat VertexFormat VertexFormat.DEFAULT optional The vertex attributes to be computed.
ellipsoid Ellipsoid Ellipsoid.WGS84 optional The ellipsoid to be used as a reference.
textureCoordinates PolygonHierarchy optional Texture coordinates as a PolygonHierarchy of Cartesian2 points.
Example:
const polygonGeometry = new Cesium.CoplanarPolygonGeometry({
 polygonHierarchy: new Cesium.PolygonHierarchy(
    Cesium.Cartesian3.fromDegreesArrayHeights([
     -90.0, 30.0, 0.0,
     -90.0, 30.0, 300000.0,
     -80.0, 30.0, 300000.0,
     -80.0, 30.0, 0.0
  ]))
});

Members

The number of elements used to pack the object into an array.

Methods

static Cesium.CoplanarPolygonGeometry.createGeometry(polygonGeometry)Geometry|undefined

Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
Name Type Description
polygonGeometry CoplanarPolygonGeometry A description of the polygon.
Returns:
The computed vertices and indices.

static Cesium.CoplanarPolygonGeometry.fromPositions(options)CoplanarPolygonGeometry

A description of a coplanar polygon from an array of positions.
Name Type Description
options Object Object with the following properties:
Name Type Default Description
positions Array.<Cartesian3> An array of positions that defined the corner points of the polygon.
vertexFormat VertexFormat VertexFormat.DEFAULT optional The vertex attributes to be computed.
stRotation Number 0.0 optional The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
ellipsoid Ellipsoid Ellipsoid.WGS84 optional The ellipsoid to be used as a reference.
textureCoordinates PolygonHierarchy optional Texture coordinates as a PolygonHierarchy of Cartesian2 points.
Returns:
Example:
// create a polygon from points
const polygon = Cesium.CoplanarPolygonGeometry.fromPositions({
  positions : Cesium.Cartesian3.fromDegreesArray([
    -72.0, 40.0,
    -70.0, 35.0,
    -75.0, 30.0,
    -70.0, 30.0,
    -68.0, 40.0
  ])
});
const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
See:
  • PolygonGeometry#createGeometry

static Cesium.CoplanarPolygonGeometry.pack(value, array, startingIndex)Array.<Number>

Stores the provided instance into the provided array.
Name Type Default Description
value CoplanarPolygonGeometry The value to pack.
array Array.<Number> The array to pack into.
startingIndex Number 0 optional The index into the array at which to start packing the elements.
Returns:
The array that was packed into

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

Retrieves an instance from a packed array.
Name Type Default Description
array Array.<Number> The packed array.
startingIndex Number 0 optional The starting index of the element to be unpacked.
result CoplanarPolygonGeometry optional The object into which to store the result.
Returns:
The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.