A description of a polygon composed of arbitrary coplanar positions.
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Object with the following properties:
|
Example:
var polygon = new LSGlobe.CoplanarPolygonGeometry({
positions : LSGlobe.Cartesian3.fromDegreesArrayHeights([
-90.0, 30.0, 0.0,
-90.0, 30.0, 1000.0,
-80.0, 30.0, 1000.0,
-80.0, 30.0, 0.0
])
});
var geometry = LSGlobe.CoplanarPolygonGeometry.createGeometry(polygon);
See:
Members
The number of elements used to pack the object into an array.
Methods
static LSGlobe.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 LSGlobe.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:
|
Returns:
- PolygonGeometry#createGeometry
Example:
// create a polygon from points
var polygon = LSGlobe.CoplanarPolygonGeometry.fromPositions({
positions : LSGlobe.Cartesian3.fromDegreesArray([
-72.0, 40.0,
-70.0, 35.0,
-75.0, 30.0,
-70.0, 30.0,
-68.0, 40.0
])
});
var geometry = LSGlobe.PolygonGeometry.createGeometry(polygon);
See:
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 LSGlobe.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.