DrawGatheringPlace.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. import {
  2. createTooltip
  3. } from "../../../common/common.js";
  4. import {
  5. isRuntimeApp,
  6. isRuntimeWeb,
  7. createOperationMainDom,
  8. showTooltipMessage
  9. } from "../../../common/RuntimeEnvironment.js";
  10. /*
  11. 九、绘制集结地
  12. */
  13. class DrawGatheringPlace {
  14. constructor(arg) {
  15. this.viewer = arg.viewer;
  16. this.Cesium = arg.Cesium;
  17. this.tt = 0.4;
  18. this.floatingPoint = null; //标识点
  19. this.drawHandler = null; //画事件
  20. this.gatheringPlace = null; //集结地
  21. this._gatheringPlaceLast = null; //最后一个箭头
  22. this._positions = []; //活动点
  23. this._entities_point = []; //脏数据
  24. this._entities_PincerArrow = []; //脏数据
  25. this._gatheringPlaceData = null; //用于构造集结地
  26. this.DrawStartEvent = new Cesium.Event(); //开始绘制事件
  27. this.DrawEndEvent = new Cesium.Event(); //结束绘制事件
  28. this._tooltip = createTooltip(this.viewer.container);
  29. /* 通用参数集合 */
  30. this._param = {
  31. id: "DrawStraightArrow",
  32. polygonColor: 'rgba(0,255,0,0.5)', //面填充颜色
  33. outlineColor: 'rgba(255, 255, 255, 1)', //边框颜色
  34. outlineWidth: 1, //边框宽度
  35. }
  36. /* 创建面材质 */
  37. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  38. /* 创建线材质 */
  39. // this.outlineMaterial = new Cesium.PolylineDashMaterialProperty({//曲线
  40. // dashLength: 16,
  41. // color: Cesium.Color.fromCssColorString(this._param.outlineColor)
  42. // });
  43. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  44. }
  45. //返回箭头
  46. get PincerArrow() {
  47. return this._gatheringPlaceLast;
  48. }
  49. //返回箭头数据用于加载箭头
  50. getData() {
  51. return this._gatheringPlaceData;
  52. }
  53. // 修改编辑调用计算
  54. computePosition(data) {
  55. var $this = this;
  56. if (data.length < 3) {
  57. return;
  58. }
  59. var gatheringPlace = [];
  60. var lonLats = [];
  61. var res = $this.fineGatheringPlace(data);
  62. for (var i = 0; i < res.length; i++) {
  63. var cart3 = new $this.Cesium.Cartesian3(res[i].x, res[i].y, res[i].z);
  64. gatheringPlace.push(cart3);
  65. }
  66. for (let q = 0; q < data.length; q++) {
  67. lonLats.push($this.cartesianToLatlng(data[q]));
  68. }
  69. this._gatheringPlaceData = lonLats;
  70. return new $this.Cesium.PolygonHierarchy(gatheringPlace);
  71. }
  72. //加载箭头
  73. addload(data) {
  74. var $this = this;
  75. if (data.length < 3) {
  76. return;
  77. }
  78. var gatheringPlace = [];
  79. var lnglatArr = [];
  80. for (var i = 0; i < data.length; i++) {
  81. var lnglat = $this.LatlngTocartesian(data[i]);
  82. lnglatArr.push(lnglat)
  83. }
  84. var res = $this.fineGatheringPlace(lnglatArr);
  85. for (var i = 0; i < res.length; i++) {
  86. var cart3 = new $this.Cesium.Cartesian3(res[i].x, res[i].y, res[i].z);
  87. gatheringPlace.push(cart3);
  88. }
  89. var pHierarchy = new $this.Cesium.PolygonHierarchy(gatheringPlace);
  90. var arrowEntity = $this.viewer.entities.add({
  91. Type: 'DrawGatheringPlace',
  92. Position: data,
  93. id: data.id || $this.objId,
  94. polygon: {
  95. hierarchy: pHierarchy,
  96. show: true,
  97. fill: true,
  98. clampToGround: true,
  99. material: $this.polygonMaterial
  100. }
  101. })
  102. return arrowEntity
  103. }
  104. // 开始创建
  105. startCreate(drawType) {
  106. if (isRuntimeApp()) {
  107. showTooltipMessage("点击开始绘制");
  108. }
  109. var $this = this;
  110. this.drawType = drawType
  111. this.handler = new $this.Cesium.ScreenSpaceEventHandler($this.viewer.scene.canvas);
  112. //单击开始绘制
  113. this.handler.setInputAction(function(event) {
  114. if (isRuntimeApp()) {
  115. //屏幕坐标转地形上坐标
  116. var cartesian = $this.getCatesian3FromPX(event.position);
  117. if (!cartesian) {
  118. return;
  119. }
  120. $this.createPoint(cartesian); // 绘制点
  121. $this._positions.push(cartesian);
  122. if ($this._positions.length < 3) {
  123. showTooltipMessage("点击添加点");
  124. }
  125. if ($this._positions.length === 3) {
  126. showTooltipMessage("点击完成按钮,结束绘制");
  127. $this.destroy();
  128. if (!$this.Cesium.defined($this.gatheringPlace)) {
  129. $this.gatheringPlace = $this.createGatheringPlace();
  130. //创建按钮
  131. createOperationMainDom();
  132. //隐藏回退按钮
  133. document.getElementById("btnDrawBackout").style.display = 'none';
  134. //完成绘制
  135. document.getElementById("btnDrawComplete").onclick = () => {
  136. $this._gatheringPlaceData = $this._positions.concat();
  137. $this.viewer.entities.remove($this.gatheringPlace); //移除
  138. $this.gatheringPlace = null;
  139. var lnglatArr = [];
  140. for (var i = 0; i < $this._gatheringPlaceData.length; i++) {
  141. var lnglat = $this.cartesianToLatlng($this._gatheringPlaceData[i]);
  142. lnglatArr.push(lnglat)
  143. }
  144. $this._gatheringPlaceData = lnglatArr;
  145. var pincerArrow = $this.addload(lnglatArr); //加载
  146. $this._entities_PincerArrow.push(pincerArrow);
  147. $this._gatheringPlaceLast = pincerArrow;
  148. $this.viewer.entities.remove($this.floatingPoint);
  149. $this.floatingPoint = null;
  150. //删除关键点
  151. $this.clearPoint();
  152. $this.destroy();
  153. let buttonDiv = document.getElementById("drawButtonDiv");
  154. if (buttonDiv) {
  155. //从页面移除
  156. document.body.removeChild(buttonDiv);
  157. }
  158. }
  159. }
  160. }
  161. } else {
  162. console.log('监听鼠标事件', '单击')
  163. /* 锁定点击事件 以免和双击事件冲突 */
  164. clearTimeout($this._timer);
  165. $this._timer = setTimeout(function() {
  166. //屏幕坐标转世界坐标
  167. var position = event.position;
  168. if (!$this.Cesium.defined(position)) {
  169. return;
  170. }
  171. var ray = $this.viewer.camera.getPickRay(position);
  172. if (!$this.Cesium.defined(ray)) {
  173. return;
  174. }
  175. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  176. if (!$this.Cesium.defined(cartesian)) {
  177. return;
  178. }
  179. if ($this._positions.length == 0) {
  180. $this._positions.push(cartesian.clone());
  181. $this.floatingPoint = $this.createPoint(cartesian);
  182. }
  183. if ($this._positions.length <= 2) {
  184. $this.createPoint(cartesian); // 绘制点
  185. $this._positions.push(cartesian);
  186. }
  187. }, 200);
  188. }
  189. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  190. //移动时绘制面
  191. this.handler.setInputAction(function(event) {
  192. //console.log("_positions",_positions);
  193. /* 如果运行环境是App 则禁止使用鼠标移动事件 */
  194. if (isRuntimeApp()) return;
  195. if ($this._positions.length == 0) {
  196. $this._tooltip.showAt(event.endPosition, "点击开始绘制");
  197. } else {
  198. $this._tooltip.showAt(event.endPosition, "点击添加点");
  199. }
  200. if ($this._positions.length < 2) {
  201. return;
  202. }
  203. if ($this._positions.length == 3) {
  204. $this._tooltip.showAt(event.endPosition, "双击结束绘制");
  205. }
  206. //屏幕坐标转世界坐标
  207. var position = event.endPosition;
  208. if (!$this.Cesium.defined(position)) {
  209. return;
  210. }
  211. var ray = $this.viewer.camera.getPickRay(position);
  212. if (!$this.Cesium.defined(ray)) {
  213. return;
  214. }
  215. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  216. if (!$this.Cesium.defined(cartesian)) {
  217. return;
  218. }
  219. //console.log("点击地图移动采集的点:",cartesian);
  220. if (!$this.Cesium.defined($this.gatheringPlace)) {
  221. $this.gatheringPlace = $this.createGatheringPlace();
  222. }
  223. $this.floatingPoint.position.setValue(cartesian);
  224. if ($this.gatheringPlace) {
  225. //替换最后一个点
  226. // _positions.pop();
  227. // _positions.push(cartesian);
  228. //替换中间点
  229. if ($this._positions.length == 3) {
  230. $this._positions[1] = cartesian;
  231. } else {
  232. $this._positions.pop();
  233. $this._positions.push(cartesian);
  234. }
  235. }
  236. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  237. //右击停止采集改为双击结束
  238. this.handler.setInputAction(function(movement) {
  239. // if ($this._positions.length >= 3) {
  240. // $this._gatheringPlaceData = $this._positions.concat();
  241. // $this.viewer.entities.remove($this.gatheringPlace); //移除
  242. // $this.gatheringPlace = null;
  243. // var lnglatArr = [];
  244. // for (var i = 0; i < $this._gatheringPlaceData.length; i++) {
  245. // var lnglat = $this.cartesianToLatlng($this._gatheringPlaceData[i]);
  246. // lnglatArr.push(lnglat)
  247. // }
  248. // $this._gatheringPlaceData = lnglatArr;
  249. // var pincerArrow = $this.addload(lnglatArr); //加载
  250. // $this._entities_PincerArrow.push(pincerArrow);
  251. // $this._gatheringPlaceLast = pincerArrow;
  252. // $this.viewer.entities.remove($this.floatingPoint);
  253. // $this.floatingPoint = null;
  254. // //删除关键点
  255. // $this.clearPoint();
  256. // $this.destroy()
  257. // }
  258. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  259. //双击结束
  260. this.handler.setInputAction(function(movement) {
  261. /* 如果运行环境是App 则禁止使用鼠标双击事件 */
  262. if (isRuntimeApp()) return;
  263. console.log('监听鼠标事件', '双击')
  264. /* 解除锁定 */
  265. clearTimeout($this._timer);
  266. if ($this._positions.length >= 3) {
  267. $this._gatheringPlaceData = $this._positions.concat();
  268. $this.viewer.entities.remove($this.gatheringPlace); //移除
  269. $this.gatheringPlace = null;
  270. var lnglatArr = [];
  271. for (var i = 0; i < $this._gatheringPlaceData.length; i++) {
  272. var lnglat = $this.cartesianToLatlng($this._gatheringPlaceData[i]);
  273. lnglatArr.push(lnglat)
  274. }
  275. $this._gatheringPlaceData = lnglatArr;
  276. var pincerArrow = $this.addload(lnglatArr); //加载
  277. $this._entities_PincerArrow.push(pincerArrow);
  278. $this._gatheringPlaceLast = pincerArrow;
  279. $this.viewer.entities.remove($this.floatingPoint);
  280. $this.floatingPoint = null;
  281. //删除关键点
  282. $this.clearPoint();
  283. $this.destroy();
  284. $this._tooltip.setVisible(false);
  285. }
  286. }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  287. }
  288. //创建集结地
  289. createGatheringPlace() {
  290. let $this = this
  291. var gatheringPlaceEntity = $this.viewer.entities.add({
  292. polygon: {
  293. hierarchy: new $this.Cesium.CallbackProperty(function() {
  294. if ($this._positions.length < 3) {
  295. return;
  296. }
  297. var gatheringPlace = [];
  298. var res = $this.fineGatheringPlace($this._positions);
  299. for (var i = 0; i < res.length; i++) {
  300. var cart3 = new $this.Cesium.Cartesian3(res[i].x, res[i].y, res[i].z);
  301. gatheringPlace.push(cart3);
  302. }
  303. var pHierarchy = new $this.Cesium.PolygonHierarchy(gatheringPlace);
  304. var lonLats = $this.cartesianToLatlng($this._positions);
  305. pHierarchy.keyPoints = lonLats;
  306. return pHierarchy
  307. }, false),
  308. show: true,
  309. fill: true,
  310. clampToGround: true,
  311. material: $this.polygonMaterial
  312. }
  313. })
  314. //$this._entities_gatheringPlace.push(gatheringPlaceEntity);
  315. // gatheringPlaceEntity.valueFlag = "value";
  316. $this._entities_PincerArrow.push(gatheringPlaceEntity);
  317. return gatheringPlaceEntity
  318. }
  319. //创建点
  320. createPoint(cartesian) {
  321. var $this = this;
  322. var point = this.viewer.entities.add({
  323. position: cartesian,
  324. point: {
  325. pixelSize: 10,
  326. color: $this.Cesium.Color.RED,
  327. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  328. }
  329. });
  330. $this._entities_point.push(point);
  331. return point;
  332. }
  333. cartesianToLatlng(cartesian) {
  334. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  335. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  336. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  337. let alt = cartographic.height;
  338. return [lng, lat, alt];
  339. }
  340. //销毁
  341. destroy() {
  342. if (this.handler) {
  343. this.handler.destroy();
  344. this.handler = null;
  345. }
  346. }
  347. clearPoint() {
  348. this.DrawEndEvent.raiseEvent(this._gatheringPlaceLast, this._gatheringPlaceData, this.drawType);
  349. for (var i = 0; i < this._entities_point.length; i++) {
  350. this.viewer.entities.remove(this._entities_point[i]);
  351. }
  352. this._entities_point = []; //脏数据
  353. }
  354. //清空实体对象
  355. clear() {
  356. for (var i = 0; i < this._entities_point.length; i++) {
  357. this.viewer.entities.remove(this._entities_point[i]);
  358. }
  359. for (var i = 0; i < this._entities_PincerArrow.length; i++) {
  360. this.viewer.entities.remove(this._entities_PincerArrow[i]);
  361. }
  362. this.floatingPoint = null; //标识点
  363. this._PincerArrow = null; //活动箭头
  364. this._PincerArrowLast = null; //最后一个箭头
  365. this._positions = []; //活动点
  366. this._entities_point = []; //脏数据
  367. this._entities_PincerArrow = []; //脏数据
  368. this._PincerArrowData = null; //用于构造箭头数据
  369. }
  370. getCatesian3FromPX(px) {
  371. var cartesian;
  372. var ray = this.viewer.camera.getPickRay(px);
  373. if (!ray) return null;
  374. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  375. return cartesian;
  376. }
  377. _computeTempPositions() {
  378. var _this = this;
  379. var pnts = [].concat(_this._positions);
  380. var num = pnts.length;
  381. var first = pnts[0];
  382. var last = pnts[num - 1];
  383. if (_this._isSimpleXYZ(first, last) == false) {
  384. pnts.push(first);
  385. num += 1;
  386. }
  387. _this.tempPositions = [];
  388. for (var i = 1; i < num; i++) {
  389. var p1 = pnts[i - 1];
  390. var p2 = pnts[i];
  391. var cp = _this._computeCenterPotition(p1, p2);
  392. _this.tempPositions.push(p1);
  393. _this.tempPositions.push(cp);
  394. }
  395. }
  396. _isSimpleXYZ(p1, p2) {
  397. if (p1.x == p2.x && p1.y == p2.y && p1.z == p2.z) {
  398. return true;
  399. }
  400. return false;
  401. }
  402. _computeCenterPotition(p1, p2) {
  403. var _this = this;
  404. var c1 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p1);
  405. var c2 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p2);
  406. var cm = new _this.Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5);
  407. var cp = _this.viewer.scene.globe.ellipsoid.cartographicToCartesian(cm);
  408. return cp;
  409. }
  410. /**
  411. * 笛卡尔坐标转经纬度坐标
  412. */
  413. getLonLat(cartesian) {
  414. var cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  415. cartographic.height = this.viewer.scene.globe.getHeight(cartographic);
  416. var pos = {
  417. lon: cartographic.longitude,
  418. lat: cartographic.latitude,
  419. alt: cartographic.height
  420. };
  421. pos.lon = this.Cesium.Math.toDegrees(pos.lon);
  422. pos.lat = this.Cesium.Math.toDegrees(pos.lat);
  423. return pos;
  424. }
  425. LatlngTocartesian(latlng) {
  426. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  427. return cartesian3
  428. }
  429. ////////////////////////////////////////集结地/////////////////////////////////////////////////////
  430. fineGatheringPlace(gatherPosition) {
  431. let $this = this
  432. let points = gatherPosition.length;
  433. if (points < 2) {
  434. return false
  435. } else {
  436. let pnts = new Array();
  437. gatherPosition.forEach(function(item) {
  438. var posLonLat = $this.getLonLat(item);
  439. pnts.push([posLonLat.lon, posLonLat.lat]);
  440. });
  441. //console.log("pnts6666",pnts);
  442. // pnts.push(tailPoint);
  443. // pnts.push(headerPoint);
  444. if (pnts.length === 2) {
  445. let mid = $this.mid(pnts[0], pnts[1])
  446. //let d = utils.MathDistance(pnts[0], mid) / 0.9
  447. let d = $this.distance(pnts[0], mid) / 0.9
  448. //console.log("d",d);
  449. let pnt = $this.getThirdPoint(pnts[0], mid, Math.PI / 2, d, true)
  450. pnts = [pnts[0], pnt, pnts[1]];
  451. //console.log("pnt",pnt);
  452. //createPoint(Cesium.Cartesian3.fromDegrees(pnt[0], pnt[1]));
  453. }
  454. let mid = $this.mid(pnts[0], pnts[2])
  455. pnts.push(mid, pnts[0], pnts[1])
  456. //console.log("3333");
  457. let [normals, pnt1, pnt2, pnt3, pList] = [
  458. [], undefined, undefined, undefined, []
  459. ]
  460. for (let i = 0; i < pnts.length - 2; i++) {
  461. pnt1 = pnts[i]
  462. pnt2 = pnts[i + 1]
  463. pnt3 = pnts[i + 2]
  464. let normalPoints = $this.getBisectorNormals($this.tt, pnt1, pnt2, pnt3)
  465. normals = normals.concat(normalPoints)
  466. }
  467. let count = normals.length
  468. normals = [normals[count - 1]].concat(normals.slice(0, count - 1))
  469. for (let i = 0; i < pnts.length - 2; i++) {
  470. pnt1 = pnts[i]
  471. pnt2 = pnts[i + 1]
  472. pList = pList.concat(pnt1)
  473. for (let t = 0; t <= 100; t++) {
  474. let pnt = $this.getCubicValue(t / 100, pnt1, normals[i * 2], normals[i * 2 + 1], pnt2)
  475. pList = pList.concat(pnt)
  476. }
  477. pList = pList.concat(pnt2)
  478. }
  479. return Cesium.Cartesian3.fromDegreesArray(pList);
  480. }
  481. }
  482. mid(t, o) {
  483. return [(t[0] + o[0]) / 2, (t[1] + o[1]) / 2]
  484. }
  485. distance(t, o) {
  486. return Math.sqrt(Math.pow(t[0] - o[0], 2) + Math.pow(t[1] - o[1], 2))
  487. }
  488. getThirdPoint(t, o, e, r, n) {
  489. var g = this.getAzimuth(t, o),
  490. i = n ? g + e : g - e,
  491. s = r * Math.cos(i),
  492. a = r * Math.sin(i);
  493. return [o[0] + s, o[1] + a]
  494. }
  495. getAzimuth(t, o) {
  496. var e, r = Math.asin(Math.abs(o[1] - t[1]) / this.distance(t, o));
  497. return o[1] >= t[1] && o[0] >= t[0] ? e = r + Math.PI : o[1] >= t[1] && o[0] < t[0] ? e = 2 * Math.PI - r : o[1] < t[1] && o[0] < t[0] ? e = r : o[1] < t[1] && o[0] >= t[0] && (e = Math.PI - r), e
  498. }
  499. getBisectorNormals(t, o, e, r) {
  500. var n = this.getNormal(o, e, r),
  501. g = Math.sqrt(n[0] * n[0] + n[1] * n[1]),
  502. i = n[0] / g,
  503. s = n[1] / g,
  504. a = this.distance(o, e),
  505. l = this.distance(e, r);
  506. if (g > 1e-4)
  507. if (this.isClockWise(o, e, r)) {
  508. var u = t * a,
  509. c = e[0] - u * s,
  510. p = e[1] + u * i,
  511. h = [c, p];
  512. u = t * l, c = e[0] + u * s, p = e[1] - u * i;
  513. var d = [c, p]
  514. } else u = t * a, c = e[0] + u * s, p = e[1] - u * i, h = [c, p], u = t * l, c = e[0] - u * s, p = e[1] + u * i, d = [c, p];
  515. else c = e[0] + t * (o[0] - e[0]), p = e[1] + t * (o[1] - e[1]), h = [c, p], c = e[0] + t * (r[0] - e[0]), p = e[1] + t * (r[1] - e[1]), d = [c, p];
  516. return [h, d]
  517. }
  518. getNormal(t, o, e) {
  519. var r = t[0] - o[0],
  520. n = t[1] - o[1],
  521. g = Math.sqrt(r * r + n * n);
  522. r /= g, n /= g;
  523. var i = e[0] - o[0],
  524. s = e[1] - o[1],
  525. a = Math.sqrt(i * i + s * s);
  526. i /= a, s /= a;
  527. var l = r + i,
  528. u = n + s;
  529. return [l, u]
  530. }
  531. isClockWise(t, o, e) {
  532. return (e[1] - t[1]) * (o[0] - t[0]) > (o[1] - t[1]) * (e[0] - t[0])
  533. }
  534. getCubicValue(t, o, e, r, n) {
  535. t = Math.max(Math.min(t, 1), 0);
  536. var g = 1 - t,
  537. i = t * t,
  538. s = i * t,
  539. a = g * g,
  540. l = a * g,
  541. u = l * o[0] + 3 * a * t * e[0] + 3 * g * i * r[0] + s * n[0],
  542. c = l * o[1] + 3 * a * t * e[1] + 3 * g * i * r[1] + s * n[1];
  543. return [u, c]
  544. }
  545. }
  546. export default DrawGatheringPlace