PolylinePipeline-a9f32196.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. /**
  2. * Cesium - https://github.com/AnalyticalGraphicsInc/cesium
  3. *
  4. * Copyright 2011-2017 Cesium Contributors
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. *
  18. * Columbus View (Pat. Pend.)
  19. *
  20. * Portions licensed separately.
  21. * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details.
  22. */
  23. define(['exports', './when-8d13db60', './Check-70bec281', './Math-61ede240', './Cartographic-fe4be337', './Cartesian2-85064f09', './BoundingSphere-775c5788', './IntersectionTests-397d9494', './Plane-8390418f', './EllipsoidRhumbLine-f161e674', './EllipsoidGeodesic-84507801'], function (exports, when, Check, _Math, Cartographic, Cartesian2, BoundingSphere, IntersectionTests, Plane, EllipsoidRhumbLine, EllipsoidGeodesic) { 'use strict';
  24. /**
  25. * @private
  26. */
  27. var PolylinePipeline = {};
  28. PolylinePipeline.numberOfPoints = function(p0, p1, minDistance) {
  29. var distance = Cartographic.Cartesian3.distance(p0, p1);
  30. return Math.ceil(distance / minDistance);
  31. };
  32. PolylinePipeline.numberOfPointsRhumbLine = function(p0, p1, granularity) {
  33. var radiansDistanceSquared = Math.pow((p0.longitude - p1.longitude), 2) + Math.pow((p0.latitude - p1.latitude), 2);
  34. return Math.ceil(Math.sqrt(radiansDistanceSquared / (granularity * granularity)));
  35. };
  36. var cartoScratch = new Cartographic.Cartographic();
  37. PolylinePipeline.extractHeights = function(positions, ellipsoid) {
  38. var length = positions.length;
  39. var heights = new Array(length);
  40. for (var i = 0; i < length; i++) {
  41. var p = positions[i];
  42. heights[i] = ellipsoid.cartesianToCartographic(p, cartoScratch).height;
  43. }
  44. return heights;
  45. };
  46. var wrapLongitudeInversMatrix = new BoundingSphere.Matrix4();
  47. var wrapLongitudeOrigin = new Cartographic.Cartesian3();
  48. var wrapLongitudeXZNormal = new Cartographic.Cartesian3();
  49. var wrapLongitudeXZPlane = new Plane.Plane(Cartographic.Cartesian3.UNIT_X, 0.0);
  50. var wrapLongitudeYZNormal = new Cartographic.Cartesian3();
  51. var wrapLongitudeYZPlane = new Plane.Plane(Cartographic.Cartesian3.UNIT_X, 0.0);
  52. var wrapLongitudeIntersection = new Cartographic.Cartesian3();
  53. var wrapLongitudeOffset = new Cartographic.Cartesian3();
  54. var subdivideHeightsScratchArray = [];
  55. function subdivideHeights(numPoints, h0, h1) {
  56. var heights = subdivideHeightsScratchArray;
  57. heights.length = numPoints;
  58. var i;
  59. if (h0 === h1) {
  60. for (i = 0; i < numPoints; i++) {
  61. heights[i] = h0;
  62. }
  63. return heights;
  64. }
  65. var dHeight = h1 - h0;
  66. var heightPerVertex = dHeight / numPoints;
  67. for (i = 0; i < numPoints; i++) {
  68. var h = h0 + i*heightPerVertex;
  69. heights[i] = h;
  70. }
  71. return heights;
  72. }
  73. function subdivideHeightsBySin(numPoints, hMax) {
  74. var heights = subdivideHeightsScratchArray;
  75. heights.length = numPoints;
  76. for (var i = 0; i < numPoints; i++) {
  77. heights[i] = hMax * Math.sin(Math.PI * i/numPoints);
  78. }
  79. return heights;
  80. }
  81. var carto1 = new Cartographic.Cartographic();
  82. var carto2 = new Cartographic.Cartographic();
  83. var cartesian = new Cartographic.Cartesian3();
  84. var scaleFirst = new Cartographic.Cartesian3();
  85. var scaleLast = new Cartographic.Cartesian3();
  86. var ellipsoidGeodesic = new EllipsoidGeodesic.EllipsoidGeodesic();
  87. var ellipsoidRhumb = new EllipsoidRhumbLine.EllipsoidRhumbLine();
  88. //Returns subdivided line scaled to ellipsoid surface starting at p1 and ending at p2.
  89. //Result includes p1, but not include p2. This function is called for a sequence of line segments,
  90. //and this prevents duplication of end point.
  91. function generateCartesianArc(p0, p1, minDistance, ellipsoid, h0, h1, array, offset, hMax) {
  92. var first = ellipsoid.scaleToGeodeticSurface(p0, scaleFirst);
  93. var last = ellipsoid.scaleToGeodeticSurface(p1, scaleLast);
  94. var numPoints = PolylinePipeline.numberOfPoints(p0, p1, minDistance);
  95. var start = ellipsoid.cartesianToCartographic(first, carto1);
  96. var end = ellipsoid.cartesianToCartographic(last, carto2);
  97. var heights = subdivideHeights(numPoints, h0, h1);
  98. if(hMax >0.0){
  99. heights = subdivideHeightsBySin(numPoints, hMax);
  100. }
  101. ellipsoidGeodesic.setEndPoints(start, end);
  102. var surfaceDistanceBetweenPoints = ellipsoidGeodesic.surfaceDistance / numPoints;
  103. var index = offset;
  104. start.height = h0;
  105. var cart = ellipsoid.cartographicToCartesian(start, cartesian);
  106. Cartographic.Cartesian3.pack(cart, array, index);
  107. index += 3;
  108. for (var i = 1; i < numPoints; i++) {
  109. var carto = ellipsoidGeodesic.interpolateUsingSurfaceDistance(i * surfaceDistanceBetweenPoints, carto2);
  110. carto.height = heights[i];
  111. cart = ellipsoid.cartographicToCartesian(carto, cartesian);
  112. Cartographic.Cartesian3.pack(cart, array, index);
  113. index += 3;
  114. }
  115. return index;
  116. }
  117. //Returns subdivided line scaled to ellipsoid surface starting at p1 and ending at p2.
  118. //Result includes p1, but not include p2. This function is called for a sequence of line segments,
  119. //and this prevents duplication of end point.
  120. function generateCartesianRhumbArc(p0, p1, granularity, ellipsoid, h0, h1, array, offset) {
  121. var first = ellipsoid.scaleToGeodeticSurface(p0, scaleFirst);
  122. var last = ellipsoid.scaleToGeodeticSurface(p1, scaleLast);
  123. var start = ellipsoid.cartesianToCartographic(first, carto1);
  124. var end = ellipsoid.cartesianToCartographic(last, carto2);
  125. var numPoints = PolylinePipeline.numberOfPointsRhumbLine(start, end, granularity);
  126. var heights = subdivideHeights(numPoints, h0, h1);
  127. if (!ellipsoidRhumb.ellipsoid.equals(ellipsoid)) {
  128. ellipsoidRhumb = new EllipsoidRhumbLine.EllipsoidRhumbLine(undefined, undefined, ellipsoid);
  129. }
  130. ellipsoidRhumb.setEndPoints(start, end);
  131. var surfaceDistanceBetweenPoints = ellipsoidRhumb.surfaceDistance / numPoints;
  132. var index = offset;
  133. start.height = h0;
  134. var cart = ellipsoid.cartographicToCartesian(start, cartesian);
  135. Cartographic.Cartesian3.pack(cart, array, index);
  136. index += 3;
  137. for (var i = 1; i < numPoints; i++) {
  138. var carto = ellipsoidRhumb.interpolateUsingSurfaceDistance(i * surfaceDistanceBetweenPoints, carto2);
  139. carto.height = heights[i];
  140. cart = ellipsoid.cartographicToCartesian(carto, cartesian);
  141. Cartographic.Cartesian3.pack(cart, array, index);
  142. index += 3;
  143. }
  144. return index;
  145. }
  146. /**
  147. * Breaks a {@link Polyline} into segments such that it does not cross the &plusmn;180 degree meridian of an ellipsoid.
  148. *
  149. * @param {Cartesian3[]} positions The polyline's Cartesian positions.
  150. * @param {Matrix4} [modelMatrix=Matrix4.IDENTITY] The polyline's model matrix. Assumed to be an affine
  151. * transformation matrix, where the upper left 3x3 elements are a rotation matrix, and
  152. * the upper three elements in the fourth column are the translation. The bottom row is assumed to be [0, 0, 0, 1].
  153. * The matrix is not verified to be in the proper form.
  154. * @returns {Object} An object with a <code>positions</code> property that is an array of positions and a
  155. * <code>segments</code> property.
  156. *
  157. *
  158. * @example
  159. * var polylines = new Cesium.PolylineCollection();
  160. * var polyline = polylines.add(...);
  161. * var positions = polyline.positions;
  162. * var modelMatrix = polylines.modelMatrix;
  163. * var segments = Cesium.PolylinePipeline.wrapLongitude(positions, modelMatrix);
  164. *
  165. * @see PolygonPipeline.wrapLongitude
  166. * @see Polyline
  167. * @see PolylineCollection
  168. */
  169. PolylinePipeline.wrapLongitude = function(positions, modelMatrix) {
  170. var cartesians = [];
  171. var segments = [];
  172. if (when.defined(positions) && positions.length > 0) {
  173. modelMatrix = when.defaultValue(modelMatrix, BoundingSphere.Matrix4.IDENTITY);
  174. var inverseModelMatrix = BoundingSphere.Matrix4.inverseTransformation(modelMatrix, wrapLongitudeInversMatrix);
  175. var origin = BoundingSphere.Matrix4.multiplyByPoint(inverseModelMatrix, Cartographic.Cartesian3.ZERO, wrapLongitudeOrigin);
  176. var xzNormal = Cartographic.Cartesian3.normalize(BoundingSphere.Matrix4.multiplyByPointAsVector(inverseModelMatrix, Cartographic.Cartesian3.UNIT_Y, wrapLongitudeXZNormal), wrapLongitudeXZNormal);
  177. var xzPlane = Plane.Plane.fromPointNormal(origin, xzNormal, wrapLongitudeXZPlane);
  178. var yzNormal = Cartographic.Cartesian3.normalize(BoundingSphere.Matrix4.multiplyByPointAsVector(inverseModelMatrix, Cartographic.Cartesian3.UNIT_X, wrapLongitudeYZNormal), wrapLongitudeYZNormal);
  179. var yzPlane = Plane.Plane.fromPointNormal(origin, yzNormal, wrapLongitudeYZPlane);
  180. var count = 1;
  181. cartesians.push(Cartographic.Cartesian3.clone(positions[0]));
  182. var prev = cartesians[0];
  183. var length = positions.length;
  184. for (var i = 1; i < length; ++i) {
  185. var cur = positions[i];
  186. // intersects the IDL if either endpoint is on the negative side of the yz-plane
  187. if (Plane.Plane.getPointDistance(yzPlane, prev) < 0.0 || Plane.Plane.getPointDistance(yzPlane, cur) < 0.0) {
  188. // and intersects the xz-plane
  189. var intersection = IntersectionTests.IntersectionTests.lineSegmentPlane(prev, cur, xzPlane, wrapLongitudeIntersection);
  190. if (when.defined(intersection)) {
  191. // move point on the xz-plane slightly away from the plane
  192. var offset = Cartographic.Cartesian3.multiplyByScalar(xzNormal, 5.0e-9, wrapLongitudeOffset);
  193. if (Plane.Plane.getPointDistance(xzPlane, prev) < 0.0) {
  194. Cartographic.Cartesian3.negate(offset, offset);
  195. }
  196. cartesians.push(Cartographic.Cartesian3.add(intersection, offset, new Cartographic.Cartesian3()));
  197. segments.push(count + 1);
  198. Cartographic.Cartesian3.negate(offset, offset);
  199. cartesians.push(Cartographic.Cartesian3.add(intersection, offset, new Cartographic.Cartesian3()));
  200. count = 1;
  201. }
  202. }
  203. cartesians.push(Cartographic.Cartesian3.clone(positions[i]));
  204. count++;
  205. prev = cur;
  206. }
  207. segments.push(count);
  208. }
  209. return {
  210. positions : cartesians,
  211. lengths : segments
  212. };
  213. };
  214. /**
  215. * Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions.
  216. * @param {Object} options Object with the following properties:
  217. * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.
  218. * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.
  219. * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  220. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.
  221. * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid.
  222. *
  223. * @example
  224. * var positions = Cesium.Cartesian3.fromDegreesArray([
  225. * -105.0, 40.0,
  226. * -100.0, 38.0,
  227. * -105.0, 35.0,
  228. * -100.0, 32.0
  229. * ]);
  230. * var surfacePositions = Cesium.PolylinePipeline.generateArc({
  231. * positons: positions
  232. * });
  233. */
  234. PolylinePipeline.generateArc = function(options) {
  235. if (!when.defined(options)) {
  236. options = {};
  237. }
  238. var positions = options.positions;
  239. //>>includeStart('debug', pragmas.debug);
  240. if (!when.defined(positions)) {
  241. throw new Check.DeveloperError('options.positions is required.');
  242. }
  243. //>>includeEnd('debug');
  244. var length = positions.length;
  245. var ellipsoid = when.defaultValue(options.ellipsoid, Cartesian2.Ellipsoid.WGS84);
  246. var height = when.defaultValue(options.height, 0);
  247. var hasHeightArray = Array.isArray(height);
  248. if (length < 1) {
  249. return [];
  250. } else if (length === 1) {
  251. var p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);
  252. height = hasHeightArray ? height[0] : height;
  253. if (height !== 0) {
  254. var n = ellipsoid.geodeticSurfaceNormal(p, cartesian);
  255. Cartographic.Cartesian3.multiplyByScalar(n, height, n);
  256. Cartographic.Cartesian3.add(p, n, p);
  257. }
  258. return [p.x, p.y, p.z];
  259. }
  260. var minDistance = options.minDistance;
  261. if (!when.defined(minDistance)) {
  262. var granularity = when.defaultValue(options.granularity, _Math.CesiumMath.RADIANS_PER_DEGREE);
  263. minDistance = _Math.CesiumMath.chordLength(granularity, ellipsoid.maximumRadius);
  264. }
  265. var numPoints = 0;
  266. var i;
  267. for (i = 0; i < length -1; i++) {
  268. numPoints += PolylinePipeline.numberOfPoints(positions[i], positions[i+1], minDistance);
  269. }
  270. var hMax = options.hMax;
  271. var arrayLength = (numPoints + 1) * 3;
  272. var newPositions = new Array(arrayLength);
  273. var offset = 0;
  274. for (i = 0; i < length - 1; i++) {
  275. var p0 = positions[i];
  276. var p1 = positions[i + 1];
  277. var h0 = hasHeightArray ? height[i] : height;
  278. var h1 = hasHeightArray ? height[i + 1] : height;
  279. offset = generateCartesianArc(p0, p1, minDistance, ellipsoid, h0, h1, newPositions, offset, hMax);
  280. }
  281. subdivideHeightsScratchArray.length = 0;
  282. var lastPoint = positions[length - 1];
  283. var carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);
  284. carto.height = hasHeightArray ? height[length - 1] : height;
  285. var cart = ellipsoid.cartographicToCartesian(carto, cartesian);
  286. Cartographic.Cartesian3.pack(cart, newPositions, arrayLength - 3);
  287. return newPositions;
  288. };
  289. var scratchCartographic0 = new Cartographic.Cartographic();
  290. var scratchCartographic1 = new Cartographic.Cartographic();
  291. /**
  292. * Subdivides polyline and raises all points to the specified height using Rhumb lines. Returns an array of numbers to represent the positions.
  293. * @param {Object} options Object with the following properties:
  294. * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.
  295. * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.
  296. * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  297. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.
  298. * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid.
  299. *
  300. * @example
  301. * var positions = Cesium.Cartesian3.fromDegreesArray([
  302. * -105.0, 40.0,
  303. * -100.0, 38.0,
  304. * -105.0, 35.0,
  305. * -100.0, 32.0
  306. * ]);
  307. * var surfacePositions = Cesium.PolylinePipeline.generateRhumbArc({
  308. * positons: positions
  309. * });
  310. */
  311. PolylinePipeline.generateRhumbArc = function(options) {
  312. if (!when.defined(options)) {
  313. options = {};
  314. }
  315. var positions = options.positions;
  316. //>>includeStart('debug', pragmas.debug);
  317. if (!when.defined(positions)) {
  318. throw new Check.DeveloperError('options.positions is required.');
  319. }
  320. //>>includeEnd('debug');
  321. var length = positions.length;
  322. var ellipsoid = when.defaultValue(options.ellipsoid, Cartesian2.Ellipsoid.WGS84);
  323. var height = when.defaultValue(options.height, 0);
  324. var hasHeightArray = Array.isArray(height);
  325. if (length < 1) {
  326. return [];
  327. } else if (length === 1) {
  328. var p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);
  329. height = hasHeightArray ? height[0] : height;
  330. if (height !== 0) {
  331. var n = ellipsoid.geodeticSurfaceNormal(p, cartesian);
  332. Cartographic.Cartesian3.multiplyByScalar(n, height, n);
  333. Cartographic.Cartesian3.add(p, n, p);
  334. }
  335. return [p.x, p.y, p.z];
  336. }
  337. var granularity = when.defaultValue(options.granularity, _Math.CesiumMath.RADIANS_PER_DEGREE);
  338. var numPoints = 0;
  339. var i;
  340. var c0 = ellipsoid.cartesianToCartographic(positions[0], scratchCartographic0);
  341. var c1;
  342. for (i = 0; i < length - 1; i++) {
  343. c1 = ellipsoid.cartesianToCartographic(positions[i + 1], scratchCartographic1);
  344. numPoints += PolylinePipeline.numberOfPointsRhumbLine(c0, c1, granularity);
  345. c0 = Cartographic.Cartographic.clone(c1, scratchCartographic0);
  346. }
  347. var arrayLength = (numPoints + 1) * 3;
  348. var newPositions = new Array(arrayLength);
  349. var offset = 0;
  350. for (i = 0; i < length - 1; i++) {
  351. var p0 = positions[i];
  352. var p1 = positions[i + 1];
  353. var h0 = hasHeightArray ? height[i] : height;
  354. var h1 = hasHeightArray ? height[i + 1] : height;
  355. offset = generateCartesianRhumbArc(p0, p1, granularity, ellipsoid, h0, h1, newPositions, offset);
  356. }
  357. subdivideHeightsScratchArray.length = 0;
  358. var lastPoint = positions[length - 1];
  359. var carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);
  360. carto.height = hasHeightArray ? height[length - 1] : height;
  361. var cart = ellipsoid.cartographicToCartesian(carto, cartesian);
  362. Cartographic.Cartesian3.pack(cart, newPositions, arrayLength - 3);
  363. return newPositions;
  364. };
  365. /**
  366. * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions.
  367. * @param {Object} options Object with the following properties:
  368. * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.
  369. * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.
  370. * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  371. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.
  372. * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid.
  373. *
  374. * @example
  375. * var positions = Cesium.Cartesian3.fromDegreesArray([
  376. * -105.0, 40.0,
  377. * -100.0, 38.0,
  378. * -105.0, 35.0,
  379. * -100.0, 32.0
  380. * ]);
  381. * var surfacePositions = Cesium.PolylinePipeline.generateCartesianArc({
  382. * positons: positions
  383. * });
  384. */
  385. PolylinePipeline.generateCartesianArc = function(options) {
  386. var numberArray = PolylinePipeline.generateArc(options);
  387. var size = numberArray.length/3;
  388. var newPositions = new Array(size);
  389. for (var i = 0; i < size; i++) {
  390. newPositions[i] = Cartographic.Cartesian3.unpack(numberArray, i*3);
  391. }
  392. return newPositions;
  393. };
  394. /**
  395. * Subdivides polyline and raises all points to the specified height using Rhumb Lines. Returns an array of new {Cartesian3} positions.
  396. * @param {Object} options Object with the following properties:
  397. * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.
  398. * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.
  399. * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  400. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.
  401. * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid.
  402. *
  403. * @example
  404. * var positions = Cesium.Cartesian3.fromDegreesArray([
  405. * -105.0, 40.0,
  406. * -100.0, 38.0,
  407. * -105.0, 35.0,
  408. * -100.0, 32.0
  409. * ]);
  410. * var surfacePositions = Cesium.PolylinePipeline.generateCartesianRhumbArc({
  411. * positons: positions
  412. * });
  413. */
  414. PolylinePipeline.generateCartesianRhumbArc = function(options) {
  415. var numberArray = PolylinePipeline.generateRhumbArc(options);
  416. var size = numberArray.length/3;
  417. var newPositions = new Array(size);
  418. for (var i = 0; i < size; i++) {
  419. newPositions[i] = Cartographic.Cartesian3.unpack(numberArray, i*3);
  420. }
  421. return newPositions;
  422. };
  423. exports.PolylinePipeline = PolylinePipeline;
  424. });