iflow-engine-base 3.12.19 → 3.12.20
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/bim-engine-sdk.es.js +8 -8
- package/dist/bim-engine-sdk.umd.js +343 -343
- package/dist/chunks/{engine-2d-BJOOxEoZ.js → engine-2d-CuLhyJ4W.js} +3 -3
- package/dist/chunks/{engine-3d-COo_NGsu.js → engine-3d-0u52vT3w.js} +336 -298
- package/dist/chunks/{engine-720-CEmWxs1M.js → engine-720-Dz-5oAkD.js} +1 -1
- package/dist/chunks/{engine-gaussian-C9Cvnx1T.js → engine-gaussian-BsWABBm5.js} +1 -1
- package/dist/chunks/{engine-gis-C7b1GU6-.js → engine-gis-CqD2VJSC.js} +2 -2
- package/dist/chunks/{sdk-assets-BtLdPMFM.js → sdk-assets-C-CdwDId.js} +1 -1
- package/dist/chunks/{sdk-runtime-BZYuUdV8.js → sdk-runtime-xqU48yqa.js} +2 -2
- package/dist/chunks/{sdk-vendor-BieYdF2L.js → sdk-vendor-q_6JUhFc.js} +1 -1
- package/dist/index.d.ts +29 -8
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { W as me, C as mo, b as ft, B as Yi, g as
|
|
3
|
-
import { r as ee, g as Mo } from "./sdk-assets-
|
|
4
|
-
import { a as Qt, J as vi, c as vo, b as xo, P as si, q as wo, k as bo, n as Xi, E as Qi, S as Co } from "./sdk-vendor-
|
|
5
|
-
import { L as Ao } from "./engine-2d-
|
|
1
|
+
import { j as R, I as W, M as F, G as de, t as ht, u as fi, v as Ye, C as Me, w as Ss, x as Pi, D as re, T as Je, i as Xe, y as Ps, z as dt, n as Ti, H as qt, O as _e, a as N, V as d, J as Ze, p as Bn, K as Ts, W as Ii, U as Is, X as _i, Y as _s, Z as ot, b as G, Q as Ae, q as zn, R as fe, E as qe, _ as Di, r as z, $ as ki, a0 as Rn, f as ii, a1 as ni, a2 as On, a3 as Fn, a4 as Kt, a5 as Ds, a6 as ks, a7 as Ls, a8 as Gi, a9 as qi, aa as Bs, ab as zs, d as Nn, ac as Hn, ad as Li, ae as Rs, af as Vn, B as ge, ag as Os, m as bt, ah as Fs, ai as Ns, aj as Un, ak as Hs, al as Ke, am as jt, an as Z, h as oe, ao as Ct, ap as Vs, aq as yi, L as He, o as It, ar as Us, as as Ws, k as Mi, at as Gs, au as ct, av as qs, aw as Ks, ax as Wn, ay as Yt, F as At, g as Xt, az as js, aA as Ki, aB as Et, s as St, aC as Ys, aD as Xs, aE as ji, aF as Qs, l as $s, aG as Zs, aH as Js, aI as eo, aJ as to, aK as io, aL as no, aM as so, aN as Gn, c as oo, aO as ro, aP as ao, aQ as lo, aR as co, aS as ho, aT as uo, aU as po } from "./three-vendor-CB3x8EQd.js";
|
|
2
|
+
import { W as me, C as mo, b as ft, B as Yi, g as ze, L as go, E as fo, r as yo } from "./sdk-runtime-xqU48yqa.js";
|
|
3
|
+
import { r as ee, g as Mo } from "./sdk-assets-C-CdwDId.js";
|
|
4
|
+
import { a as Qt, J as vi, c as vo, b as xo, P as si, q as wo, k as bo, n as Xi, E as Qi, S as Co } from "./sdk-vendor-q_6JUhFc.js";
|
|
5
|
+
import { L as Ao } from "./engine-2d-CuLhyJ4W.js";
|
|
6
6
|
var ie = /* @__PURE__ */ ((l) => (l.ModelLoadStart = "model-load-start", l.ModelLoadProgress = "model-load-progress", l.ModelLoaded = "model-loaded", l.ModelError = "model-error", l.SelectionChanged = "selection-changed", l.HoverChanged = "hover-changed", l.Click = "click", l.MouseMove = "mouse-move", l.ModelPlaceSelected = "model-place-selected", l.ModelCalibrationChanged = "model-calibration-changed", l.CameraChanged = "camera-changed", l.CameraIdle = "camera-idle", l.ViewportResize = "viewport-resize", l.EngineFree = "engine-free", l.EngineBusy = "engine-busy", l.MeasureChanged = "measure-changed", l.SectionMove = "section-move", l.LoadingCompleted = "loading_completed", l))(ie || {});
|
|
7
7
|
class oi extends Error {
|
|
8
8
|
constructor() {
|
|
@@ -497,7 +497,7 @@ function tt(l, e) {
|
|
|
497
497
|
const s = l?.scene?.children?.find?.((o) => o instanceof de ? Bi(o, e) ? !0 : o.name === e && o.url === e : !1);
|
|
498
498
|
return s != null ? (bi(s, e), t.set(e, s), n != null && (n.group = s), s) : null;
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function De(l, e) {
|
|
501
501
|
const t = tt(l, e);
|
|
502
502
|
return t == null ? new F() : (t.updateWorldMatrix(!0, !1), t.matrixWorld.clone());
|
|
503
503
|
}
|
|
@@ -538,7 +538,7 @@ function Pt(l, e) {
|
|
|
538
538
|
}), t;
|
|
539
539
|
}
|
|
540
540
|
function Ri(l) {
|
|
541
|
-
return Pt(l, (e) => e instanceof
|
|
541
|
+
return Pt(l, (e) => e instanceof R && !(e instanceof W));
|
|
542
542
|
}
|
|
543
543
|
function Po(l) {
|
|
544
544
|
if (typeof l.__modelObjectIndexSeed == "number")
|
|
@@ -586,7 +586,7 @@ function Zi(l, e) {
|
|
|
586
586
|
}, i.enabled || e ? (t.polygonOffset = !1, t.polygonOffsetFactor = s, t.polygonOffsetUnits = n + (e ? qn : 0)) : t.polygonOffset = !1, t.needsUpdate = !0;
|
|
587
587
|
});
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function Be(l, e) {
|
|
590
590
|
if (!Number.isFinite(e))
|
|
591
591
|
return;
|
|
592
592
|
const t = jn(l), i = t.get(e);
|
|
@@ -627,7 +627,7 @@ class _o {
|
|
|
627
627
|
collectFromNode(e) {
|
|
628
628
|
const t = /* @__PURE__ */ new Map();
|
|
629
629
|
return (Array.isArray(e?.indexes) ? e.indexes : []).forEach((s) => {
|
|
630
|
-
const o =
|
|
630
|
+
const o = Be(this.engine, s?.[0]);
|
|
631
631
|
o instanceof ht && this.getObjectMaterials(o).forEach((r) => this.mergeMaterialOption(t, r, [o]));
|
|
632
632
|
}), (Array.isArray(e?.infos) ? e.infos : []).forEach((s) => {
|
|
633
633
|
const o = s?.mesh;
|
|
@@ -2382,7 +2382,7 @@ class rn extends zn {
|
|
|
2382
2382
|
setAvatarModel(e, t = {}) {
|
|
2383
2383
|
if (e) {
|
|
2384
2384
|
if (this.clearAvatarAnimation(), this.avatar && (this.avatarRoot.remove(this.avatar), this._ownsAvatarResources && this.disposeObjectResources(this.avatar)), this.avatar = e, this._ownsAvatarResources = t.ownsResources === !0, e.rotation.y += t.yawOffset ?? 0, t.alignToFeet !== !1) {
|
|
2385
|
-
const i = new
|
|
2385
|
+
const i = new z().setFromObject(e), n = i.max.y - i.min.y;
|
|
2386
2386
|
if (t.fitToPlayerHeight !== !1 && Number.isFinite(n) && n > 1e-6) {
|
|
2387
2387
|
const o = (t.targetHeight ?? this.playerHeight) / n;
|
|
2388
2388
|
e.scale.multiplyScalar(o), i.setFromObject(e);
|
|
@@ -2795,7 +2795,7 @@ class Ko {
|
|
|
2795
2795
|
const n = this.engine, s = e.object.url, o = e.object.name;
|
|
2796
2796
|
let r = n.modelEdge.getModelEdge(s, o);
|
|
2797
2797
|
r || (r = [0, 0, []]);
|
|
2798
|
-
const a =
|
|
2798
|
+
const a = De(n, s), c = this.getModelSnapCache(s, o, r);
|
|
2799
2799
|
n.camera.updateMatrixWorld(!0);
|
|
2800
2800
|
const h = new F().multiplyMatrices(n.camera.projectionMatrix, n.camera.matrixWorldInverse), u = n.renderer.domElement.clientWidth, p = n.renderer.domElement.clientHeight, g = new G(t.offsetX, t.offsetY), f = new ii(), x = new d(), w = new d(), m = new G(), b = new G(), C = new d();
|
|
2801
2801
|
let S = "face", P = null, I = null, B = 100;
|
|
@@ -3100,9 +3100,9 @@ function Hi(l) {
|
|
|
3100
3100
|
function q(v, A, L, U, j, we) {
|
|
3101
3101
|
const ve = l?.catchSvg;
|
|
3102
3102
|
if (!ve?.childElementCount) return;
|
|
3103
|
-
const
|
|
3103
|
+
const ke = l?.reactBoundingClientRect ?? A.getBoundingClientRect(), nt = (be) => {
|
|
3104
3104
|
const [Re, Oe] = be.split(",").map(Number);
|
|
3105
|
-
return Number.isFinite(Re) && Number.isFinite(Oe) ? [(Re -
|
|
3105
|
+
return Number.isFinite(Re) && Number.isFinite(Oe) ? [(Re - ke.left - L) / j * n * we, (Oe - ke.top - U) / j * n * we] : null;
|
|
3106
3106
|
};
|
|
3107
3107
|
Array.from(ve.children).forEach((be) => {
|
|
3108
3108
|
const Re = be.tagName.toLowerCase(), xe = (Re === "line" ? [`${be.getAttribute("x1")},${be.getAttribute("y1")}`, `${be.getAttribute("x2")},${be.getAttribute("y2")}`].map(nt) : (be.getAttribute("points") || "").trim().split(/\s+/).map(nt)).filter(Boolean);
|
|
@@ -3118,7 +3118,7 @@ function Hi(l) {
|
|
|
3118
3118
|
k();
|
|
3119
3119
|
return;
|
|
3120
3120
|
}
|
|
3121
|
-
const
|
|
3121
|
+
const ke = L.width / n, nt = Math.min(
|
|
3122
3122
|
window.innerWidth - n / 2 - 8,
|
|
3123
3123
|
Math.max(n / 2 + 8, v.clientX)
|
|
3124
3124
|
), be = Math.min(
|
|
@@ -3129,12 +3129,12 @@ function Hi(l) {
|
|
|
3129
3129
|
const Re = A.width / Math.max(1, A.clientWidth), Oe = A.height / Math.max(1, A.clientHeight), xe = s, st = Math.max(0, Math.min(A.clientWidth - xe, ve.x - xe / 2)), Fe = Math.max(0, Math.min(A.clientHeight - xe, ve.y - xe / 2));
|
|
3130
3130
|
U.save(), U.clearRect(0, 0, L.width, L.height), U.beginPath(), U.arc(L.width / 2, L.height / 2, L.width / 2, 0, Math.PI * 2), U.clip(), U.fillStyle = window.getComputedStyle(A.parentElement ?? document.body).backgroundColor || "#dfe8f2", U.fillRect(0, 0, L.width, L.height);
|
|
3131
3131
|
try {
|
|
3132
|
-
U.drawImage(A, st * Re, Fe * Oe, xe * Re, xe * Oe, 0, 0, L.width, L.height), q(U, A, st, Fe, xe,
|
|
3132
|
+
U.drawImage(A, st * Re, Fe * Oe, xe * Re, xe * Oe, 0, 0, L.width, L.height), q(U, A, st, Fe, xe, ke);
|
|
3133
3133
|
} catch {
|
|
3134
3134
|
k(), U.restore();
|
|
3135
3135
|
return;
|
|
3136
3136
|
}
|
|
3137
|
-
U.strokeStyle = "rgba(0, 255, 247, 0.9)", U.lineWidth = 1.5 *
|
|
3137
|
+
U.strokeStyle = "rgba(0, 255, 247, 0.9)", U.lineWidth = 1.5 * ke, U.beginPath(), U.moveTo(L.width / 2 - 10 * ke, L.height / 2), U.lineTo(L.width / 2 + 10 * ke, L.height / 2), U.moveTo(L.width / 2, L.height / 2 - 10 * ke), U.lineTo(L.width / 2, L.height / 2 + 10 * ke), U.stroke(), U.restore();
|
|
3138
3138
|
}
|
|
3139
3139
|
function Q(v, A = !1, L = !1, U = !0) {
|
|
3140
3140
|
const j = p(v);
|
|
@@ -3843,7 +3843,7 @@ function Zo(l, e, t, i, n) {
|
|
|
3843
3843
|
l === "Circle" ? (O = f.diameter, q = f.diameter) : (O = f.width, q = f.height);
|
|
3844
3844
|
const te = I.clone().makeScale(O, q, f.length);
|
|
3845
3845
|
I.multiplyMatrices(k, te), I.setPosition(f.position.x, f.position.y, f.position.z), r.setMatrixAt(g, I.clone()), r.setColorAt(g, f.color);
|
|
3846
|
-
const Q = c?.clone().applyMatrix4(I) ?? new
|
|
3846
|
+
const Q = c?.clone().applyMatrix4(I) ?? new z(), ce = Q.min.clone(), ae = Q.max.clone(), le = Q.getCenter(new d());
|
|
3847
3847
|
f.box = Q.clone();
|
|
3848
3848
|
const ue = {
|
|
3849
3849
|
name: f.name,
|
|
@@ -3902,7 +3902,7 @@ function Ot(l, e) {
|
|
|
3902
3902
|
roughness: 1,
|
|
3903
3903
|
side: re,
|
|
3904
3904
|
shadowSide: re
|
|
3905
|
-
}), p = new
|
|
3905
|
+
}), p = new R(h, u);
|
|
3906
3906
|
return p.position.set(a.x, a.y, a.z), p.rotation._order = "YXZ", p.rotation.set(c.x, c.y, c.z), p;
|
|
3907
3907
|
}
|
|
3908
3908
|
}
|
|
@@ -3910,7 +3910,7 @@ var ne = /* @__PURE__ */ ((l) => (l.ModelLoadStart = "model-load-start", l.Model
|
|
|
3910
3910
|
const an = "__bvhAccelerationInstalled", ts = "__bvhBuildFailed", Jo = "__bvhBuilt", er = "__bvhTriangleCount", is = 200, tr = 10;
|
|
3911
3911
|
function ir() {
|
|
3912
3912
|
const l = globalThis;
|
|
3913
|
-
l[an] !== !0 && (
|
|
3913
|
+
l[an] !== !0 && (R.prototype.raycast = Rs, ge.prototype.computeBoundsTree = Vn, ge.prototype.disposeBoundsTree = Os, l[an] = !0);
|
|
3914
3914
|
}
|
|
3915
3915
|
function nr(l) {
|
|
3916
3916
|
l.firstHitOnly = !0;
|
|
@@ -4130,7 +4130,7 @@ async function Tr(l, e, t, i) {
|
|
|
4130
4130
|
w.applyMatrix4(x), w.computeBoundingBox(), w.attributes.position.count > 2e4 && ar(w, {
|
|
4131
4131
|
setBoundingSphere: !0
|
|
4132
4132
|
});
|
|
4133
|
-
const m = new
|
|
4133
|
+
const m = new R(w, f.material);
|
|
4134
4134
|
g.box = w.boundingBox?.clone(), g.mesh = m, m.name = Number(h), m.glb = g.glb, m.url = e.url, w.attributes.position != null && r.push(m), c++, c % ns === 0 && (a = await Qe(l, i, a));
|
|
4135
4135
|
}
|
|
4136
4136
|
}
|
|
@@ -4151,7 +4151,7 @@ function Dr(l, e, t, i, n) {
|
|
|
4151
4151
|
const s = bt(
|
|
4152
4152
|
i.map((h) => h.geometry),
|
|
4153
4153
|
!1
|
|
4154
|
-
), o = us(n), r = new
|
|
4154
|
+
), o = us(n), r = new R(s, o);
|
|
4155
4155
|
r.castShadow = !0, r.receiveShadow = !0, it(e, l).add(r);
|
|
4156
4156
|
const c = Oi(e, r);
|
|
4157
4157
|
return Fi(r, c), r.url = l, r.glb = t, r.materialClone = o, r.geometrys = i.map((h) => h.geometry), r.geometry.computeVertexNormals(), r;
|
|
@@ -4159,7 +4159,7 @@ function Dr(l, e, t, i, n) {
|
|
|
4159
4159
|
function kr(l, e, t, i) {
|
|
4160
4160
|
return (tt(l, e)?.children ?? l.scene.children).find((o) => {
|
|
4161
4161
|
const r = o;
|
|
4162
|
-
return o instanceof
|
|
4162
|
+
return o instanceof R && r.url == e && r.glb == t && r.materialClone === i;
|
|
4163
4163
|
});
|
|
4164
4164
|
}
|
|
4165
4165
|
function Lr(l, e) {
|
|
@@ -4226,7 +4226,7 @@ async function Rr(l, e, t, i, n, s) {
|
|
|
4226
4226
|
const w = zr(i, x);
|
|
4227
4227
|
if (w != null && (f.box = w.clone()), r.setMatrixAt(g, x), r.matrixs || (r.matrixs = []), r.matrixs.push(x.clone()), p.push(x.clone()), o.nodesMap.has(f.id)) {
|
|
4228
4228
|
const m = o.nodesMap.get(f.id);
|
|
4229
|
-
m.indexes == null && (m.indexes = []), m.indexes.push([c, g, 0, 0]), Tt(m), w != null && m?.info != null && (m.info.box instanceof
|
|
4229
|
+
m.indexes == null && (m.indexes = []), m.indexes.push([c, g, 0, 0]), Tt(m), w != null && m?.info != null && (m.info.box instanceof z ? m.info.box.union(w) : m.info.box = w.clone());
|
|
4230
4230
|
} else {
|
|
4231
4231
|
const m = {
|
|
4232
4232
|
instance: !0,
|
|
@@ -4356,7 +4356,7 @@ async function Nr(l, e, t, i) {
|
|
|
4356
4356
|
}
|
|
4357
4357
|
}
|
|
4358
4358
|
function Hr(l, e, t) {
|
|
4359
|
-
if (t.boundingBox || (t.boundingBox = new
|
|
4359
|
+
if (t.boundingBox || (t.boundingBox = new z(), t.boundingBox.min = new d(t.octreeBox.min.X, t.octreeBox.min.Z, -t.octreeBox.min.Y), t.boundingBox.max = new d(t.octreeBox.max.X, t.octreeBox.max.Z, -t.octreeBox.max.Y)), !t.maxSize)
|
|
4360
4360
|
return 1e3;
|
|
4361
4361
|
const i = t.boundingBox, n = i.min, s = i.max, o = n.clone().add(s.clone()).multiplyScalar(0.5), r = n.distanceTo(s), a = new d(), c = new d(), h = new d(), u = new d();
|
|
4362
4362
|
if (e.getWorldDirection(h), e.getWorldPosition(u), e.matrixWorld.extractBasis(a, c, new d()), e instanceof _e) {
|
|
@@ -4593,7 +4593,7 @@ class Ie {
|
|
|
4593
4593
|
async collectSourceEntries(e) {
|
|
4594
4594
|
const t = [];
|
|
4595
4595
|
for (const i of e) {
|
|
4596
|
-
const n =
|
|
4596
|
+
const n = Le(i.webkitRelativePath || i.name), s = vt(n);
|
|
4597
4597
|
if (un(s)) {
|
|
4598
4598
|
t.push({ path: n, blob: i });
|
|
4599
4599
|
continue;
|
|
@@ -4602,7 +4602,7 @@ class Ie {
|
|
|
4602
4602
|
const o = await vi.loadAsync(i), r = hi(n), a = Object.values(o.files);
|
|
4603
4603
|
for (const c of a)
|
|
4604
4604
|
c.dir || t.push({
|
|
4605
|
-
path: Qr(r,
|
|
4605
|
+
path: Qr(r, Le(c.name)),
|
|
4606
4606
|
blob: await c.async("blob")
|
|
4607
4607
|
});
|
|
4608
4608
|
continue;
|
|
@@ -4625,7 +4625,7 @@ class Ie {
|
|
|
4625
4625
|
* 识别解压后的模型目录,例如 `lod0/nodes.json`、`info/info.json`。
|
|
4626
4626
|
*/
|
|
4627
4627
|
parseExtractedPackageEntry(e) {
|
|
4628
|
-
const t =
|
|
4628
|
+
const t = Le(e).split("/").filter(Boolean);
|
|
4629
4629
|
for (let n = 0; n < t.length; n++) {
|
|
4630
4630
|
const s = Zr(t[n]);
|
|
4631
4631
|
if (s == null)
|
|
@@ -4651,7 +4651,7 @@ class Ie {
|
|
|
4651
4651
|
async packEntriesAsZip(e) {
|
|
4652
4652
|
const t = new vi();
|
|
4653
4653
|
for (const i of e)
|
|
4654
|
-
t.file(
|
|
4654
|
+
t.file(Le(i.path), i.blob);
|
|
4655
4655
|
return t.generateAsync({ type: "blob" });
|
|
4656
4656
|
}
|
|
4657
4657
|
/**
|
|
@@ -4679,9 +4679,9 @@ class Ie {
|
|
|
4679
4679
|
static normalizeRequestKey(e) {
|
|
4680
4680
|
try {
|
|
4681
4681
|
const t = new URL(e, window.location.origin);
|
|
4682
|
-
return
|
|
4682
|
+
return Le(t.pathname);
|
|
4683
4683
|
} catch {
|
|
4684
|
-
return
|
|
4684
|
+
return Le(e.split("?")[0].split("#")[0]);
|
|
4685
4685
|
}
|
|
4686
4686
|
}
|
|
4687
4687
|
/**
|
|
@@ -4691,15 +4691,15 @@ class Ie {
|
|
|
4691
4691
|
return `${e.replace(/[^a-zA-Z0-9/_-]/g, "_").replace(/\//g, "__") || "model"}_${Date.now()}_${t}_${Math.random().toString(36).slice(2, 8)}`;
|
|
4692
4692
|
}
|
|
4693
4693
|
}
|
|
4694
|
-
function
|
|
4694
|
+
function Le(l) {
|
|
4695
4695
|
return l.replace(/\\/g, "/").replace(/^\/+/, "").replace(/\/+/g, "/");
|
|
4696
4696
|
}
|
|
4697
4697
|
function vt(l) {
|
|
4698
|
-
const e =
|
|
4698
|
+
const e = Le(l), t = e.lastIndexOf("/");
|
|
4699
4699
|
return t >= 0 ? e.slice(t + 1) : e;
|
|
4700
4700
|
}
|
|
4701
4701
|
function hi(l) {
|
|
4702
|
-
const e =
|
|
4702
|
+
const e = Le(l), t = e.lastIndexOf("/");
|
|
4703
4703
|
return t >= 0 ? e.slice(0, t) : "";
|
|
4704
4704
|
}
|
|
4705
4705
|
function Xr(l, e) {
|
|
@@ -4711,7 +4711,7 @@ function Xr(l, e) {
|
|
|
4711
4711
|
}
|
|
4712
4712
|
}
|
|
4713
4713
|
function Qr(l, e) {
|
|
4714
|
-
return
|
|
4714
|
+
return Le(l ? e ? `${l}/${e}` : l : e);
|
|
4715
4715
|
}
|
|
4716
4716
|
function un(l) {
|
|
4717
4717
|
return jr.test(l);
|
|
@@ -5040,11 +5040,11 @@ class xa {
|
|
|
5040
5040
|
const t = this.engine.scene;
|
|
5041
5041
|
if (!t)
|
|
5042
5042
|
return null;
|
|
5043
|
-
const i = new
|
|
5043
|
+
const i = new z();
|
|
5044
5044
|
let n = !1;
|
|
5045
5045
|
return t.traverse((s) => {
|
|
5046
|
-
if (s instanceof
|
|
5047
|
-
const o = new
|
|
5046
|
+
if (s instanceof R || s instanceof W) {
|
|
5047
|
+
const o = new z().setFromObject(s);
|
|
5048
5048
|
o.isEmpty() || (i.union(o), n = !0);
|
|
5049
5049
|
}
|
|
5050
5050
|
}), !n || i.isEmpty() ? null : this.validateBox(i);
|
|
@@ -5057,7 +5057,7 @@ class xa {
|
|
|
5057
5057
|
*/
|
|
5058
5058
|
normalizeBox(e, t) {
|
|
5059
5059
|
return [e.x, e.y, e.z, t.x, t.y, t.z].every(Number.isFinite) ? this.validateBox(
|
|
5060
|
-
new
|
|
5060
|
+
new z(
|
|
5061
5061
|
new d(
|
|
5062
5062
|
Math.min(e.x, t.x),
|
|
5063
5063
|
Math.min(e.y, t.y),
|
|
@@ -5176,7 +5176,7 @@ class xa {
|
|
|
5176
5176
|
return;
|
|
5177
5177
|
const i = e.getSize(new d()).length();
|
|
5178
5178
|
(this.lastShadowCasterPolicySceneSize <= 0 || Math.abs(i - this.lastShadowCasterPolicySceneSize) > this.lastShadowCasterPolicySceneSize * 0.1) && (this.shadowCasterPolicyChecked = /* @__PURE__ */ new WeakSet(), this.lastShadowCasterPolicySceneSize = i), t.traverse((n) => {
|
|
5179
|
-
this.shadowCasterPolicyChecked.has(n) || (n instanceof
|
|
5179
|
+
this.shadowCasterPolicyChecked.has(n) || (n instanceof R || n instanceof W) && (this.shadowCasterPolicyChecked.add(n), this.applyShadowCasterPolicy(n));
|
|
5180
5180
|
});
|
|
5181
5181
|
}
|
|
5182
5182
|
/**
|
|
@@ -5187,7 +5187,7 @@ class xa {
|
|
|
5187
5187
|
const t = e.userData;
|
|
5188
5188
|
if (t.__lightModuleOriginalCastShadow == null && (t.__lightModuleOriginalCastShadow = e.castShadow), t.__lightModuleOriginalCastShadow !== !0 || e.receiveShadow !== !0)
|
|
5189
5189
|
return;
|
|
5190
|
-
const i = new
|
|
5190
|
+
const i = new z().setFromObject(e);
|
|
5191
5191
|
if (i.isEmpty())
|
|
5192
5192
|
return;
|
|
5193
5193
|
const n = i.getSize(new d()), s = Math.max(n.x, n.z), o = Math.max(
|
|
@@ -5532,11 +5532,11 @@ class wa {
|
|
|
5532
5532
|
getNodeWorldBox(e, t, i) {
|
|
5533
5533
|
if (i != null) {
|
|
5534
5534
|
const n = this.engine.modelExplode?.getExplodedWorldBox?.(e.url, i);
|
|
5535
|
-
if (n instanceof
|
|
5535
|
+
if (n instanceof z)
|
|
5536
5536
|
return n;
|
|
5537
5537
|
}
|
|
5538
5538
|
if (Array.isArray(t?.infos) && t.infos.length > 0) {
|
|
5539
|
-
const n =
|
|
5539
|
+
const n = De(this.engine, e.url), s = t.infos.map((o) => o?.box).filter((o) => o instanceof z).map((o) => o.clone().applyMatrix4(n));
|
|
5540
5540
|
return this.getMergedBox(s);
|
|
5541
5541
|
}
|
|
5542
5542
|
if (Array.isArray(t?.indexes) && t.indexes.length > 0) {
|
|
@@ -5561,15 +5561,15 @@ class wa {
|
|
|
5561
5561
|
const n = e.indexes.map((s) => {
|
|
5562
5562
|
const o = this.getSceneModel(s[0]);
|
|
5563
5563
|
return this.createInstanceCatchMesh(o, s[1]);
|
|
5564
|
-
}).filter((s) => s instanceof
|
|
5564
|
+
}).filter((s) => s instanceof R);
|
|
5565
5565
|
if (n.length > 0)
|
|
5566
5566
|
return n;
|
|
5567
5567
|
}
|
|
5568
5568
|
if (Array.isArray(e?.infos) && e.infos.length > 0) {
|
|
5569
|
-
const n = e.infos.map((o) => o?.mesh).filter((o) => o instanceof
|
|
5569
|
+
const n = e.infos.map((o) => o?.mesh).filter((o) => o instanceof R && o.userData?.__pickBox !== !0);
|
|
5570
5570
|
if (t == null)
|
|
5571
5571
|
return n;
|
|
5572
|
-
const s =
|
|
5572
|
+
const s = De(this.engine, t);
|
|
5573
5573
|
return n.forEach((o) => {
|
|
5574
5574
|
o.parent == null && (o.matrixAutoUpdate = !1, o.matrix.copy(s), o.matrixWorld.copy(s), o.matrixWorldNeedsUpdate = !1);
|
|
5575
5575
|
}), n;
|
|
@@ -5586,7 +5586,7 @@ class wa {
|
|
|
5586
5586
|
else
|
|
5587
5587
|
return null;
|
|
5588
5588
|
const i = e.geometry.clone();
|
|
5589
|
-
return e.updateWorldMatrix(!0, !1), i.applyMatrix4(this.tempInstanceMatrix), i.applyMatrix4(e.matrixWorld), new
|
|
5589
|
+
return e.updateWorldMatrix(!0, !1), i.applyMatrix4(this.tempInstanceMatrix), i.applyMatrix4(e.matrixWorld), new R(i, e.material);
|
|
5590
5590
|
}
|
|
5591
5591
|
getInstanceWorldBox(e, t) {
|
|
5592
5592
|
if (!(e instanceof W))
|
|
@@ -5631,11 +5631,11 @@ class wa {
|
|
|
5631
5631
|
getMergedBox(e) {
|
|
5632
5632
|
if (e.length === 0)
|
|
5633
5633
|
return null;
|
|
5634
|
-
const t = new
|
|
5634
|
+
const t = new z().makeEmpty();
|
|
5635
5635
|
return e.forEach((i) => t.union(i)), t.isEmpty() ? null : t;
|
|
5636
5636
|
}
|
|
5637
5637
|
getSceneModel(e) {
|
|
5638
|
-
return
|
|
5638
|
+
return Be(this.engine, e);
|
|
5639
5639
|
}
|
|
5640
5640
|
/** 从射线命中的对象还原真实构件 ID,兼容炸开代理和普通模型对象。 */
|
|
5641
5641
|
getHitModelId(e) {
|
|
@@ -5702,7 +5702,7 @@ class ba {
|
|
|
5702
5702
|
const r = it(this.engine, o.url);
|
|
5703
5703
|
o.nodesMap.forEach((a, c) => {
|
|
5704
5704
|
const h = String(a?.name ?? a?.info?.name ?? a?.infos?.[0]?.name ?? "");
|
|
5705
|
-
if (!i.some((m) => h.includes(m)) || a?.pickBoxMesh instanceof
|
|
5705
|
+
if (!i.some((m) => h.includes(m)) || a?.pickBoxMesh instanceof R || a?.indexes?.some((m) => Be(this.engine, m?.[0]) instanceof W))
|
|
5706
5706
|
return;
|
|
5707
5707
|
const p = this.getNodeLocalBox(a);
|
|
5708
5708
|
if (p == null)
|
|
@@ -5715,7 +5715,7 @@ class ba {
|
|
|
5715
5715
|
);
|
|
5716
5716
|
const x = new Ct(f.x, f.y, f.z);
|
|
5717
5717
|
x.translate(g.x, g.y, g.z), x.computeBoundingBox();
|
|
5718
|
-
const w = new
|
|
5718
|
+
const w = new R(x, this.pickBoxMaterial);
|
|
5719
5719
|
w.name = c, w.url = o.url, w.castShadow = !1, w.receiveShadow = !1, w.userData.excludeFromAmbientOcclusion = !0, w.userData.__pickBox = !0, r.add(w), Array.isArray(a.infos) || (a.infos = a.info != null ? [a.info] : []), a.infos.push({
|
|
5720
5720
|
id: c,
|
|
5721
5721
|
name: h,
|
|
@@ -5731,7 +5731,7 @@ class ba {
|
|
|
5731
5731
|
e?.box,
|
|
5732
5732
|
e?.info?.box,
|
|
5733
5733
|
...Array.isArray(e?.infos) ? e.infos.map((n) => n?.box) : []
|
|
5734
|
-
].filter((n) => n instanceof
|
|
5734
|
+
].filter((n) => n instanceof z && !n.isEmpty());
|
|
5735
5735
|
if (t.length === 0)
|
|
5736
5736
|
return null;
|
|
5737
5737
|
const i = t[0].clone();
|
|
@@ -5812,7 +5812,7 @@ class ba {
|
|
|
5812
5812
|
rebatchSplitModels() {
|
|
5813
5813
|
if (!this.engine?.scene)
|
|
5814
5814
|
return;
|
|
5815
|
-
Pt(this.engine, (t) => t instanceof
|
|
5815
|
+
Pt(this.engine, (t) => t instanceof R && !(t instanceof W) && t.isSplit === !0).forEach((t) => {
|
|
5816
5816
|
this.rebuildSplitModelGroups(t), this.un_split_merge_model(t);
|
|
5817
5817
|
}), this.rebuildCustomInstanceColorBatches();
|
|
5818
5818
|
}
|
|
@@ -5837,13 +5837,13 @@ class ba {
|
|
|
5837
5837
|
restoreSplitModelsOnIdle() {
|
|
5838
5838
|
if (!this.engine?.scene)
|
|
5839
5839
|
return;
|
|
5840
|
-
Pt(this.engine, (t) => t instanceof
|
|
5841
|
-
t instanceof
|
|
5840
|
+
Pt(this.engine, (t) => t instanceof R && !(t instanceof W)).forEach((t) => {
|
|
5841
|
+
t instanceof R && (t.isSplit === !0 && (t.visible = !this.areAllGroupsHidden(t)), t.isSplit === !0 && this.un_split_merge_model(t));
|
|
5842
5842
|
});
|
|
5843
5843
|
}
|
|
5844
5844
|
// 获取场景中的所有模型
|
|
5845
5845
|
getSceneModel(e) {
|
|
5846
|
-
return
|
|
5846
|
+
return Be(this.engine, e);
|
|
5847
5847
|
}
|
|
5848
5848
|
/** 炸开模式下,原模型状态变化后需要同步到代理构件,保证交互语义一致。 */
|
|
5849
5849
|
syncExplodeVisualState() {
|
|
@@ -5853,7 +5853,7 @@ class ba {
|
|
|
5853
5853
|
getModelCenter(e = this.engine.engineStatus.highlightModels ?? []) {
|
|
5854
5854
|
if (!Array.isArray(e) || e.length === 0)
|
|
5855
5855
|
return null;
|
|
5856
|
-
const t = new
|
|
5856
|
+
const t = new z();
|
|
5857
5857
|
let i = !1;
|
|
5858
5858
|
return e.forEach((n) => {
|
|
5859
5859
|
if (n?.url == null || !Array.isArray(n.ids))
|
|
@@ -5861,7 +5861,7 @@ class ba {
|
|
|
5861
5861
|
const s = this.getEngineModelByUrl(n.url);
|
|
5862
5862
|
if (s?.nodesMap == null)
|
|
5863
5863
|
return;
|
|
5864
|
-
const o =
|
|
5864
|
+
const o = De(this.engine, n.url);
|
|
5865
5865
|
n.ids.forEach((r) => {
|
|
5866
5866
|
const a = s.nodesMap.get(r);
|
|
5867
5867
|
[
|
|
@@ -5869,7 +5869,7 @@ class ba {
|
|
|
5869
5869
|
a?.info?.box,
|
|
5870
5870
|
a?.box
|
|
5871
5871
|
].forEach((h) => {
|
|
5872
|
-
!(h instanceof
|
|
5872
|
+
!(h instanceof z) || h.isEmpty() || (i ? t.union(h.clone().applyMatrix4(o)) : (t.copy(h).applyMatrix4(o), i = !0));
|
|
5873
5873
|
});
|
|
5874
5874
|
});
|
|
5875
5875
|
}), i ? t.getCenter(new d()) : null;
|
|
@@ -6036,7 +6036,7 @@ class ba {
|
|
|
6036
6036
|
/** 设置构件自定义颜色,入参与高亮接口一致:[{ url, ids }],同时兼容旧的直接 Mesh 入参。 */
|
|
6037
6037
|
setModelColor(e, t = 16777215, i = 1) {
|
|
6038
6038
|
const n = this.normalizeOpacity(i);
|
|
6039
|
-
if (e instanceof
|
|
6039
|
+
if (e instanceof R && !(e instanceof W)) {
|
|
6040
6040
|
e.material?.color != null && (e.material.color.set(t), this.clearMaterialTextures(e.material), e.material.transparent = n < 1, e.material.opacity = n, e.material.needsUpdate = !0);
|
|
6041
6041
|
return;
|
|
6042
6042
|
}
|
|
@@ -6049,7 +6049,7 @@ class ba {
|
|
|
6049
6049
|
let c = r.nodesMap.get(a);
|
|
6050
6050
|
c == null || c.indexes == null || c.indexes.forEach((h) => {
|
|
6051
6051
|
const u = this.getSceneModel(h[0]);
|
|
6052
|
-
u instanceof W ? this.setInstanceModelColor(o.url, a, u, h[0], h[1], s, n) : u instanceof
|
|
6052
|
+
u instanceof W ? this.setInstanceModelColor(o.url, a, u, h[0], h[1], s, n) : u instanceof R && this.setSimpleModelColor(o.url, a, u, h[1], s, n);
|
|
6053
6053
|
});
|
|
6054
6054
|
});
|
|
6055
6055
|
}), this.rebatchSplitModels(), this.syncExplodeVisualState();
|
|
@@ -6068,7 +6068,7 @@ class ba {
|
|
|
6068
6068
|
if (r == null || !r.has(String(o?.id)))
|
|
6069
6069
|
return;
|
|
6070
6070
|
const a = this.getSceneModel(o.meshIndex);
|
|
6071
|
-
o.type === "instance" && a instanceof W ? this.restoreInstanceColorRecord(a, o) : o.type === "mesh" && a instanceof
|
|
6071
|
+
o.type === "instance" && a instanceof W ? this.restoreInstanceColorRecord(a, o) : o.type === "mesh" && a instanceof R && this.restoreSimpleColorRecord(a, o), this.customModelColorRecords.delete(s);
|
|
6072
6072
|
}), this.rebatchSplitModels(), this.syncExplodeVisualState();
|
|
6073
6073
|
}
|
|
6074
6074
|
// 设置所有模型颜色
|
|
@@ -6090,7 +6090,7 @@ class ba {
|
|
|
6090
6090
|
if (t == null)
|
|
6091
6091
|
return;
|
|
6092
6092
|
const i = this.getSceneModel(t.meshIndex);
|
|
6093
|
-
t.type === "instance" && i instanceof W ? this.restoreInstanceColorRecord(i, t) : t.type === "mesh" && i instanceof
|
|
6093
|
+
t.type === "instance" && i instanceof W ? this.restoreInstanceColorRecord(i, t) : t.type === "mesh" && i instanceof R && this.restoreSimpleColorRecord(i, t), this.customModelColorRecords.delete(e);
|
|
6094
6094
|
}), this.rebatchSplitModels(), this.syncExplodeVisualState();
|
|
6095
6095
|
}
|
|
6096
6096
|
/** 获取所有通过 setModelColor/setAllModelsColor 改过颜色的构件,返回 [{url, ids}]。 */
|
|
@@ -6516,7 +6516,7 @@ function ms(l) {
|
|
|
6516
6516
|
e?.remove(l), l.material?.dispose != null && l.material.dispose();
|
|
6517
6517
|
}
|
|
6518
6518
|
function kt(l, e) {
|
|
6519
|
-
return
|
|
6519
|
+
return Be(l, e);
|
|
6520
6520
|
}
|
|
6521
6521
|
const gs = "advanced";
|
|
6522
6522
|
class Sa {
|
|
@@ -6764,7 +6764,7 @@ class ei {
|
|
|
6764
6764
|
for (const s of n) {
|
|
6765
6765
|
let o = s.geometry.clone();
|
|
6766
6766
|
o.computeVertexNormals();
|
|
6767
|
-
const r = new
|
|
6767
|
+
const r = new R(o, this.overlayMaterial);
|
|
6768
6768
|
s.updateWorldMatrix(!0, !1), r.matrix.copy(s.matrixWorld), r.matrixAutoUpdate = !1, this.engine.scene.add(r), this.overlayMeshes.push(r);
|
|
6769
6769
|
}
|
|
6770
6770
|
this.animState = "fadeIn", this.animStartTime = performance.now(), this.setAnimationFrameRateExempt(!0);
|
|
@@ -6979,8 +6979,8 @@ function Ia(l, e, t) {
|
|
|
6979
6979
|
var we = j.dot(V), ve = j.dot(K);
|
|
6980
6980
|
v = Math.min(v, we), A = Math.max(A, we), L = Math.min(L, ve), U = Math.max(U, ve);
|
|
6981
6981
|
}
|
|
6982
|
-
var
|
|
6983
|
-
H = Math.min(be /
|
|
6982
|
+
var ke = (A - v) / 2, nt = (U - L) / 2, be = (e.camera.right - e.camera.left) / 2, Re = (e.camera.top - e.camera.bottom) / 2;
|
|
6983
|
+
H = Math.min(be / ke, Re / nt) * 0.75;
|
|
6984
6984
|
var Oe = e.camera.position.clone(), xe = l.controls.target.clone(), st = e.camera.zoom, Fe = new Ze.Tween({
|
|
6985
6985
|
x1: Oe.x,
|
|
6986
6986
|
y1: Oe.y,
|
|
@@ -7196,7 +7196,7 @@ function Ia(l, e, t) {
|
|
|
7196
7196
|
color: 16777215,
|
|
7197
7197
|
map: ae(M, T.icon)
|
|
7198
7198
|
}));
|
|
7199
|
-
var _ = new
|
|
7199
|
+
var _ = new R(new Ct(110, 110, 110), E);
|
|
7200
7200
|
i.sceneOrtho.add(_), ue(122), i.RenderScene();
|
|
7201
7201
|
let D = { x: 0, y: 0 };
|
|
7202
7202
|
o.addEventListener("mousedown", (T) => {
|
|
@@ -7421,7 +7421,7 @@ function Ia(l, e, t) {
|
|
|
7421
7421
|
transparent: !0,
|
|
7422
7422
|
opacity: 0.01
|
|
7423
7423
|
}), _ = new F().makeTranslation(y.point.x, y.point.y, y.point.z);
|
|
7424
|
-
let D = M.applyMatrix4(_), T = new
|
|
7424
|
+
let D = M.applyMatrix4(_), T = new R(D, E);
|
|
7425
7425
|
return T.name = y.name, i.sceneOrtho.add(T), T;
|
|
7426
7426
|
}
|
|
7427
7427
|
return i.ToggleCameraType = function() {
|
|
@@ -7493,7 +7493,7 @@ class _a {
|
|
|
7493
7493
|
flyToModels(e = this.engine.engineStatus.highlightModels ?? []) {
|
|
7494
7494
|
if (!Array.isArray(e) || e.length === 0)
|
|
7495
7495
|
return;
|
|
7496
|
-
const t = new
|
|
7496
|
+
const t = new z();
|
|
7497
7497
|
let i = !1;
|
|
7498
7498
|
e.forEach((n) => {
|
|
7499
7499
|
if (n?.url == null || !Array.isArray(n.ids))
|
|
@@ -7501,7 +7501,7 @@ class _a {
|
|
|
7501
7501
|
const s = this.engine.models?.find((r) => r.url === n.url);
|
|
7502
7502
|
if (s?.nodesMap == null)
|
|
7503
7503
|
return;
|
|
7504
|
-
const o =
|
|
7504
|
+
const o = De(this.engine, n.url);
|
|
7505
7505
|
n.ids.forEach((r) => {
|
|
7506
7506
|
const a = s.nodesMap.get(r);
|
|
7507
7507
|
[
|
|
@@ -7509,7 +7509,7 @@ class _a {
|
|
|
7509
7509
|
a?.info?.box,
|
|
7510
7510
|
a?.box
|
|
7511
7511
|
].forEach((h) => {
|
|
7512
|
-
!(h instanceof
|
|
7512
|
+
!(h instanceof z) || h.isEmpty() || (i ? t.union(h.clone().applyMatrix4(o)) : (t.copy(h).applyMatrix4(o), i = !0));
|
|
7513
7513
|
});
|
|
7514
7514
|
});
|
|
7515
7515
|
}), i && this.zoomToModel(t);
|
|
@@ -7622,13 +7622,13 @@ function Da(l) {
|
|
|
7622
7622
|
const M = p.get(y.url);
|
|
7623
7623
|
if (M == null)
|
|
7624
7624
|
return;
|
|
7625
|
-
const E =
|
|
7625
|
+
const E = De(l, y.url);
|
|
7626
7626
|
(y.lods ?? []).forEach((_) => {
|
|
7627
7627
|
let D = _.octreeBox;
|
|
7628
7628
|
b(i, D, y, M, E);
|
|
7629
7629
|
});
|
|
7630
7630
|
});
|
|
7631
|
-
const w = r.map((y) => k(y)).filter((y) => y instanceof
|
|
7631
|
+
const w = r.map((y) => k(y)).filter((y) => y instanceof R);
|
|
7632
7632
|
nr(i);
|
|
7633
7633
|
const m = [
|
|
7634
7634
|
...x,
|
|
@@ -7640,7 +7640,7 @@ function Da(l) {
|
|
|
7640
7640
|
return;
|
|
7641
7641
|
if (!M.threeBox) {
|
|
7642
7642
|
let V = new d(M.min.X * 0.3048, M.min.Z * 0.3048, -M.min.Y * 0.3048), K = new d(M.max.X * 0.3048, M.max.Z * 0.3048, -M.max.Y * 0.3048), $ = new d(Math.min(V.x, K.x), Math.min(V.y, K.y), Math.min(V.z, K.z)), v = new d(Math.max(K.x, V.x), Math.max(K.y, V.y), Math.max(K.z, V.z));
|
|
7643
|
-
M.threeBox = new
|
|
7643
|
+
M.threeBox = new z($, v).applyMatrix4(D);
|
|
7644
7644
|
}
|
|
7645
7645
|
const T = M.threeBox, H = y.ray.intersectsBox(T);
|
|
7646
7646
|
if (!(H == null || H == !1) && h?.doesBoxIntersectClippingRange?.(T) !== !1)
|
|
@@ -7681,7 +7681,7 @@ function Da(l) {
|
|
|
7681
7681
|
});
|
|
7682
7682
|
}
|
|
7683
7683
|
function S(y, M) {
|
|
7684
|
-
if (!(y instanceof
|
|
7684
|
+
if (!(y instanceof R) || (y.parent == null && Ee(y, M), s && y.geometry.attributes.position.count >= 2e3))
|
|
7685
7685
|
return;
|
|
7686
7686
|
const E = y.uuid ?? y.id;
|
|
7687
7687
|
if (a.has(E))
|
|
@@ -7698,7 +7698,7 @@ function Da(l) {
|
|
|
7698
7698
|
}), B());
|
|
7699
7699
|
}
|
|
7700
7700
|
function P(y, M, E, _, D) {
|
|
7701
|
-
if (!Array.isArray(M) || M.length < 2 || !(
|
|
7701
|
+
if (!Array.isArray(M) || M.length < 2 || !(Be(l, M[0]) instanceof W))
|
|
7702
7702
|
return;
|
|
7703
7703
|
const H = `instance:${M[0]}:${M[1]}`;
|
|
7704
7704
|
a.has(H) || (a.add(H), r.push({
|
|
@@ -7712,7 +7712,7 @@ function Da(l) {
|
|
|
7712
7712
|
}), B());
|
|
7713
7713
|
}
|
|
7714
7714
|
function I(y) {
|
|
7715
|
-
return Array.isArray(y) ? y.filter((M) => Array.isArray(M) &&
|
|
7715
|
+
return Array.isArray(y) ? y.filter((M) => Array.isArray(M) && Be(l, M[0]) instanceof W) : [];
|
|
7716
7716
|
}
|
|
7717
7717
|
function B() {
|
|
7718
7718
|
if (r.sort((y, M) => y.distanceSq - M.distanceSq), r.length > 20) {
|
|
@@ -7726,7 +7726,7 @@ function Da(l) {
|
|
|
7726
7726
|
function O(y, M, E, _) {
|
|
7727
7727
|
if (!Array.isArray(M) || M.length < 2 || y == null)
|
|
7728
7728
|
return null;
|
|
7729
|
-
const D =
|
|
7729
|
+
const D = Be(l, M[0]);
|
|
7730
7730
|
if (!(D instanceof W) || D.geometry == null)
|
|
7731
7731
|
return null;
|
|
7732
7732
|
const T = M[1], H = te(D, T);
|
|
@@ -7736,7 +7736,7 @@ function Da(l) {
|
|
|
7736
7736
|
K.__pickMeshes instanceof Map || (K.__pickMeshes = /* @__PURE__ */ new Map());
|
|
7737
7737
|
const $ = `${M[0]}:${T}`;
|
|
7738
7738
|
let v = K.__pickMeshes.get($);
|
|
7739
|
-
return v instanceof
|
|
7739
|
+
return v instanceof R || (v = new R(D.geometry, D.material), K.__pickMeshes.set($, v)), Ee(v, V), v.userData.__instancePickMeta = {
|
|
7740
7740
|
url: E,
|
|
7741
7741
|
id: y.info?.id ?? y.id ?? y.infos[0].id,
|
|
7742
7742
|
instanceId: T,
|
|
@@ -7744,9 +7744,9 @@ function Da(l) {
|
|
|
7744
7744
|
}, v;
|
|
7745
7745
|
}
|
|
7746
7746
|
function q(y, M, E) {
|
|
7747
|
-
if (y?.info?.box instanceof
|
|
7747
|
+
if (y?.info?.box instanceof z)
|
|
7748
7748
|
return y.info.box.clone().applyMatrix4(M);
|
|
7749
|
-
const _ =
|
|
7749
|
+
const _ = Be(l, E?.[0]);
|
|
7750
7750
|
if (!(_ instanceof W) || _.geometry == null)
|
|
7751
7751
|
return null;
|
|
7752
7752
|
_.geometry.boundingBox == null && _.geometry.computeBoundingBox();
|
|
@@ -7778,7 +7778,7 @@ function Da(l) {
|
|
|
7778
7778
|
};
|
|
7779
7779
|
}
|
|
7780
7780
|
function ce(y, M) {
|
|
7781
|
-
return y.box instanceof
|
|
7781
|
+
return y.box instanceof z ? y.box : y.geometry == null || (y.geometry.boundingBox == null && y.geometry.computeBoundingBox(), y.geometry.boundingBox == null) ? null : (y.box = y.geometry.boundingBox.clone().applyMatrix4(M), y.box);
|
|
7782
7782
|
}
|
|
7783
7783
|
function ae(y, M) {
|
|
7784
7784
|
return g.get(y)?.has(M) || f.get(y)?.has(M);
|
|
@@ -7793,7 +7793,7 @@ function Da(l) {
|
|
|
7793
7793
|
}), M;
|
|
7794
7794
|
}
|
|
7795
7795
|
function Ee(y, M) {
|
|
7796
|
-
y instanceof
|
|
7796
|
+
y instanceof R && (y.matrixAutoUpdate = !1, y.matrix.copy(M), y.matrixWorld.copy(M), y.matrixWorldNeedsUpdate = !1, y.box instanceof z && (y.box.copy(y.geometry.boundingBox ?? new z().setFromBufferAttribute(y.geometry.attributes.position)), y.box.applyMatrix4(M)));
|
|
7797
7797
|
}
|
|
7798
7798
|
}, e;
|
|
7799
7799
|
}
|
|
@@ -7931,7 +7931,7 @@ class ka {
|
|
|
7931
7931
|
console.warn("RangeScale: 无法将屏幕区域转换为世界坐标");
|
|
7932
7932
|
return;
|
|
7933
7933
|
}
|
|
7934
|
-
const c = new
|
|
7934
|
+
const c = new z();
|
|
7935
7935
|
for (const h of r)
|
|
7936
7936
|
c.expandByPoint(h);
|
|
7937
7937
|
if (c.isEmpty()) {
|
|
@@ -8342,7 +8342,7 @@ class Vi {
|
|
|
8342
8342
|
() => {
|
|
8343
8343
|
}
|
|
8344
8344
|
);
|
|
8345
|
-
const a = new
|
|
8345
|
+
const a = new R(s, o);
|
|
8346
8346
|
a.name = "groundMesh", a.receiveShadow = !0, a.castShadow = !1, a.position.y = -0.01, this.groundMesh = a, this.isWaterAddon = !1, this.groundGroup.add(a);
|
|
8347
8347
|
}
|
|
8348
8348
|
this.groundGroup.position.y = this.groundY, this.clock.start();
|
|
@@ -8524,7 +8524,7 @@ class Fa {
|
|
|
8524
8524
|
fog: !1,
|
|
8525
8525
|
toneMapped: !0
|
|
8526
8526
|
});
|
|
8527
|
-
this.skybox = new
|
|
8527
|
+
this.skybox = new R(t, i), this.skybox.name = "hdr_skybox", this.skybox.renderOrder = -1e3, this.skybox.frustumCulled = !1, this.skybox.visible = this.isVisible, this.skybox.onBeforeRender = (n, s, o) => {
|
|
8528
8528
|
this.skybox?.position.copy(o.position);
|
|
8529
8529
|
}, this._updateSkyboxIntensity(), this.engine.scene.add(this.skybox);
|
|
8530
8530
|
}
|
|
@@ -8678,7 +8678,7 @@ class Va {
|
|
|
8678
8678
|
opacity: this.PLANE_OPACITY,
|
|
8679
8679
|
side: re,
|
|
8680
8680
|
depthWrite: !1
|
|
8681
|
-
}), c = new
|
|
8681
|
+
}), c = new R(r, a);
|
|
8682
8682
|
c.position.y = s, o.add(c);
|
|
8683
8683
|
const h = [
|
|
8684
8684
|
new d(-this.halfSize, s, -this.halfSize),
|
|
@@ -8770,7 +8770,7 @@ class Va {
|
|
|
8770
8770
|
min: { x: -this.halfSize, y: -this.halfSize, z: -this.halfSize },
|
|
8771
8771
|
max: { x: this.halfSize, y: this.halfSize, z: this.halfSize }
|
|
8772
8772
|
};
|
|
8773
|
-
const e = new
|
|
8773
|
+
const e = new z();
|
|
8774
8774
|
let t = !1;
|
|
8775
8775
|
return this.engine.models.forEach((i) => {
|
|
8776
8776
|
const n = i.boundingBox;
|
|
@@ -9017,7 +9017,7 @@ class $a {
|
|
|
9017
9017
|
const a = new ge();
|
|
9018
9018
|
a.setAttribute("position", new At(s, 3));
|
|
9019
9019
|
const c = new Xt(a, this.material);
|
|
9020
|
-
c.url = i, this.setLineTransform(c,
|
|
9020
|
+
c.url = i, this.setLineTransform(c, De(this.engine, i)), this.groupEdge.add(c), this.highlightIndexes.set(i, o), this.releaseIndexes(i);
|
|
9021
9021
|
});
|
|
9022
9022
|
}
|
|
9023
9023
|
/**
|
|
@@ -9065,7 +9065,7 @@ class $a {
|
|
|
9065
9065
|
const o = new ge();
|
|
9066
9066
|
o.setAttribute("position", new At(s, 3));
|
|
9067
9067
|
const r = new Xt(o, this.highlightEdgeMaterial);
|
|
9068
|
-
r.name = "highlightModelEdge", r.url = i.url, this.setLineTransform(r,
|
|
9068
|
+
r.name = "highlightModelEdge", r.url = i.url, this.setLineTransform(r, De(this.engine, i.url)), this.highlightEdgeGroup.add(r);
|
|
9069
9069
|
}));
|
|
9070
9070
|
}
|
|
9071
9071
|
appendEdgePositions(e, t) {
|
|
@@ -10042,7 +10042,7 @@ class el {
|
|
|
10042
10042
|
if (!s)
|
|
10043
10043
|
continue;
|
|
10044
10044
|
typeof s.updateMatrixWorld == "function" && s.updateMatrixWorld(!0);
|
|
10045
|
-
const o = new
|
|
10045
|
+
const o = new z().setFromObject(s);
|
|
10046
10046
|
!Number.isFinite(o.min.y) || !Number.isFinite(o.max.y) || (o.min.y < t && (t = o.min.y), o.max.y > i && (i = o.max.y));
|
|
10047
10047
|
}
|
|
10048
10048
|
return !Number.isFinite(t) || !Number.isFinite(i) ? null : { minY: t, maxY: i };
|
|
@@ -10072,7 +10072,7 @@ class el {
|
|
|
10072
10072
|
let t = this.engine.measure.annotationData.normalAnnotation.find((n) => n.isSelect == !0);
|
|
10073
10073
|
t == null && (t = {
|
|
10074
10074
|
text: null,
|
|
10075
|
-
id:
|
|
10075
|
+
id: ze(),
|
|
10076
10076
|
isSelect: !0,
|
|
10077
10077
|
type: "clear-height"
|
|
10078
10078
|
}, this.engine.measure.annotationData.normalAnnotation.push(t));
|
|
@@ -10144,7 +10144,7 @@ class tl {
|
|
|
10144
10144
|
if (t != null && this.points.length == 1) {
|
|
10145
10145
|
let i = this.engine.measure.annotationData.normalAnnotation.find((n) => n.isSelect == !0);
|
|
10146
10146
|
i == null && (i = {
|
|
10147
|
-
id:
|
|
10147
|
+
id: ze(),
|
|
10148
10148
|
point1: this.points[0].clone(),
|
|
10149
10149
|
point2: t.point.clone(),
|
|
10150
10150
|
text: this.points[0].clone().distanceTo(t.point.clone()),
|
|
@@ -10196,7 +10196,7 @@ class il {
|
|
|
10196
10196
|
let t = this.engine.measure.annotationData.normalAnnotation.find((o) => o.isSelect == !0);
|
|
10197
10197
|
t == null && (t = {
|
|
10198
10198
|
text: null,
|
|
10199
|
-
id:
|
|
10199
|
+
id: ze(),
|
|
10200
10200
|
isSelect: !0,
|
|
10201
10201
|
type: "clear-distance"
|
|
10202
10202
|
}, this.engine.measure.annotationData.normalAnnotation.push(t));
|
|
@@ -10244,7 +10244,7 @@ class nl {
|
|
|
10244
10244
|
let t = this.engine.measure.annotationData.elevationAnnotation.find((i) => i.isSelect == !0);
|
|
10245
10245
|
if (t == null) {
|
|
10246
10246
|
t = {
|
|
10247
|
-
id:
|
|
10247
|
+
id: ze(),
|
|
10248
10248
|
point: e.catch.point.clone(),
|
|
10249
10249
|
text: e.catch.point.y,
|
|
10250
10250
|
isSelect: !0,
|
|
@@ -10292,7 +10292,7 @@ class sl {
|
|
|
10292
10292
|
let t = this.engine.measure.annotationData.coordinateAnnotation.find((i) => i.isSelect == !0);
|
|
10293
10293
|
if (t == null) {
|
|
10294
10294
|
t = {
|
|
10295
|
-
id:
|
|
10295
|
+
id: ze(),
|
|
10296
10296
|
point: e.catch.point.clone(),
|
|
10297
10297
|
text: Math.round(e.catch.point.y) + " m",
|
|
10298
10298
|
isSelect: !0,
|
|
@@ -10360,7 +10360,7 @@ class ol {
|
|
|
10360
10360
|
if (e.catch != null && this.points.length != 1 && this.points.length == 2) {
|
|
10361
10361
|
let t = this.engine.measure.annotationData.angleAnnotation.find((i) => i.isSelect == !0);
|
|
10362
10362
|
t == null && (t = {
|
|
10363
|
-
id:
|
|
10363
|
+
id: ze(),
|
|
10364
10364
|
point1: this.points[0].clone(),
|
|
10365
10365
|
// 起点
|
|
10366
10366
|
point2: this.points[1].clone(),
|
|
@@ -10417,7 +10417,7 @@ class rl {
|
|
|
10417
10417
|
this.points.length === 0 && this.engine.measure.tools.clearHighlight(), this.points.push(t.point.clone());
|
|
10418
10418
|
let i = this.getCurrentDrawingMeasure();
|
|
10419
10419
|
i == null ? (i = {
|
|
10420
|
-
id:
|
|
10420
|
+
id: ze(),
|
|
10421
10421
|
points: this.points.map((n) => n.clone()),
|
|
10422
10422
|
area: 0,
|
|
10423
10423
|
text: 0,
|
|
@@ -10429,7 +10429,7 @@ class rl {
|
|
|
10429
10429
|
if (e.catch != null && this.points.length >= 1) {
|
|
10430
10430
|
let t = this.getCurrentDrawingMeasure();
|
|
10431
10431
|
t == null && (t = {
|
|
10432
|
-
id:
|
|
10432
|
+
id: ze(),
|
|
10433
10433
|
points: [],
|
|
10434
10434
|
area: 0,
|
|
10435
10435
|
text: 0,
|
|
@@ -10584,7 +10584,7 @@ class wt {
|
|
|
10584
10584
|
if (t != null && this.points.length == 1) {
|
|
10585
10585
|
let i = this.engine.measure.annotationData.slopeAnnotation.find((s) => s.isSelect == !0);
|
|
10586
10586
|
i == null && (i = {
|
|
10587
|
-
id:
|
|
10587
|
+
id: ze(),
|
|
10588
10588
|
point1: this.points[0].clone(),
|
|
10589
10589
|
// 起点
|
|
10590
10590
|
point2: this.getSlopeSnappedPoint(this.points[0], t, e),
|
|
@@ -10636,7 +10636,7 @@ class al {
|
|
|
10636
10636
|
return;
|
|
10637
10637
|
let s = this.engine.measure.annotationData.normalAnnotation.find((o) => o.isSelect == !0);
|
|
10638
10638
|
s == null && (s = {
|
|
10639
|
-
id:
|
|
10639
|
+
id: ze(),
|
|
10640
10640
|
type: "clear-distance",
|
|
10641
10641
|
isSelect: !0
|
|
10642
10642
|
}, this.engine.measure.annotationData.normalAnnotation.push(s)), s.point1 = i, s.point2 = n.footPoint, s.text = n.distance, s.facePoint = t.point.clone(), s.faceNormal = t.normal.clone(), s.isSelect = !1, this.points = [], this.behavior?.clearLastPoint?.(), this.engine.events.trigger(ne.MeasureChanged, s);
|
|
@@ -10652,7 +10652,7 @@ class al {
|
|
|
10652
10652
|
return;
|
|
10653
10653
|
let s = this.engine.measure.annotationData.normalAnnotation.find((o) => o.isSelect == !0);
|
|
10654
10654
|
s == null && (s = {
|
|
10655
|
-
id:
|
|
10655
|
+
id: ze(),
|
|
10656
10656
|
point1: i.clone(),
|
|
10657
10657
|
point2: n.footPoint.clone(),
|
|
10658
10658
|
text: n.distance,
|
|
@@ -11240,7 +11240,7 @@ class cl {
|
|
|
11240
11240
|
opacity: this.faceIdleOpacity,
|
|
11241
11241
|
side: re
|
|
11242
11242
|
});
|
|
11243
|
-
m.polygonOffset = !0, m.polygonOffsetFactor = 1, m.polygonOffsetUnits = 4, h = new
|
|
11243
|
+
m.polygonOffset = !0, m.polygonOffsetFactor = 1, m.polygonOffsetUnits = 4, h = new R(r, m), h.name = n, e.add(h), this.meshs.push(h);
|
|
11244
11244
|
} else
|
|
11245
11245
|
h.geometry = r;
|
|
11246
11246
|
h.userData = {
|
|
@@ -11526,7 +11526,7 @@ class hl {
|
|
|
11526
11526
|
opacity: this.idleOpacity,
|
|
11527
11527
|
side: re
|
|
11528
11528
|
});
|
|
11529
|
-
x.polygonOffset = !0, x.polygonOffsetFactor = 1, x.polygonOffsetUnits = 4, c = new
|
|
11529
|
+
x.polygonOffset = !0, x.polygonOffsetFactor = 1, x.polygonOffsetUnits = 4, c = new R(s, x), c.name = n, e.add(c), this.meshs.push(c);
|
|
11530
11530
|
} else
|
|
11531
11531
|
c.geometry = s;
|
|
11532
11532
|
c.normal = r.clone(), c.userData.excludeFromAmbientOcclusion = !0;
|
|
@@ -11972,7 +11972,7 @@ class ul {
|
|
|
11972
11972
|
e.normal.y * p * g,
|
|
11973
11973
|
e.normal.z * p * g
|
|
11974
11974
|
);
|
|
11975
|
-
const f = new
|
|
11975
|
+
const f = new R(u, this.fillMaterial);
|
|
11976
11976
|
f.name = `${this.fillMeshName}_${t}`, f.frustumCulled = !1, f.renderOrder = 20, f.castShadow = !1, f.receiveShadow = !1, this.engine.scene.add(f), this.fillMeshes.set(t, f);
|
|
11977
11977
|
}
|
|
11978
11978
|
/**
|
|
@@ -12019,7 +12019,7 @@ class ul {
|
|
|
12019
12019
|
if (!(p?.instance === !0 || !Array.isArray(p?.infos)))
|
|
12020
12020
|
for (const g of p.infos) {
|
|
12021
12021
|
const f = g?.mesh;
|
|
12022
|
-
f instanceof
|
|
12022
|
+
f instanceof R && (i.has(f.uuid) || (i.add(f.uuid), t.push(f)));
|
|
12023
12023
|
}
|
|
12024
12024
|
}
|
|
12025
12025
|
}
|
|
@@ -12064,7 +12064,7 @@ class ul {
|
|
|
12064
12064
|
Math.max(t.y, i.y),
|
|
12065
12065
|
Math.max(t.z, i.z)
|
|
12066
12066
|
);
|
|
12067
|
-
return new
|
|
12067
|
+
return new z(n, s);
|
|
12068
12068
|
}
|
|
12069
12069
|
/**
|
|
12070
12070
|
* 候选 mesh 二次筛选:
|
|
@@ -12073,7 +12073,7 @@ class ul {
|
|
|
12073
12073
|
* - world bbox 必须与 plane 相交
|
|
12074
12074
|
*/
|
|
12075
12075
|
filterMeshesByBoxAndComplexity(e, t) {
|
|
12076
|
-
const i = [], n = new
|
|
12076
|
+
const i = [], n = new z();
|
|
12077
12077
|
for (const s of t) {
|
|
12078
12078
|
const o = s.geometry, r = o?.attributes?.position;
|
|
12079
12079
|
!o || !r || r.count === 0 || (o.index ? Math.floor(o.index.count / 3) : Math.floor(r.count / 3)) > this.maxTriangleCountPerMesh || (o.boundingBox || o.computeBoundingBox(), o.boundingBox && (n.copy(o.boundingBox), s.updateWorldMatrix(!0, !1), n.applyMatrix4(s.matrixWorld), e.intersectsBox(n) && (s.geometry.attributes.position.count > 500 || i.push(s))));
|
|
@@ -12239,7 +12239,7 @@ class pl {
|
|
|
12239
12239
|
let o = new d(1e8, 1e9, 1e10), r = new d(-1e8, -1e9, -1e10);
|
|
12240
12240
|
return s.forEach((a) => {
|
|
12241
12241
|
a.min.x < o.x && (o.x = a.min.x), a.min.y < o.y && (o.y = a.min.y), a.min.z < o.z && (o.z = a.min.z), a.max.x > r.x && (r.x = a.max.x), a.max.y > r.y && (r.y = a.max.y), a.max.z > r.z && (r.z = a.max.z);
|
|
12242
|
-
}), new
|
|
12242
|
+
}), new z(o, r);
|
|
12243
12243
|
}
|
|
12244
12244
|
}
|
|
12245
12245
|
// ****************************更新剖切值*******************************
|
|
@@ -12312,7 +12312,7 @@ class pl {
|
|
|
12312
12312
|
const c = this.intersectThreePlanes(n[o], n[r], n[a]);
|
|
12313
12313
|
c && this.isPointInsidePlanes(c, n) && this.pushUniquePoint(s, c);
|
|
12314
12314
|
}
|
|
12315
|
-
return s.length === 0 ? null : new
|
|
12315
|
+
return s.length === 0 ? null : new z().setFromPoints(s);
|
|
12316
12316
|
}
|
|
12317
12317
|
getEffectiveClippingPlanes() {
|
|
12318
12318
|
const e = Array.isArray(this.engine.sectionPlane) ? this.engine.sectionPlane : [];
|
|
@@ -12325,7 +12325,7 @@ class pl {
|
|
|
12325
12325
|
return [];
|
|
12326
12326
|
}
|
|
12327
12327
|
toBox3(e) {
|
|
12328
|
-
return e == null || e.min == null || e.max == null ? null : new
|
|
12328
|
+
return e == null || e.min == null || e.max == null ? null : new z(
|
|
12329
12329
|
new d(e.min.x, e.min.y, e.min.z),
|
|
12330
12330
|
new d(e.max.x, e.max.y, e.max.z)
|
|
12331
12331
|
);
|
|
@@ -12470,7 +12470,7 @@ class gl {
|
|
|
12470
12470
|
totalTriangles: 0,
|
|
12471
12471
|
meshCount: 0
|
|
12472
12472
|
} : (this.engine.scene.traverse((n) => {
|
|
12473
|
-
if (n instanceof
|
|
12473
|
+
if (n instanceof R) {
|
|
12474
12474
|
const s = n.geometry;
|
|
12475
12475
|
if (s && s.attributes) {
|
|
12476
12476
|
const o = s.attributes.position;
|
|
@@ -12861,10 +12861,10 @@ class vl {
|
|
|
12861
12861
|
return Array.isArray(e) ? e : e && typeof e == "object" ? Object.values(e) : [];
|
|
12862
12862
|
}
|
|
12863
12863
|
toBox3(e) {
|
|
12864
|
-
if (e instanceof
|
|
12864
|
+
if (e instanceof z) return e.clone();
|
|
12865
12865
|
const t = e?.min ?? e?.Min, i = e?.max ?? e?.Max;
|
|
12866
12866
|
if (!t || !i) return;
|
|
12867
|
-
const n = new
|
|
12867
|
+
const n = new z(
|
|
12868
12868
|
new d(t.x ?? t.X, t.y ?? t.Y, t.z ?? t.Z),
|
|
12869
12869
|
new d(i.x ?? i.X, i.y ?? i.Y, i.z ?? i.Z)
|
|
12870
12870
|
);
|
|
@@ -13035,7 +13035,7 @@ class Cl {
|
|
|
13035
13035
|
this.appendBoxPositions(g.min, g.max, p);
|
|
13036
13036
|
});
|
|
13037
13037
|
});
|
|
13038
|
-
const r =
|
|
13038
|
+
const r = De(this.engine, i.url);
|
|
13039
13039
|
this.addLineGroup(i.url, n, this.meshMaterial, "mesh", r), this.addLineGroup(i.url, s, this.instanceMaterial, "instance", r);
|
|
13040
13040
|
}), this.rootGroup.visible = this.isVisible, this.engine.requestComposerRender?.();
|
|
13041
13041
|
}
|
|
@@ -13083,7 +13083,7 @@ class Cl {
|
|
|
13083
13083
|
e?.box
|
|
13084
13084
|
], i = /* @__PURE__ */ new Set(), n = [];
|
|
13085
13085
|
return t.forEach((s) => {
|
|
13086
|
-
if (!(s instanceof
|
|
13086
|
+
if (!(s instanceof z) || s.isEmpty())
|
|
13087
13087
|
return;
|
|
13088
13088
|
const o = `${s.min.x},${s.min.y},${s.min.z},${s.max.x},${s.max.y},${s.max.z}`;
|
|
13089
13089
|
i.has(o) || (i.add(o), n.push(s));
|
|
@@ -13096,7 +13096,7 @@ class Cl {
|
|
|
13096
13096
|
for (const i of t) {
|
|
13097
13097
|
if (!Array.isArray(i) || i.length === 0)
|
|
13098
13098
|
continue;
|
|
13099
|
-
if (
|
|
13099
|
+
if (Be(this.engine, i[0]) instanceof W)
|
|
13100
13100
|
return !0;
|
|
13101
13101
|
}
|
|
13102
13102
|
return !1;
|
|
@@ -14361,7 +14361,7 @@ class Il {
|
|
|
14361
14361
|
const i = e.ids.map((s) => t.nodesMap.get(s)).flatMap((s) => s?.infos?.map((o) => o?.box).filter(Boolean) ?? []);
|
|
14362
14362
|
if (i.length === 0)
|
|
14363
14363
|
return null;
|
|
14364
|
-
const n = new
|
|
14364
|
+
const n = new z();
|
|
14365
14365
|
n.copy(i[0]);
|
|
14366
14366
|
for (let s = 1; s < i.length; s++)
|
|
14367
14367
|
n.union(i[s]);
|
|
@@ -14859,7 +14859,7 @@ class Hl {
|
|
|
14859
14859
|
const i = e?.nodesMap;
|
|
14860
14860
|
if (!(i instanceof Map))
|
|
14861
14861
|
return [];
|
|
14862
|
-
const n =
|
|
14862
|
+
const n = De(this.engine, e.url), s = [];
|
|
14863
14863
|
return i.forEach((o) => {
|
|
14864
14864
|
const r = this.normalizeName(this.getNodeName(o));
|
|
14865
14865
|
if (!r || !t.some((c) => r.includes(this.normalizeName(c))))
|
|
@@ -14892,7 +14892,7 @@ class Hl {
|
|
|
14892
14892
|
];
|
|
14893
14893
|
let n = null;
|
|
14894
14894
|
return i.forEach((s) => {
|
|
14895
|
-
if (!(s instanceof
|
|
14895
|
+
if (!(s instanceof z) || s.isEmpty())
|
|
14896
14896
|
return;
|
|
14897
14897
|
const o = s.clone().applyMatrix4(t);
|
|
14898
14898
|
n ? n.union(o) : n = o;
|
|
@@ -14994,7 +14994,13 @@ const Nt = {
|
|
|
14994
14994
|
floorPlan: [Nt.floorPlan, "楼层"],
|
|
14995
14995
|
elevation: [Nt.elevation, "立面"],
|
|
14996
14996
|
section: [Nt.section, "剖面"]
|
|
14997
|
-
}
|
|
14997
|
+
}, Ul = [
|
|
14998
|
+
["CeilingPlans", "ceilingPlans"],
|
|
14999
|
+
["Elevations", "elevations"],
|
|
15000
|
+
["DynamicViews", "dynamicViews"],
|
|
15001
|
+
["FloorPlans", "floorPlans"],
|
|
15002
|
+
["Sections", "sections"]
|
|
15003
|
+
];
|
|
14998
15004
|
class Ui {
|
|
14999
15005
|
static OPEN_VIEW_ANIMATION_DURATION = 1e3;
|
|
15000
15006
|
engine;
|
|
@@ -15016,44 +15022,29 @@ class Ui {
|
|
|
15016
15022
|
}
|
|
15017
15023
|
/** 获取单个模型的视图树数据,并补充运行时生成的动态视图分类。 */
|
|
15018
15024
|
getViewTreeData(e) {
|
|
15019
|
-
const t = this.getResolvedViewTree(e), i =
|
|
15020
|
-
|
|
15021
|
-
|
|
15022
|
-
|
|
15023
|
-
floorPlans: [],
|
|
15024
|
-
sections: []
|
|
15025
|
-
};
|
|
15026
|
-
return t && ((t.CeilingPlans ?? []).forEach((n) => {
|
|
15027
|
-
i.ceilingPlans.push({
|
|
15028
|
-
id: n.Id,
|
|
15029
|
-
name: n.Name,
|
|
15030
|
-
url: e
|
|
15031
|
-
});
|
|
15032
|
-
}), (t.Elevations ?? []).forEach((n) => {
|
|
15033
|
-
i.elevations.push({
|
|
15034
|
-
id: n.Id,
|
|
15035
|
-
name: n.Name,
|
|
15036
|
-
url: e
|
|
15037
|
-
});
|
|
15038
|
-
}), (t.DynamicViews ?? []).forEach((n) => {
|
|
15039
|
-
i.dynamicViews.push({
|
|
15040
|
-
id: n.Id,
|
|
15041
|
-
name: n.Name,
|
|
15042
|
-
url: e
|
|
15025
|
+
const t = this.getResolvedViewTree(e), i = this.createEmptyViewTreeResult();
|
|
15026
|
+
return t && Ul.forEach(([n, s]) => {
|
|
15027
|
+
(t[n] ?? []).forEach((o) => {
|
|
15028
|
+
i[s].push(this.toViewTreeItem(o, e));
|
|
15043
15029
|
});
|
|
15044
|
-
}),
|
|
15045
|
-
|
|
15046
|
-
|
|
15047
|
-
|
|
15048
|
-
|
|
15049
|
-
|
|
15050
|
-
|
|
15051
|
-
|
|
15052
|
-
|
|
15053
|
-
|
|
15054
|
-
|
|
15055
|
-
|
|
15056
|
-
|
|
15030
|
+
}), i;
|
|
15031
|
+
}
|
|
15032
|
+
/**
|
|
15033
|
+
* 获取指定构件所属的动态视图,可选择直接切换到第一个匹配视图。
|
|
15034
|
+
* 仅使用动态视图的关注区域判断,不改变构件自身的显隐状态。
|
|
15035
|
+
*/
|
|
15036
|
+
getElementVisibleViews(e, t, i = !1) {
|
|
15037
|
+
const n = this.createEmptyViewTreeResult(), s = this.engine.models.find((h) => h.url === e);
|
|
15038
|
+
if (!s)
|
|
15039
|
+
return n;
|
|
15040
|
+
const o = this.findModelNode(s, t), r = this.getNodeWorldBox(s, o), a = this.getResolvedViewTree(e);
|
|
15041
|
+
if (!r || !a)
|
|
15042
|
+
return n;
|
|
15043
|
+
(a.DynamicViews ?? []).forEach((h) => {
|
|
15044
|
+
this.isBoxVisibleInDynamicView(r, h) && n.dynamicViews.push(this.toViewTreeItem(h, e));
|
|
15045
|
+
});
|
|
15046
|
+
const c = n.dynamicViews[0];
|
|
15047
|
+
return i && c && this.openView(c.url, c.id), n;
|
|
15057
15048
|
}
|
|
15058
15049
|
/** 打开指定视图,并根据视图类型决定是否启用剖切和正交投影。 */
|
|
15059
15050
|
openView(e, t) {
|
|
@@ -15103,7 +15094,7 @@ class Ui {
|
|
|
15103
15094
|
b,
|
|
15104
15095
|
S,
|
|
15105
15096
|
C ? void 0 : () => {
|
|
15106
|
-
s.focusBox instanceof
|
|
15097
|
+
s.focusBox instanceof z && !s.focusBox.isEmpty() ? this.engine.viewCube?.zoomToModel?.(s.focusBox, 0) : I && this.zoomToCurrentViewRange(0);
|
|
15107
15098
|
}
|
|
15108
15099
|
);
|
|
15109
15100
|
return;
|
|
@@ -15115,7 +15106,7 @@ class Ui {
|
|
|
15115
15106
|
b,
|
|
15116
15107
|
S,
|
|
15117
15108
|
C ? void 0 : () => {
|
|
15118
|
-
s.focusBox instanceof
|
|
15109
|
+
s.focusBox instanceof z && !s.focusBox.isEmpty() && this.engine.viewCube?.zoomToModel?.(s.focusBox, 0);
|
|
15119
15110
|
}
|
|
15120
15111
|
);
|
|
15121
15112
|
}
|
|
@@ -15123,6 +15114,53 @@ class Ui {
|
|
|
15123
15114
|
const t = this.engine.models.find((n) => n.url === e), i = t ? this.dynamicElevationViewGenerator.syncModelViews(t) : null;
|
|
15124
15115
|
return i || null;
|
|
15125
15116
|
}
|
|
15117
|
+
createEmptyViewTreeResult() {
|
|
15118
|
+
return {
|
|
15119
|
+
ceilingPlans: [],
|
|
15120
|
+
elevations: [],
|
|
15121
|
+
dynamicViews: [],
|
|
15122
|
+
floorPlans: [],
|
|
15123
|
+
sections: []
|
|
15124
|
+
};
|
|
15125
|
+
}
|
|
15126
|
+
toViewTreeItem(e, t) {
|
|
15127
|
+
return {
|
|
15128
|
+
id: e.Id ?? e.id,
|
|
15129
|
+
name: e.Name ?? e.name,
|
|
15130
|
+
url: t
|
|
15131
|
+
};
|
|
15132
|
+
}
|
|
15133
|
+
/** 兼容模型节点 Map 使用数字或字符串作为构件 ID。 */
|
|
15134
|
+
findModelNode(e, t) {
|
|
15135
|
+
const i = e?.nodesMap;
|
|
15136
|
+
if (!(i instanceof Map))
|
|
15137
|
+
return null;
|
|
15138
|
+
if (i.has(t))
|
|
15139
|
+
return i.get(t);
|
|
15140
|
+
const n = typeof t == "number" ? String(t) : Number(t);
|
|
15141
|
+
return (typeof n == "string" || Number.isFinite(n)) && i.has(n) ? i.get(n) : null;
|
|
15142
|
+
}
|
|
15143
|
+
/** 合并构件的局部包围盒,并转换到引擎世界坐标。 */
|
|
15144
|
+
getNodeWorldBox(e, t) {
|
|
15145
|
+
if (!t)
|
|
15146
|
+
return null;
|
|
15147
|
+
const i = [
|
|
15148
|
+
...Array.isArray(t.infos) ? t.infos.map((o) => o?.box) : [],
|
|
15149
|
+
t.info?.box,
|
|
15150
|
+
t.box
|
|
15151
|
+
], n = De(this.engine, e.url);
|
|
15152
|
+
let s = null;
|
|
15153
|
+
return i.forEach((o) => {
|
|
15154
|
+
if (!(o instanceof z) || o.isEmpty())
|
|
15155
|
+
return;
|
|
15156
|
+
const r = o.clone().applyMatrix4(n);
|
|
15157
|
+
s ? s.union(r) : s = r;
|
|
15158
|
+
}), s;
|
|
15159
|
+
}
|
|
15160
|
+
/** 构件包围盒与动态视图关注区域相交时,认为构件在该动态视图中可见。 */
|
|
15161
|
+
isBoxVisibleInDynamicView(e, t) {
|
|
15162
|
+
return t.__dynamic === !0 && t.focusBox instanceof z && !t.focusBox.isEmpty() && e.intersectsBox(t.focusBox);
|
|
15163
|
+
}
|
|
15126
15164
|
createViewRangePlanes(e, t) {
|
|
15127
15165
|
if (!e)
|
|
15128
15166
|
return null;
|
|
@@ -15190,7 +15228,7 @@ class Ui {
|
|
|
15190
15228
|
!t || t.isEmpty?.() || this.engine.viewCube?.zoomToModel?.(t, e);
|
|
15191
15229
|
}
|
|
15192
15230
|
}
|
|
15193
|
-
class
|
|
15231
|
+
class Wl {
|
|
15194
15232
|
engine;
|
|
15195
15233
|
sectionPlaneGroup = null;
|
|
15196
15234
|
loaderModule2d;
|
|
@@ -15260,16 +15298,16 @@ class Ul {
|
|
|
15260
15298
|
), a.setPosition(e), a;
|
|
15261
15299
|
}
|
|
15262
15300
|
}
|
|
15263
|
-
function
|
|
15301
|
+
function Gl(l, e, t = "bim-snapshot.png") {
|
|
15264
15302
|
const i = l?.renderer, n = i?.domElement;
|
|
15265
15303
|
if (!i || !n || !e)
|
|
15266
15304
|
return null;
|
|
15267
15305
|
const s = n.width || n.clientWidth, o = n.height || n.clientHeight;
|
|
15268
15306
|
if (s <= 0 || o <= 0)
|
|
15269
15307
|
return null;
|
|
15270
|
-
let r =
|
|
15271
|
-
if (!
|
|
15272
|
-
const p =
|
|
15308
|
+
let r = ql(n, s, o);
|
|
15309
|
+
if (!Kl(r)) {
|
|
15310
|
+
const p = jl(l, s, o);
|
|
15273
15311
|
p && (r = p);
|
|
15274
15312
|
}
|
|
15275
15313
|
const a = document.createElement("canvas");
|
|
@@ -15281,13 +15319,13 @@ function Wl(l, e, t = "bim-snapshot.png") {
|
|
|
15281
15319
|
const h = a.toDataURL("image/png"), u = document.createElement("a");
|
|
15282
15320
|
return u.href = h, u.download = t.toLowerCase().endsWith(".png") ? t : `${t}.png`, u.click(), h;
|
|
15283
15321
|
}
|
|
15284
|
-
function
|
|
15322
|
+
function ql(l, e, t) {
|
|
15285
15323
|
const i = document.createElement("canvas");
|
|
15286
15324
|
i.width = e, i.height = t;
|
|
15287
15325
|
const n = i.getContext("2d");
|
|
15288
15326
|
return n && n.drawImage(l, 0, 0, e, t), i;
|
|
15289
15327
|
}
|
|
15290
|
-
function
|
|
15328
|
+
function Kl(l) {
|
|
15291
15329
|
const e = l.getContext("2d");
|
|
15292
15330
|
if (!e || l.width <= 0 || l.height <= 0)
|
|
15293
15331
|
return !1;
|
|
@@ -15300,7 +15338,7 @@ function ql(l) {
|
|
|
15300
15338
|
}
|
|
15301
15339
|
return !1;
|
|
15302
15340
|
}
|
|
15303
|
-
function
|
|
15341
|
+
function jl(l, e, t) {
|
|
15304
15342
|
const i = l?.renderer, n = l?.scene, s = l?.camera;
|
|
15305
15343
|
if (!i || !n || !s)
|
|
15306
15344
|
return null;
|
|
@@ -15314,14 +15352,14 @@ function Kl(l, e, t) {
|
|
|
15314
15352
|
try {
|
|
15315
15353
|
i.xr && (i.xr.enabled = !1), i.autoClear = !0, i.setRenderTarget(o), i.clear(!0, !0, !0), i.render(n, s);
|
|
15316
15354
|
const h = new Uint8Array(e * t * 4);
|
|
15317
|
-
return i.readRenderTargetPixels(o, 0, 0, e, t, h),
|
|
15355
|
+
return i.readRenderTargetPixels(o, 0, 0, e, t, h), Yl(h, e, t);
|
|
15318
15356
|
} catch {
|
|
15319
15357
|
return null;
|
|
15320
15358
|
} finally {
|
|
15321
15359
|
i.setRenderTarget(r), i.autoClear = a, i.xr && (i.xr.enabled = c), o.dispose();
|
|
15322
15360
|
}
|
|
15323
15361
|
}
|
|
15324
|
-
function
|
|
15362
|
+
function Yl(l, e, t) {
|
|
15325
15363
|
const i = document.createElement("canvas");
|
|
15326
15364
|
i.width = e, i.height = t;
|
|
15327
15365
|
const n = i.getContext("2d");
|
|
@@ -15335,7 +15373,7 @@ function jl(l, e, t) {
|
|
|
15335
15373
|
}
|
|
15336
15374
|
return n.putImageData(s, 0, 0), i;
|
|
15337
15375
|
}
|
|
15338
|
-
const
|
|
15376
|
+
const Xl = [
|
|
15339
15377
|
"#ffffff",
|
|
15340
15378
|
"#000000",
|
|
15341
15379
|
"#ff4d4f",
|
|
@@ -15346,7 +15384,7 @@ const Yl = [
|
|
|
15346
15384
|
"#1677ff",
|
|
15347
15385
|
"#722ed1",
|
|
15348
15386
|
"#eb2f96"
|
|
15349
|
-
],
|
|
15387
|
+
], Ql = {
|
|
15350
15388
|
none: ee("/assets/icon/选择.svg", import.meta.url),
|
|
15351
15389
|
line: ee("/assets/icon/线.svg", import.meta.url),
|
|
15352
15390
|
arrow: ee("/assets/icon/箭头.svg", import.meta.url),
|
|
@@ -15354,7 +15392,7 @@ const Yl = [
|
|
|
15354
15392
|
circle: ee("/assets/icon/圆形.svg", import.meta.url),
|
|
15355
15393
|
text: ee("/assets/icon/文字.svg", import.meta.url),
|
|
15356
15394
|
cloudline: ee("/assets/icon/云线.svg", import.meta.url)
|
|
15357
|
-
},
|
|
15395
|
+
}, $l = ee("/assets/icon/测距.svg", import.meta.url), Zl = ee("/assets/icon/截图.svg", import.meta.url), Jl = ee("/assets/icon/线宽.svg", import.meta.url), ec = ee("/assets/icon/字号.svg", import.meta.url), tc = `data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2l4 8-4 12-4-12 4-8z" fill="#1677ff"/><circle cx="12" cy="10" r="2.5" fill="#fff"/></svg>')}`, ic = [
|
|
15358
15396
|
{ type: "distance", label: "距离" },
|
|
15359
15397
|
{ type: "clearDistance", label: "净距" },
|
|
15360
15398
|
{ type: "clearHeight", label: "净高" },
|
|
@@ -15363,7 +15401,7 @@ const Yl = [
|
|
|
15363
15401
|
{ type: "angle", label: "角度" },
|
|
15364
15402
|
{ type: "area", label: "面积" },
|
|
15365
15403
|
{ type: "slope", label: "坡度" }
|
|
15366
|
-
],
|
|
15404
|
+
], nc = {
|
|
15367
15405
|
distance: ee("/assets/icon/距离.svg", import.meta.url),
|
|
15368
15406
|
clearDistance: ee("/assets/icon/净距.svg", import.meta.url),
|
|
15369
15407
|
clearHeight: ee("/assets/icon/净高.svg", import.meta.url),
|
|
@@ -15373,7 +15411,7 @@ const Yl = [
|
|
|
15373
15411
|
area: ee("/assets/icon/面积.svg", import.meta.url),
|
|
15374
15412
|
slope: ee("/assets/icon/坡度.svg", import.meta.url)
|
|
15375
15413
|
};
|
|
15376
|
-
class
|
|
15414
|
+
class sc {
|
|
15377
15415
|
constructor(e, t) {
|
|
15378
15416
|
this.handlers = e, this.root = document.createElement("div"), this.root.style.position = "absolute", this.root.style.top = "8px", this.root.style.left = "50%", this.root.style.transform = "translateX(-50%)", this.root.style.display = "none", this.root.style.padding = "6px", this.root.style.background = "#ffffff", this.root.style.border = "1px solid #d9d9d9", this.root.style.borderRadius = "8px", this.root.style.pointerEvents = "auto", this.root.style.userSelect = "none", this.root.style.boxShadow = "0 4px 14px rgba(0, 0, 0, 0.12)", this.root.style.zIndex = "1300", this.root.style.overflow = "visible", this.editPanel = document.createElement("div"), this.editPanel.style.display = "flex", this.editPanel.style.flexDirection = "column", this.editPanel.style.gap = "6px", this.viewPanel = document.createElement("div"), this.viewPanel.style.display = "none", this.viewPanel.style.alignItems = "center", this.viewPanel.style.gap = "6px";
|
|
15379
15417
|
const i = document.createElement("div");
|
|
@@ -15386,7 +15424,7 @@ class nc {
|
|
|
15386
15424
|
{ type: "text", label: "文字" },
|
|
15387
15425
|
{ type: "cloudline", label: "云线" }
|
|
15388
15426
|
].forEach((f) => {
|
|
15389
|
-
const x = this.createIconButton(f.label,
|
|
15427
|
+
const x = this.createIconButton(f.label, Ql[f.type]);
|
|
15390
15428
|
x.onclick = () => this.handlers.onDrawTypeChange(f.type), this.drawButtons[f.type] = x, i.appendChild(x);
|
|
15391
15429
|
});
|
|
15392
15430
|
const s = document.createElement("div");
|
|
@@ -15396,23 +15434,23 @@ class nc {
|
|
|
15396
15434
|
this.updateColorControl(this.colorInput.value), this.handlers.onColorChange(this.colorInput.value), this.setColorPresetVisible(!1);
|
|
15397
15435
|
}, s.appendChild(this.colorInput), this.colorPresetPanel = document.createElement("div"), this.colorPresetPanel.style.position = "absolute", this.colorPresetPanel.style.top = "30px", this.colorPresetPanel.style.left = "0", this.colorPresetPanel.style.display = "none", this.colorPresetPanel.style.padding = "8px", this.colorPresetPanel.style.background = "#ffffff", this.colorPresetPanel.style.border = "1px solid #d9d9d9", this.colorPresetPanel.style.borderRadius = "6px", this.colorPresetPanel.style.boxShadow = "0 6px 18px rgba(0, 0, 0, 0.14)", this.colorPresetPanel.style.zIndex = "20", this.colorPresetPanel.style.width = "152px";
|
|
15398
15436
|
const r = document.createElement("div");
|
|
15399
|
-
r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px",
|
|
15437
|
+
r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px", Xl.forEach((f) => {
|
|
15400
15438
|
const x = document.createElement("button");
|
|
15401
15439
|
x.type = "button", x.title = f, x.style.width = "22px", x.style.height = "22px", x.style.padding = "0", x.style.border = "1px solid #d9d9d9", x.style.borderRadius = "4px", x.style.background = f, x.style.cursor = "pointer", x.onclick = () => {
|
|
15402
15440
|
this.updateColorControl(f), this.handlers.onColorChange(f), this.setColorPresetVisible(!1);
|
|
15403
15441
|
}, r.appendChild(x);
|
|
15404
15442
|
}), this.colorPresetPanel.appendChild(r);
|
|
15405
15443
|
const a = document.createElement("button");
|
|
15406
|
-
a.type = "button", a.textContent = "自定义", a.style.marginTop = "8px", a.style.width = "100%", a.style.height = "26px", a.style.border = "1px solid #d9d9d9", a.style.borderRadius = "4px", a.style.background = "#ffffff", a.style.color = "#333333", a.style.cursor = "pointer", a.onclick = () => this.openNativeColorPicker(), this.colorPresetPanel.appendChild(a), s.appendChild(this.colorPresetPanel), this.updateColorControl(t.stroke), i.appendChild(this.createField("", s)), this.strokeWidthInput = document.createElement("input"), this.strokeWidthInput.type = "number", this.strokeWidthInput.min = "1", this.strokeWidthInput.max = "20", this.strokeWidthInput.step = "1", this.strokeWidthInput.value = String(t.strokeWidth), this.strokeWidthInput.style.width = "46px", this.strokeWidthInput.oninput = () => this.handlers.onStrokeWidthChange(this.strokeWidthInput.value), i.appendChild(this.createField("", this.strokeWidthInput,
|
|
15407
|
-
const c = this.createIconButton("截图",
|
|
15444
|
+
a.type = "button", a.textContent = "自定义", a.style.marginTop = "8px", a.style.width = "100%", a.style.height = "26px", a.style.border = "1px solid #d9d9d9", a.style.borderRadius = "4px", a.style.background = "#ffffff", a.style.color = "#333333", a.style.cursor = "pointer", a.onclick = () => this.openNativeColorPicker(), this.colorPresetPanel.appendChild(a), s.appendChild(this.colorPresetPanel), this.updateColorControl(t.stroke), i.appendChild(this.createField("", s)), this.strokeWidthInput = document.createElement("input"), this.strokeWidthInput.type = "number", this.strokeWidthInput.min = "1", this.strokeWidthInput.max = "20", this.strokeWidthInput.step = "1", this.strokeWidthInput.value = String(t.strokeWidth), this.strokeWidthInput.style.width = "46px", this.strokeWidthInput.oninput = () => this.handlers.onStrokeWidthChange(this.strokeWidthInput.value), i.appendChild(this.createField("", this.strokeWidthInput, Jl, "线宽")), this.fontSizeInput = document.createElement("input"), this.fontSizeInput.type = "number", this.fontSizeInput.min = "10", this.fontSizeInput.max = "96", this.fontSizeInput.step = "1", this.fontSizeInput.value = String(t.fontSize), this.fontSizeInput.style.width = "46px", this.fontSizeInput.oninput = () => this.handlers.onFontSizeChange(this.fontSizeInput.value), i.appendChild(this.createField("", this.fontSizeInput, ec, "字号")), this.distanceButton = this.createIconButton("测量", $l), this.distanceButton.onclick = () => this.handlers.onMeasureToggle(), i.appendChild(this.distanceButton);
|
|
15445
|
+
const c = this.createIconButton("截图", Zl);
|
|
15408
15446
|
c.onclick = () => this.handlers.onScreenshot(), i.appendChild(c);
|
|
15409
|
-
const h = this.createIconButton("捕捉点",
|
|
15447
|
+
const h = this.createIconButton("捕捉点", tc);
|
|
15410
15448
|
h.onclick = () => this.handlers.onPickPoint(), i.appendChild(h);
|
|
15411
15449
|
const u = this.createTextButton("×", "取消");
|
|
15412
15450
|
u.onclick = () => this.handlers.onCancel(), u.style.background = "#ff4d4f", u.style.borderColor = "#ff4d4f", u.style.color = "#ffffff", i.appendChild(u);
|
|
15413
15451
|
const p = this.createTextButton("✔", "确定");
|
|
15414
|
-
p.onclick = () => this.handlers.onConfirm(), p.style.background = "#52c41a", p.style.borderColor = "#52c41a", p.style.color = "#ffffff", i.appendChild(p), this.measureSubPanel = document.createElement("div"), this.measureSubPanel.style.display = "none", this.measureSubPanel.style.alignItems = "center", this.measureSubPanel.style.gap = "6px", this.measureSubPanel.style.flexWrap = "wrap", this.measureSubPanel.style.paddingTop = "2px",
|
|
15415
|
-
const x = this.createSmallIconButton(f.label,
|
|
15452
|
+
p.onclick = () => this.handlers.onConfirm(), p.style.background = "#52c41a", p.style.borderColor = "#52c41a", p.style.color = "#ffffff", i.appendChild(p), this.measureSubPanel = document.createElement("div"), this.measureSubPanel.style.display = "none", this.measureSubPanel.style.alignItems = "center", this.measureSubPanel.style.gap = "6px", this.measureSubPanel.style.flexWrap = "wrap", this.measureSubPanel.style.paddingTop = "2px", ic.forEach((f) => {
|
|
15453
|
+
const x = this.createSmallIconButton(f.label, nc[f.type]);
|
|
15416
15454
|
x.onclick = () => this.handlers.onMeasureTypeChange(f.type), this.measureTypeButtons[f.type] = x, this.measureSubPanel.appendChild(x);
|
|
15417
15455
|
}), this.editPanel.appendChild(i), this.editPanel.appendChild(this.measureSubPanel);
|
|
15418
15456
|
const g = this.createTextButton("关闭", "关闭");
|
|
@@ -15537,7 +15575,7 @@ class nc {
|
|
|
15537
15575
|
return i.type = "button", i.title = t, i.textContent = e, i.style.width = "28px", i.style.height = "28px", i.style.padding = "0 10px", i.style.border = "1px solid #d9d9d9", i.style.borderRadius = "4px", i.style.background = "#ffffff", i.style.color = "#333333", i.style.fontSize = "13px", i.style.lineHeight = "1", i.style.cursor = "pointer", i;
|
|
15538
15576
|
}
|
|
15539
15577
|
}
|
|
15540
|
-
class
|
|
15578
|
+
class oc {
|
|
15541
15579
|
engine;
|
|
15542
15580
|
wrapper;
|
|
15543
15581
|
canvasEl;
|
|
@@ -15576,7 +15614,7 @@ class sc {
|
|
|
15576
15614
|
const t = this.engine.container;
|
|
15577
15615
|
if (!t)
|
|
15578
15616
|
throw new Error("FabricDraw: engine container not found.");
|
|
15579
|
-
this.wrapper = document.createElement("div"), this.wrapper.className = "fabric-draw-layer", this.wrapper.style.position = "absolute", this.wrapper.style.left = "0", this.wrapper.style.top = "0", this.wrapper.style.right = "0", this.wrapper.style.bottom = "0", this.wrapper.style.pointerEvents = "none", this.canvasEl = document.createElement("canvas"), this.canvasEl.style.width = "100%", this.canvasEl.style.height = "100%", this.wrapper.appendChild(this.canvasEl), this.toolbar = new
|
|
15617
|
+
this.wrapper = document.createElement("div"), this.wrapper.className = "fabric-draw-layer", this.wrapper.style.position = "absolute", this.wrapper.style.left = "0", this.wrapper.style.top = "0", this.wrapper.style.right = "0", this.wrapper.style.bottom = "0", this.wrapper.style.pointerEvents = "none", this.canvasEl = document.createElement("canvas"), this.canvasEl.style.width = "100%", this.canvasEl.style.height = "100%", this.wrapper.appendChild(this.canvasEl), this.toolbar = new sc({
|
|
15580
15618
|
onDrawTypeChange: (n) => this.setDrawType(n),
|
|
15581
15619
|
onMeasureToggle: () => this.toggleMeasurePanel(),
|
|
15582
15620
|
onMeasureTypeChange: (n) => this.activateDistanceMeasure(n),
|
|
@@ -15725,7 +15763,7 @@ class sc {
|
|
|
15725
15763
|
* 鎴浘淇濆瓨锛堟ā鍨?Fabric鎵规敞鍚堟垚锛夈€? */
|
|
15726
15764
|
saveScreenshot(e = "bim-snapshot.png") {
|
|
15727
15765
|
const t = this.canvas.lowerCanvasEl;
|
|
15728
|
-
return t ?
|
|
15766
|
+
return t ? Gl(this.engine, t, e) : null;
|
|
15729
15767
|
}
|
|
15730
15768
|
/**
|
|
15731
15769
|
* 鍚屾鐢诲竷灏哄銆? */
|
|
@@ -16209,7 +16247,7 @@ class sc {
|
|
|
16209
16247
|
return JSON.parse(JSON.stringify(e));
|
|
16210
16248
|
}
|
|
16211
16249
|
}
|
|
16212
|
-
class
|
|
16250
|
+
class rc {
|
|
16213
16251
|
engine;
|
|
16214
16252
|
capturePoint = null;
|
|
16215
16253
|
labelPrefix = "drawing-pin-label-";
|
|
@@ -16659,7 +16697,7 @@ class oc {
|
|
|
16659
16697
|
return e;
|
|
16660
16698
|
}
|
|
16661
16699
|
}
|
|
16662
|
-
const gi = "bim-engine:model-link-3d",
|
|
16700
|
+
const gi = "bim-engine:model-link-3d", ac = "default-model-link-3d-group", _n = "model-link-3d", Dn = {
|
|
16663
16701
|
enabled: !1,
|
|
16664
16702
|
highlight: !0,
|
|
16665
16703
|
visibility: !0,
|
|
@@ -16668,7 +16706,7 @@ const gi = "bim-engine:model-link-3d", rc = "default-model-link-3d-group", _n =
|
|
|
16668
16706
|
cameraMode: "onStop",
|
|
16669
16707
|
cameraThrottleMs: 50
|
|
16670
16708
|
};
|
|
16671
|
-
class
|
|
16709
|
+
class lc {
|
|
16672
16710
|
viewerGuid;
|
|
16673
16711
|
engine;
|
|
16674
16712
|
options;
|
|
@@ -16732,7 +16770,7 @@ class ac {
|
|
|
16732
16770
|
return {
|
|
16733
16771
|
...Dn,
|
|
16734
16772
|
...e,
|
|
16735
|
-
groupId: e.groupId ?? this.engine?.options?.linkGroupId ??
|
|
16773
|
+
groupId: e.groupId ?? this.engine?.options?.linkGroupId ?? ac,
|
|
16736
16774
|
modelId: e.modelId ?? this.engine?.options?.modelLinkId
|
|
16737
16775
|
};
|
|
16738
16776
|
}
|
|
@@ -16972,7 +17010,7 @@ class ac {
|
|
|
16972
17010
|
}).filter((n) => n.ids.length > 0);
|
|
16973
17011
|
}
|
|
16974
17012
|
}
|
|
16975
|
-
class
|
|
17013
|
+
class cc {
|
|
16976
17014
|
engine;
|
|
16977
17015
|
manager;
|
|
16978
17016
|
worldToScreen;
|
|
@@ -17040,7 +17078,7 @@ class lc {
|
|
|
17040
17078
|
return e = this.engine.clipping?.filterIntersectionsByClipping?.(e) ?? e, e.filter((i) => i?.point instanceof d).sort((i, n) => i.distance - n.distance)[0] ?? null;
|
|
17041
17079
|
}
|
|
17042
17080
|
}
|
|
17043
|
-
class
|
|
17081
|
+
class hc {
|
|
17044
17082
|
/** 推进当前标记注册的材质与独立点动画。 */
|
|
17045
17083
|
updateRecord(e, t) {
|
|
17046
17084
|
const i = t + e.timeSeed;
|
|
@@ -17063,7 +17101,7 @@ class cc {
|
|
|
17063
17101
|
});
|
|
17064
17102
|
}
|
|
17065
17103
|
}
|
|
17066
|
-
class
|
|
17104
|
+
class dc {
|
|
17067
17105
|
engine;
|
|
17068
17106
|
rootGroup;
|
|
17069
17107
|
records;
|
|
@@ -17370,7 +17408,7 @@ const Se = {
|
|
|
17370
17408
|
showBottom: !1,
|
|
17371
17409
|
edgeColor: "#d9ffff"
|
|
17372
17410
|
}
|
|
17373
|
-
},
|
|
17411
|
+
}, uc = {
|
|
17374
17412
|
background: "rgba(10, 18, 28, 0.92)",
|
|
17375
17413
|
color: "#ffffff",
|
|
17376
17414
|
border: "1px solid rgba(127, 252, 255, 0.72)",
|
|
@@ -17379,7 +17417,7 @@ const Se = {
|
|
|
17379
17417
|
boxShadow: "0 10px 30px rgba(0, 0, 0, 0.32)",
|
|
17380
17418
|
minWidth: "120px",
|
|
17381
17419
|
pointerEvents: "auto"
|
|
17382
|
-
},
|
|
17420
|
+
}, pc = "bim-engine-annotation3d-panels";
|
|
17383
17421
|
function Gt(l) {
|
|
17384
17422
|
return l.map((e) => ({ x: e.x, y: e.y, z: e.z }));
|
|
17385
17423
|
}
|
|
@@ -17390,7 +17428,7 @@ function Ht(l) {
|
|
|
17390
17428
|
const e = new d();
|
|
17391
17429
|
return l.length === 0 ? e : (l.forEach((t) => e.add(J(t))), e.multiplyScalar(1 / l.length));
|
|
17392
17430
|
}
|
|
17393
|
-
function
|
|
17431
|
+
function mc(l) {
|
|
17394
17432
|
const e = new d();
|
|
17395
17433
|
for (let t = 0; t < l.length; t += 1) {
|
|
17396
17434
|
const i = l[t], n = l[(t + 1) % l.length];
|
|
@@ -17400,7 +17438,7 @@ function pc(l) {
|
|
|
17400
17438
|
}
|
|
17401
17439
|
function Cs(l) {
|
|
17402
17440
|
const e = l.map((c) => J(c)), t = e[0].clone(), i = e.length > 1 ? e[1].clone().sub(t).normalize() : new d(1, 0, 0);
|
|
17403
|
-
let n =
|
|
17441
|
+
let n = mc(e);
|
|
17404
17442
|
n.lengthSq() < 1e-8 && (n = new d(0, 1, 0));
|
|
17405
17443
|
const s = new d().crossVectors(n, i).normalize(), o = new d().crossVectors(s, n).normalize(), r = e.map((c) => {
|
|
17406
17444
|
const h = c.clone().sub(t);
|
|
@@ -17418,12 +17456,12 @@ function As(l) {
|
|
|
17418
17456
|
e.lineTo(t.x, t.y);
|
|
17419
17457
|
}), e.closePath(), e;
|
|
17420
17458
|
}
|
|
17421
|
-
function
|
|
17459
|
+
function gc(l, e) {
|
|
17422
17460
|
l.traverse((t) => {
|
|
17423
17461
|
t.userData = t.userData ?? {}, t.userData.annotationId = e;
|
|
17424
17462
|
});
|
|
17425
17463
|
}
|
|
17426
|
-
function
|
|
17464
|
+
function fc(l) {
|
|
17427
17465
|
l.traverse((e) => {
|
|
17428
17466
|
const t = e;
|
|
17429
17467
|
t.geometry?.dispose?.();
|
|
@@ -17435,13 +17473,13 @@ function gc(l) {
|
|
|
17435
17473
|
i?.dispose?.();
|
|
17436
17474
|
});
|
|
17437
17475
|
}
|
|
17438
|
-
function
|
|
17476
|
+
function yc(l) {
|
|
17439
17477
|
return l.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
17440
17478
|
}
|
|
17441
|
-
function
|
|
17479
|
+
function Mc(l) {
|
|
17442
17480
|
return l === "polyline" || l === "curve3d" ? "center" : l === "polygon" ? "centroid" : "top";
|
|
17443
17481
|
}
|
|
17444
|
-
class
|
|
17482
|
+
class vc {
|
|
17445
17483
|
render(e) {
|
|
17446
17484
|
const t = e.instance.style.leaderPoint ?? {}, i = t.strokeColor || e.instance.style.color || "#7ffcff", n = t.backgroundColor || e.instance.style.fillColor || i, s = t.borderColor || i, o = t.anchorColor || n, r = t.anchorRingColor || i, a = t.iconBackgroundColor || n, c = t.side ?? "right", h = t.icon ? this.escapeXmlAttribute(t.icon) : "", u = Math.max(t.iconWidth ?? 22, 1), p = Math.max(t.iconHeight ?? 22, 1), g = (t.text ?? "").trim(), f = Math.max(t.fontSize ?? 14, 10), x = t.textColor || e.instance.style.color || "#ffffff", w = t.fontWeight ?? 500, m = Math.max(Math.round((t.height ?? 8) * 12), 48), b = Math.max(Math.round(Math.abs(t.offsetX ?? t.armLength ?? 4) * 18), 56), C = this.getBoardWidth(e, g, f), S = Math.max(Math.round((t.boardHeight ?? 1.8) * 22), f + 18, 34), P = Math.max(Math.round((t.stemWidth ?? e.instance.style.lineWidth ?? 0.12) * 20), 2), I = t.borderWidth ?? 2.5, B = t.variant ?? "elbow", k = c === "right" ? 22 + b - 8 : 22 - b - C + 8, O = 8, q = Math.min(22, k) - 16, te = Math.max(22, k + C) + 16, Q = Math.max(te - q, 140), ce = Math.max(m + S + 36, 120), ae = 22 - q, le = k - q, ue = ce - 18, Ee = Math.max(ue - m, 14), y = c === "right" ? le : le + C, M = O + Math.round(S * 0.5), E = B === "vertical" ? [`${ae},${ue}`, `${ae},${Ee}`] : [`${ae},${ue}`, `${ae},${M}`, `${y},${M}`], _ = e.instance.selectable !== !1, D = _ ? "visiblePainted" : "none", T = _ ? "pointer" : "default", H = le + (h || !g ? 38 : 12), V = t.showBoard === !1 ? "" : `
|
|
17447
17485
|
<rect x="${le}" y="${O}" width="${C}" height="${S}" rx="10"
|
|
@@ -17495,7 +17533,7 @@ class Mc {
|
|
|
17495
17533
|
return Math.max(Math.round((n.boardWidth ?? 4.6) * 22), Math.ceil(r), 78);
|
|
17496
17534
|
}
|
|
17497
17535
|
}
|
|
17498
|
-
class
|
|
17536
|
+
class xc {
|
|
17499
17537
|
/** 按标记类型重建内容,并返回相对三维锚点的布局参数。 */
|
|
17500
17538
|
render(e, t) {
|
|
17501
17539
|
const i = t.instance.type === "iconPoint" ? t.instance.style.iconPoint ?? {} : t.instance.type === "textPoint" ? t.instance.style.textPoint ?? {} : t.instance.style.iconTextPoint ?? {}, n = JSON.stringify({
|
|
@@ -17568,10 +17606,10 @@ class vc {
|
|
|
17568
17606
|
return `rgba(${r >> 16 & 255}, ${r >> 8 & 255}, ${r & 255}, ${i})`;
|
|
17569
17607
|
}
|
|
17570
17608
|
}
|
|
17571
|
-
const
|
|
17572
|
-
class
|
|
17609
|
+
const wc = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]), bc = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint", "ripplePoint", "pillarPoint", "leaderPoint"]);
|
|
17610
|
+
class Cc {
|
|
17573
17611
|
constructor(e, t) {
|
|
17574
|
-
this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className =
|
|
17612
|
+
this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className = pc, this.container.style.cssText = [
|
|
17575
17613
|
"position:absolute",
|
|
17576
17614
|
"left:0",
|
|
17577
17615
|
"top:0",
|
|
@@ -17584,8 +17622,8 @@ class bc {
|
|
|
17584
17622
|
}
|
|
17585
17623
|
container;
|
|
17586
17624
|
worldToScreen;
|
|
17587
|
-
leaderMarker = new
|
|
17588
|
-
pointContentMarker = new
|
|
17625
|
+
leaderMarker = new vc();
|
|
17626
|
+
pointContentMarker = new xc();
|
|
17589
17627
|
updateProjectionState() {
|
|
17590
17628
|
this.worldToScreen.updateCamera(this.engine.camera), this.worldToScreen.updateRenderer(this.engine.renderer), this.worldToScreen.updateScene(this.engine.scene);
|
|
17591
17629
|
}
|
|
@@ -17598,7 +17636,7 @@ class bc {
|
|
|
17598
17636
|
"transform:translate(-50%, -100%)",
|
|
17599
17637
|
"display:none",
|
|
17600
17638
|
t.interactive === !1 ? "pointer-events:none" : "pointer-events:auto"
|
|
17601
|
-
].join(";"), t.mode === "html" ? i.innerHTML = t.html ?? "" : i.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([n, s]) => i.style.setProperty(
|
|
17639
|
+
].join(";"), t.mode === "html" ? i.innerHTML = t.html ?? "" : i.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([n, s]) => i.style.setProperty(yc(n), s)), i;
|
|
17602
17640
|
}
|
|
17603
17641
|
createLeaderMarkerElement(e) {
|
|
17604
17642
|
const t = document.createElement("div");
|
|
@@ -17610,7 +17648,7 @@ class bc {
|
|
|
17610
17648
|
return t.className = "bim-annotation3d-marker bim-annotation3d-point-marker", t.dataset.annotationId = e.id, t.style.cssText = ["position:absolute", "left:0", "top:0", "display:none", "pointer-events:none"].join(";"), t;
|
|
17611
17649
|
}
|
|
17612
17650
|
updateRecord(e) {
|
|
17613
|
-
if (e.markerElement && e.instance.type === "leaderPoint" ? this.updateLeaderMarker(e) : e.markerElement &&
|
|
17651
|
+
if (e.markerElement && e.instance.type === "leaderPoint" ? this.updateLeaderMarker(e) : e.markerElement && wc.has(e.instance.type) && this.updatePointMarker(e), !e.panelElement || !e.instance.panel)
|
|
17614
17652
|
return;
|
|
17615
17653
|
const t = e.instance.panel;
|
|
17616
17654
|
if (!(t.visible !== !1 && this.shouldShowPanel(e)) || !e.instance.visible) {
|
|
@@ -17669,9 +17707,9 @@ class bc {
|
|
|
17669
17707
|
const t = e.instance.panel?.offset ?? {};
|
|
17670
17708
|
if (e.panelAnchorPoint)
|
|
17671
17709
|
return e.panelAnchorPoint.clone().add(new d(t.x ?? 0, t.y ?? 0, t.z ?? 0));
|
|
17672
|
-
const i = e.instance.panel?.anchor ??
|
|
17710
|
+
const i = e.instance.panel?.anchor ?? Mc(e.instance.type);
|
|
17673
17711
|
let n = new d();
|
|
17674
|
-
if (
|
|
17712
|
+
if (bc.has(e.instance.type))
|
|
17675
17713
|
n.copy(J(e.instance.points[0])), i === "top" && (n.y += e.volumeHeight ?? 0);
|
|
17676
17714
|
else if (e.instance.type === "polyline" || e.instance.type === "curve3d")
|
|
17677
17715
|
i === "start" ? n.copy(J(e.instance.points[0])) : i === "end" ? n.copy(J(e.instance.points[e.instance.points.length - 1])) : e.anchorCurve ? n.copy(e.anchorCurve.getPoint(0.5)) : n.copy(Ht(e.instance.points));
|
|
@@ -17686,14 +17724,14 @@ class bc {
|
|
|
17686
17724
|
return n.add(new d(t.x ?? 0, t.y ?? 0, t.z ?? 0)), n;
|
|
17687
17725
|
}
|
|
17688
17726
|
}
|
|
17689
|
-
class
|
|
17727
|
+
class Ac {
|
|
17690
17728
|
apply(e, t) {
|
|
17691
17729
|
e.instance.root.visible = e.instance.visible, e.instance.style.alwaysOnTop && e.instance.root.traverse((i) => {
|
|
17692
17730
|
i.renderOrder = Math.max(i.renderOrder, 1200);
|
|
17693
17731
|
}), t(e);
|
|
17694
17732
|
}
|
|
17695
17733
|
}
|
|
17696
|
-
class
|
|
17734
|
+
class Ec {
|
|
17697
17735
|
constructor(e) {
|
|
17698
17736
|
this.engine = e;
|
|
17699
17737
|
}
|
|
@@ -17853,7 +17891,7 @@ class Ue {
|
|
|
17853
17891
|
createTubeMesh(e, t, i, n, s, o, r = 10, a = !1) {
|
|
17854
17892
|
const c = new eo(t, i, n, r, a);
|
|
17855
17893
|
c.computeBoundingBox();
|
|
17856
|
-
const h = c.boundingBox ?? new
|
|
17894
|
+
const h = c.boundingBox ?? new z(new d(0, 0, 0), new d(1, 1, 1)), u = this.materialFactory.createSurfaceMaterial({
|
|
17857
17895
|
color: s.color ?? "#7ffcff",
|
|
17858
17896
|
opacity: s.opacity ?? 0.92,
|
|
17859
17897
|
style: s,
|
|
@@ -17861,7 +17899,7 @@ class Ue {
|
|
|
17861
17899
|
axisMode: "uvx",
|
|
17862
17900
|
axisMin: h.min.x,
|
|
17863
17901
|
axisMax: h.max.x
|
|
17864
|
-
}), p = new
|
|
17902
|
+
}), p = new R(c, u);
|
|
17865
17903
|
return e.animatedMaterials.push(u), p;
|
|
17866
17904
|
}
|
|
17867
17905
|
createLoopLine(e, t, i) {
|
|
@@ -17876,14 +17914,14 @@ class Ue {
|
|
|
17876
17914
|
return o.renderOrder = 998, o;
|
|
17877
17915
|
}
|
|
17878
17916
|
}
|
|
17879
|
-
class
|
|
17917
|
+
class Sc extends Ue {
|
|
17880
17918
|
type = "box";
|
|
17881
17919
|
build(e) {
|
|
17882
17920
|
if (e.instance.points.length < 2)
|
|
17883
17921
|
return;
|
|
17884
17922
|
const t = J(e.instance.points[0]), i = J(e.instance.points[1]), n = t.clone().min(i), s = t.clone().max(i), o = s.clone().sub(n), r = n.clone().add(s).multiplyScalar(0.5), a = new Ct(o.x || 0.1, o.y || 0.1, o.z || 0.1);
|
|
17885
17923
|
a.computeBoundingBox();
|
|
17886
|
-
const c = a.boundingBox ?? new
|
|
17924
|
+
const c = a.boundingBox ?? new z(
|
|
17887
17925
|
new d(-0.5, -0.5, -0.5),
|
|
17888
17926
|
new d(0.5, 0.5, 0.5)
|
|
17889
17927
|
), h = this.materialFactory.createSurfaceMaterial({
|
|
@@ -17894,7 +17932,7 @@ class Ec extends Ue {
|
|
|
17894
17932
|
axisMode: "y",
|
|
17895
17933
|
axisMin: c.min.y,
|
|
17896
17934
|
axisMax: c.max.y
|
|
17897
|
-
}), u = new
|
|
17935
|
+
}), u = new R(a, h);
|
|
17898
17936
|
u.position.copy(r), e.instance.root.add(u);
|
|
17899
17937
|
const p = new He({
|
|
17900
17938
|
color: e.instance.style.volume?.edgeColor ?? "#d9ffff",
|
|
@@ -17907,7 +17945,7 @@ class Ec extends Ue {
|
|
|
17907
17945
|
g.position.copy(r), e.instance.root.add(g), e.volumeHeight = o.y, e.animatedMaterials.push(h);
|
|
17908
17946
|
}
|
|
17909
17947
|
}
|
|
17910
|
-
class
|
|
17948
|
+
class Pc extends Ue {
|
|
17911
17949
|
type = "curve3d";
|
|
17912
17950
|
build(e) {
|
|
17913
17951
|
const t = e.instance.points.map((r) => J(r)), i = e.instance.style.curve ?? {}, n = i.interpolation ?? "catmullRom", s = new no(
|
|
@@ -17928,7 +17966,7 @@ class Sc extends Ue {
|
|
|
17928
17966
|
e.instance.root.add(o), e.anchorCurve = s, e.panelAnchorPoint = s.getPoint(0.5);
|
|
17929
17967
|
}
|
|
17930
17968
|
}
|
|
17931
|
-
class
|
|
17969
|
+
class Tc extends Ue {
|
|
17932
17970
|
type = "extrudePolygon";
|
|
17933
17971
|
build(e) {
|
|
17934
17972
|
const t = Cs(e.instance.points), i = As(t.localPoints), n = e.instance.style.volume?.height ?? 10, s = new Hn(i, {
|
|
@@ -17938,7 +17976,7 @@ class Pc extends Ue {
|
|
|
17938
17976
|
curveSegments: 24
|
|
17939
17977
|
});
|
|
17940
17978
|
s.computeBoundingBox();
|
|
17941
|
-
const o = s.boundingBox ?? new
|
|
17979
|
+
const o = s.boundingBox ?? new z(new d(0, 0, 0), new d(1, 1, 1)), r = this.materialFactory.createSurfaceMaterial({
|
|
17942
17980
|
color: e.instance.style.fillColor ?? e.instance.style.color ?? "#7ffcff",
|
|
17943
17981
|
opacity: e.instance.style.fillOpacity ?? 0.22,
|
|
17944
17982
|
style: e.instance.style,
|
|
@@ -17946,7 +17984,7 @@ class Pc extends Ue {
|
|
|
17946
17984
|
axisMode: "z",
|
|
17947
17985
|
axisMin: o.min.z,
|
|
17948
17986
|
axisMax: o.max.z
|
|
17949
|
-
}), a = new
|
|
17987
|
+
}), a = new R(s, r);
|
|
17950
17988
|
a.applyMatrix4(t.matrix), e.instance.root.add(a), e.anchorNormal = t.normal, e.volumeHeight = n, this.appendLayerLoops(e, t.normal), e.instance.root.add(
|
|
17951
17989
|
this.createLoopLine(
|
|
17952
17990
|
e.instance.points,
|
|
@@ -17976,21 +18014,21 @@ class Wi extends Ue {
|
|
|
17976
18014
|
e.instance.root.position.copy(t), e.panelAnchorPoint = t.clone();
|
|
17977
18015
|
}
|
|
17978
18016
|
}
|
|
17979
|
-
class
|
|
18017
|
+
class Ic extends Wi {
|
|
17980
18018
|
type = "iconPoint";
|
|
17981
18019
|
/** 将图标点绑定到首个世界坐标。 */
|
|
17982
18020
|
build(e) {
|
|
17983
18021
|
this.buildDomAnchor(e);
|
|
17984
18022
|
}
|
|
17985
18023
|
}
|
|
17986
|
-
class
|
|
18024
|
+
class _c extends Wi {
|
|
17987
18025
|
type = "iconTextPoint";
|
|
17988
18026
|
/** 将图文组合点绑定到首个世界坐标。 */
|
|
17989
18027
|
build(e) {
|
|
17990
18028
|
this.buildDomAnchor(e);
|
|
17991
18029
|
}
|
|
17992
18030
|
}
|
|
17993
|
-
class
|
|
18031
|
+
class Dc extends Ue {
|
|
17994
18032
|
type = "leaderPoint";
|
|
17995
18033
|
build(e) {
|
|
17996
18034
|
const t = J(e.instance.points[0]), i = e.instance.style.leaderPoint ?? {}, n = Math.max(i.height ?? 8, 0.5), s = i.offsetX ?? i.armLength ?? 4, o = i.offsetZ ?? 0, r = this.createLeaderPathPoints(i.variant ?? "elbow", n, s, o), a = r[r.length - 1].clone();
|
|
@@ -18010,7 +18048,7 @@ class _c extends Ue {
|
|
|
18010
18048
|
];
|
|
18011
18049
|
}
|
|
18012
18050
|
}
|
|
18013
|
-
class
|
|
18051
|
+
class kc extends Ue {
|
|
18014
18052
|
type = "pillarPoint";
|
|
18015
18053
|
/** 根据光柱专属参数创建柱体与可选底环。 */
|
|
18016
18054
|
build(e) {
|
|
@@ -18047,7 +18085,7 @@ class Dc extends Ue {
|
|
|
18047
18085
|
axisMode: "y",
|
|
18048
18086
|
axisMin: -s * 0.5,
|
|
18049
18087
|
axisMax: s * 0.5
|
|
18050
|
-
}), c = new
|
|
18088
|
+
}), c = new R(o, a);
|
|
18051
18089
|
if (c.position.y = s * 0.5, e.instance.root.add(c), e.animatedMaterials.push(a), t.showBaseRing !== !1) {
|
|
18052
18090
|
const h = new oe({
|
|
18053
18091
|
color: t.baseRingColor ?? r,
|
|
@@ -18058,7 +18096,7 @@ class Dc extends Ue {
|
|
|
18058
18096
|
depthWrite: !1
|
|
18059
18097
|
});
|
|
18060
18098
|
h.clippingPlanes = this.engine.sectionPlane;
|
|
18061
|
-
const u = new
|
|
18099
|
+
const u = new R(
|
|
18062
18100
|
new Gn(
|
|
18063
18101
|
Math.max(t.baseRingInnerRadius ?? 1.9, 1e-3),
|
|
18064
18102
|
Math.max(t.baseRingOuterRadius ?? 2.4, (t.baseRingInnerRadius ?? 1.9) + 1e-3),
|
|
@@ -18070,12 +18108,12 @@ class Dc extends Ue {
|
|
|
18070
18108
|
}
|
|
18071
18109
|
}
|
|
18072
18110
|
}
|
|
18073
|
-
class
|
|
18111
|
+
class Lc extends Ue {
|
|
18074
18112
|
type = "polygon";
|
|
18075
18113
|
build(e) {
|
|
18076
18114
|
const t = Cs(e.instance.points), i = As(t.localPoints), n = new oo(i);
|
|
18077
18115
|
n.computeBoundingBox();
|
|
18078
|
-
const s = n.boundingBox ?? new
|
|
18116
|
+
const s = n.boundingBox ?? new z(new d(0, 0, 0), new d(1, 1, 1)), o = this.materialFactory.createSurfaceMaterial({
|
|
18079
18117
|
color: e.instance.style.fillColor ?? e.instance.style.color ?? "#7ffcff",
|
|
18080
18118
|
opacity: e.instance.style.fillOpacity ?? 0.18,
|
|
18081
18119
|
style: e.instance.style,
|
|
@@ -18083,7 +18121,7 @@ class kc extends Ue {
|
|
|
18083
18121
|
axisMode: "y",
|
|
18084
18122
|
axisMin: s.min.y,
|
|
18085
18123
|
axisMax: s.max.y
|
|
18086
|
-
}), r = new
|
|
18124
|
+
}), r = new R(n, o);
|
|
18087
18125
|
r.applyMatrix4(t.matrix), e.instance.root.add(r), e.anchorNormal = t.normal, e.instance.style.polygon?.showEdge !== !1 && e.instance.root.add(
|
|
18088
18126
|
this.createLoopLine(
|
|
18089
18127
|
e.instance.points,
|
|
@@ -18093,7 +18131,7 @@ class kc extends Ue {
|
|
|
18093
18131
|
), e.animatedMaterials.push(o);
|
|
18094
18132
|
}
|
|
18095
18133
|
}
|
|
18096
|
-
class
|
|
18134
|
+
class Bc extends Ue {
|
|
18097
18135
|
type = "polyline";
|
|
18098
18136
|
build(e) {
|
|
18099
18137
|
const t = e.instance.points.map((s) => J(s)), i = this.createSegmentCurve(t), n = this.createTubeMesh(
|
|
@@ -18107,7 +18145,7 @@ class Lc extends Ue {
|
|
|
18107
18145
|
e.instance.root.add(n), e.anchorCurve = i, e.panelAnchorPoint = i.getPoint(0.5);
|
|
18108
18146
|
}
|
|
18109
18147
|
}
|
|
18110
|
-
class
|
|
18148
|
+
class zc extends Ue {
|
|
18111
18149
|
type = "ripplePoint";
|
|
18112
18150
|
/** 根据波纹参数创建中心点和错相扩散圆环。 */
|
|
18113
18151
|
build(e) {
|
|
@@ -18121,7 +18159,7 @@ class Bc extends Ue {
|
|
|
18121
18159
|
depthWrite: !1
|
|
18122
18160
|
});
|
|
18123
18161
|
c.clippingPlanes = this.engine.sectionPlane;
|
|
18124
|
-
const h = new
|
|
18162
|
+
const h = new R(
|
|
18125
18163
|
new Yt(Math.max(t.centerRadius ?? 0.28, 0.01), 20, 16),
|
|
18126
18164
|
c
|
|
18127
18165
|
);
|
|
@@ -18138,7 +18176,7 @@ class Bc extends Ue {
|
|
|
18138
18176
|
depthWrite: !1
|
|
18139
18177
|
});
|
|
18140
18178
|
h.clippingPlanes = this.engine.sectionPlane;
|
|
18141
|
-
const u = new
|
|
18179
|
+
const u = new R(
|
|
18142
18180
|
new Gn(Math.max(o - r, 1e-3), o, a),
|
|
18143
18181
|
h
|
|
18144
18182
|
);
|
|
@@ -18146,29 +18184,29 @@ class Bc extends Ue {
|
|
|
18146
18184
|
}
|
|
18147
18185
|
}
|
|
18148
18186
|
}
|
|
18149
|
-
class
|
|
18187
|
+
class Rc extends Wi {
|
|
18150
18188
|
type = "textPoint";
|
|
18151
18189
|
/** 将文字点绑定到首个世界坐标。 */
|
|
18152
18190
|
build(e) {
|
|
18153
18191
|
this.buildDomAnchor(e);
|
|
18154
18192
|
}
|
|
18155
18193
|
}
|
|
18156
|
-
function
|
|
18194
|
+
function Oc(l, e) {
|
|
18157
18195
|
return [
|
|
18158
|
-
new Tc(l, e),
|
|
18159
|
-
new zc(l, e),
|
|
18160
18196
|
new Ic(l, e),
|
|
18161
|
-
new
|
|
18162
|
-
new Dc(l, e),
|
|
18197
|
+
new Rc(l, e),
|
|
18163
18198
|
new _c(l, e),
|
|
18164
|
-
new
|
|
18165
|
-
new Sc(l, e),
|
|
18199
|
+
new zc(l, e),
|
|
18166
18200
|
new kc(l, e),
|
|
18201
|
+
new Dc(l, e),
|
|
18202
|
+
new Bc(l, e),
|
|
18167
18203
|
new Pc(l, e),
|
|
18168
|
-
new
|
|
18204
|
+
new Lc(l, e),
|
|
18205
|
+
new Tc(l, e),
|
|
18206
|
+
new Sc(l, e)
|
|
18169
18207
|
];
|
|
18170
18208
|
}
|
|
18171
|
-
function
|
|
18209
|
+
function Fc(l, e, t) {
|
|
18172
18210
|
const i = l.camera;
|
|
18173
18211
|
if (!i)
|
|
18174
18212
|
return !1;
|
|
@@ -18181,7 +18219,7 @@ function Oc(l, e, t) {
|
|
|
18181
18219
|
const r = o.sort((a, c) => a.distance - c.distance)[0];
|
|
18182
18220
|
return !!(r && r.distance < s - 0.05);
|
|
18183
18221
|
}
|
|
18184
|
-
class
|
|
18222
|
+
class Nc {
|
|
18185
18223
|
/** 归一化外部数据,并在创建几何前校验类型对应的必要输入。 */
|
|
18186
18224
|
normalizeData(e) {
|
|
18187
18225
|
const t = {
|
|
@@ -18315,7 +18353,7 @@ class Fc {
|
|
|
18315
18353
|
offset: { ...e.offset ?? {} },
|
|
18316
18354
|
screenOffset: { ...e.screenOffset ?? {} },
|
|
18317
18355
|
className: e.className,
|
|
18318
|
-
style: { ...
|
|
18356
|
+
style: { ...uc, ...e.style ?? {} },
|
|
18319
18357
|
interactive: e.interactive ?? !0,
|
|
18320
18358
|
occlusion: e.occlusion ?? "show",
|
|
18321
18359
|
actions: e.actions
|
|
@@ -18354,11 +18392,11 @@ class Fc {
|
|
|
18354
18392
|
}
|
|
18355
18393
|
}
|
|
18356
18394
|
}
|
|
18357
|
-
function
|
|
18395
|
+
function Hc(l) {
|
|
18358
18396
|
const { actions: e, ...t } = l;
|
|
18359
18397
|
return t;
|
|
18360
18398
|
}
|
|
18361
|
-
function
|
|
18399
|
+
function Vc(l) {
|
|
18362
18400
|
return {
|
|
18363
18401
|
id: l.instance.id,
|
|
18364
18402
|
type: l.instance.type,
|
|
@@ -18374,7 +18412,7 @@ function Hc(l) {
|
|
|
18374
18412
|
function Vt(l) {
|
|
18375
18413
|
return l === void 0 ? l : JSON.parse(JSON.stringify(l));
|
|
18376
18414
|
}
|
|
18377
|
-
class
|
|
18415
|
+
class Uc {
|
|
18378
18416
|
builders = /* @__PURE__ */ new Map();
|
|
18379
18417
|
constructor(e) {
|
|
18380
18418
|
e.forEach((t) => this.builders.set(t.type, t));
|
|
@@ -18386,8 +18424,8 @@ class Vc {
|
|
|
18386
18424
|
t.build(e);
|
|
18387
18425
|
}
|
|
18388
18426
|
}
|
|
18389
|
-
const
|
|
18390
|
-
class
|
|
18427
|
+
const Wc = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]);
|
|
18428
|
+
class Gc {
|
|
18391
18429
|
constructor(e, t) {
|
|
18392
18430
|
this.markerRegistry = e, this.overlayController = t;
|
|
18393
18431
|
}
|
|
@@ -18402,7 +18440,7 @@ class Wc {
|
|
|
18402
18440
|
selectable: e.selectable ?? !0,
|
|
18403
18441
|
style: e.style,
|
|
18404
18442
|
effect: e.effect ?? {},
|
|
18405
|
-
panel: e.panel ?
|
|
18443
|
+
panel: e.panel ? Hc(e.panel) : void 0,
|
|
18406
18444
|
data: e.data,
|
|
18407
18445
|
panelVisible: e.panel?.trigger === "always",
|
|
18408
18446
|
hovered: !1,
|
|
@@ -18411,37 +18449,37 @@ class Wc {
|
|
|
18411
18449
|
instance: i,
|
|
18412
18450
|
actions: e.panel?.actions,
|
|
18413
18451
|
panelElement: e.panel ? this.overlayController.createPanelElement(i, e.panel) : null,
|
|
18414
|
-
markerElement: e.type === "leaderPoint" ? this.overlayController.createLeaderMarkerElement(i) :
|
|
18452
|
+
markerElement: e.type === "leaderPoint" ? this.overlayController.createLeaderMarkerElement(i) : Wc.has(e.type) ? this.overlayController.createPointMarkerElement(i) : null,
|
|
18415
18453
|
timeSeed: Math.random() * Math.PI * 2,
|
|
18416
18454
|
pulseMaterials: [],
|
|
18417
18455
|
rippleMeshes: [],
|
|
18418
18456
|
baseRingMeshes: [],
|
|
18419
18457
|
animatedMaterials: []
|
|
18420
18458
|
};
|
|
18421
|
-
return this.markerRegistry.build(n),
|
|
18459
|
+
return this.markerRegistry.build(n), gc(t, i.id), n;
|
|
18422
18460
|
}
|
|
18423
18461
|
}
|
|
18424
|
-
class
|
|
18462
|
+
class qc {
|
|
18425
18463
|
engine;
|
|
18426
18464
|
rootGroup;
|
|
18427
18465
|
records = /* @__PURE__ */ new Map();
|
|
18428
18466
|
occlusionRaycaster = new fe();
|
|
18429
|
-
normalizer = new
|
|
18467
|
+
normalizer = new Nc();
|
|
18430
18468
|
materialFactory;
|
|
18431
18469
|
overlayController;
|
|
18432
18470
|
interactionController;
|
|
18433
18471
|
effectsController;
|
|
18434
|
-
visibilityController = new
|
|
18472
|
+
visibilityController = new Ac();
|
|
18435
18473
|
markerRegistry;
|
|
18436
18474
|
recordFactory;
|
|
18437
18475
|
currentTime = 0;
|
|
18438
18476
|
constructor(e) {
|
|
18439
|
-
this.engine = e, this.rootGroup = new de(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new
|
|
18477
|
+
this.engine = e, this.rootGroup = new de(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new Ec(this.engine), this.overlayController = new Cc(
|
|
18440
18478
|
this.engine,
|
|
18441
|
-
(t) =>
|
|
18442
|
-
), this.markerRegistry = new
|
|
18443
|
-
|
|
18444
|
-
), this.recordFactory = new
|
|
18479
|
+
(t) => Fc(this.engine, this.occlusionRaycaster, t)
|
|
18480
|
+
), this.markerRegistry = new Uc(
|
|
18481
|
+
Oc(this.engine, this.materialFactory)
|
|
18482
|
+
), this.recordFactory = new Gc(this.markerRegistry, this.overlayController), this.effectsController = new hc(), this.interactionController = new dc({
|
|
18445
18483
|
engine: this.engine,
|
|
18446
18484
|
rootGroup: this.rootGroup,
|
|
18447
18485
|
records: this.records,
|
|
@@ -18542,7 +18580,7 @@ class Gc {
|
|
|
18542
18580
|
return this.update(e, { panel: n });
|
|
18543
18581
|
}
|
|
18544
18582
|
getData() {
|
|
18545
|
-
return Array.from(this.records.values()).map((e) =>
|
|
18583
|
+
return Array.from(this.records.values()).map((e) => Vc(e));
|
|
18546
18584
|
}
|
|
18547
18585
|
restoreData(e) {
|
|
18548
18586
|
this.clear(), e.forEach((t) => this.add(t));
|
|
@@ -18560,7 +18598,7 @@ class Gc {
|
|
|
18560
18598
|
}
|
|
18561
18599
|
removeInternal(e, t) {
|
|
18562
18600
|
const i = this.records.get(e);
|
|
18563
|
-
return i ? (this.interactionController.handleRecordRemoved(e),
|
|
18601
|
+
return i ? (this.interactionController.handleRecordRemoved(e), fc(i.instance.root), i.instance.root.removeFromParent(), i.panelElement?.remove(), i.markerElement?.remove(), this.records.delete(e), t && this.emit("annotation3d-removed", { id: e }), !0) : !1;
|
|
18564
18602
|
}
|
|
18565
18603
|
toEventPayload(e, t) {
|
|
18566
18604
|
return { id: e.instance.id, annotation: e.instance, originalEvent: t };
|
|
@@ -18839,7 +18877,7 @@ class lt {
|
|
|
18839
18877
|
min: i.boundingBox.min.clone(),
|
|
18840
18878
|
max: i.boundingBox.max.clone()
|
|
18841
18879
|
});
|
|
18842
|
-
const n = new
|
|
18880
|
+
const n = new z(
|
|
18843
18881
|
i.localBoundingBox.min.clone(),
|
|
18844
18882
|
i.localBoundingBox.max.clone()
|
|
18845
18883
|
);
|
|
@@ -18850,7 +18888,7 @@ class lt {
|
|
|
18850
18888
|
}
|
|
18851
18889
|
clearRuntimeWorldBoxCache(e) {
|
|
18852
18890
|
e.traverse((t) => {
|
|
18853
|
-
t?.box instanceof
|
|
18891
|
+
t?.box instanceof z && delete t.box;
|
|
18854
18892
|
});
|
|
18855
18893
|
}
|
|
18856
18894
|
toThreeMatrix(e) {
|
|
@@ -18895,8 +18933,8 @@ class lt {
|
|
|
18895
18933
|
return "x" in e ? new d(e.x, e.y, e.z) : new d(e.X, e.Y, e.Z);
|
|
18896
18934
|
}
|
|
18897
18935
|
}
|
|
18898
|
-
const
|
|
18899
|
-
class
|
|
18936
|
+
const Kc = 1e-3, jc = 0.65, Yc = 1;
|
|
18937
|
+
class Xc {
|
|
18900
18938
|
engine;
|
|
18901
18939
|
loader;
|
|
18902
18940
|
dracoLoader;
|
|
@@ -19208,7 +19246,7 @@ class Yc {
|
|
|
19208
19246
|
}
|
|
19209
19247
|
/** 透视相机使用更小的屏幕尺寸系数,正交相机维持原有尺寸。 */
|
|
19210
19248
|
syncTransformControlCamera() {
|
|
19211
|
-
!this.transformControl || !this.engine.camera || (this.transformControl.camera = this.engine.camera, this.transformControl.size = this.engine.camera.isPerspectiveCamera ?
|
|
19249
|
+
!this.transformControl || !this.engine.camera || (this.transformControl.camera = this.engine.camera, this.transformControl.size = this.engine.camera.isPerspectiveCamera ? jc : Yc);
|
|
19212
19250
|
}
|
|
19213
19251
|
/** 使用引擎统一的捕捉器等待用户单击,并在取消或完成后恢复常规交互。 */
|
|
19214
19252
|
pickPlacementPoint(e, t) {
|
|
@@ -19247,7 +19285,7 @@ class Yc {
|
|
|
19247
19285
|
const i = t.clone(), n = e?.normal ?? e?.face?.normal;
|
|
19248
19286
|
if (n == null) return { position: i, normal: null };
|
|
19249
19287
|
const s = n.clone(), o = e?.matrix ?? e?.object?.matrixWorld;
|
|
19250
|
-
return o && s.transformDirection(o), s.lengthSq() < 1e-10 ? { position: i, normal: null } : (s.normalize(), i.addScaledVector(s,
|
|
19288
|
+
return o && s.transformDirection(o), s.lengthSq() < 1e-10 ? { position: i, normal: null } : (s.normalize(), i.addScaledVector(s, Kc), { position: i, normal: s });
|
|
19251
19289
|
}
|
|
19252
19290
|
handlePointerDown(e) {
|
|
19253
19291
|
if (!(!this.editingEnabled || !this.engine.camera || !this.engine.renderer)) {
|
|
@@ -19401,7 +19439,7 @@ class Yc {
|
|
|
19401
19439
|
}
|
|
19402
19440
|
}
|
|
19403
19441
|
const kn = "__modelExplodeProxy", Ln = new F().makeScale(0, 0, 0);
|
|
19404
|
-
class
|
|
19442
|
+
class Qc {
|
|
19405
19443
|
engine;
|
|
19406
19444
|
/** 当前是否处于炸开模式;供外部滑块、交互模块判断是否需要走代理逻辑。 */
|
|
19407
19445
|
active = !1;
|
|
@@ -19544,10 +19582,10 @@ class Xc {
|
|
|
19544
19582
|
* 这里以代理对象的实时 matrixWorld 为准,因此滑块拖动和动画过程中也能得到正确位置。
|
|
19545
19583
|
*/
|
|
19546
19584
|
getExplodedWorldBox(e, t) {
|
|
19547
|
-
const i = new
|
|
19585
|
+
const i = new z().makeEmpty();
|
|
19548
19586
|
let n = !1;
|
|
19549
19587
|
return this.records.forEach((s) => {
|
|
19550
|
-
s.url !== e || !this.isSameId(s.id, t) || !s.proxy.visible || (s.proxy.updateWorldMatrix(!0, !1), i.union(new
|
|
19588
|
+
s.url !== e || !this.isSameId(s.id, t) || !s.proxy.visible || (s.proxy.updateWorldMatrix(!0, !1), i.union(new z().setFromObject(s.proxy)), n = !0);
|
|
19551
19589
|
}), n && !i.isEmpty() ? i : null;
|
|
19552
19590
|
}
|
|
19553
19591
|
/**
|
|
@@ -19581,7 +19619,7 @@ class Xc {
|
|
|
19581
19619
|
* 这里提前缓存整体包围盒、模型中心和分组包围盒,避免每个构件重复遍历 nodesMap。
|
|
19582
19620
|
*/
|
|
19583
19621
|
buildExplodeContext(e, t) {
|
|
19584
|
-
const i = new
|
|
19622
|
+
const i = new z().makeEmpty(), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
19585
19623
|
return e.forEach((r) => {
|
|
19586
19624
|
const a = this.getEngineModel(r.url), c = this.getModelWorldBox(a);
|
|
19587
19625
|
c != null && !c.isEmpty() && (s.set(r.url, c.getCenter(new d())), o.set(r.url, Math.max(1, c.getSize(new d()).length()))), r.ids.forEach((h) => {
|
|
@@ -19590,7 +19628,7 @@ class Xc {
|
|
|
19590
19628
|
return;
|
|
19591
19629
|
i.union(p);
|
|
19592
19630
|
const g = this.getGroupKey(r.url, h, t.mode);
|
|
19593
|
-
n.has(g) || n.set(g, new
|
|
19631
|
+
n.has(g) || n.set(g, new z().makeEmpty()), n.get(g)?.union(p);
|
|
19594
19632
|
});
|
|
19595
19633
|
}), {
|
|
19596
19634
|
box: i,
|
|
@@ -19636,8 +19674,8 @@ class Xc {
|
|
|
19636
19674
|
createRecord(e, t, i, n) {
|
|
19637
19675
|
if (!Array.isArray(i) || i.length < 2)
|
|
19638
19676
|
return;
|
|
19639
|
-
const s =
|
|
19640
|
-
if (!(s instanceof
|
|
19677
|
+
const s = Be(this.engine, i[0]);
|
|
19678
|
+
if (!(s instanceof R))
|
|
19641
19679
|
return;
|
|
19642
19680
|
const o = s instanceof W ? "instance" : "mesh", r = o === "instance" ? this.createInstanceProxy(s, i[1], e, t) : this.createMeshProxy(s, i[1], e, t);
|
|
19643
19681
|
if (r == null)
|
|
@@ -19664,7 +19702,7 @@ class Xc {
|
|
|
19664
19702
|
const s = Array.isArray(e.geometrys) ? e.geometrys[t] : null;
|
|
19665
19703
|
if (!(s instanceof ge))
|
|
19666
19704
|
return null;
|
|
19667
|
-
const o = new
|
|
19705
|
+
const o = new R(s.clone(), this.cloneProxyMaterial(e.material));
|
|
19668
19706
|
return o.geometry.computeVertexNormals(), o.castShadow = e.castShadow === !0, o.receiveShadow = e.receiveShadow === !0, this.assignProxyIdentity(o, i, n), (e.parent ?? this.engine.scene).add(o), o;
|
|
19669
19707
|
}
|
|
19670
19708
|
/**
|
|
@@ -19679,7 +19717,7 @@ class Xc {
|
|
|
19679
19717
|
return null;
|
|
19680
19718
|
const o = e.geometry.clone();
|
|
19681
19719
|
o.applyMatrix4(s);
|
|
19682
|
-
const r = new
|
|
19720
|
+
const r = new R(o, this.cloneProxyMaterial(e.material));
|
|
19683
19721
|
return r.geometry.computeVertexNormals(), r.castShadow = e.castShadow === !0, r.receiveShadow = e.receiveShadow === !0, this.assignProxyIdentity(r, i, n), (e.parent ?? this.engine.scene).add(r), r;
|
|
19684
19722
|
}
|
|
19685
19723
|
/** 给代理对象写入稳定交互身份,避免依赖 name 的字符串化 id。 */
|
|
@@ -19824,17 +19862,17 @@ class Xc {
|
|
|
19824
19862
|
...Array.isArray(t?.infos) ? t.infos.map((o) => o?.box) : [],
|
|
19825
19863
|
t?.info?.box,
|
|
19826
19864
|
t?.box
|
|
19827
|
-
].filter((o) => o instanceof
|
|
19865
|
+
].filter((o) => o instanceof z && !o.isEmpty());
|
|
19828
19866
|
if (i.length === 0)
|
|
19829
19867
|
return null;
|
|
19830
|
-
const n =
|
|
19868
|
+
const n = De(this.engine, e.url), s = new z().makeEmpty();
|
|
19831
19869
|
return i.forEach((o) => s.union(o.clone().applyMatrix4(n))), s.isEmpty() ? null : s;
|
|
19832
19870
|
}
|
|
19833
19871
|
/** 计算单个模型在世界坐标下的整体包围盒,作为默认爆炸原点的依据。 */
|
|
19834
19872
|
getModelWorldBox(e) {
|
|
19835
19873
|
if (e?.nodesMap == null)
|
|
19836
19874
|
return null;
|
|
19837
|
-
const t = new
|
|
19875
|
+
const t = new z().makeEmpty();
|
|
19838
19876
|
return e.nodesMap.forEach((i) => {
|
|
19839
19877
|
const n = this.getNodeWorldBox(e, i);
|
|
19840
19878
|
n != null && !n.isEmpty() && t.union(n);
|
|
@@ -19916,7 +19954,7 @@ class Xc {
|
|
|
19916
19954
|
return Math.abs(i);
|
|
19917
19955
|
}
|
|
19918
19956
|
}
|
|
19919
|
-
class
|
|
19957
|
+
class $c {
|
|
19920
19958
|
engine;
|
|
19921
19959
|
codeMap = [];
|
|
19922
19960
|
continusIds = /* @__PURE__ */ new Map();
|
|
@@ -20017,16 +20055,16 @@ const Ut = {
|
|
|
20017
20055
|
sampleCount: 64,
|
|
20018
20056
|
roundedRadius: 1,
|
|
20019
20057
|
historyLimit: 100
|
|
20020
|
-
},
|
|
20058
|
+
}, Zc = {
|
|
20021
20059
|
bezier: "贝塞尔曲线",
|
|
20022
20060
|
straight: "直线",
|
|
20023
20061
|
rounded: "圆角直线"
|
|
20024
|
-
},
|
|
20062
|
+
}, Jc = {
|
|
20025
20063
|
bezier: "∿",
|
|
20026
20064
|
straight: "╱",
|
|
20027
20065
|
rounded: "⌁"
|
|
20028
20066
|
};
|
|
20029
|
-
class
|
|
20067
|
+
class eh {
|
|
20030
20068
|
type = "path-draw";
|
|
20031
20069
|
engine;
|
|
20032
20070
|
root = new de();
|
|
@@ -20206,7 +20244,7 @@ class Jc {
|
|
|
20206
20244
|
color: this.options.pointColor,
|
|
20207
20245
|
depthTest: !1,
|
|
20208
20246
|
depthWrite: !1
|
|
20209
|
-
}), s = new
|
|
20247
|
+
}), s = new R(i, n), o = t ?? `path-point-${++this.pointSequence}`;
|
|
20210
20248
|
return s.name = o, s.position.copy(e), s.renderOrder = 1002, s.userData.pathDrawPointId = o, { id: o, position: e.clone(), mesh: s };
|
|
20211
20249
|
}
|
|
20212
20250
|
selectPoint(e) {
|
|
@@ -20232,7 +20270,7 @@ class Jc {
|
|
|
20232
20270
|
return s.setFromCamera(n, this.engine.camera), s.intersectObjects(this.pointsGroup.children, !1)[0]?.object ?? null;
|
|
20233
20271
|
}
|
|
20234
20272
|
updatePreview(e) {
|
|
20235
|
-
this.previewMarker || (this.previewMarker = new
|
|
20273
|
+
this.previewMarker || (this.previewMarker = new R(
|
|
20236
20274
|
new Yt(this.options.pointSize * 0.72, 14, 10),
|
|
20237
20275
|
new oe({ color: this.options.previewColor, depthTest: !1, depthWrite: !1 })
|
|
20238
20276
|
), this.previewMarker.renderOrder = 1003, this.root.add(this.previewMarker)), this.previewMarker.position.copy(e), this.previewMarker.visible = !0;
|
|
@@ -20392,7 +20430,7 @@ class Jc {
|
|
|
20392
20430
|
t.append(i, n, s), e.appendChild(t), this.statusElement = n;
|
|
20393
20431
|
const o = document.createElement("div");
|
|
20394
20432
|
Object.assign(o.style, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: "4px", padding: "8px" }), ["bezier", "straight", "rounded"].forEach((w) => {
|
|
20395
|
-
const m = this.createIconButton(
|
|
20433
|
+
const m = this.createIconButton(Jc[w], Zc[w], () => this.setLineType(w));
|
|
20396
20434
|
m.dataset.lineType = w, m.style.width = "100%", m.style.fontSize = "18px", o.appendChild(m);
|
|
20397
20435
|
}), e.appendChild(o);
|
|
20398
20436
|
const r = document.createElement("label");
|
|
@@ -20510,7 +20548,7 @@ class Jc {
|
|
|
20510
20548
|
return { x: e.x, y: e.y, z: e.z };
|
|
20511
20549
|
}
|
|
20512
20550
|
}
|
|
20513
|
-
class
|
|
20551
|
+
class th {
|
|
20514
20552
|
engine;
|
|
20515
20553
|
continusIds = /* @__PURE__ */ new Map();
|
|
20516
20554
|
constructor(e) {
|
|
@@ -20569,7 +20607,7 @@ class eh {
|
|
|
20569
20607
|
});
|
|
20570
20608
|
}
|
|
20571
20609
|
}
|
|
20572
|
-
class
|
|
20610
|
+
class ih {
|
|
20573
20611
|
// 引擎参数
|
|
20574
20612
|
options;
|
|
20575
20613
|
deviceType;
|
|
@@ -20692,7 +20730,7 @@ class th {
|
|
|
20692
20730
|
constructor(e) {
|
|
20693
20731
|
if (window.THREE = Bn, ir(), this.options = e, this.container = document.getElementById(e.containerId), !this.container)
|
|
20694
20732
|
throw new Error(`Container ${e.containerId} not found`);
|
|
20695
|
-
if (this.rxQuotaListMapper = new
|
|
20733
|
+
if (this.rxQuotaListMapper = new $c(this), this.filterLoaderModel = new th(this), this.engineModelModule = new Sa(this), this.engineModelModule.init(), this.deviceModule = new Oo(this), this.deviceType = this.deviceModule.getDeviceType(), this.cameraModule = new se(this), this.sceneModule = new Ro(this), this.scene = this.sceneModule.scene, this.renderModule = new Fo(this), this.renderer = this.renderModule.createRenderer(), this.camera = this.cameraModule.orthographicCamera, this.scene.camera = this.camera, this.renderer) {
|
|
20696
20734
|
const o = this.renderer;
|
|
20697
20735
|
o.interactionCullingEnabled = !0, o.interactionActive = !1, o.interactionRenderScene = this.scene, o.interactionFrameBudgetMs = this.options.interactionFrameBudgetMs ?? 6, o.interactionSkipShadows = this.options.interactionSkipShadows ?? !0;
|
|
20698
20736
|
}
|
|
@@ -20700,7 +20738,7 @@ class th {
|
|
|
20700
20738
|
const t = this.events.trigger.bind(this.events);
|
|
20701
20739
|
this.events.trigger = ((o, r) => {
|
|
20702
20740
|
t(o, r), String(o) !== String(ie.EngineBusy) && this.requestComposerRender();
|
|
20703
|
-
}), this.engineStatus = new Jr(this), this.engineStatus.init(), this.loaderModule = new Ie(this), this.lightModule = new xa(this), this.lightModule.init(), this.viewCube = new _a(this), this.viewCube.init(), this.options.showViewCube == !1 && this.viewCube.hide(), this.octreeBox = Da(this), this.rangeScale = new ka(this), this.rangeScale.init(), this.setting = new Ja(this), this.engineModelModule.init(), this.handelBehaved = Hi(this), this.modelMapperBatch = new xl(this), this.measure = new ll(this), this.modelToolModule = new ba(this), this.modelLink3d = new
|
|
20741
|
+
}), this.engineStatus = new Jr(this), this.engineStatus.init(), this.loaderModule = new Ie(this), this.lightModule = new xa(this), this.lightModule.init(), this.viewCube = new _a(this), this.viewCube.init(), this.options.showViewCube == !1 && this.viewCube.hide(), this.octreeBox = Da(this), this.rangeScale = new ka(this), this.rangeScale.init(), this.setting = new Ja(this), this.engineModelModule.init(), this.handelBehaved = Hi(this), this.modelMapperBatch = new xl(this), this.measure = new ll(this), this.modelToolModule = new ba(this), this.modelLink3d = new lc(this, this.options.linkOptions ?? {}), this.modelLink3d.init(), this.modelProperties = new fl(this), this.search = new vl(this), this.interactionModule = new wa(this), this.interactionModule.init(), this.interactionModule.active(), this.hoverHighLight = new ei(this), this.modelEdge = new $a(this), this.nodeBox = new Cl(this), this.modelTree = new ml(this), this.viewTree = new Ui(this), this.merge2d = new Wl(this), this.engineInfo = new gl(this), this.pathRoaming = new Pl(this), this.pathRoaming.init(), this.oneClickEncoding = new Ll(this), this.minMap = new Tl(this), this.linkElement2d3d = new Dl(this), this.linkView2d3d = new kl(this), this.grid = new za(this), this.level = new Va(this), this.issueReport = new Il(this), this.fabricDraw = new oc(this), this.drawingPin = new rc(this), this.label = new cc(this), this.annotation3d = new qc(this), this.calibration = new lt(this), this.modelPlace = new Xc(this), this.modelComparison = new Eo(this), this.modelExplode = new Qc(this), this.materialTool = new zo(this, this.options.materialEditorOptions ?? {}), this.materialTool.init(), this.pathDraw = new eh(this), this.text = new _l(this), this.hdr = new Fa(this), this.ground = new Vi(this), this.ground.init(), this.skyManager = new Za(this), this.setting.init(), this.worldToScreen = new me(this.camera, this.renderer, this.scene), this.options.showStats && (this.stats = new Co(), this.stats.showPanel(0), this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "0px", this.stats.dom.style.left = "0px", this.stats.dom.style.zIndex = "1000", this.container.appendChild(this.stats.dom));
|
|
20704
20742
|
let i = document.createElement("div");
|
|
20705
20743
|
i.className = "versionText", this.versionEl = i, this.updateVersionDisplay(), this.container.appendChild(i);
|
|
20706
20744
|
let n = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
@@ -20993,7 +21031,7 @@ class th {
|
|
|
20993
21031
|
if (!e) return;
|
|
20994
21032
|
[...e.children].forEach((i) => {
|
|
20995
21033
|
this.clearScene(i);
|
|
20996
|
-
}), e.parent && e.parent.remove(e), e instanceof
|
|
21034
|
+
}), e.parent && e.parent.remove(e), e instanceof R && !(e instanceof W) && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((i) => this.disposeMaterial(i)) : this.disposeMaterial(e.material))), e instanceof It && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof uo && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof W && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((i) => this.disposeMaterial(i)) : this.disposeMaterial(e.material)), e.instanceMatrix && (e.instanceMatrix = null), e.instanceColor && (e.instanceColor = null)), e instanceof yi && e.material && this.disposeMaterial(e.material), e instanceof po && e.shadow?.dispose?.();
|
|
20997
21035
|
}
|
|
20998
21036
|
/**
|
|
20999
21037
|
* 清理材质及其纹理
|
|
@@ -21047,14 +21085,14 @@ class th {
|
|
|
21047
21085
|
}), e.dispose();
|
|
21048
21086
|
}
|
|
21049
21087
|
}
|
|
21050
|
-
const
|
|
21088
|
+
const lh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
21051
21089
|
__proto__: null,
|
|
21052
|
-
EngineKernelV2:
|
|
21090
|
+
EngineKernelV2: ih
|
|
21053
21091
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
21054
21092
|
export {
|
|
21055
21093
|
ie as E,
|
|
21056
21094
|
Eo as M,
|
|
21057
21095
|
oi as a,
|
|
21058
21096
|
zo as b,
|
|
21059
|
-
|
|
21097
|
+
lh as c
|
|
21060
21098
|
};
|