@pirireis/webglobeplugins 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/package.json +5 -2
  2. package/Math/angle-calculation.js +0 -14
  3. package/Math/arc.ts +0 -76
  4. package/Math/bounds/line-bbox.js +0 -225
  5. package/Math/constants.ts +0 -11
  6. package/Math/frustum/camera.ts +0 -32
  7. package/Math/frustum/from-globeinfo.ts +0 -63
  8. package/Math/frustum/types.ts +0 -11
  9. package/Math/globe-util/horizon-plane.ts +0 -137
  10. package/Math/index.js +0 -0
  11. package/Math/juction/arc-plane.ts +0 -114
  12. package/Math/juction/line-sphere.ts +0 -30
  13. package/Math/juction/plane-plane.ts +0 -66
  14. package/Math/line.ts +0 -70
  15. package/Math/matrix4.ts +0 -0
  16. package/Math/methods.js +0 -237
  17. package/Math/plane.ts +0 -86
  18. package/Math/quaternion.ts +0 -120
  19. package/Math/roadmap.md +0 -10
  20. package/Math/types.ts +0 -45
  21. package/Math/utils.js +0 -3
  22. package/Math/vec3.ts +0 -155
  23. package/algorithms/search-binary.js +0 -14
  24. package/altitude-locator/adaptors.js +0 -0
  25. package/altitude-locator/draw-subset-obj.js +0 -27
  26. package/altitude-locator/keymethod.js +0 -0
  27. package/altitude-locator/plugin.js +0 -439
  28. package/altitude-locator/types.js +0 -26
  29. package/arrowfield/adaptor.js +0 -11
  30. package/arrowfield/index.js +0 -3
  31. package/arrowfield/plugin.js +0 -128
  32. package/bearing-line/index.js +0 -2
  33. package/bearing-line/plugin.js +0 -512
  34. package/circle-line-chain/chain-list-map.js +0 -221
  35. package/circle-line-chain/init.js +0 -0
  36. package/circle-line-chain/plugin.js +0 -469
  37. package/circle-line-chain/readme.md +0 -57
  38. package/circle-line-chain/util.js +0 -1
  39. package/compass-rose/compass-rose-padding-flat.js +0 -266
  40. package/compass-rose/compass-text-writer.js +0 -173
  41. package/compass-rose/index.js +0 -3
  42. package/compassrose/compassrose.js +0 -341
  43. package/compassrose/index.js +0 -2
  44. package/depth-locator/readme.md +0 -26
  45. package/globe-types.ts +0 -13
  46. package/heatwave/index.js +0 -4
  47. package/heatwave/isobar/objectarraylabels.js +0 -247
  48. package/heatwave/isobar/plugin.js +0 -340
  49. package/heatwave/isobar/quadtreecontours.js +0 -336
  50. package/heatwave/plugins/heatwaveglobeshell.js +0 -258
  51. package/jest.config.js +0 -6
  52. package/partialrings/buffer-manager.js +0 -89
  53. package/partialrings/goals.md +0 -17
  54. package/partialrings/index.js +0 -3
  55. package/partialrings/plugin.js +0 -160
  56. package/partialrings/program.js +0 -324
  57. package/pin/pin-object-array.js +0 -381
  58. package/pin/pin-point-totem.js +0 -77
  59. package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +0 -78
  60. package/point-heat-map/index.js +0 -0
  61. package/point-heat-map/plugin-webworker.js +0 -151
  62. package/point-heat-map/point-to-heat-map-flow.js +0 -150
  63. package/point-heat-map/readme.md +0 -15
  64. package/point-tracks/key-methods.js +0 -3
  65. package/point-tracks/plugin.js +0 -394
  66. package/programs/arrowfield/index.js +0 -2
  67. package/programs/arrowfield/logic.js +0 -286
  68. package/programs/arrowfield/object.js +0 -89
  69. package/programs/data2legend/density-to-legend.js +0 -115
  70. package/programs/data2legend/point-to-density-texture.js +0 -114
  71. package/programs/float2legendwithratio/index.js +0 -3
  72. package/programs/float2legendwithratio/logic.js +0 -194
  73. package/programs/float2legendwithratio/object.js +0 -141
  74. package/programs/globe-util/is-globe-moved.js +0 -27
  75. package/programs/globeshell/index.js +0 -2
  76. package/programs/globeshell/noise/noises.js +0 -0
  77. package/programs/globeshell/wiggle/index.js +0 -6
  78. package/programs/globeshell/wiggle/logic.js +0 -371
  79. package/programs/globeshell/wiggle/object.js +0 -93
  80. package/programs/helpers/blender/index.js +0 -0
  81. package/programs/helpers/blender/program.js +0 -91
  82. package/programs/helpers/fadeaway/index.js +0 -3
  83. package/programs/helpers/fadeaway/logic.js +0 -76
  84. package/programs/helpers/fadeaway/object.js +0 -20
  85. package/programs/helpers/index.js +0 -2
  86. package/programs/index.js +0 -21
  87. package/programs/interface.ts +0 -7
  88. package/programs/line-on-globe/angled-line.js +0 -206
  89. package/programs/line-on-globe/circle-accurate-3d.js +0 -167
  90. package/programs/line-on-globe/circle-accurate-flat.js +0 -262
  91. package/programs/line-on-globe/circle-accurate.js +0 -202
  92. package/programs/line-on-globe/circle.js +0 -191
  93. package/programs/line-on-globe/degree-padding-around-circle-3d.js +0 -188
  94. package/programs/line-on-globe/index.js +0 -0
  95. package/programs/line-on-globe/lines-color-instanced-flat.js +0 -151
  96. package/programs/line-on-globe/linestrip.ts +0 -228
  97. package/programs/line-on-globe/naive-accurate-flexible.js +0 -239
  98. package/programs/line-on-globe/to-the-surface.js +0 -129
  99. package/programs/line-on-globe/util.js +0 -8
  100. package/programs/picking/pickable-renderer.js +0 -216
  101. package/programs/point-on-globe/element-globe-surface-glow.js +0 -168
  102. package/programs/point-on-globe/element-point-glow.js +0 -184
  103. package/programs/point-on-globe/square-pixel-point.js +0 -189
  104. package/programs/programcache.ts +0 -131
  105. package/programs/rings/distancering/circleflatprogram.js +0 -136
  106. package/programs/rings/distancering/circlepaddingfreeangleprogram.js +0 -378
  107. package/programs/rings/distancering/circlepaddysharedbuffer.js +0 -420
  108. package/programs/rings/distancering/index.js +0 -5
  109. package/programs/rings/distancering/paddyflatprogram.js +0 -146
  110. package/programs/rings/distancering/paddyflatprogram2d.js +0 -150
  111. package/programs/rings/distancering/paddyflatprogram3d.js +0 -146
  112. package/programs/rings/distancering/shader.js +0 -0
  113. package/programs/rings/index.js +0 -1
  114. package/programs/rings/partial-ring/piece-of-pie.js +0 -315
  115. package/programs/totems/camerauniformblock.d.ts +0 -48
  116. package/programs/totems/camerauniformblock.js +0 -197
  117. package/programs/totems/canvas-webglobe-info.js +0 -136
  118. package/programs/totems/gpu-selection-uniform-block.js +0 -132
  119. package/programs/totems/index.ts +0 -2
  120. package/programs/two-d/pixel-circle.js +0 -0
  121. package/programs/two-d/pixel-padding-for-compass.js +0 -174
  122. package/programs/util.js +0 -20
  123. package/programs/vectorfields/index.js +0 -3
  124. package/programs/vectorfields/logics/drawrectangleparticles.js +0 -125
  125. package/programs/vectorfields/logics/index.js +0 -5
  126. package/programs/vectorfields/logics/pixelbased.js +0 -161
  127. package/programs/vectorfields/logics/ubo.js +0 -64
  128. package/programs/vectorfields/pingpongbuffermanager.js +0 -80
  129. package/publish.bat +0 -60
  130. package/rangerings/enum.js +0 -3
  131. package/rangerings/index.js +0 -5
  132. package/rangerings/plugin.js +0 -649
  133. package/rangerings/rangeringangletext.js +0 -368
  134. package/rangerings/ring-account.js +0 -129
  135. package/shaders/fragment-toy/firework.js +0 -55
  136. package/shaders/fragment-toy/singularity.js +0 -59
  137. package/shape-on-terrain/arc/naive/plugin.ts +0 -304
  138. package/shape-on-terrain/goal.md +0 -12
  139. package/tests/Math/junction/arc-plane.test.ts +0 -133
  140. package/tests/Math/junction/plane-plane.test.ts +0 -82
  141. package/tests/Math/plane.test.ts +0 -43
  142. package/tests/Math/vec3.test.ts +0 -14
  143. package/timetracks/adaptors-line-strip.js +0 -80
  144. package/timetracks/adaptors.js +0 -133
  145. package/timetracks/index.js +0 -6
  146. package/timetracks/plugin-line-strip.js +0 -295
  147. package/timetracks/plugin.js +0 -304
  148. package/timetracks/program-line-strip.js +0 -688
  149. package/timetracks/program.js +0 -850
  150. package/timetracks/programpoint-line-strip.js +0 -175
  151. package/timetracks/programpoint.js +0 -168
  152. package/timetracks/readme.md +0 -1
  153. package/tsconfig.json +0 -22
  154. package/types.ts +0 -17
  155. package/util/account/bufferoffsetmanager.js +0 -209
  156. package/util/account/index.js +0 -6
  157. package/util/account/single-attribute-buffer-management/buffer-manager.ts +0 -119
  158. package/util/account/single-attribute-buffer-management/buffer-orchestrator.ts +0 -173
  159. package/util/account/single-attribute-buffer-management/index.ts +0 -13
  160. package/util/account/single-attribute-buffer-management/object-store.ts +0 -65
  161. package/util/account/single-attribute-buffer-management/types.ts +0 -39
  162. package/util/account/util.js +0 -22
  163. package/util/algorithms/index.js +0 -0
  164. package/util/algorithms/search-binary.js +0 -26
  165. package/util/check/get.js +0 -13
  166. package/util/check/index.js +0 -0
  167. package/util/check/typecheck.js +0 -39
  168. package/util/geometry/index.js +0 -53
  169. package/util/gl-util/buffer/attribute-loader.ts +0 -85
  170. package/util/gl-util/buffer/index.ts +0 -6
  171. package/util/gl-util/buffer/types.ts +0 -13
  172. package/util/gl-util/draw-options/methods.ts +0 -66
  173. package/util/gl-util/draw-options/types.ts +0 -28
  174. package/util/gl-util/uniform-block/manager.ts +0 -187
  175. package/util/gl-util/uniform-block/roadmap.md +0 -70
  176. package/util/gl-util/uniform-block/shader.js +0 -0
  177. package/util/gl-util/uniform-block/types.ts +0 -27
  178. package/util/heatwavedatamanager/datamanager.js +0 -168
  179. package/util/heatwavedatamanager/index.js +0 -3
  180. package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +0 -133
  181. package/util/heatwavedatamanager/pointcoordsmeta.js +0 -22
  182. package/util/index.js +0 -13
  183. package/util/interpolation/index.js +0 -0
  184. package/util/interpolation/timetrack/index.js +0 -9
  185. package/util/interpolation/timetrack/timetrack-interpolator.js +0 -88
  186. package/util/interpolation/timetrack/web-worker-str.js +0 -180
  187. package/util/interpolation/timetrack/web-worker.js +0 -51
  188. package/util/jshelpers/data-filler.js +0 -19
  189. package/util/jshelpers/equality.js +0 -17
  190. package/util/jshelpers/index.js +0 -1
  191. package/util/jshelpers/timefilters.js +0 -32
  192. package/util/picking/fence.js +0 -46
  193. package/util/picking/picker-displayer.js +0 -177
  194. package/util/programs/draw-texture-on-canvas.js +0 -102
  195. package/util/programs/index.js +0 -1
  196. package/util/programs/shapesonglobe.js +0 -246
  197. package/util/programs/supersampletotextures.js +0 -142
  198. package/util/programs/texturetoglobe.js +0 -203
  199. package/util/shaderfunctions/geometrytransformations.ts +0 -388
  200. package/util/shaderfunctions/index.js +0 -2
  201. package/util/shaderfunctions/nodata.js +0 -10
  202. package/util/shaderfunctions/noisefunctions.js +0 -44
  203. package/util/surface-line-data/arc-bboxes.ts +0 -42
  204. package/util/surface-line-data/arcs-to-cuts.js +0 -74
  205. package/util/surface-line-data/cut-arc.js +0 -0
  206. package/util/surface-line-data/flow.ts +0 -52
  207. package/util/surface-line-data/rbush-manager.js +0 -0
  208. package/util/surface-line-data/types.ts +0 -27
  209. package/util/surface-line-data/web-worker.js +0 -0
  210. package/util/webglobe/gldefaultstates.js +0 -5
  211. package/util/webglobe/index.js +0 -2
  212. package/util/webglobe/rasteroverlay.js +0 -96
  213. package/util/webglobjectbuilders.ts +0 -456
  214. package/util/webglobjectbuilders1.js +0 -271
  215. package/waveparticles/adaptor.js +0 -16
  216. package/waveparticles/index.js +0 -3
  217. package/waveparticles/plugin.js +0 -313
  218. package/wind/imagetovectorfieldandmagnitude.js +0 -39
  219. package/wind/index.js +0 -5
  220. package/wind/plugin.js +0 -1057
  221. package/wind/vectorfieldimage.js +0 -27
  222. package/write-text/attached-text-writer.js +0 -105
  223. package/write-text/context-text.js +0 -125
  224. package/write-text/context-text3.js +0 -178
  225. package/write-text/index.js +0 -1
  226. package/write-text/writer-plugin.js +0 -7
@@ -1,304 +0,0 @@
1
- // import { LineStripProgramCache } from "../../../programs/line-on-globe/linestrip"
2
- // import "../../../programs/interface";
3
-
4
- // import { createBufferAndReadInfo } from '../../../util/gl-util/buffer/attribute-loader';
5
- // import { populateFloat32Array } from "../../../util/jshelpers/data-filler";
6
- // import { BufferManagement, BufferManager, BufferOrchestrator } from "../../../util/account/single-attribute-buffer-management/index";
7
- // import { globe3Dcoordinates, globe2Dcoordinates, RADIANS } from "../../../Math/methods";
8
- // import { Vector3D } from "../../../Math/vector3d";
9
- // import { Arc } from "../../../Math/arc";
10
- // import { Plane } from "../../../Math/plane";
11
- // import { arcFrustumPlanesIntersection } from "../../../Math/intersections/arc-frustum-planes";
12
-
13
- // import { CameraUniformBlockTotemCache, CameraUniformBlockTotem } from "../../../programs/totems/camerauniformblock";
14
- // import { FrustumPlanes } from "../../../Math/frustum/types";
15
- // const VERTEX_COUNT = 360;
16
- // const INITAL_CAPACITY = 10;
17
- // const _0vector = new Vector3D();
18
- // const _0arc = new Arc();
19
-
20
- // // window add properties
21
- // declare global {
22
- // interface Window {
23
- // startPoint: Vector3D;
24
- // endPoint: Vector3D;
25
- // }
26
- // }
27
-
28
- // let interval = 1;
29
-
30
- // const testVec = new Vector3D(0, 0, 1);
31
- // testVec.setFromLongLat(30 * RADIANS, 30 * RADIANS);
32
- // console.log("testVec", testVec.x, testVec.y, testVec.z);
33
-
34
- // testVec.setFromLongLat(50 * RADIANS, 50 * RADIANS);
35
- // console.log("testVec", testVec.x, testVec.y, testVec.z);
36
-
37
-
38
- // export class NaiveLineOnTerrainPlugin {
39
- // public id: string;
40
- // private program: ProgramInterface;
41
- // private _bufferManagersCompMap: BufferManagement;
42
- // private _bufferManagersCompMapTest: BufferManagement;
43
- // private _bufferOrchestrator: BufferOrchestrator = new BufferOrchestrator({ capacity: INITAL_CAPACITY });
44
- // private _testOrchestrator: BufferOrchestrator = new BufferOrchestrator({ capacity: INITAL_CAPACITY });
45
- // private _opacity: number = 1;
46
- // private _arcUBOHandler: UBOHandler;
47
- // private _vao: WebGLVertexArrayObject;
48
- // private _vaoAllTest: WebGLVertexArrayObject;
49
- // private _ubohandlerAllTest: UBOHandler;
50
- // private globe: any;
51
- // private gl: WebGL2RenderingContext;
52
- // private _arcMap: Map<string, Arc>;
53
- // private _arcMapTest: Map<string, Arc>;
54
- // private _screenPlane: Plane = new Plane();
55
- // private _doBuild: boolean = false
56
- // private _cameraUniformBlock: CameraUniformBlockTotem;
57
- // public fieldOfView = 50 * RADIANS; // 50 degrees in radians
58
-
59
- // constructor(id: string) {
60
- // this.id = id;
61
- // this._arcMap = new Map();
62
- // this._arcMapTest = new Map();
63
- // }
64
-
65
-
66
-
67
- // insertArcFromLongLat(key: string, startPoint: { long: number, lat: number }, endPoint: { long: number, lat: number }) {
68
- // if (this._arcMap.has(key)) {
69
- // this._arcMap.delete(key);
70
- // }
71
- // const start = _0vector.setFromLongLat(startPoint.long * RADIANS, startPoint.lat * RADIANS).clone();
72
- // const end = _0vector.setFromLongLat(endPoint.long * RADIANS, endPoint.lat * RADIANS).clone();
73
-
74
-
75
-
76
- // window.startPoint = start;
77
- // window.endPoint = end;
78
- // const arc = new Arc(start, end);
79
- // this._arcMap.set(key, arc);
80
- // this._arcMapTest.set(key, arc.clone());
81
- // const longLatArr = new Float32Array(2 * VERTEX_COUNT);
82
- // const _3Dpoints = arc.populatePoints3D(VERTEX_COUNT);
83
- // const longLat = {
84
- // long: 1,
85
- // lat: 1
86
- // };
87
- // for (let i = 0; i < _3Dpoints.length / 3; i++) {
88
- // _0vector.set(_3Dpoints[i * 3], _3Dpoints[i * 3 + 1], _3Dpoints[i * 3 + 2]).toLongLat(longLat);
89
- // longLatArr.set([longLat.long / RADIANS, longLat.lat / RADIANS], i * 2);
90
- // }
91
- // const result = [{
92
- // key: key,
93
- // longLatArr: longLatArr,
94
- // }
95
- // ]
96
- // this._testOrchestrator.insertBulk(result, this._bufferManagersCompMapTest);
97
-
98
- // this._doBuild = true;
99
- // }
100
-
101
-
102
-
103
- // init(globe: any, gl: WebGL2RenderingContext) {
104
- // this.globe = globe;
105
- // this.gl = gl;
106
- // this.program = LineStripProgramCache.get(globe);
107
-
108
- // const g3D = globe3Dcoordinates(globe, 30);
109
- // const g2D = globe2Dcoordinates(globe);
110
- // this._cameraUniformBlock = CameraUniformBlockTotemCache.get(globe);
111
- // this._bufferManagersCompMap = new Map(
112
- // [
113
- // ["position3d", {
114
- // bufferManager: new BufferManager(gl, 3 * (VERTEX_COUNT + 1), { bufferType: "DYNAMIC_DRAW", initialCapacity: INITAL_CAPACITY }),
115
- // adaptor: (item: any) => {
116
- // const { longLatArr } = item;
117
- // const result = g3D(longLatArr, { paddingCount: 1 });
118
- // // console.log("result", result);
119
- // return result;
120
- // }
121
- // }],
122
- // ["position2d", {
123
- // bufferManager: new BufferManager(gl, 2 * (VERTEX_COUNT + 1), { bufferType: "DYNAMIC_DRAW", initialCapacity: INITAL_CAPACITY }),
124
- // adaptor: (item: any) => {
125
- // const { longLatArr } = item;
126
- // return g2D(longLatArr, { paddingCount: 1 });
127
- // }
128
- // }
129
- // ],
130
- // ]
131
- // );
132
-
133
- // this._bufferManagersCompMapTest = new Map([
134
- // ["positionTest3d", {
135
- // bufferManager: new BufferManager(gl, 3 * (VERTEX_COUNT + 1), { bufferType: "DYNAMIC_DRAW", initialCapacity: INITAL_CAPACITY }),
136
- // adaptor: (item: any) => {
137
- // const { longLatArr } = item;
138
- // const result = g3D(longLatArr, { paddingCount: 1 });
139
- // return result;
140
- // }
141
- // }],
142
- // ["positionTest2d", {
143
- // bufferManager: new BufferManager(gl, 2 * (VERTEX_COUNT + 1), { bufferType: "DYNAMIC_DRAW", initialCapacity: INITAL_CAPACITY }),
144
- // adaptor: (item: any) => {
145
- // const { longLatArr } = item;
146
- // return g2D(longLatArr, { paddingCount: 1 });
147
- // }
148
- // }
149
- // ]
150
- // ]
151
- // );
152
-
153
- // this._bufferOrchestrator = new BufferOrchestrator(gl, this._bufferManagersCompMap);
154
-
155
- // this._arcUBOHandler = this.program.createUBO();
156
- // this._arcUBOHandler.update(new Map([
157
- // ["u_color", new Float32Array([1, 0, 0, 1])],
158
- // ]));
159
- // this._ubohandlerAllTest = this.program.createUBO();
160
- // this._ubohandlerAllTest.update(new Map([
161
- // ["u_color", new Float32Array([0, 0, 1, 1])],
162
- // ]));
163
-
164
- // this._vao = this.program.createVAO(
165
- // createBufferAndReadInfo(this._bufferManagersCompMap.get("position3d").bufferManager.buffer),
166
- // createBufferAndReadInfo(this._bufferManagersCompMap.get("position2d").bufferManager.buffer),
167
- // null,
168
- // null,
169
- // null,
170
- // );
171
- // this._vaoAllTest = this.program.createVAO(
172
- // createBufferAndReadInfo(this._bufferManagersCompMapTest.get("positionTest3d").bufferManager.buffer),
173
- // createBufferAndReadInfo(this._bufferManagersCompMapTest.get("positionTest2d").bufferManager.buffer),
174
- // null,
175
- // null,
176
- // null,
177
- // );
178
- // }
179
-
180
- // setFieldOfView(fieldOfView: number) {
181
- // this.fieldOfView = fieldOfView * RADIANS; // convert degrees to radians
182
- // this.globe.DrawRender();
183
- // }
184
-
185
-
186
-
187
- // _buildArcs() {
188
- // // updatePlane
189
- // const { globe, _arcMap } = this;
190
-
191
- // const planes = this._cameraUniformBlock.getFrustumPlanes() as FrustumPlanes;
192
- // //
193
-
194
- // const cameraPostition = new Vector3D();
195
- // cameraPostition.copy(globe.Fp as Vector3D).normalize();
196
- // // calculateHorizonPlane(globe, _screenPlane, this.fieldOfView);
197
-
198
- // const result = [];
199
- // const longLat = {
200
- // long: 1,
201
- // lat: 1
202
- // }
203
-
204
- // let counter = 0;
205
- // for (const [key, arc] of _arcMap) {
206
- // // const isArc = arc.intersectionMedium(_screenPlane, _0arc) as Arc;
207
- // _0arc.copy(arc);
208
-
209
- // const isArc = arcFrustumPlanesIntersection(_0arc, planes, _0arc);
210
-
211
- // if (!isArc) {
212
- // continue;
213
- // }
214
- // counter++;
215
- // const longLatArr = new Float32Array(2 * VERTEX_COUNT);
216
- // // const _3Dpoints = _0arc.populatePoints3DInRespectToCamera(cameraPostition, VERTEX_COUNT);
217
- // const _3Dpoints = _0arc.populatePoints3D(VERTEX_COUNT);
218
-
219
- // for (let i = 0; i < _3Dpoints.length / 3; i++) {
220
- // _0vector.set(_3Dpoints[i * 3], _3Dpoints[i * 3 + 1], _3Dpoints[i * 3 + 2]).toLongLat(longLat);
221
- // longLatArr.set([longLat.long / RADIANS, longLat.lat / RADIANS], i * 2);
222
- // }
223
-
224
- // result.push({
225
- // key: key,
226
- // longLatArr: longLatArr,
227
- // });
228
-
229
- // // if (!arc.imaginaryPlane.equals(_0arc.imaginaryPlane) || !arc.imaginaryPlane.equalsReverseOriantation(_0arc.imaginaryPlane)) {
230
- // // // console.log("Arc with key", key, "has imaginary plane equal to the original arc's imaginary plane.");
231
- // // throw new Error("The arc segment is not on the parent arc")
232
- // // }
233
- // }
234
- // interval += 1;
235
- // if (interval === 100) {
236
- // interval = 1;
237
- // console.log("Arc count on screen:", counter);
238
- // }
239
- // // update buffer
240
- // this._bufferOrchestrator.resetWithCapacity(this._bufferManagersCompMap, result.length);
241
-
242
- // this._bufferOrchestrator.insertBulk(result, this._bufferManagersCompMap);
243
-
244
- // this._doBuild = false;
245
- // this._checkIfCorrupted(); // check if any arc is corrupted
246
-
247
- // }
248
-
249
-
250
- // draw3D() {
251
- // // Drawing logic here
252
- // this._buildArcs() // can be async
253
- // const { gl, program, _bufferOrchestrator } = this;
254
-
255
- // gl.disable(gl.DEPTH_TEST);
256
-
257
-
258
-
259
- // const drawOptionTest = {
260
- // drawRange: {
261
- // first: 0,
262
- // count: this._testOrchestrator.length * (VERTEX_COUNT + 1)
263
- // },
264
- // indexes: null
265
- // }
266
-
267
- // program.draw(
268
- // this._vaoAllTest,
269
- // drawOptionTest,
270
- // this._opacity,
271
- // this._ubohandlerAllTest
272
- // );
273
-
274
-
275
- // const drawOptions = {
276
- // drawRange: {
277
- // first: 0,
278
- // count: _bufferOrchestrator.length * (VERTEX_COUNT + 1)
279
- // },
280
- // indexes: null
281
- // }
282
-
283
- // program.draw(
284
- // this._vao,
285
- // drawOptions,
286
- // this._opacity,
287
- // this._arcUBOHandler
288
- // );
289
-
290
-
291
- // gl.enable(gl.DEPTH_TEST);
292
- // }
293
-
294
- // _checkIfCorrupted() {
295
- // for (const [key, arc] of this._arcMap) {
296
- // if (!arc.p0.equals(arc.p1)) {
297
- // continue; // valid arc
298
- // }
299
- // console.warn(`Arc with key ${key} is corrupted: p0 and p1 are the same point.`);
300
- // // this._arcMap.delete(key);
301
- // // this._arcMapTest.delete(key);
302
- // }
303
- // }
304
- // }
@@ -1,12 +0,0 @@
1
- The fact that a straight line have two points, lacks the ability to cover elevation data on higher zoom levels.
2
-
3
- The purpose of this subplugin is to adapt the straight line to the terrain.
4
-
5
-
6
- ### Steps
7
-
8
- - filter by bbox with tree -> indexes
9
- - find intersaction. Also filters in a more precise way then bbox. -> index and 2 points. 3d carteasian so it can be used on slerp.
10
- - Populate the line points -> Array<lat long>
11
- - 3d cartesian coords with globe api
12
-
@@ -1,133 +0,0 @@
1
- import { Plane, Line, Vec3, Quaternion, Arc } from '../../../Math/types';
2
- import { plane } from '../../../Math/plane';
3
- import { line } from '../../../Math/line';
4
- import { arc } from '../../../Math/arc';
5
- import { vec3 } from '../../../Math/vec3';
6
- import { quaternion } from '../../../Math/quaternion';
7
- import { planePlaneJuction } from '../../../Math/juction/plane-plane';
8
- import { arcSlice } from '../../../Math/juction/arc-plane';
9
- import { EPSILON } from '../../../Math/constants';
10
-
11
-
12
- const arcIn = arc.create(vec3.create(0, 0, 1), vec3.create(1, 0, 0));
13
- const arcOut: [Arc, Arc] = [
14
- arc.create(vec3.create(0, 0, 1), vec3.create(1, 0, 0)),
15
- arc.create(vec3.create(0, 0, 1), vec3.create(1, 0, 0))
16
- ];
17
- const arcExpected = arc.create(vec3.create(0, 0, 1), vec3.create(1, 0, 0));
18
- const junctionPlane = plane.create(vec3.create(0, 0, 1), 0);
19
-
20
- const r2 = Math.sqrt(2) / 2;
21
- const r3 = Math.sqrt(3) / 3;
22
-
23
- beforeAll(() => {
24
- // Initialize any necessary data or state before running the tests
25
- arc.set(arcIn, vec3.create(0, 0, 1), vec3.create(1, 0, 0));
26
- arc.set(arcOut[0], vec3.create(0, 0, 1), vec3.create(1, 0, 0));
27
- arc.set(arcOut[1], vec3.create(0, 0, 1), vec3.create(1, 0, 0));
28
-
29
- plane.set(junctionPlane, vec3.create(0, 0, 1), 0);
30
-
31
- });
32
-
33
-
34
-
35
-
36
-
37
- test('arcSlice - No intersection 1', () => {
38
- junctionPlane.distance = 2; // Set distance to ensure no intersection
39
- const result = arcSlice(arcOut, arcIn, junctionPlane);
40
- expect(result).toBe(false);
41
- });
42
-
43
-
44
-
45
- test('arcSlice - Full intersection 1', () => {
46
- junctionPlane.distance = 0; // Set distance to ensure full intersection
47
- const result = arcSlice(arcOut, arcIn, junctionPlane);
48
- expect(result).toBe(true);
49
- const isEqual = arc.equals(arcOut[0], arcExpected);
50
- expect(isEqual).toBe(true);
51
- });
52
-
53
-
54
- test('arcSlice-1', () => {
55
- // Set up a case where the arc intersects with the plane
56
-
57
-
58
- const r3 = Math.sqrt(3);
59
- const juctionNormal = vec3.create(r3, r3, r3);
60
-
61
- plane.set(junctionPlane, juctionNormal, 0);
62
-
63
- const result = arcSlice(arcOut, arcIn, junctionPlane);
64
- expect(result).toBe(true);
65
- });
66
-
67
-
68
- test('arcSlice - Plane intersection line is out of sphere', () => {
69
- // Set up a case where the arc intersects with the plane
70
-
71
- const point1 = vec3.create(0, 1, 0);
72
- const point2 = vec3.create(0, 0, 1);
73
- arc.set(arcIn, point1, point2);
74
-
75
- const juctionNormal = vec3.create(r3, r3, r3);
76
-
77
- const closestPoint = vec3.create(r2, r2, 0);
78
- const distance = vec3.dot(juctionNormal, closestPoint) + EPSILON;
79
- plane.set(junctionPlane, juctionNormal, distance);
80
-
81
- const result = arcSlice(arcOut, arcIn, junctionPlane);
82
- expect(result).toBe(false);
83
- });
84
-
85
-
86
- test("arcSlice - Planes are parallel", () => {
87
-
88
- const point1 = vec3.create(0, 1, 0);
89
- const point2 = vec3.create(0, 0, 1);
90
- arc.set(arcIn, point1, point2);
91
-
92
- plane.fromValues(junctionPlane, 1, 0, 0, 0.3); // Set a plane parallel to the arc's normal
93
- const result = arcSlice(arcOut, arcIn, junctionPlane);
94
- expect(result).toBe(false); // Expect no intersection
95
-
96
- junctionPlane.distance = -0.3;
97
-
98
- const result2 = arcSlice(arcOut, arcIn, junctionPlane);
99
- expect(result2).toBe(true); // Expect no intersection
100
- const isEqual = arc.equals(arcOut[0], arcIn);
101
- expect(isEqual).toBe(true); // Expect the output arc to be equal to the input arc
102
- });
103
-
104
-
105
- test("arcSlice - Arc sliced in half", () => {
106
-
107
- const point1 = vec3.create(0, 1, 0);
108
- const point2 = vec3.create(0, 0, 1);
109
- arc.set(arcIn, point1, point2);
110
-
111
- expect(vec3.equals(arcIn.normal, vec3.create(1, 0, 0))).toBe(true); // Arc normal should be (1, 0, 0)
112
-
113
- plane.fromValues(junctionPlane, 0, -r2, r2, 0); // Set a plane parallel to the arc's normal
114
-
115
- const result = arcSlice(arcOut, arcIn, junctionPlane);
116
- expect(result).toBe(true); // Expect an intersection
117
- const expectedPoint1 = vec3.create(0, r2, r2);
118
- const expectedPoint2 = vec3.create(0, 0, 1);
119
- arc.set(arcExpected, expectedPoint1, expectedPoint2);
120
- const isEqual = arc.equals(arcOut[0], arcExpected);
121
- expect(isEqual).toBe(true); // Expect the output arc to be equal to the expected arc
122
- });
123
-
124
-
125
- // test("arcSlice - Arc sliced in middle", () => {
126
- // const point1 = vec3.create(0, 1, 0);
127
- // const point2 = vec3.create(0, 0, 1);
128
- // arc.set(arcIn, point1, point2);
129
-
130
-
131
- // plane.fromValues(junctionPlane, 0, r2, r2, )
132
-
133
- // });
@@ -1,82 +0,0 @@
1
- import { Plane, Line, Vec3, Quaternion } from '../../../Math/types';
2
- import { plane } from '../../../Math/plane';
3
- import { line } from '../../../Math/line';
4
- import { vec3 } from '../../../Math/vec3';
5
- import { quaternion } from '../../../Math/quaternion';
6
- import { planePlaneJuction } from '../../../Math/juction/plane-plane';
7
-
8
-
9
- let plane1: Plane;
10
- let plane2: Plane;
11
- let intersectionLine: Line;
12
- let quaternion1: Quaternion;
13
-
14
- beforeAll(() => {
15
- plane1 = plane.create();
16
- plane2 = plane.create();
17
- intersectionLine = line.create();
18
- quaternion1 = quaternion.create();
19
- });
20
-
21
-
22
- test('plane-plane intersection - parallel planes', () => {
23
- plane.fromValues(plane1, 0, 0, 1, 5); // Plane: z = 5
24
- plane.fromValues(plane2, 0, 0, 1, 10); // Plane: z = 10
25
- const result = planePlaneJuction(intersectionLine, plane1, plane2);
26
- expect(result).toBe(false);
27
- });
28
-
29
- test('plane-plane intersection - intersecting planes', () => {
30
- plane.fromValues(plane1, 0, 0, 1, 5); // Plane: z = 5
31
- plane.fromValues(plane2, 1, 0, 0, 3); // Plane: x = 3
32
-
33
- const result = planePlaneJuction(intersectionLine, plane1, plane2);
34
- expect(result).toBe(true);
35
- expect(vec3.equals(intersectionLine.direction, vec3.create(0, 1, 0))).toBe(true);
36
- expect(vec3.equals(intersectionLine.origin, vec3.create(3, 0, 5))).toBe(true);
37
- });
38
-
39
-
40
- test('plane-plane intersection - rotating a plane', () => {
41
- // plane1 z = 5
42
- plane.fromValues(plane1, 0, 0, 1, 5);
43
-
44
- // plane2 x = 3, for the start
45
- vec3.randomUnit(plane2.normal);
46
- plane2.distance = 3;
47
-
48
- const result = planePlaneJuction(intersectionLine, plane1, plane2);
49
- expect(result).toBe(true);
50
- const quaRotateLine = line.clone(intersectionLine);
51
-
52
- const step = 90;
53
- quaternion.fromAxisAngle(quaternion1, plane1.normal, Math.PI / step); // Rotate 90 degrees around Y-axis
54
-
55
-
56
- for (let i = 0; i < step; i++) {
57
-
58
- vec3.applyQuaternion(plane2.normal, plane2.normal, quaternion1);
59
-
60
- const result = planePlaneJuction(intersectionLine, plane1, plane2);
61
-
62
-
63
- line.applyQuaternion(quaRotateLine, quaRotateLine, quaternion1);
64
-
65
- expect(result).toBe(true);
66
- expect(vec3.equals(intersectionLine.direction, quaRotateLine.direction)).toBe(true);
67
- expect(line.contains(intersectionLine, quaRotateLine.origin)).toBe(true);
68
- }
69
- });
70
-
71
- test("plane-plane intersection 1", () => {
72
- const r2 = Math.sqrt(2) / 2;
73
- plane.fromValues(plane1, 1, 0, 0, 0);
74
- plane.fromValues(plane2, 0, -r2, r2, 0);
75
- const result = planePlaneJuction(intersectionLine, plane1, plane2);
76
-
77
- expect(result).toBe(true);
78
- console.log(intersectionLine);
79
- expect(vec3.equals(intersectionLine.direction, vec3.create(0, r2, r2)) || vec3.equals(intersectionLine.direction, vec3.create(0, -r2, -r2))
80
- ).toBe(true);
81
- expect(line.contains(intersectionLine, vec3.create(0, 0, 0))).toBe(true);
82
- });
@@ -1,43 +0,0 @@
1
- import { Plane, Vec3 } from "../../Math/types";
2
- import { vec3 } from "../../Math/vec3";
3
- import { plane } from "../../Math/plane";
4
-
5
-
6
- const _planeA = /*@__PURE__*/ plane.create(vec3.create(1, 0, 0), 0);
7
- const _planeB = /*@__PURE__*/ plane.create(vec3.create(0, 1, 0), 0);
8
- const _vecA = /*@__PURE__*/ vec3.create(1, 0, 0);
9
-
10
- beforeAll(() => {
11
- vec3.set(_vecA, 1, 0, 0);
12
- plane.set(_planeA, vec3.create(1, 0, 0), 0);
13
- plane.set(_planeB, vec3.create(0, 1, 0), 0);
14
- });
15
-
16
- test("Plane: getUnitSphereRadiusAngle", () => {
17
- const angleA = plane.getUnitSphereRadiusAngle(_planeA);
18
- const angleB = plane.getUnitSphereRadiusAngle(_planeB);
19
-
20
- expect(angleA).toBeCloseTo(Math.PI / 2, 5); // 90 degrees
21
- expect(angleB).toBeCloseTo(Math.PI / 2, 5); // 90 degrees
22
- });
23
-
24
-
25
- test("Plane: getUnitSphereRadiusAngle 1", () => {
26
-
27
- vec3.set(_vecA, 1, 1, 0);
28
- vec3.normalize(_vecA, _vecA);
29
- const distance = Math.sqrt(2) / 2; // Distance from origin to the plane
30
- plane.set(_planeA, _vecA, distance);
31
- const angleA = plane.getUnitSphereRadiusAngle(_planeA);
32
- expect(angleA).toBeCloseTo(Math.PI / 4, 5); // 45 degrees
33
-
34
- for (let i = 0; i < 100; i++) {
35
- const distance = Math.random();
36
-
37
- const angle = Math.acos(distance);
38
- vec3.randomUnit(_vecA)
39
- plane.set(_planeA, _vecA, distance);
40
- const angleA = plane.getUnitSphereRadiusAngle(_planeA);
41
- expect(angleA).toBeCloseTo(angle, 5); // Check if the angle is close to the expected value
42
- }
43
- });
@@ -1,14 +0,0 @@
1
- import { Vec3 } from "../../Math/types";
2
- import { vec3 } from "../../Math/vec3";
3
-
4
- test("vec3.create", () => {
5
- const v = vec3.create(1, 2, 3);
6
- expect(v).toEqual([1, 2, 3]);
7
- });
8
-
9
-
10
- test("vec3.length", () => {
11
- const v = vec3.create(3, 4, 0);
12
- const length = vec3.length(v);
13
- expect(length).toBe(5);
14
- });
@@ -1,80 +0,0 @@
1
- import { latLongToPixelXY } from "../util";
2
-
3
-
4
-
5
- /**
6
- * @param {Array.<Array.<number>>} coordinates
7
- * @param {Array.<number>} timestamps
8
- * @param {Array.<String>} styleGroupNameArray
9
- * @param {Object.<string, TrackStyleGroup>} _groupColorMap
10
- * @param {Float32Array} floatArray
11
- * @param {number} offset
12
- *
13
- * create floatArray with createFloat32Array before calling this function.
14
- * start offset from 0.
15
- * feed the floatArray with a track data and offset that is returned from the previous call.
16
- */
17
- function featuresToLineStringData(data) {
18
- /**
19
- * features are the tracks
20
- * feature[i].geometry.coordinates are the points of the track
21
- * feature[i].properties.messageTime are the timestamps of the points
22
- *
23
- */
24
- const features = data.features;
25
- let size = data.features.length - 1;
26
-
27
- let startTime = features[0].properties.messageTime[0];
28
- let endTime = features[0].properties.messageTime[features[0].properties.messageTime.length - 1];
29
-
30
- for (let feature of features) {
31
- size += feature.properties.messageTime.length;
32
- startTime = Math.min(startTime, feature.properties.messageTime[0]);
33
- endTime = Math.max(endTime, feature.properties.messageTime[feature.properties.messageTime.length - 1]);
34
- }
35
- const array = new Float32Array(size * 9);
36
- let offset = 0;
37
-
38
- {
39
- const feature = features[0];
40
- const coordinates = feature.geometry.coordinates;
41
- const timestamps = feature.properties.messageTime.map((time) => (time - startTime) / 1000);
42
- offset = fillSliceOfFloat32ArrayLineStrip(array, offset, coordinates, timestamps);
43
- }
44
- for (let i = 1; i < features.length; i++) {
45
- const feature = features[i];
46
- const coordinates = feature.geometry.coordinates;
47
- const timestamps = feature.properties.messageTime.map((time) => (time - startTime) / 1000);
48
- offset = addCuttingPointLineStrip(array, offset);
49
- offset = fillSliceOfFloat32ArrayLineStrip(array, offset, coordinates, timestamps);
50
- }
51
-
52
- return { data: array, startTime, endTime };
53
- }
54
-
55
-
56
- function fillSliceOfFloat32ArrayLineStrip(floatArray, offset, coordinates, timestamps, { styleGroupNameArray = null, groupColorFunction = () => [Math.random(), Math.random(), Math.random()] } = {}) {
57
- const startTime = timestamps[0];
58
- const endTime = timestamps[timestamps.length - 1];
59
- for (let i = 0; i < coordinates.length; i++) {
60
- const time = timestamps[i];
61
- const coord = coordinates[i];
62
- const styleGroupName = styleGroupNameArray ? styleGroupNameArray[i] : "default";
63
- const { x, y } = latLongToPixelXY(coord[1], coord[0]);
64
- const z = coord[2] ? coord[2] / 1000.0 : 0;
65
- floatArray.set([x, y, z, time, ...groupColorFunction(styleGroupName), startTime, endTime], offset);
66
- offset += 9;
67
- }
68
- return offset;
69
- }
70
-
71
- function addCuttingPointLineStrip(floatArray, offset) {
72
- floatArray.set(new Float32Array(9).fill(NaN), offset);
73
- return offset + 9;
74
- }
75
-
76
-
77
-
78
-
79
-
80
- export { addCuttingPointLineStrip, featuresToLineStringData, fillSliceOfFloat32ArrayLineStrip, latLongToPixelXY };