createCorridorOutlineGeometry.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. /* This file is automatically rebuilt by the Cesium build process. */
  2. define(['./defined-26bd4a03', './Check-da037458', './freezeObject-2d83f591', './defaultValue-f2e68450', './Math-fa6e45cb', './Cartesian2-2a723276', './defineProperties-6f7a50f2', './Transforms-65aba0a4', './RuntimeError-ad75c885', './WebGLConstants-497deb20', './ComponentDatatype-69643096', './GeometryAttribute-ed359d71', './when-ee12a2cb', './GeometryAttributes-eecc9f43', './IndexDatatype-3de60176', './IntersectionTests-c2360ffa', './Plane-a1a3fd52', './GeometryOffsetAttribute-cb30cd97', './arrayRemoveDuplicates-dd708d81', './EllipsoidTangentPlane-10c6053a', './EllipsoidRhumbLine-c6cdbfd3', './PolygonPipeline-e486c11c', './PolylineVolumeGeometryLibrary-57289189', './EllipsoidGeodesic-53e988a6', './PolylinePipeline-b4161aaf', './CorridorGeometryLibrary-b584c522'], function (defined, Check, freezeObject, defaultValue, _Math, Cartesian2, defineProperties, Transforms, RuntimeError, WebGLConstants, ComponentDatatype, GeometryAttribute, when, GeometryAttributes, IndexDatatype, IntersectionTests, Plane, GeometryOffsetAttribute, arrayRemoveDuplicates, EllipsoidTangentPlane, EllipsoidRhumbLine, PolygonPipeline, PolylineVolumeGeometryLibrary, EllipsoidGeodesic, PolylinePipeline, CorridorGeometryLibrary) { 'use strict';
  3. var cartesian1 = new Cartesian2.Cartesian3();
  4. var cartesian2 = new Cartesian2.Cartesian3();
  5. var cartesian3 = new Cartesian2.Cartesian3();
  6. function scaleToSurface(positions, ellipsoid) {
  7. for (var i = 0; i < positions.length; i++) {
  8. positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
  9. }
  10. return positions;
  11. }
  12. function combine(computedPositions, cornerType) {
  13. var wallIndices = [];
  14. var positions = computedPositions.positions;
  15. var corners = computedPositions.corners;
  16. var endPositions = computedPositions.endPositions;
  17. var attributes = new GeometryAttributes.GeometryAttributes();
  18. var corner;
  19. var leftCount = 0;
  20. var rightCount = 0;
  21. var i;
  22. var indicesLength = 0;
  23. var length;
  24. for (i = 0; i < positions.length; i += 2) {
  25. length = positions[i].length - 3;
  26. leftCount += length; //subtracting 3 to account for duplicate points at corners
  27. indicesLength += length / 3 * 4;
  28. rightCount += positions[i + 1].length - 3;
  29. }
  30. leftCount += 3; //add back count for end positions
  31. rightCount += 3;
  32. for (i = 0; i < corners.length; i++) {
  33. corner = corners[i];
  34. var leftSide = corners[i].leftPositions;
  35. if (defined.defined(leftSide)) {
  36. length = leftSide.length;
  37. leftCount += length;
  38. indicesLength += length / 3 * 2;
  39. } else {
  40. length = corners[i].rightPositions.length;
  41. rightCount += length;
  42. indicesLength += length / 3 * 2;
  43. }
  44. }
  45. var addEndPositions = defined.defined(endPositions);
  46. var endPositionLength;
  47. if (addEndPositions) {
  48. endPositionLength = endPositions[0].length - 3;
  49. leftCount += endPositionLength;
  50. rightCount += endPositionLength;
  51. endPositionLength /= 3;
  52. indicesLength += endPositionLength * 4;
  53. }
  54. var size = leftCount + rightCount;
  55. var finalPositions = new Float64Array(size);
  56. var front = 0;
  57. var back = size - 1;
  58. var UL, LL, UR, LR;
  59. var rightPos, leftPos;
  60. var halfLength = endPositionLength / 2;
  61. var indices = IndexDatatype.IndexDatatype.createTypedArray(size / 3, indicesLength + 4);
  62. var index = 0;
  63. indices[index++] = front / 3;
  64. indices[index++] = (back - 2) / 3;
  65. if (addEndPositions) { // add rounded end
  66. wallIndices.push(front / 3);
  67. leftPos = cartesian1;
  68. rightPos = cartesian2;
  69. var firstEndPositions = endPositions[0];
  70. for (i = 0; i < halfLength; i++) {
  71. leftPos = Cartesian2.Cartesian3.fromArray(firstEndPositions, (halfLength - 1 - i) * 3, leftPos);
  72. rightPos = Cartesian2.Cartesian3.fromArray(firstEndPositions, (halfLength + i) * 3, rightPos);
  73. CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
  74. CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, leftPos, undefined, back);
  75. LL = front / 3;
  76. LR = LL + 1;
  77. UL = (back - 2) / 3;
  78. UR = UL - 1;
  79. indices[index++] = UL;
  80. indices[index++] = UR;
  81. indices[index++] = LL;
  82. indices[index++] = LR;
  83. front += 3;
  84. back -= 3;
  85. }
  86. }
  87. var posIndex = 0;
  88. var rightEdge = positions[posIndex++]; //add first two edges
  89. var leftEdge = positions[posIndex++];
  90. finalPositions.set(rightEdge, front);
  91. finalPositions.set(leftEdge, back - leftEdge.length + 1);
  92. length = leftEdge.length - 3;
  93. wallIndices.push(front / 3, (back - 2) / 3);
  94. for (i = 0; i < length; i += 3) {
  95. LL = front / 3;
  96. LR = LL + 1;
  97. UL = (back - 2) / 3;
  98. UR = UL - 1;
  99. indices[index++] = UL;
  100. indices[index++] = UR;
  101. indices[index++] = LL;
  102. indices[index++] = LR;
  103. front += 3;
  104. back -= 3;
  105. }
  106. for (i = 0; i < corners.length; i++) {
  107. var j;
  108. corner = corners[i];
  109. var l = corner.leftPositions;
  110. var r = corner.rightPositions;
  111. var start;
  112. var outsidePoint = cartesian3;
  113. if (defined.defined(l)) {
  114. back -= 3;
  115. start = UR;
  116. wallIndices.push(LR);
  117. for (j = 0; j < l.length / 3; j++) {
  118. outsidePoint = Cartesian2.Cartesian3.fromArray(l, j * 3, outsidePoint);
  119. indices[index++] = start - j - 1;
  120. indices[index++] = start - j;
  121. CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, outsidePoint, undefined, back);
  122. back -= 3;
  123. }
  124. wallIndices.push(start - Math.floor(l.length / 6));
  125. if (cornerType === PolylineVolumeGeometryLibrary.CornerType.BEVELED) {
  126. wallIndices.push((back - 2) / 3 + 1);
  127. }
  128. front += 3;
  129. } else {
  130. front += 3;
  131. start = LR;
  132. wallIndices.push(UR);
  133. for (j = 0; j < r.length / 3; j++) {
  134. outsidePoint = Cartesian2.Cartesian3.fromArray(r, j * 3, outsidePoint);
  135. indices[index++] = start + j;
  136. indices[index++] = start + j + 1;
  137. CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, outsidePoint, front);
  138. front += 3;
  139. }
  140. wallIndices.push(start + Math.floor(r.length / 6));
  141. if (cornerType === PolylineVolumeGeometryLibrary.CornerType.BEVELED) {
  142. wallIndices.push(front / 3 - 1);
  143. }
  144. back -= 3;
  145. }
  146. rightEdge = positions[posIndex++];
  147. leftEdge = positions[posIndex++];
  148. rightEdge.splice(0, 3); //remove duplicate points added by corner
  149. leftEdge.splice(leftEdge.length - 3, 3);
  150. finalPositions.set(rightEdge, front);
  151. finalPositions.set(leftEdge, back - leftEdge.length + 1);
  152. length = leftEdge.length - 3;
  153. for (j = 0; j < leftEdge.length; j += 3) {
  154. LR = front / 3;
  155. LL = LR - 1;
  156. UR = (back - 2) / 3;
  157. UL = UR + 1;
  158. indices[index++] = UL;
  159. indices[index++] = UR;
  160. indices[index++] = LL;
  161. indices[index++] = LR;
  162. front += 3;
  163. back -= 3;
  164. }
  165. front -= 3;
  166. back += 3;
  167. wallIndices.push(front / 3, (back - 2) / 3);
  168. }
  169. if (addEndPositions) { // add rounded end
  170. front += 3;
  171. back -= 3;
  172. leftPos = cartesian1;
  173. rightPos = cartesian2;
  174. var lastEndPositions = endPositions[1];
  175. for (i = 0; i < halfLength; i++) {
  176. leftPos = Cartesian2.Cartesian3.fromArray(lastEndPositions, (endPositionLength - i - 1) * 3, leftPos);
  177. rightPos = Cartesian2.Cartesian3.fromArray(lastEndPositions, i * 3, rightPos);
  178. CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, leftPos, undefined, back);
  179. CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
  180. LR = front / 3;
  181. LL = LR - 1;
  182. UR = (back - 2) / 3;
  183. UL = UR + 1;
  184. indices[index++] = UL;
  185. indices[index++] = UR;
  186. indices[index++] = LL;
  187. indices[index++] = LR;
  188. front += 3;
  189. back -= 3;
  190. }
  191. wallIndices.push(front / 3);
  192. } else {
  193. wallIndices.push(front / 3, (back - 2) / 3);
  194. }
  195. indices[index++] = front / 3;
  196. indices[index++] = (back - 2) / 3;
  197. attributes.position = new GeometryAttribute.GeometryAttribute({
  198. componentDatatype : ComponentDatatype.ComponentDatatype.DOUBLE,
  199. componentsPerAttribute : 3,
  200. values : finalPositions
  201. });
  202. return {
  203. attributes : attributes,
  204. indices : indices,
  205. wallIndices : wallIndices
  206. };
  207. }
  208. function computePositionsExtruded(params) {
  209. var ellipsoid = params.ellipsoid;
  210. var computedPositions = CorridorGeometryLibrary.CorridorGeometryLibrary.computePositions(params);
  211. var attr = combine(computedPositions, params.cornerType);
  212. var wallIndices = attr.wallIndices;
  213. var height = params.height;
  214. var extrudedHeight = params.extrudedHeight;
  215. var attributes = attr.attributes;
  216. var indices = attr.indices;
  217. var positions = attributes.position.values;
  218. var length = positions.length;
  219. var extrudedPositions = new Float64Array(length);
  220. extrudedPositions.set(positions);
  221. var newPositions = new Float64Array(length * 2);
  222. positions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(positions, height, ellipsoid);
  223. extrudedPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(extrudedPositions, extrudedHeight, ellipsoid);
  224. newPositions.set(positions);
  225. newPositions.set(extrudedPositions, length);
  226. attributes.position.values = newPositions;
  227. length /= 3;
  228. if (defined.defined(params.offsetAttribute)) {
  229. var applyOffset = new Uint8Array(length * 2);
  230. if (params.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
  231. applyOffset = GeometryOffsetAttribute.arrayFill(applyOffset, 1, 0, length);
  232. } else {
  233. var applyOffsetValue = params.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
  234. applyOffset = GeometryOffsetAttribute.arrayFill(applyOffset, applyOffsetValue);
  235. }
  236. attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
  237. componentDatatype : ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
  238. componentsPerAttribute : 1,
  239. values: applyOffset
  240. });
  241. }
  242. var i;
  243. var iLength = indices.length;
  244. var newIndices = IndexDatatype.IndexDatatype.createTypedArray(newPositions.length / 3, (iLength + wallIndices.length) * 2);
  245. newIndices.set(indices);
  246. var index = iLength;
  247. for (i = 0; i < iLength; i += 2) { // bottom indices
  248. var v0 = indices[i];
  249. var v1 = indices[i + 1];
  250. newIndices[index++] = v0 + length;
  251. newIndices[index++] = v1 + length;
  252. }
  253. var UL, LL;
  254. for (i = 0; i < wallIndices.length; i++) { //wall indices
  255. UL = wallIndices[i];
  256. LL = UL + length;
  257. newIndices[index++] = UL;
  258. newIndices[index++] = LL;
  259. }
  260. return {
  261. attributes : attributes,
  262. indices : newIndices
  263. };
  264. }
  265. /**
  266. * A description of a corridor outline.
  267. *
  268. * @alias CorridorOutlineGeometry
  269. * @constructor
  270. *
  271. * @param {Object} options Object with the following properties:
  272. * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor outline.
  273. * @param {Number} options.width The distance between the edges of the corridor outline.
  274. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
  275. * @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.
  276. * @param {Number} [options.height=0] The distance in meters between the positions and the ellipsoid surface.
  277. * @param {Number} [options.extrudedHeight] The distance in meters between the extruded face and the ellipsoid surface.
  278. * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
  279. *
  280. * @see CorridorOutlineGeometry.createGeometry
  281. *
  282. * @example
  283. * var corridor = new Cesium.CorridorOutlineGeometry({
  284. * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  285. * width : 100000
  286. * });
  287. */
  288. function CorridorOutlineGeometry(options) {
  289. options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
  290. var positions = options.positions;
  291. var width = options.width;
  292. //>>includeStart('debug', pragmas.debug);
  293. Check.Check.typeOf.object('options.positions', positions);
  294. Check.Check.typeOf.number('options.width', width);
  295. //>>includeEnd('debug');
  296. var height = defaultValue.defaultValue(options.height, 0.0);
  297. var extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
  298. this._positions = positions;
  299. this._ellipsoid = Cartesian2.Ellipsoid.clone(defaultValue.defaultValue(options.ellipsoid, Cartesian2.Ellipsoid.WGS84));
  300. this._width = width;
  301. this._height = Math.max(height, extrudedHeight);
  302. this._extrudedHeight = Math.min(height, extrudedHeight);
  303. this._cornerType = defaultValue.defaultValue(options.cornerType, PolylineVolumeGeometryLibrary.CornerType.ROUNDED);
  304. this._granularity = defaultValue.defaultValue(options.granularity, _Math.CesiumMath.RADIANS_PER_DEGREE);
  305. this._offsetAttribute = options.offsetAttribute;
  306. this._workerName = 'createCorridorOutlineGeometry';
  307. /**
  308. * The number of elements used to pack the object into an array.
  309. * @type {Number}
  310. */
  311. this.packedLength = 1 + positions.length * Cartesian2.Cartesian3.packedLength + Cartesian2.Ellipsoid.packedLength + 6;
  312. }
  313. /**
  314. * Stores the provided instance into the provided array.
  315. *
  316. * @param {CorridorOutlineGeometry} value The value to pack.
  317. * @param {Number[]} array The array to pack into.
  318. * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
  319. *
  320. * @returns {Number[]} The array that was packed into
  321. */
  322. CorridorOutlineGeometry.pack = function(value, array, startingIndex) {
  323. //>>includeStart('debug', pragmas.debug);
  324. Check.Check.typeOf.object('value', value);
  325. Check.Check.typeOf.object('array', array);
  326. //>>includeEnd('debug');
  327. startingIndex = defaultValue.defaultValue(startingIndex, 0);
  328. var positions = value._positions;
  329. var length = positions.length;
  330. array[startingIndex++] = length;
  331. for (var i = 0; i < length; ++i, startingIndex += Cartesian2.Cartesian3.packedLength) {
  332. Cartesian2.Cartesian3.pack(positions[i], array, startingIndex);
  333. }
  334. Cartesian2.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
  335. startingIndex += Cartesian2.Ellipsoid.packedLength;
  336. array[startingIndex++] = value._width;
  337. array[startingIndex++] = value._height;
  338. array[startingIndex++] = value._extrudedHeight;
  339. array[startingIndex++] = value._cornerType;
  340. array[startingIndex++] = value._granularity;
  341. array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
  342. return array;
  343. };
  344. var scratchEllipsoid = Cartesian2.Ellipsoid.clone(Cartesian2.Ellipsoid.UNIT_SPHERE);
  345. var scratchOptions = {
  346. positions : undefined,
  347. ellipsoid : scratchEllipsoid,
  348. width : undefined,
  349. height : undefined,
  350. extrudedHeight : undefined,
  351. cornerType : undefined,
  352. granularity : undefined,
  353. offsetAttribute: undefined
  354. };
  355. /**
  356. * Retrieves an instance from a packed array.
  357. *
  358. * @param {Number[]} array The packed array.
  359. * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
  360. * @param {CorridorOutlineGeometry} [result] The object into which to store the result.
  361. * @returns {CorridorOutlineGeometry} The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.
  362. */
  363. CorridorOutlineGeometry.unpack = function(array, startingIndex, result) {
  364. //>>includeStart('debug', pragmas.debug);
  365. Check.Check.typeOf.object('array', array);
  366. //>>includeEnd('debug');
  367. startingIndex = defaultValue.defaultValue(startingIndex, 0);
  368. var length = array[startingIndex++];
  369. var positions = new Array(length);
  370. for (var i = 0; i < length; ++i, startingIndex += Cartesian2.Cartesian3.packedLength) {
  371. positions[i] = Cartesian2.Cartesian3.unpack(array, startingIndex);
  372. }
  373. var ellipsoid = Cartesian2.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
  374. startingIndex += Cartesian2.Ellipsoid.packedLength;
  375. var width = array[startingIndex++];
  376. var height = array[startingIndex++];
  377. var extrudedHeight = array[startingIndex++];
  378. var cornerType = array[startingIndex++];
  379. var granularity = array[startingIndex++];
  380. var offsetAttribute = array[startingIndex];
  381. if (!defined.defined(result)) {
  382. scratchOptions.positions = positions;
  383. scratchOptions.width = width;
  384. scratchOptions.height = height;
  385. scratchOptions.extrudedHeight = extrudedHeight;
  386. scratchOptions.cornerType = cornerType;
  387. scratchOptions.granularity = granularity;
  388. scratchOptions.offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
  389. return new CorridorOutlineGeometry(scratchOptions);
  390. }
  391. result._positions = positions;
  392. result._ellipsoid = Cartesian2.Ellipsoid.clone(ellipsoid, result._ellipsoid);
  393. result._width = width;
  394. result._height = height;
  395. result._extrudedHeight = extrudedHeight;
  396. result._cornerType = cornerType;
  397. result._granularity = granularity;
  398. result._offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
  399. return result;
  400. };
  401. /**
  402. * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
  403. *
  404. * @param {CorridorOutlineGeometry} corridorOutlineGeometry A description of the corridor.
  405. * @returns {Geometry|undefined} The computed vertices and indices.
  406. */
  407. CorridorOutlineGeometry.createGeometry = function(corridorOutlineGeometry) {
  408. var positions = corridorOutlineGeometry._positions;
  409. var width = corridorOutlineGeometry._width;
  410. var ellipsoid = corridorOutlineGeometry._ellipsoid;
  411. positions = scaleToSurface(positions, ellipsoid);
  412. var cleanPositions = arrayRemoveDuplicates.arrayRemoveDuplicates(positions, Cartesian2.Cartesian3.equalsEpsilon);
  413. if ((cleanPositions.length < 2) || (width <= 0)) {
  414. return;
  415. }
  416. var height = corridorOutlineGeometry._height;
  417. var extrudedHeight = corridorOutlineGeometry._extrudedHeight;
  418. var extrude = !_Math.CesiumMath.equalsEpsilon(height, extrudedHeight, 0, _Math.CesiumMath.EPSILON2);
  419. var params = {
  420. ellipsoid : ellipsoid,
  421. positions : cleanPositions,
  422. width : width,
  423. cornerType : corridorOutlineGeometry._cornerType,
  424. granularity : corridorOutlineGeometry._granularity,
  425. saveAttributes : false
  426. };
  427. var attr;
  428. if (extrude) {
  429. params.height = height;
  430. params.extrudedHeight = extrudedHeight;
  431. params.offsetAttribute = corridorOutlineGeometry._offsetAttribute;
  432. attr = computePositionsExtruded(params);
  433. } else {
  434. var computedPositions = CorridorGeometryLibrary.CorridorGeometryLibrary.computePositions(params);
  435. attr = combine(computedPositions, params.cornerType);
  436. attr.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(attr.attributes.position.values, height, ellipsoid);
  437. if (defined.defined(corridorOutlineGeometry._offsetAttribute)) {
  438. var length = attr.attributes.position.values.length;
  439. var applyOffset = new Uint8Array(length / 3);
  440. var offsetValue = corridorOutlineGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
  441. GeometryOffsetAttribute.arrayFill(applyOffset, offsetValue);
  442. attr.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
  443. componentDatatype : ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
  444. componentsPerAttribute : 1,
  445. values: applyOffset
  446. });
  447. }
  448. }
  449. var attributes = attr.attributes;
  450. var boundingSphere = Transforms.BoundingSphere.fromVertices(attributes.position.values, undefined, 3);
  451. return new GeometryAttribute.Geometry({
  452. attributes : attributes,
  453. indices : attr.indices,
  454. primitiveType : GeometryAttribute.PrimitiveType.LINES,
  455. boundingSphere : boundingSphere,
  456. offsetAttribute : corridorOutlineGeometry._offsetAttribute
  457. });
  458. };
  459. function createCorridorOutlineGeometry(corridorOutlineGeometry, offset) {
  460. if (defined.defined(offset)) {
  461. corridorOutlineGeometry = CorridorOutlineGeometry.unpack(corridorOutlineGeometry, offset);
  462. }
  463. corridorOutlineGeometry._ellipsoid = Cartesian2.Ellipsoid.clone(corridorOutlineGeometry._ellipsoid);
  464. return CorridorOutlineGeometry.createGeometry(corridorOutlineGeometry);
  465. }
  466. return createCorridorOutlineGeometry;
  467. });