iflow-engine-base 3.10.7 → 3.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bim-engine-sdk.es.js +5 -5
- package/dist/bim-engine-sdk.umd.js +721 -721
- package/dist/chunks/{engine-2d-DsaDpJPQ.js → engine-2d-B8rWZz5y.js} +138 -113
- package/dist/chunks/{engine-3d-XJ7zBlLL.js → engine-3d-RuQU2JFm.js} +625 -590
- package/dist/chunks/{engine-720-CZj_sSsS.js → engine-720-QtnZH4Dk.js} +132 -113
- package/dist/chunks/{engine-gaussian-CX0k_s78.js → engine-gaussian-Bavllo9e.js} +617 -579
- package/dist/chunks/{engine-gis-N6XH8qUs.js → engine-gis-D4z6WKlH.js} +10645 -10542
- package/dist/chunks/{sdk-runtime-DTY-QKTD.js → sdk-runtime-CkKNeQgI.js} +1557 -1513
- package/dist/iflow-engine-base.css +1 -1
- package/dist/index.d.ts +38 -2
- package/dist2d/dwg-preview.es.js +1561 -1504
- package/dist2d/dwg-preview.umd.js +42 -42
- package/distGaussian/gaussian.es.js +9345 -6986
- package/distGaussian/gaussian.umd.js +23 -22
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { V as X, E as gt, Q as yt, M as Me, a as we, b as se, B as Ee, F as ye, S as vt, c as
|
|
2
|
-
import { F as
|
|
1
|
+
import { V as X, E as gt, Q as yt, M as Me, a as we, b as se, B as Ee, F as ye, S as vt, c as Ze, m as ze, d as wt, P as bt, C as pe, e as xt, f as Mt, N as kt, T as _t, L as $e, g as ge, h as Te, D as Ae, i as Et, j as Re, k as at, G as Se, l as Ct, n as St, A as Tt, o as At, O as It, p as Lt, W as Pt, q as Dt, r as Ue, s as zt, I as Rt, R as Bt } from "./three-vendor-CAbFcmaK.js";
|
|
2
|
+
import { c as Nt, a as Ot, F as Ve, C as Wt, W as lt, L as jt, r as Ut } from "./sdk-runtime-CkKNeQgI.js";
|
|
3
3
|
import { r as _e } from "./sdk-assets-1SXx8Tbf.js";
|
|
4
4
|
var Oe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
5
5
|
function ht(T) {
|
|
6
6
|
return T && T.__esModule && Object.prototype.hasOwnProperty.call(T, "default") ? T.default : T;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function Gi(T) {
|
|
9
9
|
if (Object.prototype.hasOwnProperty.call(T, "__esModule")) return T;
|
|
10
10
|
var e = T.default;
|
|
11
11
|
if (typeof e == "function") {
|
|
@@ -32,9 +32,9 @@ function Vi(T) {
|
|
|
32
32
|
function We(T) {
|
|
33
33
|
throw new Error('Could not dynamically require "' + T + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var He = { exports: {} };
|
|
36
36
|
var Je;
|
|
37
|
-
function
|
|
37
|
+
function Ft() {
|
|
38
38
|
return Je || (Je = 1, (function(T, e) {
|
|
39
39
|
(function(t) {
|
|
40
40
|
T.exports = t();
|
|
@@ -2183,15 +2183,15 @@ function jt() {
|
|
|
2183
2183
|
for (C.max_code = oe, O = b.heap_len >> 1; 1 <= O; O--) he(b, V, O);
|
|
2184
2184
|
for (S = K; O = b.heap[1], b.heap[1] = b.heap[b.heap_len--], he(b, V, 1), W = b.heap[1], b.heap[--b.heap_max] = O, b.heap[--b.heap_max] = W, V[2 * S] = V[2 * O] + V[2 * W], b.depth[S] = (b.depth[O] >= b.depth[W] ? b.depth[O] : b.depth[W]) + 1, V[2 * O + 1] = V[2 * W + 1] = S, b.heap[1] = S++, he(b, V, 1), 2 <= b.heap_len; ) ;
|
|
2185
2185
|
b.heap[--b.heap_max] = b.heap[1], (function(ne, me) {
|
|
2186
|
-
var Le, xe, Pe, ce, Be, Fe, ke = me.dyn_tree,
|
|
2186
|
+
var Le, xe, Pe, ce, Be, Fe, ke = me.dyn_tree, Ke = me.max_code, pt = me.stat_desc.static_tree, ft = me.stat_desc.has_stree, mt = me.stat_desc.extra_bits, qe = me.stat_desc.extra_base, De = me.stat_desc.max_length, Ne = 0;
|
|
2187
2187
|
for (ce = 0; ce <= f; ce++) ne.bl_count[ce] = 0;
|
|
2188
|
-
for (ke[2 * ne.heap[ne.heap_max] + 1] = 0, Le = ne.heap_max + 1; Le < l; Le++) De < (ce = ke[2 * ke[2 * (xe = ne.heap[Le]) + 1] + 1] + 1) && (ce = De, Ne++), ke[2 * xe + 1] = ce,
|
|
2188
|
+
for (ke[2 * ne.heap[ne.heap_max] + 1] = 0, Le = ne.heap_max + 1; Le < l; Le++) De < (ce = ke[2 * ke[2 * (xe = ne.heap[Le]) + 1] + 1] + 1) && (ce = De, Ne++), ke[2 * xe + 1] = ce, Ke < xe || (ne.bl_count[ce]++, Be = 0, qe <= xe && (Be = mt[xe - qe]), Fe = ke[2 * xe], ne.opt_len += Fe * (ce + Be), ft && (ne.static_len += Fe * (pt[2 * xe + 1] + Be)));
|
|
2189
2189
|
if (Ne !== 0) {
|
|
2190
2190
|
do {
|
|
2191
2191
|
for (ce = De - 1; ne.bl_count[ce] === 0; ) ce--;
|
|
2192
2192
|
ne.bl_count[ce]--, ne.bl_count[ce + 1] += 2, ne.bl_count[De]--, Ne -= 2;
|
|
2193
2193
|
} while (0 < Ne);
|
|
2194
|
-
for (ce = De; ce !== 0; ce--) for (xe = ne.bl_count[ce]; xe !== 0; )
|
|
2194
|
+
for (ce = De; ce !== 0; ce--) for (xe = ne.bl_count[ce]; xe !== 0; ) Ke < (Pe = ne.heap[--Le]) || (ke[2 * Pe + 1] !== ce && (ne.opt_len += (ce - ke[2 * Pe + 1]) * ke[2 * Pe], ke[2 * Pe + 1] = ce), xe--);
|
|
2195
2195
|
}
|
|
2196
2196
|
})(b, C), ue(V, oe, b.bl_count);
|
|
2197
2197
|
}
|
|
@@ -2334,16 +2334,16 @@ function jt() {
|
|
|
2334
2334
|
}).call(this, typeof Oe < "u" ? Oe : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
2335
2335
|
}, {}] }, {}, [10])(10);
|
|
2336
2336
|
});
|
|
2337
|
-
})(
|
|
2337
|
+
})(He)), He.exports;
|
|
2338
2338
|
}
|
|
2339
|
-
var
|
|
2340
|
-
const
|
|
2341
|
-
var je = { exports: {} },
|
|
2342
|
-
function
|
|
2339
|
+
var Vt = Ft();
|
|
2340
|
+
const Ht = /* @__PURE__ */ ht(Vt);
|
|
2341
|
+
var je = { exports: {} }, Gt = je.exports, Qe;
|
|
2342
|
+
function Zt() {
|
|
2343
2343
|
return Qe || (Qe = 1, (function(T, e) {
|
|
2344
2344
|
(function(t, i) {
|
|
2345
2345
|
T.exports = i();
|
|
2346
|
-
})(
|
|
2346
|
+
})(Gt, function() {
|
|
2347
2347
|
var t = function() {
|
|
2348
2348
|
function i(d) {
|
|
2349
2349
|
return r.appendChild(d.dom), d;
|
|
@@ -2383,9 +2383,9 @@ function Ht() {
|
|
|
2383
2383
|
});
|
|
2384
2384
|
})(je)), je.exports;
|
|
2385
2385
|
}
|
|
2386
|
-
var
|
|
2387
|
-
const
|
|
2388
|
-
class
|
|
2386
|
+
var $t = Zt();
|
|
2387
|
+
const Yt = /* @__PURE__ */ ht($t);
|
|
2388
|
+
class Xt {
|
|
2389
2389
|
panel = null;
|
|
2390
2390
|
listEl = null;
|
|
2391
2391
|
isVisible = !1;
|
|
@@ -2539,7 +2539,7 @@ class ct {
|
|
|
2539
2539
|
constructor(e) {
|
|
2540
2540
|
this.engine = e;
|
|
2541
2541
|
const t = document.getElementById(e?.options?.containerId ?? "") ?? e?.container ?? null;
|
|
2542
|
-
t && (this.panelUI = new
|
|
2542
|
+
t && (this.panelUI = new Xt(t, this));
|
|
2543
2543
|
}
|
|
2544
2544
|
// ─── 数据 ──────────────────────────────────────────────
|
|
2545
2545
|
_loadLayers(e = this.engine.dwgData?.layers ?? []) {
|
|
@@ -2667,7 +2667,7 @@ class ct {
|
|
|
2667
2667
|
}
|
|
2668
2668
|
}
|
|
2669
2669
|
var fe = /* @__PURE__ */ ((T) => (T.ModelLoadStart = "model-load-start", T.ModelLoadProgress = "model-load-progress", T.ModelLoaded = "model-loaded", T.ModelLoadError = "model-load-error", T.RenderStart = "render-start", T.RenderEnd = "render-end", T.CameraChanged = "camera-changed", T.CameraReset = "camera-reset", T.SelectionChanged = "selection-changed", T.HoverChanged = "hover-changed", T.EntityClick = "entity-click", T.LayerVisibilityChanged = "layer-visibility-changed", T.LayerColorChanged = "layer-color-changed", T.ViewZoomChanged = "view-zoom-changed", T.ViewPanChanged = "view-pan-changed", T.ToolActivated = "tool-activated", T.ToolDeactivated = "tool-deactivated", T.Error = "error", T.Warning = "warning", T))(fe || {});
|
|
2670
|
-
class
|
|
2670
|
+
class Kt {
|
|
2671
2671
|
listeners = /* @__PURE__ */ new Map();
|
|
2672
2672
|
onceListeners = /* @__PURE__ */ new Map();
|
|
2673
2673
|
debugMode = !1;
|
|
@@ -2788,12 +2788,12 @@ function Ie(T) {
|
|
|
2788
2788
|
max: T.boundingBox?.max.clone() ?? new X()
|
|
2789
2789
|
}) : { min: new X(), max: new X() };
|
|
2790
2790
|
}
|
|
2791
|
-
function
|
|
2791
|
+
function Ye(T, e, t) {
|
|
2792
2792
|
const i = new X(T[0] ?? 0, T[1] ?? 0, T[2] ?? 0), n = new gt(0, 0, t ?? 0), s = new X(e[0] ?? 1, e[1] ?? 1, e[2] ?? 1), r = new yt().setFromEuler(n);
|
|
2793
2793
|
return new Me().compose(i, r, s);
|
|
2794
2794
|
}
|
|
2795
|
-
function
|
|
2796
|
-
return Array.isArray(T?.transformMatrix) && T.transformMatrix.length === 16 ? new Me().fromArray(T.transformMatrix) :
|
|
2795
|
+
function qt(T) {
|
|
2796
|
+
return Array.isArray(T?.transformMatrix) && T.transformMatrix.length === 16 ? new Me().fromArray(T.transformMatrix) : Ye(
|
|
2797
2797
|
T.position ?? [0, 0, 0],
|
|
2798
2798
|
T.scale ?? [1, 1, 1],
|
|
2799
2799
|
T.rotation ?? 0
|
|
@@ -2854,7 +2854,7 @@ class et {
|
|
|
2854
2854
|
for (const n of e)
|
|
2855
2855
|
if (n?.visible !== !1) {
|
|
2856
2856
|
if (n.type === "INSERT") {
|
|
2857
|
-
const s = this.getBlockItems(n.blockId, i + 1), r = t.clone().multiply(
|
|
2857
|
+
const s = this.getBlockItems(n.blockId, i + 1), r = t.clone().multiply(qt(n)), o = this.getClipPolygon(n, t);
|
|
2858
2858
|
for (const a of s) {
|
|
2859
2859
|
const h = this.cloneRenderItem(a, r, n), u = o ? this.clipRenderItem(h, o) : h;
|
|
2860
2860
|
u && (yield u);
|
|
@@ -3068,7 +3068,7 @@ class et {
|
|
|
3068
3068
|
};
|
|
3069
3069
|
}
|
|
3070
3070
|
}
|
|
3071
|
-
class
|
|
3071
|
+
class Jt {
|
|
3072
3072
|
zipObjectUrls = [];
|
|
3073
3073
|
/** 加载新版 manifest 分包数据,并返回 Loader 可消费的 DWGData 结构。 */
|
|
3074
3074
|
async load(e) {
|
|
@@ -3214,7 +3214,7 @@ class Kt {
|
|
|
3214
3214
|
const t = await fetch(e);
|
|
3215
3215
|
if (!t.ok)
|
|
3216
3216
|
throw new Error(`HTTP error! status: ${t.status}`);
|
|
3217
|
-
const i = await
|
|
3217
|
+
const i = await Ht.loadAsync(await t.arrayBuffer()), n = this.findZipManifestPath(i), s = await this.fetchZipJson(i, n);
|
|
3218
3218
|
if (!this.isSplitManifest(s))
|
|
3219
3219
|
throw new Error("[LoaderModule2d] Expected split CAD manifest data in .2d package.");
|
|
3220
3220
|
const r = this.getZipBasePath(n);
|
|
@@ -3291,8 +3291,8 @@ class Kt {
|
|
|
3291
3291
|
this.zipObjectUrls.forEach((e) => URL.revokeObjectURL(e)), this.zipObjectUrls = [];
|
|
3292
3292
|
}
|
|
3293
3293
|
}
|
|
3294
|
-
const ae = 1e-8, tt = 1e-3,
|
|
3295
|
-
class
|
|
3294
|
+
const ae = 1e-8, tt = 1e-3, Qt = 8421504;
|
|
3295
|
+
class ei {
|
|
3296
3296
|
constructor(e) {
|
|
3297
3297
|
this.engine = e;
|
|
3298
3298
|
}
|
|
@@ -3305,7 +3305,7 @@ class Jt {
|
|
|
3305
3305
|
if (this.isSolidFill(e))
|
|
3306
3306
|
return this.createSolidItems(e, t, i);
|
|
3307
3307
|
const s = this.createPatternLineItem(e, t, i);
|
|
3308
|
-
return s ? [s] : (this.warnUnknownPatternFallback(e), this.createSolidItems(e, t, i,
|
|
3308
|
+
return s ? [s] : (this.warnUnknownPatternFallback(e), this.createSolidItems(e, t, i, Qt));
|
|
3309
3309
|
}
|
|
3310
3310
|
/** 只有明确的 SOLID 才作为实心面;patternType=SolidFill 在当前导出数据里不可靠。 */
|
|
3311
3311
|
isSolidFill(e) {
|
|
@@ -3366,7 +3366,7 @@ class Jt {
|
|
|
3366
3366
|
const h = this.createShape(a);
|
|
3367
3367
|
i.holes.filter((u) => this.pointInPolygon(new se(u[0][0], u[0][1]), a)).forEach((u) => {
|
|
3368
3368
|
h.holes.push(this.createPath(u));
|
|
3369
|
-
}), s.push(new
|
|
3369
|
+
}), s.push(new Ze(h));
|
|
3370
3370
|
}), s.length === 0) return [];
|
|
3371
3371
|
const r = s.length === 1 ? s[0] : ze(s, !1);
|
|
3372
3372
|
r.applyMatrix4(t);
|
|
@@ -3402,7 +3402,7 @@ class Jt {
|
|
|
3402
3402
|
i.holes.filter((u) => this.pointInPolygon(new se(u[0][0], u[0][1]), o)).forEach((u) => {
|
|
3403
3403
|
a.holes.push(this.createPath(u));
|
|
3404
3404
|
});
|
|
3405
|
-
const h = this.subdivideTriangles(new
|
|
3405
|
+
const h = this.subdivideTriangles(new Ze(a), this.engine.options?.hatchGradientSubdivisions ?? 3);
|
|
3406
3406
|
this.applyGradientVertexColors(h, o, e.gradient), n.push(h);
|
|
3407
3407
|
}), n.length === 0) return [];
|
|
3408
3408
|
const s = n.length === 1 ? n[0] : ze(n, !1);
|
|
@@ -3675,7 +3675,7 @@ class Jt {
|
|
|
3675
3675
|
}
|
|
3676
3676
|
class it {
|
|
3677
3677
|
constructor(e, t) {
|
|
3678
|
-
this.engine = e, this.textFactory = t, this.hatchRenderer = new
|
|
3678
|
+
this.engine = e, this.textFactory = t, this.hatchRenderer = new ei(e);
|
|
3679
3679
|
}
|
|
3680
3680
|
hatchRenderer;
|
|
3681
3681
|
/** 根据实体类型分发到线、文字、填充、图片等具体几何生成逻辑。 */
|
|
@@ -3867,7 +3867,7 @@ class it {
|
|
|
3867
3867
|
}];
|
|
3868
3868
|
}
|
|
3869
3869
|
}
|
|
3870
|
-
class
|
|
3870
|
+
class ti {
|
|
3871
3871
|
constructor(e, t, i = e.modelGroup, n = {}) {
|
|
3872
3872
|
this.model = t, this.targetGroup = i, this.options = n;
|
|
3873
3873
|
}
|
|
@@ -3951,7 +3951,7 @@ class Qt {
|
|
|
3951
3951
|
if (e.forEach((g) => {
|
|
3952
3952
|
g.points.forEach((v) => n.push(v));
|
|
3953
3953
|
}), n.length === 0) return;
|
|
3954
|
-
const s = new Ee().setFromPoints(n), r = new
|
|
3954
|
+
const s = new Ee().setFromPoints(n), r = new $e({ color: this.resolveColor(t) }), o = new ge(s, r);
|
|
3955
3955
|
o.name = t;
|
|
3956
3956
|
const a = s.getAttribute("position");
|
|
3957
3957
|
o.clonePoints = a.array.slice(), o.materialClone = r.clone(), this.targetGroup.add(o);
|
|
@@ -4113,7 +4113,7 @@ class nt {
|
|
|
4113
4113
|
const r = [...e.position ?? [0, 0, 0]];
|
|
4114
4114
|
r[1] = r[1] - (e.height ?? 0);
|
|
4115
4115
|
const o = this.resolveWidthScale(e), a = new X(r[0] ?? 0, r[1] ?? 0, r[2] ?? 0).applyMatrix4(t), h = 1.4 * e.scale;
|
|
4116
|
-
s.applyMatrix4(t.clone().multiply(
|
|
4116
|
+
s.applyMatrix4(t.clone().multiply(Ye(r, [o * 1.4, 1 * h, 1 * h], e.rotation ?? 0)));
|
|
4117
4117
|
const u = Ie(s), g = [{
|
|
4118
4118
|
kind: "text",
|
|
4119
4119
|
layer: e.layer,
|
|
@@ -4164,7 +4164,7 @@ class nt {
|
|
|
4164
4164
|
if (!o) return;
|
|
4165
4165
|
const h = this.getRenderableText(o);
|
|
4166
4166
|
if (!h.trim()) return;
|
|
4167
|
-
const u = this.font.generateShapes(h, t), g = new
|
|
4167
|
+
const u = this.font.generateShapes(h, t), g = new Ze(u, i);
|
|
4168
4168
|
g.applyMatrix4(new Me().makeTranslation(0, -a * s, 0)), r.push(g);
|
|
4169
4169
|
}), r.length === 0 ? null : r.length === 1 ? r[0] : ze(r, !1);
|
|
4170
4170
|
}
|
|
@@ -4181,20 +4181,21 @@ class nt {
|
|
|
4181
4181
|
const i = t.max.x - t.min.x, n = t.max.y - t.min.y;
|
|
4182
4182
|
if (i <= 0 || n <= 0) return null;
|
|
4183
4183
|
const s = new at(i, n);
|
|
4184
|
-
return s.applyMatrix4(
|
|
4184
|
+
return s.applyMatrix4(Ye([(t.min.x + t.max.x) / 2, (t.min.y + t.max.y) / 2, 0], [1, 1, 1], 0)), s;
|
|
4185
4185
|
}
|
|
4186
4186
|
}
|
|
4187
|
-
class
|
|
4187
|
+
class ii {
|
|
4188
4188
|
engine;
|
|
4189
4189
|
data = null;
|
|
4190
4190
|
enableValidation = !0;
|
|
4191
4191
|
model = this.createEmptyModel();
|
|
4192
4192
|
font = null;
|
|
4193
|
-
dataSource = new
|
|
4193
|
+
dataSource = new Jt();
|
|
4194
4194
|
lastBuildOptions = {};
|
|
4195
4195
|
activeWorkspace = { type: "model", name: "模型" };
|
|
4196
4196
|
workspaceCache = /* @__PURE__ */ new Map();
|
|
4197
4197
|
workspaceViews = /* @__PURE__ */ new Map();
|
|
4198
|
+
localModelResource = null;
|
|
4198
4199
|
constructor(e) {
|
|
4199
4200
|
this.engine = e, this.engine.modelGroup = new Se(), this.engine.modelGroup.name = "model2d", this.engine.scene.add(this.engine.modelGroup), this.clearModelGroup();
|
|
4200
4201
|
}
|
|
@@ -4218,6 +4219,18 @@ class ei {
|
|
|
4218
4219
|
throw console.error("[LoaderModule2d] Model load failed:", i), this._emitProgress(0, "抱歉,图纸加载失败"), i;
|
|
4219
4220
|
}
|
|
4220
4221
|
}
|
|
4222
|
+
async loadModelFile(e, t = {}) {
|
|
4223
|
+
if (e.length === 0)
|
|
4224
|
+
return;
|
|
4225
|
+
this.revokeLocalModelResource();
|
|
4226
|
+
const i = e.length === 1 ? Nt(e[0]) : await Ot(e, `${this.getLocalModelName(e)}.2d`);
|
|
4227
|
+
this.localModelResource = i;
|
|
4228
|
+
try {
|
|
4229
|
+
await this.loadModel(i.url, t);
|
|
4230
|
+
} catch (n) {
|
|
4231
|
+
throw this.revokeLocalModelResource(), n;
|
|
4232
|
+
}
|
|
4233
|
+
}
|
|
4221
4234
|
async loadData(e) {
|
|
4222
4235
|
return this.dataSource.load(e);
|
|
4223
4236
|
}
|
|
@@ -4368,7 +4381,7 @@ class ei {
|
|
|
4368
4381
|
for (let a = 0; a < e.length; a += 1) {
|
|
4369
4382
|
const h = e[a], u = this.createTileGroup(h, n.namePrefix);
|
|
4370
4383
|
t.add(u);
|
|
4371
|
-
const g = new
|
|
4384
|
+
const g = new ti(this.engine, this.model, u, {
|
|
4372
4385
|
interactive: n.interactive ?? !0
|
|
4373
4386
|
}), v = /* @__PURE__ */ new Set();
|
|
4374
4387
|
let d = 0, y = 0;
|
|
@@ -4603,8 +4616,11 @@ class ei {
|
|
|
4603
4616
|
}
|
|
4604
4617
|
/** 按图纸实际文字裁剪字体字符集,降低字体转换成本。 */
|
|
4605
4618
|
async loadFont(e) {
|
|
4606
|
-
const t = this.
|
|
4607
|
-
|
|
4619
|
+
const t = this.collectTextChars(e), i = this.engine.options?.fontFile, n = i ? Ve.fromArrayBuffer(await i.arrayBuffer(), { chars: t }) : await Ve.fromUrl(
|
|
4620
|
+
this.engine.options?.fontUrl ?? _e("/fonts/simfang.ttf", import.meta.url),
|
|
4621
|
+
{ chars: t }
|
|
4622
|
+
);
|
|
4623
|
+
return Ve.toThreeFont(n);
|
|
4608
4624
|
}
|
|
4609
4625
|
/** 从 block 实体中收集需要转换的文字字符;根实体来自 tile insert,不包含真实文字。 */
|
|
4610
4626
|
collectTextChars(e) {
|
|
@@ -4687,15 +4703,21 @@ class ei {
|
|
|
4687
4703
|
return this.data ? this.data.layers : [];
|
|
4688
4704
|
}
|
|
4689
4705
|
clear() {
|
|
4690
|
-
this.data = null, this.engine.dwgData = null, this.model = this.createEmptyModel(), this.clearModelGroup(), this.activeWorkspace = { type: "model", name: "模型" }, this.workspaceViews.clear();
|
|
4706
|
+
this.data = null, this.engine.dwgData = null, this.model = this.createEmptyModel(), this.clearModelGroup(), this.activeWorkspace = { type: "model", name: "模型" }, this.workspaceViews.clear(), this.revokeLocalModelResource();
|
|
4691
4707
|
}
|
|
4692
4708
|
dispose() {
|
|
4693
4709
|
this.clear();
|
|
4694
4710
|
}
|
|
4711
|
+
revokeLocalModelResource() {
|
|
4712
|
+
this.localModelResource?.revoke(), this.localModelResource = null;
|
|
4713
|
+
}
|
|
4714
|
+
getLocalModelName(e) {
|
|
4715
|
+
return (e[0]?.webkitRelativePath || e[0]?.name || "model").replace(/\\/g, "/").split("/").filter(Boolean)[0]?.replace(/\.[^.]+$/, "") || "model";
|
|
4716
|
+
}
|
|
4695
4717
|
}
|
|
4696
|
-
const
|
|
4697
|
-
version:
|
|
4698
|
-
},
|
|
4718
|
+
const ni = "3.10.8", si = {
|
|
4719
|
+
version: ni
|
|
4720
|
+
}, ri = si.version, oi = `
|
|
4699
4721
|
varying vec2 vWorldPos;
|
|
4700
4722
|
|
|
4701
4723
|
void main() {
|
|
@@ -4703,7 +4725,7 @@ const ti = "3.10.7", ii = {
|
|
|
4703
4725
|
vWorldPos = worldPosition.xy;
|
|
4704
4726
|
gl_Position = projectionMatrix * viewMatrix * worldPosition;
|
|
4705
4727
|
}
|
|
4706
|
-
`,
|
|
4728
|
+
`, ai = `
|
|
4707
4729
|
precision highp float;
|
|
4708
4730
|
|
|
4709
4731
|
varying vec2 vWorldPos;
|
|
@@ -4759,7 +4781,7 @@ const ti = "3.10.7", ii = {
|
|
|
4759
4781
|
gl_FragColor = vec4(color, alpha);
|
|
4760
4782
|
}
|
|
4761
4783
|
`;
|
|
4762
|
-
class
|
|
4784
|
+
class li {
|
|
4763
4785
|
scene;
|
|
4764
4786
|
camera;
|
|
4765
4787
|
container;
|
|
@@ -4812,8 +4834,8 @@ class oi {
|
|
|
4812
4834
|
createGridMesh() {
|
|
4813
4835
|
this.gridGeometry = new at(1, 1, 1, 1), this.gridMaterial = new Ct({
|
|
4814
4836
|
uniforms: this.gridUniforms,
|
|
4815
|
-
vertexShader:
|
|
4816
|
-
fragmentShader:
|
|
4837
|
+
vertexShader: oi,
|
|
4838
|
+
fragmentShader: ai,
|
|
4817
4839
|
transparent: !0,
|
|
4818
4840
|
depthWrite: !1,
|
|
4819
4841
|
depthTest: !1,
|
|
@@ -4902,7 +4924,7 @@ class oi {
|
|
|
4902
4924
|
this.stopMonitoring(), this.teardownResizeObserver(), this.gridMesh && this.gridGroup.remove(this.gridMesh), this.gridGeometry && (this.gridGeometry.dispose(), this.gridGeometry = void 0), this.gridMaterial && (this.gridMaterial.dispose(), this.gridMaterial = void 0), this.gridMesh = void 0;
|
|
4903
4925
|
}
|
|
4904
4926
|
}
|
|
4905
|
-
class
|
|
4927
|
+
class hi {
|
|
4906
4928
|
engine;
|
|
4907
4929
|
scene;
|
|
4908
4930
|
options;
|
|
@@ -4935,7 +4957,7 @@ class ai {
|
|
|
4935
4957
|
* 创建网格辅助(自适应网格)
|
|
4936
4958
|
*/
|
|
4937
4959
|
createGrid(e = 1e3, t = 50) {
|
|
4938
|
-
this.adaptiveGrid && (this.adaptiveGrid.dispose(), this.adaptiveGrid = void 0), this.adaptiveGrid = new
|
|
4960
|
+
this.adaptiveGrid && (this.adaptiveGrid.dispose(), this.adaptiveGrid = void 0), this.adaptiveGrid = new li(
|
|
4939
4961
|
this.scene,
|
|
4940
4962
|
this.engine.cameraModule2d.orthographicCamera,
|
|
4941
4963
|
this.engine.renderModule2d.container
|
|
@@ -5037,7 +5059,7 @@ class ai {
|
|
|
5037
5059
|
this.clearScene(), this.adaptiveGrid && (this.adaptiveGrid.dispose(), this.adaptiveGrid = void 0), this.axesHelper && (this.scene.remove(this.axesHelper), this.axesHelper = void 0), this.scene.clear();
|
|
5038
5060
|
}
|
|
5039
5061
|
}
|
|
5040
|
-
class
|
|
5062
|
+
class ci {
|
|
5041
5063
|
engine;
|
|
5042
5064
|
isFree;
|
|
5043
5065
|
// 高亮模型
|
|
@@ -5053,7 +5075,7 @@ class li {
|
|
|
5053
5075
|
this.engine = e, this.isFree = !0, this.highlightModels = [], this.hideModels = [], this.translucentModels = [], this.highlightHoverModels = [], this.models = [];
|
|
5054
5076
|
}
|
|
5055
5077
|
}
|
|
5056
|
-
class
|
|
5078
|
+
class di {
|
|
5057
5079
|
engine;
|
|
5058
5080
|
orthographicCamera;
|
|
5059
5081
|
container;
|
|
@@ -5285,7 +5307,7 @@ class hi {
|
|
|
5285
5307
|
this.animationId !== null && (cancelAnimationFrame(this.animationId), this.animationId = null), this.orthographicCamera = null;
|
|
5286
5308
|
}
|
|
5287
5309
|
}
|
|
5288
|
-
class
|
|
5310
|
+
class ui {
|
|
5289
5311
|
engine;
|
|
5290
5312
|
renderer;
|
|
5291
5313
|
container;
|
|
@@ -5296,7 +5318,7 @@ class ci {
|
|
|
5296
5318
|
alpha = !1;
|
|
5297
5319
|
precision = "highp";
|
|
5298
5320
|
constructor(e, t, i) {
|
|
5299
|
-
this.engine = e, this.container = t, this.options = i, this.watermark = new
|
|
5321
|
+
this.engine = e, this.container = t, this.options = i, this.watermark = new Wt(Lt), this.renderer = this.createRenderer(), this.handleResize();
|
|
5300
5322
|
}
|
|
5301
5323
|
/**
|
|
5302
5324
|
* 创建 WebGL 渲染器
|
|
@@ -5424,7 +5446,7 @@ class ci {
|
|
|
5424
5446
|
window.removeEventListener("resize", this.onWindowResize.bind(this)), this.watermark.dispose(), this.renderer.dispose(), this.container.contains(this.renderer.domElement) && this.container.removeChild(this.renderer.domElement), this.renderer = null;
|
|
5425
5447
|
}
|
|
5426
5448
|
}
|
|
5427
|
-
class
|
|
5449
|
+
class pi extends Dt {
|
|
5428
5450
|
object;
|
|
5429
5451
|
domElement;
|
|
5430
5452
|
enabled = !0;
|
|
@@ -5634,7 +5656,7 @@ class di extends Dt {
|
|
|
5634
5656
|
this.enabled = !1, this.domElement.removeEventListener("mousedown", this.onMouseDown.bind(this)), this.domElement.removeEventListener("mousemove", this.onMouseMove.bind(this)), this.domElement.removeEventListener("mouseup", this.onMouseUp.bind(this)), this.domElement.removeEventListener("mouseleave", this.onMouseUp.bind(this)), this.domElement.removeEventListener("wheel", this.onWheel.bind(this)), this.domElement.removeEventListener("dblclick", this.onDoubleClick.bind(this)), this.domElement.removeEventListener("click", this.onClick.bind(this)), this.domElement.removeEventListener("touchstart", this.onTouchStart.bind(this)), this.domElement.removeEventListener("touchmove", this.onTouchMove.bind(this)), this.domElement.removeEventListener("touchend", this.onTouchEnd.bind(this));
|
|
5635
5657
|
}
|
|
5636
5658
|
}
|
|
5637
|
-
class
|
|
5659
|
+
class fi {
|
|
5638
5660
|
engine;
|
|
5639
5661
|
panControls;
|
|
5640
5662
|
isActive = !0;
|
|
@@ -5651,7 +5673,7 @@ class ui {
|
|
|
5651
5673
|
* 创建 2D 平移控制器
|
|
5652
5674
|
*/
|
|
5653
5675
|
createPanControls() {
|
|
5654
|
-
const e = new
|
|
5676
|
+
const e = new pi(
|
|
5655
5677
|
this.engine.camera,
|
|
5656
5678
|
this.engine.renderer.domElement
|
|
5657
5679
|
);
|
|
@@ -5767,7 +5789,7 @@ class ui {
|
|
|
5767
5789
|
this.panControls.dispose(), this.panControls = null;
|
|
5768
5790
|
}
|
|
5769
5791
|
}
|
|
5770
|
-
class
|
|
5792
|
+
class mi {
|
|
5771
5793
|
engine;
|
|
5772
5794
|
pickBoxElementIds = [];
|
|
5773
5795
|
worldToScreen;
|
|
@@ -5904,7 +5926,7 @@ class pi {
|
|
|
5904
5926
|
return e.distanceTo(a);
|
|
5905
5927
|
}
|
|
5906
5928
|
}
|
|
5907
|
-
class
|
|
5929
|
+
class gi {
|
|
5908
5930
|
engine;
|
|
5909
5931
|
// 小组件容器
|
|
5910
5932
|
widgetContainer = null;
|
|
@@ -6072,7 +6094,7 @@ class fi {
|
|
|
6072
6094
|
return Math.atan2(e.clientX - i, n - e.clientY);
|
|
6073
6095
|
}
|
|
6074
6096
|
}
|
|
6075
|
-
class
|
|
6097
|
+
class yi {
|
|
6076
6098
|
engine;
|
|
6077
6099
|
enabled = !1;
|
|
6078
6100
|
constructor(e) {
|
|
@@ -6125,7 +6147,7 @@ class mi {
|
|
|
6125
6147
|
return e?.object ?? e?.group?.children?.[e.indexes?.[0]] ?? this.engine.modelGroup?.children?.[e.indexes?.[0]];
|
|
6126
6148
|
}
|
|
6127
6149
|
}
|
|
6128
|
-
class
|
|
6150
|
+
class vi {
|
|
6129
6151
|
engine;
|
|
6130
6152
|
highlightMaterial;
|
|
6131
6153
|
hideMaterial;
|
|
@@ -6324,7 +6346,7 @@ class gi {
|
|
|
6324
6346
|
highLightRenderLine(e) {
|
|
6325
6347
|
const t = new Ee();
|
|
6326
6348
|
t.setAttribute("position", new ye(e, 3));
|
|
6327
|
-
const i = new
|
|
6349
|
+
const i = new $e({
|
|
6328
6350
|
color: 43775,
|
|
6329
6351
|
depthTest: !1,
|
|
6330
6352
|
depthWrite: !1
|
|
@@ -6340,7 +6362,7 @@ class gi {
|
|
|
6340
6362
|
highLightRenderLineHover(e) {
|
|
6341
6363
|
const t = new Ee();
|
|
6342
6364
|
t.setAttribute("position", new ye(e, 3));
|
|
6343
|
-
const i = new
|
|
6365
|
+
const i = new $e({
|
|
6344
6366
|
color: this.getHoverHighlightColor(),
|
|
6345
6367
|
depthTest: !1,
|
|
6346
6368
|
depthWrite: !1
|
|
@@ -6385,7 +6407,7 @@ class gi {
|
|
|
6385
6407
|
return !0;
|
|
6386
6408
|
}
|
|
6387
6409
|
}
|
|
6388
|
-
function
|
|
6410
|
+
function wi(T) {
|
|
6389
6411
|
const e = {
|
|
6390
6412
|
mouseMoveFrame: null,
|
|
6391
6413
|
latestMouseMoveEvent: null,
|
|
@@ -6495,7 +6517,7 @@ function yi(T) {
|
|
|
6495
6517
|
}
|
|
6496
6518
|
return e;
|
|
6497
6519
|
}
|
|
6498
|
-
class
|
|
6520
|
+
class bi {
|
|
6499
6521
|
el;
|
|
6500
6522
|
xEl;
|
|
6501
6523
|
yEl;
|
|
@@ -6515,7 +6537,7 @@ class vi {
|
|
|
6515
6537
|
}
|
|
6516
6538
|
}
|
|
6517
6539
|
var ut = /* @__PURE__ */ ((T) => (T.ModelLoadStart = "model-load-start", T.ModelLoadProgress = "model-load-progress", T.ModelLoaded = "model-loaded", T.ModelError = "model-error", T.SelectionChanged = "selection-changed", T.HoverChanged = "hover-changed", T.Click = "click", T.MouseMove = "mouse-move", T.CameraChanged = "camera-changed", T.CameraIdle = "camera-idle", T.EngineFree = "engine-free", T.EngineBusy = "engine-busy", T.MeasureChanged = "measure-changed", T.MeasureClick = "measure-click", T.SectionMove = "section-move", T))(ut || {});
|
|
6518
|
-
class
|
|
6540
|
+
class xi {
|
|
6519
6541
|
engine;
|
|
6520
6542
|
behavior;
|
|
6521
6543
|
mouseCoordUI = null;
|
|
@@ -6525,7 +6547,7 @@ class wi {
|
|
|
6525
6547
|
init() {
|
|
6526
6548
|
this.behavior = this.engine.handelBehaved2d, this.behavior.init(this);
|
|
6527
6549
|
const e = this.engine.container;
|
|
6528
|
-
e && this.engine.options?.showMouseCoordinates !== !1 && (this.mouseCoordUI = new
|
|
6550
|
+
e && this.engine.options?.showMouseCoordinates !== !1 && (this.mouseCoordUI = new bi(e));
|
|
6529
6551
|
}
|
|
6530
6552
|
active() {
|
|
6531
6553
|
this.behavior.active();
|
|
@@ -6592,7 +6614,7 @@ class wi {
|
|
|
6592
6614
|
this.mouseCoordUI?.dispose(), this.mouseCoordUI = null;
|
|
6593
6615
|
}
|
|
6594
6616
|
}
|
|
6595
|
-
class
|
|
6617
|
+
class Mi {
|
|
6596
6618
|
overlay;
|
|
6597
6619
|
hLine;
|
|
6598
6620
|
vLine;
|
|
@@ -6646,7 +6668,7 @@ const st = [
|
|
|
6646
6668
|
{ action: "linkElement2d3d", label: "模型联动", dividerBefore: !0 },
|
|
6647
6669
|
{ action: "linkView2d3d", label: "视角关联" }
|
|
6648
6670
|
];
|
|
6649
|
-
class
|
|
6671
|
+
class ki {
|
|
6650
6672
|
menu;
|
|
6651
6673
|
container;
|
|
6652
6674
|
canvas;
|
|
@@ -6719,7 +6741,7 @@ class xi {
|
|
|
6719
6741
|
this.canvas.removeEventListener("contextmenu", this.onContextMenu), document.removeEventListener("mousedown", this.onDocMouseDown), document.removeEventListener("keydown", this.onEscape), this.menu.parentElement?.removeChild(this.menu);
|
|
6720
6742
|
}
|
|
6721
6743
|
}
|
|
6722
|
-
class
|
|
6744
|
+
class _i {
|
|
6723
6745
|
overlay = null;
|
|
6724
6746
|
textEl = null;
|
|
6725
6747
|
barEl = null;
|
|
@@ -6854,14 +6876,14 @@ class Mi {
|
|
|
6854
6876
|
this.overlay?.remove(), this.overlay = null, this.textEl = null, this.barEl = null, this.pctEl = null;
|
|
6855
6877
|
}
|
|
6856
6878
|
}
|
|
6857
|
-
const
|
|
6879
|
+
const Ei = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6858
6880
|
<circle cx="6.5" cy="6.5" r="4.5" stroke="currentColor" stroke-width="1.5"/>
|
|
6859
6881
|
<line x1="10" y1="10" x2="14" y2="14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
6860
|
-
</svg>`,
|
|
6882
|
+
</svg>`, Ci = `<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6861
6883
|
<line x1="1" y1="1" x2="11" y2="11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
6862
6884
|
<line x1="11" y1="1" x2="1" y2="11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
6863
6885
|
</svg>`;
|
|
6864
|
-
class
|
|
6886
|
+
class Si {
|
|
6865
6887
|
manager;
|
|
6866
6888
|
wrapper;
|
|
6867
6889
|
input;
|
|
@@ -6880,7 +6902,7 @@ class Ei {
|
|
|
6880
6902
|
return e.className = "engine-2d-search", e.innerHTML = `
|
|
6881
6903
|
<div class="engine-2d-search__box">
|
|
6882
6904
|
<div class="engine-2d-search__input-row">
|
|
6883
|
-
<span class="engine-2d-search__icon">${
|
|
6905
|
+
<span class="engine-2d-search__icon">${Ei}</span>
|
|
6884
6906
|
<input
|
|
6885
6907
|
class="engine-2d-search__input"
|
|
6886
6908
|
type="text"
|
|
@@ -6888,7 +6910,7 @@ class Ei {
|
|
|
6888
6910
|
autocomplete="off"
|
|
6889
6911
|
spellcheck="false"
|
|
6890
6912
|
/>
|
|
6891
|
-
<button class="engine-2d-search__clear" title="清除">${
|
|
6913
|
+
<button class="engine-2d-search__clear" title="清除">${Ci}</button>
|
|
6892
6914
|
</div>
|
|
6893
6915
|
<div class="engine-2d-search__divider"></div>
|
|
6894
6916
|
<div class="engine-2d-search__status"></div>
|
|
@@ -6994,13 +7016,13 @@ class Ei {
|
|
|
6994
7016
|
this.input.removeEventListener("input", this.onInput), this.input.removeEventListener("keydown", this.onKeyDown), this.clearBtn.removeEventListener("click", this.onClear), document.removeEventListener("mousedown", this.onDocMouseDown), document.removeEventListener("keydown", this.onEscape), this.wrapper.parentElement?.removeChild(this.wrapper), this.debounceTimer !== null && clearTimeout(this.debounceTimer);
|
|
6995
7017
|
}
|
|
6996
7018
|
}
|
|
6997
|
-
class
|
|
7019
|
+
class Ti {
|
|
6998
7020
|
engine;
|
|
6999
7021
|
searchUI = null;
|
|
7000
7022
|
constructor(e) {
|
|
7001
7023
|
this.engine = e;
|
|
7002
7024
|
const t = document.getElementById(e?.options?.containerId ?? "") ?? e?.container ?? null;
|
|
7003
|
-
t && (this.searchUI = new
|
|
7025
|
+
t && (this.searchUI = new Si(t, this));
|
|
7004
7026
|
}
|
|
7005
7027
|
/** 只查询已加载的文字实体,支持连续包含和按字符顺序的模糊匹配。 */
|
|
7006
7028
|
search(e) {
|
|
@@ -7177,7 +7199,7 @@ const rt = {
|
|
|
7177
7199
|
"--e2d-coord-label": "rgba(0,0,0,0.50)"
|
|
7178
7200
|
}
|
|
7179
7201
|
};
|
|
7180
|
-
class
|
|
7202
|
+
class Ai {
|
|
7181
7203
|
container;
|
|
7182
7204
|
current;
|
|
7183
7205
|
constructor(e, t = "dark") {
|
|
@@ -7210,7 +7232,7 @@ const ot = {
|
|
|
7210
7232
|
areaUnit: "m²",
|
|
7211
7233
|
scale: 1
|
|
7212
7234
|
};
|
|
7213
|
-
class
|
|
7235
|
+
class Xe {
|
|
7214
7236
|
manager;
|
|
7215
7237
|
points = [];
|
|
7216
7238
|
constructor(e) {
|
|
@@ -7245,7 +7267,7 @@ class Ye {
|
|
|
7245
7267
|
this.clearAllPoints();
|
|
7246
7268
|
}
|
|
7247
7269
|
}
|
|
7248
|
-
class
|
|
7270
|
+
class Ii extends Xe {
|
|
7249
7271
|
/** 两点完成一条距离测量。 */
|
|
7250
7272
|
handleClick(e) {
|
|
7251
7273
|
super.handleClick(e), this.points.length === 2 && (this.manager.addMeasurement("distance", this.points), this.clearAllPoints());
|
|
@@ -7254,7 +7276,7 @@ class Ti extends Ye {
|
|
|
7254
7276
|
this.points.length === 1 && this.manager.drawPreview("distance", [this.points[0], e]);
|
|
7255
7277
|
}
|
|
7256
7278
|
}
|
|
7257
|
-
class
|
|
7279
|
+
class Li extends Xe {
|
|
7258
7280
|
/** 三点及以上可以闭合面积,双击或 Enter 结束。 */
|
|
7259
7281
|
handleClick(e) {
|
|
7260
7282
|
super.handleClick(e), this.manager.drawPreview("area", this.points);
|
|
@@ -7267,7 +7289,7 @@ class Ai extends Ye {
|
|
|
7267
7289
|
e.length >= 3 && this.manager.addMeasurement("area", e), this.clearAllPoints();
|
|
7268
7290
|
}
|
|
7269
7291
|
}
|
|
7270
|
-
class
|
|
7292
|
+
class Pi extends Xe {
|
|
7271
7293
|
/** 三点完成角度测量,第二个点作为角点。 */
|
|
7272
7294
|
handleClick(e) {
|
|
7273
7295
|
super.handleClick(e), this.points.length === 3 && (this.manager.addMeasurement("angle", this.points), this.clearAllPoints());
|
|
@@ -7276,7 +7298,7 @@ class Ii extends Ye {
|
|
|
7276
7298
|
this.points.length >= 2 && this.manager.drawPreview("angle", [...this.points, e]);
|
|
7277
7299
|
}
|
|
7278
7300
|
}
|
|
7279
|
-
class
|
|
7301
|
+
class Di {
|
|
7280
7302
|
distanceMeasure;
|
|
7281
7303
|
areaMeasure;
|
|
7282
7304
|
angleMeasure;
|
|
@@ -7296,7 +7318,7 @@ class Li {
|
|
|
7296
7318
|
hasDraggedAfterMouseDown = !1;
|
|
7297
7319
|
currentWorkspaceKey = "model";
|
|
7298
7320
|
constructor(e) {
|
|
7299
|
-
this.engine = e, this.container = e.container, this.distanceMeasure = new
|
|
7321
|
+
this.engine = e, this.container = e.container, this.distanceMeasure = new Ii(this), this.areaMeasure = new Li(this), this.angleMeasure = new Pi(this), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", this.annotationContainer.style.pointerEvents = "none", this.annotationContainer.style.zIndex = "20", this.container.appendChild(this.annotationContainer);
|
|
7300
7322
|
}
|
|
7301
7323
|
/** 开启 2D 测量事件;只停用图元点选,不停用 pan/zoom 视图控制。 */
|
|
7302
7324
|
active() {
|
|
@@ -7549,13 +7571,13 @@ class Li {
|
|
|
7549
7571
|
return `measure-2d-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
7550
7572
|
}
|
|
7551
7573
|
}
|
|
7552
|
-
const
|
|
7574
|
+
const Ge = {
|
|
7553
7575
|
stroke: "#ff4d4f",
|
|
7554
7576
|
fill: "rgba(255, 77, 79, 0.08)",
|
|
7555
7577
|
strokeWidth: 2,
|
|
7556
7578
|
fontSize: 16,
|
|
7557
7579
|
cloudRadius: 10
|
|
7558
|
-
},
|
|
7580
|
+
}, zi = {
|
|
7559
7581
|
none: _e("/assets/icon/选择.svg", import.meta.url),
|
|
7560
7582
|
line: _e("/assets/icon/线.svg", import.meta.url),
|
|
7561
7583
|
arrow: _e("/assets/icon/箭头.svg", import.meta.url),
|
|
@@ -7564,8 +7586,8 @@ const He = {
|
|
|
7564
7586
|
polygon: _e("/assets/icon/面积.svg", import.meta.url),
|
|
7565
7587
|
text: _e("/assets/icon/文字.svg", import.meta.url),
|
|
7566
7588
|
cloudline: _e("/assets/icon/云线.svg", import.meta.url)
|
|
7567
|
-
},
|
|
7568
|
-
class
|
|
7589
|
+
}, Ri = "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#1f2937" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M8 6V4h8v2"/><path d="M6 6l1 16h10l1-16"/><path d="M10 11v6"/><path d="M14 11v6"/></svg>'), Bi = "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#1f2937" stroke-width="2" stroke-linecap="round"><path d="M6 6l12 12"/><path d="M18 6L6 18"/></svg>');
|
|
7590
|
+
class Ni {
|
|
7569
7591
|
engine;
|
|
7570
7592
|
container;
|
|
7571
7593
|
layer;
|
|
@@ -7574,7 +7596,7 @@ class Ri {
|
|
|
7574
7596
|
records = [];
|
|
7575
7597
|
isActive = !1;
|
|
7576
7598
|
currentType = null;
|
|
7577
|
-
style = { ...
|
|
7599
|
+
style = { ...Ge };
|
|
7578
7600
|
draft = null;
|
|
7579
7601
|
draftStart = null;
|
|
7580
7602
|
polygonPoints = [];
|
|
@@ -7745,7 +7767,7 @@ class Ri {
|
|
|
7745
7767
|
{ type: "cloudline", title: "云线,双击或 Enter 结束" },
|
|
7746
7768
|
{ type: "text", title: "文字" }
|
|
7747
7769
|
].forEach((a) => {
|
|
7748
|
-
const h = this.createIconButton(a.title,
|
|
7770
|
+
const h = this.createIconButton(a.title, zi[a.type]);
|
|
7749
7771
|
h.onclick = () => {
|
|
7750
7772
|
this.active(), this.setDrawType(a.type);
|
|
7751
7773
|
}, a.type !== "none" && (this.buttons[a.type] = h), e.appendChild(h);
|
|
@@ -7756,15 +7778,15 @@ class Ri {
|
|
|
7756
7778
|
}, e.appendChild(i);
|
|
7757
7779
|
const n = document.createElement("input");
|
|
7758
7780
|
n.type = "number", n.min = "1", n.max = "20", n.value = `${this.style.strokeWidth}`, n.title = "线宽", n.onchange = () => {
|
|
7759
|
-
this.style.strokeWidth = this.normalizeNumber(n.valueAsNumber, 1, 20,
|
|
7781
|
+
this.style.strokeWidth = this.normalizeNumber(n.valueAsNumber, 1, 20, Ge.strokeWidth);
|
|
7760
7782
|
}, e.appendChild(n);
|
|
7761
7783
|
const s = document.createElement("input");
|
|
7762
7784
|
s.type = "number", s.min = "10", s.max = "72", s.value = `${this.style.fontSize}`, s.title = "字号", s.onchange = () => {
|
|
7763
|
-
this.style.fontSize = this.normalizeNumber(s.valueAsNumber, 10, 72,
|
|
7785
|
+
this.style.fontSize = this.normalizeNumber(s.valueAsNumber, 10, 72, Ge.fontSize);
|
|
7764
7786
|
}, e.appendChild(s), e.appendChild(this.createDivider());
|
|
7765
|
-
const r = this.createIconButton("清空",
|
|
7787
|
+
const r = this.createIconButton("清空", Ri);
|
|
7766
7788
|
r.onclick = () => this.clearAll(), e.appendChild(r);
|
|
7767
|
-
const o = this.createIconButton("关闭",
|
|
7789
|
+
const o = this.createIconButton("关闭", Bi);
|
|
7768
7790
|
return o.onclick = () => {
|
|
7769
7791
|
this.hideToolbar(), this.disActive();
|
|
7770
7792
|
}, e.appendChild(o), e;
|
|
@@ -7965,11 +7987,11 @@ class Ri {
|
|
|
7965
7987
|
return `markup-2d-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
7966
7988
|
}
|
|
7967
7989
|
}
|
|
7968
|
-
class
|
|
7990
|
+
class Oi {
|
|
7969
7991
|
engine;
|
|
7970
7992
|
manager;
|
|
7971
7993
|
constructor(e) {
|
|
7972
|
-
this.engine = e, this.manager = new
|
|
7994
|
+
this.engine = e, this.manager = new jt({
|
|
7973
7995
|
container: e.container,
|
|
7974
7996
|
className: "bim-engine-label-container bim-engine-label-container-2d",
|
|
7975
7997
|
projectCoordinate: (t) => this.projectCoordinate(t),
|
|
@@ -8032,7 +8054,7 @@ class Bi {
|
|
|
8032
8054
|
return { x: i.x, y: i.y, z: 0 };
|
|
8033
8055
|
}
|
|
8034
8056
|
}
|
|
8035
|
-
class
|
|
8057
|
+
class Wi {
|
|
8036
8058
|
engine;
|
|
8037
8059
|
mainViewPort = null;
|
|
8038
8060
|
constructor(e) {
|
|
@@ -8068,7 +8090,7 @@ class Ni {
|
|
|
8068
8090
|
};
|
|
8069
8091
|
}
|
|
8070
8092
|
}
|
|
8071
|
-
class
|
|
8093
|
+
class ji {
|
|
8072
8094
|
constructor(e, t) {
|
|
8073
8095
|
this.container = e, this.engine = t, this.el = document.createElement("div"), this.el.className = "engine-2d-workspace-tabs", this.container.appendChild(this.el), this.unsubscribe = this.engine.events?.on(fe.ModelLoaded, () => this.refresh()) ?? (() => {
|
|
8074
8096
|
}), this.refresh();
|
|
@@ -8107,7 +8129,7 @@ class Oi {
|
|
|
8107
8129
|
this.unsubscribe(), this.el.remove();
|
|
8108
8130
|
}
|
|
8109
8131
|
}
|
|
8110
|
-
class
|
|
8132
|
+
class Ui {
|
|
8111
8133
|
// 配置选项
|
|
8112
8134
|
options;
|
|
8113
8135
|
container = null;
|
|
@@ -8152,7 +8174,7 @@ class Wi {
|
|
|
8152
8174
|
renderer = null;
|
|
8153
8175
|
// 数据
|
|
8154
8176
|
dwgData = null;
|
|
8155
|
-
version =
|
|
8177
|
+
version = ri;
|
|
8156
8178
|
constructor(e) {
|
|
8157
8179
|
if (this.options = e, this.options.backgroundColor = this.options.backgroundColor ?? 1710618, this.options.enablePerformanceMonitoring = this.options.enablePerformanceMonitoring ?? !1, this.options.showMouseCoordinates = this.options.showMouseCoordinates ?? !1, this.options.loadingStyle = this.options.loadingStyle ?? 2, this.options.contextMenu = this.options.contextMenu ?? {
|
|
8158
8180
|
items: [
|
|
@@ -8166,13 +8188,13 @@ class Wi {
|
|
|
8166
8188
|
]
|
|
8167
8189
|
}, this.enablePerformanceMonitoring = e.enablePerformanceMonitoring ?? !1, this.container = document.getElementById(e.containerId), !this.container)
|
|
8168
8190
|
throw new Error(`Container ${e.containerId} not found`);
|
|
8169
|
-
this.initialize(), this.handelBehaved2d =
|
|
8191
|
+
this.initialize(), this.handelBehaved2d = wi(this), this.interactionModule2d = new xi(this), this.interactionModule2d.init(), this.interactionModule2d.active();
|
|
8170
8192
|
}
|
|
8171
8193
|
/**
|
|
8172
8194
|
* 初始化引擎
|
|
8173
8195
|
*/
|
|
8174
8196
|
initialize() {
|
|
8175
|
-
this.events = new
|
|
8197
|
+
this.events = new Kt(!1), this.sceneModule2d = new hi(this, this.options), this.scene = this.sceneModule2d.scene, this.cameraModule2d = new di(this, this.container), this.camera = this.cameraModule2d.orthographicCamera, this.renderModule2d = new ui(this, this.container, this.options), this.renderer = this.renderModule2d.renderer, this.controlModule2d = new fi(this), this.loaderModule2d = new ii(this), this.themeManager = new Ai(this.container), this.layerManager = new ct(this), this.searchManager = new Ti(this), this.measure = new Di(this), this.markup = new Ni(this), this.label = new Oi(this), this.viewCube = new Wi(this), this.octreeBox2d = new mi(this), this.modelToolModule2d = new vi(this), this.engineStatus2d = new ci(this), this.linkView2d3d = new gi(this), this.linkElement2d3d = new yi(this), this.sceneModule2d.initGrid(), this.cadCursorUI = new Mi(this.container, this.renderer.domElement, this.options.cursorStyle ?? "short-crosshair"), this.cadCursorUI.setBackgroundColor(this.options.backgroundColor ?? 1710618), this.loadingUI = new _i(this.container, this.options.loadingStyle), this.events.on(fe.ModelLoadStart, () => this.loadingUI.show("正在加载...", 0)), this.events.on(fe.ModelLoadProgress, (e) => this.loadingUI.update(e.text, e.progress)), this.events.on(fe.ModelLoaded, () => this.loadingUI.hide()), this.events.on(fe.ModelLoadError, () => this.loadingUI.hide()), this.versionEl = document.createElement("div"), this.versionEl.className = "engine-2d-version-text", this.updateVersionDisplay(), this.container.appendChild(this.versionEl), this.workspaceTabsUI = new ji(this.container, this), this.contextMenuUI = new ki(
|
|
8176
8198
|
this.container,
|
|
8177
8199
|
this.renderer.domElement,
|
|
8178
8200
|
(e) => {
|
|
@@ -8215,7 +8237,7 @@ class Wi {
|
|
|
8215
8237
|
};
|
|
8216
8238
|
/** 初始化 stats.js 性能监视器,showStats 优先控制可视面板,旧配置 enablePerformanceMonitoring 继续兼容。 */
|
|
8217
8239
|
initStatsMonitor() {
|
|
8218
|
-
!(this.options.showStats ?? this.enablePerformanceMonitoring) || !this.container || (this.stats = new
|
|
8240
|
+
!(this.options.showStats ?? this.enablePerformanceMonitoring) || !this.container || (this.stats = new Yt(), this.stats.showPanel(0), this.stats.dom.className = "engine-2d-stats-monitor", 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));
|
|
8219
8241
|
}
|
|
8220
8242
|
/**
|
|
8221
8243
|
* 更新性能统计
|
|
@@ -8239,8 +8261,11 @@ class Wi {
|
|
|
8239
8261
|
/**
|
|
8240
8262
|
* 通过 viewToken 向 OpenAPI 解析真实加载地址,再复用现有 2D URL 加载逻辑。
|
|
8241
8263
|
*/
|
|
8264
|
+
async loadModelFile(e, t) {
|
|
8265
|
+
return await this.loaderModule2d.loadModelFile(e, t), {};
|
|
8266
|
+
}
|
|
8242
8267
|
async loadModelByViewToken(e, t) {
|
|
8243
|
-
const i = await
|
|
8268
|
+
const i = await Ut(
|
|
8244
8269
|
this.options,
|
|
8245
8270
|
e,
|
|
8246
8271
|
"2d"
|
|
@@ -8447,17 +8472,17 @@ class Wi {
|
|
|
8447
8472
|
console.log("[EngineKernel2d] Disposing engine..."), this.stopRendering(), this.cadCursorUI?.dispose(), this.contextMenuUI?.dispose(), this.loadingUI?.dispose(), this.workspaceTabsUI?.dispose(), this.versionEl?.parentElement?.removeChild(this.versionEl), this.searchManager?.dispose(), this.measure?.dispose(), this.markup?.dispose(), this.label?.dispose(), this.themeManager?.dispose(), this.loaderModule2d?.dispose(), this.controlModule2d?.dispose(), this.renderModule2d?.dispose(), this.cameraModule2d?.dispose(), this.sceneModule2d?.dispose(), this.events?.dispose(), this.stats?.dom?.parentElement && this.stats.dom.parentElement.removeChild(this.stats.dom), this.scene = null, this.camera = null, this.renderer = null, this.dwgData = null, this.stats = void 0, this.versionEl = null, console.log("[EngineKernel2d] Engine disposed");
|
|
8448
8473
|
}
|
|
8449
8474
|
}
|
|
8450
|
-
const
|
|
8475
|
+
const Zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8451
8476
|
__proto__: null,
|
|
8452
|
-
EngineKernel2d:
|
|
8477
|
+
EngineKernel2d: Ui
|
|
8453
8478
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8454
8479
|
export {
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8480
|
+
ri as E,
|
|
8481
|
+
Ht as J,
|
|
8482
|
+
ii as L,
|
|
8483
|
+
Yt as S,
|
|
8484
|
+
Gi as a,
|
|
8485
|
+
Zi as b,
|
|
8461
8486
|
Oe as c,
|
|
8462
8487
|
ht as g
|
|
8463
8488
|
};
|