iflow-engine-base 3.9.205 → 3.9.211
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 +818 -818
- package/dist/chunks/{engine-2d-DAiE1uAy.js → engine-2d-DfXdo35a.js} +106 -99
- package/dist/chunks/{engine-3d-CdsLfd0i.js → engine-3d-pR92L_EF.js} +26108 -12822
- package/dist/chunks/{engine-720-K9uF9wMA.js → engine-720-B9i7xmDy.js} +32 -31
- package/dist/chunks/{engine-gaussian-x3jsCp15.js → engine-gaussian-BO2fXRFQ.js} +137 -136
- package/dist/chunks/{engine-gis-BStgPU0Q.js → engine-gis-DNuY4ydw.js} +3 -3
- package/dist/chunks/{sdk-runtime-cY1Wn7o-.js → sdk-runtime-CvEwm_hr.js} +1359 -1262
- package/dist/chunks/{three-vendor-Dbcwwhki.js → three-vendor-BislQYFI.js} +52 -52
- package/dist/index.d.ts +12 -0
- package/dist2d/dwg-preview.es.js +1559 -1456
- package/dist2d/dwg-preview.umd.js +16 -16
- package/distGaussian/gaussian.es.js +368 -271
- package/distGaussian/gaussian.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
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 Ge, 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 Ze, 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,
|
|
2
|
-
import { F as qe, W as lt, L 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 Ge, 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 Ze, 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-BislQYFI.js";
|
|
2
|
+
import { F as qe, C as Nt, W as lt, L as Ot, r as Wt } from "./sdk-runtime-CvEwm_hr.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(A) {
|
|
@@ -10,7 +10,7 @@ function We(A) {
|
|
|
10
10
|
}
|
|
11
11
|
var Ve = { exports: {} };
|
|
12
12
|
var Je;
|
|
13
|
-
function
|
|
13
|
+
function jt() {
|
|
14
14
|
return Je || (Je = 1, (function(A, e) {
|
|
15
15
|
(function(t) {
|
|
16
16
|
A.exports = t();
|
|
@@ -2312,14 +2312,14 @@ function Ot() {
|
|
|
2312
2312
|
});
|
|
2313
2313
|
})(Ve)), Ve.exports;
|
|
2314
2314
|
}
|
|
2315
|
-
var
|
|
2316
|
-
const
|
|
2317
|
-
var je = { exports: {} },
|
|
2318
|
-
function
|
|
2315
|
+
var Ut = jt();
|
|
2316
|
+
const Ft = /* @__PURE__ */ ht(Ut);
|
|
2317
|
+
var je = { exports: {} }, Vt = je.exports, Qe;
|
|
2318
|
+
function Ht() {
|
|
2319
2319
|
return Qe || (Qe = 1, (function(A, e) {
|
|
2320
2320
|
(function(t, i) {
|
|
2321
2321
|
A.exports = i();
|
|
2322
|
-
})(
|
|
2322
|
+
})(Vt, function() {
|
|
2323
2323
|
var t = function() {
|
|
2324
2324
|
function i(d) {
|
|
2325
2325
|
return r.appendChild(d.dom), d;
|
|
@@ -2359,9 +2359,9 @@ function Ft() {
|
|
|
2359
2359
|
});
|
|
2360
2360
|
})(je)), je.exports;
|
|
2361
2361
|
}
|
|
2362
|
-
var
|
|
2363
|
-
const
|
|
2364
|
-
class
|
|
2362
|
+
var Gt = Ht();
|
|
2363
|
+
const Zt = /* @__PURE__ */ ht(Gt);
|
|
2364
|
+
class $t {
|
|
2365
2365
|
panel = null;
|
|
2366
2366
|
listEl = null;
|
|
2367
2367
|
isVisible = !1;
|
|
@@ -2515,7 +2515,7 @@ class ct {
|
|
|
2515
2515
|
constructor(e) {
|
|
2516
2516
|
this.engine = e;
|
|
2517
2517
|
const t = document.getElementById(e?.options?.containerId ?? "") ?? e?.container ?? null;
|
|
2518
|
-
t && (this.panelUI = new
|
|
2518
|
+
t && (this.panelUI = new $t(t, this));
|
|
2519
2519
|
}
|
|
2520
2520
|
// ─── 数据 ──────────────────────────────────────────────
|
|
2521
2521
|
_loadLayers(e = this.engine.dwgData?.layers ?? []) {
|
|
@@ -2643,7 +2643,7 @@ class ct {
|
|
|
2643
2643
|
}
|
|
2644
2644
|
}
|
|
2645
2645
|
var fe = /* @__PURE__ */ ((A) => (A.ModelLoadStart = "model-load-start", A.ModelLoadProgress = "model-load-progress", A.ModelLoaded = "model-loaded", A.ModelLoadError = "model-load-error", A.RenderStart = "render-start", A.RenderEnd = "render-end", A.CameraChanged = "camera-changed", A.CameraReset = "camera-reset", A.SelectionChanged = "selection-changed", A.HoverChanged = "hover-changed", A.EntityClick = "entity-click", A.LayerVisibilityChanged = "layer-visibility-changed", A.LayerColorChanged = "layer-color-changed", A.ViewZoomChanged = "view-zoom-changed", A.ViewPanChanged = "view-pan-changed", A.ToolActivated = "tool-activated", A.ToolDeactivated = "tool-deactivated", A.Error = "error", A.Warning = "warning", A))(fe || {});
|
|
2646
|
-
class
|
|
2646
|
+
class Yt {
|
|
2647
2647
|
listeners = /* @__PURE__ */ new Map();
|
|
2648
2648
|
onceListeners = /* @__PURE__ */ new Map();
|
|
2649
2649
|
debugMode = !1;
|
|
@@ -2768,7 +2768,7 @@ function $e(A, e, t) {
|
|
|
2768
2768
|
const i = new X(A[0] ?? 0, A[1] ?? 0, A[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);
|
|
2769
2769
|
return new Me().compose(i, r, s);
|
|
2770
2770
|
}
|
|
2771
|
-
function
|
|
2771
|
+
function Xt(A) {
|
|
2772
2772
|
return Array.isArray(A?.transformMatrix) && A.transformMatrix.length === 16 ? new Me().fromArray(A.transformMatrix) : $e(
|
|
2773
2773
|
A.position ?? [0, 0, 0],
|
|
2774
2774
|
A.scale ?? [1, 1, 1],
|
|
@@ -2830,7 +2830,7 @@ class et {
|
|
|
2830
2830
|
for (const n of e)
|
|
2831
2831
|
if (n?.visible !== !1) {
|
|
2832
2832
|
if (n.type === "INSERT") {
|
|
2833
|
-
const s = this.getBlockItems(n.blockId, i + 1), r = t.clone().multiply(
|
|
2833
|
+
const s = this.getBlockItems(n.blockId, i + 1), r = t.clone().multiply(Xt(n)), o = this.getClipPolygon(n, t);
|
|
2834
2834
|
for (const a of s) {
|
|
2835
2835
|
const h = this.cloneRenderItem(a, r, n), u = o ? this.clipRenderItem(h, o) : h;
|
|
2836
2836
|
u && (yield u);
|
|
@@ -3044,7 +3044,7 @@ class et {
|
|
|
3044
3044
|
};
|
|
3045
3045
|
}
|
|
3046
3046
|
}
|
|
3047
|
-
class
|
|
3047
|
+
class Kt {
|
|
3048
3048
|
zipObjectUrls = [];
|
|
3049
3049
|
/** 加载新版 manifest 分包数据,并返回 Loader 可消费的 DWGData 结构。 */
|
|
3050
3050
|
async load(e) {
|
|
@@ -3190,7 +3190,7 @@ class Yt {
|
|
|
3190
3190
|
const t = await fetch(e);
|
|
3191
3191
|
if (!t.ok)
|
|
3192
3192
|
throw new Error(`HTTP error! status: ${t.status}`);
|
|
3193
|
-
const i = await
|
|
3193
|
+
const i = await Ft.loadAsync(await t.arrayBuffer()), n = this.findZipManifestPath(i), s = await this.fetchZipJson(i, n);
|
|
3194
3194
|
if (!this.isSplitManifest(s))
|
|
3195
3195
|
throw new Error("[LoaderModule2d] Expected split CAD manifest data in .2d package.");
|
|
3196
3196
|
const r = this.getZipBasePath(n);
|
|
@@ -3267,8 +3267,8 @@ class Yt {
|
|
|
3267
3267
|
this.zipObjectUrls.forEach((e) => URL.revokeObjectURL(e)), this.zipObjectUrls = [];
|
|
3268
3268
|
}
|
|
3269
3269
|
}
|
|
3270
|
-
const ae = 1e-8, tt = 1e-3,
|
|
3271
|
-
class
|
|
3270
|
+
const ae = 1e-8, tt = 1e-3, qt = 8421504;
|
|
3271
|
+
class Jt {
|
|
3272
3272
|
constructor(e) {
|
|
3273
3273
|
this.engine = e;
|
|
3274
3274
|
}
|
|
@@ -3281,7 +3281,7 @@ class Kt {
|
|
|
3281
3281
|
if (this.isSolidFill(e))
|
|
3282
3282
|
return this.createSolidItems(e, t, i);
|
|
3283
3283
|
const s = this.createPatternLineItem(e, t, i);
|
|
3284
|
-
return s ? [s] : (this.warnUnknownPatternFallback(e), this.createSolidItems(e, t, i,
|
|
3284
|
+
return s ? [s] : (this.warnUnknownPatternFallback(e), this.createSolidItems(e, t, i, qt));
|
|
3285
3285
|
}
|
|
3286
3286
|
/** 只有明确的 SOLID 才作为实心面;patternType=SolidFill 在当前导出数据里不可靠。 */
|
|
3287
3287
|
isSolidFill(e) {
|
|
@@ -3651,7 +3651,7 @@ class Kt {
|
|
|
3651
3651
|
}
|
|
3652
3652
|
class it {
|
|
3653
3653
|
constructor(e, t) {
|
|
3654
|
-
this.engine = e, this.textFactory = t, this.hatchRenderer = new
|
|
3654
|
+
this.engine = e, this.textFactory = t, this.hatchRenderer = new Jt(e);
|
|
3655
3655
|
}
|
|
3656
3656
|
hatchRenderer;
|
|
3657
3657
|
/** 根据实体类型分发到线、文字、填充、图片等具体几何生成逻辑。 */
|
|
@@ -3843,7 +3843,7 @@ class it {
|
|
|
3843
3843
|
}];
|
|
3844
3844
|
}
|
|
3845
3845
|
}
|
|
3846
|
-
class
|
|
3846
|
+
class Qt {
|
|
3847
3847
|
constructor(e, t, i = e.modelGroup, n = {}) {
|
|
3848
3848
|
this.model = t, this.targetGroup = i, this.options = n;
|
|
3849
3849
|
}
|
|
@@ -4160,13 +4160,13 @@ class nt {
|
|
|
4160
4160
|
return s.applyMatrix4($e([(t.min.x + t.max.x) / 2, (t.min.y + t.max.y) / 2, 0], [1, 1, 1], 0)), s;
|
|
4161
4161
|
}
|
|
4162
4162
|
}
|
|
4163
|
-
class
|
|
4163
|
+
class ei {
|
|
4164
4164
|
engine;
|
|
4165
4165
|
data = null;
|
|
4166
4166
|
enableValidation = !0;
|
|
4167
4167
|
model = this.createEmptyModel();
|
|
4168
4168
|
font = null;
|
|
4169
|
-
dataSource = new
|
|
4169
|
+
dataSource = new Kt();
|
|
4170
4170
|
lastBuildOptions = {};
|
|
4171
4171
|
activeWorkspace = { type: "model", name: "模型" };
|
|
4172
4172
|
workspaceCache = /* @__PURE__ */ new Map();
|
|
@@ -4344,7 +4344,7 @@ class Jt {
|
|
|
4344
4344
|
for (let a = 0; a < e.length; a += 1) {
|
|
4345
4345
|
const h = e[a], u = this.createTileGroup(h, n.namePrefix);
|
|
4346
4346
|
t.add(u);
|
|
4347
|
-
const g = new
|
|
4347
|
+
const g = new Qt(this.engine, this.model, u, {
|
|
4348
4348
|
interactive: n.interactive ?? !0
|
|
4349
4349
|
}), v = /* @__PURE__ */ new Set();
|
|
4350
4350
|
let d = 0, y = 0;
|
|
@@ -4669,9 +4669,9 @@ class Jt {
|
|
|
4669
4669
|
this.clear();
|
|
4670
4670
|
}
|
|
4671
4671
|
}
|
|
4672
|
-
const
|
|
4673
|
-
version:
|
|
4674
|
-
},
|
|
4672
|
+
const ti = "3.9.21", ii = {
|
|
4673
|
+
version: ti
|
|
4674
|
+
}, ni = ii.version, si = `
|
|
4675
4675
|
varying vec2 vWorldPos;
|
|
4676
4676
|
|
|
4677
4677
|
void main() {
|
|
@@ -4679,7 +4679,7 @@ const Qt = "3.9.205", ei = {
|
|
|
4679
4679
|
vWorldPos = worldPosition.xy;
|
|
4680
4680
|
gl_Position = projectionMatrix * viewMatrix * worldPosition;
|
|
4681
4681
|
}
|
|
4682
|
-
`,
|
|
4682
|
+
`, ri = `
|
|
4683
4683
|
precision highp float;
|
|
4684
4684
|
|
|
4685
4685
|
varying vec2 vWorldPos;
|
|
@@ -4735,7 +4735,7 @@ const Qt = "3.9.205", ei = {
|
|
|
4735
4735
|
gl_FragColor = vec4(color, alpha);
|
|
4736
4736
|
}
|
|
4737
4737
|
`;
|
|
4738
|
-
class
|
|
4738
|
+
class oi {
|
|
4739
4739
|
scene;
|
|
4740
4740
|
camera;
|
|
4741
4741
|
container;
|
|
@@ -4788,8 +4788,8 @@ class si {
|
|
|
4788
4788
|
createGridMesh() {
|
|
4789
4789
|
this.gridGeometry = new at(1, 1, 1, 1), this.gridMaterial = new Ct({
|
|
4790
4790
|
uniforms: this.gridUniforms,
|
|
4791
|
-
vertexShader:
|
|
4792
|
-
fragmentShader:
|
|
4791
|
+
vertexShader: si,
|
|
4792
|
+
fragmentShader: ri,
|
|
4793
4793
|
transparent: !0,
|
|
4794
4794
|
depthWrite: !1,
|
|
4795
4795
|
depthTest: !1,
|
|
@@ -4878,7 +4878,7 @@ class si {
|
|
|
4878
4878
|
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;
|
|
4879
4879
|
}
|
|
4880
4880
|
}
|
|
4881
|
-
class
|
|
4881
|
+
class ai {
|
|
4882
4882
|
engine;
|
|
4883
4883
|
scene;
|
|
4884
4884
|
options;
|
|
@@ -4911,7 +4911,7 @@ class ri {
|
|
|
4911
4911
|
* 创建网格辅助(自适应网格)
|
|
4912
4912
|
*/
|
|
4913
4913
|
createGrid(e = 1e3, t = 50) {
|
|
4914
|
-
this.adaptiveGrid && (this.adaptiveGrid.dispose(), this.adaptiveGrid = void 0), this.adaptiveGrid = new
|
|
4914
|
+
this.adaptiveGrid && (this.adaptiveGrid.dispose(), this.adaptiveGrid = void 0), this.adaptiveGrid = new oi(
|
|
4915
4915
|
this.scene,
|
|
4916
4916
|
this.engine.cameraModule2d.orthographicCamera,
|
|
4917
4917
|
this.engine.renderModule2d.container
|
|
@@ -5013,7 +5013,7 @@ class ri {
|
|
|
5013
5013
|
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();
|
|
5014
5014
|
}
|
|
5015
5015
|
}
|
|
5016
|
-
class
|
|
5016
|
+
class li {
|
|
5017
5017
|
engine;
|
|
5018
5018
|
isFree;
|
|
5019
5019
|
// 高亮模型
|
|
@@ -5029,7 +5029,7 @@ class oi {
|
|
|
5029
5029
|
this.engine = e, this.isFree = !0, this.highlightModels = [], this.hideModels = [], this.translucentModels = [], this.highlightHoverModels = [], this.models = [];
|
|
5030
5030
|
}
|
|
5031
5031
|
}
|
|
5032
|
-
class
|
|
5032
|
+
class hi {
|
|
5033
5033
|
engine;
|
|
5034
5034
|
orthographicCamera;
|
|
5035
5035
|
container;
|
|
@@ -5261,23 +5261,24 @@ class ai {
|
|
|
5261
5261
|
this.animationId !== null && (cancelAnimationFrame(this.animationId), this.animationId = null), this.orthographicCamera = null;
|
|
5262
5262
|
}
|
|
5263
5263
|
}
|
|
5264
|
-
class
|
|
5264
|
+
class ci {
|
|
5265
5265
|
engine;
|
|
5266
5266
|
renderer;
|
|
5267
5267
|
container;
|
|
5268
5268
|
options;
|
|
5269
|
+
watermark;
|
|
5269
5270
|
// 渲染配置
|
|
5270
5271
|
antialias = !0;
|
|
5271
5272
|
alpha = !1;
|
|
5272
5273
|
precision = "highp";
|
|
5273
5274
|
constructor(e, t, i) {
|
|
5274
|
-
this.engine = e, this.container = t, this.options = i, this.renderer = this.createRenderer(), this.handleResize();
|
|
5275
|
+
this.engine = e, this.container = t, this.options = i, this.watermark = new Nt(Lt), this.renderer = this.createRenderer(), this.handleResize();
|
|
5275
5276
|
}
|
|
5276
5277
|
/**
|
|
5277
5278
|
* 创建 WebGL 渲染器
|
|
5278
5279
|
*/
|
|
5279
5280
|
createRenderer() {
|
|
5280
|
-
const e = new
|
|
5281
|
+
const e = new Pt({
|
|
5281
5282
|
antialias: this.antialias,
|
|
5282
5283
|
alpha: this.alpha,
|
|
5283
5284
|
precision: this.precision
|
|
@@ -5291,7 +5292,7 @@ class li {
|
|
|
5291
5292
|
*/
|
|
5292
5293
|
render(e, t) {
|
|
5293
5294
|
const i = performance.now();
|
|
5294
|
-
this.engine.events && this.engine.events.trigger("render-start"), this.renderer.render(e, t);
|
|
5295
|
+
this.engine.events && this.engine.events.trigger("render-start"), this.renderer.render(e, t), this.drawWatermark();
|
|
5295
5296
|
const n = performance.now() - i;
|
|
5296
5297
|
this.engine.events && this.engine.events.trigger("render-end", { renderTime: n });
|
|
5297
5298
|
}
|
|
@@ -5366,6 +5367,12 @@ class li {
|
|
|
5366
5367
|
clear(e = !0, t = !0, i = !1) {
|
|
5367
5368
|
this.renderer.clear(e, t, i);
|
|
5368
5369
|
}
|
|
5370
|
+
/**
|
|
5371
|
+
* 将水印绘制到当前 WebGL canvas,供主循环和截图的强制渲染复用。
|
|
5372
|
+
*/
|
|
5373
|
+
drawWatermark() {
|
|
5374
|
+
this.watermark.render(this.renderer);
|
|
5375
|
+
}
|
|
5369
5376
|
/**
|
|
5370
5377
|
* 获取渲染器信息
|
|
5371
5378
|
* @returns 渲染器信息
|
|
@@ -5390,10 +5397,10 @@ class li {
|
|
|
5390
5397
|
* 销毁渲染模块
|
|
5391
5398
|
*/
|
|
5392
5399
|
dispose() {
|
|
5393
|
-
window.removeEventListener("resize", this.onWindowResize.bind(this)), this.renderer.dispose(), this.container.contains(this.renderer.domElement) && this.container.removeChild(this.renderer.domElement), this.renderer = null;
|
|
5400
|
+
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;
|
|
5394
5401
|
}
|
|
5395
5402
|
}
|
|
5396
|
-
class
|
|
5403
|
+
class di extends Dt {
|
|
5397
5404
|
object;
|
|
5398
5405
|
domElement;
|
|
5399
5406
|
enabled = !0;
|
|
@@ -5603,7 +5610,7 @@ class hi extends Pt {
|
|
|
5603
5610
|
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));
|
|
5604
5611
|
}
|
|
5605
5612
|
}
|
|
5606
|
-
class
|
|
5613
|
+
class ui {
|
|
5607
5614
|
engine;
|
|
5608
5615
|
panControls;
|
|
5609
5616
|
isActive = !0;
|
|
@@ -5620,7 +5627,7 @@ class ci {
|
|
|
5620
5627
|
* 创建 2D 平移控制器
|
|
5621
5628
|
*/
|
|
5622
5629
|
createPanControls() {
|
|
5623
|
-
const e = new
|
|
5630
|
+
const e = new di(
|
|
5624
5631
|
this.engine.camera,
|
|
5625
5632
|
this.engine.renderer.domElement
|
|
5626
5633
|
);
|
|
@@ -5736,7 +5743,7 @@ class ci {
|
|
|
5736
5743
|
this.panControls.dispose(), this.panControls = null;
|
|
5737
5744
|
}
|
|
5738
5745
|
}
|
|
5739
|
-
class
|
|
5746
|
+
class pi {
|
|
5740
5747
|
engine;
|
|
5741
5748
|
pickBoxElementIds = [];
|
|
5742
5749
|
worldToScreen;
|
|
@@ -5817,7 +5824,7 @@ class di {
|
|
|
5817
5824
|
const s = new Ee();
|
|
5818
5825
|
return Object.keys(i.attributes).forEach((r) => {
|
|
5819
5826
|
const o = i.getAttribute(r), a = o.itemSize, h = o.array, u = n.start * a, g = (n.start + n.count) * a;
|
|
5820
|
-
s.setAttribute(r, new
|
|
5827
|
+
s.setAttribute(r, new zt(h.slice(u, g), a, o.normalized));
|
|
5821
5828
|
}), s;
|
|
5822
5829
|
}
|
|
5823
5830
|
/** 获取鼠标射线经过的 octree 节点内元素。 */
|
|
@@ -5873,7 +5880,7 @@ class di {
|
|
|
5873
5880
|
return e.distanceTo(a);
|
|
5874
5881
|
}
|
|
5875
5882
|
}
|
|
5876
|
-
class
|
|
5883
|
+
class fi {
|
|
5877
5884
|
engine;
|
|
5878
5885
|
// 小组件容器
|
|
5879
5886
|
widgetContainer = null;
|
|
@@ -6041,7 +6048,7 @@ class ui {
|
|
|
6041
6048
|
return Math.atan2(e.clientX - i, n - e.clientY);
|
|
6042
6049
|
}
|
|
6043
6050
|
}
|
|
6044
|
-
class
|
|
6051
|
+
class mi {
|
|
6045
6052
|
engine;
|
|
6046
6053
|
enabled = !1;
|
|
6047
6054
|
constructor(e) {
|
|
@@ -6094,7 +6101,7 @@ class pi {
|
|
|
6094
6101
|
return e?.object ?? e?.group?.children?.[e.indexes?.[0]] ?? this.engine.modelGroup?.children?.[e.indexes?.[0]];
|
|
6095
6102
|
}
|
|
6096
6103
|
}
|
|
6097
|
-
class
|
|
6104
|
+
class gi {
|
|
6098
6105
|
engine;
|
|
6099
6106
|
highlightMaterial;
|
|
6100
6107
|
hideMaterial;
|
|
@@ -6127,7 +6134,7 @@ class fi {
|
|
|
6127
6134
|
}
|
|
6128
6135
|
/** 拆分合并网格,让单个子几何可以通过 materialIndex 独立高亮或隐藏。 */
|
|
6129
6136
|
split_merge_model(e) {
|
|
6130
|
-
if (e.isSplit || e instanceof
|
|
6137
|
+
if (e.isSplit || e instanceof Rt)
|
|
6131
6138
|
return;
|
|
6132
6139
|
const t = e.materialClone.clone(), i = Array.isArray(e.geometrys) && e.geometrys.length > 0 ? ze(e.geometrys, !0) : e.geometry;
|
|
6133
6140
|
i.groups.forEach((n) => {
|
|
@@ -6354,7 +6361,7 @@ class fi {
|
|
|
6354
6361
|
return !0;
|
|
6355
6362
|
}
|
|
6356
6363
|
}
|
|
6357
|
-
function
|
|
6364
|
+
function yi(A) {
|
|
6358
6365
|
const e = {
|
|
6359
6366
|
mouseMoveFrame: null,
|
|
6360
6367
|
latestMouseMoveEvent: null,
|
|
@@ -6391,7 +6398,7 @@ function mi(A) {
|
|
|
6391
6398
|
return f.x = l.offsetX / m * 2 - 1, f.y = -(l.offsetY / w) * 2 + 1, f;
|
|
6392
6399
|
}
|
|
6393
6400
|
function s(l) {
|
|
6394
|
-
const f = new
|
|
6401
|
+
const f = new Bt(), m = n(l);
|
|
6395
6402
|
return f.setFromCamera(m, A.camera), f;
|
|
6396
6403
|
}
|
|
6397
6404
|
function r(l, f = !1) {
|
|
@@ -6464,7 +6471,7 @@ function mi(A) {
|
|
|
6464
6471
|
}
|
|
6465
6472
|
return e;
|
|
6466
6473
|
}
|
|
6467
|
-
class
|
|
6474
|
+
class vi {
|
|
6468
6475
|
el;
|
|
6469
6476
|
xEl;
|
|
6470
6477
|
yEl;
|
|
@@ -6484,7 +6491,7 @@ class gi {
|
|
|
6484
6491
|
}
|
|
6485
6492
|
}
|
|
6486
6493
|
var ut = /* @__PURE__ */ ((A) => (A.ModelLoadStart = "model-load-start", A.ModelLoadProgress = "model-load-progress", A.ModelLoaded = "model-loaded", A.ModelError = "model-error", A.SelectionChanged = "selection-changed", A.HoverChanged = "hover-changed", A.Click = "click", A.MouseMove = "mouse-move", A.CameraChanged = "camera-changed", A.CameraIdle = "camera-idle", A.EngineFree = "engine-free", A.EngineBusy = "engine-busy", A.MeasureChanged = "measure-changed", A.MeasureClick = "measure-click", A.SectionMove = "section-move", A))(ut || {});
|
|
6487
|
-
class
|
|
6494
|
+
class wi {
|
|
6488
6495
|
engine;
|
|
6489
6496
|
behavior;
|
|
6490
6497
|
mouseCoordUI = null;
|
|
@@ -6494,7 +6501,7 @@ class yi {
|
|
|
6494
6501
|
init() {
|
|
6495
6502
|
this.behavior = this.engine.handelBehaved2d, this.behavior.init(this);
|
|
6496
6503
|
const e = this.engine.container;
|
|
6497
|
-
e && this.engine.options?.showMouseCoordinates !== !1 && (this.mouseCoordUI = new
|
|
6504
|
+
e && this.engine.options?.showMouseCoordinates !== !1 && (this.mouseCoordUI = new vi(e));
|
|
6498
6505
|
}
|
|
6499
6506
|
active() {
|
|
6500
6507
|
this.behavior.active();
|
|
@@ -6561,7 +6568,7 @@ class yi {
|
|
|
6561
6568
|
this.mouseCoordUI?.dispose(), this.mouseCoordUI = null;
|
|
6562
6569
|
}
|
|
6563
6570
|
}
|
|
6564
|
-
class
|
|
6571
|
+
class bi {
|
|
6565
6572
|
overlay;
|
|
6566
6573
|
hLine;
|
|
6567
6574
|
vLine;
|
|
@@ -6615,7 +6622,7 @@ const st = [
|
|
|
6615
6622
|
{ action: "linkElement2d3d", label: "模型联动", dividerBefore: !0 },
|
|
6616
6623
|
{ action: "linkView2d3d", label: "视角关联" }
|
|
6617
6624
|
];
|
|
6618
|
-
class
|
|
6625
|
+
class xi {
|
|
6619
6626
|
menu;
|
|
6620
6627
|
container;
|
|
6621
6628
|
canvas;
|
|
@@ -6688,7 +6695,7 @@ class wi {
|
|
|
6688
6695
|
this.canvas.removeEventListener("contextmenu", this.onContextMenu), document.removeEventListener("mousedown", this.onDocMouseDown), document.removeEventListener("keydown", this.onEscape), this.menu.parentElement?.removeChild(this.menu);
|
|
6689
6696
|
}
|
|
6690
6697
|
}
|
|
6691
|
-
class
|
|
6698
|
+
class Mi {
|
|
6692
6699
|
overlay = null;
|
|
6693
6700
|
textEl = null;
|
|
6694
6701
|
barEl = null;
|
|
@@ -6823,14 +6830,14 @@ class bi {
|
|
|
6823
6830
|
this.overlay?.remove(), this.overlay = null, this.textEl = null, this.barEl = null, this.pctEl = null;
|
|
6824
6831
|
}
|
|
6825
6832
|
}
|
|
6826
|
-
const
|
|
6833
|
+
const ki = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6827
6834
|
<circle cx="6.5" cy="6.5" r="4.5" stroke="currentColor" stroke-width="1.5"/>
|
|
6828
6835
|
<line x1="10" y1="10" x2="14" y2="14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
6829
|
-
</svg>`,
|
|
6836
|
+
</svg>`, _i = `<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6830
6837
|
<line x1="1" y1="1" x2="11" y2="11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
6831
6838
|
<line x1="11" y1="1" x2="1" y2="11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
6832
6839
|
</svg>`;
|
|
6833
|
-
class
|
|
6840
|
+
class Ei {
|
|
6834
6841
|
manager;
|
|
6835
6842
|
wrapper;
|
|
6836
6843
|
input;
|
|
@@ -6849,7 +6856,7 @@ class ki {
|
|
|
6849
6856
|
return e.className = "engine-2d-search", e.innerHTML = `
|
|
6850
6857
|
<div class="engine-2d-search__box">
|
|
6851
6858
|
<div class="engine-2d-search__input-row">
|
|
6852
|
-
<span class="engine-2d-search__icon">${
|
|
6859
|
+
<span class="engine-2d-search__icon">${ki}</span>
|
|
6853
6860
|
<input
|
|
6854
6861
|
class="engine-2d-search__input"
|
|
6855
6862
|
type="text"
|
|
@@ -6857,7 +6864,7 @@ class ki {
|
|
|
6857
6864
|
autocomplete="off"
|
|
6858
6865
|
spellcheck="false"
|
|
6859
6866
|
/>
|
|
6860
|
-
<button class="engine-2d-search__clear" title="清除">${
|
|
6867
|
+
<button class="engine-2d-search__clear" title="清除">${_i}</button>
|
|
6861
6868
|
</div>
|
|
6862
6869
|
<div class="engine-2d-search__divider"></div>
|
|
6863
6870
|
<div class="engine-2d-search__status"></div>
|
|
@@ -6963,13 +6970,13 @@ class ki {
|
|
|
6963
6970
|
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);
|
|
6964
6971
|
}
|
|
6965
6972
|
}
|
|
6966
|
-
class
|
|
6973
|
+
class Ci {
|
|
6967
6974
|
engine;
|
|
6968
6975
|
searchUI = null;
|
|
6969
6976
|
constructor(e) {
|
|
6970
6977
|
this.engine = e;
|
|
6971
6978
|
const t = document.getElementById(e?.options?.containerId ?? "") ?? e?.container ?? null;
|
|
6972
|
-
t && (this.searchUI = new
|
|
6979
|
+
t && (this.searchUI = new Ei(t, this));
|
|
6973
6980
|
}
|
|
6974
6981
|
/** 只查询已加载的文字实体,支持连续包含和按字符顺序的模糊匹配。 */
|
|
6975
6982
|
search(e) {
|
|
@@ -7146,7 +7153,7 @@ const rt = {
|
|
|
7146
7153
|
"--e2d-coord-label": "rgba(0,0,0,0.50)"
|
|
7147
7154
|
}
|
|
7148
7155
|
};
|
|
7149
|
-
class
|
|
7156
|
+
class Si {
|
|
7150
7157
|
container;
|
|
7151
7158
|
current;
|
|
7152
7159
|
constructor(e, t = "dark") {
|
|
@@ -7214,7 +7221,7 @@ class Ye {
|
|
|
7214
7221
|
this.clearAllPoints();
|
|
7215
7222
|
}
|
|
7216
7223
|
}
|
|
7217
|
-
class
|
|
7224
|
+
class Ti extends Ye {
|
|
7218
7225
|
/** 两点完成一条距离测量。 */
|
|
7219
7226
|
handleClick(e) {
|
|
7220
7227
|
super.handleClick(e), this.points.length === 2 && (this.manager.addMeasurement("distance", this.points), this.clearAllPoints());
|
|
@@ -7223,7 +7230,7 @@ class Ci extends Ye {
|
|
|
7223
7230
|
this.points.length === 1 && this.manager.drawPreview("distance", [this.points[0], e]);
|
|
7224
7231
|
}
|
|
7225
7232
|
}
|
|
7226
|
-
class
|
|
7233
|
+
class Ai extends Ye {
|
|
7227
7234
|
/** 三点及以上可以闭合面积,双击或 Enter 结束。 */
|
|
7228
7235
|
handleClick(e) {
|
|
7229
7236
|
super.handleClick(e), this.manager.drawPreview("area", this.points);
|
|
@@ -7236,7 +7243,7 @@ class Si extends Ye {
|
|
|
7236
7243
|
e.length >= 3 && this.manager.addMeasurement("area", e), this.clearAllPoints();
|
|
7237
7244
|
}
|
|
7238
7245
|
}
|
|
7239
|
-
class
|
|
7246
|
+
class Ii extends Ye {
|
|
7240
7247
|
/** 三点完成角度测量,第二个点作为角点。 */
|
|
7241
7248
|
handleClick(e) {
|
|
7242
7249
|
super.handleClick(e), this.points.length === 3 && (this.manager.addMeasurement("angle", this.points), this.clearAllPoints());
|
|
@@ -7245,7 +7252,7 @@ class Ti extends Ye {
|
|
|
7245
7252
|
this.points.length >= 2 && this.manager.drawPreview("angle", [...this.points, e]);
|
|
7246
7253
|
}
|
|
7247
7254
|
}
|
|
7248
|
-
class
|
|
7255
|
+
class Li {
|
|
7249
7256
|
distanceMeasure;
|
|
7250
7257
|
areaMeasure;
|
|
7251
7258
|
angleMeasure;
|
|
@@ -7265,7 +7272,7 @@ class Ai {
|
|
|
7265
7272
|
hasDraggedAfterMouseDown = !1;
|
|
7266
7273
|
currentWorkspaceKey = "model";
|
|
7267
7274
|
constructor(e) {
|
|
7268
|
-
this.engine = e, this.container = e.container, this.distanceMeasure = new
|
|
7275
|
+
this.engine = e, this.container = e.container, this.distanceMeasure = new Ti(this), this.areaMeasure = new Ai(this), this.angleMeasure = new Ii(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);
|
|
7269
7276
|
}
|
|
7270
7277
|
/** 开启 2D 测量事件;只停用图元点选,不停用 pan/zoom 视图控制。 */
|
|
7271
7278
|
active() {
|
|
@@ -7524,7 +7531,7 @@ const He = {
|
|
|
7524
7531
|
strokeWidth: 2,
|
|
7525
7532
|
fontSize: 16,
|
|
7526
7533
|
cloudRadius: 10
|
|
7527
|
-
},
|
|
7534
|
+
}, Pi = {
|
|
7528
7535
|
none: _e("/assets/icon/选择.svg", import.meta.url),
|
|
7529
7536
|
line: _e("/assets/icon/线.svg", import.meta.url),
|
|
7530
7537
|
arrow: _e("/assets/icon/箭头.svg", import.meta.url),
|
|
@@ -7533,8 +7540,8 @@ const He = {
|
|
|
7533
7540
|
polygon: _e("/assets/icon/面积.svg", import.meta.url),
|
|
7534
7541
|
text: _e("/assets/icon/文字.svg", import.meta.url),
|
|
7535
7542
|
cloudline: _e("/assets/icon/云线.svg", import.meta.url)
|
|
7536
|
-
},
|
|
7537
|
-
class
|
|
7543
|
+
}, Di = "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>'), zi = "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>');
|
|
7544
|
+
class Ri {
|
|
7538
7545
|
engine;
|
|
7539
7546
|
container;
|
|
7540
7547
|
layer;
|
|
@@ -7714,7 +7721,7 @@ class Di {
|
|
|
7714
7721
|
{ type: "cloudline", title: "云线,双击或 Enter 结束" },
|
|
7715
7722
|
{ type: "text", title: "文字" }
|
|
7716
7723
|
].forEach((a) => {
|
|
7717
|
-
const h = this.createIconButton(a.title,
|
|
7724
|
+
const h = this.createIconButton(a.title, Pi[a.type]);
|
|
7718
7725
|
h.onclick = () => {
|
|
7719
7726
|
this.active(), this.setDrawType(a.type);
|
|
7720
7727
|
}, a.type !== "none" && (this.buttons[a.type] = h), e.appendChild(h);
|
|
@@ -7731,9 +7738,9 @@ class Di {
|
|
|
7731
7738
|
s.type = "number", s.min = "10", s.max = "72", s.value = `${this.style.fontSize}`, s.title = "字号", s.onchange = () => {
|
|
7732
7739
|
this.style.fontSize = this.normalizeNumber(s.valueAsNumber, 10, 72, He.fontSize);
|
|
7733
7740
|
}, e.appendChild(s), e.appendChild(this.createDivider());
|
|
7734
|
-
const r = this.createIconButton("清空",
|
|
7741
|
+
const r = this.createIconButton("清空", Di);
|
|
7735
7742
|
r.onclick = () => this.clearAll(), e.appendChild(r);
|
|
7736
|
-
const o = this.createIconButton("关闭",
|
|
7743
|
+
const o = this.createIconButton("关闭", zi);
|
|
7737
7744
|
return o.onclick = () => {
|
|
7738
7745
|
this.hideToolbar(), this.disActive();
|
|
7739
7746
|
}, e.appendChild(o), e;
|
|
@@ -7934,11 +7941,11 @@ class Di {
|
|
|
7934
7941
|
return `markup-2d-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
7935
7942
|
}
|
|
7936
7943
|
}
|
|
7937
|
-
class
|
|
7944
|
+
class Bi {
|
|
7938
7945
|
engine;
|
|
7939
7946
|
manager;
|
|
7940
7947
|
constructor(e) {
|
|
7941
|
-
this.engine = e, this.manager = new
|
|
7948
|
+
this.engine = e, this.manager = new Ot({
|
|
7942
7949
|
container: e.container,
|
|
7943
7950
|
className: "bim-engine-label-container bim-engine-label-container-2d",
|
|
7944
7951
|
projectCoordinate: (t) => this.projectCoordinate(t),
|
|
@@ -8001,7 +8008,7 @@ class zi {
|
|
|
8001
8008
|
return { x: i.x, y: i.y, z: 0 };
|
|
8002
8009
|
}
|
|
8003
8010
|
}
|
|
8004
|
-
class
|
|
8011
|
+
class Ni {
|
|
8005
8012
|
engine;
|
|
8006
8013
|
mainViewPort = null;
|
|
8007
8014
|
constructor(e) {
|
|
@@ -8037,7 +8044,7 @@ class Ri {
|
|
|
8037
8044
|
};
|
|
8038
8045
|
}
|
|
8039
8046
|
}
|
|
8040
|
-
class
|
|
8047
|
+
class Oi {
|
|
8041
8048
|
constructor(e, t) {
|
|
8042
8049
|
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()) ?? (() => {
|
|
8043
8050
|
}), this.refresh();
|
|
@@ -8076,7 +8083,7 @@ class Bi {
|
|
|
8076
8083
|
this.unsubscribe(), this.el.remove();
|
|
8077
8084
|
}
|
|
8078
8085
|
}
|
|
8079
|
-
class
|
|
8086
|
+
class Wi {
|
|
8080
8087
|
// 配置选项
|
|
8081
8088
|
options;
|
|
8082
8089
|
container = null;
|
|
@@ -8121,7 +8128,7 @@ class Ni {
|
|
|
8121
8128
|
renderer = null;
|
|
8122
8129
|
// 数据
|
|
8123
8130
|
dwgData = null;
|
|
8124
|
-
version =
|
|
8131
|
+
version = ni;
|
|
8125
8132
|
constructor(e) {
|
|
8126
8133
|
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 ?? {
|
|
8127
8134
|
items: [
|
|
@@ -8135,13 +8142,13 @@ class Ni {
|
|
|
8135
8142
|
]
|
|
8136
8143
|
}, this.enablePerformanceMonitoring = e.enablePerformanceMonitoring ?? !1, this.container = document.getElementById(e.containerId), !this.container)
|
|
8137
8144
|
throw new Error(`Container ${e.containerId} not found`);
|
|
8138
|
-
this.initialize(), this.handelBehaved2d =
|
|
8145
|
+
this.initialize(), this.handelBehaved2d = yi(this), this.interactionModule2d = new wi(this), this.interactionModule2d.init(), this.interactionModule2d.active();
|
|
8139
8146
|
}
|
|
8140
8147
|
/**
|
|
8141
8148
|
* 初始化引擎
|
|
8142
8149
|
*/
|
|
8143
8150
|
initialize() {
|
|
8144
|
-
this.events = new
|
|
8151
|
+
this.events = new Yt(!1), this.sceneModule2d = new ai(this, this.options), this.scene = this.sceneModule2d.scene, this.cameraModule2d = new hi(this, this.container), this.camera = this.cameraModule2d.orthographicCamera, this.renderModule2d = new ci(this, this.container, this.options), this.renderer = this.renderModule2d.renderer, this.controlModule2d = new ui(this), this.loaderModule2d = new ei(this), this.themeManager = new Si(this.container), this.layerManager = new ct(this), this.searchManager = new Ci(this), this.measure = new Li(this), this.markup = new Ri(this), this.label = new Bi(this), this.viewCube = new Ni(this), this.octreeBox2d = new pi(this), this.modelToolModule2d = new gi(this), this.engineStatus2d = new li(this), this.linkView2d3d = new fi(this), this.linkElement2d3d = new mi(this), this.sceneModule2d.initGrid(), this.cadCursorUI = new bi(this.container, this.renderer.domElement, this.options.cursorStyle ?? "short-crosshair"), this.cadCursorUI.setBackgroundColor(this.options.backgroundColor ?? 1710618), this.loadingUI = new Mi(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 Oi(this.container, this), this.contextMenuUI = new xi(
|
|
8145
8152
|
this.container,
|
|
8146
8153
|
this.renderer.domElement,
|
|
8147
8154
|
(e) => {
|
|
@@ -8180,11 +8187,11 @@ class Ni {
|
|
|
8180
8187
|
* 动画循环
|
|
8181
8188
|
*/
|
|
8182
8189
|
animate = () => {
|
|
8183
|
-
this.isRendering && (this.animationId = requestAnimationFrame(this.animate), this.stats?.begin(), this.controlModule2d.update(), this.camera?.updateMatrixWorld(!0), this.measure?.update(), this.markup?.update(), this.label?.update(), this.scene && this.camera && this.renderer && this.renderer.render(this.scene, this.camera), this.enablePerformanceMonitoring && this.updatePerformanceStats(), this.stats?.end());
|
|
8190
|
+
this.isRendering && (this.animationId = requestAnimationFrame(this.animate), this.stats?.begin(), this.controlModule2d.update(), this.camera?.updateMatrixWorld(!0), this.measure?.update(), this.markup?.update(), this.label?.update(), this.scene && this.camera && this.renderer && (this.renderer.render(this.scene, this.camera), this.renderModule2d?.drawWatermark()), this.enablePerformanceMonitoring && this.updatePerformanceStats(), this.stats?.end());
|
|
8184
8191
|
};
|
|
8185
8192
|
/** 初始化 stats.js 性能监视器,showStats 优先控制可视面板,旧配置 enablePerformanceMonitoring 继续兼容。 */
|
|
8186
8193
|
initStatsMonitor() {
|
|
8187
|
-
!(this.options.showStats ?? this.enablePerformanceMonitoring) || !this.container || (this.stats = new
|
|
8194
|
+
!(this.options.showStats ?? this.enablePerformanceMonitoring) || !this.container || (this.stats = new Zt(), 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));
|
|
8188
8195
|
}
|
|
8189
8196
|
/**
|
|
8190
8197
|
* 更新性能统计
|
|
@@ -8209,7 +8216,7 @@ class Ni {
|
|
|
8209
8216
|
* 通过 viewToken 向 OpenAPI 解析真实加载地址,再复用现有 2D URL 加载逻辑。
|
|
8210
8217
|
*/
|
|
8211
8218
|
async loadModelByViewToken(e, t) {
|
|
8212
|
-
const i = await
|
|
8219
|
+
const i = await Wt(
|
|
8213
8220
|
this.options,
|
|
8214
8221
|
e,
|
|
8215
8222
|
"2d"
|
|
@@ -8369,9 +8376,9 @@ class Ni {
|
|
|
8369
8376
|
return console.error("[EngineKernel2d] Renderer or scene module not initialized"), null;
|
|
8370
8377
|
const t = this.renderer.domElement, i = e?.format || "png", n = e?.quality || 0.92, s = `image/${i === "jpeg" ? "jpeg" : i}`, r = e?.transparent ?? !1, o = e?.hideGrid ?? !0, a = e?.hideAxes ?? !0, h = this.scene?.background ?? null;
|
|
8371
8378
|
let u = !1, g = !1;
|
|
8372
|
-
this.sceneModule2d.adaptiveGrid && (u = this.sceneModule2d.adaptiveGrid.gridGroup?.visible ?? !1, o && this.sceneModule2d.adaptiveGrid.setVisible(!1)), this.sceneModule2d.axesHelper && (g = this.sceneModule2d.axesHelper.visible ?? !1, a && this.sceneModule2d.setAxesVisible(!1)), r && this.scene && (this.scene.background = null), this.scene && this.camera && this.renderer.render(this.scene, this.camera);
|
|
8379
|
+
this.sceneModule2d.adaptiveGrid && (u = this.sceneModule2d.adaptiveGrid.gridGroup?.visible ?? !1, o && this.sceneModule2d.adaptiveGrid.setVisible(!1)), this.sceneModule2d.axesHelper && (g = this.sceneModule2d.axesHelper.visible ?? !1, a && this.sceneModule2d.setAxesVisible(!1)), r && this.scene && (this.scene.background = null), this.scene && this.camera && (this.renderer.render(this.scene, this.camera), this.renderModule2d?.drawWatermark());
|
|
8373
8380
|
const v = t.toDataURL(s, n);
|
|
8374
|
-
this.scene && (this.scene.background = h), this.sceneModule2d.adaptiveGrid && o && this.sceneModule2d.adaptiveGrid.setVisible(u), this.sceneModule2d.axesHelper && a && this.sceneModule2d.setAxesVisible(g), this.scene && this.camera && this.renderer.render(this.scene, this.camera);
|
|
8381
|
+
this.scene && (this.scene.background = h), this.sceneModule2d.adaptiveGrid && o && this.sceneModule2d.adaptiveGrid.setVisible(u), this.sceneModule2d.axesHelper && a && this.sceneModule2d.setAxesVisible(g), this.scene && this.camera && (this.renderer.render(this.scene, this.camera), this.renderModule2d?.drawWatermark());
|
|
8375
8382
|
const d = {
|
|
8376
8383
|
dataURL: v
|
|
8377
8384
|
};
|
|
@@ -8392,13 +8399,13 @@ class Ni {
|
|
|
8392
8399
|
return console.error("[EngineKernel2d] Renderer or scene module not initialized"), null;
|
|
8393
8400
|
const t = this.renderer.domElement, i = e?.format || "png", n = e?.quality || 0.92, s = `image/${i === "jpeg" ? "jpeg" : i}`, r = e?.transparent ?? !1, o = e?.hideGrid ?? !0, a = e?.hideAxes ?? !0, h = this.scene?.background ?? null;
|
|
8394
8401
|
let u = !1, g = !1;
|
|
8395
|
-
this.sceneModule2d.adaptiveGrid && (u = this.sceneModule2d.adaptiveGrid.gridGroup?.visible ?? !1, o && this.sceneModule2d.adaptiveGrid.setVisible(!1)), this.sceneModule2d.axesHelper && (g = this.sceneModule2d.axesHelper.visible ?? !1, a && this.sceneModule2d.setAxesVisible(!1)), r && this.scene && (this.scene.background = null), this.scene && this.camera && this.renderer.render(this.scene, this.camera);
|
|
8402
|
+
this.sceneModule2d.adaptiveGrid && (u = this.sceneModule2d.adaptiveGrid.gridGroup?.visible ?? !1, o && this.sceneModule2d.adaptiveGrid.setVisible(!1)), this.sceneModule2d.axesHelper && (g = this.sceneModule2d.axesHelper.visible ?? !1, a && this.sceneModule2d.setAxesVisible(!1)), r && this.scene && (this.scene.background = null), this.scene && this.camera && (this.renderer.render(this.scene, this.camera), this.renderModule2d?.drawWatermark());
|
|
8396
8403
|
const v = t.toDataURL(s, n), d = await new Promise((l) => {
|
|
8397
8404
|
t.toBlob((f) => {
|
|
8398
8405
|
f && l(f);
|
|
8399
8406
|
}, s, n);
|
|
8400
8407
|
}), y = URL.createObjectURL(d);
|
|
8401
|
-
if (this.scene && (this.scene.background = h), this.sceneModule2d.adaptiveGrid && o && this.sceneModule2d.adaptiveGrid.setVisible(u), this.sceneModule2d.axesHelper && a && this.sceneModule2d.setAxesVisible(g), this.scene && this.camera && this.renderer.render(this.scene, this.camera), e?.download) {
|
|
8408
|
+
if (this.scene && (this.scene.background = h), this.sceneModule2d.adaptiveGrid && o && this.sceneModule2d.adaptiveGrid.setVisible(u), this.sceneModule2d.axesHelper && a && this.sceneModule2d.setAxesVisible(g), this.scene && this.camera && (this.renderer.render(this.scene, this.camera), this.renderModule2d?.drawWatermark()), e?.download) {
|
|
8402
8409
|
const l = e.filename || `capture-${Date.now()}.${i}`, f = document.createElement("a");
|
|
8403
8410
|
f.href = y, f.download = l, f.style.display = "none", document.body.appendChild(f), f.click(), f.remove(), console.log(`[EngineKernel2d] Image captured and downloaded: ${l}`);
|
|
8404
8411
|
} else
|
|
@@ -8416,16 +8423,16 @@ class Ni {
|
|
|
8416
8423
|
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");
|
|
8417
8424
|
}
|
|
8418
8425
|
}
|
|
8419
|
-
const
|
|
8426
|
+
const Vi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8420
8427
|
__proto__: null,
|
|
8421
|
-
EngineKernel2d:
|
|
8428
|
+
EngineKernel2d: Wi
|
|
8422
8429
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8423
8430
|
export {
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8431
|
+
ni as E,
|
|
8432
|
+
Ft as J,
|
|
8433
|
+
ei as L,
|
|
8434
|
+
Zt as S,
|
|
8435
|
+
Vi as a,
|
|
8429
8436
|
Oe as c,
|
|
8430
8437
|
ht as g
|
|
8431
8438
|
};
|