@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
@@ -1,5 +1,5 @@
1
1
  import { lerp as Z } from "three/src/math/MathUtils.js";
2
- import { d as G, P as x, o as S, p as tt, a3 as N, E as st, F as et, aa as it, ag as nt, J as rt } from "./chunk-iY0wQ9Z6.js";
2
+ import { d as U, P as x, p as S, q as tt, a8 as N, G as st, I as et, af as it, al as nt, M as rt } from "./chunk-61X6qE5N.js";
3
3
  import { BufferGeometry as K, BufferAttribute as L } from "three";
4
4
  function at(n, t) {
5
5
  switch (t) {
@@ -123,9 +123,9 @@ function D(n) {
123
123
  type: "Float32Array"
124
124
  }), t;
125
125
  }
126
- function U(n, t, s) {
126
+ function G(n, t, s) {
127
127
  if (t[0] === s[0]) return s[1];
128
- const e = s[0] - t[0], o = G((n - t[0]) / e, 0, 1);
128
+ const e = s[0] - t[0], o = U((n - t[0]) / e, 0, 1);
129
129
  return Z(t[1], s[1], o);
130
130
  }
131
131
  function H(n, t, s, e, o, l, r, i) {
@@ -136,7 +136,7 @@ function H(n, t, s, e, o, l, r, i) {
136
136
  let d = [0, o], g = [1, o];
137
137
  const b = l.findIndex((v) => v[0] > s);
138
138
  b === -1 ? d = l[l.length - 1] : (b > 0 && (d = l[b - 1]), g = l[b]);
139
- const y = t === "linear" ? U(s, d, g) : d[1];
139
+ const y = t === "linear" ? G(s, d, g) : d[1];
140
140
  a.push([s, y]);
141
141
  for (let v = b; v >= 0 && v < l.length; v++) {
142
142
  const p = l[v];
@@ -145,14 +145,14 @@ function H(n, t, s, e, o, l, r, i) {
145
145
  else {
146
146
  t === "linear" ? a.push([
147
147
  e,
148
- U(e, a[a.length - 1], p)
148
+ G(e, a[a.length - 1], p)
149
149
  ]) : a.push([e, a[a.length - 1][1]]);
150
150
  break;
151
151
  }
152
152
  }
153
153
  a[a.length - 1][0] < e && (t === "linear" ? a.push([
154
154
  e,
155
- U(e, a[a.length - 1], [1, o])
155
+ G(e, a[a.length - 1], [1, o])
156
156
  ]) : a.push([e, a[a.length - 1][1]]));
157
157
  }
158
158
  const u = [], c = S(
@@ -172,7 +172,7 @@ function H(n, t, s, e, o, l, r, i) {
172
172
  ]); h <= b && f < c.length - 1; )
173
173
  h = c[++f];
174
174
  for (; h < v && f < c.length; ) {
175
- const z = t === "linear" ? U(h, a[d], a[g]) : y;
175
+ const z = t === "linear" ? G(h, a[d], a[g]) : y;
176
176
  u.push([
177
177
  h,
178
178
  z,
@@ -279,7 +279,7 @@ function Y(n, t, s = !0, e, o, l) {
279
279
  }
280
280
  return r;
281
281
  }
282
- function J(n, t, s, e = !0, o, l, r) {
282
+ function $(n, t, s, e = !0, o, l, r) {
283
283
  const i = D(r), a = e ? [
284
284
  -n.tangent[0],
285
285
  -n.tangent[1],
@@ -317,12 +317,12 @@ function J(n, t, s, e = !0, o, l, r) {
317
317
  return i;
318
318
  }
319
319
  function ht(n, t = {}) {
320
- const s = G(t.from || 0, 0, 1), e = G(t.to || 1);
320
+ const s = U(t.from || 0, 0, 1), e = U(t.to || 1);
321
321
  if (e < s)
322
322
  throw Error('Value of "from" must be less than the value of "to"!');
323
323
  const o = [], l = t.radius || 1, r = t.radiusModifier?.steps || [], i = t.radialSegments || 8, a = t.startCap || !1, u = t.endCap || !1, c = n.closed, f = n.length;
324
324
  r.sort((p, m) => p[0] - m[0]);
325
- const h = t.segmentsPerMeter || 0.1, _ = t.radiusModifier?.type || "none", d = G(
325
+ const h = t.segmentsPerMeter || 0.1, _ = t.radiusModifier?.type || "none", d = U(
326
326
  t.simplificationThreshold || 0,
327
327
  0,
328
328
  1
@@ -376,7 +376,7 @@ function ht(n, t = {}) {
376
376
  !1
377
377
  )
378
378
  )), a && (!c || s > 0 || e < 1) && (b ? o.push(
379
- J(
379
+ $(
380
380
  g[0],
381
381
  b[0],
382
382
  i,
@@ -395,7 +395,7 @@ function ht(n, t = {}) {
395
395
  t
396
396
  )
397
397
  )), u && (!c || s > 0 || e < 1) && (b ? o.push(
398
- J(
398
+ $(
399
399
  g[g.length - 1],
400
400
  b[b.length - 1],
401
401
  i,
@@ -419,7 +419,7 @@ function gt(n, t = {}) {
419
419
  const s = ht(n, t);
420
420
  return ut(s, t.addGroups);
421
421
  }
422
- const $ = -1e3;
422
+ const J = -1e3;
423
423
  class lt {
424
424
  data;
425
425
  width;
@@ -477,7 +477,7 @@ class lt {
477
477
  // height value at a given position
478
478
  heightAt(t, s) {
479
479
  const e = this.data[this.width * s + t];
480
- return e === this.nullValue ? $ : e;
480
+ return e === this.nullValue ? J : e;
481
481
  }
482
482
  // rasterize a triangle, find its max error, and queue it for processing
483
483
  _findCandidate(t, s, e, o, l, r, i) {
@@ -488,15 +488,15 @@ class lt {
488
488
  for (let T = u; T <= f; T++) {
489
489
  let w = 0;
490
490
  h < 0 && y !== 0 && (w = Math.max(w, Math.floor(-h / y))), _ < 0 && p !== 0 && (w = Math.max(w, Math.floor(-_ / p))), d < 0 && g !== 0 && (w = Math.max(w, Math.floor(-d / g)));
491
- let E = h + y * w, V = _ + p * w, j = d + g * w, O = !1;
491
+ let V = h + y * w, j = _ + p * w, E = d + g * w, O = !1;
492
492
  for (let I = a + w; I <= c; I++) {
493
- if (E >= 0 && V >= 0 && j >= 0) {
493
+ if (V >= 0 && j >= 0 && E >= 0) {
494
494
  O = !0;
495
- const Q = q * E + C * V + z * j, W = this.heightAt(I, T), B = Math.abs(Q - W);
495
+ const Q = q * V + C * j + z * E, W = this.heightAt(I, T), B = Math.abs(Q - W);
496
496
  k += B * B, B > R && (R = B, M = I, F = T);
497
497
  } else if (O)
498
498
  break;
499
- E += y, V += p, j += g;
499
+ V += y, j += p, E += g;
500
500
  }
501
501
  h += v, _ += m, d += b;
502
502
  }
@@ -518,7 +518,7 @@ class lt {
518
518
  }
519
519
  _addPoint(t, s) {
520
520
  const e = this.coords.length >> 1;
521
- return this.coords.push(t, s), this.heightAt(t, s) === $ && this._invalidPoints.add(e), e;
521
+ return this.coords.push(t, s), this.heightAt(t, s) === J && this._invalidPoints.add(e), e;
522
522
  }
523
523
  _addTriangle(t, s, e, o, l, r, i = this.triangles.length) {
524
524
  const a = i / 3;
@@ -682,6 +682,8 @@ export {
682
682
  ht as b,
683
683
  pt as c,
684
684
  gt as d,
685
- vt as e,
685
+ ut as e,
686
+ vt as f,
687
+ ot as m,
686
688
  yt as t
687
689
  };