@pirireis/webglobeplugins 0.8.15-alpha → 0.8.17
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.
- package/Math/arc.ts +239 -0
- package/Math/bounds/line-bbox.js +225 -0
- package/Math/constants.ts +8 -0
- package/Math/methodology/arc-part-on-screen.ts +47 -0
- package/Math/methods.js +1 -3
- package/Math/plane.ts +167 -0
- package/Math/quaternion.ts +159 -0
- package/Math/ray.ts +101 -0
- package/Math/roadmap.md +10 -0
- package/Math/types.ts +36 -0
- package/Math/utils.js +3 -0
- package/Math/vector3d.ts +230 -0
- package/jest.config.js +6 -0
- package/package.json +1 -1
- package/point-heat-map/plugin-webworker.js +1 -1
- package/programs/line-on-globe/circle-accurate-flat.js +18 -3
- package/tests/Math/arc.test.ts +52 -0
- package/tests/Math/plane.test.ts +45 -0
- package/tests/Math/quaternion.test.ts +98 -0
- package/tests/Math/ray-plane.test.ts +176 -0
- package/tests/Math/vector3d.test.ts +71 -0
- package/util/geometry/index.js +8 -5
- package/util/surface-line-data/arc-bboxes.ts +42 -0
- package/util/surface-line-data/arcs-to-cuts.js +74 -0
- package/util/surface-line-data/flow.ts +52 -0
- package/util/surface-line-data/rbush-manager.js +0 -0
- package/util/surface-line-data/types.ts +27 -0
- package/util/surface-line-data/web-worker.js +0 -0
- package/waveparticles/plugin.js +1 -1
- package/webworker-test/index.js +0 -10
- package/webworker-test/module.js +0 -10
- package/webworker-test/worker.js +0 -8
- /package/{webpack.config.js → util/surface-line-data/cut-arc.js} +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class FlowManager {
|
|
6
|
+
_populateCount: number;
|
|
7
|
+
_rbush: RBush<any>;
|
|
8
|
+
_arcToCutsManager: ArcToCutsManager;
|
|
9
|
+
consturctor({ populateCount = 36, dotDistanceOfArcCuts = 1 / Math.pow(2, 10 - 1) }) {
|
|
10
|
+
this._populateCount = populateCount;
|
|
11
|
+
|
|
12
|
+
// does the cutting and id mapping(one to many)
|
|
13
|
+
// cuts have their bbox ready for rbush
|
|
14
|
+
this._rbush = new RBush(1000);
|
|
15
|
+
this._arcToCutsManager = new ArcToCutsManager({ dotDistanceOfArcCuts, rbush: this._rbush }); // 10km
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* adds or updates an arc in the rbush and the cuts manager
|
|
25
|
+
*/
|
|
26
|
+
insertArc(arc: Arc) {
|
|
27
|
+
this._arcToCutsManager.insertArc(arc);
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
deleteArc(id: Arc['id']) {
|
|
34
|
+
this._arcToCutsManager.deleteArc(id);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
queryBBox(bbox: BBox) {
|
|
39
|
+
|
|
40
|
+
const arcIDSet = new Set(this._rbush.query(bbox).map(x => x.id)); // sets Of ids of arcs
|
|
41
|
+
|
|
42
|
+
// arcs U bbox => arcs
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
// populate points
|
|
46
|
+
// return typed array of points belonging to all the arcs of cuts
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type BBox = {
|
|
2
|
+
minX: number;
|
|
3
|
+
minY: number;
|
|
4
|
+
maxX: number;
|
|
5
|
+
maxY: number;
|
|
6
|
+
id?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type Point = { lon: number, lat: number };
|
|
10
|
+
type Vector = [number, number, number]; // x y z
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
type Arc = {
|
|
14
|
+
id: string;
|
|
15
|
+
start: number[];
|
|
16
|
+
end: number[];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
interface RBUSH {
|
|
21
|
+
insert: (item: BBox) => void;
|
|
22
|
+
remove: (item: BBox) => void;
|
|
23
|
+
search: (bbox: BBox) => BBox[];
|
|
24
|
+
clear: () => void;
|
|
25
|
+
all: () => BBox[];
|
|
26
|
+
|
|
27
|
+
}
|
|
File without changes
|
package/waveparticles/plugin.js
CHANGED
|
@@ -253,7 +253,7 @@ export default class Plugin {
|
|
|
253
253
|
|
|
254
254
|
setParticleDimensions(tail, wing) {
|
|
255
255
|
if (0 < tail || 0 < wing) {
|
|
256
|
-
this.waveUbo.update({
|
|
256
|
+
this.waveUbo.update({ tail_wing_base_limp: [tail, wing] });
|
|
257
257
|
} else {
|
|
258
258
|
console.error("tail and wing must be greater than 0");
|
|
259
259
|
}
|
package/webworker-test/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export function testWebWorker() {
|
|
2
|
-
|
|
3
|
-
const worker = new Worker(new URL('./worker.js', import.meta.url), { type: 'module' });
|
|
4
|
-
worker.onmessage = (event) => {
|
|
5
|
-
console.log(event.data);
|
|
6
|
-
worker.terminate();
|
|
7
|
-
};
|
|
8
|
-
worker.postMessage("sumBigNumber");
|
|
9
|
-
return worker;
|
|
10
|
-
}
|
package/webworker-test/module.js
DELETED
package/webworker-test/worker.js
DELETED
|
File without changes
|