@equinor/videx-3d 2.0.0 → 3.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/dist/chunk-DKAquGKk.js +2820 -0
- package/dist/chunk-DsUZyEG_.js +16 -0
- package/dist/generators.js +512 -727
- package/dist/main.js +6940 -10553
- package/dist/sdk.js +2 -787
- package/dist/types/components/Ocean/Ocean.d.ts +333 -0
- package/dist/types/components/Ocean/index.d.ts +6 -0
- package/dist/types/components/Ocean/ocean-bed-material.d.ts +60 -0
- package/dist/types/components/Ocean/ocean-contact.d.ts +39 -0
- package/dist/types/components/Ocean/ocean-material.d.ts +145 -0
- package/dist/types/components/Ocean/ocean-sampler.d.ts +93 -0
- package/dist/types/components/Ocean/ocean-volume-material.d.ts +54 -0
- package/dist/types/components/Tanker/Tanker.d.ts +47 -0
- package/dist/types/components/Tanker/TankerSuperstructure.d.ts +23 -0
- package/dist/types/components/Tanker/tanker-geometry-builder.d.ts +21 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/rendering/Pass.d.ts +10 -1
- package/dist/types/rendering/RenderingPipeline.d.ts +10 -1
- package/dist/types/rendering/debug/DebugBoxOutputPass.d.ts +22 -0
- package/dist/types/rendering/debug/DebugPatternPass.d.ts +30 -0
- package/dist/types/rendering/fxaa-resolver.d.ts +25 -0
- package/dist/types/rendering/index.d.ts +1 -0
- package/dist/types/rendering/passes/AnnotationsPass.d.ts +1 -0
- package/dist/types/rendering/passes/FXAAPass.d.ts +11 -6
- package/dist/types/rendering/passes/OITRenderPass.d.ts +147 -0
- package/dist/types/rendering/passes/OutputPass.d.ts +9 -0
- package/dist/types/rendering/passes/RenderPass.d.ts +2 -0
- package/dist/types/rendering/passes/index.d.ts +0 -2
- package/dist/types/rendering/smaa-resolver.d.ts +58 -0
- package/dist/types/rendering/taa-resolver.d.ts +161 -0
- package/dist/types/rendering/temporal-resolver.d.ts +152 -0
- package/dist/types/sdk/geometries/boundary-loops.d.ts +38 -0
- package/dist/types/sdk/geometries/geometry-attributes.d.ts +37 -0
- package/dist/types/sdk/geometries/grid-sampling.d.ts +50 -0
- package/dist/types/sdk/geometries/ocean-geometry.d.ts +288 -0
- package/dist/types/sdk/geometries/packing.d.ts +1 -1
- package/dist/types/sdk/geometries/tessellation.d.ts +25 -0
- package/dist/types/sdk/index.d.ts +5 -0
- package/dist/types/sdk/utils/vector-operations.d.ts +7 -0
- package/package.json +9 -10
- package/dist/chunk-61X6qE5N.js +0 -981
- package/dist/chunk-ChG5d4HC.js +0 -675
- package/dist/chunk-DuRASjkF.js +0 -17
- package/dist/chunk-M-Pcc_Yg.js +0 -689
- package/dist/types/rendering/passes/SMAAPass.d.ts +0 -40
- package/dist/types/rendering/passes/TAAPass.d.ts +0 -94
- /package/dist/{shaderLib → src/sdk/materials/shaderLib}/color-conversion.glsl +0 -0
- /package/dist/{shaderLib → src/sdk/materials/shaderLib}/colors.glsl +0 -0
- /package/dist/{shaderLib → src/sdk/materials/shaderLib}/glyphs.glsl +0 -0
- /package/dist/{shaderLib → src/sdk/materials/shaderLib}/oit.glsl +0 -0
- /package/dist/{shaderLib → src/sdk/materials/shaderLib}/random.glsl +0 -0
- /package/dist/{shaderLib → src/sdk/materials/shaderLib}/remap.glsl +0 -0
- /package/dist/{shaderLib → src/sdk/materials/shaderLib}/render-number.glsl +0 -0
- /package/dist/{shaderLib → src/sdk/materials/shaderLib}/render-text.glsl +0 -0
- /package/dist/{shaderLib → src/sdk/materials/shaderLib}/rotation.glsl +0 -0
- /package/dist/{shaderLib → src/sdk/materials/shaderLib}/sdf-functions.glsl +0 -0
- /package/dist/textures/{normal_map.jpg → public/normal_map.jpg} +0 -0
package/dist/generators.js
CHANGED
|
@@ -1,748 +1,533 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
import "
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const w = e.curve.getPointAt(f);
|
|
28
|
-
s[h * 3] = w[0], s[h * 3 + 1] = w[1], s[h * 3 + 2] = w[2], g && (g[h] = f);
|
|
29
|
-
});
|
|
30
|
-
const u = {
|
|
31
|
-
position: {
|
|
32
|
-
array: s,
|
|
33
|
-
itemSize: 3
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
g && (u.lengths = {
|
|
37
|
-
array: g,
|
|
38
|
-
itemSize: 1
|
|
39
|
-
});
|
|
40
|
-
const [c, a] = ct({ attributes: u });
|
|
41
|
-
return x(c, a);
|
|
1
|
+
import { At as e, Cn as t, Ct as n, Dt as r, E as i, Jt as a, Rt as o, T as s, Tn as c, _ as l, dt as u, gn as d, jt as f, ln as p, mn as m, nt as h, rt as g, tn as _, u as v, wn as y, wt as b, xt as x } from "./chunk-DKAquGKk.js";
|
|
2
|
+
import { n as S } from "./chunk-DsUZyEG_.js";
|
|
3
|
+
import { Box3 as C, BufferAttribute as w, BufferGeometry as T, Color as E, Matrix4 as D, Sphere as ee, Vector3 as O } from "three";
|
|
4
|
+
import { transfer as k } from "comlink";
|
|
5
|
+
import { clamp as A } from "curve-interpolator";
|
|
6
|
+
import { mergeBufferGeometries as j } from "three-stdlib";
|
|
7
|
+
import { group as te } from "d3-array";
|
|
8
|
+
//#region src/generators/basic-trajectory-generator.ts
|
|
9
|
+
async function ne(e, t, r = 0, i, a = !1) {
|
|
10
|
+
let o = n(e, await this.get("position-logs", e));
|
|
11
|
+
if (!o) return null;
|
|
12
|
+
let s = i === void 0 ? 0 : m((i - o.measuredTop) / o.measuredLength, 0, 1), c = f(o.curve, s, 1, t, r), l = new Float32Array(c.length * 3), u = a ? new Float32Array(c.length) : null;
|
|
13
|
+
c.forEach((e, t) => {
|
|
14
|
+
let n = o.curve.getPointAt(e);
|
|
15
|
+
l[t * 3] = n[0], l[t * 3 + 1] = n[1], l[t * 3 + 2] = n[2], u && (u[t] = e);
|
|
16
|
+
});
|
|
17
|
+
let d = { position: {
|
|
18
|
+
array: l,
|
|
19
|
+
itemSize: 3
|
|
20
|
+
} };
|
|
21
|
+
u && (d.lengths = {
|
|
22
|
+
array: u,
|
|
23
|
+
itemSize: 1
|
|
24
|
+
});
|
|
25
|
+
let [p, h] = g({ attributes: d });
|
|
26
|
+
return k(p, h);
|
|
42
27
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/generators/casing-annotations-generator.ts
|
|
30
|
+
async function re(e) {
|
|
31
|
+
let t = await this.get("casings", e);
|
|
32
|
+
if (!t) return null;
|
|
33
|
+
let r = n(e, await this.get("position-logs", e));
|
|
34
|
+
return r ? t.filter((e) => e.mdBottomMsl > r.measuredTop).map((e) => {
|
|
35
|
+
let t = m((e.mdTopMsl + (e.mdBottomMsl - e.mdTopMsl) / 2 - r.measuredTop) / r.measuredLength, 0, 1);
|
|
36
|
+
return {
|
|
37
|
+
name: `${e.properties.Diameter} ${e.properties.Type}`,
|
|
38
|
+
data: {
|
|
39
|
+
...e.properties,
|
|
40
|
+
isShoe: e.isShoe
|
|
41
|
+
},
|
|
42
|
+
position: r.curve.getPointAt(t),
|
|
43
|
+
direction: r.curve.getTangentAt(t),
|
|
44
|
+
priority: e.isShoe ? 50 : e.innerDiameter
|
|
45
|
+
};
|
|
46
|
+
}) : null;
|
|
61
47
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/generators/casings-generator.ts
|
|
50
|
+
var M = new ee();
|
|
51
|
+
function N(e, t, n) {
|
|
52
|
+
if (t[0] === n[0]) return n[1];
|
|
53
|
+
let r = n[0] - t[0], i = m((e - t[0]) / r, 0, 1);
|
|
54
|
+
return d(t[1], n[1], i);
|
|
67
55
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
// outer radius,
|
|
86
|
-
]); g <= h && s < m.length - 1; )
|
|
87
|
-
g = m[++s];
|
|
88
|
-
for (; g < d && s < m.length; ) {
|
|
89
|
-
const T = Pt(g, r[a], r[f]);
|
|
90
|
-
n.push([g, T]), g = m[s++];
|
|
91
|
-
}
|
|
92
|
-
f === r.length - 1 && n.push([d, y]);
|
|
93
|
-
}
|
|
94
|
-
const u = nt(
|
|
95
|
-
o,
|
|
96
|
-
n.map((a) => a[0])
|
|
97
|
-
), c = l - i;
|
|
98
|
-
return u.forEach((a, f) => {
|
|
99
|
-
e.push(
|
|
100
|
-
...a.position,
|
|
101
|
-
...a.normal,
|
|
102
|
-
...a.tangent,
|
|
103
|
-
b((a.curvePosition - i) / c, 0, 1),
|
|
104
|
-
// segment length 0-1
|
|
105
|
-
a.curvePosition,
|
|
106
|
-
// position on curve 0-1
|
|
107
|
-
n[f][1]
|
|
108
|
-
// outer radius
|
|
109
|
-
);
|
|
110
|
-
}), Float32Array.from(e);
|
|
56
|
+
function P(t, n, r, i, a, o) {
|
|
57
|
+
let s = [];
|
|
58
|
+
i.sort((e, t) => e[0] - t[0]);
|
|
59
|
+
let c = [], l = f(t, n, r, a, o), u = 0, d = l[u];
|
|
60
|
+
for (let e = 0; e < i.length - 1; e++) {
|
|
61
|
+
let t = e + 1, [n, r] = i[e], [a, o] = i[t];
|
|
62
|
+
for (c.push([n, r]); d <= n && u < l.length - 1;) d = l[++u];
|
|
63
|
+
for (; d < a && u < l.length;) {
|
|
64
|
+
let n = N(d, i[e], i[t]);
|
|
65
|
+
c.push([d, n]), d = l[u++];
|
|
66
|
+
}
|
|
67
|
+
t === i.length - 1 && c.push([a, o]);
|
|
68
|
+
}
|
|
69
|
+
let p = e(t, c.map((e) => e[0])), h = r - n;
|
|
70
|
+
return p.forEach((e, t) => {
|
|
71
|
+
s.push(...e.position, ...e.normal, ...e.tangent, m((e.curvePosition - n) / h, 0, 1), e.curvePosition, c[t][1]);
|
|
72
|
+
}), Float32Array.from(s);
|
|
111
73
|
}
|
|
112
|
-
async function
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
T.push(
|
|
151
|
-
[h, d],
|
|
152
|
-
[h + (w - h) / 4, d],
|
|
153
|
-
[w, L]
|
|
154
|
-
);
|
|
155
|
-
} else {
|
|
156
|
-
const L = d - (d - y) / 4;
|
|
157
|
-
T.push([h, L]);
|
|
158
|
-
const I = Math.min((d - L) * 2, f / 3) * g;
|
|
159
|
-
T.push([h + I, d]), T.push([w - I, d]), T.push([w, L]);
|
|
160
|
-
}
|
|
161
|
-
const $ = Dt(
|
|
162
|
-
n.curve,
|
|
163
|
-
h,
|
|
164
|
-
w,
|
|
165
|
-
T,
|
|
166
|
-
r,
|
|
167
|
-
p
|
|
168
|
-
), M = n.curve.getBoundingBox(h, w);
|
|
169
|
-
new Mt(new v(...M.min), new v(...M.max)).getBoundingSphere(U), c.push({
|
|
170
|
-
type: a.type,
|
|
171
|
-
radius: d,
|
|
172
|
-
innerRadius: y,
|
|
173
|
-
length: f,
|
|
174
|
-
top: h,
|
|
175
|
-
bottom: w,
|
|
176
|
-
attributesBuffer: $,
|
|
177
|
-
segments: $.length / 12,
|
|
178
|
-
boundingSphere: {
|
|
179
|
-
center: U.center.toArray(),
|
|
180
|
-
radius: U.radius
|
|
181
|
-
}
|
|
182
|
-
}), u.push($.buffer);
|
|
183
|
-
}), x(c, u);
|
|
74
|
+
async function ie(e, t, r = 2, i = .1, a = 0) {
|
|
75
|
+
let o = await this.get("casings", e);
|
|
76
|
+
if (!o) return null;
|
|
77
|
+
let s = n(e, await this.get("position-logs", e));
|
|
78
|
+
if (!s) return null;
|
|
79
|
+
let c = t === void 0 ? 0 : m((t - s.measuredTop) / s.measuredLength, 0, 1), l = o.filter((e) => e.mdBottomMsl > s.measuredTop && (t === void 0 || e.mdBottomMsl > t)).map((e) => ({
|
|
80
|
+
...e,
|
|
81
|
+
mdTopMsl: Math.max(e.mdTopMsl, s.measuredTop)
|
|
82
|
+
})).sort((e, t) => e.outerDiameter - t.outerDiameter || e.mdTopMsl - t.mdTopMsl);
|
|
83
|
+
if (l.length === 0) return null;
|
|
84
|
+
let u = 1 / s.measuredLength, d = [], f = [];
|
|
85
|
+
return l.forEach((e) => {
|
|
86
|
+
let t = m(e.mdBottomMsl - e.mdTopMsl, 1e-4, s.measuredLength), n = Math.max(c, m((e.mdTopMsl - s.measuredTop) / s.measuredLength, 0, 1)), o = m((e.mdBottomMsl - s.measuredTop) / s.measuredLength, 0, 1), l = e.outerDiameter / 2, p = e.innerDiameter ? e.innerDiameter / 2 : l * .95, h = [];
|
|
87
|
+
if (e.isShoe) {
|
|
88
|
+
let e = l * r;
|
|
89
|
+
h.push([n, l], [n + (o - n) / 4, l], [o, e]);
|
|
90
|
+
} else {
|
|
91
|
+
let e = l - (l - p) / 4;
|
|
92
|
+
h.push([n, e]);
|
|
93
|
+
let r = Math.min((l - e) * 2, t / 3) * u;
|
|
94
|
+
h.push([n + r, l]), h.push([o - r, l]), h.push([o, e]);
|
|
95
|
+
}
|
|
96
|
+
let g = P(s.curve, n, o, h, i, a), _ = s.curve.getBoundingBox(n, o);
|
|
97
|
+
new C(new O(..._.min), new O(..._.max)).getBoundingSphere(M), f.push({
|
|
98
|
+
type: e.type,
|
|
99
|
+
radius: l,
|
|
100
|
+
innerRadius: p,
|
|
101
|
+
length: t,
|
|
102
|
+
top: n,
|
|
103
|
+
bottom: o,
|
|
104
|
+
attributesBuffer: g,
|
|
105
|
+
segments: g.length / 12,
|
|
106
|
+
boundingSphere: {
|
|
107
|
+
center: M.center.toArray(),
|
|
108
|
+
radius: M.radius
|
|
109
|
+
}
|
|
110
|
+
}), d.push(g.buffer);
|
|
111
|
+
}), k(f, d);
|
|
184
112
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
priority: t.diameterMax
|
|
201
|
-
};
|
|
202
|
-
}) : null;
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/generators/completion-annotations-generator.ts
|
|
115
|
+
async function ae(e) {
|
|
116
|
+
let t = await this.get("completion-tools", e);
|
|
117
|
+
if (!t) return null;
|
|
118
|
+
let r = n(e, await this.get("position-logs", e));
|
|
119
|
+
return r ? t.filter((e) => e.mdBottomMsl > r.measuredTop).map((e) => {
|
|
120
|
+
let t = m((e.mdTopMsl + e.length / 2 - r.measuredTop) / r.measuredLength, 0, 1);
|
|
121
|
+
return {
|
|
122
|
+
name: e.name,
|
|
123
|
+
position: r.curve.getPointAt(t),
|
|
124
|
+
direction: r.curve.getTangentAt(t),
|
|
125
|
+
priority: e.diameterMax
|
|
126
|
+
};
|
|
127
|
+
}) : null;
|
|
203
128
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
computeLengths: !0,
|
|
221
|
-
radiusModifier: {
|
|
222
|
-
type: "linear",
|
|
223
|
-
steps: n
|
|
224
|
-
}
|
|
225
|
-
});
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/generators/completion-tools-generator.ts
|
|
131
|
+
function oe(e, t, n, i, a) {
|
|
132
|
+
let o = m(t.length, 1e-4, e.measuredLength), s = 1 / e.measuredLength, c = [], l = m((t.mdTopMsl - e.measuredTop) / e.measuredLength, 0, 1), u = m((t.mdBottomMsl - e.measuredTop) / e.measuredLength, 0, 1), d = n * ((t.diameterTop || t.diameterBottom) / 2), f = n * ((t.diameterBottom || t.diameterTop) / 2), p = n * ((t.diameterMax || t.diameterTop) / 2), h = Math.min(d, f, p);
|
|
133
|
+
c.push([l, d]);
|
|
134
|
+
let g = Math.min((p - h) * 2, o / 3) * s;
|
|
135
|
+
return p > h && (c.push([l + g, p]), c.push([u - g, p])), c.push([u, f]), r(e.curve, {
|
|
136
|
+
...a,
|
|
137
|
+
from: Math.max(l, i),
|
|
138
|
+
to: u,
|
|
139
|
+
computeLengths: !0,
|
|
140
|
+
radiusModifier: {
|
|
141
|
+
type: "linear",
|
|
142
|
+
steps: c
|
|
143
|
+
}
|
|
144
|
+
});
|
|
226
145
|
}
|
|
227
|
-
async function
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
)).filter((B) => B);
|
|
256
|
-
f.push(xt[T]);
|
|
257
|
-
const M = Y(
|
|
258
|
-
$,
|
|
259
|
-
!1
|
|
260
|
-
);
|
|
261
|
-
M && a.push(M);
|
|
262
|
-
}), !a.length) return null;
|
|
263
|
-
const h = Y(a, !0);
|
|
264
|
-
if (!h) return null;
|
|
265
|
-
h.groups.forEach((y, T) => {
|
|
266
|
-
y.materialIndex = f[T];
|
|
267
|
-
});
|
|
268
|
-
const [w, d] = E(h);
|
|
269
|
-
return x(w, d);
|
|
146
|
+
async function se(e, t, r = 16, i = 1, a = .1, o = 0) {
|
|
147
|
+
let s = await this.get("completion-tools", e);
|
|
148
|
+
if (!s) return null;
|
|
149
|
+
let c = n(e, await this.get("position-logs", e));
|
|
150
|
+
if (!c) return null;
|
|
151
|
+
let l = t === void 0 ? 0 : m((t - c.measuredTop) / c.measuredLength, 0, 1), u = te(s.filter((e) => e.mdBottomMsl > c.measuredTop && (t === void 0 || e.mdBottomMsl > t)).sort((e, t) => e.mdTopMsl - t.mdTopMsl), (e) => e.category), d = {
|
|
152
|
+
startCap: !0,
|
|
153
|
+
endCap: !0,
|
|
154
|
+
radialSegments: r,
|
|
155
|
+
computeNormals: !0,
|
|
156
|
+
computeUvs: !0,
|
|
157
|
+
segmentsPerMeter: a,
|
|
158
|
+
simplificationThreshold: o,
|
|
159
|
+
radius: 0
|
|
160
|
+
}, f = [], p = [];
|
|
161
|
+
if (u.forEach((e, t) => {
|
|
162
|
+
let n = e.map((e) => oe(c, e, i, l, d)).filter((e) => e);
|
|
163
|
+
p.push(S[t]);
|
|
164
|
+
let r = j(n, !1);
|
|
165
|
+
r && f.push(r);
|
|
166
|
+
}), !f.length) return null;
|
|
167
|
+
let g = j(f, !0);
|
|
168
|
+
if (!g) return null;
|
|
169
|
+
g.groups.forEach((e, t) => {
|
|
170
|
+
e.materialIndex = p[t];
|
|
171
|
+
});
|
|
172
|
+
let [_, v] = h(g);
|
|
173
|
+
return k(_, v);
|
|
270
174
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
return {
|
|
295
|
-
id: `${o}_${a}`,
|
|
296
|
-
name: (Math.round(a * 10) / 10).toString(),
|
|
297
|
-
direction: w,
|
|
298
|
-
position: h
|
|
299
|
-
};
|
|
300
|
-
});
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/generators/depth-markers-generator.ts
|
|
177
|
+
async function ce(e, t, r = "MSL", i) {
|
|
178
|
+
let a = await this.get("position-logs", e);
|
|
179
|
+
if (!a || a.length < 8) return null;
|
|
180
|
+
let o = 0;
|
|
181
|
+
if (r === "RT") {
|
|
182
|
+
let t = await this.get("wellbore-headers", e);
|
|
183
|
+
t && (o = t.depthReferenceElevation);
|
|
184
|
+
}
|
|
185
|
+
let s = n(e, a);
|
|
186
|
+
if (!s) return null;
|
|
187
|
+
let c = a[a.length - 1] + o, l = Math.max(s.measuredTop, i && Number.isFinite(i) ? i : s.measuredTop) + o, u = [l], d = Math.floor(l / t) * t;
|
|
188
|
+
for (d <= l && (d += t); d < c;) u.push(d), d += t;
|
|
189
|
+
return u.push(c), u.map((t) => {
|
|
190
|
+
let n = m((t - o - s.measuredTop) / s.measuredLength, 0, 1), r = s.curve.getPointAt(n), i = s.curve.getTangentAt(n);
|
|
191
|
+
return {
|
|
192
|
+
id: `${e}_${t}`,
|
|
193
|
+
name: (Math.round(t * 10) / 10).toString(),
|
|
194
|
+
direction: i,
|
|
195
|
+
position: r
|
|
196
|
+
};
|
|
197
|
+
});
|
|
301
198
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
name: `${c.name} ${Bt(c.type)}`,
|
|
337
|
-
depth: c.mdMsl,
|
|
338
|
-
tvd: c.tvdMsl,
|
|
339
|
-
level: c.level,
|
|
340
|
-
direction: c.direction
|
|
341
|
-
};
|
|
342
|
-
}), x(
|
|
343
|
-
{
|
|
344
|
-
data: u,
|
|
345
|
-
transformations: s,
|
|
346
|
-
colors: g
|
|
347
|
-
},
|
|
348
|
-
[s.buffer]
|
|
349
|
-
);
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/generators/formation-markers-generator.ts
|
|
201
|
+
var F = new O(), I = new O(), L = new O(), le = new O(0, 1, 0), R = new D(), ue = new D().makeRotationX(p), z = new E();
|
|
202
|
+
async function B(e, r, i, a = 10) {
|
|
203
|
+
let o = await y(e, r, this, i);
|
|
204
|
+
if (!o) return null;
|
|
205
|
+
let s = t(o);
|
|
206
|
+
if (!s.length) return null;
|
|
207
|
+
let c = n(e, await this.get("position-logs", e));
|
|
208
|
+
if (!c) return null;
|
|
209
|
+
let l = s.map((e) => {
|
|
210
|
+
let t = A((e.mdMsl - c.measuredTop) / c.measuredLength, 0, 1);
|
|
211
|
+
return {
|
|
212
|
+
...e,
|
|
213
|
+
position: c.curve.getPointAt(t),
|
|
214
|
+
direction: c.curve.getTangentAt(t)
|
|
215
|
+
};
|
|
216
|
+
}), u = new Float32Array(l.length * 16), d = new Float32Array(l.length * 3), f = [];
|
|
217
|
+
return l.forEach((t, n) => {
|
|
218
|
+
F.set(...t.position), R.identity();
|
|
219
|
+
let r = a;
|
|
220
|
+
L.set(r, r, r), I.set(F.x + t.direction[0], F.y + t.direction[1], F.z + t.direction[2]), R.lookAt(F, I, le), R.multiply(ue), R.setPosition(F), R.scale(L), R.toArray(u, n * 16), z.set(t.color), z.toArray(d, n * 3), f[n] = {
|
|
221
|
+
id: `${e}_${n}`,
|
|
222
|
+
name: `${t.name} ${v(t.type)}`,
|
|
223
|
+
depth: t.mdMsl,
|
|
224
|
+
tvd: t.tvdMsl,
|
|
225
|
+
level: t.level,
|
|
226
|
+
direction: t.direction
|
|
227
|
+
};
|
|
228
|
+
}), k({
|
|
229
|
+
data: f,
|
|
230
|
+
transformations: u,
|
|
231
|
+
colors: d
|
|
232
|
+
}, [u.buffer]);
|
|
350
233
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
name: c.type,
|
|
406
|
-
position: B.position,
|
|
407
|
-
normal: L,
|
|
408
|
-
tangent: B.tangent
|
|
409
|
-
}), $ += ft(c.phase);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
const s = new Float32Array(m.length * 16), g = [];
|
|
413
|
-
for (let u = 0; u < m.length; u++) {
|
|
414
|
-
const c = m[u];
|
|
415
|
-
V.set(...c.position), Q.set(
|
|
416
|
-
V.x + c.normal[0],
|
|
417
|
-
V.y + c.normal[1],
|
|
418
|
-
V.z + c.normal[2]
|
|
419
|
-
), X.setY(
|
|
420
|
-
l + l * (Math.random() - 0.5) * 0.25
|
|
421
|
-
), C.identity(), C.lookAt(V, Q, Rt), C.multiply(kt), C.setPosition(V), C.scale(X), C.toArray(s, u * 16), g[u] = {
|
|
422
|
-
id: `${o}_${u}`,
|
|
423
|
-
name: c.name,
|
|
424
|
-
direction: c.tangent
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
return x(
|
|
428
|
-
{
|
|
429
|
-
data: g,
|
|
430
|
-
transformations: s
|
|
431
|
-
},
|
|
432
|
-
[s.buffer]
|
|
433
|
-
);
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region src/generators/perforations-generator.ts
|
|
236
|
+
var V = new O(), H = new O(), U = new O(), de = new O(0, 1, 0), W = new D(), fe = new D().makeRotationX(p);
|
|
237
|
+
async function pe(t, r, a = 1) {
|
|
238
|
+
let c = await this.get("perforations", t);
|
|
239
|
+
if (!c) return null;
|
|
240
|
+
let l = n(t, await this.get("position-logs", t));
|
|
241
|
+
if (!l) return null;
|
|
242
|
+
U.set(Math.max(1, a / 2), a, Math.max(1, a / 2));
|
|
243
|
+
let u = [], d = c.filter((e) => e.status === "Open" && e.mdBottomMsl > l.measuredTop && (r === void 0 || e.mdBottomMsl > r)).sort((e, t) => e.mdTopMsl - t.mdTopMsl);
|
|
244
|
+
for (let e = 0; e < d.length; e++) {
|
|
245
|
+
let t = d[e];
|
|
246
|
+
t.mdBottomMsl <= l.measuredTop || (!u.length || u[u.length - 1].bottom !== t.mdTopMsl ? u.push({
|
|
247
|
+
type: t.type,
|
|
248
|
+
top: Math.max(l.measuredTop, t.mdTopMsl),
|
|
249
|
+
bottom: t.mdBottomMsl,
|
|
250
|
+
density: i(t.density || 0),
|
|
251
|
+
phase: t.phase || 0,
|
|
252
|
+
innerDiameter: 0,
|
|
253
|
+
outerDiameter: 0
|
|
254
|
+
}) : u.length && (u[u.length - 1].bottom = t.mdBottomMsl));
|
|
255
|
+
}
|
|
256
|
+
let f = [];
|
|
257
|
+
for (let t = 0; t < u.length; t++) {
|
|
258
|
+
let n = u[t], r = n.bottom - n.top, i = Math.max(1, Math.floor(r * n.density)), a = m((n.top - l.measuredTop) / l.measuredLength, 0, 1), c = (m((n.bottom - l.measuredTop) / l.measuredLength, 0, 1) - a) / i, d = [];
|
|
259
|
+
for (let e = 0; e < i; e++) d.push(a + c * e);
|
|
260
|
+
let h = e(l.curve, d), g = p;
|
|
261
|
+
for (let e = 0; e < h.length; e++) {
|
|
262
|
+
let t = h[e], r = _(o(t.tangent, [
|
|
263
|
+
0,
|
|
264
|
+
-1,
|
|
265
|
+
0
|
|
266
|
+
]), t.tangent, g);
|
|
267
|
+
f.push({
|
|
268
|
+
name: n.type,
|
|
269
|
+
position: t.position,
|
|
270
|
+
normal: r,
|
|
271
|
+
tangent: t.tangent
|
|
272
|
+
}), g += s(n.phase);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
let h = new Float32Array(f.length * 16), g = [];
|
|
276
|
+
for (let e = 0; e < f.length; e++) {
|
|
277
|
+
let n = f[e];
|
|
278
|
+
V.set(...n.position), H.set(V.x + n.normal[0], V.y + n.normal[1], V.z + n.normal[2]), U.setY(a + a * (Math.random() - .5) * .25), W.identity(), W.lookAt(V, H, de), W.multiply(fe), W.setPosition(V), W.scale(U), W.toArray(h, e * 16), g[e] = {
|
|
279
|
+
id: `${t}_${e}`,
|
|
280
|
+
name: n.name,
|
|
281
|
+
direction: n.tangent
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
return k({
|
|
285
|
+
data: g,
|
|
286
|
+
transformations: h
|
|
287
|
+
}, [h.buffer]);
|
|
434
288
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region src/generators/perimieter-generator.ts
|
|
291
|
+
async function me(e, t, i = .1, a = 0) {
|
|
292
|
+
let o = n(e, await this.get("position-logs", e));
|
|
293
|
+
if (!o) return null;
|
|
294
|
+
let s = {
|
|
295
|
+
from: 0,
|
|
296
|
+
to: 1,
|
|
297
|
+
startCap: !1,
|
|
298
|
+
endCap: !1,
|
|
299
|
+
radialSegments: 32,
|
|
300
|
+
computeLengths: !0,
|
|
301
|
+
computeUvs: !0,
|
|
302
|
+
segmentsPerMeter: i,
|
|
303
|
+
simplificationThreshold: a,
|
|
304
|
+
radius: t
|
|
305
|
+
}, c = r(o.curve, s);
|
|
306
|
+
if (!c) return null;
|
|
307
|
+
let [l, u] = h(c);
|
|
308
|
+
return k(l, u);
|
|
453
309
|
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
depth: f,
|
|
478
|
-
position: d
|
|
479
|
-
};
|
|
480
|
-
}), x(
|
|
481
|
-
{
|
|
482
|
-
data: a,
|
|
483
|
-
transformations: c
|
|
484
|
-
},
|
|
485
|
-
[c.buffer]
|
|
486
|
-
);
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region src/generators/position-markers-generator.ts
|
|
312
|
+
var G = new O(), K = new O(), q = new O(), he = new O(0, 1, 0), J = new D(), ge = new D().makeRotationX(p);
|
|
313
|
+
async function _e(e, t, r, i) {
|
|
314
|
+
let a = n(e, await this.get("position-logs", e));
|
|
315
|
+
if (!a) return null;
|
|
316
|
+
let o = a.measuredBottom, s = a.measuredLength, c = Math.max(a.measuredTop, i && Number.isFinite(i) ? i : a.measuredTop), l = [c], u = Math.floor(c / r) * r;
|
|
317
|
+
for (u <= c && (u += r); u < o;) l.push(u), u += r;
|
|
318
|
+
l.push(o);
|
|
319
|
+
let d = new Float32Array(l.length * 16), f = [];
|
|
320
|
+
return l.forEach((n, r) => {
|
|
321
|
+
let i = m((n - a.measuredTop) / s, 0, 1), o = a.curve.getPointAt(i), c = a.curve.getTangentAt(i);
|
|
322
|
+
G.set(...o), J.identity();
|
|
323
|
+
let l = t + 2 / t;
|
|
324
|
+
q.set(l, l, l), K.set(G.x + c[0], G.y + c[1], G.z + c[2]), J.lookAt(G, K, he), J.multiply(ge), J.setPosition(G), J.scale(q), J.toArray(d, r * 16), f[r] = {
|
|
325
|
+
id: `${e}_${r}`,
|
|
326
|
+
depth: n,
|
|
327
|
+
position: o
|
|
328
|
+
};
|
|
329
|
+
}), k({
|
|
330
|
+
data: f,
|
|
331
|
+
transformations: d
|
|
332
|
+
}, [d.buffer]);
|
|
487
333
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
id: `${o}_${g}`,
|
|
519
|
-
name: s.name,
|
|
520
|
-
direction: s.direction
|
|
521
|
-
};
|
|
522
|
-
}), x(
|
|
523
|
-
{
|
|
524
|
-
data: m,
|
|
525
|
-
transformations: n
|
|
526
|
-
},
|
|
527
|
-
[n.buffer]
|
|
528
|
-
);
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/generators/shoes-generator.ts
|
|
336
|
+
var Y = new O(), X = new O(), Z = new O(), ve = new O(0, 1, 0), Q = new D(), ye = new D().makeRotationX(p);
|
|
337
|
+
async function be(e, t, r) {
|
|
338
|
+
let i = await this.get("casings", e);
|
|
339
|
+
if (!i) return null;
|
|
340
|
+
let a = n(e, await this.get("position-logs", e));
|
|
341
|
+
if (!a) return null;
|
|
342
|
+
let o = i.filter((e) => e.isShoe && e.mdBottomMsl > a.measuredTop && (t === void 0 || e.mdBottomMsl > t)).map((e) => {
|
|
343
|
+
let t = m((e.mdBottomMsl - a.measuredTop) / a.measuredLength, 0, 1);
|
|
344
|
+
return {
|
|
345
|
+
name: `${e.properties.Diameter} ${e.properties.Type}`,
|
|
346
|
+
data: e.properties,
|
|
347
|
+
position: a.curve.getPointAt(t),
|
|
348
|
+
direction: a.curve.getTangentAt(t),
|
|
349
|
+
radius: e.outerDiameter / 2
|
|
350
|
+
};
|
|
351
|
+
}), s = new Float32Array(o.length * 16), c = [];
|
|
352
|
+
return o.forEach((t, n) => {
|
|
353
|
+
Y.set(...t.position), Q.identity();
|
|
354
|
+
let i = t.radius * (r || 1);
|
|
355
|
+
Z.set(i, i, i), X.set(Y.x + t.direction[0], Y.y + t.direction[1], Y.z + t.direction[2]), Q.lookAt(Y, X, ve), Q.multiply(ye), Q.setPosition(Y), Q.scale(Z), Q.toArray(s, n * 16), c[n] = {
|
|
356
|
+
id: `${e}_${n}`,
|
|
357
|
+
name: t.name,
|
|
358
|
+
direction: t.direction
|
|
359
|
+
};
|
|
360
|
+
}), k({
|
|
361
|
+
data: c,
|
|
362
|
+
transformations: s
|
|
363
|
+
}, [s.buffer]);
|
|
529
364
|
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
t.xinc,
|
|
545
|
-
t.yinc
|
|
546
|
-
);
|
|
547
|
-
e.normalImageBuffer = m, n.push(m.buffer);
|
|
548
|
-
}
|
|
549
|
-
return x(e, n);
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region src/generators/surface-generator.ts
|
|
367
|
+
var $ = -1;
|
|
368
|
+
async function xe(e, t = !1) {
|
|
369
|
+
let n = await this.get("surface-meta", e);
|
|
370
|
+
if (!n) return null;
|
|
371
|
+
let r = await this.get("surface-values", e);
|
|
372
|
+
if (!r) return null;
|
|
373
|
+
let i = r, { header: a } = n, o = { elevationImageBuffer: i }, s = [i.buffer];
|
|
374
|
+
if (t) {
|
|
375
|
+
let e = l(r, a.nx, a.ny, a.xinc, a.yinc);
|
|
376
|
+
o.normalImageBuffer = e, s.push(e.buffer);
|
|
377
|
+
}
|
|
378
|
+
return k(o, s);
|
|
550
379
|
}
|
|
551
|
-
async function
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
t.yinc,
|
|
561
|
-
St,
|
|
562
|
-
i
|
|
563
|
-
);
|
|
564
|
-
e.setAttribute("position", new W(n, 3)), e.setAttribute("uv", new W(m, 2)), e.setIndex(new W(s, 1)), e.translate(0, 0, -(t.ny - 1) * t.yinc), e.rotateY(t.rot * (Math.PI / 180)), e.translate(0, -r, 0);
|
|
565
|
-
const [g, u] = E(e);
|
|
566
|
-
return x(g, u);
|
|
380
|
+
async function Se(e, t = 5) {
|
|
381
|
+
let n = await this.get("surface-meta", e);
|
|
382
|
+
if (!n) return null;
|
|
383
|
+
let r = n.max, i = await this.get("surface-values", e);
|
|
384
|
+
if (!i) return null;
|
|
385
|
+
let { header: a } = n, o = new T(), { positions: s, uvs: c, indices: l } = u(i, a.nx, a.xinc, a.yinc, $, t);
|
|
386
|
+
o.setAttribute("position", new w(s, 3)), o.setAttribute("uv", new w(c, 2)), o.setIndex(new w(l, 1)), o.translate(0, 0, -(a.ny - 1) * a.yinc), o.rotateY(a.rot * (Math.PI / 180)), o.translate(0, -r, 0);
|
|
387
|
+
let [d, f] = h(o);
|
|
388
|
+
return k(d, f);
|
|
567
389
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
const [c, a] = E(u);
|
|
589
|
-
return x(c, a);
|
|
390
|
+
//#endregion
|
|
391
|
+
//#region src/generators/tube-trajectory-generator.ts
|
|
392
|
+
async function Ce(e, t, i = 0, a, o = .5, s = 16, c = !1) {
|
|
393
|
+
let l = n(e, await this.get("position-logs", e));
|
|
394
|
+
if (!l) return null;
|
|
395
|
+
let u = {
|
|
396
|
+
from: a === void 0 ? 0 : m((a - l.measuredTop) / l.measuredLength, 0, 1),
|
|
397
|
+
radius: o,
|
|
398
|
+
startCap: !0,
|
|
399
|
+
endCap: !0,
|
|
400
|
+
segmentsPerMeter: t,
|
|
401
|
+
simplificationThreshold: i,
|
|
402
|
+
computeNormals: !0,
|
|
403
|
+
computeUvs: !0,
|
|
404
|
+
computeLengths: !!c,
|
|
405
|
+
radialSegments: s
|
|
406
|
+
}, d = r(l.curve, u);
|
|
407
|
+
if (!d) return null;
|
|
408
|
+
let [f, p] = h(d);
|
|
409
|
+
return k(f, p);
|
|
590
410
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
411
|
+
//#endregion
|
|
412
|
+
//#region src/generators/wellbore-bounds-generator.ts
|
|
413
|
+
async function we(e, t, r = 250) {
|
|
414
|
+
let i = await this.get("position-logs", e), o = {
|
|
415
|
+
main: {
|
|
416
|
+
center: [
|
|
417
|
+
0,
|
|
418
|
+
0,
|
|
419
|
+
0
|
|
420
|
+
],
|
|
421
|
+
radius: 10
|
|
422
|
+
},
|
|
423
|
+
sampled: []
|
|
424
|
+
};
|
|
425
|
+
if (i) {
|
|
426
|
+
let s = n(e, i);
|
|
427
|
+
if (s) {
|
|
428
|
+
let e = t === void 0 ? 0 : m((t - s.measuredTop) / s.measuredLength, 0, 1), n = s.curve.getBoundingBox(e), i = (n.max[0] - n.min[0]) / 2, c = (n.max[1] - n.min[1]) / 2, l = (n.max[2] - n.min[2]) / 2, u = a([
|
|
429
|
+
i,
|
|
430
|
+
c,
|
|
431
|
+
l
|
|
432
|
+
]) + r * 2, d = [
|
|
433
|
+
n.min[0] + i,
|
|
434
|
+
n.min[1] + c,
|
|
435
|
+
n.min[2] + l
|
|
436
|
+
];
|
|
437
|
+
if (o.main.center = d, o.main.radius = u, r > 0) {
|
|
438
|
+
let t = Math.max(2, Math.ceil((1 - e) * s.curve.length / r)), n = s.curve.getPoints(t, e, 1), i = [];
|
|
439
|
+
n.forEach((e) => {
|
|
440
|
+
i.push({
|
|
441
|
+
center: e,
|
|
442
|
+
radius: r
|
|
443
|
+
});
|
|
444
|
+
}), o.sampled = i;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
let s = new Float32Array(4 + o.sampled.length * 4), c = 0;
|
|
449
|
+
s[c] = o.main.center[0], s[c + 1] = o.main.center[1], s[c + 2] = o.main.center[2], s[c + 3] = o.main.radius, c = 4;
|
|
450
|
+
for (let e = 0; e < o.sampled.length; e++, c += 4) s[c] = o.sampled[e].center[0], s[c + 1] = o.sampled[e].center[1], s[c + 2] = o.sampled[e].center[2], s[c + 3] = o.sampled[e].radius;
|
|
451
|
+
return k(s, [s.buffer]);
|
|
631
452
|
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
}), !d.length) return null;
|
|
676
|
-
const y = Y(d, !1);
|
|
677
|
-
if (!y) return null;
|
|
678
|
-
const [T, $] = E(y);
|
|
679
|
-
return x(T, $);
|
|
453
|
+
//#endregion
|
|
454
|
+
//#region src/generators/wellbore-formation-column-generator.ts
|
|
455
|
+
async function Te(e, t, i, a, o, s, l = .5, u = 2, d = !0, f = 16, p = 0) {
|
|
456
|
+
let m = await y(e, t, this);
|
|
457
|
+
if (!m) return null;
|
|
458
|
+
let g = m.filter((e) => (s === void 0 || e.type && s.includes(e.type)) && (o === void 0 || o.includes(e.name)));
|
|
459
|
+
if (!g.length) return null;
|
|
460
|
+
let _ = c(g), v = n(e, await this.get("position-logs", e));
|
|
461
|
+
if (!v) return null;
|
|
462
|
+
let b = {
|
|
463
|
+
startCap: d,
|
|
464
|
+
endCap: d,
|
|
465
|
+
segmentsPerMeter: i,
|
|
466
|
+
simplificationThreshold: p,
|
|
467
|
+
radialSegments: f,
|
|
468
|
+
computeRelativeLengths: !0
|
|
469
|
+
}, x = [];
|
|
470
|
+
if (_.forEach((e) => {
|
|
471
|
+
if (a === void 0 || e.mdMslTo > a) {
|
|
472
|
+
let t = e.mdMslFrom;
|
|
473
|
+
a !== void 0 && a > t && (t = a);
|
|
474
|
+
let n = v.getPositionAtDepth(t, !0), i = v.getPositionAtDepth(e.mdMslTo, !0);
|
|
475
|
+
if (n !== null && i !== null) {
|
|
476
|
+
let t = u + l, a = new E(e.color), o = r(v.curve, {
|
|
477
|
+
...b,
|
|
478
|
+
radius: t,
|
|
479
|
+
from: n,
|
|
480
|
+
to: i
|
|
481
|
+
});
|
|
482
|
+
if (o?.attributes.position.count) {
|
|
483
|
+
let e = new Float32Array(o.attributes.position.count * 3);
|
|
484
|
+
for (let t = 0; t < o.attributes.position.count; t++) a.toArray(e, t * 3);
|
|
485
|
+
o.attributes.color = new w(e, 3), x.push(o);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}), !x.length) return null;
|
|
490
|
+
let S = j(x, !1);
|
|
491
|
+
if (!S) return null;
|
|
492
|
+
let [C, T] = h(S);
|
|
493
|
+
return k(C, T);
|
|
680
494
|
}
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
const u = (l || n) + (m - (l || n)) / 2;
|
|
696
|
-
e = b((u - n) / m, 0, 1);
|
|
697
|
-
}
|
|
698
|
-
return [{
|
|
699
|
-
id: o,
|
|
700
|
-
name: `${r.name.replace("NO ", "")}`,
|
|
701
|
-
position: s.getPointAt(e),
|
|
702
|
-
direction: s.getTangentAt(e)
|
|
703
|
-
}];
|
|
495
|
+
//#endregion
|
|
496
|
+
//#region src/generators/wellbore-label-generator.ts
|
|
497
|
+
async function Ee(e, t, r) {
|
|
498
|
+
let i = await this.get("wellbore-headers", e);
|
|
499
|
+
if (!i) return null;
|
|
500
|
+
let a = n(e, await this.get("position-logs", e));
|
|
501
|
+
if (!a) return null;
|
|
502
|
+
let o = 1, { measuredTop: s, measuredLength: c, curve: l } = a;
|
|
503
|
+
return t === "top" ? o = m(((r || s) - s) / c, 0, 1) : t === "center" && (o = m(((r || s) + (c - (r || s)) / 2 - s) / c, 0, 1)), [{
|
|
504
|
+
id: e,
|
|
505
|
+
name: `${i.name.replace("NO ", "")}`,
|
|
506
|
+
position: l.getPointAt(o),
|
|
507
|
+
direction: l.getTangentAt(o)
|
|
508
|
+
}];
|
|
704
509
|
}
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}, h = [f.data.array.buffer, ...a];
|
|
727
|
-
return x(f, h);
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region src/generators/wellbore-seismic-section-generator.ts
|
|
512
|
+
async function De(e, t = 3, n = 1e3, r = 1e3, i = 0) {
|
|
513
|
+
let a = {
|
|
514
|
+
stepSize: t,
|
|
515
|
+
minSize: n,
|
|
516
|
+
extension: r,
|
|
517
|
+
defaultExtensionAngle: i
|
|
518
|
+
}, o = await this.get("wellbore-seismic-section", e, a);
|
|
519
|
+
if (o === null || o.trajectory === null) return null;
|
|
520
|
+
let { positions: s } = o.trajectory, c = -o.depthRange[0], l = -o.depthRange[1], [u, d] = h(x(b(s), c, l)), f = {
|
|
521
|
+
data: {
|
|
522
|
+
array: o.values,
|
|
523
|
+
width: o.samples[0],
|
|
524
|
+
height: o.samples[1],
|
|
525
|
+
min: o.valueRange[0],
|
|
526
|
+
max: o.valueRange[1]
|
|
527
|
+
},
|
|
528
|
+
geometry: u
|
|
529
|
+
};
|
|
530
|
+
return k(f, [f.data.array.buffer, ...d]);
|
|
728
531
|
}
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
Qt as generateBasicTrajectory,
|
|
732
|
-
Zt as generateCasingAnnotations,
|
|
733
|
-
zt as generateCasings,
|
|
734
|
-
te as generateCompletionToolAnnotations,
|
|
735
|
-
ee as generateCompletionTools,
|
|
736
|
-
oe as generateDepthMarkers,
|
|
737
|
-
ne as generateFormationMarkers,
|
|
738
|
-
se as generatePerforations,
|
|
739
|
-
re as generatePerimeterGeometry,
|
|
740
|
-
ae as generatePositionMarkers,
|
|
741
|
-
ie as generateShoes,
|
|
742
|
-
ue as generateSurfaceGeometry,
|
|
743
|
-
ce as generateSurfaceTexturesData,
|
|
744
|
-
le as generateTubeTrajectory,
|
|
745
|
-
pe as generateWellboreFormationColumnGeometries,
|
|
746
|
-
ge as generateWellboreLabel,
|
|
747
|
-
fe as generateWellboreSeismicSection
|
|
748
|
-
};
|
|
532
|
+
//#endregion
|
|
533
|
+
export { we as calculateWellboreBounds, ne as generateBasicTrajectory, re as generateCasingAnnotations, ie as generateCasings, ae as generateCompletionToolAnnotations, se as generateCompletionTools, ce as generateDepthMarkers, B as generateFormationMarkers, pe as generatePerforations, me as generatePerimeterGeometry, _e as generatePositionMarkers, be as generateShoes, Se as generateSurfaceGeometry, xe as generateSurfaceTexturesData, Ce as generateTubeTrajectory, Te as generateWellboreFormationColumnGeometries, Ee as generateWellboreLabel, De as generateWellboreSeismicSection };
|