iflow-engine-base-3d 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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Pi, G as de, P as qt, O as _e, M as F, V as d, e as $e, T as Bn, C as Ss, W as Ti, a as Ps, b as je, N as Ii, c as Ts, d as ot, f as G, Q as Se, E as zn, R as fe, g as Ze, h as _i, B as
|
|
2
|
-
import { W as me, C as mo, L as ft, B as Yi, g as
|
|
1
|
+
import { S as Pi, G as de, P as qt, O as _e, M as F, V as d, e as $e, T as Bn, C as Ss, W as Ti, a as Ps, b as je, N as Ii, c as Ts, d as ot, f as G, Q as Se, E as zn, R as fe, g as Ze, h as _i, B as z, i as Di, A as Rn, j as V, k as R, I as W, l as ii, m as ni, n as On, o as Fn, L as Kt, p as Is, q as _s, r as Ds, s as Gi, D as re, t as qi, u as ks, F as Ls, v as Me, w as Nn, x as Hn, y as ki, z as Bs, H as Vn, J as ge, K as zs, U as bt, X as Rs, Y as Os, Z as Un, _ as Fs, $ as qe, a0 as jt, a1 as Li, a2 as Z, a3 as oe, a4 as Ct, a5 as Ns, a6 as Je, a7 as fi, a8 as He, a9 as It, aa as Hs, ab as Vs, ac as yi, ad as ht, ae as Us, af as ct, ag as Ws, ah as Gs, ai as Wn, aj as Yt, ak as At, al as Xt, am as qs, an as Ki, ao as dt, ap as Et, aq as St, ar as Ks, as as js, at as ji, au as Ys, av as Xs, aw as Qs, ax as $s, ay as Zs, az as Js, aA as eo, aB as to, aC as io, aD as Gn, aE as no, aF as so, aG as oo, aH as Mi, aI as Ye, aJ as ro, aK as ao, aL as lo, aM as co, aN as ho, aO as uo, aP as po } from "./three-vendor-ClQTDDlA.js";
|
|
2
|
+
import { W as me, C as mo, L as ft, B as Yi, g as ze, a as go, E as fo, r as yo } from "./sdk-runtime-Cc_Cz64H.js";
|
|
3
3
|
import { r as ee, g as Mo } from "./sdk-assets-DAIj-7Ou.js";
|
|
4
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-DYgn7sFs.js";
|
|
5
5
|
class Ao {
|
|
@@ -1178,7 +1178,7 @@ class sn extends zn {
|
|
|
1178
1178
|
setAvatarModel(e, t = {}) {
|
|
1179
1179
|
if (e) {
|
|
1180
1180
|
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) {
|
|
1181
|
-
const i = new
|
|
1181
|
+
const i = new z().setFromObject(e), n = i.max.y - i.min.y;
|
|
1182
1182
|
if (t.fitToPlayerHeight !== !1 && Number.isFinite(n) && n > 1e-6) {
|
|
1183
1183
|
const o = (t.targetHeight ?? this.playerHeight) / n;
|
|
1184
1184
|
e.scale.multiplyScalar(o), i.setFromObject(e);
|
|
@@ -1611,7 +1611,7 @@ function et(l, e) {
|
|
|
1611
1611
|
const s = l?.scene?.children?.find?.((o) => o instanceof de ? zi(o, e) ? !0 : o.name === e && o.url === e : !1);
|
|
1612
1612
|
return s != null ? (wi(s, e), t.set(e, s), n != null && (n.group = s), s) : null;
|
|
1613
1613
|
}
|
|
1614
|
-
function
|
|
1614
|
+
function De(l, e) {
|
|
1615
1615
|
const t = et(l, e);
|
|
1616
1616
|
return t == null ? new V() : (t.updateWorldMatrix(!0, !1), t.matrixWorld.clone());
|
|
1617
1617
|
}
|
|
@@ -1652,7 +1652,7 @@ function Pt(l, e) {
|
|
|
1652
1652
|
}), t;
|
|
1653
1653
|
}
|
|
1654
1654
|
function Oi(l) {
|
|
1655
|
-
return Pt(l, (e) => e instanceof
|
|
1655
|
+
return Pt(l, (e) => e instanceof R && !(e instanceof W));
|
|
1656
1656
|
}
|
|
1657
1657
|
function zo(l) {
|
|
1658
1658
|
if (typeof l.__modelObjectIndexSeed == "number")
|
|
@@ -1700,7 +1700,7 @@ function on(l, e) {
|
|
|
1700
1700
|
}, i.enabled || e ? (t.polygonOffset = !1, t.polygonOffsetFactor = s, t.polygonOffsetUnits = n + (e ? Kn : 0)) : t.polygonOffset = !1, t.needsUpdate = !0;
|
|
1701
1701
|
});
|
|
1702
1702
|
}
|
|
1703
|
-
function
|
|
1703
|
+
function Be(l, e) {
|
|
1704
1704
|
if (!Number.isFinite(e))
|
|
1705
1705
|
return;
|
|
1706
1706
|
const t = Yn(l), i = t.get(e);
|
|
@@ -1722,7 +1722,7 @@ class Fo {
|
|
|
1722
1722
|
const n = this.engine, s = e.object.url, o = e.object.name;
|
|
1723
1723
|
let r = n.modelEdge.getModelEdge(s, o);
|
|
1724
1724
|
r || (r = [0, 0, []]);
|
|
1725
|
-
const a =
|
|
1725
|
+
const a = De(n, s), c = this.getModelSnapCache(s, o, r);
|
|
1726
1726
|
n.camera.updateMatrixWorld(!0);
|
|
1727
1727
|
const h = new V().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();
|
|
1728
1728
|
let S = "face", P = null, I = null, B = 100;
|
|
@@ -2027,9 +2027,9 @@ function Hi(l) {
|
|
|
2027
2027
|
function q(v, A, L, U, j, we) {
|
|
2028
2028
|
const ve = l?.catchSvg;
|
|
2029
2029
|
if (!ve?.childElementCount) return;
|
|
2030
|
-
const
|
|
2030
|
+
const ke = l?.reactBoundingClientRect ?? A.getBoundingClientRect(), nt = (be) => {
|
|
2031
2031
|
const [Re, Oe] = be.split(",").map(Number);
|
|
2032
|
-
return Number.isFinite(Re) && Number.isFinite(Oe) ? [(Re -
|
|
2032
|
+
return Number.isFinite(Re) && Number.isFinite(Oe) ? [(Re - ke.left - L) / j * n * we, (Oe - ke.top - U) / j * n * we] : null;
|
|
2033
2033
|
};
|
|
2034
2034
|
Array.from(ve.children).forEach((be) => {
|
|
2035
2035
|
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);
|
|
@@ -2045,7 +2045,7 @@ function Hi(l) {
|
|
|
2045
2045
|
k();
|
|
2046
2046
|
return;
|
|
2047
2047
|
}
|
|
2048
|
-
const
|
|
2048
|
+
const ke = L.width / n, nt = Math.min(
|
|
2049
2049
|
window.innerWidth - n / 2 - 8,
|
|
2050
2050
|
Math.max(n / 2 + 8, v.clientX)
|
|
2051
2051
|
), be = Math.min(
|
|
@@ -2056,12 +2056,12 @@ function Hi(l) {
|
|
|
2056
2056
|
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));
|
|
2057
2057
|
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);
|
|
2058
2058
|
try {
|
|
2059
|
-
U.drawImage(A, st * Re, Fe * Oe, xe * Re, xe * Oe, 0, 0, L.width, L.height), q(U, A, st, Fe, xe,
|
|
2059
|
+
U.drawImage(A, st * Re, Fe * Oe, xe * Re, xe * Oe, 0, 0, L.width, L.height), q(U, A, st, Fe, xe, ke);
|
|
2060
2060
|
} catch {
|
|
2061
2061
|
k(), U.restore();
|
|
2062
2062
|
return;
|
|
2063
2063
|
}
|
|
2064
|
-
U.strokeStyle = "rgba(0, 255, 247, 0.9)", U.lineWidth = 1.5 *
|
|
2064
|
+
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();
|
|
2065
2065
|
}
|
|
2066
2066
|
function Q(v, A = !1, L = !1, U = !0) {
|
|
2067
2067
|
const j = p(v);
|
|
@@ -2770,7 +2770,7 @@ function Go(l, e, t, i, n) {
|
|
|
2770
2770
|
l === "Circle" ? (O = f.diameter, q = f.diameter) : (O = f.width, q = f.height);
|
|
2771
2771
|
const te = I.clone().makeScale(O, q, f.length);
|
|
2772
2772
|
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);
|
|
2773
|
-
const Q = c?.clone().applyMatrix4(I) ?? new
|
|
2773
|
+
const Q = c?.clone().applyMatrix4(I) ?? new z(), ce = Q.min.clone(), ae = Q.max.clone(), le = Q.getCenter(new d());
|
|
2774
2774
|
f.box = Q.clone();
|
|
2775
2775
|
const ue = {
|
|
2776
2776
|
name: f.name,
|
|
@@ -2829,7 +2829,7 @@ function Rt(l, e) {
|
|
|
2829
2829
|
roughness: 1,
|
|
2830
2830
|
side: re,
|
|
2831
2831
|
shadowSide: re
|
|
2832
|
-
}), p = new
|
|
2832
|
+
}), p = new R(h, u);
|
|
2833
2833
|
return p.position.set(a.x, a.y, a.z), p.rotation._order = "YXZ", p.rotation.set(c.x, c.y, c.z), p;
|
|
2834
2834
|
}
|
|
2835
2835
|
}
|
|
@@ -2837,7 +2837,7 @@ var ne = /* @__PURE__ */ ((l) => (l.ModelLoadStart = "model-load-start", l.Model
|
|
|
2837
2837
|
const rn = "__bvhAccelerationInstalled", Jn = "__bvhBuildFailed", qo = "__bvhBuilt", Ko = "__bvhTriangleCount", es = 200, jo = 10;
|
|
2838
2838
|
function Yo() {
|
|
2839
2839
|
const l = globalThis;
|
|
2840
|
-
l[rn] !== !0 && (
|
|
2840
|
+
l[rn] !== !0 && (R.prototype.raycast = Bs, ge.prototype.computeBoundsTree = Vn, ge.prototype.disposeBoundsTree = zs, l[rn] = !0);
|
|
2841
2841
|
}
|
|
2842
2842
|
function Xo(l) {
|
|
2843
2843
|
l.firstHitOnly = !0;
|
|
@@ -3057,7 +3057,7 @@ async function xr(l, e, t, i) {
|
|
|
3057
3057
|
w.applyMatrix4(x), w.computeBoundingBox(), w.attributes.position.count > 2e4 && Jo(w, {
|
|
3058
3058
|
setBoundingSphere: !0
|
|
3059
3059
|
});
|
|
3060
|
-
const m = new
|
|
3060
|
+
const m = new R(w, f.material);
|
|
3061
3061
|
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 % ts === 0 && (a = await Xe(l, i, a));
|
|
3062
3062
|
}
|
|
3063
3063
|
}
|
|
@@ -3078,7 +3078,7 @@ function Cr(l, e, t, i, n) {
|
|
|
3078
3078
|
const s = bt(
|
|
3079
3079
|
i.map((h) => h.geometry),
|
|
3080
3080
|
!1
|
|
3081
|
-
), o = hs(n), r = new
|
|
3081
|
+
), o = hs(n), r = new R(s, o);
|
|
3082
3082
|
r.castShadow = !0, r.receiveShadow = !0, it(e, l).add(r);
|
|
3083
3083
|
const c = Fi(e, r);
|
|
3084
3084
|
return Ni(r, c), r.url = l, r.glb = t, r.materialClone = o, r.geometrys = i.map((h) => h.geometry), r.geometry.computeVertexNormals(), r;
|
|
@@ -3086,7 +3086,7 @@ function Cr(l, e, t, i, n) {
|
|
|
3086
3086
|
function Ar(l, e, t, i) {
|
|
3087
3087
|
return (et(l, e)?.children ?? l.scene.children).find((o) => {
|
|
3088
3088
|
const r = o;
|
|
3089
|
-
return o instanceof
|
|
3089
|
+
return o instanceof R && r.url == e && r.glb == t && r.materialClone === i;
|
|
3090
3090
|
});
|
|
3091
3091
|
}
|
|
3092
3092
|
function Er(l, e) {
|
|
@@ -3153,7 +3153,7 @@ async function Tr(l, e, t, i, n, s) {
|
|
|
3153
3153
|
const w = Pr(i, x);
|
|
3154
3154
|
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)) {
|
|
3155
3155
|
const m = o.nodesMap.get(f.id);
|
|
3156
|
-
m.indexes == null && (m.indexes = []), m.indexes.push([c, g, 0, 0]), Tt(m), w != null && m?.info != null && (m.info.box instanceof
|
|
3156
|
+
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());
|
|
3157
3157
|
} else {
|
|
3158
3158
|
const m = {
|
|
3159
3159
|
instance: !0,
|
|
@@ -3283,7 +3283,7 @@ async function Dr(l, e, t, i) {
|
|
|
3283
3283
|
}
|
|
3284
3284
|
}
|
|
3285
3285
|
function kr(l, e, t) {
|
|
3286
|
-
if (t.boundingBox || (t.boundingBox = new
|
|
3286
|
+
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)
|
|
3287
3287
|
return 1e3;
|
|
3288
3288
|
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();
|
|
3289
3289
|
if (e.getWorldDirection(h), e.getWorldPosition(u), e.matrixWorld.extractBasis(a, c, new d()), e instanceof _e) {
|
|
@@ -3520,7 +3520,7 @@ class Ie {
|
|
|
3520
3520
|
async collectSourceEntries(e) {
|
|
3521
3521
|
const t = [];
|
|
3522
3522
|
for (const i of e) {
|
|
3523
|
-
const n =
|
|
3523
|
+
const n = Le(i.webkitRelativePath || i.name), s = vt(n);
|
|
3524
3524
|
if (dn(s)) {
|
|
3525
3525
|
t.push({ path: n, blob: i });
|
|
3526
3526
|
continue;
|
|
@@ -3529,7 +3529,7 @@ class Ie {
|
|
|
3529
3529
|
const o = await vi.loadAsync(i), r = li(n), a = Object.values(o.files);
|
|
3530
3530
|
for (const c of a)
|
|
3531
3531
|
c.dir || t.push({
|
|
3532
|
-
path: Ur(r,
|
|
3532
|
+
path: Ur(r, Le(c.name)),
|
|
3533
3533
|
blob: await c.async("blob")
|
|
3534
3534
|
});
|
|
3535
3535
|
continue;
|
|
@@ -3552,7 +3552,7 @@ class Ie {
|
|
|
3552
3552
|
* 识别解压后的模型目录,例如 `lod0/nodes.json`、`info/info.json`。
|
|
3553
3553
|
*/
|
|
3554
3554
|
parseExtractedPackageEntry(e) {
|
|
3555
|
-
const t =
|
|
3555
|
+
const t = Le(e).split("/").filter(Boolean);
|
|
3556
3556
|
for (let n = 0; n < t.length; n++) {
|
|
3557
3557
|
const s = Gr(t[n]);
|
|
3558
3558
|
if (s == null)
|
|
@@ -3578,7 +3578,7 @@ class Ie {
|
|
|
3578
3578
|
async packEntriesAsZip(e) {
|
|
3579
3579
|
const t = new vi();
|
|
3580
3580
|
for (const i of e)
|
|
3581
|
-
t.file(
|
|
3581
|
+
t.file(Le(i.path), i.blob);
|
|
3582
3582
|
return t.generateAsync({ type: "blob" });
|
|
3583
3583
|
}
|
|
3584
3584
|
/**
|
|
@@ -3606,9 +3606,9 @@ class Ie {
|
|
|
3606
3606
|
static normalizeRequestKey(e) {
|
|
3607
3607
|
try {
|
|
3608
3608
|
const t = new URL(e, window.location.origin);
|
|
3609
|
-
return
|
|
3609
|
+
return Le(t.pathname);
|
|
3610
3610
|
} catch {
|
|
3611
|
-
return
|
|
3611
|
+
return Le(e.split("?")[0].split("#")[0]);
|
|
3612
3612
|
}
|
|
3613
3613
|
}
|
|
3614
3614
|
/**
|
|
@@ -3618,15 +3618,15 @@ class Ie {
|
|
|
3618
3618
|
return `${e.replace(/[^a-zA-Z0-9/_-]/g, "_").replace(/\//g, "__") || "model"}_${Date.now()}_${t}_${Math.random().toString(36).slice(2, 8)}`;
|
|
3619
3619
|
}
|
|
3620
3620
|
}
|
|
3621
|
-
function
|
|
3621
|
+
function Le(l) {
|
|
3622
3622
|
return l.replace(/\\/g, "/").replace(/^\/+/, "").replace(/\/+/g, "/");
|
|
3623
3623
|
}
|
|
3624
3624
|
function vt(l) {
|
|
3625
|
-
const e =
|
|
3625
|
+
const e = Le(l), t = e.lastIndexOf("/");
|
|
3626
3626
|
return t >= 0 ? e.slice(t + 1) : e;
|
|
3627
3627
|
}
|
|
3628
3628
|
function li(l) {
|
|
3629
|
-
const e =
|
|
3629
|
+
const e = Le(l), t = e.lastIndexOf("/");
|
|
3630
3630
|
return t >= 0 ? e.slice(0, t) : "";
|
|
3631
3631
|
}
|
|
3632
3632
|
function Vr(l, e) {
|
|
@@ -3638,7 +3638,7 @@ function Vr(l, e) {
|
|
|
3638
3638
|
}
|
|
3639
3639
|
}
|
|
3640
3640
|
function Ur(l, e) {
|
|
3641
|
-
return
|
|
3641
|
+
return Le(l ? e ? `${l}/${e}` : l : e);
|
|
3642
3642
|
}
|
|
3643
3643
|
function dn(l) {
|
|
3644
3644
|
return Nr.test(l);
|
|
@@ -3968,11 +3968,11 @@ class ua {
|
|
|
3968
3968
|
const t = this.engine.scene;
|
|
3969
3969
|
if (!t)
|
|
3970
3970
|
return null;
|
|
3971
|
-
const i = new
|
|
3971
|
+
const i = new z();
|
|
3972
3972
|
let n = !1;
|
|
3973
3973
|
return t.traverse((s) => {
|
|
3974
|
-
if (s instanceof
|
|
3975
|
-
const o = new
|
|
3974
|
+
if (s instanceof R || s instanceof W) {
|
|
3975
|
+
const o = new z().setFromObject(s);
|
|
3976
3976
|
o.isEmpty() || (i.union(o), n = !0);
|
|
3977
3977
|
}
|
|
3978
3978
|
}), !n || i.isEmpty() ? null : this.validateBox(i);
|
|
@@ -3985,7 +3985,7 @@ class ua {
|
|
|
3985
3985
|
*/
|
|
3986
3986
|
normalizeBox(e, t) {
|
|
3987
3987
|
return [e.x, e.y, e.z, t.x, t.y, t.z].every(Number.isFinite) ? this.validateBox(
|
|
3988
|
-
new
|
|
3988
|
+
new z(
|
|
3989
3989
|
new d(
|
|
3990
3990
|
Math.min(e.x, t.x),
|
|
3991
3991
|
Math.min(e.y, t.y),
|
|
@@ -4104,7 +4104,7 @@ class ua {
|
|
|
4104
4104
|
return;
|
|
4105
4105
|
const i = e.getSize(new d()).length();
|
|
4106
4106
|
(this.lastShadowCasterPolicySceneSize <= 0 || Math.abs(i - this.lastShadowCasterPolicySceneSize) > this.lastShadowCasterPolicySceneSize * 0.1) && (this.shadowCasterPolicyChecked = /* @__PURE__ */ new WeakSet(), this.lastShadowCasterPolicySceneSize = i), t.traverse((n) => {
|
|
4107
|
-
this.shadowCasterPolicyChecked.has(n) || (n instanceof
|
|
4107
|
+
this.shadowCasterPolicyChecked.has(n) || (n instanceof R || n instanceof W) && (this.shadowCasterPolicyChecked.add(n), this.applyShadowCasterPolicy(n));
|
|
4108
4108
|
});
|
|
4109
4109
|
}
|
|
4110
4110
|
/**
|
|
@@ -4115,7 +4115,7 @@ class ua {
|
|
|
4115
4115
|
const t = e.userData;
|
|
4116
4116
|
if (t.__lightModuleOriginalCastShadow == null && (t.__lightModuleOriginalCastShadow = e.castShadow), t.__lightModuleOriginalCastShadow !== !0 || e.receiveShadow !== !0)
|
|
4117
4117
|
return;
|
|
4118
|
-
const i = new
|
|
4118
|
+
const i = new z().setFromObject(e);
|
|
4119
4119
|
if (i.isEmpty())
|
|
4120
4120
|
return;
|
|
4121
4121
|
const n = i.getSize(new d()), s = Math.max(n.x, n.z), o = Math.max(
|
|
@@ -4460,11 +4460,11 @@ class pa {
|
|
|
4460
4460
|
getNodeWorldBox(e, t, i) {
|
|
4461
4461
|
if (i != null) {
|
|
4462
4462
|
const n = this.engine.modelExplode?.getExplodedWorldBox?.(e.url, i);
|
|
4463
|
-
if (n instanceof
|
|
4463
|
+
if (n instanceof z)
|
|
4464
4464
|
return n;
|
|
4465
4465
|
}
|
|
4466
4466
|
if (Array.isArray(t?.infos) && t.infos.length > 0) {
|
|
4467
|
-
const n =
|
|
4467
|
+
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));
|
|
4468
4468
|
return this.getMergedBox(s);
|
|
4469
4469
|
}
|
|
4470
4470
|
if (Array.isArray(t?.indexes) && t.indexes.length > 0) {
|
|
@@ -4489,15 +4489,15 @@ class pa {
|
|
|
4489
4489
|
const n = e.indexes.map((s) => {
|
|
4490
4490
|
const o = this.getSceneModel(s[0]);
|
|
4491
4491
|
return this.createInstanceCatchMesh(o, s[1]);
|
|
4492
|
-
}).filter((s) => s instanceof
|
|
4492
|
+
}).filter((s) => s instanceof R);
|
|
4493
4493
|
if (n.length > 0)
|
|
4494
4494
|
return n;
|
|
4495
4495
|
}
|
|
4496
4496
|
if (Array.isArray(e?.infos) && e.infos.length > 0) {
|
|
4497
|
-
const n = e.infos.map((o) => o?.mesh).filter((o) => o instanceof
|
|
4497
|
+
const n = e.infos.map((o) => o?.mesh).filter((o) => o instanceof R && o.userData?.__pickBox !== !0);
|
|
4498
4498
|
if (t == null)
|
|
4499
4499
|
return n;
|
|
4500
|
-
const s =
|
|
4500
|
+
const s = De(this.engine, t);
|
|
4501
4501
|
return n.forEach((o) => {
|
|
4502
4502
|
o.parent == null && (o.matrixAutoUpdate = !1, o.matrix.copy(s), o.matrixWorld.copy(s), o.matrixWorldNeedsUpdate = !1);
|
|
4503
4503
|
}), n;
|
|
@@ -4514,7 +4514,7 @@ class pa {
|
|
|
4514
4514
|
else
|
|
4515
4515
|
return null;
|
|
4516
4516
|
const i = e.geometry.clone();
|
|
4517
|
-
return e.updateWorldMatrix(!0, !1), i.applyMatrix4(this.tempInstanceMatrix), i.applyMatrix4(e.matrixWorld), new
|
|
4517
|
+
return e.updateWorldMatrix(!0, !1), i.applyMatrix4(this.tempInstanceMatrix), i.applyMatrix4(e.matrixWorld), new R(i, e.material);
|
|
4518
4518
|
}
|
|
4519
4519
|
getInstanceWorldBox(e, t) {
|
|
4520
4520
|
if (!(e instanceof W))
|
|
@@ -4559,11 +4559,11 @@ class pa {
|
|
|
4559
4559
|
getMergedBox(e) {
|
|
4560
4560
|
if (e.length === 0)
|
|
4561
4561
|
return null;
|
|
4562
|
-
const t = new
|
|
4562
|
+
const t = new z().makeEmpty();
|
|
4563
4563
|
return e.forEach((i) => t.union(i)), t.isEmpty() ? null : t;
|
|
4564
4564
|
}
|
|
4565
4565
|
getSceneModel(e) {
|
|
4566
|
-
return
|
|
4566
|
+
return Be(this.engine, e);
|
|
4567
4567
|
}
|
|
4568
4568
|
/** 从射线命中的对象还原真实构件 ID,兼容炸开代理和普通模型对象。 */
|
|
4569
4569
|
getHitModelId(e) {
|
|
@@ -4630,7 +4630,7 @@ class ma {
|
|
|
4630
4630
|
const r = it(this.engine, o.url);
|
|
4631
4631
|
o.nodesMap.forEach((a, c) => {
|
|
4632
4632
|
const h = String(a?.name ?? a?.info?.name ?? a?.infos?.[0]?.name ?? "");
|
|
4633
|
-
if (!i.some((m) => h.includes(m)) || a?.pickBoxMesh instanceof
|
|
4633
|
+
if (!i.some((m) => h.includes(m)) || a?.pickBoxMesh instanceof R || a?.indexes?.some((m) => Be(this.engine, m?.[0]) instanceof W))
|
|
4634
4634
|
return;
|
|
4635
4635
|
const p = this.getNodeLocalBox(a);
|
|
4636
4636
|
if (p == null)
|
|
@@ -4643,7 +4643,7 @@ class ma {
|
|
|
4643
4643
|
);
|
|
4644
4644
|
const x = new Ct(f.x, f.y, f.z);
|
|
4645
4645
|
x.translate(g.x, g.y, g.z), x.computeBoundingBox();
|
|
4646
|
-
const w = new
|
|
4646
|
+
const w = new R(x, this.pickBoxMaterial);
|
|
4647
4647
|
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({
|
|
4648
4648
|
id: c,
|
|
4649
4649
|
name: h,
|
|
@@ -4659,7 +4659,7 @@ class ma {
|
|
|
4659
4659
|
e?.box,
|
|
4660
4660
|
e?.info?.box,
|
|
4661
4661
|
...Array.isArray(e?.infos) ? e.infos.map((n) => n?.box) : []
|
|
4662
|
-
].filter((n) => n instanceof
|
|
4662
|
+
].filter((n) => n instanceof z && !n.isEmpty());
|
|
4663
4663
|
if (t.length === 0)
|
|
4664
4664
|
return null;
|
|
4665
4665
|
const i = t[0].clone();
|
|
@@ -4740,7 +4740,7 @@ class ma {
|
|
|
4740
4740
|
rebatchSplitModels() {
|
|
4741
4741
|
if (!this.engine?.scene)
|
|
4742
4742
|
return;
|
|
4743
|
-
Pt(this.engine, (t) => t instanceof
|
|
4743
|
+
Pt(this.engine, (t) => t instanceof R && !(t instanceof W) && t.isSplit === !0).forEach((t) => {
|
|
4744
4744
|
this.rebuildSplitModelGroups(t), this.un_split_merge_model(t);
|
|
4745
4745
|
}), this.rebuildCustomInstanceColorBatches();
|
|
4746
4746
|
}
|
|
@@ -4765,13 +4765,13 @@ class ma {
|
|
|
4765
4765
|
restoreSplitModelsOnIdle() {
|
|
4766
4766
|
if (!this.engine?.scene)
|
|
4767
4767
|
return;
|
|
4768
|
-
Pt(this.engine, (t) => t instanceof
|
|
4769
|
-
t instanceof
|
|
4768
|
+
Pt(this.engine, (t) => t instanceof R && !(t instanceof W)).forEach((t) => {
|
|
4769
|
+
t instanceof R && (t.isSplit === !0 && (t.visible = !this.areAllGroupsHidden(t)), t.isSplit === !0 && this.un_split_merge_model(t));
|
|
4770
4770
|
});
|
|
4771
4771
|
}
|
|
4772
4772
|
// 获取场景中的所有模型
|
|
4773
4773
|
getSceneModel(e) {
|
|
4774
|
-
return
|
|
4774
|
+
return Be(this.engine, e);
|
|
4775
4775
|
}
|
|
4776
4776
|
/** 炸开模式下,原模型状态变化后需要同步到代理构件,保证交互语义一致。 */
|
|
4777
4777
|
syncExplodeVisualState() {
|
|
@@ -4781,7 +4781,7 @@ class ma {
|
|
|
4781
4781
|
getModelCenter(e = this.engine.engineStatus.highlightModels ?? []) {
|
|
4782
4782
|
if (!Array.isArray(e) || e.length === 0)
|
|
4783
4783
|
return null;
|
|
4784
|
-
const t = new
|
|
4784
|
+
const t = new z();
|
|
4785
4785
|
let i = !1;
|
|
4786
4786
|
return e.forEach((n) => {
|
|
4787
4787
|
if (n?.url == null || !Array.isArray(n.ids))
|
|
@@ -4789,7 +4789,7 @@ class ma {
|
|
|
4789
4789
|
const s = this.getEngineModelByUrl(n.url);
|
|
4790
4790
|
if (s?.nodesMap == null)
|
|
4791
4791
|
return;
|
|
4792
|
-
const o =
|
|
4792
|
+
const o = De(this.engine, n.url);
|
|
4793
4793
|
n.ids.forEach((r) => {
|
|
4794
4794
|
const a = s.nodesMap.get(r);
|
|
4795
4795
|
[
|
|
@@ -4797,7 +4797,7 @@ class ma {
|
|
|
4797
4797
|
a?.info?.box,
|
|
4798
4798
|
a?.box
|
|
4799
4799
|
].forEach((h) => {
|
|
4800
|
-
!(h instanceof
|
|
4800
|
+
!(h instanceof z) || h.isEmpty() || (i ? t.union(h.clone().applyMatrix4(o)) : (t.copy(h).applyMatrix4(o), i = !0));
|
|
4801
4801
|
});
|
|
4802
4802
|
});
|
|
4803
4803
|
}), i ? t.getCenter(new d()) : null;
|
|
@@ -4964,7 +4964,7 @@ class ma {
|
|
|
4964
4964
|
/** 设置构件自定义颜色,入参与高亮接口一致:[{ url, ids }],同时兼容旧的直接 Mesh 入参。 */
|
|
4965
4965
|
setModelColor(e, t = 16777215, i = 1) {
|
|
4966
4966
|
const n = this.normalizeOpacity(i);
|
|
4967
|
-
if (e instanceof
|
|
4967
|
+
if (e instanceof R && !(e instanceof W)) {
|
|
4968
4968
|
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);
|
|
4969
4969
|
return;
|
|
4970
4970
|
}
|
|
@@ -4977,7 +4977,7 @@ class ma {
|
|
|
4977
4977
|
let c = r.nodesMap.get(a);
|
|
4978
4978
|
c == null || c.indexes == null || c.indexes.forEach((h) => {
|
|
4979
4979
|
const u = this.getSceneModel(h[0]);
|
|
4980
|
-
u instanceof W ? this.setInstanceModelColor(o.url, a, u, h[0], h[1], s, n) : u instanceof
|
|
4980
|
+
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);
|
|
4981
4981
|
});
|
|
4982
4982
|
});
|
|
4983
4983
|
}), this.rebatchSplitModels(), this.syncExplodeVisualState();
|
|
@@ -4996,7 +4996,7 @@ class ma {
|
|
|
4996
4996
|
if (r == null || !r.has(String(o?.id)))
|
|
4997
4997
|
return;
|
|
4998
4998
|
const a = this.getSceneModel(o.meshIndex);
|
|
4999
|
-
o.type === "instance" && a instanceof W ? this.restoreInstanceColorRecord(a, o) : o.type === "mesh" && a instanceof
|
|
4999
|
+
o.type === "instance" && a instanceof W ? this.restoreInstanceColorRecord(a, o) : o.type === "mesh" && a instanceof R && this.restoreSimpleColorRecord(a, o), this.customModelColorRecords.delete(s);
|
|
5000
5000
|
}), this.rebatchSplitModels(), this.syncExplodeVisualState();
|
|
5001
5001
|
}
|
|
5002
5002
|
// 设置所有模型颜色
|
|
@@ -5018,7 +5018,7 @@ class ma {
|
|
|
5018
5018
|
if (t == null)
|
|
5019
5019
|
return;
|
|
5020
5020
|
const i = this.getSceneModel(t.meshIndex);
|
|
5021
|
-
t.type === "instance" && i instanceof W ? this.restoreInstanceColorRecord(i, t) : t.type === "mesh" && i instanceof
|
|
5021
|
+
t.type === "instance" && i instanceof W ? this.restoreInstanceColorRecord(i, t) : t.type === "mesh" && i instanceof R && this.restoreSimpleColorRecord(i, t), this.customModelColorRecords.delete(e);
|
|
5022
5022
|
}), this.rebatchSplitModels(), this.syncExplodeVisualState();
|
|
5023
5023
|
}
|
|
5024
5024
|
/** 获取所有通过 setModelColor/setAllModelsColor 改过颜色的构件,返回 [{url, ids}]。 */
|
|
@@ -5444,7 +5444,7 @@ function us(l) {
|
|
|
5444
5444
|
e?.remove(l), l.material?.dispose != null && l.material.dispose();
|
|
5445
5445
|
}
|
|
5446
5446
|
function kt(l, e) {
|
|
5447
|
-
return
|
|
5447
|
+
return Be(l, e);
|
|
5448
5448
|
}
|
|
5449
5449
|
const ps = "advanced";
|
|
5450
5450
|
class Ma {
|
|
@@ -5692,7 +5692,7 @@ class Jt {
|
|
|
5692
5692
|
for (const s of n) {
|
|
5693
5693
|
let o = s.geometry.clone();
|
|
5694
5694
|
o.computeVertexNormals();
|
|
5695
|
-
const r = new
|
|
5695
|
+
const r = new R(o, this.overlayMaterial);
|
|
5696
5696
|
s.updateWorldMatrix(!0, !1), r.matrix.copy(s.matrixWorld), r.matrixAutoUpdate = !1, this.engine.scene.add(r), this.overlayMeshes.push(r);
|
|
5697
5697
|
}
|
|
5698
5698
|
this.animState = "fadeIn", this.animStartTime = performance.now(), this.setAnimationFrameRateExempt(!0);
|
|
@@ -5907,8 +5907,8 @@ function wa(l, e, t) {
|
|
|
5907
5907
|
var we = j.dot(H), ve = j.dot(K);
|
|
5908
5908
|
v = Math.min(v, we), A = Math.max(A, we), L = Math.min(L, ve), U = Math.max(U, ve);
|
|
5909
5909
|
}
|
|
5910
|
-
var
|
|
5911
|
-
N = Math.min(be /
|
|
5910
|
+
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;
|
|
5911
|
+
N = Math.min(be / ke, Re / nt) * 0.75;
|
|
5912
5912
|
var Oe = e.camera.position.clone(), xe = l.controls.target.clone(), st = e.camera.zoom, Fe = new $e.Tween({
|
|
5913
5913
|
x1: Oe.x,
|
|
5914
5914
|
y1: Oe.y,
|
|
@@ -6124,7 +6124,7 @@ function wa(l, e, t) {
|
|
|
6124
6124
|
color: 16777215,
|
|
6125
6125
|
map: ae(M, T.icon)
|
|
6126
6126
|
}));
|
|
6127
|
-
var _ = new
|
|
6127
|
+
var _ = new R(new Ct(110, 110, 110), E);
|
|
6128
6128
|
i.sceneOrtho.add(_), ue(122), i.RenderScene();
|
|
6129
6129
|
let D = { x: 0, y: 0 };
|
|
6130
6130
|
o.addEventListener("mousedown", (T) => {
|
|
@@ -6349,7 +6349,7 @@ function wa(l, e, t) {
|
|
|
6349
6349
|
transparent: !0,
|
|
6350
6350
|
opacity: 0.01
|
|
6351
6351
|
}), _ = new V().makeTranslation(y.point.x, y.point.y, y.point.z);
|
|
6352
|
-
let D = M.applyMatrix4(_), T = new
|
|
6352
|
+
let D = M.applyMatrix4(_), T = new R(D, E);
|
|
6353
6353
|
return T.name = y.name, i.sceneOrtho.add(T), T;
|
|
6354
6354
|
}
|
|
6355
6355
|
return i.ToggleCameraType = function() {
|
|
@@ -6421,7 +6421,7 @@ class ba {
|
|
|
6421
6421
|
flyToModels(e = this.engine.engineStatus.highlightModels ?? []) {
|
|
6422
6422
|
if (!Array.isArray(e) || e.length === 0)
|
|
6423
6423
|
return;
|
|
6424
|
-
const t = new
|
|
6424
|
+
const t = new z();
|
|
6425
6425
|
let i = !1;
|
|
6426
6426
|
e.forEach((n) => {
|
|
6427
6427
|
if (n?.url == null || !Array.isArray(n.ids))
|
|
@@ -6429,7 +6429,7 @@ class ba {
|
|
|
6429
6429
|
const s = this.engine.models?.find((r) => r.url === n.url);
|
|
6430
6430
|
if (s?.nodesMap == null)
|
|
6431
6431
|
return;
|
|
6432
|
-
const o =
|
|
6432
|
+
const o = De(this.engine, n.url);
|
|
6433
6433
|
n.ids.forEach((r) => {
|
|
6434
6434
|
const a = s.nodesMap.get(r);
|
|
6435
6435
|
[
|
|
@@ -6437,7 +6437,7 @@ class ba {
|
|
|
6437
6437
|
a?.info?.box,
|
|
6438
6438
|
a?.box
|
|
6439
6439
|
].forEach((h) => {
|
|
6440
|
-
!(h instanceof
|
|
6440
|
+
!(h instanceof z) || h.isEmpty() || (i ? t.union(h.clone().applyMatrix4(o)) : (t.copy(h).applyMatrix4(o), i = !0));
|
|
6441
6441
|
});
|
|
6442
6442
|
});
|
|
6443
6443
|
}), i && this.zoomToModel(t);
|
|
@@ -6550,13 +6550,13 @@ function Ca(l) {
|
|
|
6550
6550
|
const M = p.get(y.url);
|
|
6551
6551
|
if (M == null)
|
|
6552
6552
|
return;
|
|
6553
|
-
const E =
|
|
6553
|
+
const E = De(l, y.url);
|
|
6554
6554
|
(y.lods ?? []).forEach((_) => {
|
|
6555
6555
|
let D = _.octreeBox;
|
|
6556
6556
|
b(i, D, y, M, E);
|
|
6557
6557
|
});
|
|
6558
6558
|
});
|
|
6559
|
-
const w = r.map((y) => k(y)).filter((y) => y instanceof
|
|
6559
|
+
const w = r.map((y) => k(y)).filter((y) => y instanceof R);
|
|
6560
6560
|
Xo(i);
|
|
6561
6561
|
const m = [
|
|
6562
6562
|
...x,
|
|
@@ -6568,7 +6568,7 @@ function Ca(l) {
|
|
|
6568
6568
|
return;
|
|
6569
6569
|
if (!M.threeBox) {
|
|
6570
6570
|
let H = 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(H.x, K.x), Math.min(H.y, K.y), Math.min(H.z, K.z)), v = new d(Math.max(K.x, H.x), Math.max(K.y, H.y), Math.max(K.z, H.z));
|
|
6571
|
-
M.threeBox = new
|
|
6571
|
+
M.threeBox = new z($, v).applyMatrix4(D);
|
|
6572
6572
|
}
|
|
6573
6573
|
const T = M.threeBox, N = y.ray.intersectsBox(T);
|
|
6574
6574
|
if (!(N == null || N == !1) && h?.doesBoxIntersectClippingRange?.(T) !== !1)
|
|
@@ -6609,7 +6609,7 @@ function Ca(l) {
|
|
|
6609
6609
|
});
|
|
6610
6610
|
}
|
|
6611
6611
|
function S(y, M) {
|
|
6612
|
-
if (!(y instanceof
|
|
6612
|
+
if (!(y instanceof R) || (y.parent == null && Ae(y, M), s && y.geometry.attributes.position.count >= 2e3))
|
|
6613
6613
|
return;
|
|
6614
6614
|
const E = y.uuid ?? y.id;
|
|
6615
6615
|
if (a.has(E))
|
|
@@ -6626,7 +6626,7 @@ function Ca(l) {
|
|
|
6626
6626
|
}), B());
|
|
6627
6627
|
}
|
|
6628
6628
|
function P(y, M, E, _, D) {
|
|
6629
|
-
if (!Array.isArray(M) || M.length < 2 || !(
|
|
6629
|
+
if (!Array.isArray(M) || M.length < 2 || !(Be(l, M[0]) instanceof W))
|
|
6630
6630
|
return;
|
|
6631
6631
|
const N = `instance:${M[0]}:${M[1]}`;
|
|
6632
6632
|
a.has(N) || (a.add(N), r.push({
|
|
@@ -6640,7 +6640,7 @@ function Ca(l) {
|
|
|
6640
6640
|
}), B());
|
|
6641
6641
|
}
|
|
6642
6642
|
function I(y) {
|
|
6643
|
-
return Array.isArray(y) ? y.filter((M) => Array.isArray(M) &&
|
|
6643
|
+
return Array.isArray(y) ? y.filter((M) => Array.isArray(M) && Be(l, M[0]) instanceof W) : [];
|
|
6644
6644
|
}
|
|
6645
6645
|
function B() {
|
|
6646
6646
|
if (r.sort((y, M) => y.distanceSq - M.distanceSq), r.length > 20) {
|
|
@@ -6654,7 +6654,7 @@ function Ca(l) {
|
|
|
6654
6654
|
function O(y, M, E, _) {
|
|
6655
6655
|
if (!Array.isArray(M) || M.length < 2 || y == null)
|
|
6656
6656
|
return null;
|
|
6657
|
-
const D =
|
|
6657
|
+
const D = Be(l, M[0]);
|
|
6658
6658
|
if (!(D instanceof W) || D.geometry == null)
|
|
6659
6659
|
return null;
|
|
6660
6660
|
const T = M[1], N = te(D, T);
|
|
@@ -6664,7 +6664,7 @@ function Ca(l) {
|
|
|
6664
6664
|
K.__pickMeshes instanceof Map || (K.__pickMeshes = /* @__PURE__ */ new Map());
|
|
6665
6665
|
const $ = `${M[0]}:${T}`;
|
|
6666
6666
|
let v = K.__pickMeshes.get($);
|
|
6667
|
-
return v instanceof
|
|
6667
|
+
return v instanceof R || (v = new R(D.geometry, D.material), K.__pickMeshes.set($, v)), Ae(v, H), v.userData.__instancePickMeta = {
|
|
6668
6668
|
url: E,
|
|
6669
6669
|
id: y.info?.id ?? y.id ?? y.infos[0].id,
|
|
6670
6670
|
instanceId: T,
|
|
@@ -6672,9 +6672,9 @@ function Ca(l) {
|
|
|
6672
6672
|
}, v;
|
|
6673
6673
|
}
|
|
6674
6674
|
function q(y, M, E) {
|
|
6675
|
-
if (y?.info?.box instanceof
|
|
6675
|
+
if (y?.info?.box instanceof z)
|
|
6676
6676
|
return y.info.box.clone().applyMatrix4(M);
|
|
6677
|
-
const _ =
|
|
6677
|
+
const _ = Be(l, E?.[0]);
|
|
6678
6678
|
if (!(_ instanceof W) || _.geometry == null)
|
|
6679
6679
|
return null;
|
|
6680
6680
|
_.geometry.boundingBox == null && _.geometry.computeBoundingBox();
|
|
@@ -6706,7 +6706,7 @@ function Ca(l) {
|
|
|
6706
6706
|
};
|
|
6707
6707
|
}
|
|
6708
6708
|
function ce(y, M) {
|
|
6709
|
-
return y.box instanceof
|
|
6709
|
+
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);
|
|
6710
6710
|
}
|
|
6711
6711
|
function ae(y, M) {
|
|
6712
6712
|
return g.get(y)?.has(M) || f.get(y)?.has(M);
|
|
@@ -6721,7 +6721,7 @@ function Ca(l) {
|
|
|
6721
6721
|
}), M;
|
|
6722
6722
|
}
|
|
6723
6723
|
function Ae(y, M) {
|
|
6724
|
-
y instanceof
|
|
6724
|
+
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)));
|
|
6725
6725
|
}
|
|
6726
6726
|
}, e;
|
|
6727
6727
|
}
|
|
@@ -6859,7 +6859,7 @@ class Aa {
|
|
|
6859
6859
|
console.warn("RangeScale: 无法将屏幕区域转换为世界坐标");
|
|
6860
6860
|
return;
|
|
6861
6861
|
}
|
|
6862
|
-
const c = new
|
|
6862
|
+
const c = new z();
|
|
6863
6863
|
for (const h of r)
|
|
6864
6864
|
c.expandByPoint(h);
|
|
6865
6865
|
if (c.isEmpty()) {
|
|
@@ -7270,7 +7270,7 @@ class Vi {
|
|
|
7270
7270
|
() => {
|
|
7271
7271
|
}
|
|
7272
7272
|
);
|
|
7273
|
-
const a = new
|
|
7273
|
+
const a = new R(s, o);
|
|
7274
7274
|
a.name = "groundMesh", a.receiveShadow = !0, a.castShadow = !1, a.position.y = -0.01, this.groundMesh = a, this.isWaterAddon = !1, this.groundGroup.add(a);
|
|
7275
7275
|
}
|
|
7276
7276
|
this.groundGroup.position.y = this.groundY, this.clock.start();
|
|
@@ -7452,7 +7452,7 @@ class _a {
|
|
|
7452
7452
|
fog: !1,
|
|
7453
7453
|
toneMapped: !0
|
|
7454
7454
|
});
|
|
7455
|
-
this.skybox = new
|
|
7455
|
+
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) => {
|
|
7456
7456
|
this.skybox?.position.copy(o.position);
|
|
7457
7457
|
}, this._updateSkyboxIntensity(), this.engine.scene.add(this.skybox);
|
|
7458
7458
|
}
|
|
@@ -7606,7 +7606,7 @@ class La {
|
|
|
7606
7606
|
opacity: this.PLANE_OPACITY,
|
|
7607
7607
|
side: re,
|
|
7608
7608
|
depthWrite: !1
|
|
7609
|
-
}), c = new
|
|
7609
|
+
}), c = new R(r, a);
|
|
7610
7610
|
c.position.y = s, o.add(c);
|
|
7611
7611
|
const h = [
|
|
7612
7612
|
new d(-this.halfSize, s, -this.halfSize),
|
|
@@ -7698,7 +7698,7 @@ class La {
|
|
|
7698
7698
|
min: { x: -this.halfSize, y: -this.halfSize, z: -this.halfSize },
|
|
7699
7699
|
max: { x: this.halfSize, y: this.halfSize, z: this.halfSize }
|
|
7700
7700
|
};
|
|
7701
|
-
const e = new
|
|
7701
|
+
const e = new z();
|
|
7702
7702
|
let t = !1;
|
|
7703
7703
|
return this.engine.models.forEach((i) => {
|
|
7704
7704
|
const n = i.boundingBox;
|
|
@@ -7945,7 +7945,7 @@ class Wa {
|
|
|
7945
7945
|
const a = new ge();
|
|
7946
7946
|
a.setAttribute("position", new At(s, 3));
|
|
7947
7947
|
const c = new Xt(a, this.material);
|
|
7948
|
-
c.url = i, this.setLineTransform(c,
|
|
7948
|
+
c.url = i, this.setLineTransform(c, De(this.engine, i)), this.groupEdge.add(c), this.highlightIndexes.set(i, o), this.releaseIndexes(i);
|
|
7949
7949
|
});
|
|
7950
7950
|
}
|
|
7951
7951
|
/**
|
|
@@ -7993,7 +7993,7 @@ class Wa {
|
|
|
7993
7993
|
const o = new ge();
|
|
7994
7994
|
o.setAttribute("position", new At(s, 3));
|
|
7995
7995
|
const r = new Xt(o, this.highlightEdgeMaterial);
|
|
7996
|
-
r.name = "highlightModelEdge", r.url = i.url, this.setLineTransform(r,
|
|
7996
|
+
r.name = "highlightModelEdge", r.url = i.url, this.setLineTransform(r, De(this.engine, i.url)), this.highlightEdgeGroup.add(r);
|
|
7997
7997
|
}));
|
|
7998
7998
|
}
|
|
7999
7999
|
appendEdgePositions(e, t) {
|
|
@@ -8970,7 +8970,7 @@ class Ka {
|
|
|
8970
8970
|
if (!s)
|
|
8971
8971
|
continue;
|
|
8972
8972
|
typeof s.updateMatrixWorld == "function" && s.updateMatrixWorld(!0);
|
|
8973
|
-
const o = new
|
|
8973
|
+
const o = new z().setFromObject(s);
|
|
8974
8974
|
!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));
|
|
8975
8975
|
}
|
|
8976
8976
|
return !Number.isFinite(t) || !Number.isFinite(i) ? null : { minY: t, maxY: i };
|
|
@@ -9000,7 +9000,7 @@ class Ka {
|
|
|
9000
9000
|
let t = this.engine.measure.annotationData.normalAnnotation.find((n) => n.isSelect == !0);
|
|
9001
9001
|
t == null && (t = {
|
|
9002
9002
|
text: null,
|
|
9003
|
-
id:
|
|
9003
|
+
id: ze(),
|
|
9004
9004
|
isSelect: !0,
|
|
9005
9005
|
type: "clear-height"
|
|
9006
9006
|
}, this.engine.measure.annotationData.normalAnnotation.push(t));
|
|
@@ -9072,7 +9072,7 @@ class ja {
|
|
|
9072
9072
|
if (t != null && this.points.length == 1) {
|
|
9073
9073
|
let i = this.engine.measure.annotationData.normalAnnotation.find((n) => n.isSelect == !0);
|
|
9074
9074
|
i == null && (i = {
|
|
9075
|
-
id:
|
|
9075
|
+
id: ze(),
|
|
9076
9076
|
point1: this.points[0].clone(),
|
|
9077
9077
|
point2: t.point.clone(),
|
|
9078
9078
|
text: this.points[0].clone().distanceTo(t.point.clone()),
|
|
@@ -9124,7 +9124,7 @@ class Ya {
|
|
|
9124
9124
|
let t = this.engine.measure.annotationData.normalAnnotation.find((o) => o.isSelect == !0);
|
|
9125
9125
|
t == null && (t = {
|
|
9126
9126
|
text: null,
|
|
9127
|
-
id:
|
|
9127
|
+
id: ze(),
|
|
9128
9128
|
isSelect: !0,
|
|
9129
9129
|
type: "clear-distance"
|
|
9130
9130
|
}, this.engine.measure.annotationData.normalAnnotation.push(t));
|
|
@@ -9172,7 +9172,7 @@ class Xa {
|
|
|
9172
9172
|
let t = this.engine.measure.annotationData.elevationAnnotation.find((i) => i.isSelect == !0);
|
|
9173
9173
|
if (t == null) {
|
|
9174
9174
|
t = {
|
|
9175
|
-
id:
|
|
9175
|
+
id: ze(),
|
|
9176
9176
|
point: e.catch.point.clone(),
|
|
9177
9177
|
text: e.catch.point.y,
|
|
9178
9178
|
isSelect: !0,
|
|
@@ -9220,7 +9220,7 @@ class Qa {
|
|
|
9220
9220
|
let t = this.engine.measure.annotationData.coordinateAnnotation.find((i) => i.isSelect == !0);
|
|
9221
9221
|
if (t == null) {
|
|
9222
9222
|
t = {
|
|
9223
|
-
id:
|
|
9223
|
+
id: ze(),
|
|
9224
9224
|
point: e.catch.point.clone(),
|
|
9225
9225
|
text: Math.round(e.catch.point.y) + " m",
|
|
9226
9226
|
isSelect: !0,
|
|
@@ -9288,7 +9288,7 @@ class $a {
|
|
|
9288
9288
|
if (e.catch != null && this.points.length != 1 && this.points.length == 2) {
|
|
9289
9289
|
let t = this.engine.measure.annotationData.angleAnnotation.find((i) => i.isSelect == !0);
|
|
9290
9290
|
t == null && (t = {
|
|
9291
|
-
id:
|
|
9291
|
+
id: ze(),
|
|
9292
9292
|
point1: this.points[0].clone(),
|
|
9293
9293
|
// 起点
|
|
9294
9294
|
point2: this.points[1].clone(),
|
|
@@ -9345,7 +9345,7 @@ class Za {
|
|
|
9345
9345
|
this.points.length === 0 && this.engine.measure.tools.clearHighlight(), this.points.push(t.point.clone());
|
|
9346
9346
|
let i = this.getCurrentDrawingMeasure();
|
|
9347
9347
|
i == null ? (i = {
|
|
9348
|
-
id:
|
|
9348
|
+
id: ze(),
|
|
9349
9349
|
points: this.points.map((n) => n.clone()),
|
|
9350
9350
|
area: 0,
|
|
9351
9351
|
text: 0,
|
|
@@ -9357,7 +9357,7 @@ class Za {
|
|
|
9357
9357
|
if (e.catch != null && this.points.length >= 1) {
|
|
9358
9358
|
let t = this.getCurrentDrawingMeasure();
|
|
9359
9359
|
t == null && (t = {
|
|
9360
|
-
id:
|
|
9360
|
+
id: ze(),
|
|
9361
9361
|
points: [],
|
|
9362
9362
|
area: 0,
|
|
9363
9363
|
text: 0,
|
|
@@ -9512,7 +9512,7 @@ class wt {
|
|
|
9512
9512
|
if (t != null && this.points.length == 1) {
|
|
9513
9513
|
let i = this.engine.measure.annotationData.slopeAnnotation.find((s) => s.isSelect == !0);
|
|
9514
9514
|
i == null && (i = {
|
|
9515
|
-
id:
|
|
9515
|
+
id: ze(),
|
|
9516
9516
|
point1: this.points[0].clone(),
|
|
9517
9517
|
// 起点
|
|
9518
9518
|
point2: this.getSlopeSnappedPoint(this.points[0], t, e),
|
|
@@ -9564,7 +9564,7 @@ class Ja {
|
|
|
9564
9564
|
return;
|
|
9565
9565
|
let s = this.engine.measure.annotationData.normalAnnotation.find((o) => o.isSelect == !0);
|
|
9566
9566
|
s == null && (s = {
|
|
9567
|
-
id:
|
|
9567
|
+
id: ze(),
|
|
9568
9568
|
type: "clear-distance",
|
|
9569
9569
|
isSelect: !0
|
|
9570
9570
|
}, 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);
|
|
@@ -9580,7 +9580,7 @@ class Ja {
|
|
|
9580
9580
|
return;
|
|
9581
9581
|
let s = this.engine.measure.annotationData.normalAnnotation.find((o) => o.isSelect == !0);
|
|
9582
9582
|
s == null && (s = {
|
|
9583
|
-
id:
|
|
9583
|
+
id: ze(),
|
|
9584
9584
|
point1: i.clone(),
|
|
9585
9585
|
point2: n.footPoint.clone(),
|
|
9586
9586
|
text: n.distance,
|
|
@@ -10168,7 +10168,7 @@ class tl {
|
|
|
10168
10168
|
opacity: this.faceIdleOpacity,
|
|
10169
10169
|
side: re
|
|
10170
10170
|
});
|
|
10171
|
-
m.polygonOffset = !0, m.polygonOffsetFactor = 1, m.polygonOffsetUnits = 4, h = new
|
|
10171
|
+
m.polygonOffset = !0, m.polygonOffsetFactor = 1, m.polygonOffsetUnits = 4, h = new R(r, m), h.name = n, e.add(h), this.meshs.push(h);
|
|
10172
10172
|
} else
|
|
10173
10173
|
h.geometry = r;
|
|
10174
10174
|
h.userData = {
|
|
@@ -10454,7 +10454,7 @@ class il {
|
|
|
10454
10454
|
opacity: this.idleOpacity,
|
|
10455
10455
|
side: re
|
|
10456
10456
|
});
|
|
10457
|
-
x.polygonOffset = !0, x.polygonOffsetFactor = 1, x.polygonOffsetUnits = 4, c = new
|
|
10457
|
+
x.polygonOffset = !0, x.polygonOffsetFactor = 1, x.polygonOffsetUnits = 4, c = new R(s, x), c.name = n, e.add(c), this.meshs.push(c);
|
|
10458
10458
|
} else
|
|
10459
10459
|
c.geometry = s;
|
|
10460
10460
|
c.normal = r.clone(), c.userData.excludeFromAmbientOcclusion = !0;
|
|
@@ -10900,7 +10900,7 @@ class sl {
|
|
|
10900
10900
|
e.normal.y * p * g,
|
|
10901
10901
|
e.normal.z * p * g
|
|
10902
10902
|
);
|
|
10903
|
-
const f = new
|
|
10903
|
+
const f = new R(u, this.fillMaterial);
|
|
10904
10904
|
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);
|
|
10905
10905
|
}
|
|
10906
10906
|
/**
|
|
@@ -10947,7 +10947,7 @@ class sl {
|
|
|
10947
10947
|
if (!(p?.instance === !0 || !Array.isArray(p?.infos)))
|
|
10948
10948
|
for (const g of p.infos) {
|
|
10949
10949
|
const f = g?.mesh;
|
|
10950
|
-
f instanceof
|
|
10950
|
+
f instanceof R && (i.has(f.uuid) || (i.add(f.uuid), t.push(f)));
|
|
10951
10951
|
}
|
|
10952
10952
|
}
|
|
10953
10953
|
}
|
|
@@ -10992,7 +10992,7 @@ class sl {
|
|
|
10992
10992
|
Math.max(t.y, i.y),
|
|
10993
10993
|
Math.max(t.z, i.z)
|
|
10994
10994
|
);
|
|
10995
|
-
return new
|
|
10995
|
+
return new z(n, s);
|
|
10996
10996
|
}
|
|
10997
10997
|
/**
|
|
10998
10998
|
* 候选 mesh 二次筛选:
|
|
@@ -11001,7 +11001,7 @@ class sl {
|
|
|
11001
11001
|
* - world bbox 必须与 plane 相交
|
|
11002
11002
|
*/
|
|
11003
11003
|
filterMeshesByBoxAndComplexity(e, t) {
|
|
11004
|
-
const i = [], n = new
|
|
11004
|
+
const i = [], n = new z();
|
|
11005
11005
|
for (const s of t) {
|
|
11006
11006
|
const o = s.geometry, r = o?.attributes?.position;
|
|
11007
11007
|
!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))));
|
|
@@ -11167,7 +11167,7 @@ class ol {
|
|
|
11167
11167
|
let o = new d(1e8, 1e9, 1e10), r = new d(-1e8, -1e9, -1e10);
|
|
11168
11168
|
return s.forEach((a) => {
|
|
11169
11169
|
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);
|
|
11170
|
-
}), new
|
|
11170
|
+
}), new z(o, r);
|
|
11171
11171
|
}
|
|
11172
11172
|
}
|
|
11173
11173
|
// ****************************更新剖切值*******************************
|
|
@@ -11240,7 +11240,7 @@ class ol {
|
|
|
11240
11240
|
const c = this.intersectThreePlanes(n[o], n[r], n[a]);
|
|
11241
11241
|
c && this.isPointInsidePlanes(c, n) && this.pushUniquePoint(s, c);
|
|
11242
11242
|
}
|
|
11243
|
-
return s.length === 0 ? null : new
|
|
11243
|
+
return s.length === 0 ? null : new z().setFromPoints(s);
|
|
11244
11244
|
}
|
|
11245
11245
|
getEffectiveClippingPlanes() {
|
|
11246
11246
|
const e = Array.isArray(this.engine.sectionPlane) ? this.engine.sectionPlane : [];
|
|
@@ -11253,7 +11253,7 @@ class ol {
|
|
|
11253
11253
|
return [];
|
|
11254
11254
|
}
|
|
11255
11255
|
toBox3(e) {
|
|
11256
|
-
return e == null || e.min == null || e.max == null ? null : new
|
|
11256
|
+
return e == null || e.min == null || e.max == null ? null : new z(
|
|
11257
11257
|
new d(e.min.x, e.min.y, e.min.z),
|
|
11258
11258
|
new d(e.max.x, e.max.y, e.max.z)
|
|
11259
11259
|
);
|
|
@@ -11398,7 +11398,7 @@ class al {
|
|
|
11398
11398
|
totalTriangles: 0,
|
|
11399
11399
|
meshCount: 0
|
|
11400
11400
|
} : (this.engine.scene.traverse((n) => {
|
|
11401
|
-
if (n instanceof
|
|
11401
|
+
if (n instanceof R) {
|
|
11402
11402
|
const s = n.geometry;
|
|
11403
11403
|
if (s && s.attributes) {
|
|
11404
11404
|
const o = s.attributes.position;
|
|
@@ -11789,10 +11789,10 @@ class dl {
|
|
|
11789
11789
|
return Array.isArray(e) ? e : e && typeof e == "object" ? Object.values(e) : [];
|
|
11790
11790
|
}
|
|
11791
11791
|
toBox3(e) {
|
|
11792
|
-
if (e instanceof
|
|
11792
|
+
if (e instanceof z) return e.clone();
|
|
11793
11793
|
const t = e?.min ?? e?.Min, i = e?.max ?? e?.Max;
|
|
11794
11794
|
if (!t || !i) return;
|
|
11795
|
-
const n = new
|
|
11795
|
+
const n = new z(
|
|
11796
11796
|
new d(t.x ?? t.X, t.y ?? t.Y, t.z ?? t.Z),
|
|
11797
11797
|
new d(i.x ?? i.X, i.y ?? i.Y, i.z ?? i.Z)
|
|
11798
11798
|
);
|
|
@@ -11963,7 +11963,7 @@ class gl {
|
|
|
11963
11963
|
this.appendBoxPositions(g.min, g.max, p);
|
|
11964
11964
|
});
|
|
11965
11965
|
});
|
|
11966
|
-
const r =
|
|
11966
|
+
const r = De(this.engine, i.url);
|
|
11967
11967
|
this.addLineGroup(i.url, n, this.meshMaterial, "mesh", r), this.addLineGroup(i.url, s, this.instanceMaterial, "instance", r);
|
|
11968
11968
|
}), this.rootGroup.visible = this.isVisible, this.engine.requestComposerRender?.();
|
|
11969
11969
|
}
|
|
@@ -12011,7 +12011,7 @@ class gl {
|
|
|
12011
12011
|
e?.box
|
|
12012
12012
|
], i = /* @__PURE__ */ new Set(), n = [];
|
|
12013
12013
|
return t.forEach((s) => {
|
|
12014
|
-
if (!(s instanceof
|
|
12014
|
+
if (!(s instanceof z) || s.isEmpty())
|
|
12015
12015
|
return;
|
|
12016
12016
|
const o = `${s.min.x},${s.min.y},${s.min.z},${s.max.x},${s.max.y},${s.max.z}`;
|
|
12017
12017
|
i.has(o) || (i.add(o), n.push(s));
|
|
@@ -12024,7 +12024,7 @@ class gl {
|
|
|
12024
12024
|
for (const i of t) {
|
|
12025
12025
|
if (!Array.isArray(i) || i.length === 0)
|
|
12026
12026
|
continue;
|
|
12027
|
-
if (
|
|
12027
|
+
if (Be(this.engine, i[0]) instanceof W)
|
|
12028
12028
|
return !0;
|
|
12029
12029
|
}
|
|
12030
12030
|
return !1;
|
|
@@ -13289,7 +13289,7 @@ class wl {
|
|
|
13289
13289
|
const i = e.ids.map((s) => t.nodesMap.get(s)).flatMap((s) => s?.infos?.map((o) => o?.box).filter(Boolean) ?? []);
|
|
13290
13290
|
if (i.length === 0)
|
|
13291
13291
|
return null;
|
|
13292
|
-
const n = new
|
|
13292
|
+
const n = new z();
|
|
13293
13293
|
n.copy(i[0]);
|
|
13294
13294
|
for (let s = 1; s < i.length; s++)
|
|
13295
13295
|
n.union(i[s]);
|
|
@@ -13787,7 +13787,7 @@ class kl {
|
|
|
13787
13787
|
const i = e?.nodesMap;
|
|
13788
13788
|
if (!(i instanceof Map))
|
|
13789
13789
|
return [];
|
|
13790
|
-
const n =
|
|
13790
|
+
const n = De(this.engine, e.url), s = [];
|
|
13791
13791
|
return i.forEach((o) => {
|
|
13792
13792
|
const r = this.normalizeName(this.getNodeName(o));
|
|
13793
13793
|
if (!r || !t.some((c) => r.includes(this.normalizeName(c))))
|
|
@@ -13820,7 +13820,7 @@ class kl {
|
|
|
13820
13820
|
];
|
|
13821
13821
|
let n = null;
|
|
13822
13822
|
return i.forEach((s) => {
|
|
13823
|
-
if (!(s instanceof
|
|
13823
|
+
if (!(s instanceof z) || s.isEmpty())
|
|
13824
13824
|
return;
|
|
13825
13825
|
const o = s.clone().applyMatrix4(t);
|
|
13826
13826
|
n ? n.union(o) : n = o;
|
|
@@ -13922,7 +13922,13 @@ const Ft = {
|
|
|
13922
13922
|
floorPlan: [Ft.floorPlan, "楼层"],
|
|
13923
13923
|
elevation: [Ft.elevation, "立面"],
|
|
13924
13924
|
section: [Ft.section, "剖面"]
|
|
13925
|
-
}
|
|
13925
|
+
}, Bl = [
|
|
13926
|
+
["CeilingPlans", "ceilingPlans"],
|
|
13927
|
+
["Elevations", "elevations"],
|
|
13928
|
+
["DynamicViews", "dynamicViews"],
|
|
13929
|
+
["FloorPlans", "floorPlans"],
|
|
13930
|
+
["Sections", "sections"]
|
|
13931
|
+
];
|
|
13926
13932
|
class Ui {
|
|
13927
13933
|
static OPEN_VIEW_ANIMATION_DURATION = 1e3;
|
|
13928
13934
|
engine;
|
|
@@ -13944,44 +13950,29 @@ class Ui {
|
|
|
13944
13950
|
}
|
|
13945
13951
|
/** 获取单个模型的视图树数据,并补充运行时生成的动态视图分类。 */
|
|
13946
13952
|
getViewTreeData(e) {
|
|
13947
|
-
const t = this.getResolvedViewTree(e), i =
|
|
13948
|
-
|
|
13949
|
-
|
|
13950
|
-
|
|
13951
|
-
floorPlans: [],
|
|
13952
|
-
sections: []
|
|
13953
|
-
};
|
|
13954
|
-
return t && ((t.CeilingPlans ?? []).forEach((n) => {
|
|
13955
|
-
i.ceilingPlans.push({
|
|
13956
|
-
id: n.Id,
|
|
13957
|
-
name: n.Name,
|
|
13958
|
-
url: e
|
|
13959
|
-
});
|
|
13960
|
-
}), (t.Elevations ?? []).forEach((n) => {
|
|
13961
|
-
i.elevations.push({
|
|
13962
|
-
id: n.Id,
|
|
13963
|
-
name: n.Name,
|
|
13964
|
-
url: e
|
|
13965
|
-
});
|
|
13966
|
-
}), (t.DynamicViews ?? []).forEach((n) => {
|
|
13967
|
-
i.dynamicViews.push({
|
|
13968
|
-
id: n.Id,
|
|
13969
|
-
name: n.Name,
|
|
13970
|
-
url: e
|
|
13971
|
-
});
|
|
13972
|
-
}), (t.FloorPlans ?? []).forEach((n) => {
|
|
13973
|
-
i.floorPlans.push({
|
|
13974
|
-
id: n.Id,
|
|
13975
|
-
name: n.Name,
|
|
13976
|
-
url: e
|
|
13953
|
+
const t = this.getResolvedViewTree(e), i = this.createEmptyViewTreeResult();
|
|
13954
|
+
return t && Bl.forEach(([n, s]) => {
|
|
13955
|
+
(t[n] ?? []).forEach((o) => {
|
|
13956
|
+
i[s].push(this.toViewTreeItem(o, e));
|
|
13977
13957
|
});
|
|
13978
|
-
}),
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
13983
|
-
|
|
13984
|
-
|
|
13958
|
+
}), i;
|
|
13959
|
+
}
|
|
13960
|
+
/**
|
|
13961
|
+
* 获取指定构件所属的动态视图,可选择直接切换到第一个匹配视图。
|
|
13962
|
+
* 仅使用动态视图的关注区域判断,不改变构件自身的显隐状态。
|
|
13963
|
+
*/
|
|
13964
|
+
getElementVisibleViews(e, t, i = !1) {
|
|
13965
|
+
const n = this.createEmptyViewTreeResult(), s = this.engine.models.find((h) => h.url === e);
|
|
13966
|
+
if (!s)
|
|
13967
|
+
return n;
|
|
13968
|
+
const o = this.findModelNode(s, t), r = this.getNodeWorldBox(s, o), a = this.getResolvedViewTree(e);
|
|
13969
|
+
if (!r || !a)
|
|
13970
|
+
return n;
|
|
13971
|
+
(a.DynamicViews ?? []).forEach((h) => {
|
|
13972
|
+
this.isBoxVisibleInDynamicView(r, h) && n.dynamicViews.push(this.toViewTreeItem(h, e));
|
|
13973
|
+
});
|
|
13974
|
+
const c = n.dynamicViews[0];
|
|
13975
|
+
return i && c && this.openView(c.url, c.id), n;
|
|
13985
13976
|
}
|
|
13986
13977
|
/** 打开指定视图,并根据视图类型决定是否启用剖切和正交投影。 */
|
|
13987
13978
|
openView(e, t) {
|
|
@@ -14031,7 +14022,7 @@ class Ui {
|
|
|
14031
14022
|
b,
|
|
14032
14023
|
S,
|
|
14033
14024
|
C ? void 0 : () => {
|
|
14034
|
-
s.focusBox instanceof
|
|
14025
|
+
s.focusBox instanceof z && !s.focusBox.isEmpty() ? this.engine.viewCube?.zoomToModel?.(s.focusBox, 0) : I && this.zoomToCurrentViewRange(0);
|
|
14035
14026
|
}
|
|
14036
14027
|
);
|
|
14037
14028
|
return;
|
|
@@ -14043,7 +14034,7 @@ class Ui {
|
|
|
14043
14034
|
b,
|
|
14044
14035
|
S,
|
|
14045
14036
|
C ? void 0 : () => {
|
|
14046
|
-
s.focusBox instanceof
|
|
14037
|
+
s.focusBox instanceof z && !s.focusBox.isEmpty() && this.engine.viewCube?.zoomToModel?.(s.focusBox, 0);
|
|
14047
14038
|
}
|
|
14048
14039
|
);
|
|
14049
14040
|
}
|
|
@@ -14051,6 +14042,53 @@ class Ui {
|
|
|
14051
14042
|
const t = this.engine.models.find((n) => n.url === e), i = t ? this.dynamicElevationViewGenerator.syncModelViews(t) : null;
|
|
14052
14043
|
return i || null;
|
|
14053
14044
|
}
|
|
14045
|
+
createEmptyViewTreeResult() {
|
|
14046
|
+
return {
|
|
14047
|
+
ceilingPlans: [],
|
|
14048
|
+
elevations: [],
|
|
14049
|
+
dynamicViews: [],
|
|
14050
|
+
floorPlans: [],
|
|
14051
|
+
sections: []
|
|
14052
|
+
};
|
|
14053
|
+
}
|
|
14054
|
+
toViewTreeItem(e, t) {
|
|
14055
|
+
return {
|
|
14056
|
+
id: e.Id ?? e.id,
|
|
14057
|
+
name: e.Name ?? e.name,
|
|
14058
|
+
url: t
|
|
14059
|
+
};
|
|
14060
|
+
}
|
|
14061
|
+
/** 兼容模型节点 Map 使用数字或字符串作为构件 ID。 */
|
|
14062
|
+
findModelNode(e, t) {
|
|
14063
|
+
const i = e?.nodesMap;
|
|
14064
|
+
if (!(i instanceof Map))
|
|
14065
|
+
return null;
|
|
14066
|
+
if (i.has(t))
|
|
14067
|
+
return i.get(t);
|
|
14068
|
+
const n = typeof t == "number" ? String(t) : Number(t);
|
|
14069
|
+
return (typeof n == "string" || Number.isFinite(n)) && i.has(n) ? i.get(n) : null;
|
|
14070
|
+
}
|
|
14071
|
+
/** 合并构件的局部包围盒,并转换到引擎世界坐标。 */
|
|
14072
|
+
getNodeWorldBox(e, t) {
|
|
14073
|
+
if (!t)
|
|
14074
|
+
return null;
|
|
14075
|
+
const i = [
|
|
14076
|
+
...Array.isArray(t.infos) ? t.infos.map((o) => o?.box) : [],
|
|
14077
|
+
t.info?.box,
|
|
14078
|
+
t.box
|
|
14079
|
+
], n = De(this.engine, e.url);
|
|
14080
|
+
let s = null;
|
|
14081
|
+
return i.forEach((o) => {
|
|
14082
|
+
if (!(o instanceof z) || o.isEmpty())
|
|
14083
|
+
return;
|
|
14084
|
+
const r = o.clone().applyMatrix4(n);
|
|
14085
|
+
s ? s.union(r) : s = r;
|
|
14086
|
+
}), s;
|
|
14087
|
+
}
|
|
14088
|
+
/** 构件包围盒与动态视图关注区域相交时,认为构件在该动态视图中可见。 */
|
|
14089
|
+
isBoxVisibleInDynamicView(e, t) {
|
|
14090
|
+
return t.__dynamic === !0 && t.focusBox instanceof z && !t.focusBox.isEmpty() && e.intersectsBox(t.focusBox);
|
|
14091
|
+
}
|
|
14054
14092
|
createViewRangePlanes(e, t) {
|
|
14055
14093
|
if (!e)
|
|
14056
14094
|
return null;
|
|
@@ -14118,7 +14156,7 @@ class Ui {
|
|
|
14118
14156
|
!t || t.isEmpty?.() || this.engine.viewCube?.zoomToModel?.(t, e);
|
|
14119
14157
|
}
|
|
14120
14158
|
}
|
|
14121
|
-
class
|
|
14159
|
+
class zl {
|
|
14122
14160
|
constructor(e) {
|
|
14123
14161
|
}
|
|
14124
14162
|
/** 3D 独立包不支持加载 2D 视图。 */
|
|
@@ -14129,16 +14167,16 @@ class Bl {
|
|
|
14129
14167
|
removeSectionPlane() {
|
|
14130
14168
|
}
|
|
14131
14169
|
}
|
|
14132
|
-
function
|
|
14170
|
+
function Rl(l, e, t = "bim-snapshot.png") {
|
|
14133
14171
|
const i = l?.renderer, n = i?.domElement;
|
|
14134
14172
|
if (!i || !n || !e)
|
|
14135
14173
|
return null;
|
|
14136
14174
|
const s = n.width || n.clientWidth, o = n.height || n.clientHeight;
|
|
14137
14175
|
if (s <= 0 || o <= 0)
|
|
14138
14176
|
return null;
|
|
14139
|
-
let r =
|
|
14140
|
-
if (!
|
|
14141
|
-
const p =
|
|
14177
|
+
let r = Ol(n, s, o);
|
|
14178
|
+
if (!Fl(r)) {
|
|
14179
|
+
const p = Nl(l, s, o);
|
|
14142
14180
|
p && (r = p);
|
|
14143
14181
|
}
|
|
14144
14182
|
const a = document.createElement("canvas");
|
|
@@ -14150,13 +14188,13 @@ function zl(l, e, t = "bim-snapshot.png") {
|
|
|
14150
14188
|
const h = a.toDataURL("image/png"), u = document.createElement("a");
|
|
14151
14189
|
return u.href = h, u.download = t.toLowerCase().endsWith(".png") ? t : `${t}.png`, u.click(), h;
|
|
14152
14190
|
}
|
|
14153
|
-
function
|
|
14191
|
+
function Ol(l, e, t) {
|
|
14154
14192
|
const i = document.createElement("canvas");
|
|
14155
14193
|
i.width = e, i.height = t;
|
|
14156
14194
|
const n = i.getContext("2d");
|
|
14157
14195
|
return n && n.drawImage(l, 0, 0, e, t), i;
|
|
14158
14196
|
}
|
|
14159
|
-
function
|
|
14197
|
+
function Fl(l) {
|
|
14160
14198
|
const e = l.getContext("2d");
|
|
14161
14199
|
if (!e || l.width <= 0 || l.height <= 0)
|
|
14162
14200
|
return !1;
|
|
@@ -14169,7 +14207,7 @@ function Ol(l) {
|
|
|
14169
14207
|
}
|
|
14170
14208
|
return !1;
|
|
14171
14209
|
}
|
|
14172
|
-
function
|
|
14210
|
+
function Nl(l, e, t) {
|
|
14173
14211
|
const i = l?.renderer, n = l?.scene, s = l?.camera;
|
|
14174
14212
|
if (!i || !n || !s)
|
|
14175
14213
|
return null;
|
|
@@ -14183,14 +14221,14 @@ function Fl(l, e, t) {
|
|
|
14183
14221
|
try {
|
|
14184
14222
|
i.xr && (i.xr.enabled = !1), i.autoClear = !0, i.setRenderTarget(o), i.clear(!0, !0, !0), i.render(n, s);
|
|
14185
14223
|
const h = new Uint8Array(e * t * 4);
|
|
14186
|
-
return i.readRenderTargetPixels(o, 0, 0, e, t, h),
|
|
14224
|
+
return i.readRenderTargetPixels(o, 0, 0, e, t, h), Hl(h, e, t);
|
|
14187
14225
|
} catch {
|
|
14188
14226
|
return null;
|
|
14189
14227
|
} finally {
|
|
14190
14228
|
i.setRenderTarget(r), i.autoClear = a, i.xr && (i.xr.enabled = c), o.dispose();
|
|
14191
14229
|
}
|
|
14192
14230
|
}
|
|
14193
|
-
function
|
|
14231
|
+
function Hl(l, e, t) {
|
|
14194
14232
|
const i = document.createElement("canvas");
|
|
14195
14233
|
i.width = e, i.height = t;
|
|
14196
14234
|
const n = i.getContext("2d");
|
|
@@ -14204,7 +14242,7 @@ function Nl(l, e, t) {
|
|
|
14204
14242
|
}
|
|
14205
14243
|
return n.putImageData(s, 0, 0), i;
|
|
14206
14244
|
}
|
|
14207
|
-
const
|
|
14245
|
+
const Vl = [
|
|
14208
14246
|
"#ffffff",
|
|
14209
14247
|
"#000000",
|
|
14210
14248
|
"#ff4d4f",
|
|
@@ -14215,7 +14253,7 @@ const Hl = [
|
|
|
14215
14253
|
"#1677ff",
|
|
14216
14254
|
"#722ed1",
|
|
14217
14255
|
"#eb2f96"
|
|
14218
|
-
],
|
|
14256
|
+
], Ul = {
|
|
14219
14257
|
none: ee("/assets/icon/选择.svg", import.meta.url),
|
|
14220
14258
|
line: ee("/assets/icon/线.svg", import.meta.url),
|
|
14221
14259
|
arrow: ee("/assets/icon/箭头.svg", import.meta.url),
|
|
@@ -14223,7 +14261,7 @@ const Hl = [
|
|
|
14223
14261
|
circle: ee("/assets/icon/圆形.svg", import.meta.url),
|
|
14224
14262
|
text: ee("/assets/icon/文字.svg", import.meta.url),
|
|
14225
14263
|
cloudline: ee("/assets/icon/云线.svg", import.meta.url)
|
|
14226
|
-
},
|
|
14264
|
+
}, Wl = ee("/assets/icon/测距.svg", import.meta.url), Gl = ee("/assets/icon/截图.svg", import.meta.url), ql = ee("/assets/icon/线宽.svg", import.meta.url), Kl = ee("/assets/icon/字号.svg", import.meta.url), jl = `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>')}`, Yl = [
|
|
14227
14265
|
{ type: "distance", label: "距离" },
|
|
14228
14266
|
{ type: "clearDistance", label: "净距" },
|
|
14229
14267
|
{ type: "clearHeight", label: "净高" },
|
|
@@ -14232,7 +14270,7 @@ const Hl = [
|
|
|
14232
14270
|
{ type: "angle", label: "角度" },
|
|
14233
14271
|
{ type: "area", label: "面积" },
|
|
14234
14272
|
{ type: "slope", label: "坡度" }
|
|
14235
|
-
],
|
|
14273
|
+
], Xl = {
|
|
14236
14274
|
distance: ee("/assets/icon/距离.svg", import.meta.url),
|
|
14237
14275
|
clearDistance: ee("/assets/icon/净距.svg", import.meta.url),
|
|
14238
14276
|
clearHeight: ee("/assets/icon/净高.svg", import.meta.url),
|
|
@@ -14242,7 +14280,7 @@ const Hl = [
|
|
|
14242
14280
|
area: ee("/assets/icon/面积.svg", import.meta.url),
|
|
14243
14281
|
slope: ee("/assets/icon/坡度.svg", import.meta.url)
|
|
14244
14282
|
};
|
|
14245
|
-
class
|
|
14283
|
+
class Ql {
|
|
14246
14284
|
constructor(e, t) {
|
|
14247
14285
|
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";
|
|
14248
14286
|
const i = document.createElement("div");
|
|
@@ -14255,7 +14293,7 @@ class Xl {
|
|
|
14255
14293
|
{ type: "text", label: "文字" },
|
|
14256
14294
|
{ type: "cloudline", label: "云线" }
|
|
14257
14295
|
].forEach((f) => {
|
|
14258
|
-
const x = this.createIconButton(f.label,
|
|
14296
|
+
const x = this.createIconButton(f.label, Ul[f.type]);
|
|
14259
14297
|
x.onclick = () => this.handlers.onDrawTypeChange(f.type), this.drawButtons[f.type] = x, i.appendChild(x);
|
|
14260
14298
|
});
|
|
14261
14299
|
const s = document.createElement("div");
|
|
@@ -14265,23 +14303,23 @@ class Xl {
|
|
|
14265
14303
|
this.updateColorControl(this.colorInput.value), this.handlers.onColorChange(this.colorInput.value), this.setColorPresetVisible(!1);
|
|
14266
14304
|
}, 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";
|
|
14267
14305
|
const r = document.createElement("div");
|
|
14268
|
-
r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px",
|
|
14306
|
+
r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px", Vl.forEach((f) => {
|
|
14269
14307
|
const x = document.createElement("button");
|
|
14270
14308
|
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 = () => {
|
|
14271
14309
|
this.updateColorControl(f), this.handlers.onColorChange(f), this.setColorPresetVisible(!1);
|
|
14272
14310
|
}, r.appendChild(x);
|
|
14273
14311
|
}), this.colorPresetPanel.appendChild(r);
|
|
14274
14312
|
const a = document.createElement("button");
|
|
14275
|
-
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,
|
|
14276
|
-
const c = this.createIconButton("截图",
|
|
14313
|
+
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, ql, "线宽")), 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, Kl, "字号")), this.distanceButton = this.createIconButton("测量", Wl), this.distanceButton.onclick = () => this.handlers.onMeasureToggle(), i.appendChild(this.distanceButton);
|
|
14314
|
+
const c = this.createIconButton("截图", Gl);
|
|
14277
14315
|
c.onclick = () => this.handlers.onScreenshot(), i.appendChild(c);
|
|
14278
|
-
const h = this.createIconButton("捕捉点",
|
|
14316
|
+
const h = this.createIconButton("捕捉点", jl);
|
|
14279
14317
|
h.onclick = () => this.handlers.onPickPoint(), i.appendChild(h);
|
|
14280
14318
|
const u = this.createTextButton("×", "取消");
|
|
14281
14319
|
u.onclick = () => this.handlers.onCancel(), u.style.background = "#ff4d4f", u.style.borderColor = "#ff4d4f", u.style.color = "#ffffff", i.appendChild(u);
|
|
14282
14320
|
const p = this.createTextButton("✔", "确定");
|
|
14283
|
-
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",
|
|
14284
|
-
const x = this.createSmallIconButton(f.label,
|
|
14321
|
+
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", Yl.forEach((f) => {
|
|
14322
|
+
const x = this.createSmallIconButton(f.label, Xl[f.type]);
|
|
14285
14323
|
x.onclick = () => this.handlers.onMeasureTypeChange(f.type), this.measureTypeButtons[f.type] = x, this.measureSubPanel.appendChild(x);
|
|
14286
14324
|
}), this.editPanel.appendChild(i), this.editPanel.appendChild(this.measureSubPanel);
|
|
14287
14325
|
const g = this.createTextButton("关闭", "关闭");
|
|
@@ -14406,7 +14444,7 @@ class Xl {
|
|
|
14406
14444
|
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;
|
|
14407
14445
|
}
|
|
14408
14446
|
}
|
|
14409
|
-
class
|
|
14447
|
+
class $l {
|
|
14410
14448
|
engine;
|
|
14411
14449
|
wrapper;
|
|
14412
14450
|
canvasEl;
|
|
@@ -14445,7 +14483,7 @@ class Ql {
|
|
|
14445
14483
|
const t = this.engine.container;
|
|
14446
14484
|
if (!t)
|
|
14447
14485
|
throw new Error("FabricDraw: engine container not found.");
|
|
14448
|
-
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
|
|
14486
|
+
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 Ql({
|
|
14449
14487
|
onDrawTypeChange: (n) => this.setDrawType(n),
|
|
14450
14488
|
onMeasureToggle: () => this.toggleMeasurePanel(),
|
|
14451
14489
|
onMeasureTypeChange: (n) => this.activateDistanceMeasure(n),
|
|
@@ -14594,7 +14632,7 @@ class Ql {
|
|
|
14594
14632
|
* 鎴浘淇濆瓨锛堟ā鍨?Fabric鎵规敞鍚堟垚锛夈€? */
|
|
14595
14633
|
saveScreenshot(e = "bim-snapshot.png") {
|
|
14596
14634
|
const t = this.canvas.lowerCanvasEl;
|
|
14597
|
-
return t ?
|
|
14635
|
+
return t ? Rl(this.engine, t, e) : null;
|
|
14598
14636
|
}
|
|
14599
14637
|
/**
|
|
14600
14638
|
* 鍚屾鐢诲竷灏哄銆? */
|
|
@@ -15078,7 +15116,7 @@ class Ql {
|
|
|
15078
15116
|
return JSON.parse(JSON.stringify(e));
|
|
15079
15117
|
}
|
|
15080
15118
|
}
|
|
15081
|
-
class
|
|
15119
|
+
class Zl {
|
|
15082
15120
|
engine;
|
|
15083
15121
|
capturePoint = null;
|
|
15084
15122
|
labelPrefix = "drawing-pin-label-";
|
|
@@ -15528,7 +15566,7 @@ class $l {
|
|
|
15528
15566
|
return e;
|
|
15529
15567
|
}
|
|
15530
15568
|
}
|
|
15531
|
-
const pi = "bim-engine:model-link-3d",
|
|
15569
|
+
const pi = "bim-engine:model-link-3d", Jl = "default-model-link-3d-group", In = "model-link-3d", _n = {
|
|
15532
15570
|
enabled: !1,
|
|
15533
15571
|
highlight: !0,
|
|
15534
15572
|
visibility: !0,
|
|
@@ -15537,7 +15575,7 @@ const pi = "bim-engine:model-link-3d", Zl = "default-model-link-3d-group", In =
|
|
|
15537
15575
|
cameraMode: "onStop",
|
|
15538
15576
|
cameraThrottleMs: 50
|
|
15539
15577
|
};
|
|
15540
|
-
class
|
|
15578
|
+
class ec {
|
|
15541
15579
|
viewerGuid;
|
|
15542
15580
|
engine;
|
|
15543
15581
|
options;
|
|
@@ -15601,7 +15639,7 @@ class Jl {
|
|
|
15601
15639
|
return {
|
|
15602
15640
|
..._n,
|
|
15603
15641
|
...e,
|
|
15604
|
-
groupId: e.groupId ?? this.engine?.options?.linkGroupId ??
|
|
15642
|
+
groupId: e.groupId ?? this.engine?.options?.linkGroupId ?? Jl,
|
|
15605
15643
|
modelId: e.modelId ?? this.engine?.options?.modelLinkId
|
|
15606
15644
|
};
|
|
15607
15645
|
}
|
|
@@ -15841,7 +15879,7 @@ class Jl {
|
|
|
15841
15879
|
}).filter((n) => n.ids.length > 0);
|
|
15842
15880
|
}
|
|
15843
15881
|
}
|
|
15844
|
-
class
|
|
15882
|
+
class tc {
|
|
15845
15883
|
engine;
|
|
15846
15884
|
manager;
|
|
15847
15885
|
worldToScreen;
|
|
@@ -15909,7 +15947,7 @@ class ec {
|
|
|
15909
15947
|
return e = this.engine.clipping?.filterIntersectionsByClipping?.(e) ?? e, e.filter((i) => i?.point instanceof d).sort((i, n) => i.distance - n.distance)[0] ?? null;
|
|
15910
15948
|
}
|
|
15911
15949
|
}
|
|
15912
|
-
class
|
|
15950
|
+
class ic {
|
|
15913
15951
|
/** 推进当前标记注册的材质与独立点动画。 */
|
|
15914
15952
|
updateRecord(e, t) {
|
|
15915
15953
|
const i = t + e.timeSeed;
|
|
@@ -15932,7 +15970,7 @@ class tc {
|
|
|
15932
15970
|
});
|
|
15933
15971
|
}
|
|
15934
15972
|
}
|
|
15935
|
-
class
|
|
15973
|
+
class nc {
|
|
15936
15974
|
engine;
|
|
15937
15975
|
rootGroup;
|
|
15938
15976
|
records;
|
|
@@ -16239,7 +16277,7 @@ const Ee = {
|
|
|
16239
16277
|
showBottom: !1,
|
|
16240
16278
|
edgeColor: "#d9ffff"
|
|
16241
16279
|
}
|
|
16242
|
-
},
|
|
16280
|
+
}, sc = {
|
|
16243
16281
|
background: "rgba(10, 18, 28, 0.92)",
|
|
16244
16282
|
color: "#ffffff",
|
|
16245
16283
|
border: "1px solid rgba(127, 252, 255, 0.72)",
|
|
@@ -16248,7 +16286,7 @@ const Ee = {
|
|
|
16248
16286
|
boxShadow: "0 10px 30px rgba(0, 0, 0, 0.32)",
|
|
16249
16287
|
minWidth: "120px",
|
|
16250
16288
|
pointerEvents: "auto"
|
|
16251
|
-
},
|
|
16289
|
+
}, oc = "bim-engine-annotation3d-panels";
|
|
16252
16290
|
function Gt(l) {
|
|
16253
16291
|
return l.map((e) => ({ x: e.x, y: e.y, z: e.z }));
|
|
16254
16292
|
}
|
|
@@ -16259,7 +16297,7 @@ function Nt(l) {
|
|
|
16259
16297
|
const e = new d();
|
|
16260
16298
|
return l.length === 0 ? e : (l.forEach((t) => e.add(J(t))), e.multiplyScalar(1 / l.length));
|
|
16261
16299
|
}
|
|
16262
|
-
function
|
|
16300
|
+
function rc(l) {
|
|
16263
16301
|
const e = new d();
|
|
16264
16302
|
for (let t = 0; t < l.length; t += 1) {
|
|
16265
16303
|
const i = l[t], n = l[(t + 1) % l.length];
|
|
@@ -16269,7 +16307,7 @@ function oc(l) {
|
|
|
16269
16307
|
}
|
|
16270
16308
|
function ws(l) {
|
|
16271
16309
|
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);
|
|
16272
|
-
let n =
|
|
16310
|
+
let n = rc(e);
|
|
16273
16311
|
n.lengthSq() < 1e-8 && (n = new d(0, 1, 0));
|
|
16274
16312
|
const s = new d().crossVectors(n, i).normalize(), o = new d().crossVectors(s, n).normalize(), r = e.map((c) => {
|
|
16275
16313
|
const h = c.clone().sub(t);
|
|
@@ -16287,12 +16325,12 @@ function bs(l) {
|
|
|
16287
16325
|
e.lineTo(t.x, t.y);
|
|
16288
16326
|
}), e.closePath(), e;
|
|
16289
16327
|
}
|
|
16290
|
-
function
|
|
16328
|
+
function ac(l, e) {
|
|
16291
16329
|
l.traverse((t) => {
|
|
16292
16330
|
t.userData = t.userData ?? {}, t.userData.annotationId = e;
|
|
16293
16331
|
});
|
|
16294
16332
|
}
|
|
16295
|
-
function
|
|
16333
|
+
function lc(l) {
|
|
16296
16334
|
l.traverse((e) => {
|
|
16297
16335
|
const t = e;
|
|
16298
16336
|
t.geometry?.dispose?.();
|
|
@@ -16304,13 +16342,13 @@ function ac(l) {
|
|
|
16304
16342
|
i?.dispose?.();
|
|
16305
16343
|
});
|
|
16306
16344
|
}
|
|
16307
|
-
function
|
|
16345
|
+
function cc(l) {
|
|
16308
16346
|
return l.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
16309
16347
|
}
|
|
16310
|
-
function
|
|
16348
|
+
function hc(l) {
|
|
16311
16349
|
return l === "polyline" || l === "curve3d" ? "center" : l === "polygon" ? "centroid" : "top";
|
|
16312
16350
|
}
|
|
16313
|
-
class
|
|
16351
|
+
class dc {
|
|
16314
16352
|
render(e) {
|
|
16315
16353
|
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, Ae = Math.max(ue - m, 14), y = c === "right" ? le : le + C, M = O + Math.round(S * 0.5), E = B === "vertical" ? [`${ae},${ue}`, `${ae},${Ae}`] : [`${ae},${ue}`, `${ae},${M}`, `${y},${M}`], _ = e.instance.selectable !== !1, D = _ ? "visiblePainted" : "none", T = _ ? "pointer" : "default", N = le + (h || !g ? 38 : 12), H = t.showBoard === !1 ? "" : `
|
|
16316
16354
|
<rect x="${le}" y="${O}" width="${C}" height="${S}" rx="10"
|
|
@@ -16364,7 +16402,7 @@ class hc {
|
|
|
16364
16402
|
return Math.max(Math.round((n.boardWidth ?? 4.6) * 22), Math.ceil(r), 78);
|
|
16365
16403
|
}
|
|
16366
16404
|
}
|
|
16367
|
-
class
|
|
16405
|
+
class uc {
|
|
16368
16406
|
/** 按标记类型重建内容,并返回相对三维锚点的布局参数。 */
|
|
16369
16407
|
render(e, t) {
|
|
16370
16408
|
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({
|
|
@@ -16437,10 +16475,10 @@ class dc {
|
|
|
16437
16475
|
return `rgba(${r >> 16 & 255}, ${r >> 8 & 255}, ${r & 255}, ${i})`;
|
|
16438
16476
|
}
|
|
16439
16477
|
}
|
|
16440
|
-
const
|
|
16441
|
-
class
|
|
16478
|
+
const pc = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]), mc = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint", "ripplePoint", "pillarPoint", "leaderPoint"]);
|
|
16479
|
+
class gc {
|
|
16442
16480
|
constructor(e, t) {
|
|
16443
|
-
this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className =
|
|
16481
|
+
this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className = oc, this.container.style.cssText = [
|
|
16444
16482
|
"position:absolute",
|
|
16445
16483
|
"left:0",
|
|
16446
16484
|
"top:0",
|
|
@@ -16453,8 +16491,8 @@ class mc {
|
|
|
16453
16491
|
}
|
|
16454
16492
|
container;
|
|
16455
16493
|
worldToScreen;
|
|
16456
|
-
leaderMarker = new
|
|
16457
|
-
pointContentMarker = new
|
|
16494
|
+
leaderMarker = new dc();
|
|
16495
|
+
pointContentMarker = new uc();
|
|
16458
16496
|
updateProjectionState() {
|
|
16459
16497
|
this.worldToScreen.updateCamera(this.engine.camera), this.worldToScreen.updateRenderer(this.engine.renderer), this.worldToScreen.updateScene(this.engine.scene);
|
|
16460
16498
|
}
|
|
@@ -16467,7 +16505,7 @@ class mc {
|
|
|
16467
16505
|
"transform:translate(-50%, -100%)",
|
|
16468
16506
|
"display:none",
|
|
16469
16507
|
t.interactive === !1 ? "pointer-events:none" : "pointer-events:auto"
|
|
16470
|
-
].join(";"), t.mode === "html" ? i.innerHTML = t.html ?? "" : i.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([n, s]) => i.style.setProperty(
|
|
16508
|
+
].join(";"), t.mode === "html" ? i.innerHTML = t.html ?? "" : i.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([n, s]) => i.style.setProperty(cc(n), s)), i;
|
|
16471
16509
|
}
|
|
16472
16510
|
createLeaderMarkerElement(e) {
|
|
16473
16511
|
const t = document.createElement("div");
|
|
@@ -16479,7 +16517,7 @@ class mc {
|
|
|
16479
16517
|
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;
|
|
16480
16518
|
}
|
|
16481
16519
|
updateRecord(e) {
|
|
16482
|
-
if (e.markerElement && e.instance.type === "leaderPoint" ? this.updateLeaderMarker(e) : e.markerElement &&
|
|
16520
|
+
if (e.markerElement && e.instance.type === "leaderPoint" ? this.updateLeaderMarker(e) : e.markerElement && pc.has(e.instance.type) && this.updatePointMarker(e), !e.panelElement || !e.instance.panel)
|
|
16483
16521
|
return;
|
|
16484
16522
|
const t = e.instance.panel;
|
|
16485
16523
|
if (!(t.visible !== !1 && this.shouldShowPanel(e)) || !e.instance.visible) {
|
|
@@ -16538,9 +16576,9 @@ class mc {
|
|
|
16538
16576
|
const t = e.instance.panel?.offset ?? {};
|
|
16539
16577
|
if (e.panelAnchorPoint)
|
|
16540
16578
|
return e.panelAnchorPoint.clone().add(new d(t.x ?? 0, t.y ?? 0, t.z ?? 0));
|
|
16541
|
-
const i = e.instance.panel?.anchor ??
|
|
16579
|
+
const i = e.instance.panel?.anchor ?? hc(e.instance.type);
|
|
16542
16580
|
let n = new d();
|
|
16543
|
-
if (
|
|
16581
|
+
if (mc.has(e.instance.type))
|
|
16544
16582
|
n.copy(J(e.instance.points[0])), i === "top" && (n.y += e.volumeHeight ?? 0);
|
|
16545
16583
|
else if (e.instance.type === "polyline" || e.instance.type === "curve3d")
|
|
16546
16584
|
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(Nt(e.instance.points));
|
|
@@ -16555,14 +16593,14 @@ class mc {
|
|
|
16555
16593
|
return n.add(new d(t.x ?? 0, t.y ?? 0, t.z ?? 0)), n;
|
|
16556
16594
|
}
|
|
16557
16595
|
}
|
|
16558
|
-
class
|
|
16596
|
+
class fc {
|
|
16559
16597
|
apply(e, t) {
|
|
16560
16598
|
e.instance.root.visible = e.instance.visible, e.instance.style.alwaysOnTop && e.instance.root.traverse((i) => {
|
|
16561
16599
|
i.renderOrder = Math.max(i.renderOrder, 1200);
|
|
16562
16600
|
}), t(e);
|
|
16563
16601
|
}
|
|
16564
16602
|
}
|
|
16565
|
-
class
|
|
16603
|
+
class yc {
|
|
16566
16604
|
constructor(e) {
|
|
16567
16605
|
this.engine = e;
|
|
16568
16606
|
}
|
|
@@ -16722,7 +16760,7 @@ class Ue {
|
|
|
16722
16760
|
createTubeMesh(e, t, i, n, s, o, r = 10, a = !1) {
|
|
16723
16761
|
const c = new Zs(t, i, n, r, a);
|
|
16724
16762
|
c.computeBoundingBox();
|
|
16725
|
-
const h = c.boundingBox ?? new
|
|
16763
|
+
const h = c.boundingBox ?? new z(new d(0, 0, 0), new d(1, 1, 1)), u = this.materialFactory.createSurfaceMaterial({
|
|
16726
16764
|
color: s.color ?? "#7ffcff",
|
|
16727
16765
|
opacity: s.opacity ?? 0.92,
|
|
16728
16766
|
style: s,
|
|
@@ -16730,7 +16768,7 @@ class Ue {
|
|
|
16730
16768
|
axisMode: "uvx",
|
|
16731
16769
|
axisMin: h.min.x,
|
|
16732
16770
|
axisMax: h.max.x
|
|
16733
|
-
}), p = new
|
|
16771
|
+
}), p = new R(c, u);
|
|
16734
16772
|
return e.animatedMaterials.push(u), p;
|
|
16735
16773
|
}
|
|
16736
16774
|
createLoopLine(e, t, i) {
|
|
@@ -16745,14 +16783,14 @@ class Ue {
|
|
|
16745
16783
|
return o.renderOrder = 998, o;
|
|
16746
16784
|
}
|
|
16747
16785
|
}
|
|
16748
|
-
class
|
|
16786
|
+
class Mc extends Ue {
|
|
16749
16787
|
type = "box";
|
|
16750
16788
|
build(e) {
|
|
16751
16789
|
if (e.instance.points.length < 2)
|
|
16752
16790
|
return;
|
|
16753
16791
|
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);
|
|
16754
16792
|
a.computeBoundingBox();
|
|
16755
|
-
const c = a.boundingBox ?? new
|
|
16793
|
+
const c = a.boundingBox ?? new z(
|
|
16756
16794
|
new d(-0.5, -0.5, -0.5),
|
|
16757
16795
|
new d(0.5, 0.5, 0.5)
|
|
16758
16796
|
), h = this.materialFactory.createSurfaceMaterial({
|
|
@@ -16763,7 +16801,7 @@ class yc extends Ue {
|
|
|
16763
16801
|
axisMode: "y",
|
|
16764
16802
|
axisMin: c.min.y,
|
|
16765
16803
|
axisMax: c.max.y
|
|
16766
|
-
}), u = new
|
|
16804
|
+
}), u = new R(a, h);
|
|
16767
16805
|
u.position.copy(r), e.instance.root.add(u);
|
|
16768
16806
|
const p = new He({
|
|
16769
16807
|
color: e.instance.style.volume?.edgeColor ?? "#d9ffff",
|
|
@@ -16776,7 +16814,7 @@ class yc extends Ue {
|
|
|
16776
16814
|
g.position.copy(r), e.instance.root.add(g), e.volumeHeight = o.y, e.animatedMaterials.push(h);
|
|
16777
16815
|
}
|
|
16778
16816
|
}
|
|
16779
|
-
class
|
|
16817
|
+
class vc extends Ue {
|
|
16780
16818
|
type = "curve3d";
|
|
16781
16819
|
build(e) {
|
|
16782
16820
|
const t = e.instance.points.map((r) => J(r)), i = e.instance.style.curve ?? {}, n = i.interpolation ?? "catmullRom", s = new to(
|
|
@@ -16797,7 +16835,7 @@ class Mc extends Ue {
|
|
|
16797
16835
|
e.instance.root.add(o), e.anchorCurve = s, e.panelAnchorPoint = s.getPoint(0.5);
|
|
16798
16836
|
}
|
|
16799
16837
|
}
|
|
16800
|
-
class
|
|
16838
|
+
class xc extends Ue {
|
|
16801
16839
|
type = "extrudePolygon";
|
|
16802
16840
|
build(e) {
|
|
16803
16841
|
const t = ws(e.instance.points), i = bs(t.localPoints), n = e.instance.style.volume?.height ?? 10, s = new Hn(i, {
|
|
@@ -16807,7 +16845,7 @@ class vc extends Ue {
|
|
|
16807
16845
|
curveSegments: 24
|
|
16808
16846
|
});
|
|
16809
16847
|
s.computeBoundingBox();
|
|
16810
|
-
const o = s.boundingBox ?? new
|
|
16848
|
+
const o = s.boundingBox ?? new z(new d(0, 0, 0), new d(1, 1, 1)), r = this.materialFactory.createSurfaceMaterial({
|
|
16811
16849
|
color: e.instance.style.fillColor ?? e.instance.style.color ?? "#7ffcff",
|
|
16812
16850
|
opacity: e.instance.style.fillOpacity ?? 0.22,
|
|
16813
16851
|
style: e.instance.style,
|
|
@@ -16815,7 +16853,7 @@ class vc extends Ue {
|
|
|
16815
16853
|
axisMode: "z",
|
|
16816
16854
|
axisMin: o.min.z,
|
|
16817
16855
|
axisMax: o.max.z
|
|
16818
|
-
}), a = new
|
|
16856
|
+
}), a = new R(s, r);
|
|
16819
16857
|
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(
|
|
16820
16858
|
this.createLoopLine(
|
|
16821
16859
|
e.instance.points,
|
|
@@ -16845,21 +16883,21 @@ class Wi extends Ue {
|
|
|
16845
16883
|
e.instance.root.position.copy(t), e.panelAnchorPoint = t.clone();
|
|
16846
16884
|
}
|
|
16847
16885
|
}
|
|
16848
|
-
class
|
|
16886
|
+
class wc extends Wi {
|
|
16849
16887
|
type = "iconPoint";
|
|
16850
16888
|
/** 将图标点绑定到首个世界坐标。 */
|
|
16851
16889
|
build(e) {
|
|
16852
16890
|
this.buildDomAnchor(e);
|
|
16853
16891
|
}
|
|
16854
16892
|
}
|
|
16855
|
-
class
|
|
16893
|
+
class bc extends Wi {
|
|
16856
16894
|
type = "iconTextPoint";
|
|
16857
16895
|
/** 将图文组合点绑定到首个世界坐标。 */
|
|
16858
16896
|
build(e) {
|
|
16859
16897
|
this.buildDomAnchor(e);
|
|
16860
16898
|
}
|
|
16861
16899
|
}
|
|
16862
|
-
class
|
|
16900
|
+
class Cc extends Ue {
|
|
16863
16901
|
type = "leaderPoint";
|
|
16864
16902
|
build(e) {
|
|
16865
16903
|
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();
|
|
@@ -16879,7 +16917,7 @@ class bc extends Ue {
|
|
|
16879
16917
|
];
|
|
16880
16918
|
}
|
|
16881
16919
|
}
|
|
16882
|
-
class
|
|
16920
|
+
class Ac extends Ue {
|
|
16883
16921
|
type = "pillarPoint";
|
|
16884
16922
|
/** 根据光柱专属参数创建柱体与可选底环。 */
|
|
16885
16923
|
build(e) {
|
|
@@ -16916,7 +16954,7 @@ class Cc extends Ue {
|
|
|
16916
16954
|
axisMode: "y",
|
|
16917
16955
|
axisMin: -s * 0.5,
|
|
16918
16956
|
axisMax: s * 0.5
|
|
16919
|
-
}), c = new
|
|
16957
|
+
}), c = new R(o, a);
|
|
16920
16958
|
if (c.position.y = s * 0.5, e.instance.root.add(c), e.animatedMaterials.push(a), t.showBaseRing !== !1) {
|
|
16921
16959
|
const h = new oe({
|
|
16922
16960
|
color: t.baseRingColor ?? r,
|
|
@@ -16927,7 +16965,7 @@ class Cc extends Ue {
|
|
|
16927
16965
|
depthWrite: !1
|
|
16928
16966
|
});
|
|
16929
16967
|
h.clippingPlanes = this.engine.sectionPlane;
|
|
16930
|
-
const u = new
|
|
16968
|
+
const u = new R(
|
|
16931
16969
|
new Gn(
|
|
16932
16970
|
Math.max(t.baseRingInnerRadius ?? 1.9, 1e-3),
|
|
16933
16971
|
Math.max(t.baseRingOuterRadius ?? 2.4, (t.baseRingInnerRadius ?? 1.9) + 1e-3),
|
|
@@ -16939,12 +16977,12 @@ class Cc extends Ue {
|
|
|
16939
16977
|
}
|
|
16940
16978
|
}
|
|
16941
16979
|
}
|
|
16942
|
-
class
|
|
16980
|
+
class Ec extends Ue {
|
|
16943
16981
|
type = "polygon";
|
|
16944
16982
|
build(e) {
|
|
16945
16983
|
const t = ws(e.instance.points), i = bs(t.localPoints), n = new no(i);
|
|
16946
16984
|
n.computeBoundingBox();
|
|
16947
|
-
const s = n.boundingBox ?? new
|
|
16985
|
+
const s = n.boundingBox ?? new z(new d(0, 0, 0), new d(1, 1, 1)), o = this.materialFactory.createSurfaceMaterial({
|
|
16948
16986
|
color: e.instance.style.fillColor ?? e.instance.style.color ?? "#7ffcff",
|
|
16949
16987
|
opacity: e.instance.style.fillOpacity ?? 0.18,
|
|
16950
16988
|
style: e.instance.style,
|
|
@@ -16952,7 +16990,7 @@ class Ac extends Ue {
|
|
|
16952
16990
|
axisMode: "y",
|
|
16953
16991
|
axisMin: s.min.y,
|
|
16954
16992
|
axisMax: s.max.y
|
|
16955
|
-
}), r = new
|
|
16993
|
+
}), r = new R(n, o);
|
|
16956
16994
|
r.applyMatrix4(t.matrix), e.instance.root.add(r), e.anchorNormal = t.normal, e.instance.style.polygon?.showEdge !== !1 && e.instance.root.add(
|
|
16957
16995
|
this.createLoopLine(
|
|
16958
16996
|
e.instance.points,
|
|
@@ -16962,7 +17000,7 @@ class Ac extends Ue {
|
|
|
16962
17000
|
), e.animatedMaterials.push(o);
|
|
16963
17001
|
}
|
|
16964
17002
|
}
|
|
16965
|
-
class
|
|
17003
|
+
class Sc extends Ue {
|
|
16966
17004
|
type = "polyline";
|
|
16967
17005
|
build(e) {
|
|
16968
17006
|
const t = e.instance.points.map((s) => J(s)), i = this.createSegmentCurve(t), n = this.createTubeMesh(
|
|
@@ -16976,7 +17014,7 @@ class Ec extends Ue {
|
|
|
16976
17014
|
e.instance.root.add(n), e.anchorCurve = i, e.panelAnchorPoint = i.getPoint(0.5);
|
|
16977
17015
|
}
|
|
16978
17016
|
}
|
|
16979
|
-
class
|
|
17017
|
+
class Pc extends Ue {
|
|
16980
17018
|
type = "ripplePoint";
|
|
16981
17019
|
/** 根据波纹参数创建中心点和错相扩散圆环。 */
|
|
16982
17020
|
build(e) {
|
|
@@ -16990,7 +17028,7 @@ class Sc extends Ue {
|
|
|
16990
17028
|
depthWrite: !1
|
|
16991
17029
|
});
|
|
16992
17030
|
c.clippingPlanes = this.engine.sectionPlane;
|
|
16993
|
-
const h = new
|
|
17031
|
+
const h = new R(
|
|
16994
17032
|
new Yt(Math.max(t.centerRadius ?? 0.28, 0.01), 20, 16),
|
|
16995
17033
|
c
|
|
16996
17034
|
);
|
|
@@ -17007,7 +17045,7 @@ class Sc extends Ue {
|
|
|
17007
17045
|
depthWrite: !1
|
|
17008
17046
|
});
|
|
17009
17047
|
h.clippingPlanes = this.engine.sectionPlane;
|
|
17010
|
-
const u = new
|
|
17048
|
+
const u = new R(
|
|
17011
17049
|
new Gn(Math.max(o - r, 1e-3), o, a),
|
|
17012
17050
|
h
|
|
17013
17051
|
);
|
|
@@ -17015,29 +17053,29 @@ class Sc extends Ue {
|
|
|
17015
17053
|
}
|
|
17016
17054
|
}
|
|
17017
17055
|
}
|
|
17018
|
-
class
|
|
17056
|
+
class Tc extends Wi {
|
|
17019
17057
|
type = "textPoint";
|
|
17020
17058
|
/** 将文字点绑定到首个世界坐标。 */
|
|
17021
17059
|
build(e) {
|
|
17022
17060
|
this.buildDomAnchor(e);
|
|
17023
17061
|
}
|
|
17024
17062
|
}
|
|
17025
|
-
function
|
|
17063
|
+
function Ic(l, e) {
|
|
17026
17064
|
return [
|
|
17027
|
-
new xc(l, e),
|
|
17028
|
-
new Pc(l, e),
|
|
17029
17065
|
new wc(l, e),
|
|
17030
|
-
new
|
|
17031
|
-
new Cc(l, e),
|
|
17066
|
+
new Tc(l, e),
|
|
17032
17067
|
new bc(l, e),
|
|
17033
|
-
new
|
|
17034
|
-
new Mc(l, e),
|
|
17068
|
+
new Pc(l, e),
|
|
17035
17069
|
new Ac(l, e),
|
|
17070
|
+
new Cc(l, e),
|
|
17071
|
+
new Sc(l, e),
|
|
17036
17072
|
new vc(l, e),
|
|
17037
|
-
new
|
|
17073
|
+
new Ec(l, e),
|
|
17074
|
+
new xc(l, e),
|
|
17075
|
+
new Mc(l, e)
|
|
17038
17076
|
];
|
|
17039
17077
|
}
|
|
17040
|
-
function
|
|
17078
|
+
function _c(l, e, t) {
|
|
17041
17079
|
const i = l.camera;
|
|
17042
17080
|
if (!i)
|
|
17043
17081
|
return !1;
|
|
@@ -17050,7 +17088,7 @@ function Ic(l, e, t) {
|
|
|
17050
17088
|
const r = o.sort((a, c) => a.distance - c.distance)[0];
|
|
17051
17089
|
return !!(r && r.distance < s - 0.05);
|
|
17052
17090
|
}
|
|
17053
|
-
class
|
|
17091
|
+
class Dc {
|
|
17054
17092
|
/** 归一化外部数据,并在创建几何前校验类型对应的必要输入。 */
|
|
17055
17093
|
normalizeData(e) {
|
|
17056
17094
|
const t = {
|
|
@@ -17184,7 +17222,7 @@ class _c {
|
|
|
17184
17222
|
offset: { ...e.offset ?? {} },
|
|
17185
17223
|
screenOffset: { ...e.screenOffset ?? {} },
|
|
17186
17224
|
className: e.className,
|
|
17187
|
-
style: { ...
|
|
17225
|
+
style: { ...sc, ...e.style ?? {} },
|
|
17188
17226
|
interactive: e.interactive ?? !0,
|
|
17189
17227
|
occlusion: e.occlusion ?? "show",
|
|
17190
17228
|
actions: e.actions
|
|
@@ -17223,11 +17261,11 @@ class _c {
|
|
|
17223
17261
|
}
|
|
17224
17262
|
}
|
|
17225
17263
|
}
|
|
17226
|
-
function
|
|
17264
|
+
function kc(l) {
|
|
17227
17265
|
const { actions: e, ...t } = l;
|
|
17228
17266
|
return t;
|
|
17229
17267
|
}
|
|
17230
|
-
function
|
|
17268
|
+
function Lc(l) {
|
|
17231
17269
|
return {
|
|
17232
17270
|
id: l.instance.id,
|
|
17233
17271
|
type: l.instance.type,
|
|
@@ -17243,7 +17281,7 @@ function kc(l) {
|
|
|
17243
17281
|
function Ht(l) {
|
|
17244
17282
|
return l === void 0 ? l : JSON.parse(JSON.stringify(l));
|
|
17245
17283
|
}
|
|
17246
|
-
class
|
|
17284
|
+
class Bc {
|
|
17247
17285
|
builders = /* @__PURE__ */ new Map();
|
|
17248
17286
|
constructor(e) {
|
|
17249
17287
|
e.forEach((t) => this.builders.set(t.type, t));
|
|
@@ -17255,8 +17293,8 @@ class Lc {
|
|
|
17255
17293
|
t.build(e);
|
|
17256
17294
|
}
|
|
17257
17295
|
}
|
|
17258
|
-
const
|
|
17259
|
-
class
|
|
17296
|
+
const zc = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]);
|
|
17297
|
+
class Rc {
|
|
17260
17298
|
constructor(e, t) {
|
|
17261
17299
|
this.markerRegistry = e, this.overlayController = t;
|
|
17262
17300
|
}
|
|
@@ -17271,7 +17309,7 @@ class zc {
|
|
|
17271
17309
|
selectable: e.selectable ?? !0,
|
|
17272
17310
|
style: e.style,
|
|
17273
17311
|
effect: e.effect ?? {},
|
|
17274
|
-
panel: e.panel ?
|
|
17312
|
+
panel: e.panel ? kc(e.panel) : void 0,
|
|
17275
17313
|
data: e.data,
|
|
17276
17314
|
panelVisible: e.panel?.trigger === "always",
|
|
17277
17315
|
hovered: !1,
|
|
@@ -17280,37 +17318,37 @@ class zc {
|
|
|
17280
17318
|
instance: i,
|
|
17281
17319
|
actions: e.panel?.actions,
|
|
17282
17320
|
panelElement: e.panel ? this.overlayController.createPanelElement(i, e.panel) : null,
|
|
17283
|
-
markerElement: e.type === "leaderPoint" ? this.overlayController.createLeaderMarkerElement(i) :
|
|
17321
|
+
markerElement: e.type === "leaderPoint" ? this.overlayController.createLeaderMarkerElement(i) : zc.has(e.type) ? this.overlayController.createPointMarkerElement(i) : null,
|
|
17284
17322
|
timeSeed: Math.random() * Math.PI * 2,
|
|
17285
17323
|
pulseMaterials: [],
|
|
17286
17324
|
rippleMeshes: [],
|
|
17287
17325
|
baseRingMeshes: [],
|
|
17288
17326
|
animatedMaterials: []
|
|
17289
17327
|
};
|
|
17290
|
-
return this.markerRegistry.build(n),
|
|
17328
|
+
return this.markerRegistry.build(n), ac(t, i.id), n;
|
|
17291
17329
|
}
|
|
17292
17330
|
}
|
|
17293
|
-
class
|
|
17331
|
+
class Oc {
|
|
17294
17332
|
engine;
|
|
17295
17333
|
rootGroup;
|
|
17296
17334
|
records = /* @__PURE__ */ new Map();
|
|
17297
17335
|
occlusionRaycaster = new fe();
|
|
17298
|
-
normalizer = new
|
|
17336
|
+
normalizer = new Dc();
|
|
17299
17337
|
materialFactory;
|
|
17300
17338
|
overlayController;
|
|
17301
17339
|
interactionController;
|
|
17302
17340
|
effectsController;
|
|
17303
|
-
visibilityController = new
|
|
17341
|
+
visibilityController = new fc();
|
|
17304
17342
|
markerRegistry;
|
|
17305
17343
|
recordFactory;
|
|
17306
17344
|
currentTime = 0;
|
|
17307
17345
|
constructor(e) {
|
|
17308
|
-
this.engine = e, this.rootGroup = new de(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new
|
|
17346
|
+
this.engine = e, this.rootGroup = new de(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new yc(this.engine), this.overlayController = new gc(
|
|
17309
17347
|
this.engine,
|
|
17310
|
-
(t) =>
|
|
17311
|
-
), this.markerRegistry = new
|
|
17312
|
-
|
|
17313
|
-
), this.recordFactory = new
|
|
17348
|
+
(t) => _c(this.engine, this.occlusionRaycaster, t)
|
|
17349
|
+
), this.markerRegistry = new Bc(
|
|
17350
|
+
Ic(this.engine, this.materialFactory)
|
|
17351
|
+
), this.recordFactory = new Rc(this.markerRegistry, this.overlayController), this.effectsController = new ic(), this.interactionController = new nc({
|
|
17314
17352
|
engine: this.engine,
|
|
17315
17353
|
rootGroup: this.rootGroup,
|
|
17316
17354
|
records: this.records,
|
|
@@ -17411,7 +17449,7 @@ class Rc {
|
|
|
17411
17449
|
return this.update(e, { panel: n });
|
|
17412
17450
|
}
|
|
17413
17451
|
getData() {
|
|
17414
|
-
return Array.from(this.records.values()).map((e) =>
|
|
17452
|
+
return Array.from(this.records.values()).map((e) => Lc(e));
|
|
17415
17453
|
}
|
|
17416
17454
|
restoreData(e) {
|
|
17417
17455
|
this.clear(), e.forEach((t) => this.add(t));
|
|
@@ -17429,7 +17467,7 @@ class Rc {
|
|
|
17429
17467
|
}
|
|
17430
17468
|
removeInternal(e, t) {
|
|
17431
17469
|
const i = this.records.get(e);
|
|
17432
|
-
return i ? (this.interactionController.handleRecordRemoved(e),
|
|
17470
|
+
return i ? (this.interactionController.handleRecordRemoved(e), lc(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;
|
|
17433
17471
|
}
|
|
17434
17472
|
toEventPayload(e, t) {
|
|
17435
17473
|
return { id: e.instance.id, annotation: e.instance, originalEvent: t };
|
|
@@ -17708,7 +17746,7 @@ class lt {
|
|
|
17708
17746
|
min: i.boundingBox.min.clone(),
|
|
17709
17747
|
max: i.boundingBox.max.clone()
|
|
17710
17748
|
});
|
|
17711
|
-
const n = new
|
|
17749
|
+
const n = new z(
|
|
17712
17750
|
i.localBoundingBox.min.clone(),
|
|
17713
17751
|
i.localBoundingBox.max.clone()
|
|
17714
17752
|
);
|
|
@@ -17719,7 +17757,7 @@ class lt {
|
|
|
17719
17757
|
}
|
|
17720
17758
|
clearRuntimeWorldBoxCache(e) {
|
|
17721
17759
|
e.traverse((t) => {
|
|
17722
|
-
t?.box instanceof
|
|
17760
|
+
t?.box instanceof z && delete t.box;
|
|
17723
17761
|
});
|
|
17724
17762
|
}
|
|
17725
17763
|
toThreeMatrix(e) {
|
|
@@ -17764,8 +17802,8 @@ class lt {
|
|
|
17764
17802
|
return "x" in e ? new d(e.x, e.y, e.z) : new d(e.X, e.Y, e.Z);
|
|
17765
17803
|
}
|
|
17766
17804
|
}
|
|
17767
|
-
const
|
|
17768
|
-
class
|
|
17805
|
+
const Fc = 1e-3, Nc = 0.65, Hc = 1;
|
|
17806
|
+
class Vc {
|
|
17769
17807
|
engine;
|
|
17770
17808
|
loader;
|
|
17771
17809
|
dracoLoader;
|
|
@@ -18077,7 +18115,7 @@ class Hc {
|
|
|
18077
18115
|
}
|
|
18078
18116
|
/** 透视相机使用更小的屏幕尺寸系数,正交相机维持原有尺寸。 */
|
|
18079
18117
|
syncTransformControlCamera() {
|
|
18080
|
-
!this.transformControl || !this.engine.camera || (this.transformControl.camera = this.engine.camera, this.transformControl.size = this.engine.camera.isPerspectiveCamera ?
|
|
18118
|
+
!this.transformControl || !this.engine.camera || (this.transformControl.camera = this.engine.camera, this.transformControl.size = this.engine.camera.isPerspectiveCamera ? Nc : Hc);
|
|
18081
18119
|
}
|
|
18082
18120
|
/** 使用引擎统一的捕捉器等待用户单击,并在取消或完成后恢复常规交互。 */
|
|
18083
18121
|
pickPlacementPoint(e, t) {
|
|
@@ -18116,7 +18154,7 @@ class Hc {
|
|
|
18116
18154
|
const i = t.clone(), n = e?.normal ?? e?.face?.normal;
|
|
18117
18155
|
if (n == null) return { position: i, normal: null };
|
|
18118
18156
|
const s = n.clone(), o = e?.matrix ?? e?.object?.matrixWorld;
|
|
18119
|
-
return o && s.transformDirection(o), s.lengthSq() < 1e-10 ? { position: i, normal: null } : (s.normalize(), i.addScaledVector(s,
|
|
18157
|
+
return o && s.transformDirection(o), s.lengthSq() < 1e-10 ? { position: i, normal: null } : (s.normalize(), i.addScaledVector(s, Fc), { position: i, normal: s });
|
|
18120
18158
|
}
|
|
18121
18159
|
handlePointerDown(e) {
|
|
18122
18160
|
if (!(!this.editingEnabled || !this.engine.camera || !this.engine.renderer)) {
|
|
@@ -18274,7 +18312,7 @@ class mi extends Error {
|
|
|
18274
18312
|
super("模型对比已取消"), this.name = "ModelComparisonCancelledError";
|
|
18275
18313
|
}
|
|
18276
18314
|
}
|
|
18277
|
-
class
|
|
18315
|
+
class Uc {
|
|
18278
18316
|
constructor(e) {
|
|
18279
18317
|
this.engine = e;
|
|
18280
18318
|
}
|
|
@@ -18713,7 +18751,7 @@ class Vc {
|
|
|
18713
18751
|
}
|
|
18714
18752
|
}
|
|
18715
18753
|
const Dn = "__modelExplodeProxy", kn = new V().makeScale(0, 0, 0);
|
|
18716
|
-
class
|
|
18754
|
+
class Wc {
|
|
18717
18755
|
engine;
|
|
18718
18756
|
/** 当前是否处于炸开模式;供外部滑块、交互模块判断是否需要走代理逻辑。 */
|
|
18719
18757
|
active = !1;
|
|
@@ -18856,10 +18894,10 @@ class Uc {
|
|
|
18856
18894
|
* 这里以代理对象的实时 matrixWorld 为准,因此滑块拖动和动画过程中也能得到正确位置。
|
|
18857
18895
|
*/
|
|
18858
18896
|
getExplodedWorldBox(e, t) {
|
|
18859
|
-
const i = new
|
|
18897
|
+
const i = new z().makeEmpty();
|
|
18860
18898
|
let n = !1;
|
|
18861
18899
|
return this.records.forEach((s) => {
|
|
18862
|
-
s.url !== e || !this.isSameId(s.id, t) || !s.proxy.visible || (s.proxy.updateWorldMatrix(!0, !1), i.union(new
|
|
18900
|
+
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);
|
|
18863
18901
|
}), n && !i.isEmpty() ? i : null;
|
|
18864
18902
|
}
|
|
18865
18903
|
/**
|
|
@@ -18893,7 +18931,7 @@ class Uc {
|
|
|
18893
18931
|
* 这里提前缓存整体包围盒、模型中心和分组包围盒,避免每个构件重复遍历 nodesMap。
|
|
18894
18932
|
*/
|
|
18895
18933
|
buildExplodeContext(e, t) {
|
|
18896
|
-
const i = new
|
|
18934
|
+
const i = new z().makeEmpty(), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
18897
18935
|
return e.forEach((r) => {
|
|
18898
18936
|
const a = this.getEngineModel(r.url), c = this.getModelWorldBox(a);
|
|
18899
18937
|
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) => {
|
|
@@ -18902,7 +18940,7 @@ class Uc {
|
|
|
18902
18940
|
return;
|
|
18903
18941
|
i.union(p);
|
|
18904
18942
|
const g = this.getGroupKey(r.url, h, t.mode);
|
|
18905
|
-
n.has(g) || n.set(g, new
|
|
18943
|
+
n.has(g) || n.set(g, new z().makeEmpty()), n.get(g)?.union(p);
|
|
18906
18944
|
});
|
|
18907
18945
|
}), {
|
|
18908
18946
|
box: i,
|
|
@@ -18948,8 +18986,8 @@ class Uc {
|
|
|
18948
18986
|
createRecord(e, t, i, n) {
|
|
18949
18987
|
if (!Array.isArray(i) || i.length < 2)
|
|
18950
18988
|
return;
|
|
18951
|
-
const s =
|
|
18952
|
-
if (!(s instanceof
|
|
18989
|
+
const s = Be(this.engine, i[0]);
|
|
18990
|
+
if (!(s instanceof R))
|
|
18953
18991
|
return;
|
|
18954
18992
|
const o = s instanceof W ? "instance" : "mesh", r = o === "instance" ? this.createInstanceProxy(s, i[1], e, t) : this.createMeshProxy(s, i[1], e, t);
|
|
18955
18993
|
if (r == null)
|
|
@@ -18976,7 +19014,7 @@ class Uc {
|
|
|
18976
19014
|
const s = Array.isArray(e.geometrys) ? e.geometrys[t] : null;
|
|
18977
19015
|
if (!(s instanceof ge))
|
|
18978
19016
|
return null;
|
|
18979
|
-
const o = new
|
|
19017
|
+
const o = new R(s.clone(), this.cloneProxyMaterial(e.material));
|
|
18980
19018
|
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;
|
|
18981
19019
|
}
|
|
18982
19020
|
/**
|
|
@@ -18991,7 +19029,7 @@ class Uc {
|
|
|
18991
19029
|
return null;
|
|
18992
19030
|
const o = e.geometry.clone();
|
|
18993
19031
|
o.applyMatrix4(s);
|
|
18994
|
-
const r = new
|
|
19032
|
+
const r = new R(o, this.cloneProxyMaterial(e.material));
|
|
18995
19033
|
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;
|
|
18996
19034
|
}
|
|
18997
19035
|
/** 给代理对象写入稳定交互身份,避免依赖 name 的字符串化 id。 */
|
|
@@ -19136,17 +19174,17 @@ class Uc {
|
|
|
19136
19174
|
...Array.isArray(t?.infos) ? t.infos.map((o) => o?.box) : [],
|
|
19137
19175
|
t?.info?.box,
|
|
19138
19176
|
t?.box
|
|
19139
|
-
].filter((o) => o instanceof
|
|
19177
|
+
].filter((o) => o instanceof z && !o.isEmpty());
|
|
19140
19178
|
if (i.length === 0)
|
|
19141
19179
|
return null;
|
|
19142
|
-
const n =
|
|
19180
|
+
const n = De(this.engine, e.url), s = new z().makeEmpty();
|
|
19143
19181
|
return i.forEach((o) => s.union(o.clone().applyMatrix4(n))), s.isEmpty() ? null : s;
|
|
19144
19182
|
}
|
|
19145
19183
|
/** 计算单个模型在世界坐标下的整体包围盒,作为默认爆炸原点的依据。 */
|
|
19146
19184
|
getModelWorldBox(e) {
|
|
19147
19185
|
if (e?.nodesMap == null)
|
|
19148
19186
|
return null;
|
|
19149
|
-
const t = new
|
|
19187
|
+
const t = new z().makeEmpty();
|
|
19150
19188
|
return e.nodesMap.forEach((i) => {
|
|
19151
19189
|
const n = this.getNodeWorldBox(e, i);
|
|
19152
19190
|
n != null && !n.isEmpty() && t.union(n);
|
|
@@ -19247,7 +19285,7 @@ const Ln = "bim-material-editor-style", tt = [
|
|
|
19247
19285
|
bumpMap: "凹凸贴图",
|
|
19248
19286
|
emissiveMap: "自发光贴图"
|
|
19249
19287
|
};
|
|
19250
|
-
class
|
|
19288
|
+
class Gc {
|
|
19251
19289
|
constructor(e) {
|
|
19252
19290
|
this.engine = e;
|
|
19253
19291
|
}
|
|
@@ -19278,7 +19316,7 @@ class Wc {
|
|
|
19278
19316
|
collectFromNode(e) {
|
|
19279
19317
|
const t = /* @__PURE__ */ new Map();
|
|
19280
19318
|
return (Array.isArray(e?.indexes) ? e.indexes : []).forEach((s) => {
|
|
19281
|
-
const o =
|
|
19319
|
+
const o = Be(this.engine, s?.[0]);
|
|
19282
19320
|
o instanceof dt && this.getObjectMaterials(o).forEach((r) => this.mergeMaterialOption(t, r, [o]));
|
|
19283
19321
|
}), (Array.isArray(e?.infos) ? e.infos : []).forEach((s) => {
|
|
19284
19322
|
const o = s?.mesh;
|
|
@@ -19353,7 +19391,7 @@ function Cs(l) {
|
|
|
19353
19391
|
function gt(l) {
|
|
19354
19392
|
return l instanceof Ye ? ei(l) || l.uuid : l;
|
|
19355
19393
|
}
|
|
19356
|
-
function
|
|
19394
|
+
function qc(l) {
|
|
19357
19395
|
const e = l, t = {
|
|
19358
19396
|
type: l.type,
|
|
19359
19397
|
name: l.name || l.type,
|
|
@@ -19369,7 +19407,7 @@ function Gc(l) {
|
|
|
19369
19407
|
i in e && (t[i] = gt(e[i]) ?? null);
|
|
19370
19408
|
}), JSON.stringify(t);
|
|
19371
19409
|
}
|
|
19372
|
-
function
|
|
19410
|
+
function Kc(l, e) {
|
|
19373
19411
|
const t = Cs(l), i = {};
|
|
19374
19412
|
return Object.entries(e.values).forEach(([n, s]) => {
|
|
19375
19413
|
const o = t[n];
|
|
@@ -19414,7 +19452,7 @@ function Vt(l) {
|
|
|
19414
19452
|
}))
|
|
19415
19453
|
};
|
|
19416
19454
|
}
|
|
19417
|
-
class
|
|
19455
|
+
class jc {
|
|
19418
19456
|
constructor(e, t) {
|
|
19419
19457
|
this.engine = e, this.host = t;
|
|
19420
19458
|
}
|
|
@@ -19621,7 +19659,7 @@ class Kc {
|
|
|
19621
19659
|
`, document.head.appendChild(e);
|
|
19622
19660
|
}
|
|
19623
19661
|
}
|
|
19624
|
-
class
|
|
19662
|
+
class Yc {
|
|
19625
19663
|
constructor(e) {
|
|
19626
19664
|
this.collectSceneMaterials = e;
|
|
19627
19665
|
}
|
|
@@ -19652,7 +19690,7 @@ class jc {
|
|
|
19652
19690
|
const i = this.baselineSnapshots.get(t.material.uuid);
|
|
19653
19691
|
if (i == null)
|
|
19654
19692
|
return;
|
|
19655
|
-
const n =
|
|
19693
|
+
const n = Kc(t.material, i);
|
|
19656
19694
|
Object.keys(n).length !== 0 && e.push({
|
|
19657
19695
|
id: t.material.uuid,
|
|
19658
19696
|
name: t.material.name || i.name,
|
|
@@ -19669,13 +19707,13 @@ class jc {
|
|
|
19669
19707
|
}), e.needsUpdate = !0, !0);
|
|
19670
19708
|
}
|
|
19671
19709
|
}
|
|
19672
|
-
class
|
|
19710
|
+
class Xc {
|
|
19673
19711
|
constructor(e, t = {}) {
|
|
19674
19712
|
this.engine = e, this.options = {
|
|
19675
19713
|
visible: t.visible ?? !1,
|
|
19676
19714
|
title: t.title ?? "材质编辑器",
|
|
19677
19715
|
width: t.width ?? 340
|
|
19678
|
-
}, this.visible = this.options.visible, this.collector = new
|
|
19716
|
+
}, this.visible = this.options.visible, this.collector = new Gc(e), this.snapshots = new Yc(() => this.collectSceneMaterials()), this.panel = new jc(e, this);
|
|
19679
19717
|
}
|
|
19680
19718
|
options;
|
|
19681
19719
|
selectedMaterials = [];
|
|
@@ -19817,7 +19855,7 @@ class Yc {
|
|
|
19817
19855
|
dedupeMaterials(e) {
|
|
19818
19856
|
const t = /* @__PURE__ */ new Map();
|
|
19819
19857
|
return e.forEach((i) => {
|
|
19820
|
-
const n =
|
|
19858
|
+
const n = qc(i.material), s = t.get(n);
|
|
19821
19859
|
if (s == null) {
|
|
19822
19860
|
t.set(n, { material: i.material, materials: [i.material], owners: [...i.owners] });
|
|
19823
19861
|
return;
|
|
@@ -19857,7 +19895,7 @@ class Yc {
|
|
|
19857
19895
|
this.ownedTextures.forEach((e) => e.dispose()), this.ownedTextures.clear();
|
|
19858
19896
|
}
|
|
19859
19897
|
}
|
|
19860
|
-
class
|
|
19898
|
+
class Qc {
|
|
19861
19899
|
engine;
|
|
19862
19900
|
codeMap = [];
|
|
19863
19901
|
continusIds = /* @__PURE__ */ new Map();
|
|
@@ -19958,16 +19996,16 @@ const Ut = {
|
|
|
19958
19996
|
sampleCount: 64,
|
|
19959
19997
|
roundedRadius: 1,
|
|
19960
19998
|
historyLimit: 100
|
|
19961
|
-
},
|
|
19999
|
+
}, $c = {
|
|
19962
20000
|
bezier: "贝塞尔曲线",
|
|
19963
20001
|
straight: "直线",
|
|
19964
20002
|
rounded: "圆角直线"
|
|
19965
|
-
},
|
|
20003
|
+
}, Zc = {
|
|
19966
20004
|
bezier: "∿",
|
|
19967
20005
|
straight: "╱",
|
|
19968
20006
|
rounded: "⌁"
|
|
19969
20007
|
};
|
|
19970
|
-
class
|
|
20008
|
+
class Jc {
|
|
19971
20009
|
type = "path-draw";
|
|
19972
20010
|
engine;
|
|
19973
20011
|
root = new de();
|
|
@@ -20147,7 +20185,7 @@ class Zc {
|
|
|
20147
20185
|
color: this.options.pointColor,
|
|
20148
20186
|
depthTest: !1,
|
|
20149
20187
|
depthWrite: !1
|
|
20150
|
-
}), s = new
|
|
20188
|
+
}), s = new R(i, n), o = t ?? `path-point-${++this.pointSequence}`;
|
|
20151
20189
|
return s.name = o, s.position.copy(e), s.renderOrder = 1002, s.userData.pathDrawPointId = o, { id: o, position: e.clone(), mesh: s };
|
|
20152
20190
|
}
|
|
20153
20191
|
selectPoint(e) {
|
|
@@ -20173,7 +20211,7 @@ class Zc {
|
|
|
20173
20211
|
return s.setFromCamera(n, this.engine.camera), s.intersectObjects(this.pointsGroup.children, !1)[0]?.object ?? null;
|
|
20174
20212
|
}
|
|
20175
20213
|
updatePreview(e) {
|
|
20176
|
-
this.previewMarker || (this.previewMarker = new
|
|
20214
|
+
this.previewMarker || (this.previewMarker = new R(
|
|
20177
20215
|
new Yt(this.options.pointSize * 0.72, 14, 10),
|
|
20178
20216
|
new oe({ color: this.options.previewColor, depthTest: !1, depthWrite: !1 })
|
|
20179
20217
|
), this.previewMarker.renderOrder = 1003, this.root.add(this.previewMarker)), this.previewMarker.position.copy(e), this.previewMarker.visible = !0;
|
|
@@ -20333,7 +20371,7 @@ class Zc {
|
|
|
20333
20371
|
t.append(i, n, s), e.appendChild(t), this.statusElement = n;
|
|
20334
20372
|
const o = document.createElement("div");
|
|
20335
20373
|
Object.assign(o.style, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: "4px", padding: "8px" }), ["bezier", "straight", "rounded"].forEach((w) => {
|
|
20336
|
-
const m = this.createIconButton(
|
|
20374
|
+
const m = this.createIconButton(Zc[w], $c[w], () => this.setLineType(w));
|
|
20337
20375
|
m.dataset.lineType = w, m.style.width = "100%", m.style.fontSize = "18px", o.appendChild(m);
|
|
20338
20376
|
}), e.appendChild(o);
|
|
20339
20377
|
const r = document.createElement("label");
|
|
@@ -20451,7 +20489,7 @@ class Zc {
|
|
|
20451
20489
|
return { x: e.x, y: e.y, z: e.z };
|
|
20452
20490
|
}
|
|
20453
20491
|
}
|
|
20454
|
-
class
|
|
20492
|
+
class eh {
|
|
20455
20493
|
engine;
|
|
20456
20494
|
continusIds = /* @__PURE__ */ new Map();
|
|
20457
20495
|
constructor(e) {
|
|
@@ -20510,7 +20548,7 @@ class Jc {
|
|
|
20510
20548
|
});
|
|
20511
20549
|
}
|
|
20512
20550
|
}
|
|
20513
|
-
class
|
|
20551
|
+
class oh {
|
|
20514
20552
|
// 引擎参数
|
|
20515
20553
|
options;
|
|
20516
20554
|
deviceType;
|
|
@@ -20633,7 +20671,7 @@ class sh {
|
|
|
20633
20671
|
constructor(e) {
|
|
20634
20672
|
if (window.THREE = Bn, Yo(), this.options = e, this.container = document.getElementById(e.containerId), !this.container)
|
|
20635
20673
|
throw new Error(`Container ${e.containerId} not found`);
|
|
20636
|
-
if (this.rxQuotaListMapper = new
|
|
20674
|
+
if (this.rxQuotaListMapper = new Qc(this), this.filterLoaderModel = new eh(this), this.engineModelModule = new Ma(this), this.engineModelModule.init(), this.deviceModule = new Eo(this), this.deviceType = this.deviceModule.getDeviceType(), this.cameraModule = new se(this), this.sceneModule = new Ao(this), this.scene = this.sceneModule.scene, this.renderModule = new So(this), this.renderer = this.renderModule.createRenderer(), this.camera = this.cameraModule.orthographicCamera, this.scene.camera = this.camera, this.renderer) {
|
|
20637
20675
|
const o = this.renderer;
|
|
20638
20676
|
o.interactionCullingEnabled = !0, o.interactionActive = !1, o.interactionRenderScene = this.scene, o.interactionFrameBudgetMs = this.options.interactionFrameBudgetMs ?? 6, o.interactionSkipShadows = this.options.interactionSkipShadows ?? !0;
|
|
20639
20677
|
}
|
|
@@ -20641,7 +20679,7 @@ class sh {
|
|
|
20641
20679
|
const t = this.events.trigger.bind(this.events);
|
|
20642
20680
|
this.events.trigger = ((o, r) => {
|
|
20643
20681
|
t(o, r), String(o) !== String(ie.EngineBusy) && this.requestComposerRender();
|
|
20644
|
-
}), this.engineStatus = new qr(this), this.engineStatus.init(), this.loaderModule = new Ie(this), this.lightModule = new ua(this), this.lightModule.init(), this.viewCube = new ba(this), this.viewCube.init(), this.options.showViewCube == !1 && this.viewCube.hide(), this.octreeBox = Ca(this), this.rangeScale = new Aa(this), this.rangeScale.init(), this.setting = new qa(this), this.engineModelModule.init(), this.handelBehaved = Hi(this), this.modelMapperBatch = new ul(this), this.measure = new el(this), this.modelToolModule = new ma(this), this.modelLink3d = new
|
|
20682
|
+
}), this.engineStatus = new qr(this), this.engineStatus.init(), this.loaderModule = new Ie(this), this.lightModule = new ua(this), this.lightModule.init(), this.viewCube = new ba(this), this.viewCube.init(), this.options.showViewCube == !1 && this.viewCube.hide(), this.octreeBox = Ca(this), this.rangeScale = new Aa(this), this.rangeScale.init(), this.setting = new qa(this), this.engineModelModule.init(), this.handelBehaved = Hi(this), this.modelMapperBatch = new ul(this), this.measure = new el(this), this.modelToolModule = new ma(this), this.modelLink3d = new ec(this, this.options.linkOptions ?? {}), this.modelLink3d.init(), this.modelProperties = new ll(this), this.search = new dl(this), this.interactionModule = new pa(this), this.interactionModule.init(), this.interactionModule.active(), this.hoverHighLight = new Jt(this), this.modelEdge = new Wa(this), this.nodeBox = new gl(this), this.modelTree = new rl(this), this.viewTree = new Ui(this), this.merge2d = new zl(this), this.engineInfo = new al(this), this.pathRoaming = new vl(this), this.pathRoaming.init(), this.oneClickEncoding = new El(this), this.minMap = new xl(this), this.linkElement2d3d = new Cl(this), this.linkView2d3d = new Al(this), this.grid = new Pa(this), this.level = new La(this), this.issueReport = new wl(this), this.fabricDraw = new $l(this), this.drawingPin = new Zl(this), this.label = new tc(this), this.annotation3d = new Oc(this), this.calibration = new lt(this), this.modelPlace = new Vc(this), this.modelComparison = new Uc(this), this.modelExplode = new Wc(this), this.materialTool = new Xc(this, this.options.materialEditorOptions ?? {}), this.materialTool.init(), this.pathDraw = new Jc(this), this.text = new bl(this), this.hdr = new _a(this), this.ground = new Vi(this), this.ground.init(), this.skyManager = new Ga(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));
|
|
20645
20683
|
let i = document.createElement("div");
|
|
20646
20684
|
i.className = "versionText", this.versionEl = i, this.updateVersionDisplay(), this.container.appendChild(i);
|
|
20647
20685
|
let n = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
@@ -20934,7 +20972,7 @@ class sh {
|
|
|
20934
20972
|
if (!e) return;
|
|
20935
20973
|
[...e.children].forEach((i) => {
|
|
20936
20974
|
this.clearScene(i);
|
|
20937
|
-
}), e.parent && e.parent.remove(e), e instanceof
|
|
20975
|
+
}), 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 fi && e.material && this.disposeMaterial(e.material), e instanceof po && e.shadow?.dispose?.();
|
|
20938
20976
|
}
|
|
20939
20977
|
/**
|
|
20940
20978
|
* 清理材质及其纹理
|
|
@@ -20989,6 +21027,6 @@ class sh {
|
|
|
20989
21027
|
}
|
|
20990
21028
|
}
|
|
20991
21029
|
export {
|
|
20992
|
-
|
|
20993
|
-
|
|
21030
|
+
oh as E,
|
|
21031
|
+
Xc as M
|
|
20994
21032
|
};
|