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