@equinor/videx-3d 5.1.0-beta
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/LICENSE.md +21 -0
- package/README.md +120 -0
- package/dist/chunk-BX-cez1_.js +23 -0
- package/dist/chunk-CnY6Tmof.js +358 -0
- package/dist/chunk-MFzFdEWm.js +591 -0
- package/dist/chunk-iY0wQ9Z6.js +887 -0
- package/dist/generators.js +711 -0
- package/dist/main.js +8405 -0
- package/dist/sdk.js +610 -0
- package/dist/shaderLib/color-conversion.glsl +33 -0
- package/dist/shaderLib/colors.glsl +8 -0
- package/dist/shaderLib/glyphs.glsl +78 -0
- package/dist/shaderLib/random.glsl +3 -0
- package/dist/shaderLib/remap.glsl +13 -0
- package/dist/shaderLib/render-number.glsl +74 -0
- package/dist/shaderLib/render-text.glsl +66 -0
- package/dist/shaderLib/rotation.glsl +19 -0
- package/dist/shaderLib/sdf-functions.glsl +18 -0
- package/dist/textures/normal_map.jpg +0 -0
- package/dist/types/common/color-ramps.d.ts +5 -0
- package/dist/types/common/types.d.ts +25 -0
- package/dist/types/components/Annotations/Annotations.d.ts +42 -0
- package/dist/types/components/Annotations/AnnotationsHMTL.d.ts +1 -0
- package/dist/types/components/Annotations/AnnotationsLayer.d.ts +46 -0
- package/dist/types/components/Annotations/AutoUpdate.d.ts +3 -0
- package/dist/types/components/Annotations/DefaultLabelComponent.d.ts +11 -0
- package/dist/types/components/Annotations/TestAnnotations.d.ts +12 -0
- package/dist/types/components/Annotations/annotations-renderer.d.ts +26 -0
- package/dist/types/components/Annotations/annotations-state.d.ts +88 -0
- package/dist/types/components/Annotations/helpers.d.ts +11 -0
- package/dist/types/components/Annotations/index.d.ts +8 -0
- package/dist/types/components/Annotations/types.d.ts +80 -0
- package/dist/types/components/Annotations/update-annotations.d.ts +12 -0
- package/dist/types/components/CameraTargetMarker/CameraTargetMarker.d.ts +29 -0
- package/dist/types/components/Distance/Distance.d.ts +35 -0
- package/dist/types/components/Distance/DistanceContext.d.ts +12 -0
- package/dist/types/components/Distance/index.d.ts +2 -0
- package/dist/types/components/EventEmitter/EventEmitter.d.ts +20 -0
- package/dist/types/components/EventEmitter/EventEmitterContext.d.ts +90 -0
- package/dist/types/components/EventEmitter/index.d.ts +3 -0
- package/dist/types/components/EventEmitter/picking-helper.d.ts +32 -0
- package/dist/types/components/EventEmitter/picking-material.d.ts +11 -0
- package/dist/types/components/Grids/BoxGrid/BoxGrid.d.ts +52 -0
- package/dist/types/components/Grids/Grid/Grid.d.ts +62 -0
- package/dist/types/components/Grids/Grid/GridAxesLabels.d.ts +24 -0
- package/dist/types/components/Grids/Grid/UtmGrid.d.ts +30 -0
- package/dist/types/components/Grids/Grid/grid-helpers.d.ts +2 -0
- package/dist/types/components/Grids/index.d.ts +5 -0
- package/dist/types/components/Highlighter/Highlighter.d.ts +23 -0
- package/dist/types/components/Highlighter/highlight-state.d.ts +43 -0
- package/dist/types/components/Highlighter/index.d.ts +2 -0
- package/dist/types/components/Html/DepthSelector.d.ts +1 -0
- package/dist/types/components/Html/OutputPanel/OutputPanel.d.ts +10 -0
- package/dist/types/components/Html/OutputPanel/index.d.ts +2 -0
- package/dist/types/components/Html/OutputPanel/output-panel-state.d.ts +38 -0
- package/dist/types/components/Html/Panel/Panel.d.ts +20 -0
- package/dist/types/components/Html/WellMap/ActiveTrack.d.ts +9 -0
- package/dist/types/components/Html/WellMap/DepthCursor.d.ts +8 -0
- package/dist/types/components/Html/WellMap/DepthReadout.d.ts +6 -0
- package/dist/types/components/Html/WellMap/Schematic.d.ts +15 -0
- package/dist/types/components/Html/WellMap/Track.d.ts +13 -0
- package/dist/types/components/Html/WellMap/WellMap.d.ts +47 -0
- package/dist/types/components/Html/WellMap/addons/WellMapCasingShoes.d.ts +14 -0
- package/dist/types/components/Html/WellMap/addons/WellMapCompletionIntervals.d.ts +15 -0
- package/dist/types/components/Html/WellMap/addons/WellMapFormations.d.ts +14 -0
- package/dist/types/components/Html/WellMap/addons/WellMapTvd.d.ts +14 -0
- package/dist/types/components/Html/WellMap/addons/index.d.ts +4 -0
- package/dist/types/components/Html/WellMap/index.d.ts +4 -0
- package/dist/types/components/Html/WellMap/themes.d.ts +13 -0
- package/dist/types/components/Html/WellMap/well-map-context.d.ts +34 -0
- package/dist/types/components/Html/WellMap/well-map-state.d.ts +38 -0
- package/dist/types/components/Html/index.d.ts +5 -0
- package/dist/types/components/ObservableGroup/ObservableGroup.d.ts +38 -0
- package/dist/types/components/SDFTest/SDFTest.d.ts +12 -0
- package/dist/types/components/Surfaces/Surface.d.ts +46 -0
- package/dist/types/components/Surfaces/SurfaceMaterial.d.ts +53 -0
- package/dist/types/components/Surfaces/index.d.ts +4 -0
- package/dist/types/components/Surfaces/surface-defs.d.ts +7 -0
- package/dist/types/components/Symbol/Symbol.d.ts +45 -0
- package/dist/types/components/Symbol/index.d.ts +1 -0
- package/dist/types/components/UtmArea/UtmArea.d.ts +37 -0
- package/dist/types/components/UtmArea/UtmAreaContext.d.ts +32 -0
- package/dist/types/components/UtmArea/UtmPosition.d.ts +26 -0
- package/dist/types/components/UtmArea/Wgs84Position.d.ts +26 -0
- package/dist/types/components/UtmArea/index.d.ts +4 -0
- package/dist/types/components/Wellbores/BasicTrajectory/BasicTrajectory.d.ts +27 -0
- package/dist/types/components/Wellbores/BasicTrajectory/basic-trajectory-defs.d.ts +3 -0
- package/dist/types/components/Wellbores/BasicTrajectory/index.d.ts +2 -0
- package/dist/types/components/Wellbores/Casings/CasingAnnotations/CasingAnnotations.d.ts +9 -0
- package/dist/types/components/Wellbores/Casings/CasingAnnotations/CasingLabel.d.ts +9 -0
- package/dist/types/components/Wellbores/Casings/CasingAnnotations/casing-annotations-defs.d.ts +1 -0
- package/dist/types/components/Wellbores/Casings/Casings.d.ts +42 -0
- package/dist/types/components/Wellbores/Casings/casings-defs.d.ts +6 -0
- package/dist/types/components/Wellbores/Casings/index.d.ts +5 -0
- package/dist/types/components/Wellbores/CompletionTools/CompletionAnnotations/CompletionAnnotations.d.ts +9 -0
- package/dist/types/components/Wellbores/CompletionTools/CompletionAnnotations/completion-annotations-defs.d.ts +1 -0
- package/dist/types/components/Wellbores/CompletionTools/CompletionTools.d.ts +31 -0
- package/dist/types/components/Wellbores/CompletionTools/Screen/screen-material.d.ts +8 -0
- package/dist/types/components/Wellbores/CompletionTools/completion-tools-defs.d.ts +4 -0
- package/dist/types/components/Wellbores/CompletionTools/index.d.ts +5 -0
- package/dist/types/components/Wellbores/DepthMarkers/DepthMarkerLabel.d.ts +11 -0
- package/dist/types/components/Wellbores/DepthMarkers/DepthMarkers.d.ts +27 -0
- package/dist/types/components/Wellbores/DepthMarkers/depth-markers-defs.d.ts +1 -0
- package/dist/types/components/Wellbores/DepthMarkers/index.d.ts +3 -0
- package/dist/types/components/Wellbores/FormationMarkers/FormationMarkerLabel.d.ts +10 -0
- package/dist/types/components/Wellbores/FormationMarkers/FormationMarkers.d.ts +33 -0
- package/dist/types/components/Wellbores/FormationMarkers/formation-markers-defs.d.ts +3 -0
- package/dist/types/components/Wellbores/FormationMarkers/index.d.ts +3 -0
- package/dist/types/components/Wellbores/Perforations/Perforations.d.ts +32 -0
- package/dist/types/components/Wellbores/Perforations/index.d.ts +2 -0
- package/dist/types/components/Wellbores/Perforations/perforations-defs.d.ts +3 -0
- package/dist/types/components/Wellbores/Perimeter/Perimeter.d.ts +29 -0
- package/dist/types/components/Wellbores/Perimeter/index.d.ts +2 -0
- package/dist/types/components/Wellbores/Perimeter/perimeter-defs.d.ts +3 -0
- package/dist/types/components/Wellbores/PositionMarkers/PositionMarkers.d.ts +12 -0
- package/dist/types/components/Wellbores/PositionMarkers/position-markers-defs.d.ts +3 -0
- package/dist/types/components/Wellbores/Shoes/Shoes.d.ts +34 -0
- package/dist/types/components/Wellbores/Shoes/index.d.ts +2 -0
- package/dist/types/components/Wellbores/Shoes/shoes-defs.d.ts +3 -0
- package/dist/types/components/Wellbores/TubeTrajectory/TubeTrajectory.d.ts +25 -0
- package/dist/types/components/Wellbores/TubeTrajectory/index.d.ts +2 -0
- package/dist/types/components/Wellbores/TubeTrajectory/tube-geometry-defs.d.ts +3 -0
- package/dist/types/components/Wellbores/Wellbore/Wellbore.d.ts +45 -0
- package/dist/types/components/Wellbores/Wellbore/WellboreContext.d.ts +19 -0
- package/dist/types/components/Wellbores/Wellbore/index.d.ts +2 -0
- package/dist/types/components/Wellbores/WellboreBounds/WellboreBounds.d.ts +47 -0
- package/dist/types/components/Wellbores/WellboreBounds/index.d.ts +2 -0
- package/dist/types/components/Wellbores/WellboreBounds/wellbore-bounds-defs.d.ts +1 -0
- package/dist/types/components/Wellbores/WellboreFormationColumn/WellboreFormationColumn.d.ts +30 -0
- package/dist/types/components/Wellbores/WellboreFormationColumn/index.d.ts +2 -0
- package/dist/types/components/Wellbores/WellboreFormationColumn/wellbore-formation-column-defs.d.ts +3 -0
- package/dist/types/components/Wellbores/WellboreLabel/WellboreAnnotationLabel.d.ts +10 -0
- package/dist/types/components/Wellbores/WellboreLabel/WellboreLabel.d.ts +25 -0
- package/dist/types/components/Wellbores/WellboreLabel/index.d.ts +3 -0
- package/dist/types/components/Wellbores/WellboreLabel/wellbore-label-defs.d.ts +1 -0
- package/dist/types/components/Wellbores/WellboreRibbon/WellboreRibbon.d.ts +22 -0
- package/dist/types/components/Wellbores/WellboreRibbon/WellboreRibbonContext.d.ts +16 -0
- package/dist/types/components/Wellbores/WellboreRibbon/index.d.ts +4 -0
- package/dist/types/components/Wellbores/WellboreRibbon/stripes/FormationsStripe.d.ts +30 -0
- package/dist/types/components/Wellbores/WellboreRibbon/stripes/MeasuredDepthStripe.d.ts +28 -0
- package/dist/types/components/Wellbores/WellboreSeismicSection/WellboreSeismicSection.d.ts +34 -0
- package/dist/types/components/Wellbores/WellboreSeismicSection/index.d.ts +2 -0
- package/dist/types/components/Wellbores/WellboreSeismicSection/wellbore-seismic-section-defs.d.ts +12 -0
- package/dist/types/components/Wellbores/Wells/Wells.d.ts +43 -0
- package/dist/types/components/Wellbores/Wells/index.d.ts +1 -0
- package/dist/types/contexts/DataContext.d.ts +15 -0
- package/dist/types/contexts/DataContextProvider.d.ts +33 -0
- package/dist/types/contexts/GeneratorsContext.d.ts +13 -0
- package/dist/types/contexts/GeneratorsContextProvider.d.ts +34 -0
- package/dist/types/contexts/GlyphsContext.d.ts +19 -0
- package/dist/types/contexts/GlyphsContextProvider.d.ts +29 -0
- package/dist/types/events/camera-events.d.ts +34 -0
- package/dist/types/events/depth-events.d.ts +22 -0
- package/dist/types/events/interaction-events.d.ts +7 -0
- package/dist/types/events/wellbore-events.d.ts +46 -0
- package/dist/types/generators/basic-trajectory-generator.d.ts +2 -0
- package/dist/types/generators/casing-annotations-generator.d.ts +8 -0
- package/dist/types/generators/casings-generator.d.ts +4 -0
- package/dist/types/generators/completion-annotations-generator.d.ts +7 -0
- package/dist/types/generators/completion-tools-generator.d.ts +2 -0
- package/dist/types/generators/depth-markers-generator.d.ts +3 -0
- package/dist/types/generators/formation-markers-generator.d.ts +2 -0
- package/dist/types/generators/index.d.ts +20 -0
- package/dist/types/generators/perforations-generator.d.ts +2 -0
- package/dist/types/generators/perimieter-generator.d.ts +2 -0
- package/dist/types/generators/position-markers-generator.d.ts +2 -0
- package/dist/types/generators/shoes-generator.d.ts +2 -0
- package/dist/types/generators/surface-generator.d.ts +4 -0
- package/dist/types/generators/tube-trajectory-generator.d.ts +2 -0
- package/dist/types/generators/wellbore-bounds-generator.d.ts +2 -0
- package/dist/types/generators/wellbore-formation-column-generator.d.ts +2 -0
- package/dist/types/generators/wellbore-label-generator.d.ts +7 -0
- package/dist/types/generators/wellbore-seismic-section-generator.d.ts +3 -0
- package/dist/types/hooks/useData.d.ts +25 -0
- package/dist/types/hooks/useGenerator.d.ts +43 -0
- package/dist/types/hooks/useWellboreContext.d.ts +13 -0
- package/dist/types/layers/layers.d.ts +6 -0
- package/dist/types/main.d.ts +48 -0
- package/dist/types/rendering/fullscreen-renderer.d.ts +9 -0
- package/dist/types/rendering/index.d.ts +2 -0
- package/dist/types/rendering/render-passes.d.ts +16 -0
- package/dist/types/sdk/data/DataLoader.d.ts +54 -0
- package/dist/types/sdk/data/GeneratorRegistry.d.ts +15 -0
- package/dist/types/sdk/data/Store.d.ts +29 -0
- package/dist/types/sdk/data/helpers/formations-helpers.d.ts +24 -0
- package/dist/types/sdk/data/helpers/well-helpers.d.ts +9 -0
- package/dist/types/sdk/data/types/Casing.d.ts +8 -0
- package/dist/types/sdk/data/types/CompletionTool.d.ts +11 -0
- package/dist/types/sdk/data/types/DepthReferencePoint.d.ts +1 -0
- package/dist/types/sdk/data/types/Formation.d.ts +32 -0
- package/dist/types/sdk/data/types/PerforationInterval.d.ts +9 -0
- package/dist/types/sdk/data/types/Pick.d.ts +8 -0
- package/dist/types/sdk/data/types/PositionLog.d.ts +17 -0
- package/dist/types/sdk/data/types/StratColumn.d.ts +18 -0
- package/dist/types/sdk/data/types/SurfaceMeta.d.ts +23 -0
- package/dist/types/sdk/data/types/SurfaceValues.d.ts +1 -0
- package/dist/types/sdk/data/types/Symbol.d.ts +6 -0
- package/dist/types/sdk/data/types/VerticalSlice.d.ts +9 -0
- package/dist/types/sdk/data/types/WellboreHeader.d.ts +15 -0
- package/dist/types/sdk/data/types/index.d.ts +11 -0
- package/dist/types/sdk/geometries/curve/curve-3d.d.ts +46 -0
- package/dist/types/sdk/geometries/curve/tube-geometry.d.ts +34 -0
- package/dist/types/sdk/geometries/delatin.d.ts +44 -0
- package/dist/types/sdk/geometries/fence.d.ts +3 -0
- package/dist/types/sdk/geometries/packing.d.ts +46 -0
- package/dist/types/sdk/geometries/triangulate-grid-delaunay.d.ts +8 -0
- package/dist/types/sdk/geometries/triangulate-grid.d.ts +28 -0
- package/dist/types/sdk/index.d.ts +39 -0
- package/dist/types/sdk/managers/CameraManager.d.ts +11 -0
- package/dist/types/sdk/managers/WellboreManager.d.ts +18 -0
- package/dist/types/sdk/materials/depth-material.d.ts +4 -0
- package/dist/types/sdk/materials/ribbon-material.d.ts +24 -0
- package/dist/types/sdk/materials/tube-material.d.ts +7 -0
- package/dist/types/sdk/materials/uv-material.d.ts +2 -0
- package/dist/types/sdk/projection/crs.d.ts +37 -0
- package/dist/types/sdk/types/common.d.ts +4 -0
- package/dist/types/sdk/utils/array.d.ts +0 -0
- package/dist/types/sdk/utils/colors.d.ts +2 -0
- package/dist/types/sdk/utils/conversions.d.ts +5 -0
- package/dist/types/sdk/utils/depth-reader.d.ts +5 -0
- package/dist/types/sdk/utils/elevation-map.d.ts +15 -0
- package/dist/types/sdk/utils/glyphs.d.ts +50 -0
- package/dist/types/sdk/utils/irapbin-parser.d.ts +17 -0
- package/dist/types/sdk/utils/num-array.d.ts +2 -0
- package/dist/types/sdk/utils/numbers.d.ts +5 -0
- package/dist/types/sdk/utils/packing.d.ts +1 -0
- package/dist/types/sdk/utils/scene.d.ts +2 -0
- package/dist/types/sdk/utils/segments.d.ts +4 -0
- package/dist/types/sdk/utils/strings.d.ts +2 -0
- package/dist/types/sdk/utils/trajectory.d.ts +59 -0
- package/dist/types/sdk/utils/trigonometry.d.ts +12 -0
- package/dist/types/sdk/utils/typed-2d-array.d.ts +52 -0
- package/dist/types/sdk/utils/typed-array.d.ts +2 -0
- package/dist/types/sdk/utils/vector-operations.d.ts +29 -0
- package/package.json +127 -0
package/dist/sdk.js
ADDED
|
@@ -0,0 +1,610 @@
|
|
|
1
|
+
import { wrap as Z } from "comlink";
|
|
2
|
+
import $ from "p-limit";
|
|
3
|
+
import { x as ct, D as ft, P as ut, b as dt, a as gt, c as pt, T as wt, y as yt, z as mt, A as xt, B as bt, p as vt, d as _t, E as Mt, F as At, G as Ft, H as Lt, I as St, J as Vt, K as It, L as Bt, M as Et, e as Tt, N as Dt, o as qt, O as zt, Q as Gt, R as kt, i as Pt, S as jt, U as Nt, V as Ct, X as Qt, g as Ut, Y as Wt, Z as Ht, _ as Zt, $ as $t, h as Jt, m as Kt, a0 as Ot, a1 as Xt, a2 as Yt, n as Rt, a3 as te, f as ee, a4 as se, a5 as ie, a6 as re, a7 as ne, a8 as ae, a9 as le, aa as oe, ab as he, ac as ce, ad as fe, ae as ue, af as de, ag as ge, s as pe, ah as we, ai as ye, aj as me, u as xe, ak as be } from "./chunk-iY0wQ9Z6.js";
|
|
4
|
+
import { C as _e, T as Me, c as Ae, b as Fe, a as Le, d as Se, e as Ve, g as Ie, f as Be, t as Ee, h as Te, w as De } from "./chunk-CnY6Tmof.js";
|
|
5
|
+
import { D as ze, c as Ge, a as ke, b as Pe, t as je, d as Ne } from "./chunk-MFzFdEWm.js";
|
|
6
|
+
const J = 10, K = 25;
|
|
7
|
+
class Y {
|
|
8
|
+
store;
|
|
9
|
+
config;
|
|
10
|
+
cached = /* @__PURE__ */ new Map();
|
|
11
|
+
_activeLoaders = {};
|
|
12
|
+
_batchqueue = /* @__PURE__ */ new Map();
|
|
13
|
+
_flushScheduled = null;
|
|
14
|
+
constructor(t, e = {}) {
|
|
15
|
+
this.store = t, this.config = { ...e }, this.config.batched && (this.config.batchSize === void 0 && (this.config.batchSize = J), this.config.batchMaxDelay === void 0 && (this.config.batchMaxDelay = K)), this._flushScheduled = null;
|
|
16
|
+
}
|
|
17
|
+
async init(...t) {
|
|
18
|
+
if (this.config.init)
|
|
19
|
+
try {
|
|
20
|
+
const e = await this.config.init(...t);
|
|
21
|
+
if (Array.isArray(e))
|
|
22
|
+
return this.cached = new Map(e), !0;
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.warn("Init failed", e);
|
|
25
|
+
}
|
|
26
|
+
return this.clear(), !1;
|
|
27
|
+
}
|
|
28
|
+
async all() {
|
|
29
|
+
if (this.config.preloaded) {
|
|
30
|
+
if (this.config.transform) {
|
|
31
|
+
const t = this.config.transform;
|
|
32
|
+
return Array.from(this.cached.values()).map((e) => t(e));
|
|
33
|
+
}
|
|
34
|
+
return Array.from(this.cached.values());
|
|
35
|
+
} else
|
|
36
|
+
console.warn('Data Loader: "all" called on non-preloaded dataset!');
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
async _enqueueRequest(t) {
|
|
40
|
+
if (this._batchqueue.has(t))
|
|
41
|
+
return this._batchqueue.get(t).promise;
|
|
42
|
+
let e = null;
|
|
43
|
+
const i = new Promise((n) => {
|
|
44
|
+
e = n;
|
|
45
|
+
}), r = {
|
|
46
|
+
key: t,
|
|
47
|
+
promise: i,
|
|
48
|
+
_resolve: e
|
|
49
|
+
};
|
|
50
|
+
return this._batchqueue.set(t, r), this._flushScheduled || (this._flushScheduled = setTimeout(() => {
|
|
51
|
+
this._processBatchQueue();
|
|
52
|
+
}, this.config.batchMaxDelay)), i;
|
|
53
|
+
}
|
|
54
|
+
async _processBatch(t) {
|
|
55
|
+
const e = t.map((i) => i.key);
|
|
56
|
+
if (!this.config.batchLoad) return null;
|
|
57
|
+
this.config.batchLoad(e).then((i) => {
|
|
58
|
+
Array.isArray(i) && i.forEach(([r, n]) => {
|
|
59
|
+
this.set(r, n);
|
|
60
|
+
});
|
|
61
|
+
}).catch((i) => {
|
|
62
|
+
console.warn("Batch load failed", i);
|
|
63
|
+
}).finally(() => {
|
|
64
|
+
t.forEach((i) => {
|
|
65
|
+
const r = this.cached.get(i.key) || null;
|
|
66
|
+
i._resolve(r);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async _processBatchQueue() {
|
|
71
|
+
let t = [];
|
|
72
|
+
for (const e of this._batchqueue.values())
|
|
73
|
+
t.push(e), this._batchqueue.delete(e.key), (t.length >= this.config.batchSize || this._batchqueue.size === 0) && (this._processBatch(t), t = []);
|
|
74
|
+
this._batchqueue.size ? this._flushScheduled = setTimeout(() => this._processBatchQueue(), 1) : this._flushScheduled = null;
|
|
75
|
+
}
|
|
76
|
+
async get(t, e) {
|
|
77
|
+
if (this.cached.has(t))
|
|
78
|
+
return this.config.transform ? this.config.transform(this.cached.get(t)) : this.cached.get(t);
|
|
79
|
+
if (this.config.preloaded) return null;
|
|
80
|
+
if (!this.config.batched && this.config.load) {
|
|
81
|
+
if (this.config.noCache)
|
|
82
|
+
return this.config.load(t, e);
|
|
83
|
+
let i = this._activeLoaders[t];
|
|
84
|
+
if (!i) {
|
|
85
|
+
if (e)
|
|
86
|
+
throw Error(
|
|
87
|
+
"DataLoader: A load function with additional args may not be cached. Set noCache to true in config."
|
|
88
|
+
);
|
|
89
|
+
i = this.config.load(t).then((r) => {
|
|
90
|
+
r && this.cached.set(t, r);
|
|
91
|
+
}).catch((r) => {
|
|
92
|
+
console.warn("Load failed", r);
|
|
93
|
+
}).finally(() => {
|
|
94
|
+
delete this._activeLoaders[t];
|
|
95
|
+
}), this._activeLoaders[t] = i;
|
|
96
|
+
}
|
|
97
|
+
return await i, this.config.transform ? this.config.transform(this.cached.get(t)) : this.cached.get(t);
|
|
98
|
+
}
|
|
99
|
+
return this.config.batched && this.config.batchLoad ? this._enqueueRequest(t) : null;
|
|
100
|
+
}
|
|
101
|
+
set(t, e) {
|
|
102
|
+
this.cached.set(t, e);
|
|
103
|
+
}
|
|
104
|
+
clear() {
|
|
105
|
+
this.cached.clear();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
class R {
|
|
109
|
+
store = null;
|
|
110
|
+
config;
|
|
111
|
+
generators = /* @__PURE__ */ new Map();
|
|
112
|
+
constructor(t = {}, e) {
|
|
113
|
+
this.config = { concurrentStoreCalls: 0, ...t }, e && this.setStore(e);
|
|
114
|
+
}
|
|
115
|
+
add(t, e) {
|
|
116
|
+
this.generators.set(t, e);
|
|
117
|
+
}
|
|
118
|
+
setStore(t) {
|
|
119
|
+
if (t && this.config.concurrentStoreCalls) {
|
|
120
|
+
const e = $(this.config.concurrentStoreCalls), i = {
|
|
121
|
+
get: (r, n, s) => e(() => t.get(r, n, s)),
|
|
122
|
+
all: (r) => e(() => t.all(r)),
|
|
123
|
+
query: (r, n) => e(() => t.query(r, n))
|
|
124
|
+
};
|
|
125
|
+
this.store = i;
|
|
126
|
+
} else
|
|
127
|
+
this.store = t;
|
|
128
|
+
}
|
|
129
|
+
async connectRemoteStore(t) {
|
|
130
|
+
const e = Z(t);
|
|
131
|
+
this.setStore(e);
|
|
132
|
+
}
|
|
133
|
+
async invoke(t, ...e) {
|
|
134
|
+
if (!this.store) throw Error("No available store!");
|
|
135
|
+
if (!this.generators.has(t))
|
|
136
|
+
throw Error(`Generator with key '${t}' not found!`);
|
|
137
|
+
return this.generators.get(t).bind(this.store)(...e);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function tt(u, t, e = 1, i = 1, r = (n) => n) {
|
|
141
|
+
console.time("triangulate");
|
|
142
|
+
const n = [], s = [], a = [], c = [], h = u.length / t;
|
|
143
|
+
let l, o, d, g, v, y, m, _, A, S, b, V, M, F, L, k, f, C, D, q, z, p, x, Q, H = 0, U = 0, W = 0, B = new Array(t).fill(null), P = new Array(t).fill(null);
|
|
144
|
+
const w = new Array(t - 1).fill(null);
|
|
145
|
+
function j(I, T, G) {
|
|
146
|
+
return n.push({ x: I * e, y: G, z: T * i, edge: null }), a.push(I / (t - 1), 1 - T / (h - 1)), H++;
|
|
147
|
+
}
|
|
148
|
+
function E(I, T, G) {
|
|
149
|
+
D = {
|
|
150
|
+
index: U++,
|
|
151
|
+
tail: I,
|
|
152
|
+
head: T,
|
|
153
|
+
twin: null,
|
|
154
|
+
prev: null,
|
|
155
|
+
next: null
|
|
156
|
+
}, q = {
|
|
157
|
+
index: U++,
|
|
158
|
+
tail: T,
|
|
159
|
+
head: G,
|
|
160
|
+
twin: null,
|
|
161
|
+
prev: null,
|
|
162
|
+
next: null
|
|
163
|
+
}, z = {
|
|
164
|
+
index: U++,
|
|
165
|
+
tail: G,
|
|
166
|
+
head: I,
|
|
167
|
+
twin: null,
|
|
168
|
+
prev: null,
|
|
169
|
+
next: null
|
|
170
|
+
}, D.next = q, q.next = z, z.next = D, D.prev = z, q.prev = D, z.prev = q, n[I].edge || (n[I].edge = D), n[T].edge || (n[T].edge = q), n[G].edge || (n[G].edge = z), s.push(D, q, z), c.push(I, T, G);
|
|
171
|
+
}
|
|
172
|
+
for (k = 1; k < h - 1; k++) {
|
|
173
|
+
Q = !1;
|
|
174
|
+
const I = B;
|
|
175
|
+
for (B = P, P = I.fill(null), p = null, C = k - 1, W += t, L = 1; L < t - 1; L++)
|
|
176
|
+
f = L - 1, S = W + L, A = S - 1, _ = S - t, m = _ - 1, b = r(u[m]), V = r(u[_]), M = r(u[A]), F = r(u[S]), b !== null && V !== null && M !== null && F !== null ? x = 1 : b !== null && V !== null && M !== null ? x = 2 : b !== null && V !== null && F !== null ? x = 3 : b !== null && M !== null && F !== null ? x = 4 : V !== null && M !== null && F !== null ? x = 5 : x = 0, d = null, g = null, x !== 0 ? (Q ? (l = B[f], d = P[f]) : (x !== 5 && (B[f] === null ? (l = j(f, C, b), B[f] = l) : l = B[f]), x !== 3 && (d = j(f, k, M)), P[f] = d), x !== 4 && (B[L] === null ? (o = j(L, C, V), B[L] = o) : o = B[L]), x !== 2 && (g = j(L, k, F)), x === 1 ? (v = Math.abs(n[l].y - n[g].y), y = Math.abs(n[o].y - n[d].y), v < y ? (E(l, d, g), p !== null && (s[s.length - 3].twin = p, p.twin = s[s.length - 3]), E(g, o, l), w[f] !== null && (s[s.length - 2].twin = w[f], w[f].twin = s[s.length - 2]), s[s.length - 4].twin = s[s.length - 1], s[s.length - 1].twin = s[s.length - 4], w[f] = s[s.length - 5], p = s[s.length - 3]) : (E(l, d, o), w[f] !== null && (s[s.length - 1].twin = w[f], w[f].twin = s[s.length - 1]), p !== null && (s[s.length - 3].twin = p, p.twin = s[s.length - 3]), E(o, d, g), s[s.length - 5].twin = s[s.length - 3], s[s.length - 3].twin = s[s.length - 5], w[f] = s[s.length - 2], p = s[s.length - 1])) : x === 2 ? (E(l, d, o), w[f] !== null && (s[s.length - 1].twin = w[f], w[f].twin = s[s.length - 1]), p !== null && (s[s.length - 3].twin = p, p.twin = s[s.length - 3]), w[f] = null, p = null) : x === 5 ? (E(o, d, g), w[f] = s[s.length - 2], p = s[s.length - 1]) : x === 3 ? (E(o, l, g), w[f] !== null && (s[s.length - 3].twin = w[f], w[f].twin = s[s.length - 3]), w[f] = null, p = s[s.length - 1]) : (E(l, d, g), p !== null && (s[s.length - 3].twin = p, p.twin = s[s.length - 3]), w[f] = s[s.length - 2], p = null)) : (w[f] = null, p = null), P[L] = g, Q = !!x;
|
|
177
|
+
}
|
|
178
|
+
return console.timeEnd("triangulate"), console.log(c.length / 3), { vertices: n, indices: c, uvs: a, edges: s };
|
|
179
|
+
}
|
|
180
|
+
const et = (u) => `#${u.toString(16).padStart(6, "0")}`;
|
|
181
|
+
function st() {
|
|
182
|
+
const u = "123456789ABCDEF";
|
|
183
|
+
let t = "#";
|
|
184
|
+
for (let e = 0; e < 6; e++)
|
|
185
|
+
t += u[Math.floor(Math.random() * 16)];
|
|
186
|
+
return t;
|
|
187
|
+
}
|
|
188
|
+
async function it(u, t = -1, e = null) {
|
|
189
|
+
const i = await u.arrayBuffer(), r = new DataView(i), n = {
|
|
190
|
+
ny: r.getInt32(8, !1),
|
|
191
|
+
xori: r.getFloat32(12, !1),
|
|
192
|
+
xmax: r.getFloat32(16, !1),
|
|
193
|
+
yori: r.getFloat32(20, !1),
|
|
194
|
+
ymax: r.getFloat32(24, !1),
|
|
195
|
+
xinc: r.getFloat32(28, !1),
|
|
196
|
+
yinc: r.getFloat32(32, !1),
|
|
197
|
+
nx: r.getInt32(44, !1),
|
|
198
|
+
rot: r.getFloat32(48, !1)
|
|
199
|
+
}, s = 1e30, a = 1e-30, c = new Float32Array(n.nx * n.ny);
|
|
200
|
+
let h, l, o, d, g, v = 0, y = 100;
|
|
201
|
+
for (; y < r.byteLength; ) {
|
|
202
|
+
l = r.getInt32(y), y += 4;
|
|
203
|
+
for (let m = 0; m < l; m += 4)
|
|
204
|
+
h = r.getFloat32(y + m, !1), o = v % n.nx, d = n.ny - Math.floor(v / n.nx), g = (d - 1) * n.nx + o, c[g] = h < a || h > s ? t : e ? e - h : h, v++;
|
|
205
|
+
y += l + 4;
|
|
206
|
+
}
|
|
207
|
+
return { header: n, data: c };
|
|
208
|
+
}
|
|
209
|
+
function rt(u) {
|
|
210
|
+
return u.map((t) => -t);
|
|
211
|
+
}
|
|
212
|
+
function nt(u, t) {
|
|
213
|
+
return u.map((e) => e * t);
|
|
214
|
+
}
|
|
215
|
+
function at(u, t, e) {
|
|
216
|
+
const i = (r) => {
|
|
217
|
+
if (r.userData[u] && r.userData[u] === t)
|
|
218
|
+
return r;
|
|
219
|
+
if (r.children && r.children.length)
|
|
220
|
+
for (let n = 0; n < r.children.length; n++) {
|
|
221
|
+
const s = i(r.children[n]);
|
|
222
|
+
if (s)
|
|
223
|
+
return s;
|
|
224
|
+
}
|
|
225
|
+
return null;
|
|
226
|
+
};
|
|
227
|
+
return i(e);
|
|
228
|
+
}
|
|
229
|
+
class N {
|
|
230
|
+
data;
|
|
231
|
+
columns;
|
|
232
|
+
rows;
|
|
233
|
+
stride;
|
|
234
|
+
_rowLength;
|
|
235
|
+
_lerpFn = [];
|
|
236
|
+
arrayConstructor;
|
|
237
|
+
constructor(t, e, i = 1) {
|
|
238
|
+
this.data = t, this.columns = e, this.stride = i, this._rowLength = e * i, this.rows = this.data.length / this._rowLength, this.arrayConstructor = (r) => new this.data.constructor(
|
|
239
|
+
r
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
static readWriteBlock(t, e, i, r, n, s, a, c, h, l, o = null) {
|
|
243
|
+
if (!(t instanceof N && s instanceof N))
|
|
244
|
+
throw Error("Source and target must be of type Typed2dArray");
|
|
245
|
+
if (a < 0 || a + h > s.columns || c < 0 || c + l > s.rows)
|
|
246
|
+
throw Error("Invalid target block dimensions!");
|
|
247
|
+
if (e < 0 || e + r > t.columns || i < 0 || i + n > t.rows)
|
|
248
|
+
throw Error("Invalid source block dimensions!");
|
|
249
|
+
const d = Math.max(1, h - 1), g = Math.max(1, l - 1), v = Math.max(1, r - 1), y = Math.max(1, n - 1);
|
|
250
|
+
for (let m = 0; m < l; m++) {
|
|
251
|
+
const _ = s.index(0, m + c), A = m / g * y + i;
|
|
252
|
+
for (let S = 0; S < h; S++) {
|
|
253
|
+
const b = _ + (S + a) * s.stride, V = S / d * v + e;
|
|
254
|
+
let M = t.valueAt(V, A);
|
|
255
|
+
if (o && (M = o(M)), s.stride === 1)
|
|
256
|
+
s.data[b] = M;
|
|
257
|
+
else if (Array.isArray(M))
|
|
258
|
+
for (let F = 0; F < M.length; F++)
|
|
259
|
+
s.data[b + F] = M[F];
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return this;
|
|
263
|
+
}
|
|
264
|
+
// built-in interpolation methods
|
|
265
|
+
static logInterp(t, e, i, r, n, s) {
|
|
266
|
+
const a = (e * e - t * t) * n + t * t, c = (r * r - i * i) * n + i * i;
|
|
267
|
+
return Math.sqrt((c - a) * s + a);
|
|
268
|
+
}
|
|
269
|
+
static linearInterp(t, e, i, r, n, s) {
|
|
270
|
+
const a = (e - t) * n + t;
|
|
271
|
+
return ((r - i) * n + i - a) * s + a;
|
|
272
|
+
}
|
|
273
|
+
static nearestInterp(t, e, i, r, n, s) {
|
|
274
|
+
const a = n <= 0.5 ? t : e, c = n <= 0.5 ? i : r;
|
|
275
|
+
return s <= 0.5 ? a : c;
|
|
276
|
+
}
|
|
277
|
+
// // create a new Typed2DArray instance using an existing data array
|
|
278
|
+
// static from<ArrayType>(source: ArrayType, columns: number, stride = 1, copyData = false) {
|
|
279
|
+
// const data = source instanceof Typed2DArray ? source.data : source;
|
|
280
|
+
// const array = new Typed2DArray(data.constructor, columns, data.length / (columns * stride), stride, false);
|
|
281
|
+
// array.data = copyData ? new array.type(data) : data;
|
|
282
|
+
// if (source instanceof Typed2DArray) {
|
|
283
|
+
// array.setInterpolator(...source._lerpFn);
|
|
284
|
+
// }
|
|
285
|
+
// return array;
|
|
286
|
+
// }
|
|
287
|
+
// alias for columns
|
|
288
|
+
get width() {
|
|
289
|
+
return this.columns;
|
|
290
|
+
}
|
|
291
|
+
// alias for rows
|
|
292
|
+
get height() {
|
|
293
|
+
return this.rows;
|
|
294
|
+
}
|
|
295
|
+
// get the array index to the first component from the provided column and row indices
|
|
296
|
+
index(t, e) {
|
|
297
|
+
if (t < 0 || e < 0 || t >= this.columns || e >= this.rows)
|
|
298
|
+
throw Error("Index out of bounds!");
|
|
299
|
+
return e * this._rowLength + t * this.stride;
|
|
300
|
+
}
|
|
301
|
+
// get the column and row at the beginning of the item according to stride from an index into the data array
|
|
302
|
+
positionOf(t) {
|
|
303
|
+
if (t < 0 || t > this.data.length) return;
|
|
304
|
+
const e = t % this.stride, i = Math.floor((t - e) / this._rowLength), r = Math.floor((t - i * this._rowLength) / this.stride);
|
|
305
|
+
return { row: i, col: r };
|
|
306
|
+
}
|
|
307
|
+
// allow you to set a custom interpolation function per component, which are used when interpolating values
|
|
308
|
+
setInterpolator(...t) {
|
|
309
|
+
return this._lerpFn = t, this;
|
|
310
|
+
}
|
|
311
|
+
// get the configured interpolation function for the given component index
|
|
312
|
+
getInterpolator(t) {
|
|
313
|
+
return this._lerpFn.length > 0 ? this._lerpFn[Math.min(t, this._lerpFn.length - 1)] : N.linearInterp;
|
|
314
|
+
}
|
|
315
|
+
// convenience function for reading an entire column
|
|
316
|
+
col(t, e) {
|
|
317
|
+
return this.readBlock(
|
|
318
|
+
Math.floor(t),
|
|
319
|
+
0,
|
|
320
|
+
1,
|
|
321
|
+
this.rows,
|
|
322
|
+
void 0,
|
|
323
|
+
void 0,
|
|
324
|
+
e
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
// convenience function for reading an entire row
|
|
328
|
+
row(t, e) {
|
|
329
|
+
const i = this.index(0, Math.floor(t));
|
|
330
|
+
if (e) {
|
|
331
|
+
for (let r = 0; r < this._rowLength; r++)
|
|
332
|
+
e[r] = this.data[i + r];
|
|
333
|
+
return e;
|
|
334
|
+
}
|
|
335
|
+
return this.data.subarray(i, i + this._rowLength);
|
|
336
|
+
}
|
|
337
|
+
// set a single value into the provided column and row
|
|
338
|
+
setValue(t, e, ...i) {
|
|
339
|
+
const r = this.index(t, e);
|
|
340
|
+
for (let n = 0; n < Math.min(i.length, this.stride); n++)
|
|
341
|
+
this.data[r + n] = i[n];
|
|
342
|
+
return this;
|
|
343
|
+
}
|
|
344
|
+
// read all the values within the provided block dimension
|
|
345
|
+
readBlock(t, e, i, r, n, s, a) {
|
|
346
|
+
if (t < 0 || t + i > this.columns || e < 0 || e + r > this.rows)
|
|
347
|
+
throw Error("Invalid block dimensions!");
|
|
348
|
+
n = Number.isFinite(n) ? n : i, s = Number.isFinite(s) ? s : r, a = a || this.arrayConstructor(n * s * this.stride);
|
|
349
|
+
const c = Math.max(1, n - 1), h = Math.max(1, s - 1), l = Math.max(1, i - 1), o = Math.max(1, r - 1);
|
|
350
|
+
let d = 0;
|
|
351
|
+
for (let g = 0; g < s; g++) {
|
|
352
|
+
const v = g / h * o + e;
|
|
353
|
+
for (let y = 0; y < n; y++) {
|
|
354
|
+
const m = y / c * l + t, _ = this.valueAt(m, v);
|
|
355
|
+
if (this.stride === 1)
|
|
356
|
+
a[d++] = _;
|
|
357
|
+
else if (Array.isArray(_))
|
|
358
|
+
for (let A = 0; A < _.length; A++)
|
|
359
|
+
a[d++] = _[A];
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return a;
|
|
363
|
+
}
|
|
364
|
+
// upscale grid using the current interpolation method
|
|
365
|
+
upscale(t, e) {
|
|
366
|
+
if (t < this.columns || e < this.rows)
|
|
367
|
+
throw Error(
|
|
368
|
+
"New column and row size must be equal or bigger than the current sizes!"
|
|
369
|
+
);
|
|
370
|
+
const i = this.readBlock(
|
|
371
|
+
0,
|
|
372
|
+
0,
|
|
373
|
+
this.columns,
|
|
374
|
+
this.rows,
|
|
375
|
+
t,
|
|
376
|
+
e
|
|
377
|
+
);
|
|
378
|
+
return this.columns = t, this.rows = e, this._rowLength = t * this.stride, this.data = i, this;
|
|
379
|
+
}
|
|
380
|
+
// write values into a given block dimension
|
|
381
|
+
writeBlock(t, e, i, r, n) {
|
|
382
|
+
if (n.length !== i * r * this.stride)
|
|
383
|
+
throw Error("Incorrect number of values");
|
|
384
|
+
if (t < 0 || t + i > this.columns || e < 0 || e + r > this.rows)
|
|
385
|
+
throw Error("Invalid block dimensions!");
|
|
386
|
+
let s = 0;
|
|
387
|
+
for (let a = e; a < e + r; a++) {
|
|
388
|
+
const c = this.index(t, a);
|
|
389
|
+
for (let h = 0; h < i; h++) {
|
|
390
|
+
const l = c + h * this.stride;
|
|
391
|
+
for (let o = 0; o < this.stride; o++)
|
|
392
|
+
this.data[l + o] = n[s++];
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
return this;
|
|
396
|
+
}
|
|
397
|
+
// fills the block with a single value
|
|
398
|
+
fillBlock(t, e, i, r, n) {
|
|
399
|
+
if (t < 0 || t + i > this.columns || e < 0 || e + r > this.rows)
|
|
400
|
+
throw Error("Invalid block dimensions!");
|
|
401
|
+
let s = (a, c, h) => {
|
|
402
|
+
this.data[h] = n;
|
|
403
|
+
};
|
|
404
|
+
typeof n == "function" ? s = (a, c, h) => {
|
|
405
|
+
const l = n(a, c, h);
|
|
406
|
+
if (Array.isArray(l) && l.length && l.length > 0)
|
|
407
|
+
for (let o = 0; o < Math.min(l.length, this.stride); o++)
|
|
408
|
+
this.data[h + o] = l[o];
|
|
409
|
+
else
|
|
410
|
+
this.data[h] = l;
|
|
411
|
+
} : this.stride > 1 && Array.isArray(n) && (s = (a, c, h) => {
|
|
412
|
+
for (let l = 0; l < Math.min(n.length, this.stride); l++)
|
|
413
|
+
this.data[h + l] = n[l];
|
|
414
|
+
});
|
|
415
|
+
for (let a = e; a < e + r; a++) {
|
|
416
|
+
const c = this.index(t, a);
|
|
417
|
+
for (let h = 0; h < i; h++) {
|
|
418
|
+
const l = c + h * this.stride;
|
|
419
|
+
s(h, a, l);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
return this;
|
|
423
|
+
}
|
|
424
|
+
// get the value corresponding to the specified index according to stride
|
|
425
|
+
valueOf(t, e) {
|
|
426
|
+
const { stride: i, data: r } = this;
|
|
427
|
+
if (i > 1) {
|
|
428
|
+
t = t % i, e = e || this.arrayConstructor(i);
|
|
429
|
+
for (let n = 0; n < i; n++)
|
|
430
|
+
e[n] = r[t + n];
|
|
431
|
+
return e;
|
|
432
|
+
}
|
|
433
|
+
return r[t];
|
|
434
|
+
}
|
|
435
|
+
// get the calue at the requested column and row, which may be given as fractions, which in case
|
|
436
|
+
// bilinear filtering will be applied to interpolate values (for each component) in between columns and rows
|
|
437
|
+
valueAt(t, e, i) {
|
|
438
|
+
const { columns: r, rows: n, stride: s, data: a } = this, c = t % 1, h = e % 1;
|
|
439
|
+
if (c > 0 || h > 0) {
|
|
440
|
+
const o = (t < 0 ? 0 : t >= r ? r - 1 : t) | 0, d = (e < 0 ? 0 : e >= n ? n - 1 : e) | 0, g = o === r - 1 ? o : o + 1, v = d === n - 1 ? d : d + 1;
|
|
441
|
+
let y = this.index(o, d), m = this.index(g, d), _ = this.index(o, v), A = this.index(g, v);
|
|
442
|
+
if (s > 1) {
|
|
443
|
+
i = i || this.arrayConstructor(s);
|
|
444
|
+
for (let b = 0; b < s; b++) {
|
|
445
|
+
const V = this.getInterpolator(b);
|
|
446
|
+
i[b] = V(a[y++], a[m++], a[_++], a[A++], c, h);
|
|
447
|
+
}
|
|
448
|
+
return i;
|
|
449
|
+
}
|
|
450
|
+
return this.getInterpolator(0)(a[y], a[m], a[_], a[A], c, h);
|
|
451
|
+
}
|
|
452
|
+
const l = this.index(t, e);
|
|
453
|
+
if (s > 1) {
|
|
454
|
+
i = i || this.arrayConstructor(s);
|
|
455
|
+
for (let o = 0; o < s; o++)
|
|
456
|
+
i[o] = a[l + o];
|
|
457
|
+
return i;
|
|
458
|
+
}
|
|
459
|
+
return a[l];
|
|
460
|
+
}
|
|
461
|
+
// swap all values from one row with all values from another row
|
|
462
|
+
swapRows(t, e, i) {
|
|
463
|
+
i = i || this.arrayConstructor(this._rowLength), this.row(t, i);
|
|
464
|
+
const r = this.index(0, t), n = this.index(0, e);
|
|
465
|
+
for (let s = 0; s < this._rowLength; s++)
|
|
466
|
+
this.data[r + s] = this.data[n + s], this.data[n + s] = i[s];
|
|
467
|
+
return this;
|
|
468
|
+
}
|
|
469
|
+
// invert all rows (top-bottom to bottom-top)
|
|
470
|
+
invertRows() {
|
|
471
|
+
const t = Math.floor(this.rows / 2), e = this.arrayConstructor(this._rowLength);
|
|
472
|
+
for (let i = this.rows - 1, r = 0; i > t; i--, r++)
|
|
473
|
+
this.swapRows(i, r, e);
|
|
474
|
+
return this;
|
|
475
|
+
}
|
|
476
|
+
copyInto(t, e = 0, i = 0, r = this.columns - e, n = this.rows - i) {
|
|
477
|
+
if (t.length !== r * n * this.stride)
|
|
478
|
+
throw Error("Target is not of the correct size!");
|
|
479
|
+
let s = 0;
|
|
480
|
+
for (let a = i; a < i + n; a++) {
|
|
481
|
+
const c = this.index(0, a);
|
|
482
|
+
for (let h = e; h < e + r; h++) {
|
|
483
|
+
const l = c + h * this.stride;
|
|
484
|
+
for (let o = 0; o < this.stride; o++)
|
|
485
|
+
t[s++] = this.data[l + o];
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
return this;
|
|
489
|
+
}
|
|
490
|
+
// return a multi-dimensional javascript array of the data (main purpose for debugging)
|
|
491
|
+
toJsArray() {
|
|
492
|
+
const t = new Array(this.rows);
|
|
493
|
+
for (let e = 0; e < this.rows; e++) {
|
|
494
|
+
const i = this.index(0, e);
|
|
495
|
+
t[e] = new Array(this.columns);
|
|
496
|
+
for (let r = 0; r < this.columns; r++)
|
|
497
|
+
if (this.stride > 1) {
|
|
498
|
+
t[e][r] = new Array(this.stride);
|
|
499
|
+
for (let n = 0; n < this.stride; n++)
|
|
500
|
+
t[e][r][n] = this.data[i + r * this.stride + n];
|
|
501
|
+
} else
|
|
502
|
+
t[e][r] = this.data[i + r * this.stride];
|
|
503
|
+
}
|
|
504
|
+
return t;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
function lt(u) {
|
|
508
|
+
const t = new Float32Array(u.length * 3);
|
|
509
|
+
for (let e = 0; e < u.length; e++) {
|
|
510
|
+
const i = e * 3;
|
|
511
|
+
t[i + 0] = u[e][0], t[i + 1] = u[e][1], t[i + 2] = u[e][2];
|
|
512
|
+
}
|
|
513
|
+
return t;
|
|
514
|
+
}
|
|
515
|
+
export {
|
|
516
|
+
_e as CRS,
|
|
517
|
+
ct as CameraManager,
|
|
518
|
+
Y as DataLoader,
|
|
519
|
+
ze as Delatin,
|
|
520
|
+
ft as DepthReadMaterial,
|
|
521
|
+
R as GeneratorRegistry,
|
|
522
|
+
ut as PI,
|
|
523
|
+
dt as PI2,
|
|
524
|
+
gt as PI4,
|
|
525
|
+
pt as PI8,
|
|
526
|
+
wt as TAU,
|
|
527
|
+
Me as TubeMaterial,
|
|
528
|
+
N as Typed2DArray,
|
|
529
|
+
yt as WellboreManager,
|
|
530
|
+
mt as addVec2,
|
|
531
|
+
xt as addVec3,
|
|
532
|
+
bt as angleVec3,
|
|
533
|
+
vt as calculateFrenetFrames,
|
|
534
|
+
Ge as calculateHashValue,
|
|
535
|
+
Ae as calculateWellSegments,
|
|
536
|
+
_t as clamp,
|
|
537
|
+
Mt as copyVec3,
|
|
538
|
+
Fe as createConfig,
|
|
539
|
+
Le as createElevationTexture,
|
|
540
|
+
ke as createFenceGeometry,
|
|
541
|
+
Se as createNormalTexture,
|
|
542
|
+
Pe as createTubeGeometry,
|
|
543
|
+
At as crossVec3,
|
|
544
|
+
Ft as degreesToRadians,
|
|
545
|
+
Lt as directionVec2,
|
|
546
|
+
St as directionVec3,
|
|
547
|
+
Vt as distanceVec2,
|
|
548
|
+
It as distanceVec3,
|
|
549
|
+
Bt as dotVec2,
|
|
550
|
+
Et as dotVec3,
|
|
551
|
+
Tt as edgeOfRectangle,
|
|
552
|
+
Ve as elevationMapNormalsToRGBA,
|
|
553
|
+
Dt as feetToMeters,
|
|
554
|
+
qt as getCurvePositions,
|
|
555
|
+
zt as getFormationMarkers,
|
|
556
|
+
at as getObjectByCustomProperty,
|
|
557
|
+
Gt as getProjectedTrajectory,
|
|
558
|
+
Ie as getProjectionDefFromUtmZone,
|
|
559
|
+
kt as getSplineCurve,
|
|
560
|
+
Pt as getTrajectory,
|
|
561
|
+
jt as getTypedArrayFromBuffer,
|
|
562
|
+
Nt as getTypedArrayType,
|
|
563
|
+
Be as getUtmZoneFromLatLng,
|
|
564
|
+
Ct as getVec2,
|
|
565
|
+
Qt as getVec3,
|
|
566
|
+
Ut as getWellboreFormations,
|
|
567
|
+
et as idToHexColor,
|
|
568
|
+
Wt as inverseLerp,
|
|
569
|
+
Ht as lengthVec2,
|
|
570
|
+
Zt as lengthVec3,
|
|
571
|
+
$t as lerp,
|
|
572
|
+
Jt as mergeFormationIntervals,
|
|
573
|
+
Kt as mixVec2,
|
|
574
|
+
Ot as mixVec3,
|
|
575
|
+
nt as multiply,
|
|
576
|
+
rt as negate,
|
|
577
|
+
Xt as negateVec2,
|
|
578
|
+
Yt as negateVec3,
|
|
579
|
+
Rt as normalizeVec2,
|
|
580
|
+
te as normalizeVec3,
|
|
581
|
+
ee as normalizedDeviceToScreen,
|
|
582
|
+
se as packAttribute,
|
|
583
|
+
ie as packBufferGeometries,
|
|
584
|
+
re as packBufferGeometry,
|
|
585
|
+
ne as packBufferGeometryLike,
|
|
586
|
+
it as parseIrapbin,
|
|
587
|
+
st as randomColor,
|
|
588
|
+
ae as readDepth,
|
|
589
|
+
le as remap,
|
|
590
|
+
oe as rotateVec3,
|
|
591
|
+
he as scaleVec2,
|
|
592
|
+
ce as scaleVec3,
|
|
593
|
+
fe as screenToNormalizedDevice,
|
|
594
|
+
ue as setVec2,
|
|
595
|
+
de as setVec3,
|
|
596
|
+
ge as simplifyCurve2D,
|
|
597
|
+
pe as subVec2,
|
|
598
|
+
we as subVec3,
|
|
599
|
+
je as titleCase,
|
|
600
|
+
lt as toFloat32Array,
|
|
601
|
+
ye as toRGB,
|
|
602
|
+
Ee as toSegments,
|
|
603
|
+
Te as triangleNormal,
|
|
604
|
+
tt as triangulateGrid,
|
|
605
|
+
Ne as triangulateGridDelaunay,
|
|
606
|
+
me as unpackBufferGeometries,
|
|
607
|
+
xe as unpackBufferGeometry,
|
|
608
|
+
be as uvMaterial,
|
|
609
|
+
De as wgs84Def
|
|
610
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
vec3 hue2rgb(in float H) {
|
|
2
|
+
float R = abs(H * 6. - 3.) - 1.;
|
|
3
|
+
float G = 2. - abs(H * 6. - 2.);
|
|
4
|
+
float B = 2. - abs(H * 6. - 4.);
|
|
5
|
+
return saturate(vec3(R, G, B));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
vec3 hsl2rgb(in vec3 HSL) {
|
|
9
|
+
vec3 RGB = hue2rgb(HSL.x);
|
|
10
|
+
float C = (1. - abs(2. * HSL.z - 1.)) * HSL.y;
|
|
11
|
+
return (RGB - 0.5) * C + HSL.z;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
vec3 rgb2hsv(in vec3 RGB) {
|
|
15
|
+
// Based on work by Sam Hocevar and Emil Persson
|
|
16
|
+
vec4 P = (RGB.g < RGB.b) ? vec4(RGB.bg, -1.0, 2.0 / 3.0) : vec4(RGB.gb, 0.0, -1.0 / 3.0);
|
|
17
|
+
vec4 Q = (RGB.r < P.x) ? vec4(P.xyw, RGB.r) : vec4(RGB.r, P.yzx);
|
|
18
|
+
float C = Q.x - min(Q.w, Q.y);
|
|
19
|
+
float H = abs((Q.w - Q.y) / (6. * C + EPSILON) + Q.z);
|
|
20
|
+
return vec3(H, C, Q.x);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
vec3 rgb2hsl(in vec3 RGB) {
|
|
24
|
+
vec3 HCV = rgb2hsv(RGB);
|
|
25
|
+
float L = HCV.z - HCV.y * 0.5;
|
|
26
|
+
float S = HCV.y / (1. - abs(L * 2. - 1.) + EPSILON);
|
|
27
|
+
return vec3(HCV.x, S, L);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
vec3 hsv2rgb(in vec3 HSV) {
|
|
31
|
+
vec3 RGB = hue2rgb(HSV.x);
|
|
32
|
+
return ((RGB - 1.) * HSV.y + 1.) * HSV.z;
|
|
33
|
+
}
|