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