PolylinePipeline

Polyline geometry processing functions, including arc generation and subdivision.

Methods

static Cesium.PolylinePipeline.generateArc(options) → Array.<number>

Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions.
Name Type Description
options object Object with the following properties:
Name Type Default Description
positions Array.<Cartesian3> The array of type {Cartesian3} representing positions.
height number | Array.<number> 0.0 optional A number or array of numbers representing the heights of each position.
granularity number CesiumMath.RADIANS_PER_DEGREE optional The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid on which the positions lie.
Returns:
A new array of positions of type {number} that have been subdivided and raised to the surface of the ellipsoid.
Example:
const positions = Cesium.Cartesian3.fromDegreesArray([
  -105.0, 40.0,
  -100.0, 38.0,
  -105.0, 35.0,
  -100.0, 32.0
]);
const surfacePositions = Cesium.PolylinePipeline.generateArc({
  positons: positions
});

static Cesium.PolylinePipeline.generateCartesianArc(options) → Array.<Cartesian3>

Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions.
Name Type Description
options object Object with the following properties:
Name Type Default Description
positions Array.<Cartesian3> The array of type {Cartesian3} representing positions.
height number | Array.<number> 0.0 optional A number or array of numbers representing the heights of each position.
granularity number CesiumMath.RADIANS_PER_DEGREE optional The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid on which the positions lie.
Returns:
A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid.
Example:
const positions = Cesium.Cartesian3.fromDegreesArray([
  -105.0, 40.0,
  -100.0, 38.0,
  -105.0, 35.0,
  -100.0, 32.0
]);
const surfacePositions = Cesium.PolylinePipeline.generateCartesianArc({
  positons: positions
});

static Cesium.PolylinePipeline.generateCartesianRhumbArc(options) → Array.<Cartesian3>

Subdivides polyline and raises all points to the specified height using Rhumb Lines. Returns an array of new {Cartesian3} positions.
Name Type Description
options object Object with the following properties:
Name Type Default Description
positions Array.<Cartesian3> The array of type {Cartesian3} representing positions.
height number | Array.<number> 0.0 optional A number or array of numbers representing the heights of each position.
granularity number CesiumMath.RADIANS_PER_DEGREE optional The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid on which the positions lie.
Returns:
A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid.
Example:
const positions = Cesium.Cartesian3.fromDegreesArray([
  -105.0, 40.0,
  -100.0, 38.0,
  -105.0, 35.0,
  -100.0, 32.0
]);
const surfacePositions = Cesium.PolylinePipeline.generateCartesianRhumbArc({
  positons: positions
});

static Cesium.PolylinePipeline.generateRhumbArc(options) → Array.<number>

Subdivides polyline and raises all points to the specified height using Rhumb lines. Returns an array of numbers to represent the positions.
Name Type Description
options object Object with the following properties:
Name Type Default Description
positions Array.<Cartesian3> The array of type {Cartesian3} representing positions.
height number | Array.<number> 0.0 optional A number or array of numbers representing the heights of each position.
granularity number CesiumMath.RADIANS_PER_DEGREE optional The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid on which the positions lie.
Returns:
A new array of positions of type {number} that have been subdivided and raised to the surface of the ellipsoid.
Example:
const positions = Cesium.Cartesian3.fromDegreesArray([
  -105.0, 40.0,
  -100.0, 38.0,
  -105.0, 35.0,
  -100.0, 32.0
]);
const surfacePositions = Cesium.PolylinePipeline.generateRhumbArc({
  positons: positions
});

static Cesium.PolylinePipeline.wrapLongitude(positions, modelMatrix) → object

Breaks a Polyline into segments such that it does not cross the ±180 degree meridian of an ellipsoid.
Name Type Default Description
positions Array.<Cartesian3> The polyline's Cartesian positions.
modelMatrix Matrix4 Matrix4.IDENTITY optional The polyline's model matrix. Assumed to be an affine transformation matrix, where the upper left 3x3 elements are a rotation matrix, and the upper three elements in the fourth column are the translation. The bottom row is assumed to be [0, 0, 0, 1]. The matrix is not verified to be in the proper form.
Returns:
An object with a positions property that is an array of positions and a segments property.
Example:
const polylines = new Cesium.PolylineCollection();
const polyline = polylines.add(...);
const positions = polyline.positions;
const modelMatrix = polylines.modelMatrix;
const segments = Cesium.PolylinePipeline.wrapLongitude(positions, modelMatrix);
See:
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.