@equinor/videx-3d 1.1.0 → 2.0.0

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 (47) hide show
  1. package/README.md +120 -120
  2. package/dist/chunk-61X6qE5N.js +981 -0
  3. package/dist/chunk-ChG5d4HC.js +675 -0
  4. package/dist/{chunk-BolRQZt9.js → chunk-M-Pcc_Yg.js} +22 -20
  5. package/dist/generators.js +271 -260
  6. package/dist/main.js +5185 -3434
  7. package/dist/sdk.js +492 -316
  8. package/dist/shaderLib/oit.glsl +106 -0
  9. package/dist/types/components/Annotations/AutoUpdate.d.ts +1 -1
  10. package/dist/types/components/Annotations/index.d.ts +2 -2
  11. package/dist/types/components/Annotations/types.d.ts +3 -1
  12. package/dist/types/components/Annotations/update-annotations.d.ts +10 -0
  13. package/dist/types/components/EventEmitter/EventEmitterContext.d.ts +2 -1
  14. package/dist/types/components/EventEmitter/index.d.ts +1 -0
  15. package/dist/types/components/EventEmitter/picking-helper.d.ts +25 -0
  16. package/dist/types/components/EventEmitter/picking-material.d.ts +8 -5
  17. package/dist/types/components/Surfaces/Surface.d.ts +8 -1
  18. package/dist/types/components/Surfaces/SurfaceMaterial.d.ts +3 -0
  19. package/dist/types/components/Surfaces/surface-defs.d.ts +1 -0
  20. package/dist/types/components/Wellbores/Casings/CasingEmitterMaterial.d.ts +16 -0
  21. package/dist/types/components/Wellbores/Casings/CasingSection.d.ts +3 -2
  22. package/dist/types/components/Wellbores/Casings/Casings.d.ts +3 -2
  23. package/dist/types/generators/surface-generator.d.ts +1 -1
  24. package/dist/types/layers/layers.d.ts +4 -0
  25. package/dist/types/rendering/OitMaterial.d.ts +59 -0
  26. package/dist/types/rendering/Pass.d.ts +7 -0
  27. package/dist/types/rendering/RenderingPipeline.d.ts +37 -0
  28. package/dist/types/rendering/fullscreen-renderer.d.ts +1 -0
  29. package/dist/types/rendering/gpu-timer.d.ts +46 -0
  30. package/dist/types/rendering/index.d.ts +7 -1
  31. package/dist/types/rendering/oit-material.d.ts +122 -0
  32. package/dist/types/{components/Annotations/annotations-renderer.d.ts → rendering/passes/AnnotationsPass.d.ts} +13 -4
  33. package/dist/types/rendering/passes/FXAAPass.d.ts +12 -0
  34. package/dist/types/rendering/passes/OITRenderPass.d.ts +282 -0
  35. package/dist/types/rendering/passes/OutputPass.d.ts +10 -0
  36. package/dist/types/rendering/passes/RenderPass.d.ts +8 -0
  37. package/dist/types/rendering/passes/SMAAPass.d.ts +40 -0
  38. package/dist/types/rendering/passes/TAAPass.d.ts +94 -0
  39. package/dist/types/rendering/passes/index.d.ts +6 -0
  40. package/dist/types/rendering/rendering-state.d.ts +59 -0
  41. package/dist/types/sdk/index.d.ts +2 -0
  42. package/dist/types/sdk/utils/elevation-map.d.ts +23 -0
  43. package/dist/types/sdk/utils/trigonometry.d.ts +4 -1
  44. package/package.json +1 -1
  45. package/dist/chunk-CnY6Tmof.js +0 -358
  46. package/dist/chunk-iY0wQ9Z6.js +0 -887
  47. package/dist/types/rendering/render-passes.d.ts +0 -16
package/dist/sdk.js CHANGED
@@ -1,10 +1,12 @@
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 Tt, e as Et, 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 Te, h as Ee, w as De } from "./chunk-CnY6Tmof.js";
5
- import { D as ze, c as Ge, a as ke, b as Pe, d as je, t as Ne, e as Ce } from "./chunk-BolRQZt9.js";
6
- const J = 10, K = 25;
7
- class Y {
1
+ import { wrap as Y } from "comlink";
2
+ import R from "p-limit";
3
+ import { d as K } from "./chunk-61X6qE5N.js";
4
+ import { y as xt, D as bt, P as vt, b as Mt, a as Ct, c as Et, T as Bt, z as At, A as zt, B as Ft, E as St, q as It, F as Lt, G as Vt, i as Tt, H as Pt, j as qt, I as Dt, J as Gt, K as jt, L as kt, M as Nt, N as Ot, O as Qt, Q as Ut, e as Wt, R as Ht, S as Zt, p as $t, U as Jt, V as Kt, X as Xt, h as Yt, Y as Rt, Z as te, _ as ee, $ as se, g as ie, a0 as ne, a1 as re, a2 as ae, a3 as oe, m as le, a4 as he, a5 as ce, a6 as fe, a7 as ue, n as de, a8 as ge, f as me, a9 as pe, aa as ye, ab as _e, ac as we, ad as xe, ae as be, af as ve, ag as Me, ah as Ce, ai as Ee, aj as Be, ak as Ae, al as ze, s as Fe, am as Se, an as Ie, ao as Le, ap as Ve, u as Te, aq as Pe } from "./chunk-61X6qE5N.js";
5
+ import { C as De, T as Ge, c as je, b as ke, g as Ne, e as Oe, t as Qe, w as Ue } from "./chunk-ChG5d4HC.js";
6
+ import { D as He, c as Ze, a as $e, b as Je, d as Ke, m as Xe, t as Ye, e as Re, f as ts } from "./chunk-M-Pcc_Yg.js";
7
+ import { Vector2 as N, Shape as tt, Path as et } from "three";
8
+ const st = 10, it = 25;
9
+ class lt {
8
10
  store;
9
11
  config;
10
12
  cached = /* @__PURE__ */ new Map();
@@ -12,7 +14,7 @@ class Y {
12
14
  _batchqueue = /* @__PURE__ */ new Map();
13
15
  _flushScheduled = null;
14
16
  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;
17
+ this.store = t, this.config = { ...e }, this.config.batched && (this.config.batchSize === void 0 && (this.config.batchSize = st), this.config.batchMaxDelay === void 0 && (this.config.batchMaxDelay = it)), this._flushScheduled = null;
16
18
  }
17
19
  async init(...t) {
18
20
  if (this.config.init)
@@ -40,30 +42,30 @@ class Y {
40
42
  if (this._batchqueue.has(t))
41
43
  return this._batchqueue.get(t).promise;
42
44
  let e = null;
43
- const i = new Promise((n) => {
44
- e = n;
45
- }), r = {
45
+ const s = new Promise((r) => {
46
+ e = r;
47
+ }), i = {
46
48
  key: t,
47
- promise: i,
49
+ promise: s,
48
50
  _resolve: e
49
51
  };
50
- return this._batchqueue.set(t, r), this._flushScheduled || (this._flushScheduled = setTimeout(() => {
52
+ return this._batchqueue.set(t, i), this._flushScheduled || (this._flushScheduled = setTimeout(() => {
51
53
  this._processBatchQueue();
52
- }, this.config.batchMaxDelay)), i;
54
+ }, this.config.batchMaxDelay)), s;
53
55
  }
54
56
  async _processBatch(t) {
55
- const e = t.map((i) => i.key);
57
+ const e = t.map((s) => s.key);
56
58
  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);
59
+ this.config.batchLoad(e).then((s) => {
60
+ Array.isArray(s) && s.forEach(([i, r]) => {
61
+ this.set(i, r);
60
62
  });
61
- }).catch((i) => {
62
- console.warn("Batch load failed", i);
63
+ }).catch((s) => {
64
+ console.warn("Batch load failed", s);
63
65
  }).finally(() => {
64
- t.forEach((i) => {
65
- const r = this.cached.get(i.key) || null;
66
- i._resolve(r);
66
+ t.forEach((s) => {
67
+ const i = this.cached.get(s.key) || null;
68
+ s._resolve(i);
67
69
  });
68
70
  });
69
71
  }
@@ -80,21 +82,21 @@ class Y {
80
82
  if (!this.config.batched && this.config.load) {
81
83
  if (this.config.noCache)
82
84
  return this.config.load(t, e);
83
- let i = this._activeLoaders[t];
84
- if (!i) {
85
+ let s = this._activeLoaders[t];
86
+ if (!s) {
85
87
  if (e)
86
88
  throw Error(
87
89
  "DataLoader: A load function with additional args may not be cached. Set noCache to true in config."
88
90
  );
89
- i = this.config.load(t).then((r) => {
90
- r && this.cached.set(t, r);
91
- }).catch((r) => {
92
- console.warn("Load failed", r);
91
+ s = this.config.load(t).then((i) => {
92
+ i && this.cached.set(t, i);
93
+ }).catch((i) => {
94
+ console.warn("Load failed", i);
93
95
  }).finally(() => {
94
96
  delete this._activeLoaders[t];
95
- }), this._activeLoaders[t] = i;
97
+ }), this._activeLoaders[t] = s;
96
98
  }
97
- return await i, this.config.transform ? this.config.transform(this.cached.get(t)) : this.cached.get(t);
99
+ return await s, this.config.transform ? this.config.transform(this.cached.get(t)) : this.cached.get(t);
98
100
  }
99
101
  return this.config.batched && this.config.batchLoad ? this._enqueueRequest(t) : null;
100
102
  }
@@ -105,7 +107,7 @@ class Y {
105
107
  this.cached.clear();
106
108
  }
107
109
  }
108
- class R {
110
+ class ht {
109
111
  store = null;
110
112
  config;
111
113
  generators = /* @__PURE__ */ new Map();
@@ -117,17 +119,17 @@ class R {
117
119
  }
118
120
  setStore(t) {
119
121
  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))
122
+ const e = R(this.config.concurrentStoreCalls), s = {
123
+ get: (i, r, n) => e(() => t.get(i, r, n)),
124
+ all: (i) => e(() => t.all(i)),
125
+ query: (i, r) => e(() => t.query(i, r))
124
126
  };
125
- this.store = i;
127
+ this.store = s;
126
128
  } else
127
129
  this.store = t;
128
130
  }
129
131
  async connectRemoteStore(t) {
130
- const e = Z(t);
132
+ const e = Y(t);
131
133
  this.setStore(e);
132
134
  }
133
135
  async invoke(t, ...e) {
@@ -137,96 +139,262 @@ class R {
137
139
  return this.generators.get(t).bind(this.store)(...e);
138
140
  }
139
141
  }
140
- function tt(u, t, e = 1, i = 1, r = (n) => n) {
142
+ class W {
143
+ type;
144
+ coordinates;
145
+ _min = null;
146
+ _max = null;
147
+ _size = null;
148
+ _offset = [0, 0];
149
+ constructor(t, e, s) {
150
+ this.type = t, this.coordinates = e, s && (this._offset[0] = s[0], this._offset[1] = s[1]);
151
+ }
152
+ static fromPointCoordinates(t, e) {
153
+ const s = e ? t.map(e) : t;
154
+ return new H(s);
155
+ }
156
+ static fromLineCoordinates(t, e) {
157
+ const s = e ? t.map((i) => i.map(e)) : t;
158
+ return new Z(s);
159
+ }
160
+ static fromPolygonCoordinates(t, e) {
161
+ const s = e ? t.map((i) => i.map((r) => r.map(e))) : t;
162
+ return new $(s);
163
+ }
164
+ _calculateBounds() {
165
+ const t = [1 / 0, 1 / 0], e = [-1 / 0, -1 / 0], s = (i) => {
166
+ i[0] < t[0] && (t[0] = i[0]), i[0] > e[0] && (e[0] = i[0]), i[1] < t[1] && (t[1] = i[1]), i[1] > e[1] && (e[1] = i[1]);
167
+ };
168
+ this.forEachCoordinate(s), this._min = t, this._max = e, this._size = [e[0] - t[0], e[1] - t[1]];
169
+ }
170
+ get min() {
171
+ return this._min || this._calculateBounds(), [...this._min];
172
+ }
173
+ get max() {
174
+ return this._max || this._calculateBounds(), [...this._max];
175
+ }
176
+ get center() {
177
+ return (!this._min || !this._max || !this._size) && this._calculateBounds(), [
178
+ this.min[0] + this.size[0] / 2,
179
+ this.min[1] + this.size[1] / 2
180
+ ];
181
+ }
182
+ get size() {
183
+ return this._size || this._calculateBounds(), [...this._size];
184
+ }
185
+ get offset() {
186
+ return [...this._offset];
187
+ }
188
+ setOffset(t) {
189
+ this.forEachCoordinate((e) => {
190
+ e[0] -= t[0], e[1] -= t[1];
191
+ }), this._min && (this._min[0] -= t[0], this._min[1] -= t[1]), this._max && (this._max[0] -= t[0], this._max[1] -= t[1]), this._offset[0] += t[0], this._offset[1] += t[1];
192
+ }
193
+ removeOffset() {
194
+ (this._offset[0] !== 0 || this._offset[1] !== 0) && (this.forEachCoordinate((t) => {
195
+ t[0] += this._offset[0], t[1] += this._offset[1];
196
+ }), this._min = null, this._max = null, this._size = null, this._offset = [0, 0]);
197
+ }
198
+ centralize() {
199
+ this.setOffset(this.center);
200
+ }
201
+ normalize(t = [1, 1], e = [0, 0]) {
202
+ this.centralize();
203
+ const s = this.getBounds();
204
+ this.forEachCoordinate((i) => {
205
+ i[0] = K((i[0] - s.min[0]) / s.size[0]) * t[0] + e[0], i[1] = K((i[1] - s.min[1]) / s.size[1]) * t[1] + e[1];
206
+ });
207
+ }
208
+ transform(t) {
209
+ (this._offset[0] !== 0 || this._offset[1] !== 0) && this.removeOffset(), this.forEachCoordinate((e) => {
210
+ const s = t(e);
211
+ e[0] = s[0], e[1] = s[1];
212
+ }), this._min = null, this._max = null, this._size = null;
213
+ }
214
+ toObject() {
215
+ return {
216
+ type: this.type.toString(),
217
+ coordinates: structuredClone(this.coordinates),
218
+ offset: this.offset
219
+ };
220
+ }
221
+ getPointsFlattened() {
222
+ const t = [];
223
+ return this.forEachCoordinate((e) => {
224
+ t.push(new N(e[0], e[1]));
225
+ }), t;
226
+ }
227
+ getBounds() {
228
+ return {
229
+ min: this.min,
230
+ max: this.max,
231
+ size: this.size
232
+ };
233
+ }
234
+ }
235
+ class H extends W {
236
+ constructor(t, e) {
237
+ super("point2d", t, e);
238
+ }
239
+ forEachCoordinate(t) {
240
+ this.coordinates.forEach((s) => t(s));
241
+ }
242
+ getPoints() {
243
+ return this.coordinates.map((e) => [new N(e[0], e[1])]);
244
+ }
245
+ clone() {
246
+ return new H(
247
+ structuredClone(this.coordinates),
248
+ this.offset
249
+ );
250
+ }
251
+ }
252
+ class Z extends W {
253
+ constructor(t, e) {
254
+ super("line2d", t, e);
255
+ }
256
+ forEachCoordinate(t) {
257
+ this.coordinates.forEach((s) => s.forEach((i) => t(i)));
258
+ }
259
+ getPoints() {
260
+ return this.coordinates.map((e) => e.map((s) => new N(s[0], s[1])));
261
+ }
262
+ clone() {
263
+ return new Z(
264
+ structuredClone(this.coordinates),
265
+ this.offset
266
+ );
267
+ }
268
+ }
269
+ class $ extends W {
270
+ constructor(t, e) {
271
+ super("polygon2d", t, e);
272
+ }
273
+ forEachCoordinate(t) {
274
+ this.coordinates.forEach((s) => s.forEach((i) => i.forEach((r) => t(r))));
275
+ }
276
+ getPoints() {
277
+ return this.coordinates.map(
278
+ (e) => e.reduce(
279
+ (s, i) => s.concat(i.map((r) => new N(r[0], r[1]))),
280
+ []
281
+ )
282
+ );
283
+ }
284
+ clone() {
285
+ return new $(
286
+ structuredClone(this.coordinates),
287
+ this._offset
288
+ );
289
+ }
290
+ toShapes() {
291
+ const t = [], e = (i, r) => {
292
+ i.moveTo(r[0][0], r[0][1]);
293
+ for (let n = 1; n < r.length; n++)
294
+ i.lineTo(r[n][0], r[n][1]);
295
+ i.closePath();
296
+ };
297
+ return this.coordinates.forEach((i) => {
298
+ const r = new tt(), n = i[0];
299
+ e(r, n);
300
+ for (let a = 1; a < i.length; a++) {
301
+ const c = new et();
302
+ e(c, i[a]), r.holes.push(c);
303
+ }
304
+ t.push(r);
305
+ }), t;
306
+ }
307
+ }
308
+ function ct(u, t, e = 1, s = 1, i = (r) => r) {
141
309
  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, E, G) {
146
- return n.push({ x: I * e, y: G, z: E * i, edge: null }), a.push(I / (t - 1), 1 - E / (h - 1)), H++;
147
- }
148
- function T(I, E, G) {
149
- D = {
310
+ const r = [], n = [], a = [], c = [], h = u.length / t;
311
+ let o, l, d, g, b, y, _, v, C, A, x, z, M, E, B, D, f, O, V, T, P, m, w, Q, X = 0, U = 0, J = 0, S = new Array(t).fill(null), G = new Array(t).fill(null);
312
+ const p = new Array(t - 1).fill(null);
313
+ function j(F, L, q) {
314
+ return r.push({ x: F * e, y: q, z: L * s, edge: null }), a.push(F / (t - 1), 1 - L / (h - 1)), X++;
315
+ }
316
+ function I(F, L, q) {
317
+ V = {
150
318
  index: U++,
151
- tail: I,
152
- head: E,
319
+ tail: F,
320
+ head: L,
153
321
  twin: null,
154
322
  prev: null,
155
323
  next: null
156
- }, q = {
324
+ }, T = {
157
325
  index: U++,
158
- tail: E,
159
- head: G,
326
+ tail: L,
327
+ head: q,
160
328
  twin: null,
161
329
  prev: null,
162
330
  next: null
163
- }, z = {
331
+ }, P = {
164
332
  index: U++,
165
- tail: G,
166
- head: I,
333
+ tail: q,
334
+ head: F,
167
335
  twin: null,
168
336
  prev: null,
169
337
  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[E].edge || (n[E].edge = q), n[G].edge || (n[G].edge = z), s.push(D, q, z), c.push(I, E, G);
338
+ }, V.next = T, T.next = P, P.next = V, V.prev = P, T.prev = V, P.prev = T, r[F].edge || (r[F].edge = V), r[L].edge || (r[L].edge = T), r[q].edge || (r[q].edge = P), n.push(V, T, P), c.push(F, L, q);
171
339
  }
172
- for (k = 1; k < h - 1; k++) {
340
+ for (D = 1; D < h - 1; D++) {
173
341
  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 ? (T(l, d, g), p !== null && (s[s.length - 3].twin = p, p.twin = s[s.length - 3]), T(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]) : (T(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]), T(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 ? (T(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 ? (T(o, d, g), w[f] = s[s.length - 2], p = s[s.length - 1]) : x === 3 ? (T(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]) : (T(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;
342
+ const F = S;
343
+ for (S = G, G = F.fill(null), m = null, O = D - 1, J += t, B = 1; B < t - 1; B++)
344
+ f = B - 1, A = J + B, C = A - 1, v = A - t, _ = v - 1, x = i(u[_]), z = i(u[v]), M = i(u[C]), E = i(u[A]), x !== null && z !== null && M !== null && E !== null ? w = 1 : x !== null && z !== null && M !== null ? w = 2 : x !== null && z !== null && E !== null ? w = 3 : x !== null && M !== null && E !== null ? w = 4 : z !== null && M !== null && E !== null ? w = 5 : w = 0, d = null, g = null, w !== 0 ? (Q ? (o = S[f], d = G[f]) : (w !== 5 && (S[f] === null ? (o = j(f, O, x), S[f] = o) : o = S[f]), w !== 3 && (d = j(f, D, M)), G[f] = d), w !== 4 && (S[B] === null ? (l = j(B, O, z), S[B] = l) : l = S[B]), w !== 2 && (g = j(B, D, E)), w === 1 ? (b = Math.abs(r[o].y - r[g].y), y = Math.abs(r[l].y - r[d].y), b < y ? (I(o, d, g), m !== null && (n[n.length - 3].twin = m, m.twin = n[n.length - 3]), I(g, l, o), p[f] !== null && (n[n.length - 2].twin = p[f], p[f].twin = n[n.length - 2]), n[n.length - 4].twin = n[n.length - 1], n[n.length - 1].twin = n[n.length - 4], p[f] = n[n.length - 5], m = n[n.length - 3]) : (I(o, d, l), p[f] !== null && (n[n.length - 1].twin = p[f], p[f].twin = n[n.length - 1]), m !== null && (n[n.length - 3].twin = m, m.twin = n[n.length - 3]), I(l, d, g), n[n.length - 5].twin = n[n.length - 3], n[n.length - 3].twin = n[n.length - 5], p[f] = n[n.length - 2], m = n[n.length - 1])) : w === 2 ? (I(o, d, l), p[f] !== null && (n[n.length - 1].twin = p[f], p[f].twin = n[n.length - 1]), m !== null && (n[n.length - 3].twin = m, m.twin = n[n.length - 3]), p[f] = null, m = null) : w === 5 ? (I(l, d, g), p[f] = n[n.length - 2], m = n[n.length - 1]) : w === 3 ? (I(l, o, g), p[f] !== null && (n[n.length - 3].twin = p[f], p[f].twin = n[n.length - 3]), p[f] = null, m = n[n.length - 1]) : (I(o, d, g), m !== null && (n[n.length - 3].twin = m, m.twin = n[n.length - 3]), p[f] = n[n.length - 2], m = null)) : (p[f] = null, m = null), G[B] = g, Q = !!w;
177
345
  }
178
- return console.timeEnd("triangulate"), console.log(c.length / 3), { vertices: n, indices: c, uvs: a, edges: s };
346
+ return console.timeEnd("triangulate"), console.log(c.length / 3), { vertices: r, indices: c, uvs: a, edges: n };
179
347
  }
180
- const et = (u) => `#${u.toString(16).padStart(6, "0")}`;
181
- function st() {
348
+ const ft = (u) => `#${u.toString(16).padStart(6, "0")}`;
349
+ function ut() {
182
350
  const u = "123456789ABCDEF";
183
351
  let t = "#";
184
352
  for (let e = 0; e < 6; e++)
185
353
  t += u[Math.floor(Math.random() * 16)];
186
354
  return t;
187
355
  }
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 };
356
+ async function dt(u, t = -1, e = null) {
357
+ const s = await u.arrayBuffer(), i = new DataView(s), r = {
358
+ ny: i.getInt32(8, !1),
359
+ xori: i.getFloat32(12, !1),
360
+ xmax: i.getFloat32(16, !1),
361
+ yori: i.getFloat32(20, !1),
362
+ ymax: i.getFloat32(24, !1),
363
+ xinc: i.getFloat32(28, !1),
364
+ yinc: i.getFloat32(32, !1),
365
+ nx: i.getInt32(44, !1),
366
+ rot: i.getFloat32(48, !1)
367
+ }, n = 1e30, a = 1e-30, c = new Float32Array(r.nx * r.ny);
368
+ let h, o, l, d, g, b = 0, y = 100;
369
+ for (; y < i.byteLength; ) {
370
+ o = i.getInt32(y), y += 4;
371
+ for (let _ = 0; _ < o; _ += 4)
372
+ h = i.getFloat32(y + _, !1), l = b % r.nx, d = r.ny - Math.floor(b / r.nx), g = (d - 1) * r.nx + l, c[g] = h < a || h > n ? t : e ? e - h : h, b++;
373
+ y += o + 4;
374
+ }
375
+ return { header: r, data: c };
208
376
  }
209
- function rt(u) {
377
+ function gt(u) {
210
378
  return u.map((t) => -t);
211
379
  }
212
- function nt(u, t) {
380
+ function mt(u, t) {
213
381
  return u.map((e) => e * t);
214
382
  }
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;
383
+ function pt(u, t, e) {
384
+ const s = (i) => {
385
+ if (i.userData[u] && i.userData[u] === t)
386
+ return i;
387
+ if (i.children && i.children.length)
388
+ for (let r = 0; r < i.children.length; r++) {
389
+ const n = s(i.children[r]);
390
+ if (n)
391
+ return n;
224
392
  }
225
393
  return null;
226
394
  };
227
- return i(e);
395
+ return s(e);
228
396
  }
229
- class N {
397
+ class k {
230
398
  data;
231
399
  columns;
232
400
  rows;
@@ -234,45 +402,45 @@ class N {
234
402
  _rowLength;
235
403
  _lerpFn = [];
236
404
  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
405
+ constructor(t, e, s = 1) {
406
+ this.data = t, this.columns = e, this.stride = s, this._rowLength = e * s, this.rows = this.data.length / this._rowLength, this.arrayConstructor = (i) => new this.data.constructor(
407
+ i
240
408
  );
241
409
  }
242
- static readWriteBlock(t, e, i, r, n, s, a, c, h, l, o = null) {
243
- if (!(t instanceof N && s instanceof N))
410
+ static readWriteBlock(t, e, s, i, r, n, a, c, h, o, l = null) {
411
+ if (!(t instanceof k && n instanceof k))
244
412
  throw Error("Source and target must be of type Typed2dArray");
245
- if (a < 0 || a + h > s.columns || c < 0 || c + l > s.rows)
413
+ if (a < 0 || a + h > n.columns || c < 0 || c + o > n.rows)
246
414
  throw Error("Invalid target block dimensions!");
247
- if (e < 0 || e + r > t.columns || i < 0 || i + n > t.rows)
415
+ if (e < 0 || e + i > t.columns || s < 0 || s + r > t.rows)
248
416
  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;
417
+ const d = Math.max(1, h - 1), g = Math.max(1, o - 1), b = Math.max(1, i - 1), y = Math.max(1, r - 1);
418
+ for (let _ = 0; _ < o; _++) {
419
+ const v = n.index(0, _ + c), C = _ / g * y + s;
420
+ for (let A = 0; A < h; A++) {
421
+ const x = v + (A + a) * n.stride, z = A / d * b + e;
422
+ let M = t.valueAt(z, C);
423
+ if (l && (M = l(M)), n.stride === 1)
424
+ n.data[x] = M;
257
425
  else if (Array.isArray(M))
258
- for (let F = 0; F < M.length; F++)
259
- s.data[b + F] = M[F];
426
+ for (let E = 0; E < M.length; E++)
427
+ n.data[x + E] = M[E];
260
428
  }
261
429
  }
262
430
  return this;
263
431
  }
264
432
  // 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);
433
+ static logInterp(t, e, s, i, r, n) {
434
+ const a = (e * e - t * t) * r + t * t, c = (i * i - s * s) * r + s * s;
435
+ return Math.sqrt((c - a) * n + a);
268
436
  }
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;
437
+ static linearInterp(t, e, s, i, r, n) {
438
+ const a = (e - t) * r + t;
439
+ return ((i - s) * r + s - a) * n + a;
272
440
  }
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;
441
+ static nearestInterp(t, e, s, i, r, n) {
442
+ const a = r <= 0.5 ? t : e, c = r <= 0.5 ? s : i;
443
+ return n <= 0.5 ? a : c;
276
444
  }
277
445
  // // create a new Typed2DArray instance using an existing data array
278
446
  // static from<ArrayType>(source: ArrayType, columns: number, stride = 1, copyData = false) {
@@ -301,8 +469,8 @@ class N {
301
469
  // get the column and row at the beginning of the item according to stride from an index into the data array
302
470
  positionOf(t) {
303
471
  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 };
472
+ const e = t % this.stride, s = Math.floor((t - e) / this._rowLength), i = Math.floor((t - s * this._rowLength) / this.stride);
473
+ return { row: s, col: i };
306
474
  }
307
475
  // allow you to set a custom interpolation function per component, which are used when interpolating values
308
476
  setInterpolator(...t) {
@@ -310,7 +478,7 @@ class N {
310
478
  }
311
479
  // get the configured interpolation function for the given component index
312
480
  getInterpolator(t) {
313
- return this._lerpFn.length > 0 ? this._lerpFn[Math.min(t, this._lerpFn.length - 1)] : N.linearInterp;
481
+ return this._lerpFn.length > 0 ? this._lerpFn[Math.min(t, this._lerpFn.length - 1)] : k.linearInterp;
314
482
  }
315
483
  // convenience function for reading an entire column
316
484
  col(t, e) {
@@ -326,37 +494,37 @@ class N {
326
494
  }
327
495
  // convenience function for reading an entire row
328
496
  row(t, e) {
329
- const i = this.index(0, Math.floor(t));
497
+ const s = this.index(0, Math.floor(t));
330
498
  if (e) {
331
- for (let r = 0; r < this._rowLength; r++)
332
- e[r] = this.data[i + r];
499
+ for (let i = 0; i < this._rowLength; i++)
500
+ e[i] = this.data[s + i];
333
501
  return e;
334
502
  }
335
- return this.data.subarray(i, i + this._rowLength);
503
+ return this.data.subarray(s, s + this._rowLength);
336
504
  }
337
505
  // 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];
506
+ setValue(t, e, ...s) {
507
+ const i = this.index(t, e);
508
+ for (let r = 0; r < Math.min(s.length, this.stride); r++)
509
+ this.data[i + r] = s[r];
342
510
  return this;
343
511
  }
344
512
  // 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)
513
+ readBlock(t, e, s, i, r, n, a) {
514
+ if (t < 0 || t + s > this.columns || e < 0 || e + i > this.rows)
347
515
  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);
516
+ r = Number.isFinite(r) ? r : s, n = Number.isFinite(n) ? n : i, a = a || this.arrayConstructor(r * n * this.stride);
517
+ const c = Math.max(1, r - 1), h = Math.max(1, n - 1), o = Math.max(1, s - 1), l = Math.max(1, i - 1);
350
518
  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);
519
+ for (let g = 0; g < n; g++) {
520
+ const b = g / h * l + e;
521
+ for (let y = 0; y < r; y++) {
522
+ const _ = y / c * o + t, v = this.valueAt(_, b);
355
523
  if (this.stride === 1)
356
- a[d++] = _;
357
- else if (Array.isArray(_))
358
- for (let A = 0; A < _.length; A++)
359
- a[d++] = _[A];
524
+ a[d++] = v;
525
+ else if (Array.isArray(v))
526
+ for (let C = 0; C < v.length; C++)
527
+ a[d++] = v[C];
360
528
  }
361
529
  }
362
530
  return a;
@@ -367,7 +535,7 @@ class N {
367
535
  throw Error(
368
536
  "New column and row size must be equal or bigger than the current sizes!"
369
537
  );
370
- const i = this.readBlock(
538
+ const s = this.readBlock(
371
539
  0,
372
540
  0,
373
541
  this.columns,
@@ -375,114 +543,114 @@ class N {
375
543
  t,
376
544
  e
377
545
  );
378
- return this.columns = t, this.rows = e, this._rowLength = t * this.stride, this.data = i, this;
546
+ return this.columns = t, this.rows = e, this._rowLength = t * this.stride, this.data = s, this;
379
547
  }
380
548
  // write values into a given block dimension
381
- writeBlock(t, e, i, r, n) {
382
- if (n.length !== i * r * this.stride)
549
+ writeBlock(t, e, s, i, r) {
550
+ if (r.length !== s * i * this.stride)
383
551
  throw Error("Incorrect number of values");
384
- if (t < 0 || t + i > this.columns || e < 0 || e + r > this.rows)
552
+ if (t < 0 || t + s > this.columns || e < 0 || e + i > this.rows)
385
553
  throw Error("Invalid block dimensions!");
386
- let s = 0;
387
- for (let a = e; a < e + r; a++) {
554
+ let n = 0;
555
+ for (let a = e; a < e + i; a++) {
388
556
  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++];
557
+ for (let h = 0; h < s; h++) {
558
+ const o = c + h * this.stride;
559
+ for (let l = 0; l < this.stride; l++)
560
+ this.data[o + l] = r[n++];
393
561
  }
394
562
  }
395
563
  return this;
396
564
  }
397
565
  // 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)
566
+ fillBlock(t, e, s, i, r) {
567
+ if (t < 0 || t + s > this.columns || e < 0 || e + i > this.rows)
400
568
  throw Error("Invalid block dimensions!");
401
- let s = (a, c, h) => {
402
- this.data[h] = n;
569
+ let n = (a, c, h) => {
570
+ this.data[h] = r;
403
571
  };
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];
572
+ typeof r == "function" ? n = (a, c, h) => {
573
+ const o = r(a, c, h);
574
+ if (Array.isArray(o) && o.length && o.length > 0)
575
+ for (let l = 0; l < Math.min(o.length, this.stride); l++)
576
+ this.data[h + l] = o[l];
409
577
  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];
578
+ this.data[h] = o;
579
+ } : this.stride > 1 && Array.isArray(r) && (n = (a, c, h) => {
580
+ for (let o = 0; o < Math.min(r.length, this.stride); o++)
581
+ this.data[h + o] = r[o];
414
582
  });
415
- for (let a = e; a < e + r; a++) {
583
+ for (let a = e; a < e + i; a++) {
416
584
  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);
585
+ for (let h = 0; h < s; h++) {
586
+ const o = c + h * this.stride;
587
+ n(h, a, o);
420
588
  }
421
589
  }
422
590
  return this;
423
591
  }
424
592
  // get the value corresponding to the specified index according to stride
425
593
  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];
594
+ const { stride: s, data: i } = this;
595
+ if (s > 1) {
596
+ t = t % s, e = e || this.arrayConstructor(s);
597
+ for (let r = 0; r < s; r++)
598
+ e[r] = i[t + r];
431
599
  return e;
432
600
  }
433
- return r[t];
601
+ return i[t];
434
602
  }
435
603
  // get the calue at the requested column and row, which may be given as fractions, which in case
436
604
  // 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;
605
+ valueAt(t, e, s) {
606
+ const { columns: i, rows: r, stride: n, data: a } = this, c = t % 1, h = e % 1;
439
607
  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);
608
+ const l = (t < 0 ? 0 : t >= i ? i - 1 : t) | 0, d = (e < 0 ? 0 : e >= r ? r - 1 : e) | 0, g = l === i - 1 ? l : l + 1, b = d === r - 1 ? d : d + 1;
609
+ let y = this.index(l, d), _ = this.index(g, d), v = this.index(l, b), C = this.index(g, b);
610
+ if (n > 1) {
611
+ s = s || this.arrayConstructor(n);
612
+ for (let x = 0; x < n; x++) {
613
+ const z = this.getInterpolator(x);
614
+ s[x] = z(a[y++], a[_++], a[v++], a[C++], c, h);
447
615
  }
448
- return i;
616
+ return s;
449
617
  }
450
- return this.getInterpolator(0)(a[y], a[m], a[_], a[A], c, h);
618
+ return this.getInterpolator(0)(a[y], a[_], a[v], a[C], c, h);
451
619
  }
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;
620
+ const o = this.index(t, e);
621
+ if (n > 1) {
622
+ s = s || this.arrayConstructor(n);
623
+ for (let l = 0; l < n; l++)
624
+ s[l] = a[o + l];
625
+ return s;
458
626
  }
459
- return a[l];
627
+ return a[o];
460
628
  }
461
629
  // 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];
630
+ swapRows(t, e, s) {
631
+ s = s || this.arrayConstructor(this._rowLength), this.row(t, s);
632
+ const i = this.index(0, t), r = this.index(0, e);
633
+ for (let n = 0; n < this._rowLength; n++)
634
+ this.data[i + n] = this.data[r + n], this.data[r + n] = s[n];
467
635
  return this;
468
636
  }
469
637
  // invert all rows (top-bottom to bottom-top)
470
638
  invertRows() {
471
639
  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);
640
+ for (let s = this.rows - 1, i = 0; s > t; s--, i++)
641
+ this.swapRows(s, i, e);
474
642
  return this;
475
643
  }
476
- copyInto(t, e = 0, i = 0, r = this.columns - e, n = this.rows - i) {
477
- if (t.length !== r * n * this.stride)
644
+ copyInto(t, e = 0, s = 0, i = this.columns - e, r = this.rows - s) {
645
+ if (t.length !== i * r * this.stride)
478
646
  throw Error("Target is not of the correct size!");
479
- let s = 0;
480
- for (let a = i; a < i + n; a++) {
647
+ let n = 0;
648
+ for (let a = s; a < s + r; a++) {
481
649
  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];
650
+ for (let h = e; h < e + i; h++) {
651
+ const o = c + h * this.stride;
652
+ for (let l = 0; l < this.stride; l++)
653
+ t[n++] = this.data[o + l];
486
654
  }
487
655
  }
488
656
  return this;
@@ -491,121 +659,129 @@ class N {
491
659
  toJsArray() {
492
660
  const t = new Array(this.rows);
493
661
  for (let e = 0; e < this.rows; e++) {
494
- const i = this.index(0, e);
662
+ const s = this.index(0, e);
495
663
  t[e] = new Array(this.columns);
496
- for (let r = 0; r < this.columns; r++)
664
+ for (let i = 0; i < this.columns; i++)
497
665
  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];
666
+ t[e][i] = new Array(this.stride);
667
+ for (let r = 0; r < this.stride; r++)
668
+ t[e][i][r] = this.data[s + i * this.stride + r];
501
669
  } else
502
- t[e][r] = this.data[i + r * this.stride];
670
+ t[e][i] = this.data[s + i * this.stride];
503
671
  }
504
672
  return t;
505
673
  }
506
674
  }
507
- function lt(u) {
675
+ function yt(u) {
508
676
  const t = new Float32Array(u.length * 3);
509
677
  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];
678
+ const s = e * 3;
679
+ t[s + 0] = u[e][0], t[s + 1] = u[e][1], t[s + 2] = u[e][2];
512
680
  }
513
681
  return t;
514
682
  }
515
683
  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 createTubeGeometries,
543
- je as createTubeGeometry,
544
- At as crossVec3,
545
- Ft as degreesToRadians,
546
- Lt as directionVec2,
547
- St as directionVec3,
548
- Vt as distanceVec2,
549
- It as distanceVec3,
550
- Bt as dotVec2,
551
- Tt as dotVec3,
552
- Et as edgeOfRectangle,
553
- Ve as elevationMapNormalsToRGBA,
554
- Dt as feetToMeters,
555
- qt as getCurvePositions,
556
- zt as getFormationMarkers,
557
- at as getObjectByCustomProperty,
558
- Gt as getProjectedTrajectory,
559
- Ie as getProjectionDefFromUtmZone,
560
- kt as getSplineCurve,
561
- Pt as getTrajectory,
562
- jt as getTypedArrayFromBuffer,
563
- Nt as getTypedArrayType,
564
- Be as getUtmZoneFromLatLng,
565
- Ct as getVec2,
566
- Qt as getVec3,
567
- Ut as getWellboreFormations,
568
- et as idToHexColor,
569
- Wt as inverseLerp,
570
- Ht as lengthVec2,
571
- Zt as lengthVec3,
572
- $t as lerp,
573
- Jt as mergeFormationIntervals,
574
- Kt as mixVec2,
575
- Ot as mixVec3,
576
- nt as multiply,
577
- rt as negate,
578
- Xt as negateVec2,
579
- Yt as negateVec3,
580
- Rt as normalizeVec2,
581
- te as normalizeVec3,
582
- ee as normalizedDeviceToScreen,
583
- se as packAttribute,
584
- ie as packBufferGeometries,
585
- re as packBufferGeometry,
586
- ne as packBufferGeometryLike,
587
- it as parseIrapbin,
588
- st as randomColor,
589
- ae as readDepth,
590
- le as remap,
591
- oe as rotateVec3,
592
- he as scaleVec2,
593
- ce as scaleVec3,
594
- fe as screenToNormalizedDevice,
595
- ue as setVec2,
596
- de as setVec3,
597
- ge as simplifyCurve2D,
598
- pe as subVec2,
599
- we as subVec3,
600
- Ne as titleCase,
601
- lt as toFloat32Array,
602
- ye as toRGB,
603
- Te as toSegments,
604
- Ee as triangleNormal,
605
- tt as triangulateGrid,
606
- Ce as triangulateGridDelaunay,
607
- me as unpackBufferGeometries,
608
- xe as unpackBufferGeometry,
609
- be as uvMaterial,
610
- De as wgs84Def
684
+ De as CRS,
685
+ xt as CameraManager,
686
+ lt as DataLoader,
687
+ He as Delatin,
688
+ bt as DepthReadMaterial,
689
+ ht as GeneratorRegistry,
690
+ vt as PI,
691
+ Mt as PI2,
692
+ Ct as PI4,
693
+ Et as PI8,
694
+ W as PlanarGeometry,
695
+ Z as PlanarLineGeometry,
696
+ H as PlanarPointGeometry,
697
+ $ as PlanarPolygonGeometry,
698
+ Bt as TAU,
699
+ Ge as TubeMaterial,
700
+ k as Typed2DArray,
701
+ At as WellboreManager,
702
+ zt as addVec2,
703
+ Ft as addVec3,
704
+ St as angleVec3,
705
+ It as calculateFrenetFrames,
706
+ Ze as calculateHashValue,
707
+ je as calculateWellSegments,
708
+ K as clamp,
709
+ Lt as computeSurfaceNormalsRG,
710
+ Vt as copyVec3,
711
+ ke as createConfig,
712
+ Tt as createElevationTexture,
713
+ $e as createFenceGeometry,
714
+ Pt as createNormalTexture,
715
+ qt as createPackedNormalTexture,
716
+ Je as createTubeGeometries,
717
+ Ke as createTubeGeometry,
718
+ Dt as crossVec3,
719
+ Gt as degreesToRadians,
720
+ jt as directionVec2,
721
+ kt as directionVec3,
722
+ Nt as distanceVec2,
723
+ Ot as distanceVec3,
724
+ Qt as dotVec2,
725
+ Ut as dotVec3,
726
+ Wt as edgeOfRectangle,
727
+ Ht as elevationMapNormalsToRGBA,
728
+ Zt as feetToMeters,
729
+ $t as getCurvePositions,
730
+ Jt as getFormationMarkers,
731
+ pt as getObjectByCustomProperty,
732
+ Kt as getProjectedTrajectory,
733
+ Ne as getProjectionDefFromUtmZone,
734
+ Xt as getSplineCurve,
735
+ Yt as getTrajectory,
736
+ Rt as getTypedArrayFromBuffer,
737
+ te as getTypedArrayType,
738
+ Oe as getUtmZoneFromLatLng,
739
+ ee as getVec2,
740
+ se as getVec3,
741
+ ie as getWellboreFormations,
742
+ ft as idToHexColor,
743
+ ne as inverseLerp,
744
+ re as lengthVec2,
745
+ ae as lengthVec3,
746
+ oe as lerp,
747
+ le as mergeFormationIntervals,
748
+ Xe as mergeGeometries,
749
+ he as mixVec2,
750
+ ce as mixVec3,
751
+ mt as multiply,
752
+ gt as negate,
753
+ fe as negateVec2,
754
+ ue as negateVec3,
755
+ de as normalizeVec2,
756
+ ge as normalizeVec3,
757
+ me as normalizedDeviceToScreen,
758
+ pe as packAttribute,
759
+ ye as packBufferGeometries,
760
+ _e as packBufferGeometry,
761
+ we as packBufferGeometryLike,
762
+ dt as parseIrapbin,
763
+ ut as randomColor,
764
+ xe as readDepth,
765
+ be as remap,
766
+ ve as rotateVec3,
767
+ Me as scaleVec2,
768
+ Ce as scaleVec3,
769
+ Ee as screenToNormalizedDevice,
770
+ Be as setVec2,
771
+ Ae as setVec3,
772
+ ze as simplifyCurve2D,
773
+ Fe as subVec2,
774
+ Se as subVec3,
775
+ Ye as titleCase,
776
+ Re as toBufferGeometry,
777
+ yt as toFloat32Array,
778
+ Ie as toRGB,
779
+ Qe as toSegments,
780
+ Le as triangleNormal,
781
+ ct as triangulateGrid,
782
+ ts as triangulateGridDelaunay,
783
+ Ve as unpackBufferGeometries,
784
+ Te as unpackBufferGeometry,
785
+ Pe as uvMaterial,
786
+ Ue as wgs84Def
611
787
  };