PolygonPipeline-a3c0d57c.js 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243
  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/main/LICENSE.md for full licensing details.
  22. */
  23. define(['exports', './Matrix2-d35cf4b5', './RuntimeError-8952249c', './ComponentDatatype-9e86ac8f', './defaultValue-81eec7ed', './EllipsoidRhumbLine-d049f903', './GeometryAttribute-eeb38987', './WebGLConstants-508b9636'], (function (exports, Matrix2, RuntimeError, ComponentDatatype, defaultValue, EllipsoidRhumbLine, GeometryAttribute, WebGLConstants) { 'use strict';
  24. /* This file is automatically rebuilt by the Cesium build process. */
  25. var earcut_1 = earcut;
  26. var _default = earcut;
  27. function earcut(data, holeIndices, dim) {
  28. dim = dim || 2;
  29. var hasHoles = holeIndices && holeIndices.length,
  30. outerLen = hasHoles ? holeIndices[0] * dim : data.length,
  31. outerNode = linkedList(data, 0, outerLen, dim, true),
  32. triangles = [];
  33. if (!outerNode || outerNode.next === outerNode.prev) return triangles;
  34. var minX, minY, maxX, maxY, x, y, invSize;
  35. if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);
  36. // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox
  37. if (data.length > 80 * dim) {
  38. minX = maxX = data[0];
  39. minY = maxY = data[1];
  40. for (var i = dim; i < outerLen; i += dim) {
  41. x = data[i];
  42. y = data[i + 1];
  43. if (x < minX) minX = x;
  44. if (y < minY) minY = y;
  45. if (x > maxX) maxX = x;
  46. if (y > maxY) maxY = y;
  47. }
  48. // minX, minY and invSize are later used to transform coords into integers for z-order calculation
  49. invSize = Math.max(maxX - minX, maxY - minY);
  50. invSize = invSize !== 0 ? 1 / invSize : 0;
  51. }
  52. earcutLinked(outerNode, triangles, dim, minX, minY, invSize);
  53. return triangles;
  54. }
  55. // create a circular doubly linked list from polygon points in the specified winding order
  56. function linkedList(data, start, end, dim, clockwise) {
  57. var i, last;
  58. if (clockwise === (signedArea(data, start, end, dim) > 0)) {
  59. for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);
  60. } else {
  61. for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);
  62. }
  63. if (last && equals(last, last.next)) {
  64. removeNode(last);
  65. last = last.next;
  66. }
  67. return last;
  68. }
  69. // eliminate colinear or duplicate points
  70. function filterPoints(start, end) {
  71. if (!start) return start;
  72. if (!end) end = start;
  73. var p = start,
  74. again;
  75. do {
  76. again = false;
  77. if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {
  78. removeNode(p);
  79. p = end = p.prev;
  80. if (p === p.next) break;
  81. again = true;
  82. } else {
  83. p = p.next;
  84. }
  85. } while (again || p !== end);
  86. return end;
  87. }
  88. // main ear slicing loop which triangulates a polygon (given as a linked list)
  89. function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {
  90. if (!ear) return;
  91. // interlink polygon nodes in z-order
  92. if (!pass && invSize) indexCurve(ear, minX, minY, invSize);
  93. var stop = ear,
  94. prev, next;
  95. // iterate through ears, slicing them one by one
  96. while (ear.prev !== ear.next) {
  97. prev = ear.prev;
  98. next = ear.next;
  99. if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {
  100. // cut off the triangle
  101. triangles.push(prev.i / dim);
  102. triangles.push(ear.i / dim);
  103. triangles.push(next.i / dim);
  104. removeNode(ear);
  105. // skipping the next vertex leads to less sliver triangles
  106. ear = next.next;
  107. stop = next.next;
  108. continue;
  109. }
  110. ear = next;
  111. // if we looped through the whole remaining polygon and can't find any more ears
  112. if (ear === stop) {
  113. // try filtering points and slicing again
  114. if (!pass) {
  115. earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);
  116. // if this didn't work, try curing all small self-intersections locally
  117. } else if (pass === 1) {
  118. ear = cureLocalIntersections(filterPoints(ear), triangles, dim);
  119. earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);
  120. // as a last resort, try splitting the remaining polygon into two
  121. } else if (pass === 2) {
  122. splitEarcut(ear, triangles, dim, minX, minY, invSize);
  123. }
  124. break;
  125. }
  126. }
  127. }
  128. // check whether a polygon node forms a valid ear with adjacent nodes
  129. function isEar(ear) {
  130. var a = ear.prev,
  131. b = ear,
  132. c = ear.next;
  133. if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
  134. // now make sure we don't have other points inside the potential ear
  135. var p = ear.next.next;
  136. while (p !== ear.prev) {
  137. if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
  138. area(p.prev, p, p.next) >= 0) return false;
  139. p = p.next;
  140. }
  141. return true;
  142. }
  143. function isEarHashed(ear, minX, minY, invSize) {
  144. var a = ear.prev,
  145. b = ear,
  146. c = ear.next;
  147. if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
  148. // triangle bbox; min & max are calculated like this for speed
  149. var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),
  150. minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),
  151. maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),
  152. maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);
  153. // z-order range for the current triangle bbox;
  154. var minZ = zOrder(minTX, minTY, minX, minY, invSize),
  155. maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);
  156. var p = ear.prevZ,
  157. n = ear.nextZ;
  158. // look for points inside the triangle in both directions
  159. while (p && p.z >= minZ && n && n.z <= maxZ) {
  160. if (p !== ear.prev && p !== ear.next &&
  161. pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
  162. area(p.prev, p, p.next) >= 0) return false;
  163. p = p.prevZ;
  164. if (n !== ear.prev && n !== ear.next &&
  165. pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&
  166. area(n.prev, n, n.next) >= 0) return false;
  167. n = n.nextZ;
  168. }
  169. // look for remaining points in decreasing z-order
  170. while (p && p.z >= minZ) {
  171. if (p !== ear.prev && p !== ear.next &&
  172. pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
  173. area(p.prev, p, p.next) >= 0) return false;
  174. p = p.prevZ;
  175. }
  176. // look for remaining points in increasing z-order
  177. while (n && n.z <= maxZ) {
  178. if (n !== ear.prev && n !== ear.next &&
  179. pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&
  180. area(n.prev, n, n.next) >= 0) return false;
  181. n = n.nextZ;
  182. }
  183. return true;
  184. }
  185. // go through all polygon nodes and cure small local self-intersections
  186. function cureLocalIntersections(start, triangles, dim) {
  187. var p = start;
  188. do {
  189. var a = p.prev,
  190. b = p.next.next;
  191. if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {
  192. triangles.push(a.i / dim);
  193. triangles.push(p.i / dim);
  194. triangles.push(b.i / dim);
  195. // remove two nodes involved
  196. removeNode(p);
  197. removeNode(p.next);
  198. p = start = b;
  199. }
  200. p = p.next;
  201. } while (p !== start);
  202. return filterPoints(p);
  203. }
  204. // try splitting polygon into two and triangulate them independently
  205. function splitEarcut(start, triangles, dim, minX, minY, invSize) {
  206. // look for a valid diagonal that divides the polygon into two
  207. var a = start;
  208. do {
  209. var b = a.next.next;
  210. while (b !== a.prev) {
  211. if (a.i !== b.i && isValidDiagonal(a, b)) {
  212. // split the polygon in two by the diagonal
  213. var c = splitPolygon(a, b);
  214. // filter colinear points around the cuts
  215. a = filterPoints(a, a.next);
  216. c = filterPoints(c, c.next);
  217. // run earcut on each half
  218. earcutLinked(a, triangles, dim, minX, minY, invSize);
  219. earcutLinked(c, triangles, dim, minX, minY, invSize);
  220. return;
  221. }
  222. b = b.next;
  223. }
  224. a = a.next;
  225. } while (a !== start);
  226. }
  227. // link every hole into the outer loop, producing a single-ring polygon without holes
  228. function eliminateHoles(data, holeIndices, outerNode, dim) {
  229. var queue = [],
  230. i, len, start, end, list;
  231. for (i = 0, len = holeIndices.length; i < len; i++) {
  232. start = holeIndices[i] * dim;
  233. end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
  234. list = linkedList(data, start, end, dim, false);
  235. if (list === list.next) list.steiner = true;
  236. queue.push(getLeftmost(list));
  237. }
  238. queue.sort(compareX);
  239. // process holes from left to right
  240. for (i = 0; i < queue.length; i++) {
  241. outerNode = eliminateHole(queue[i], outerNode);
  242. outerNode = filterPoints(outerNode, outerNode.next);
  243. }
  244. return outerNode;
  245. }
  246. function compareX(a, b) {
  247. return a.x - b.x;
  248. }
  249. // find a bridge between vertices that connects hole with an outer ring and and link it
  250. function eliminateHole(hole, outerNode) {
  251. var bridge = findHoleBridge(hole, outerNode);
  252. if (!bridge) {
  253. return outerNode;
  254. }
  255. var bridgeReverse = splitPolygon(bridge, hole);
  256. // filter collinear points around the cuts
  257. var filteredBridge = filterPoints(bridge, bridge.next);
  258. filterPoints(bridgeReverse, bridgeReverse.next);
  259. // Check if input node was removed by the filtering
  260. return outerNode === bridge ? filteredBridge : outerNode;
  261. }
  262. // David Eberly's algorithm for finding a bridge between hole and outer polygon
  263. function findHoleBridge(hole, outerNode) {
  264. var p = outerNode,
  265. hx = hole.x,
  266. hy = hole.y,
  267. qx = -Infinity,
  268. m;
  269. // find a segment intersected by a ray from the hole's leftmost point to the left;
  270. // segment's endpoint with lesser x will be potential connection point
  271. do {
  272. if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {
  273. var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
  274. if (x <= hx && x > qx) {
  275. qx = x;
  276. if (x === hx) {
  277. if (hy === p.y) return p;
  278. if (hy === p.next.y) return p.next;
  279. }
  280. m = p.x < p.next.x ? p : p.next;
  281. }
  282. }
  283. p = p.next;
  284. } while (p !== outerNode);
  285. if (!m) return null;
  286. if (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint
  287. // look for points inside the triangle of hole point, segment intersection and endpoint;
  288. // if there are no points found, we have a valid connection;
  289. // otherwise choose the point of the minimum angle with the ray as connection point
  290. var stop = m,
  291. mx = m.x,
  292. my = m.y,
  293. tanMin = Infinity,
  294. tan;
  295. p = m;
  296. do {
  297. if (hx >= p.x && p.x >= mx && hx !== p.x &&
  298. pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {
  299. tan = Math.abs(hy - p.y) / (hx - p.x); // tangential
  300. if (locallyInside(p, hole) &&
  301. (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {
  302. m = p;
  303. tanMin = tan;
  304. }
  305. }
  306. p = p.next;
  307. } while (p !== stop);
  308. return m;
  309. }
  310. // whether sector in vertex m contains sector in vertex p in the same coordinates
  311. function sectorContainsSector(m, p) {
  312. return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;
  313. }
  314. // interlink polygon nodes in z-order
  315. function indexCurve(start, minX, minY, invSize) {
  316. var p = start;
  317. do {
  318. if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);
  319. p.prevZ = p.prev;
  320. p.nextZ = p.next;
  321. p = p.next;
  322. } while (p !== start);
  323. p.prevZ.nextZ = null;
  324. p.prevZ = null;
  325. sortLinked(p);
  326. }
  327. // Simon Tatham's linked list merge sort algorithm
  328. // http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html
  329. function sortLinked(list) {
  330. var i, p, q, e, tail, numMerges, pSize, qSize,
  331. inSize = 1;
  332. do {
  333. p = list;
  334. list = null;
  335. tail = null;
  336. numMerges = 0;
  337. while (p) {
  338. numMerges++;
  339. q = p;
  340. pSize = 0;
  341. for (i = 0; i < inSize; i++) {
  342. pSize++;
  343. q = q.nextZ;
  344. if (!q) break;
  345. }
  346. qSize = inSize;
  347. while (pSize > 0 || (qSize > 0 && q)) {
  348. if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {
  349. e = p;
  350. p = p.nextZ;
  351. pSize--;
  352. } else {
  353. e = q;
  354. q = q.nextZ;
  355. qSize--;
  356. }
  357. if (tail) tail.nextZ = e;
  358. else list = e;
  359. e.prevZ = tail;
  360. tail = e;
  361. }
  362. p = q;
  363. }
  364. tail.nextZ = null;
  365. inSize *= 2;
  366. } while (numMerges > 1);
  367. return list;
  368. }
  369. // z-order of a point given coords and inverse of the longer side of data bbox
  370. function zOrder(x, y, minX, minY, invSize) {
  371. // coords are transformed into non-negative 15-bit integer range
  372. x = 32767 * (x - minX) * invSize;
  373. y = 32767 * (y - minY) * invSize;
  374. x = (x | (x << 8)) & 0x00FF00FF;
  375. x = (x | (x << 4)) & 0x0F0F0F0F;
  376. x = (x | (x << 2)) & 0x33333333;
  377. x = (x | (x << 1)) & 0x55555555;
  378. y = (y | (y << 8)) & 0x00FF00FF;
  379. y = (y | (y << 4)) & 0x0F0F0F0F;
  380. y = (y | (y << 2)) & 0x33333333;
  381. y = (y | (y << 1)) & 0x55555555;
  382. return x | (y << 1);
  383. }
  384. // find the leftmost node of a polygon ring
  385. function getLeftmost(start) {
  386. var p = start,
  387. leftmost = start;
  388. do {
  389. if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;
  390. p = p.next;
  391. } while (p !== start);
  392. return leftmost;
  393. }
  394. // check if a point lies within a convex triangle
  395. function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
  396. return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&
  397. (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&
  398. (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;
  399. }
  400. // check if a diagonal between two polygon nodes is valid (lies in polygon interior)
  401. function isValidDiagonal(a, b) {
  402. return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges
  403. (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible
  404. (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
  405. equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case
  406. }
  407. // signed area of a triangle
  408. function area(p, q, r) {
  409. return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
  410. }
  411. // check if two points are equal
  412. function equals(p1, p2) {
  413. return p1.x === p2.x && p1.y === p2.y;
  414. }
  415. // check if two segments intersect
  416. function intersects(p1, q1, p2, q2) {
  417. var o1 = sign(area(p1, q1, p2));
  418. var o2 = sign(area(p1, q1, q2));
  419. var o3 = sign(area(p2, q2, p1));
  420. var o4 = sign(area(p2, q2, q1));
  421. if (o1 !== o2 && o3 !== o4) return true; // general case
  422. if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1
  423. if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1
  424. if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2
  425. if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2
  426. return false;
  427. }
  428. // for collinear points p, q, r, check if point q lies on segment pr
  429. function onSegment(p, q, r) {
  430. return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);
  431. }
  432. function sign(num) {
  433. return num > 0 ? 1 : num < 0 ? -1 : 0;
  434. }
  435. // check if a polygon diagonal intersects any polygon segments
  436. function intersectsPolygon(a, b) {
  437. var p = a;
  438. do {
  439. if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&
  440. intersects(p, p.next, a, b)) return true;
  441. p = p.next;
  442. } while (p !== a);
  443. return false;
  444. }
  445. // check if a polygon diagonal is locally inside the polygon
  446. function locallyInside(a, b) {
  447. return area(a.prev, a, a.next) < 0 ?
  448. area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :
  449. area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;
  450. }
  451. // check if the middle point of a polygon diagonal is inside the polygon
  452. function middleInside(a, b) {
  453. var p = a,
  454. inside = false,
  455. px = (a.x + b.x) / 2,
  456. py = (a.y + b.y) / 2;
  457. do {
  458. if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&
  459. (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))
  460. inside = !inside;
  461. p = p.next;
  462. } while (p !== a);
  463. return inside;
  464. }
  465. // link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;
  466. // if one belongs to the outer ring and another to a hole, it merges it into a single ring
  467. function splitPolygon(a, b) {
  468. var a2 = new Node(a.i, a.x, a.y),
  469. b2 = new Node(b.i, b.x, b.y),
  470. an = a.next,
  471. bp = b.prev;
  472. a.next = b;
  473. b.prev = a;
  474. a2.next = an;
  475. an.prev = a2;
  476. b2.next = a2;
  477. a2.prev = b2;
  478. bp.next = b2;
  479. b2.prev = bp;
  480. return b2;
  481. }
  482. // create a node and optionally link it with previous one (in a circular doubly linked list)
  483. function insertNode(i, x, y, last) {
  484. var p = new Node(i, x, y);
  485. if (!last) {
  486. p.prev = p;
  487. p.next = p;
  488. } else {
  489. p.next = last.next;
  490. p.prev = last;
  491. last.next.prev = p;
  492. last.next = p;
  493. }
  494. return p;
  495. }
  496. function removeNode(p) {
  497. p.next.prev = p.prev;
  498. p.prev.next = p.next;
  499. if (p.prevZ) p.prevZ.nextZ = p.nextZ;
  500. if (p.nextZ) p.nextZ.prevZ = p.prevZ;
  501. }
  502. function Node(i, x, y) {
  503. // vertex index in coordinates array
  504. this.i = i;
  505. // vertex coordinates
  506. this.x = x;
  507. this.y = y;
  508. // previous and next vertex nodes in a polygon ring
  509. this.prev = null;
  510. this.next = null;
  511. // z-order curve value
  512. this.z = null;
  513. // previous and next nodes in z-order
  514. this.prevZ = null;
  515. this.nextZ = null;
  516. // indicates whether this is a steiner point
  517. this.steiner = false;
  518. }
  519. // return a percentage difference between the polygon area and its triangulation area;
  520. // used to verify correctness of triangulation
  521. earcut.deviation = function (data, holeIndices, dim, triangles) {
  522. var hasHoles = holeIndices && holeIndices.length;
  523. var outerLen = hasHoles ? holeIndices[0] * dim : data.length;
  524. var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));
  525. if (hasHoles) {
  526. for (var i = 0, len = holeIndices.length; i < len; i++) {
  527. var start = holeIndices[i] * dim;
  528. var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
  529. polygonArea -= Math.abs(signedArea(data, start, end, dim));
  530. }
  531. }
  532. var trianglesArea = 0;
  533. for (i = 0; i < triangles.length; i += 3) {
  534. var a = triangles[i] * dim;
  535. var b = triangles[i + 1] * dim;
  536. var c = triangles[i + 2] * dim;
  537. trianglesArea += Math.abs(
  538. (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -
  539. (data[a] - data[b]) * (data[c + 1] - data[a + 1]));
  540. }
  541. return polygonArea === 0 && trianglesArea === 0 ? 0 :
  542. Math.abs((trianglesArea - polygonArea) / polygonArea);
  543. };
  544. function signedArea(data, start, end, dim) {
  545. var sum = 0;
  546. for (var i = start, j = end - dim; i < end; i += dim) {
  547. sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);
  548. j = i;
  549. }
  550. return sum;
  551. }
  552. // turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts
  553. earcut.flatten = function (data) {
  554. var dim = data[0][0].length,
  555. result = {vertices: [], holes: [], dimensions: dim},
  556. holeIndex = 0;
  557. for (var i = 0; i < data.length; i++) {
  558. for (var j = 0; j < data[i].length; j++) {
  559. for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);
  560. }
  561. if (i > 0) {
  562. holeIndex += data[i - 1].length;
  563. result.holes.push(holeIndex);
  564. }
  565. }
  566. return result;
  567. };
  568. earcut_1.default = _default;
  569. /**
  570. * Winding order defines the order of vertices for a triangle to be considered front-facing.
  571. *
  572. * @enum {Number}
  573. */
  574. const WindingOrder = {
  575. /**
  576. * Vertices are in clockwise order.
  577. *
  578. * @type {Number}
  579. * @constant
  580. */
  581. CLOCKWISE: WebGLConstants.WebGLConstants.CW,
  582. /**
  583. * Vertices are in counter-clockwise order.
  584. *
  585. * @type {Number}
  586. * @constant
  587. */
  588. COUNTER_CLOCKWISE: WebGLConstants.WebGLConstants.CCW,
  589. };
  590. /**
  591. * @private
  592. */
  593. WindingOrder.validate = function (windingOrder) {
  594. return (
  595. windingOrder === WindingOrder.CLOCKWISE ||
  596. windingOrder === WindingOrder.COUNTER_CLOCKWISE
  597. );
  598. };
  599. var WindingOrder$1 = Object.freeze(WindingOrder);
  600. const scaleToGeodeticHeightN = new Matrix2.Cartesian3();
  601. const scaleToGeodeticHeightP = new Matrix2.Cartesian3();
  602. /**
  603. * @private
  604. */
  605. const PolygonPipeline = {};
  606. /**
  607. * @exception {DeveloperError} At least three positions are required.
  608. */
  609. PolygonPipeline.computeArea2D = function (positions) {
  610. //>>includeStart('debug', pragmas.debug);
  611. RuntimeError.Check.defined("positions", positions);
  612. RuntimeError.Check.typeOf.number.greaterThanOrEquals(
  613. "positions.length",
  614. positions.length,
  615. 3
  616. );
  617. //>>includeEnd('debug');
  618. const length = positions.length;
  619. let area = 0.0;
  620. for (let i0 = length - 1, i1 = 0; i1 < length; i0 = i1++) {
  621. const v0 = positions[i0];
  622. const v1 = positions[i1];
  623. area += v0.x * v1.y - v1.x * v0.y;
  624. }
  625. return area * 0.5;
  626. };
  627. /**
  628. * @returns {WindingOrder} The winding order.
  629. *
  630. * @exception {DeveloperError} At least three positions are required.
  631. */
  632. PolygonPipeline.computeWindingOrder2D = function (positions) {
  633. const area = PolygonPipeline.computeArea2D(positions);
  634. return area > 0.0 ? WindingOrder$1.COUNTER_CLOCKWISE : WindingOrder$1.CLOCKWISE;
  635. };
  636. /**
  637. * Triangulate a polygon.
  638. *
  639. * @param {Cartesian2[]} positions Cartesian2 array containing the vertices of the polygon
  640. * @param {Number[]} [holes] An array of the staring indices of the holes.
  641. * @returns {Number[]} Index array representing triangles that fill the polygon
  642. */
  643. PolygonPipeline.triangulate = function (positions, holes) {
  644. //>>includeStart('debug', pragmas.debug);
  645. RuntimeError.Check.defined("positions", positions);
  646. //>>includeEnd('debug');
  647. const flattenedPositions = Matrix2.Cartesian2.packArray(positions);
  648. return earcut_1(flattenedPositions, holes, 2);
  649. };
  650. const subdivisionV0Scratch = new Matrix2.Cartesian3();
  651. const subdivisionV1Scratch = new Matrix2.Cartesian3();
  652. const subdivisionV2Scratch = new Matrix2.Cartesian3();
  653. const subdivisionS0Scratch = new Matrix2.Cartesian3();
  654. const subdivisionS1Scratch = new Matrix2.Cartesian3();
  655. const subdivisionS2Scratch = new Matrix2.Cartesian3();
  656. const subdivisionMidScratch = new Matrix2.Cartesian3();
  657. /**
  658. * Subdivides positions and raises points to the surface of the ellipsoid.
  659. *
  660. * @param {Ellipsoid} ellipsoid The ellipsoid the polygon in on.
  661. * @param {Cartesian3[]} positions An array of {@link Cartesian3} positions of the polygon.
  662. * @param {Number[]} indices An array of indices that determines the triangles in the polygon.
  663. * @param {Number} [granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  664. *
  665. * @exception {DeveloperError} At least three indices are required.
  666. * @exception {DeveloperError} The number of indices must be divisable by three.
  667. * @exception {DeveloperError} Granularity must be greater than zero.
  668. */
  669. PolygonPipeline.computeSubdivision = function (
  670. ellipsoid,
  671. positions,
  672. indices,
  673. granularity
  674. ) {
  675. granularity = defaultValue.defaultValue(granularity, ComponentDatatype.CesiumMath.RADIANS_PER_DEGREE);
  676. //>>includeStart('debug', pragmas.debug);
  677. RuntimeError.Check.typeOf.object("ellipsoid", ellipsoid);
  678. RuntimeError.Check.defined("positions", positions);
  679. RuntimeError.Check.defined("indices", indices);
  680. RuntimeError.Check.typeOf.number.greaterThanOrEquals("indices.length", indices.length, 3);
  681. RuntimeError.Check.typeOf.number.equals("indices.length % 3", "0", indices.length % 3, 0);
  682. RuntimeError.Check.typeOf.number.greaterThan("granularity", granularity, 0.0);
  683. //>>includeEnd('debug');
  684. // triangles that need (or might need) to be subdivided.
  685. const triangles = indices.slice(0);
  686. // New positions due to edge splits are appended to the positions list.
  687. let i;
  688. const length = positions.length;
  689. const subdividedPositions = new Array(length * 3);
  690. let q = 0;
  691. for (i = 0; i < length; i++) {
  692. const item = positions[i];
  693. subdividedPositions[q++] = item.x;
  694. subdividedPositions[q++] = item.y;
  695. subdividedPositions[q++] = item.z;
  696. }
  697. const subdividedIndices = [];
  698. // Used to make sure shared edges are not split more than once.
  699. const edges = {};
  700. const radius = ellipsoid.maximumRadius;
  701. const minDistance = ComponentDatatype.CesiumMath.chordLength(granularity, radius);
  702. const minDistanceSqrd = minDistance * minDistance;
  703. while (triangles.length > 0) {
  704. const i2 = triangles.pop();
  705. const i1 = triangles.pop();
  706. const i0 = triangles.pop();
  707. const v0 = Matrix2.Cartesian3.fromArray(
  708. subdividedPositions,
  709. i0 * 3,
  710. subdivisionV0Scratch
  711. );
  712. const v1 = Matrix2.Cartesian3.fromArray(
  713. subdividedPositions,
  714. i1 * 3,
  715. subdivisionV1Scratch
  716. );
  717. const v2 = Matrix2.Cartesian3.fromArray(
  718. subdividedPositions,
  719. i2 * 3,
  720. subdivisionV2Scratch
  721. );
  722. const s0 = Matrix2.Cartesian3.multiplyByScalar(
  723. Matrix2.Cartesian3.normalize(v0, subdivisionS0Scratch),
  724. radius,
  725. subdivisionS0Scratch
  726. );
  727. const s1 = Matrix2.Cartesian3.multiplyByScalar(
  728. Matrix2.Cartesian3.normalize(v1, subdivisionS1Scratch),
  729. radius,
  730. subdivisionS1Scratch
  731. );
  732. const s2 = Matrix2.Cartesian3.multiplyByScalar(
  733. Matrix2.Cartesian3.normalize(v2, subdivisionS2Scratch),
  734. radius,
  735. subdivisionS2Scratch
  736. );
  737. const g0 = Matrix2.Cartesian3.magnitudeSquared(
  738. Matrix2.Cartesian3.subtract(s0, s1, subdivisionMidScratch)
  739. );
  740. const g1 = Matrix2.Cartesian3.magnitudeSquared(
  741. Matrix2.Cartesian3.subtract(s1, s2, subdivisionMidScratch)
  742. );
  743. const g2 = Matrix2.Cartesian3.magnitudeSquared(
  744. Matrix2.Cartesian3.subtract(s2, s0, subdivisionMidScratch)
  745. );
  746. const max = Math.max(g0, g1, g2);
  747. let edge;
  748. let mid;
  749. // if the max length squared of a triangle edge is greater than the chord length of squared
  750. // of the granularity, subdivide the triangle
  751. if (max > minDistanceSqrd) {
  752. if (g0 === max) {
  753. edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;
  754. i = edges[edge];
  755. if (!defaultValue.defined(i)) {
  756. mid = Matrix2.Cartesian3.add(v0, v1, subdivisionMidScratch);
  757. Matrix2.Cartesian3.multiplyByScalar(mid, 0.5, mid);
  758. subdividedPositions.push(mid.x, mid.y, mid.z);
  759. i = subdividedPositions.length / 3 - 1;
  760. edges[edge] = i;
  761. }
  762. triangles.push(i0, i, i2);
  763. triangles.push(i, i1, i2);
  764. } else if (g1 === max) {
  765. edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;
  766. i = edges[edge];
  767. if (!defaultValue.defined(i)) {
  768. mid = Matrix2.Cartesian3.add(v1, v2, subdivisionMidScratch);
  769. Matrix2.Cartesian3.multiplyByScalar(mid, 0.5, mid);
  770. subdividedPositions.push(mid.x, mid.y, mid.z);
  771. i = subdividedPositions.length / 3 - 1;
  772. edges[edge] = i;
  773. }
  774. triangles.push(i1, i, i0);
  775. triangles.push(i, i2, i0);
  776. } else if (g2 === max) {
  777. edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;
  778. i = edges[edge];
  779. if (!defaultValue.defined(i)) {
  780. mid = Matrix2.Cartesian3.add(v2, v0, subdivisionMidScratch);
  781. Matrix2.Cartesian3.multiplyByScalar(mid, 0.5, mid);
  782. subdividedPositions.push(mid.x, mid.y, mid.z);
  783. i = subdividedPositions.length / 3 - 1;
  784. edges[edge] = i;
  785. }
  786. triangles.push(i2, i, i1);
  787. triangles.push(i, i0, i1);
  788. }
  789. } else {
  790. subdividedIndices.push(i0);
  791. subdividedIndices.push(i1);
  792. subdividedIndices.push(i2);
  793. }
  794. }
  795. return new GeometryAttribute.Geometry({
  796. attributes: {
  797. position: new GeometryAttribute.GeometryAttribute({
  798. componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
  799. componentsPerAttribute: 3,
  800. values: subdividedPositions,
  801. }),
  802. },
  803. indices: subdividedIndices,
  804. primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
  805. });
  806. };
  807. const subdivisionC0Scratch = new Matrix2.Cartographic();
  808. const subdivisionC1Scratch = new Matrix2.Cartographic();
  809. const subdivisionC2Scratch = new Matrix2.Cartographic();
  810. const subdivisionCartographicScratch = new Matrix2.Cartographic();
  811. /**
  812. * Subdivides positions on rhumb lines and raises points to the surface of the ellipsoid.
  813. *
  814. * @param {Ellipsoid} ellipsoid The ellipsoid the polygon in on.
  815. * @param {Cartesian3[]} positions An array of {@link Cartesian3} positions of the polygon.
  816. * @param {Number[]} indices An array of indices that determines the triangles in the polygon.
  817. * @param {Number} [granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  818. *
  819. * @exception {DeveloperError} At least three indices are required.
  820. * @exception {DeveloperError} The number of indices must be divisable by three.
  821. * @exception {DeveloperError} Granularity must be greater than zero.
  822. */
  823. PolygonPipeline.computeRhumbLineSubdivision = function (
  824. ellipsoid,
  825. positions,
  826. indices,
  827. granularity
  828. ) {
  829. granularity = defaultValue.defaultValue(granularity, ComponentDatatype.CesiumMath.RADIANS_PER_DEGREE);
  830. //>>includeStart('debug', pragmas.debug);
  831. RuntimeError.Check.typeOf.object("ellipsoid", ellipsoid);
  832. RuntimeError.Check.defined("positions", positions);
  833. RuntimeError.Check.defined("indices", indices);
  834. RuntimeError.Check.typeOf.number.greaterThanOrEquals("indices.length", indices.length, 3);
  835. RuntimeError.Check.typeOf.number.equals("indices.length % 3", "0", indices.length % 3, 0);
  836. RuntimeError.Check.typeOf.number.greaterThan("granularity", granularity, 0.0);
  837. //>>includeEnd('debug');
  838. // triangles that need (or might need) to be subdivided.
  839. const triangles = indices.slice(0);
  840. // New positions due to edge splits are appended to the positions list.
  841. let i;
  842. const length = positions.length;
  843. const subdividedPositions = new Array(length * 3);
  844. let q = 0;
  845. for (i = 0; i < length; i++) {
  846. const item = positions[i];
  847. subdividedPositions[q++] = item.x;
  848. subdividedPositions[q++] = item.y;
  849. subdividedPositions[q++] = item.z;
  850. }
  851. const subdividedIndices = [];
  852. // Used to make sure shared edges are not split more than once.
  853. const edges = {};
  854. const radius = ellipsoid.maximumRadius;
  855. const minDistance = ComponentDatatype.CesiumMath.chordLength(granularity, radius);
  856. const rhumb0 = new EllipsoidRhumbLine.EllipsoidRhumbLine(undefined, undefined, ellipsoid);
  857. const rhumb1 = new EllipsoidRhumbLine.EllipsoidRhumbLine(undefined, undefined, ellipsoid);
  858. const rhumb2 = new EllipsoidRhumbLine.EllipsoidRhumbLine(undefined, undefined, ellipsoid);
  859. while (triangles.length > 0) {
  860. const i2 = triangles.pop();
  861. const i1 = triangles.pop();
  862. const i0 = triangles.pop();
  863. const v0 = Matrix2.Cartesian3.fromArray(
  864. subdividedPositions,
  865. i0 * 3,
  866. subdivisionV0Scratch
  867. );
  868. const v1 = Matrix2.Cartesian3.fromArray(
  869. subdividedPositions,
  870. i1 * 3,
  871. subdivisionV1Scratch
  872. );
  873. const v2 = Matrix2.Cartesian3.fromArray(
  874. subdividedPositions,
  875. i2 * 3,
  876. subdivisionV2Scratch
  877. );
  878. const c0 = ellipsoid.cartesianToCartographic(v0, subdivisionC0Scratch);
  879. const c1 = ellipsoid.cartesianToCartographic(v1, subdivisionC1Scratch);
  880. const c2 = ellipsoid.cartesianToCartographic(v2, subdivisionC2Scratch);
  881. rhumb0.setEndPoints(c0, c1);
  882. const g0 = rhumb0.surfaceDistance;
  883. rhumb1.setEndPoints(c1, c2);
  884. const g1 = rhumb1.surfaceDistance;
  885. rhumb2.setEndPoints(c2, c0);
  886. const g2 = rhumb2.surfaceDistance;
  887. const max = Math.max(g0, g1, g2);
  888. let edge;
  889. let mid;
  890. let midHeight;
  891. let midCartesian3;
  892. // if the max length squared of a triangle edge is greater than granularity, subdivide the triangle
  893. if (max > minDistance) {
  894. if (g0 === max) {
  895. edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;
  896. i = edges[edge];
  897. if (!defaultValue.defined(i)) {
  898. mid = rhumb0.interpolateUsingFraction(
  899. 0.5,
  900. subdivisionCartographicScratch
  901. );
  902. midHeight = (c0.height + c1.height) * 0.5;
  903. midCartesian3 = Matrix2.Cartesian3.fromRadians(
  904. mid.longitude,
  905. mid.latitude,
  906. midHeight,
  907. ellipsoid,
  908. subdivisionMidScratch
  909. );
  910. subdividedPositions.push(
  911. midCartesian3.x,
  912. midCartesian3.y,
  913. midCartesian3.z
  914. );
  915. i = subdividedPositions.length / 3 - 1;
  916. edges[edge] = i;
  917. }
  918. triangles.push(i0, i, i2);
  919. triangles.push(i, i1, i2);
  920. } else if (g1 === max) {
  921. edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;
  922. i = edges[edge];
  923. if (!defaultValue.defined(i)) {
  924. mid = rhumb1.interpolateUsingFraction(
  925. 0.5,
  926. subdivisionCartographicScratch
  927. );
  928. midHeight = (c1.height + c2.height) * 0.5;
  929. midCartesian3 = Matrix2.Cartesian3.fromRadians(
  930. mid.longitude,
  931. mid.latitude,
  932. midHeight,
  933. ellipsoid,
  934. subdivisionMidScratch
  935. );
  936. subdividedPositions.push(
  937. midCartesian3.x,
  938. midCartesian3.y,
  939. midCartesian3.z
  940. );
  941. i = subdividedPositions.length / 3 - 1;
  942. edges[edge] = i;
  943. }
  944. triangles.push(i1, i, i0);
  945. triangles.push(i, i2, i0);
  946. } else if (g2 === max) {
  947. edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;
  948. i = edges[edge];
  949. if (!defaultValue.defined(i)) {
  950. mid = rhumb2.interpolateUsingFraction(
  951. 0.5,
  952. subdivisionCartographicScratch
  953. );
  954. midHeight = (c2.height + c0.height) * 0.5;
  955. midCartesian3 = Matrix2.Cartesian3.fromRadians(
  956. mid.longitude,
  957. mid.latitude,
  958. midHeight,
  959. ellipsoid,
  960. subdivisionMidScratch
  961. );
  962. subdividedPositions.push(
  963. midCartesian3.x,
  964. midCartesian3.y,
  965. midCartesian3.z
  966. );
  967. i = subdividedPositions.length / 3 - 1;
  968. edges[edge] = i;
  969. }
  970. triangles.push(i2, i, i1);
  971. triangles.push(i, i0, i1);
  972. }
  973. } else {
  974. subdividedIndices.push(i0);
  975. subdividedIndices.push(i1);
  976. subdividedIndices.push(i2);
  977. }
  978. }
  979. return new GeometryAttribute.Geometry({
  980. attributes: {
  981. position: new GeometryAttribute.GeometryAttribute({
  982. componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
  983. componentsPerAttribute: 3,
  984. values: subdividedPositions,
  985. }),
  986. },
  987. indices: subdividedIndices,
  988. primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
  989. });
  990. };
  991. /**
  992. * Scales each position of a geometry's position attribute to a height, in place.
  993. *
  994. * @param {Number[]} positions The array of numbers representing the positions to be scaled
  995. * @param {Number} [height=0.0] The desired height to add to the positions
  996. * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.
  997. * @param {Boolean} [scaleToSurface=true] <code>true</code> if the positions need to be scaled to the surface before the height is added.
  998. * @returns {Number[]} The input array of positions, scaled to height
  999. */
  1000. PolygonPipeline.scaleToGeodeticHeight = function (
  1001. positions,
  1002. height,
  1003. ellipsoid,
  1004. scaleToSurface
  1005. ) {
  1006. ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix2.Ellipsoid.WGS84);
  1007. let n = scaleToGeodeticHeightN;
  1008. let p = scaleToGeodeticHeightP;
  1009. height = defaultValue.defaultValue(height, 0.0);
  1010. scaleToSurface = defaultValue.defaultValue(scaleToSurface, true);
  1011. if (defaultValue.defined(positions)) {
  1012. const length = positions.length;
  1013. for (let i = 0; i < length; i += 3) {
  1014. Matrix2.Cartesian3.fromArray(positions, i, p);
  1015. if (scaleToSurface) {
  1016. p = ellipsoid.scaleToGeodeticSurface(p, p);
  1017. }
  1018. if (height !== 0) {
  1019. n = ellipsoid.geodeticSurfaceNormal(p, n);
  1020. Matrix2.Cartesian3.multiplyByScalar(n, height, n);
  1021. Matrix2.Cartesian3.add(p, n, p);
  1022. }
  1023. positions[i] = p.x;
  1024. positions[i + 1] = p.y;
  1025. positions[i + 2] = p.z;
  1026. }
  1027. }
  1028. return positions;
  1029. };
  1030. exports.PolygonPipeline = PolygonPipeline;
  1031. exports.WindingOrder = WindingOrder$1;
  1032. }));
  1033. //# sourceMappingURL=PolygonPipeline-a3c0d57c.js.map