@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.
- package/README.md +120 -120
- package/dist/chunk-61X6qE5N.js +981 -0
- package/dist/chunk-ChG5d4HC.js +675 -0
- package/dist/{chunk-BolRQZt9.js → chunk-M-Pcc_Yg.js} +22 -20
- package/dist/generators.js +271 -260
- package/dist/main.js +5185 -3434
- package/dist/sdk.js +492 -316
- package/dist/shaderLib/oit.glsl +106 -0
- package/dist/types/components/Annotations/AutoUpdate.d.ts +1 -1
- package/dist/types/components/Annotations/index.d.ts +2 -2
- package/dist/types/components/Annotations/types.d.ts +3 -1
- package/dist/types/components/Annotations/update-annotations.d.ts +10 -0
- package/dist/types/components/EventEmitter/EventEmitterContext.d.ts +2 -1
- package/dist/types/components/EventEmitter/index.d.ts +1 -0
- package/dist/types/components/EventEmitter/picking-helper.d.ts +25 -0
- package/dist/types/components/EventEmitter/picking-material.d.ts +8 -5
- package/dist/types/components/Surfaces/Surface.d.ts +8 -1
- package/dist/types/components/Surfaces/SurfaceMaterial.d.ts +3 -0
- package/dist/types/components/Surfaces/surface-defs.d.ts +1 -0
- package/dist/types/components/Wellbores/Casings/CasingEmitterMaterial.d.ts +16 -0
- package/dist/types/components/Wellbores/Casings/CasingSection.d.ts +3 -2
- package/dist/types/components/Wellbores/Casings/Casings.d.ts +3 -2
- package/dist/types/generators/surface-generator.d.ts +1 -1
- package/dist/types/layers/layers.d.ts +4 -0
- package/dist/types/rendering/OitMaterial.d.ts +59 -0
- package/dist/types/rendering/Pass.d.ts +7 -0
- package/dist/types/rendering/RenderingPipeline.d.ts +37 -0
- package/dist/types/rendering/fullscreen-renderer.d.ts +1 -0
- package/dist/types/rendering/gpu-timer.d.ts +46 -0
- package/dist/types/rendering/index.d.ts +7 -1
- package/dist/types/rendering/oit-material.d.ts +122 -0
- package/dist/types/{components/Annotations/annotations-renderer.d.ts → rendering/passes/AnnotationsPass.d.ts} +13 -4
- package/dist/types/rendering/passes/FXAAPass.d.ts +12 -0
- package/dist/types/rendering/passes/OITRenderPass.d.ts +282 -0
- package/dist/types/rendering/passes/OutputPass.d.ts +10 -0
- package/dist/types/rendering/passes/RenderPass.d.ts +8 -0
- package/dist/types/rendering/passes/SMAAPass.d.ts +40 -0
- package/dist/types/rendering/passes/TAAPass.d.ts +94 -0
- package/dist/types/rendering/passes/index.d.ts +6 -0
- package/dist/types/rendering/rendering-state.d.ts +59 -0
- package/dist/types/sdk/index.d.ts +2 -0
- package/dist/types/sdk/utils/elevation-map.d.ts +23 -0
- package/dist/types/sdk/utils/trigonometry.d.ts +4 -1
- package/package.json +1 -1
- package/dist/chunk-CnY6Tmof.js +0 -358
- package/dist/chunk-iY0wQ9Z6.js +0 -887
- package/dist/types/rendering/render-passes.d.ts +0 -16
|
@@ -0,0 +1,981 @@
|
|
|
1
|
+
import { EPS as Pt, CurveInterpolator as Ft } from "curve-interpolator";
|
|
2
|
+
import { BufferGeometry as mt, BufferAttribute as G, Vector3 as D, ShaderMaterial as pt, OrthographicCamera as Et, Scene as It, PlaneGeometry as Rt, Mesh as Ut, WebGLRenderTarget as Vt, RGBAFormat as Dt, UnsignedByteType as ht, DataTexture as nt, RedFormat as Ct, FloatType as Bt, LinearFilter as U, RGFormat as Lt } from "three";
|
|
3
|
+
import "comlink";
|
|
4
|
+
import "p-limit";
|
|
5
|
+
import "three/src/math/MathUtils.js";
|
|
6
|
+
import "proj4";
|
|
7
|
+
async function ie(t, e, r, n) {
|
|
8
|
+
const s = await r.get("formations", t) || [];
|
|
9
|
+
n = n === void 0 ? -1 / 0 : n;
|
|
10
|
+
const o = s.filter(
|
|
11
|
+
(a) => a.stratColumnId === e && a.exit.mdMsl > n
|
|
12
|
+
);
|
|
13
|
+
return o.sort(
|
|
14
|
+
(a, i) => a.entry.mdMsl - i.entry.mdMsl || a.level - i.level
|
|
15
|
+
), o.length && o[0].entry.mdMsl < n && (o[0].entry.mdMsl = n), o;
|
|
16
|
+
}
|
|
17
|
+
function it(t, e, r) {
|
|
18
|
+
return {
|
|
19
|
+
mdMslFrom: e,
|
|
20
|
+
mdMslTo: r,
|
|
21
|
+
name: t.name,
|
|
22
|
+
level: t.level,
|
|
23
|
+
color: t.color,
|
|
24
|
+
properties: { ...t.properties || {} }
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function ce(t) {
|
|
28
|
+
if (!t.length) return [];
|
|
29
|
+
let e = [];
|
|
30
|
+
const r = [...t].sort((n, s) => {
|
|
31
|
+
const o = s.level - n.level || n.entry.mdMsl - s.entry.mdMsl;
|
|
32
|
+
if (o === 0 && (n.properties?.updated || s.properties?.updated)) {
|
|
33
|
+
const a = n.properties?.updated ? new Date(n.properties?.updated) : null, i = s.properties?.updated ? new Date(s.properties?.updated) : null;
|
|
34
|
+
return a === null ? 1 : i === null ? -1 : i.getTime() - a.getTime();
|
|
35
|
+
}
|
|
36
|
+
return o;
|
|
37
|
+
});
|
|
38
|
+
for (let n = 0; n < r.length; n++) {
|
|
39
|
+
const s = r[n];
|
|
40
|
+
let o = s.entry.mdMsl;
|
|
41
|
+
const a = [...e];
|
|
42
|
+
for (let i = 0; i < e.length && o < s.exit.mdMsl; i++) {
|
|
43
|
+
const c = e[i];
|
|
44
|
+
if (o < c.mdMslFrom) {
|
|
45
|
+
const l = Math.min(s.exit.mdMsl, c.mdMslFrom);
|
|
46
|
+
a.push(it(s, o, l));
|
|
47
|
+
}
|
|
48
|
+
o = Math.max(o, c.mdMslTo);
|
|
49
|
+
}
|
|
50
|
+
o < s.exit.mdMsl && a.push(
|
|
51
|
+
it(s, o, s.exit.mdMsl)
|
|
52
|
+
), e = a.sort((i, c) => i.mdMslFrom - c.mdMslFrom);
|
|
53
|
+
}
|
|
54
|
+
return e;
|
|
55
|
+
}
|
|
56
|
+
function le(t) {
|
|
57
|
+
const e = [], r = [...t].sort(
|
|
58
|
+
(o, a) => o.entry.mdMsl - a.entry.mdMsl || a.level - o.level
|
|
59
|
+
);
|
|
60
|
+
let n = null, s = -1 / 0;
|
|
61
|
+
for (let o = 0; o < r.length; o++) {
|
|
62
|
+
const a = r[o];
|
|
63
|
+
a.entry.mdMsl > s && (s = a.entry.mdMsl, n && n.exit.mdMsl < s && e.push({
|
|
64
|
+
color: n.color,
|
|
65
|
+
name: n.name,
|
|
66
|
+
type: "base",
|
|
67
|
+
mdMsl: n.exit.mdMsl,
|
|
68
|
+
tvdMsl: n.exit.tvdMsl,
|
|
69
|
+
level: n.level
|
|
70
|
+
}), e.push({
|
|
71
|
+
color: a.color,
|
|
72
|
+
name: a.name,
|
|
73
|
+
type: "top",
|
|
74
|
+
mdMsl: s,
|
|
75
|
+
tvdMsl: a.entry.tvdMsl,
|
|
76
|
+
level: a.level
|
|
77
|
+
}), n = a);
|
|
78
|
+
}
|
|
79
|
+
return n && e.push({
|
|
80
|
+
color: n.color,
|
|
81
|
+
name: n.name,
|
|
82
|
+
type: "base",
|
|
83
|
+
mdMsl: n.exit.mdMsl,
|
|
84
|
+
tvdMsl: n.exit.tvdMsl,
|
|
85
|
+
level: n.level
|
|
86
|
+
}), e;
|
|
87
|
+
}
|
|
88
|
+
function Z(t, e = 0, r = 1) {
|
|
89
|
+
return t < e ? e : t > r ? r : t;
|
|
90
|
+
}
|
|
91
|
+
function zt(t, e, r) {
|
|
92
|
+
return r = Z(r, 0, 1), (1 - r) * t + r * e;
|
|
93
|
+
}
|
|
94
|
+
function kt(t, e, r) {
|
|
95
|
+
return (t - e) / (r - e);
|
|
96
|
+
}
|
|
97
|
+
function ue(t, e, r, n, s) {
|
|
98
|
+
const o = kt(t, e, r);
|
|
99
|
+
return zt(n, s, o);
|
|
100
|
+
}
|
|
101
|
+
const de = (t) => {
|
|
102
|
+
if (t < 0) return [0, 0, 0];
|
|
103
|
+
if (t > 16777.215) throw Error("Value out of range!");
|
|
104
|
+
const e = Math.round(t * 1e3), r = Math.floor(e / 65536), n = Math.floor(e / 256) - r * 256, s = Math.floor(e) - r * 65536 - n * 256;
|
|
105
|
+
return [r, n, s];
|
|
106
|
+
}, fe = Math.PI, ct = 2 * Math.PI, Nt = Math.PI / 2, me = Math.PI / 4, pe = Math.PI / 8;
|
|
107
|
+
function he(t, e, r) {
|
|
108
|
+
for (; e < -Math.PI; )
|
|
109
|
+
e += ct;
|
|
110
|
+
for (; e > Math.PI; )
|
|
111
|
+
e -= ct;
|
|
112
|
+
const n = Math.atan2(t[1], t[0]), s = Math.tan(e);
|
|
113
|
+
let o;
|
|
114
|
+
e > -n && e <= n ? o = 1 : e > n && e <= Math.PI - n ? o = 2 : e > Math.PI - n || e <= -(Math.PI - n) ? o = 3 : o = 4;
|
|
115
|
+
const a = r || [0, 0];
|
|
116
|
+
a[0] = 0, a[1] = 0;
|
|
117
|
+
let i = 1, c = 1;
|
|
118
|
+
switch (o) {
|
|
119
|
+
case 1:
|
|
120
|
+
c = -1;
|
|
121
|
+
break;
|
|
122
|
+
case 2:
|
|
123
|
+
c = -1;
|
|
124
|
+
break;
|
|
125
|
+
case 3:
|
|
126
|
+
i = -1;
|
|
127
|
+
break;
|
|
128
|
+
case 4:
|
|
129
|
+
i = -1;
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
return o === 1 || o === 3 ? (a[0] += i * (t[0] / 2), a[1] += c * (t[0] / 2) * s) : (a[0] += i * (t[1] / (2 * s)), a[1] += c * (t[1] / 2)), a;
|
|
133
|
+
}
|
|
134
|
+
function ge(t) {
|
|
135
|
+
return t[0] = -t[0], t[1] = -t[1], t[2] = -t[2], t;
|
|
136
|
+
}
|
|
137
|
+
function ye(t, e) {
|
|
138
|
+
return [t[e], t[e + 1], t[e + 2]];
|
|
139
|
+
}
|
|
140
|
+
function Me(t, e, r) {
|
|
141
|
+
t[e] = r[0], t[e + 1] = r[1], t[e + 2] = r[2];
|
|
142
|
+
}
|
|
143
|
+
function be(t, e) {
|
|
144
|
+
return [t[0] + e[0], t[1] + e[1], t[2] + e[2]];
|
|
145
|
+
}
|
|
146
|
+
function j(t, e) {
|
|
147
|
+
return [t[0] - e[0], t[1] - e[1], t[2] - e[2]];
|
|
148
|
+
}
|
|
149
|
+
function Ae(t, e) {
|
|
150
|
+
return t[0] = t[0] * e, t[1] = t[1] * e, t[2] = t[2] * e, t;
|
|
151
|
+
}
|
|
152
|
+
function gt(t) {
|
|
153
|
+
const e = t[0] ** 2 + t[1] ** 2 + t[2] ** 2;
|
|
154
|
+
return e > 0 ? Math.sqrt(e) : 0;
|
|
155
|
+
}
|
|
156
|
+
function P(t, e) {
|
|
157
|
+
return [
|
|
158
|
+
t[1] * e[2] - t[2] * e[1],
|
|
159
|
+
t[2] * e[0] - t[0] * e[2],
|
|
160
|
+
t[0] * e[1] - t[1] * e[0]
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
function rt(t, e) {
|
|
164
|
+
return t[0] * e[0] + t[1] * e[1] + t[2] * e[2];
|
|
165
|
+
}
|
|
166
|
+
function V(t) {
|
|
167
|
+
const e = Math.sqrt(t[0] * t[0] + t[1] * t[1] + t[2] * t[2]);
|
|
168
|
+
return e ? (t[0] = t[0] / e, t[1] = t[1] / e, t[2] = t[2] / e, t) : [0, 0, 0];
|
|
169
|
+
}
|
|
170
|
+
function xe(t, e, r = 0.5) {
|
|
171
|
+
const n = 1 - r;
|
|
172
|
+
return [
|
|
173
|
+
t[0] * n + e[0] * r,
|
|
174
|
+
t[1] * n + e[1] * r,
|
|
175
|
+
t[2] * n + e[2] * r
|
|
176
|
+
];
|
|
177
|
+
}
|
|
178
|
+
function Wt(t) {
|
|
179
|
+
return [t[0], t[1], t[2]];
|
|
180
|
+
}
|
|
181
|
+
function we(t, e) {
|
|
182
|
+
const r = Math.sqrt(
|
|
183
|
+
(t[0] ** 2 + t[1] ** 2 + t[2] ** 2) * (e[0] ** 2 + e[1] ** 2 + e[2] ** 2)
|
|
184
|
+
);
|
|
185
|
+
if (r === 0) return Nt;
|
|
186
|
+
const n = rt(t, e) / r;
|
|
187
|
+
return Math.acos(Z(n, -1, 1));
|
|
188
|
+
}
|
|
189
|
+
function yt(t, e = [0, 1, 0], r = 0) {
|
|
190
|
+
const n = Math.cos(r), s = Math.sin(r), o = 1 - n, a = t[0], i = t[1], c = t[2], l = e[0], u = e[1], m = e[2], f = o * l, d = o * u;
|
|
191
|
+
return [
|
|
192
|
+
(f * l + n) * a + (f * u - s * m) * i + (f * m + s * u) * c,
|
|
193
|
+
(f * u + s * m) * a + (d * u + n) * i + (d * m - s * l) * c,
|
|
194
|
+
(f * m - s * u) * a + (d * m + s * l) * i + (o * m * m + n) * c
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
function ve(t, e) {
|
|
198
|
+
return V(j(e, t));
|
|
199
|
+
}
|
|
200
|
+
function Te(t, e) {
|
|
201
|
+
return gt(j(e, t));
|
|
202
|
+
}
|
|
203
|
+
function Pe(t, e) {
|
|
204
|
+
return [t[e], t[e + 1]];
|
|
205
|
+
}
|
|
206
|
+
function Fe(t, e, r) {
|
|
207
|
+
t[e] = r[0], t[e + 1] = r[1];
|
|
208
|
+
}
|
|
209
|
+
function Mt(t) {
|
|
210
|
+
const e = Math.sqrt(t[0] * t[0] + t[1] * t[1]);
|
|
211
|
+
return e ? (t[0] = t[0] / e, t[1] = t[1] / e, t) : [0, 0];
|
|
212
|
+
}
|
|
213
|
+
function lt(t, e) {
|
|
214
|
+
return [t[0] + e[0], t[1] + e[1]];
|
|
215
|
+
}
|
|
216
|
+
function ot(t, e) {
|
|
217
|
+
return [t[0] - e[0], t[1] - e[1]];
|
|
218
|
+
}
|
|
219
|
+
function bt(t, e) {
|
|
220
|
+
return t[0] * e[0] + t[1] * e[1];
|
|
221
|
+
}
|
|
222
|
+
function Ee(t) {
|
|
223
|
+
return t[0] = -t[0], t[1] = -t[1], t;
|
|
224
|
+
}
|
|
225
|
+
function Ie(t, e) {
|
|
226
|
+
return t[0] = t[0] * e, t[1] = t[1] * e, t;
|
|
227
|
+
}
|
|
228
|
+
function Gt(t) {
|
|
229
|
+
const e = t[0] ** 2 + t[1] ** 2;
|
|
230
|
+
return e > 0 ? Math.sqrt(e) : 0;
|
|
231
|
+
}
|
|
232
|
+
function Re(t, e, r = 0.5) {
|
|
233
|
+
const n = 1 - r;
|
|
234
|
+
return [t[0] * n + e[0] * r, t[1] * n + e[1] * r];
|
|
235
|
+
}
|
|
236
|
+
function Q(t, e) {
|
|
237
|
+
return Mt(ot(e, t));
|
|
238
|
+
}
|
|
239
|
+
function J(t, e) {
|
|
240
|
+
return Gt(ot(e, t));
|
|
241
|
+
}
|
|
242
|
+
function jt(t, e = !1) {
|
|
243
|
+
const r = {
|
|
244
|
+
alpha: 1,
|
|
245
|
+
tension: 0,
|
|
246
|
+
closed: e
|
|
247
|
+
}, n = new Ft(t, r);
|
|
248
|
+
return {
|
|
249
|
+
getPointAt: (o) => n.getPointAt(o),
|
|
250
|
+
getPoints: (o, a = 0, i = 1) => n.getPoints(o, null, a, i),
|
|
251
|
+
getTangentAt: (o) => n.getTangentAt(o),
|
|
252
|
+
getNormalAt: (o) => n.getNormalAt(o),
|
|
253
|
+
getBoundingBox: (o = 0, a = 1) => {
|
|
254
|
+
const i = n.getBoundingBox(o, a);
|
|
255
|
+
return {
|
|
256
|
+
min: i.min,
|
|
257
|
+
max: i.max
|
|
258
|
+
};
|
|
259
|
+
},
|
|
260
|
+
nearest: (o) => {
|
|
261
|
+
const a = n.getNearestPosition(o);
|
|
262
|
+
return {
|
|
263
|
+
position: a.u,
|
|
264
|
+
point: a.point,
|
|
265
|
+
distance: a.distance
|
|
266
|
+
};
|
|
267
|
+
},
|
|
268
|
+
get length() {
|
|
269
|
+
return n.length;
|
|
270
|
+
},
|
|
271
|
+
closed: e
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
function Ue(t, e) {
|
|
275
|
+
const r = e.length, n = new Array(r);
|
|
276
|
+
if (!n.length) return [];
|
|
277
|
+
e.forEach((l, u) => {
|
|
278
|
+
n[u] = {
|
|
279
|
+
curvePosition: l,
|
|
280
|
+
position: t.getPointAt(l),
|
|
281
|
+
tangent: t.getTangentAt(l),
|
|
282
|
+
normal: [0, 0, 0],
|
|
283
|
+
binormal: [0, 0, 0]
|
|
284
|
+
};
|
|
285
|
+
});
|
|
286
|
+
let s = [0, 1, 0], o = Math.abs(n[0].tangent[1]);
|
|
287
|
+
const a = Math.abs(n[0].tangent[0]), i = Math.abs(n[0].tangent[2]);
|
|
288
|
+
a <= o && (o = a, s = [1, 0, 0]), i <= o && (s = [0, 0, 1]);
|
|
289
|
+
let c = V(P(n[0].tangent, s));
|
|
290
|
+
n[0].normal = P(n[0].tangent, c), n[0].binormal = P(n[0].tangent, n[0].normal);
|
|
291
|
+
for (let l = 1; l < e.length; l++) {
|
|
292
|
+
if (c = P(n[l - 1].tangent, n[l].tangent), n[l].normal = Wt(n[l - 1].normal), gt(c) > Pt) {
|
|
293
|
+
V(c);
|
|
294
|
+
const u = Math.acos(
|
|
295
|
+
Z(rt(n[l - 1].tangent, n[l].tangent), -1, 1)
|
|
296
|
+
);
|
|
297
|
+
n[l].normal = yt(n[l - 1].normal, c, u);
|
|
298
|
+
}
|
|
299
|
+
n[l].binormal = P(n[l].tangent, n[l].normal);
|
|
300
|
+
}
|
|
301
|
+
return n;
|
|
302
|
+
}
|
|
303
|
+
function Ve(t, e = 0, r = 1, n = 0.1, s = 0) {
|
|
304
|
+
const o = [], a = t.length, i = Math.ceil(n * a), c = 1 / i, l = 1 / (a * 0.01);
|
|
305
|
+
s && (s *= 0.1), o.push(e);
|
|
306
|
+
let u = s ? t.getTangentAt(e) : null;
|
|
307
|
+
const m = Math.floor(e * i);
|
|
308
|
+
let f = e;
|
|
309
|
+
for (let d = m; d <= i; d++) {
|
|
310
|
+
const g = d * c, h = g - f, p = s ? t.getTangentAt(g) : null;
|
|
311
|
+
g > e && g < r && (h >= l || !s || Math.abs(rt(u, p)) < 1 - s) && (o.push(g), u = p, f = g);
|
|
312
|
+
}
|
|
313
|
+
return o.push(r), o;
|
|
314
|
+
}
|
|
315
|
+
function De(t, e) {
|
|
316
|
+
if (!e || e.length < 8) return null;
|
|
317
|
+
const [r, , n] = e, s = new Array(e.length / 4);
|
|
318
|
+
for (let m = 0, f = 0; m < s.length; m++, f += 4)
|
|
319
|
+
s[m] = [
|
|
320
|
+
e[f] - r,
|
|
321
|
+
-e[f + 1],
|
|
322
|
+
n - e[f + 2]
|
|
323
|
+
];
|
|
324
|
+
const o = jt(s, !1);
|
|
325
|
+
if (!o) return null;
|
|
326
|
+
const a = e[3], i = e[e.length - 1], c = i - a, l = (m, f = !1) => {
|
|
327
|
+
let d = (m - a) / c;
|
|
328
|
+
return f && (d = Z(d, 0, 1)), d < 0 || d > 1 ? null : d;
|
|
329
|
+
};
|
|
330
|
+
return {
|
|
331
|
+
id: t,
|
|
332
|
+
curve: o,
|
|
333
|
+
get measuredLength() {
|
|
334
|
+
return c;
|
|
335
|
+
},
|
|
336
|
+
get measuredTop() {
|
|
337
|
+
return a;
|
|
338
|
+
},
|
|
339
|
+
get measuredBottom() {
|
|
340
|
+
return i;
|
|
341
|
+
},
|
|
342
|
+
getPositionAtDepth: l,
|
|
343
|
+
getPointAtDepth: (m, f = !1) => {
|
|
344
|
+
const d = l(m, f);
|
|
345
|
+
return d !== null ? o.getPointAt(d) : null;
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
function Ce(t, e = (n) => n, r = 1e-7) {
|
|
350
|
+
if (t.length <= 2) return t;
|
|
351
|
+
let n = e(t[0]), s = [0, 0];
|
|
352
|
+
const o = [t[0]];
|
|
353
|
+
for (let a = 1; a < t.length - 1; a++) {
|
|
354
|
+
const i = e(t[a]), c = Mt(ot(i, n));
|
|
355
|
+
Math.abs(bt(s, c)) < 1 - r && (o.push(t[a]), s = c, n = i);
|
|
356
|
+
}
|
|
357
|
+
return o.push(t[t.length - 1]), o;
|
|
358
|
+
}
|
|
359
|
+
function Be(t, e, r = 1e3, n = 2e3, s = 0) {
|
|
360
|
+
if (!t || t.length < 1) return null;
|
|
361
|
+
const o = [];
|
|
362
|
+
let a = 0;
|
|
363
|
+
const i = [t[0][0], t[0][2]];
|
|
364
|
+
let c = t[0][1], l = c, u = 1;
|
|
365
|
+
o.push(i);
|
|
366
|
+
let m = o[o.length - 1];
|
|
367
|
+
for (; u < t.length; ) {
|
|
368
|
+
const d = [t[u][0], t[u][2]];
|
|
369
|
+
t[u][1] > c && (c = t[u][1]), t[u][1] < l && (l = t[u][1]);
|
|
370
|
+
const g = J(m, d);
|
|
371
|
+
if (g < e)
|
|
372
|
+
u === t.length - 1 && o.length > 1 && (a += g, o.push(d)), u++;
|
|
373
|
+
else if (a += e, g > e) {
|
|
374
|
+
const h = Q(m, d), p = [
|
|
375
|
+
m[0] + h[0] * e,
|
|
376
|
+
m[1] + h[1] * e
|
|
377
|
+
];
|
|
378
|
+
o.push(p), m = p;
|
|
379
|
+
} else
|
|
380
|
+
o.push(d), m = d, u++;
|
|
381
|
+
}
|
|
382
|
+
const f = o.length;
|
|
383
|
+
if (r || a < n) {
|
|
384
|
+
let d = 0, g = r;
|
|
385
|
+
a + r / 2 < n && (d = (n - a) / 2, g = d);
|
|
386
|
+
let h = [
|
|
387
|
+
Math.cos(s),
|
|
388
|
+
Math.sin(s)
|
|
389
|
+
];
|
|
390
|
+
if (g) {
|
|
391
|
+
f > 1 && (h = Q(
|
|
392
|
+
o[o.length - 2],
|
|
393
|
+
o[o.length - 1]
|
|
394
|
+
));
|
|
395
|
+
const p = o[o.length - 1], F = Math.floor(g / e), v = [
|
|
396
|
+
h[0] * e,
|
|
397
|
+
h[1] * e
|
|
398
|
+
], A = [
|
|
399
|
+
p[0] + h[0] * g,
|
|
400
|
+
p[1] + h[1] * g
|
|
401
|
+
];
|
|
402
|
+
let b = p;
|
|
403
|
+
for (let T = 0; T < F; T++)
|
|
404
|
+
b = lt(b, v), o.push(b);
|
|
405
|
+
J(b, A) && o.push(A);
|
|
406
|
+
}
|
|
407
|
+
if (d) {
|
|
408
|
+
let p;
|
|
409
|
+
f > 1 ? p = Q(o[1], o[0]) : p = [
|
|
410
|
+
-Math.cos(s),
|
|
411
|
+
-Math.sin(s)
|
|
412
|
+
], (a < 100 || Math.abs(bt(h, p)) > 0.95) && (p = [
|
|
413
|
+
-h[0],
|
|
414
|
+
-h[1]
|
|
415
|
+
]);
|
|
416
|
+
const F = Math.floor(d / e), v = [
|
|
417
|
+
p[0] * e,
|
|
418
|
+
p[1] * e
|
|
419
|
+
], A = [
|
|
420
|
+
i[0] + p[0] * d,
|
|
421
|
+
i[1] + p[1] * d
|
|
422
|
+
];
|
|
423
|
+
let b = i;
|
|
424
|
+
for (let T = 0; T < F; T++)
|
|
425
|
+
b = lt(b, v), o.unshift(b);
|
|
426
|
+
J(
|
|
427
|
+
b,
|
|
428
|
+
A
|
|
429
|
+
) && o.unshift(A);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
return {
|
|
433
|
+
positions: o,
|
|
434
|
+
top: c,
|
|
435
|
+
bottom: l,
|
|
436
|
+
length: a
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
function _(t) {
|
|
440
|
+
if (t.constructor === Uint8Array) return "Uint8Array";
|
|
441
|
+
if (t.constructor === Uint16Array) return "Uint16Array";
|
|
442
|
+
if (t.constructor === Uint32Array) return "Uint32Array";
|
|
443
|
+
if (t.constructor === Int8Array) return "Int8Array";
|
|
444
|
+
if (t.constructor === Int16Array) return "Int16Array";
|
|
445
|
+
if (t.constructor === Int32Array) return "Int32Array";
|
|
446
|
+
if (t.constructor === Float32Array) return "Float32Array";
|
|
447
|
+
if (t.constructor === Float64Array) return "Float64Array";
|
|
448
|
+
throw Error("Unsupported typed array!");
|
|
449
|
+
}
|
|
450
|
+
function q(t, e) {
|
|
451
|
+
switch (e) {
|
|
452
|
+
case "Uint8Array":
|
|
453
|
+
return new Uint8Array(t);
|
|
454
|
+
case "Uint16Array":
|
|
455
|
+
return new Uint16Array(t);
|
|
456
|
+
case "Uint32Array":
|
|
457
|
+
return new Uint32Array(t);
|
|
458
|
+
case "Int8Array":
|
|
459
|
+
return new Int8Array(t);
|
|
460
|
+
case "Int16Array":
|
|
461
|
+
return new Int16Array(t);
|
|
462
|
+
case "Int32Array":
|
|
463
|
+
return new Int32Array(t);
|
|
464
|
+
case "Float32Array":
|
|
465
|
+
return new Float32Array(t);
|
|
466
|
+
case "Float64Array":
|
|
467
|
+
return new Float64Array(t);
|
|
468
|
+
default:
|
|
469
|
+
throw Error("Unsupported typed array!");
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
function _t(t, e = 1) {
|
|
473
|
+
return {
|
|
474
|
+
buffer: t.buffer,
|
|
475
|
+
attributeType: _(t),
|
|
476
|
+
itemSize: e
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
function Le(t) {
|
|
480
|
+
const e = [], r = {
|
|
481
|
+
drawRange: t.drawRange || { start: 0, count: 1 / 0 },
|
|
482
|
+
groups: t.groups || [],
|
|
483
|
+
attributes: {},
|
|
484
|
+
index: t.index,
|
|
485
|
+
indexType: t.index ? _(t.index) : void 0,
|
|
486
|
+
userData: t.userData ? structuredClone(t.userData) : void 0
|
|
487
|
+
};
|
|
488
|
+
for (const n in t.attributes)
|
|
489
|
+
r.attributes[n] = _t(
|
|
490
|
+
t.attributes[n].array,
|
|
491
|
+
t.attributes[n].itemSize
|
|
492
|
+
), e.push(r.attributes[n].buffer);
|
|
493
|
+
return [r, e];
|
|
494
|
+
}
|
|
495
|
+
function qt(t) {
|
|
496
|
+
const e = [], r = {
|
|
497
|
+
drawRange: t.drawRange,
|
|
498
|
+
groups: t.groups,
|
|
499
|
+
attributes: {},
|
|
500
|
+
index: void 0,
|
|
501
|
+
indexType: void 0
|
|
502
|
+
}, n = t.getIndex();
|
|
503
|
+
n && (r.index = n.array.buffer, r.indexType = _(n.array));
|
|
504
|
+
for (const s in t.attributes) {
|
|
505
|
+
const o = t.getAttribute(s);
|
|
506
|
+
r.attributes[s] = {
|
|
507
|
+
buffer: o.array.buffer,
|
|
508
|
+
attributeType: _(o.array),
|
|
509
|
+
itemSize: o.itemSize
|
|
510
|
+
}, e.push(r.attributes[s].buffer);
|
|
511
|
+
}
|
|
512
|
+
return t.userData && (r.userData = structuredClone(t.userData)), [r, e];
|
|
513
|
+
}
|
|
514
|
+
function ze(t) {
|
|
515
|
+
const e = {}, r = [];
|
|
516
|
+
for (const n in t) {
|
|
517
|
+
const s = t[n], o = qt(s);
|
|
518
|
+
e[n] = o[0], o[1].length && r.push(...o[1]);
|
|
519
|
+
}
|
|
520
|
+
return { data: e, transferrables: r };
|
|
521
|
+
}
|
|
522
|
+
function ke(t) {
|
|
523
|
+
const e = new mt();
|
|
524
|
+
if (t.index) {
|
|
525
|
+
const r = q(
|
|
526
|
+
t.index,
|
|
527
|
+
t.indexType || "Uint32Array"
|
|
528
|
+
), n = new G(r, 1);
|
|
529
|
+
e.setIndex(n);
|
|
530
|
+
}
|
|
531
|
+
for (const r in t.attributes) {
|
|
532
|
+
const n = new G(
|
|
533
|
+
q(
|
|
534
|
+
t.attributes[r].buffer,
|
|
535
|
+
t.attributes[r].attributeType
|
|
536
|
+
),
|
|
537
|
+
t.attributes[r].itemSize
|
|
538
|
+
);
|
|
539
|
+
e.setAttribute(r, n);
|
|
540
|
+
}
|
|
541
|
+
return e.drawRange = t.drawRange, e.groups = t.groups, t.userData && (e.userData = t.userData), e;
|
|
542
|
+
}
|
|
543
|
+
function Ne(t) {
|
|
544
|
+
const e = {};
|
|
545
|
+
for (const r in t) {
|
|
546
|
+
const n = new mt();
|
|
547
|
+
if (t[r].index) {
|
|
548
|
+
const s = q(
|
|
549
|
+
t[r].index,
|
|
550
|
+
t[r].indexType || "Uint32Array"
|
|
551
|
+
), o = new G(s, 1);
|
|
552
|
+
n.setIndex(o);
|
|
553
|
+
}
|
|
554
|
+
for (const s in t[r].attributes) {
|
|
555
|
+
const o = new G(
|
|
556
|
+
q(
|
|
557
|
+
t[r].attributes[s].buffer,
|
|
558
|
+
t[r].attributes[s].attributeType
|
|
559
|
+
),
|
|
560
|
+
t[r].attributes[s].itemSize
|
|
561
|
+
);
|
|
562
|
+
n.setAttribute(s, o);
|
|
563
|
+
}
|
|
564
|
+
n.drawRange = t[r].drawRange, n.groups = t[r].groups, e[r] = n;
|
|
565
|
+
}
|
|
566
|
+
return e;
|
|
567
|
+
}
|
|
568
|
+
const K = "camera-set-position", X = "camera-focus-point";
|
|
569
|
+
class We extends CustomEvent {
|
|
570
|
+
constructor(e) {
|
|
571
|
+
super(K, { detail: e });
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
class Ge extends CustomEvent {
|
|
575
|
+
constructor(e) {
|
|
576
|
+
super(X, { detail: e });
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
const x = new D(), M = new D(), R = new D(), B = new D(), ut = new D();
|
|
580
|
+
async function Zt(t, e, r) {
|
|
581
|
+
r.normalizeRotations();
|
|
582
|
+
const n = Math.min(r.distance, e);
|
|
583
|
+
return x.set(...t), r.getPosition(M), R.subVectors(x, M), e = Math.min(R.length() * 1.5, n), R.normalize(), M.copy(x).addScaledVector(R, -n), r.setLookAt(
|
|
584
|
+
M.x,
|
|
585
|
+
M.y,
|
|
586
|
+
M.z,
|
|
587
|
+
x.x,
|
|
588
|
+
x.y,
|
|
589
|
+
x.z,
|
|
590
|
+
!0
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
function St(t, e) {
|
|
594
|
+
e.normalizeRotations(), B.set(...t), e.getTarget(x), ut.subVectors(x, B), e.getPosition(M), M.sub(ut), e.setPosition(M.x, M.y, M.z), e.setTarget(B.x, B.y, B.z);
|
|
595
|
+
}
|
|
596
|
+
class je {
|
|
597
|
+
controls = null;
|
|
598
|
+
removeEventlisteners = null;
|
|
599
|
+
constructor() {
|
|
600
|
+
this.setControls = this.setControls.bind(this);
|
|
601
|
+
}
|
|
602
|
+
addEventListeners() {
|
|
603
|
+
const e = (n) => {
|
|
604
|
+
this.controls && St(n.detail, this.controls);
|
|
605
|
+
}, r = (n) => {
|
|
606
|
+
if (this.controls) {
|
|
607
|
+
const s = n.detail.callback;
|
|
608
|
+
Zt(
|
|
609
|
+
n.detail.point,
|
|
610
|
+
n.detail.distance || 200,
|
|
611
|
+
this.controls
|
|
612
|
+
).then(() => {
|
|
613
|
+
s && s();
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
addEventListener(K, e), addEventListener(X, r), this.removeEventlisteners = () => {
|
|
618
|
+
removeEventListener(K, e), removeEventListener(X, r);
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
async setTarget(e) {
|
|
622
|
+
const r = this.controls;
|
|
623
|
+
return r ? (x.set(...e), r.getPosition(M), R.subVectors(x, M), R.normalize(), r.setLookAt(
|
|
624
|
+
M.x,
|
|
625
|
+
M.y,
|
|
626
|
+
M.z,
|
|
627
|
+
x.x,
|
|
628
|
+
x.y,
|
|
629
|
+
x.z,
|
|
630
|
+
!0
|
|
631
|
+
)) : null;
|
|
632
|
+
}
|
|
633
|
+
setControls(e) {
|
|
634
|
+
this.controls = e, this.removeEventlisteners && this.removeEventlisteners(), this.addEventListeners();
|
|
635
|
+
}
|
|
636
|
+
dispose() {
|
|
637
|
+
this.controls = null, this.removeEventlisteners && this.removeEventlisteners();
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
const Ot = "wellbore-selected", tt = "wellbore-added", et = "wellbore-removed";
|
|
641
|
+
class _e extends CustomEvent {
|
|
642
|
+
constructor(e) {
|
|
643
|
+
super(Ot, { detail: e });
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
class qe extends CustomEvent {
|
|
647
|
+
constructor(e) {
|
|
648
|
+
super(tt, { detail: e });
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
class Ze extends CustomEvent {
|
|
652
|
+
constructor(e) {
|
|
653
|
+
super(et, { detail: e });
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
const dt = new D();
|
|
657
|
+
class Se {
|
|
658
|
+
map = /* @__PURE__ */ new Map();
|
|
659
|
+
constructor() {
|
|
660
|
+
this.onWellboreAdded = this.onWellboreAdded.bind(this), this.onWellboreRemoved = this.onWellboreRemoved.bind(this), addEventListener(tt, this.onWellboreAdded), addEventListener(et, this.onWellboreRemoved);
|
|
661
|
+
}
|
|
662
|
+
onWellboreAdded(e) {
|
|
663
|
+
this.map.set(e.detail.id, {
|
|
664
|
+
wellboreId: e.detail.id,
|
|
665
|
+
object: e.detail.object
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
onWellboreRemoved(e) {
|
|
669
|
+
this.map.delete(e.detail.id);
|
|
670
|
+
}
|
|
671
|
+
getInfo(e) {
|
|
672
|
+
const r = this.map.get(e);
|
|
673
|
+
if (r)
|
|
674
|
+
return r.object.getWorldPosition(dt), {
|
|
675
|
+
...r,
|
|
676
|
+
position: dt.toArray()
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
dispose() {
|
|
680
|
+
removeEventListener(tt, this.onWellboreAdded), removeEventListener(et, this.onWellboreRemoved);
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
function Oe(t) {
|
|
684
|
+
return t / 3.28084;
|
|
685
|
+
}
|
|
686
|
+
function He(t) {
|
|
687
|
+
return t * (Math.PI / 180);
|
|
688
|
+
}
|
|
689
|
+
const Ye = (t, e = 1, r = 1) => [t[0] / e * 2 - 1, -(t[1] / r) * 2 + 1], $e = (t, e = 1, r = 1) => [(t[0] + 1) / 2 * e, (1 - t[1]) / 2 * r];
|
|
690
|
+
var Ht = `#include <common>
|
|
691
|
+
|
|
692
|
+
varying vec2 vUv;
|
|
693
|
+
|
|
694
|
+
void main() {
|
|
695
|
+
vUv = uv;
|
|
696
|
+
gl_Position = vec4(position, 1.0);
|
|
697
|
+
}`, Yt = `#include <common>
|
|
698
|
+
#include <packing>
|
|
699
|
+
|
|
700
|
+
varying vec2 vUv;
|
|
701
|
+
uniform sampler2D depthTexture;
|
|
702
|
+
uniform float cameraFar;
|
|
703
|
+
uniform float cameraNear;
|
|
704
|
+
|
|
705
|
+
float linearizeDepth(in float depth) {
|
|
706
|
+
float a = cameraFar / (cameraFar - cameraNear);
|
|
707
|
+
float b = cameraFar * cameraNear / (cameraNear - cameraFar);
|
|
708
|
+
|
|
709
|
+
return a + b / depth;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
float linearizeLogDepth(in float depth) {
|
|
713
|
+
float z = exp2(depth * log2(cameraFar + 1.0)) - 1.0;
|
|
714
|
+
return linearizeDepth(z);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
void main() {
|
|
718
|
+
float depth = texture(depthTexture, vUv).r;
|
|
719
|
+
float viewZ;
|
|
720
|
+
#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) || defined( USE_LOGDEPTHBUF )
|
|
721
|
+
viewZ = linearizeLogDepth(depth);
|
|
722
|
+
#else
|
|
723
|
+
viewZ = depth;
|
|
724
|
+
#endif
|
|
725
|
+
|
|
726
|
+
gl_FragColor = packDepthToRGBA(viewZ);
|
|
727
|
+
}`;
|
|
728
|
+
class $t extends pt {
|
|
729
|
+
constructor() {
|
|
730
|
+
super({
|
|
731
|
+
vertexShader: Ht,
|
|
732
|
+
fragmentShader: Yt,
|
|
733
|
+
uniforms: {
|
|
734
|
+
cameraNear: { value: 0 },
|
|
735
|
+
cameraFar: { value: 1 },
|
|
736
|
+
depthTexture: { value: null },
|
|
737
|
+
cameraWasPerspective: { value: null }
|
|
738
|
+
},
|
|
739
|
+
toneMapped: !1,
|
|
740
|
+
depthWrite: !1,
|
|
741
|
+
depthTest: !1
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
const k = 255 / 256, N = new Float32Array([
|
|
746
|
+
k,
|
|
747
|
+
k / 256,
|
|
748
|
+
k / 256 ** 2,
|
|
749
|
+
k / 256 ** 3
|
|
750
|
+
]);
|
|
751
|
+
function ft(t, e, r, n) {
|
|
752
|
+
return t / 255 * N[0] + e / 255 * N[1] + r / 255 * N[2] + n / 255 * N[3];
|
|
753
|
+
}
|
|
754
|
+
const Qt = new Et(-1, 1, 1, -1, 0, 1), L = new $t(), At = new It(), Jt = new Rt(2, 2), Kt = new Ut(Jt, L);
|
|
755
|
+
let I = null, w = null;
|
|
756
|
+
At.add(Kt);
|
|
757
|
+
async function Qe(t, e, r, n) {
|
|
758
|
+
if (!t) return null;
|
|
759
|
+
try {
|
|
760
|
+
const { width: s, height: o } = t;
|
|
761
|
+
if ((!I || !w || I.width !== s || I.height !== o) && (I?.dispose(), w = new Uint8Array(4 * s * o), I = new Vt(s, o, {
|
|
762
|
+
type: ht,
|
|
763
|
+
format: Dt,
|
|
764
|
+
depthBuffer: !1,
|
|
765
|
+
stencilBuffer: !1
|
|
766
|
+
})), L.uniforms.depthTexture.value = t, L.uniforms.cameraNear.value = r.near, L.uniforms.cameraFar.value = r.far, L.uniforms.cameraWasPerspective.value = r.isPerspectiveCamera, e.setRenderTarget(I), e.clear(), e.render(At, Qt), e.setRenderTarget(null), await e.readRenderTargetPixelsAsync(
|
|
767
|
+
I,
|
|
768
|
+
0,
|
|
769
|
+
// x
|
|
770
|
+
0,
|
|
771
|
+
// y
|
|
772
|
+
s,
|
|
773
|
+
o,
|
|
774
|
+
w
|
|
775
|
+
), n !== void 0 && Number.isFinite(n))
|
|
776
|
+
return ft(
|
|
777
|
+
w[n],
|
|
778
|
+
w[n + 1],
|
|
779
|
+
w[n + 2],
|
|
780
|
+
w[n + 3]
|
|
781
|
+
) * 2 - 1;
|
|
782
|
+
{
|
|
783
|
+
const a = new Array(w.length / 4);
|
|
784
|
+
for (let i = 0; i < a.length; i++) {
|
|
785
|
+
const c = i * 4;
|
|
786
|
+
a[i] = ft(
|
|
787
|
+
w[c],
|
|
788
|
+
w[c + 1],
|
|
789
|
+
w[c + 2],
|
|
790
|
+
w[c + 3]
|
|
791
|
+
) * 2 - 1;
|
|
792
|
+
}
|
|
793
|
+
return a;
|
|
794
|
+
}
|
|
795
|
+
} catch (s) {
|
|
796
|
+
return console.error(s), null;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
function W(t, e, r) {
|
|
800
|
+
const n = j(t, e), s = j(t, r);
|
|
801
|
+
return V(P(n, s));
|
|
802
|
+
}
|
|
803
|
+
function Je(t, e, r, n, s = 0, o = -1) {
|
|
804
|
+
const a = t.length / e, i = e - 1, c = a - 1, l = new Uint8Array(i * c * 4);
|
|
805
|
+
let u = 0;
|
|
806
|
+
const m = (f, d) => t[d * e + f];
|
|
807
|
+
for (let f = 0; f < c; f++) {
|
|
808
|
+
const d = f + 1, g = f + 0.5;
|
|
809
|
+
for (let h = 0; h < i; h++) {
|
|
810
|
+
const p = h + 1, F = h + 0.5, v = m(h, f);
|
|
811
|
+
if (v !== o) {
|
|
812
|
+
const A = m(h, d), b = m(p, f), E = m(p, d), T = (v + A + b + E) / 4, C = [h * r, f * n, v], y = [h * r, d * n, A], st = [p * r, f * n, b], at = [p * r, d * n, E], z = [F * r, g * n, T], S = W(z, C, st), O = W(z, st, at), H = W(z, at, y), Y = W(z, y, C), xt = V([
|
|
813
|
+
S[0] + O[0] + H[0] + Y[0],
|
|
814
|
+
S[2] + O[2] + H[2] + Y[2],
|
|
815
|
+
S[1] + O[1] + H[1] + Y[1]
|
|
816
|
+
]), $ = yt(xt, [0, 1, 0], s * (Math.PI / 180)), wt = Math.floor(($[0] + 1) / 2 * 255), vt = Math.floor(($[1] + 1) / 2 * 255), Tt = Math.floor(($[2] + 1) / 2 * 255);
|
|
817
|
+
l[u] = wt, l[u + 1] = vt, l[u + 2] = Tt, l[u + 3] = 255;
|
|
818
|
+
} else
|
|
819
|
+
l[u] = 0, l[u + 1] = 0, l[u + 2] = 0, l[u + 3] = 0;
|
|
820
|
+
u += 4;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
return l;
|
|
824
|
+
}
|
|
825
|
+
function Ke(t, e, r) {
|
|
826
|
+
const n = new nt(t, e, r);
|
|
827
|
+
return n.minFilter = U, n.magFilter = U, n.flipY = !0, n.anisotropy = 4, n.needsUpdate = !0, n;
|
|
828
|
+
}
|
|
829
|
+
function Xe(t, e, r) {
|
|
830
|
+
const n = new nt(
|
|
831
|
+
t,
|
|
832
|
+
e,
|
|
833
|
+
r,
|
|
834
|
+
Ct,
|
|
835
|
+
Bt
|
|
836
|
+
);
|
|
837
|
+
return n.minFilter = U, n.magFilter = U, n.needsUpdate = !0, n.flipY = !0, n;
|
|
838
|
+
}
|
|
839
|
+
function tn(t, e, r, n, s) {
|
|
840
|
+
const o = new Uint8Array(e * r * 2), a = (i, c) => {
|
|
841
|
+
const l = i < 0 ? 0 : i >= r ? r - 1 : i, u = c < 0 ? 0 : c >= e ? e - 1 : c;
|
|
842
|
+
return t[l * e + u];
|
|
843
|
+
};
|
|
844
|
+
for (let i = 0; i < r; i++)
|
|
845
|
+
for (let c = 0; c < e; c++) {
|
|
846
|
+
const l = i * e + c, u = t[l];
|
|
847
|
+
let m = 0, f = 1e-4, d = 0;
|
|
848
|
+
if (u >= 0) {
|
|
849
|
+
const p = a(i - 1, c - 1), F = a(i - 1, c + 1), v = a(i + 1, c - 1), A = a(i + 1, c + 1), b = [-n, p - u, -s], E = [n, F - u, -s], T = [-n, v - u, s], C = [n, A - u, s];
|
|
850
|
+
if (p >= 0 && F >= 0) {
|
|
851
|
+
const y = P(E, b);
|
|
852
|
+
m += y[0], f += y[1], d += y[2];
|
|
853
|
+
}
|
|
854
|
+
if (F >= 0 && A >= 0) {
|
|
855
|
+
const y = P(C, E);
|
|
856
|
+
m += y[0], f += y[1], d += y[2];
|
|
857
|
+
}
|
|
858
|
+
if (v >= 0 && A >= 0) {
|
|
859
|
+
const y = P(T, C);
|
|
860
|
+
m += y[0], f += y[1], d += y[2];
|
|
861
|
+
}
|
|
862
|
+
if (A >= 0 && p >= 0) {
|
|
863
|
+
const y = P(b, T);
|
|
864
|
+
m += y[0], f += y[1], d += y[2];
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
const g = V([m, f, d]), h = l * 2;
|
|
868
|
+
o[h] = Math.round((g[0] + 1) / 2 * 255), o[h + 1] = Math.round((g[2] + 1) / 2 * 255);
|
|
869
|
+
}
|
|
870
|
+
return o;
|
|
871
|
+
}
|
|
872
|
+
function en(t, e, r) {
|
|
873
|
+
const n = new nt(
|
|
874
|
+
t,
|
|
875
|
+
e,
|
|
876
|
+
r,
|
|
877
|
+
Lt,
|
|
878
|
+
ht
|
|
879
|
+
);
|
|
880
|
+
return n.minFilter = U, n.magFilter = U, n.flipY = !0, n.needsUpdate = !0, n;
|
|
881
|
+
}
|
|
882
|
+
var Xt = `varying vec2 vUv;
|
|
883
|
+
|
|
884
|
+
void main() {
|
|
885
|
+
vUv = uv;
|
|
886
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
887
|
+
|
|
888
|
+
}`, te = `varying vec2 vUv;
|
|
889
|
+
|
|
890
|
+
void main() {
|
|
891
|
+
|
|
892
|
+
gl_FragColor = vec4(vUv, 1.0, 1.0);
|
|
893
|
+
|
|
894
|
+
}`;
|
|
895
|
+
const nn = new pt({
|
|
896
|
+
vertexShader: Xt,
|
|
897
|
+
fragmentShader: te
|
|
898
|
+
});
|
|
899
|
+
export {
|
|
900
|
+
ye as $,
|
|
901
|
+
lt as A,
|
|
902
|
+
be as B,
|
|
903
|
+
Ge as C,
|
|
904
|
+
$t as D,
|
|
905
|
+
we as E,
|
|
906
|
+
tn as F,
|
|
907
|
+
Wt as G,
|
|
908
|
+
Ke as H,
|
|
909
|
+
P as I,
|
|
910
|
+
He as J,
|
|
911
|
+
Q as K,
|
|
912
|
+
ve as L,
|
|
913
|
+
J as M,
|
|
914
|
+
Te as N,
|
|
915
|
+
bt as O,
|
|
916
|
+
fe as P,
|
|
917
|
+
rt as Q,
|
|
918
|
+
Je as R,
|
|
919
|
+
Oe as S,
|
|
920
|
+
ct as T,
|
|
921
|
+
le as U,
|
|
922
|
+
Be as V,
|
|
923
|
+
qe as W,
|
|
924
|
+
jt as X,
|
|
925
|
+
q as Y,
|
|
926
|
+
_ as Z,
|
|
927
|
+
Pe as _,
|
|
928
|
+
me as a,
|
|
929
|
+
kt as a0,
|
|
930
|
+
Gt as a1,
|
|
931
|
+
gt as a2,
|
|
932
|
+
zt as a3,
|
|
933
|
+
Re as a4,
|
|
934
|
+
xe as a5,
|
|
935
|
+
Ee as a6,
|
|
936
|
+
ge as a7,
|
|
937
|
+
V as a8,
|
|
938
|
+
_t as a9,
|
|
939
|
+
ze as aa,
|
|
940
|
+
qt as ab,
|
|
941
|
+
Le as ac,
|
|
942
|
+
Qe as ad,
|
|
943
|
+
ue as ae,
|
|
944
|
+
yt as af,
|
|
945
|
+
Ie as ag,
|
|
946
|
+
Ae as ah,
|
|
947
|
+
Ye as ai,
|
|
948
|
+
Fe as aj,
|
|
949
|
+
Me as ak,
|
|
950
|
+
Ce as al,
|
|
951
|
+
j as am,
|
|
952
|
+
de as an,
|
|
953
|
+
W as ao,
|
|
954
|
+
Ne as ap,
|
|
955
|
+
nn as aq,
|
|
956
|
+
Nt as b,
|
|
957
|
+
pe as c,
|
|
958
|
+
Z as d,
|
|
959
|
+
he as e,
|
|
960
|
+
$e as f,
|
|
961
|
+
ie as g,
|
|
962
|
+
De as h,
|
|
963
|
+
Xe as i,
|
|
964
|
+
en as j,
|
|
965
|
+
Ze as k,
|
|
966
|
+
K as l,
|
|
967
|
+
ce as m,
|
|
968
|
+
Mt as n,
|
|
969
|
+
X as o,
|
|
970
|
+
Ve as p,
|
|
971
|
+
Ue as q,
|
|
972
|
+
We as r,
|
|
973
|
+
ot as s,
|
|
974
|
+
_e as t,
|
|
975
|
+
ke as u,
|
|
976
|
+
et as v,
|
|
977
|
+
tt as w,
|
|
978
|
+
Ot as x,
|
|
979
|
+
je as y,
|
|
980
|
+
Se as z
|
|
981
|
+
};
|