PolygonPipeline
DOC_TBA
Source:
Methods
-
<static> computeArea2D
-
DOC_TBA
Throws:
DeveloperError : At least three positions are required. -
<static> computeSubdivision
-
Subdivides positions and raises points to the surface of the ellipsoid.
Parameters:
Name Type Argument Default Description positions
Array An array of Cartesian3 positions of the polygon. indices
Array An array of indices that determines the triangles in the polygon. granularity
Number <optional>
CesiumMath.RADIANS_PER_DEGREE 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> computeWindingOrder2D
-
DOC_TBA
Throws:
DeveloperError : At least three positions are required.Returns:
WindingOrder DOC_TBA -
<static> eliminateHoles
-
Given a polygon defined by an outer ring with one or more inner rings (holes), return a single list of points representing a polygon defined by the outer ring with the inner holes removed.
Parameters:
Name Type Description outerRing
Array An array of Cartesian points defining the outer boundary of the polygon. innerRings
Array An array of arrays of Cartesian points, where each array represents a hole in the polygon. Throws:
DeveloperError :outerRing
must not be empty.Returns:
A single list of Cartesian points defining the polygon, including the eliminated inner ring.Example
// Simplifying a polygon with multiple holes. outerRing = Cesium.PolygonPipeline.eliminateHoles(outerRing, innerRings); polygon.setPositions(outerRing);
-
<static> removeDuplicates
-
DOC_TBA Cleans up a simple polygon by removing duplicate adjacent positions and making the first position not equal the last position.
Throws:
DeveloperError : At least three positions are required. -
<static> scaleToGeodeticHeight
-
Scales each position of a geometry's position attribute to a height, in place.
Parameters:
Name Type Argument Default Description geometry
Geometry The geometry whose positions are to be scaled. height
Number <optional>
0.0 The desired height to add to the positions of the geometry. ellipsoid
Ellipsoid <optional>
Ellipsoid.WGS84 The ellipsoid on which the positions lie. scaleToSurface
Boolean <optional>
true true
if the positions need to be scaled to the surface before the height is added.Returns:
Geometry The same geometry whose positions where scaled. -
<static> triangulate
-
Triangulate a polygon
Parameters:
Name Type Description positions
Array Cartesian2 array containing the vertices of the polygon Throws:
DeveloperError : At least three positions are required.Returns:
Array - Index array representing triangles that fill the polygon