@billtaofbj/cad 1.0.0 → 1.2.0
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/cad.css +1 -1
- package/dist/index.cjs.js +22 -22
- package/dist/index.es.js +1233 -1047
- package/package.json +32 -26
package/dist/index.es.js
CHANGED
|
@@ -3,16 +3,16 @@ import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i
|
|
|
3
3
|
import { BrandWatermark as N } from "@billtaofbj/core";
|
|
4
4
|
import { useRoute as ee, useRouter as te } from "vue-router";
|
|
5
5
|
import { ElMessage as P } from "element-plus";
|
|
6
|
-
import { ArrowLeft as ne, ArrowRight as
|
|
7
|
-
import
|
|
8
|
-
import * as
|
|
9
|
-
import { HocuspocusProvider as
|
|
6
|
+
import { ArrowLeft as ne, ArrowRight as F, Bell as re, Clock as I, Close as ie, Delete as ae, Download as oe, Loading as se, Monitor as ce, Promotion as le, VideoPause as ue } from "@element-plus/icons-vue";
|
|
7
|
+
import de from "axios";
|
|
8
|
+
import * as fe from "yjs";
|
|
9
|
+
import { HocuspocusProvider as L } from "@hocuspocus/provider";
|
|
10
10
|
//#region \0plugin-vue:export-helper
|
|
11
|
-
var
|
|
11
|
+
var R = (e, t) => {
|
|
12
12
|
let n = e.__vccOpts || e;
|
|
13
13
|
for (let [e, r] of t) n[e] = r;
|
|
14
14
|
return n;
|
|
15
|
-
},
|
|
15
|
+
}, pe = { class: "cad-toolbar" }, me = { class: "toolbar-left" }, he = { class: "toolbar-center" }, z = { class: "toolbar-right" }, ge = /*#__PURE__*/ R({
|
|
16
16
|
__name: "CadToolbar",
|
|
17
17
|
props: {
|
|
18
18
|
title: String,
|
|
@@ -20,7 +20,15 @@ var L = (e, t) => {
|
|
|
20
20
|
activeTool: String,
|
|
21
21
|
vrSupported: Boolean,
|
|
22
22
|
arSupported: Boolean,
|
|
23
|
-
showHistory: Boolean
|
|
23
|
+
showHistory: Boolean,
|
|
24
|
+
backButton: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "show"
|
|
27
|
+
},
|
|
28
|
+
titleEditable: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !0
|
|
31
|
+
}
|
|
24
32
|
},
|
|
25
33
|
emits: [
|
|
26
34
|
"back",
|
|
@@ -45,77 +53,83 @@ var L = (e, t) => {
|
|
|
45
53
|
"enter-ar"
|
|
46
54
|
],
|
|
47
55
|
setup(e, { emit: t }) {
|
|
48
|
-
let
|
|
49
|
-
|
|
56
|
+
let s = e, u = n(() => ({
|
|
57
|
+
backButton: s.backButton,
|
|
58
|
+
titleEditable: s.titleEditable
|
|
59
|
+
})), d = t, f = (e) => {
|
|
60
|
+
d({
|
|
50
61
|
step: "export-step",
|
|
51
62
|
stl: "export-stl",
|
|
52
63
|
gltf: "export-glTF"
|
|
53
64
|
}[e]);
|
|
54
65
|
};
|
|
55
66
|
return (t, n) => {
|
|
56
|
-
let
|
|
57
|
-
return _(), a("div",
|
|
58
|
-
o("div",
|
|
67
|
+
let s = S("ArrowLeft"), d = S("el-icon"), p = S("el-button"), m = S("el-input"), h = S("Pointer"), g = S("Rank"), v = S("RefreshRight"), y = S("FullScreen"), b = S("el-button-group"), x = S("el-divider"), C = S("Edit"), w = S("Top"), T = S("Connection"), E = S("ArrowDown"), D = S("el-dropdown-item"), O = S("el-dropdown-menu"), A = S("el-dropdown"), j = S("RefreshLeft"), M = S("Grid"), N = S("Aim"), ee = S("View"), te = S("Camera"), P = S("Download"), ne = S("Check"), F = S("Clock");
|
|
68
|
+
return _(), a("div", pe, [
|
|
69
|
+
o("div", me, [u.value.backButton === "hide" ? i("", !0) : (_(), r(p, {
|
|
70
|
+
key: 0,
|
|
59
71
|
size: "small",
|
|
72
|
+
disabled: u.value.backButton === "disabled",
|
|
60
73
|
onClick: n[0] ||= (e) => t.$emit("back")
|
|
61
74
|
}, {
|
|
62
75
|
default: k(() => [l(d, null, {
|
|
63
|
-
default: k(() => [l(
|
|
76
|
+
default: k(() => [l(s)]),
|
|
64
77
|
_: 1
|
|
65
78
|
})]),
|
|
66
79
|
_: 1
|
|
67
|
-
}), l(
|
|
80
|
+
}, 8, ["disabled"])), l(m, {
|
|
68
81
|
"model-value": e.title,
|
|
69
82
|
size: "small",
|
|
70
83
|
style: {
|
|
71
84
|
width: "200px",
|
|
72
85
|
"margin-left": "8px"
|
|
73
86
|
},
|
|
87
|
+
disabled: !u.value.titleEditable,
|
|
74
88
|
onInput: n[1] ||= (e) => t.$emit("update:title", e)
|
|
75
|
-
}, null, 8, ["model-value"])]),
|
|
76
|
-
o("div",
|
|
77
|
-
l(
|
|
89
|
+
}, null, 8, ["model-value", "disabled"])]),
|
|
90
|
+
o("div", he, [
|
|
91
|
+
l(b, null, {
|
|
78
92
|
default: k(() => [
|
|
79
|
-
l(
|
|
93
|
+
l(p, {
|
|
80
94
|
size: "small",
|
|
81
95
|
type: e.activeTool === "select" ? "primary" : "",
|
|
82
96
|
onClick: n[2] ||= (e) => t.$emit("tool-change", "select")
|
|
83
97
|
}, {
|
|
84
98
|
default: k(() => [l(d, null, {
|
|
85
|
-
default: k(() => [l(
|
|
99
|
+
default: k(() => [l(h)]),
|
|
86
100
|
_: 1
|
|
87
101
|
}), n[19] ||= c(" 选择 ", -1)]),
|
|
88
102
|
_: 1
|
|
89
103
|
}, 8, ["type"]),
|
|
90
|
-
l(
|
|
104
|
+
l(p, {
|
|
91
105
|
size: "small",
|
|
92
106
|
type: e.activeTool === "move" ? "primary" : "",
|
|
93
107
|
onClick: n[3] ||= (e) => t.$emit("tool-change", "move")
|
|
94
108
|
}, {
|
|
95
109
|
default: k(() => [l(d, null, {
|
|
96
|
-
default: k(() => [l(
|
|
110
|
+
default: k(() => [l(g)]),
|
|
97
111
|
_: 1
|
|
98
112
|
}), n[20] ||= c(" 移动 ", -1)]),
|
|
99
113
|
_: 1
|
|
100
114
|
}, 8, ["type"]),
|
|
101
|
-
l(
|
|
115
|
+
l(p, {
|
|
102
116
|
size: "small",
|
|
103
117
|
type: e.activeTool === "rotate" ? "primary" : "",
|
|
104
118
|
onClick: n[4] ||= (e) => t.$emit("tool-change", "rotate")
|
|
105
119
|
}, {
|
|
106
120
|
default: k(() => [l(d, null, {
|
|
107
|
-
default: k(() => [l(
|
|
121
|
+
default: k(() => [l(v)]),
|
|
108
122
|
_: 1
|
|
109
123
|
}), n[21] ||= c(" 旋转 ", -1)]),
|
|
110
124
|
_: 1
|
|
111
125
|
}, 8, ["type"]),
|
|
112
|
-
l(
|
|
126
|
+
l(p, {
|
|
113
127
|
size: "small",
|
|
114
128
|
type: e.activeTool === "scale" ? "primary" : "",
|
|
115
129
|
onClick: n[5] ||= (e) => t.$emit("tool-change", "scale")
|
|
116
130
|
}, {
|
|
117
131
|
default: k(() => [l(d, null, {
|
|
118
|
-
default: k(() => [l(
|
|
132
|
+
default: k(() => [l(y)]),
|
|
119
133
|
_: 1
|
|
120
134
|
}), n[22] ||= c(" 缩放 ", -1)]),
|
|
121
135
|
_: 1
|
|
@@ -123,69 +137,69 @@ var L = (e, t) => {
|
|
|
123
137
|
]),
|
|
124
138
|
_: 1
|
|
125
139
|
}),
|
|
126
|
-
l(
|
|
127
|
-
l(
|
|
140
|
+
l(x, { direction: "vertical" }),
|
|
141
|
+
l(p, {
|
|
128
142
|
size: "small",
|
|
129
143
|
type: "warning",
|
|
130
144
|
onClick: n[6] ||= (e) => t.$emit("start-sketch")
|
|
131
145
|
}, {
|
|
132
146
|
default: k(() => [l(d, null, {
|
|
133
|
-
default: k(() => [l(
|
|
147
|
+
default: k(() => [l(C)]),
|
|
134
148
|
_: 1
|
|
135
149
|
}), n[23] ||= c(" 草图 ", -1)]),
|
|
136
150
|
_: 1
|
|
137
151
|
}),
|
|
138
|
-
l(
|
|
152
|
+
l(p, {
|
|
139
153
|
size: "small",
|
|
140
154
|
onClick: n[7] ||= (e) => t.$emit("extrude")
|
|
141
155
|
}, {
|
|
142
156
|
default: k(() => [l(d, null, {
|
|
143
|
-
default: k(() => [l(
|
|
157
|
+
default: k(() => [l(w)]),
|
|
144
158
|
_: 1
|
|
145
159
|
}), n[24] ||= c(" 拉伸 ", -1)]),
|
|
146
160
|
_: 1
|
|
147
161
|
}),
|
|
148
|
-
l(
|
|
162
|
+
l(p, {
|
|
149
163
|
size: "small",
|
|
150
164
|
onClick: n[8] ||= (e) => t.$emit("revolve")
|
|
151
165
|
}, {
|
|
152
166
|
default: k(() => [l(d, null, {
|
|
153
|
-
default: k(() => [l(
|
|
167
|
+
default: k(() => [l(v)]),
|
|
154
168
|
_: 1
|
|
155
169
|
}), n[25] ||= c(" 旋转 ", -1)]),
|
|
156
170
|
_: 1
|
|
157
171
|
}),
|
|
158
|
-
l(
|
|
159
|
-
l(
|
|
172
|
+
l(x, { direction: "vertical" }),
|
|
173
|
+
l(A, {
|
|
160
174
|
trigger: "click",
|
|
161
175
|
onCommand: n[9] ||= (e) => t.$emit("boolean-operation", e)
|
|
162
176
|
}, {
|
|
163
|
-
dropdown: k(() => [l(
|
|
177
|
+
dropdown: k(() => [l(O, null, {
|
|
164
178
|
default: k(() => [
|
|
165
|
-
l(
|
|
179
|
+
l(D, { command: "union" }, {
|
|
166
180
|
default: k(() => [...n[27] ||= [o("span", { class: "bool-icon" }, "∪", -1), c(" 并集 ", -1)]]),
|
|
167
181
|
_: 1
|
|
168
182
|
}),
|
|
169
|
-
l(
|
|
183
|
+
l(D, { command: "subtract" }, {
|
|
170
184
|
default: k(() => [...n[28] ||= [o("span", { class: "bool-icon" }, "−", -1), c(" 差集 ", -1)]]),
|
|
171
185
|
_: 1
|
|
172
186
|
}),
|
|
173
|
-
l(
|
|
187
|
+
l(D, { command: "intersect" }, {
|
|
174
188
|
default: k(() => [...n[29] ||= [o("span", { class: "bool-icon" }, "∩", -1), c(" 交集 ", -1)]]),
|
|
175
189
|
_: 1
|
|
176
190
|
})
|
|
177
191
|
]),
|
|
178
192
|
_: 1
|
|
179
193
|
})]),
|
|
180
|
-
default: k(() => [l(
|
|
194
|
+
default: k(() => [l(p, { size: "small" }, {
|
|
181
195
|
default: k(() => [
|
|
182
196
|
l(d, null, {
|
|
183
|
-
default: k(() => [l(
|
|
197
|
+
default: k(() => [l(T)]),
|
|
184
198
|
_: 1
|
|
185
199
|
}),
|
|
186
200
|
n[26] ||= c(" 布尔运算 ", -1),
|
|
187
201
|
l(d, { class: "el-icon--right" }, {
|
|
188
|
-
default: k(() => [l(
|
|
202
|
+
default: k(() => [l(E)]),
|
|
189
203
|
_: 1
|
|
190
204
|
})
|
|
191
205
|
]),
|
|
@@ -193,117 +207,117 @@ var L = (e, t) => {
|
|
|
193
207
|
})]),
|
|
194
208
|
_: 1
|
|
195
209
|
}),
|
|
196
|
-
l(
|
|
197
|
-
l(
|
|
210
|
+
l(x, { direction: "vertical" }),
|
|
211
|
+
l(p, {
|
|
198
212
|
size: "small",
|
|
199
213
|
onClick: n[10] ||= (e) => t.$emit("undo"),
|
|
200
214
|
disabled: !0
|
|
201
215
|
}, {
|
|
202
216
|
default: k(() => [l(d, null, {
|
|
203
|
-
default: k(() => [l(
|
|
217
|
+
default: k(() => [l(j)]),
|
|
204
218
|
_: 1
|
|
205
219
|
}), n[30] ||= c(" 撤销 ", -1)]),
|
|
206
220
|
_: 1
|
|
207
221
|
}),
|
|
208
|
-
l(
|
|
222
|
+
l(p, {
|
|
209
223
|
size: "small",
|
|
210
224
|
onClick: n[11] ||= (e) => t.$emit("redo"),
|
|
211
225
|
disabled: !0
|
|
212
226
|
}, {
|
|
213
227
|
default: k(() => [l(d, null, {
|
|
214
|
-
default: k(() => [l(
|
|
228
|
+
default: k(() => [l(v)]),
|
|
215
229
|
_: 1
|
|
216
230
|
}), n[31] ||= c(" 重做 ", -1)]),
|
|
217
231
|
_: 1
|
|
218
232
|
}),
|
|
219
|
-
l(
|
|
220
|
-
l(
|
|
233
|
+
l(x, { direction: "vertical" }),
|
|
234
|
+
l(p, {
|
|
221
235
|
size: "small",
|
|
222
236
|
onClick: n[12] ||= (e) => t.$emit("toggle-grid")
|
|
223
237
|
}, {
|
|
224
238
|
default: k(() => [l(d, null, {
|
|
225
|
-
default: k(() => [l(
|
|
239
|
+
default: k(() => [l(M)]),
|
|
226
240
|
_: 1
|
|
227
241
|
})]),
|
|
228
242
|
_: 1
|
|
229
243
|
}),
|
|
230
|
-
l(
|
|
244
|
+
l(p, {
|
|
231
245
|
size: "small",
|
|
232
246
|
onClick: n[13] ||= (e) => t.$emit("toggle-axes")
|
|
233
247
|
}, {
|
|
234
248
|
default: k(() => [l(d, null, {
|
|
235
|
-
default: k(() => [l(
|
|
249
|
+
default: k(() => [l(N)]),
|
|
236
250
|
_: 1
|
|
237
251
|
})]),
|
|
238
252
|
_: 1
|
|
239
253
|
}),
|
|
240
|
-
l(
|
|
254
|
+
l(p, {
|
|
241
255
|
size: "small",
|
|
242
256
|
onClick: n[14] ||= (e) => t.$emit("fit-view")
|
|
243
257
|
}, {
|
|
244
258
|
default: k(() => [l(d, null, {
|
|
245
|
-
default: k(() => [l(
|
|
259
|
+
default: k(() => [l(y)]),
|
|
246
260
|
_: 1
|
|
247
261
|
})]),
|
|
248
262
|
_: 1
|
|
249
263
|
}),
|
|
250
|
-
l(
|
|
251
|
-
l(
|
|
264
|
+
l(x, { direction: "vertical" }),
|
|
265
|
+
l(p, {
|
|
252
266
|
size: "small",
|
|
253
267
|
onClick: n[15] ||= (e) => t.$emit("enter-vr"),
|
|
254
268
|
disabled: !e.vrSupported,
|
|
255
269
|
title: "VR预览"
|
|
256
270
|
}, {
|
|
257
271
|
default: k(() => [l(d, null, {
|
|
258
|
-
default: k(() => [l(
|
|
272
|
+
default: k(() => [l(ee)]),
|
|
259
273
|
_: 1
|
|
260
274
|
})]),
|
|
261
275
|
_: 1
|
|
262
276
|
}, 8, ["disabled"]),
|
|
263
|
-
l(
|
|
277
|
+
l(p, {
|
|
264
278
|
size: "small",
|
|
265
279
|
onClick: n[16] ||= (e) => t.$emit("enter-ar"),
|
|
266
280
|
disabled: !e.arSupported,
|
|
267
281
|
title: "AR预览"
|
|
268
282
|
}, {
|
|
269
283
|
default: k(() => [l(d, null, {
|
|
270
|
-
default: k(() => [l(
|
|
284
|
+
default: k(() => [l(te)]),
|
|
271
285
|
_: 1
|
|
272
286
|
})]),
|
|
273
287
|
_: 1
|
|
274
288
|
}, 8, ["disabled"])
|
|
275
289
|
]),
|
|
276
|
-
o("div",
|
|
277
|
-
l(
|
|
290
|
+
o("div", z, [
|
|
291
|
+
l(A, {
|
|
278
292
|
trigger: "click",
|
|
279
|
-
onCommand:
|
|
293
|
+
onCommand: f
|
|
280
294
|
}, {
|
|
281
|
-
dropdown: k(() => [l(
|
|
295
|
+
dropdown: k(() => [l(O, null, {
|
|
282
296
|
default: k(() => [
|
|
283
|
-
l(
|
|
297
|
+
l(D, { command: "step" }, {
|
|
284
298
|
default: k(() => [...n[33] ||= [c("STEP (.step)", -1)]]),
|
|
285
299
|
_: 1
|
|
286
300
|
}),
|
|
287
|
-
l(
|
|
301
|
+
l(D, { command: "stl" }, {
|
|
288
302
|
default: k(() => [...n[34] ||= [c("STL (.stl)", -1)]]),
|
|
289
303
|
_: 1
|
|
290
304
|
}),
|
|
291
|
-
l(
|
|
305
|
+
l(D, { command: "gltf" }, {
|
|
292
306
|
default: k(() => [...n[35] ||= [c("glTF (.gltf)", -1)]]),
|
|
293
307
|
_: 1
|
|
294
308
|
})
|
|
295
309
|
]),
|
|
296
310
|
_: 1
|
|
297
311
|
})]),
|
|
298
|
-
default: k(() => [l(
|
|
312
|
+
default: k(() => [l(p, { size: "small" }, {
|
|
299
313
|
default: k(() => [
|
|
300
314
|
l(d, null, {
|
|
301
|
-
default: k(() => [l(
|
|
315
|
+
default: k(() => [l(P)]),
|
|
302
316
|
_: 1
|
|
303
317
|
}),
|
|
304
318
|
n[32] ||= c(" 导出 ", -1),
|
|
305
319
|
l(d, { class: "el-icon--right" }, {
|
|
306
|
-
default: k(() => [l(
|
|
320
|
+
default: k(() => [l(E)]),
|
|
307
321
|
_: 1
|
|
308
322
|
})
|
|
309
323
|
]),
|
|
@@ -311,19 +325,19 @@ var L = (e, t) => {
|
|
|
311
325
|
})]),
|
|
312
326
|
_: 1
|
|
313
327
|
}),
|
|
314
|
-
l(
|
|
328
|
+
l(p, {
|
|
315
329
|
size: "small",
|
|
316
330
|
type: "primary",
|
|
317
331
|
onClick: n[17] ||= (e) => t.$emit("save"),
|
|
318
332
|
loading: e.isLoading
|
|
319
333
|
}, {
|
|
320
334
|
default: k(() => [l(d, null, {
|
|
321
|
-
default: k(() => [l(
|
|
335
|
+
default: k(() => [l(ne)]),
|
|
322
336
|
_: 1
|
|
323
337
|
}), n[36] ||= c(" 保存 ", -1)]),
|
|
324
338
|
_: 1
|
|
325
339
|
}, 8, ["loading"]),
|
|
326
|
-
e.showHistory ? (_(), r(
|
|
340
|
+
e.showHistory ? (_(), r(p, {
|
|
327
341
|
key: 0,
|
|
328
342
|
size: "small",
|
|
329
343
|
circle: "",
|
|
@@ -331,7 +345,7 @@ var L = (e, t) => {
|
|
|
331
345
|
onClick: n[18] ||= (e) => t.$emit("history")
|
|
332
346
|
}, {
|
|
333
347
|
default: k(() => [l(d, null, {
|
|
334
|
-
default: k(() => [l(
|
|
348
|
+
default: k(() => [l(F)]),
|
|
335
349
|
_: 1
|
|
336
350
|
})]),
|
|
337
351
|
_: 1
|
|
@@ -340,19 +354,19 @@ var L = (e, t) => {
|
|
|
340
354
|
]);
|
|
341
355
|
};
|
|
342
356
|
}
|
|
343
|
-
}, [["__scopeId", "data-v-
|
|
357
|
+
}, [["__scopeId", "data-v-f5b47ff2"]]), B = {
|
|
344
358
|
LEFT: 0,
|
|
345
359
|
MIDDLE: 1,
|
|
346
360
|
RIGHT: 2,
|
|
347
361
|
ROTATE: 0,
|
|
348
362
|
DOLLY: 1,
|
|
349
363
|
PAN: 2
|
|
350
|
-
},
|
|
364
|
+
}, _e = {
|
|
351
365
|
ROTATE: 0,
|
|
352
366
|
PAN: 1,
|
|
353
367
|
DOLLY_PAN: 2,
|
|
354
368
|
DOLLY_ROTATE: 3
|
|
355
|
-
}, V = 1e3, ve = 1001, H = 1002, U = 1003, ye = 1004,
|
|
369
|
+
}, V = 1e3, ve = 1001, H = 1002, U = 1003, ye = 1004, be = 1005, xe = 1006, Se = 1007, Ce = 1008, W = 1009, we = 1010, Te = 1011, Ee = 1012, De = 1013, Oe = 1014, ke = 1015, Ae = 1016, je = 1017, Me = 1018, Ne = 1020, Pe = 35902, Fe = 35899, Ie = 1021, Le = 1022, Re = 1023, ze = 1026, Be = 1027, Ve = 1028, He = 1029, Ue = 1030, We = 1031, Ge = 1033, Ke = 33776, qe = 33777, Je = 33778, Ye = 33779, Xe = 35840, Ze = 35841, Qe = 35842, $e = 35843, et = 36196, tt = 37492, nt = 37496, rt = 37488, it = 37489, at = 37490, ot = 37491, st = 37808, ct = 37809, lt = 37810, ut = 37811, dt = 37812, ft = 37813, pt = 37814, mt = 37815, ht = 37816, gt = 37817, _t = 37818, vt = 37819, yt = 37820, bt = 37821, xt = 36492, St = 36494, Ct = 36495, wt = 36283, Tt = 36284, Et = 36285, Dt = 36286, Ot = 2300, kt = 2301, At = 2302, jt = 2303, Mt = 2400, Nt = 2401, Pt = 2402, Ft = 3200, It = "srgb", Lt = "srgb-linear", Rt = "linear", zt = "srgb", Bt = 7680, Vt = 35044, Ht = "300 es", Ut = 2e3, Wt = 2001;
|
|
356
370
|
function Gt(e) {
|
|
357
371
|
for (let t = e.length - 1; t >= 0; --t) if (e[t] >= 65535) return !0;
|
|
358
372
|
return !1;
|
|
@@ -1498,7 +1512,7 @@ function Gn(e) {
|
|
|
1498
1512
|
} : (G("Texture: Unable to serialize Texture."), {});
|
|
1499
1513
|
}
|
|
1500
1514
|
var Kn = 0, qn = /*@__PURE__*/ new J(), Jn = class e extends nn {
|
|
1501
|
-
constructor(t = e.DEFAULT_IMAGE, n = e.DEFAULT_MAPPING, r = ve, i = ve, a =
|
|
1515
|
+
constructor(t = e.DEFAULT_IMAGE, n = e.DEFAULT_MAPPING, r = ve, i = ve, a = xe, o = Ce, s = Re, c = W, l = e.DEFAULT_ANISOTROPY, u = "") {
|
|
1502
1516
|
super(), this.isTexture = !0, Object.defineProperty(this, "id", { value: Kn++ }), this.uuid = cn(), this.name = "", this.source = new Wn(t), this.mipmaps = [], this.mapping = n, this.channel = 0, this.wrapS = r, this.wrapT = i, this.magFilter = a, this.minFilter = o, this.anisotropy = l, this.format = s, this.internalFormat = null, this.type = c, this.offset = new q(0, 0), this.repeat = new q(1, 1), this.center = new q(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new Y(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.colorSpace = u, this.userData = {}, this.updateRanges = [], this.version = 0, this.onUpdate = null, this.renderTarget = null, this.isRenderTargetTexture = !1, this.isArrayTexture = !!(t && t.depth && t.depth > 1), this.pmremVersion = 0, this.normalized = !1;
|
|
1503
1517
|
}
|
|
1504
1518
|
get width() {
|
|
@@ -1825,7 +1839,7 @@ var Yn = class e {
|
|
|
1825
1839
|
super(), n = Object.assign({
|
|
1826
1840
|
generateMipmaps: !1,
|
|
1827
1841
|
internalFormat: null,
|
|
1828
|
-
minFilter:
|
|
1842
|
+
minFilter: xe,
|
|
1829
1843
|
depthBuffer: !0,
|
|
1830
1844
|
stencilBuffer: !1,
|
|
1831
1845
|
resolveDepthBuffer: !0,
|
|
@@ -1846,7 +1860,7 @@ var Yn = class e {
|
|
|
1846
1860
|
}
|
|
1847
1861
|
_setTextureOptions(e = {}) {
|
|
1848
1862
|
let t = {
|
|
1849
|
-
minFilter:
|
|
1863
|
+
minFilter: xe,
|
|
1850
1864
|
generateMipmaps: !1,
|
|
1851
1865
|
flipY: !1,
|
|
1852
1866
|
internalFormat: null
|
|
@@ -5122,7 +5136,7 @@ var uo = class extends Dr {
|
|
|
5122
5136
|
}
|
|
5123
5137
|
}, fo = /*@__PURE__*/ new er(), po = /*@__PURE__*/ new J(), mo = /*@__PURE__*/ new J(), ho = class {
|
|
5124
5138
|
constructor(e) {
|
|
5125
|
-
this.camera = e, this.intensity = 1, this.bias = 0, this.biasNode = null, this.normalBias = 0, this.radius = 1, this.blurSamples = 8, this.mapSize = new q(512, 512), this.mapType =
|
|
5139
|
+
this.camera = e, this.intensity = 1, this.bias = 0, this.biasNode = null, this.normalBias = 0, this.radius = 1, this.blurSamples = 8, this.mapSize = new q(512, 512), this.mapType = W, this.map = null, this.mapPass = null, this.matrix = new er(), this.autoUpdate = !0, this.needsUpdate = !1, this._frustum = new la(), this._frameExtents = new q(1, 1), this._viewportCount = 1, this._viewports = [new Yn(0, 0, 1, 1)];
|
|
5126
5140
|
}
|
|
5127
5141
|
getViewportCount() {
|
|
5128
5142
|
return this._viewportCount;
|
|
@@ -5844,7 +5858,7 @@ function $o(e, t, n, r) {
|
|
|
5844
5858
|
}
|
|
5845
5859
|
function es(e) {
|
|
5846
5860
|
switch (e) {
|
|
5847
|
-
case
|
|
5861
|
+
case W:
|
|
5848
5862
|
case we: return {
|
|
5849
5863
|
byteLength: 1,
|
|
5850
5864
|
components: 1
|
|
@@ -5966,11 +5980,11 @@ var ts = /* @__PURE__ */ e({
|
|
|
5966
5980
|
LessEqualDepth: () => 3,
|
|
5967
5981
|
LessEqualStencilFunc: () => 515,
|
|
5968
5982
|
LessStencilFunc: () => 513,
|
|
5969
|
-
LinearFilter: () =>
|
|
5983
|
+
LinearFilter: () => xe,
|
|
5970
5984
|
LinearMipMapLinearFilter: () => LinearMipMapLinearFilter,
|
|
5971
5985
|
LinearMipMapNearestFilter: () => LinearMipMapNearestFilter,
|
|
5972
|
-
LinearMipmapLinearFilter: () =>
|
|
5973
|
-
LinearMipmapNearestFilter: () =>
|
|
5986
|
+
LinearMipmapLinearFilter: () => Ce,
|
|
5987
|
+
LinearMipmapNearestFilter: () => Se,
|
|
5974
5988
|
LinearSRGBColorSpace: () => Lt,
|
|
5975
5989
|
LinearToneMapping: () => 1,
|
|
5976
5990
|
LinearTransfer: () => Rt,
|
|
@@ -5993,7 +6007,7 @@ var ts = /* @__PURE__ */ e({
|
|
|
5993
6007
|
NearestFilter: () => U,
|
|
5994
6008
|
NearestMipMapLinearFilter: () => NearestMipMapLinearFilter,
|
|
5995
6009
|
NearestMipMapNearestFilter: () => NearestMipMapNearestFilter,
|
|
5996
|
-
NearestMipmapLinearFilter: () =>
|
|
6010
|
+
NearestMipmapLinearFilter: () => be,
|
|
5997
6011
|
NearestMipmapNearestFilter: () => ye,
|
|
5998
6012
|
NeutralToneMapping: () => 7,
|
|
5999
6013
|
NeverCompare: () => 512,
|
|
@@ -6105,7 +6119,7 @@ var ts = /* @__PURE__ */ e({
|
|
|
6105
6119
|
Uint32BufferAttribute: () => _i,
|
|
6106
6120
|
UniformsLib: () => $,
|
|
6107
6121
|
UniformsUtils: () => Ba,
|
|
6108
|
-
UnsignedByteType: () =>
|
|
6122
|
+
UnsignedByteType: () => W,
|
|
6109
6123
|
UnsignedInt101111Type: () => Fe,
|
|
6110
6124
|
UnsignedInt248Type: () => Ne,
|
|
6111
6125
|
UnsignedInt5999Type: () => Pe,
|
|
@@ -7241,8 +7255,8 @@ var ps = 4, ms = [
|
|
|
7241
7255
|
}
|
|
7242
7256
|
_allocateTargets() {
|
|
7243
7257
|
let e = 3 * Math.max(this._cubeSize, 112), t = 4 * this._cubeSize, n = {
|
|
7244
|
-
magFilter:
|
|
7245
|
-
minFilter:
|
|
7258
|
+
magFilter: xe,
|
|
7259
|
+
minFilter: xe,
|
|
7246
7260
|
generateMipmaps: !1,
|
|
7247
7261
|
type: Ae,
|
|
7248
7262
|
format: Re,
|
|
@@ -7516,7 +7530,7 @@ var Ns = class extends Zn {
|
|
|
7516
7530
|
});
|
|
7517
7531
|
i.uniforms.tEquirect.value = t;
|
|
7518
7532
|
let a = new Z(r, i), o = t.minFilter;
|
|
7519
|
-
return t.minFilter === 1008 && (t.minFilter =
|
|
7533
|
+
return t.minFilter === 1008 && (t.minFilter = xe), new Ao(1, 10, this).update(e, a), t.minFilter = o, a.geometry.dispose(), a.material.dispose(), this;
|
|
7520
7534
|
}
|
|
7521
7535
|
clear(e, t = !0, n = !0, r = !0) {
|
|
7522
7536
|
let i = e.getRenderTarget();
|
|
@@ -8791,7 +8805,7 @@ function Il(e, t, n, r, i, a) {
|
|
|
8791
8805
|
let e = is[C];
|
|
8792
8806
|
D = e.vertexShader, O = e.fragmentShader;
|
|
8793
8807
|
} else D = i.vertexShader, O = i.fragmentShader, s.update(i), k = s.getVertexShaderID(i), A = s.getFragmentShaderID(i);
|
|
8794
|
-
let j = e.getRenderTarget(), M = e.state.buffers.depth.getReversed(), N = h.isInstancedMesh === !0, ee = h.isBatchedMesh === !0, te = !!i.map, P = !!i.matcap, ne = !!x,
|
|
8808
|
+
let j = e.getRenderTarget(), M = e.state.buffers.depth.getReversed(), N = h.isInstancedMesh === !0, ee = h.isBatchedMesh === !0, te = !!i.map, P = !!i.matcap, ne = !!x, F = !!i.aoMap, re = !!i.lightMap, I = !!i.bumpMap, ie = !!i.normalMap, ae = !!i.displacementMap, oe = !!i.emissiveMap, se = !!i.metalnessMap, ce = !!i.roughnessMap, le = i.anisotropy > 0, ue = i.clearcoat > 0, de = i.dispersion > 0, fe = i.iridescence > 0, L = i.sheen > 0, R = i.transmission > 0, pe = le && !!i.anisotropyMap, me = ue && !!i.clearcoatMap, he = ue && !!i.clearcoatNormalMap, z = ue && !!i.clearcoatRoughnessMap, ge = fe && !!i.iridescenceMap, B = fe && !!i.iridescenceThicknessMap, _e = L && !!i.sheenColorMap, V = L && !!i.sheenRoughnessMap, ve = !!i.specularMap, H = !!i.specularColorMap, U = !!i.specularIntensityMap, ye = R && !!i.transmissionMap, be = R && !!i.thicknessMap, xe = !!i.gradientMap, Se = !!i.alphaMap, Ce = i.alphaTest > 0, W = !!i.alphaHash, we = !!i.extensions, Te = 0;
|
|
8795
8809
|
i.toneMapped && (j === null || j.isXRRenderTarget === !0) && (Te = e.toneMapping);
|
|
8796
8810
|
let Ee = {
|
|
8797
8811
|
shaderID: C,
|
|
@@ -8817,74 +8831,74 @@ function Il(e, t, n, r, i, a) {
|
|
|
8817
8831
|
envMap: ne,
|
|
8818
8832
|
envMapMode: ne && x.mapping,
|
|
8819
8833
|
envMapCubeUVHeight: S,
|
|
8820
|
-
aoMap:
|
|
8821
|
-
lightMap:
|
|
8822
|
-
bumpMap:
|
|
8823
|
-
normalMap:
|
|
8824
|
-
displacementMap:
|
|
8825
|
-
emissiveMap:
|
|
8826
|
-
normalMapObjectSpace:
|
|
8827
|
-
normalMapTangentSpace:
|
|
8828
|
-
packedNormalMap:
|
|
8829
|
-
metalnessMap:
|
|
8830
|
-
roughnessMap:
|
|
8831
|
-
anisotropy:
|
|
8832
|
-
anisotropyMap:
|
|
8833
|
-
clearcoat:
|
|
8834
|
-
clearcoatMap:
|
|
8835
|
-
clearcoatNormalMap:
|
|
8836
|
-
clearcoatRoughnessMap:
|
|
8837
|
-
dispersion:
|
|
8838
|
-
iridescence:
|
|
8839
|
-
iridescenceMap:
|
|
8840
|
-
iridescenceThicknessMap:
|
|
8841
|
-
sheen:
|
|
8842
|
-
sheenColorMap:
|
|
8834
|
+
aoMap: F,
|
|
8835
|
+
lightMap: re,
|
|
8836
|
+
bumpMap: I,
|
|
8837
|
+
normalMap: ie,
|
|
8838
|
+
displacementMap: ae,
|
|
8839
|
+
emissiveMap: oe,
|
|
8840
|
+
normalMapObjectSpace: ie && i.normalMapType === 1,
|
|
8841
|
+
normalMapTangentSpace: ie && i.normalMapType === 0,
|
|
8842
|
+
packedNormalMap: ie && i.normalMapType === 0 && Fl(i.normalMap.format),
|
|
8843
|
+
metalnessMap: se,
|
|
8844
|
+
roughnessMap: ce,
|
|
8845
|
+
anisotropy: le,
|
|
8846
|
+
anisotropyMap: pe,
|
|
8847
|
+
clearcoat: ue,
|
|
8848
|
+
clearcoatMap: me,
|
|
8849
|
+
clearcoatNormalMap: he,
|
|
8850
|
+
clearcoatRoughnessMap: z,
|
|
8851
|
+
dispersion: de,
|
|
8852
|
+
iridescence: fe,
|
|
8853
|
+
iridescenceMap: ge,
|
|
8854
|
+
iridescenceThicknessMap: B,
|
|
8855
|
+
sheen: L,
|
|
8856
|
+
sheenColorMap: _e,
|
|
8843
8857
|
sheenRoughnessMap: V,
|
|
8844
8858
|
specularMap: ve,
|
|
8845
8859
|
specularColorMap: H,
|
|
8846
8860
|
specularIntensityMap: U,
|
|
8847
|
-
transmission:
|
|
8861
|
+
transmission: R,
|
|
8848
8862
|
transmissionMap: ye,
|
|
8849
|
-
thicknessMap:
|
|
8850
|
-
gradientMap:
|
|
8863
|
+
thicknessMap: be,
|
|
8864
|
+
gradientMap: xe,
|
|
8851
8865
|
opaque: i.transparent === !1 && i.blending === 1 && i.alphaToCoverage === !1,
|
|
8852
|
-
alphaMap:
|
|
8853
|
-
alphaTest:
|
|
8854
|
-
alphaHash:
|
|
8866
|
+
alphaMap: Se,
|
|
8867
|
+
alphaTest: Ce,
|
|
8868
|
+
alphaHash: W,
|
|
8855
8869
|
combine: i.combine,
|
|
8856
8870
|
mapUv: te && m(i.map.channel),
|
|
8857
|
-
aoMapUv:
|
|
8858
|
-
lightMapUv:
|
|
8859
|
-
bumpMapUv:
|
|
8860
|
-
normalMapUv:
|
|
8861
|
-
displacementMapUv:
|
|
8862
|
-
emissiveMapUv:
|
|
8863
|
-
metalnessMapUv:
|
|
8864
|
-
roughnessMapUv:
|
|
8865
|
-
anisotropyMapUv:
|
|
8866
|
-
clearcoatMapUv:
|
|
8867
|
-
clearcoatNormalMapUv:
|
|
8868
|
-
clearcoatRoughnessMapUv:
|
|
8869
|
-
iridescenceMapUv:
|
|
8870
|
-
iridescenceThicknessMapUv:
|
|
8871
|
-
sheenColorMapUv:
|
|
8871
|
+
aoMapUv: F && m(i.aoMap.channel),
|
|
8872
|
+
lightMapUv: re && m(i.lightMap.channel),
|
|
8873
|
+
bumpMapUv: I && m(i.bumpMap.channel),
|
|
8874
|
+
normalMapUv: ie && m(i.normalMap.channel),
|
|
8875
|
+
displacementMapUv: ae && m(i.displacementMap.channel),
|
|
8876
|
+
emissiveMapUv: oe && m(i.emissiveMap.channel),
|
|
8877
|
+
metalnessMapUv: se && m(i.metalnessMap.channel),
|
|
8878
|
+
roughnessMapUv: ce && m(i.roughnessMap.channel),
|
|
8879
|
+
anisotropyMapUv: pe && m(i.anisotropyMap.channel),
|
|
8880
|
+
clearcoatMapUv: me && m(i.clearcoatMap.channel),
|
|
8881
|
+
clearcoatNormalMapUv: he && m(i.clearcoatNormalMap.channel),
|
|
8882
|
+
clearcoatRoughnessMapUv: z && m(i.clearcoatRoughnessMap.channel),
|
|
8883
|
+
iridescenceMapUv: ge && m(i.iridescenceMap.channel),
|
|
8884
|
+
iridescenceThicknessMapUv: B && m(i.iridescenceThicknessMap.channel),
|
|
8885
|
+
sheenColorMapUv: _e && m(i.sheenColorMap.channel),
|
|
8872
8886
|
sheenRoughnessMapUv: V && m(i.sheenRoughnessMap.channel),
|
|
8873
8887
|
specularMapUv: ve && m(i.specularMap.channel),
|
|
8874
8888
|
specularColorMapUv: H && m(i.specularColorMap.channel),
|
|
8875
8889
|
specularIntensityMapUv: U && m(i.specularIntensityMap.channel),
|
|
8876
8890
|
transmissionMapUv: ye && m(i.transmissionMap.channel),
|
|
8877
|
-
thicknessMapUv:
|
|
8878
|
-
alphaMapUv:
|
|
8879
|
-
vertexTangents: !!v.attributes.tangent && (
|
|
8891
|
+
thicknessMapUv: be && m(i.thicknessMap.channel),
|
|
8892
|
+
alphaMapUv: Se && m(i.alphaMap.channel),
|
|
8893
|
+
vertexTangents: !!v.attributes.tangent && (ie || le),
|
|
8880
8894
|
vertexNormals: !!v.attributes.normal,
|
|
8881
8895
|
vertexColors: i.vertexColors,
|
|
8882
8896
|
vertexAlphas: i.vertexColors === !0 && !!v.attributes.color && v.attributes.color.itemSize === 4,
|
|
8883
|
-
pointsUvs: h.isPoints === !0 && !!v.attributes.uv && (te ||
|
|
8897
|
+
pointsUvs: h.isPoints === !0 && !!v.attributes.uv && (te || Se),
|
|
8884
8898
|
fog: !!_,
|
|
8885
8899
|
useFog: i.fog === !0,
|
|
8886
8900
|
fogExp2: !!_ && _.isFogExp2,
|
|
8887
|
-
flatShading: i.wireframe === !1 && (i.flatShading === !0 || v.attributes.normal === void 0 &&
|
|
8901
|
+
flatShading: i.wireframe === !1 && (i.flatShading === !0 || v.attributes.normal === void 0 && ie === !1 && (i.isMeshLambertMaterial || i.isMeshPhongMaterial || i.isMeshStandardMaterial || i.isMeshPhysicalMaterial)),
|
|
8888
8902
|
sizeAttenuation: i.sizeAttenuation === !0,
|
|
8889
8903
|
logarithmicDepthBuffer: d,
|
|
8890
8904
|
reversedDepthBuffer: M,
|
|
@@ -8913,7 +8927,7 @@ function Il(e, t, n, r, i, a) {
|
|
|
8913
8927
|
shadowMapType: e.shadowMap.type,
|
|
8914
8928
|
toneMapping: Te,
|
|
8915
8929
|
decodeVideoTexture: te && i.map.isVideoTexture === !0 && Rn.getTransfer(i.map.colorSpace) === "srgb",
|
|
8916
|
-
decodeVideoTextureEmissive:
|
|
8930
|
+
decodeVideoTextureEmissive: oe && i.emissiveMap.isVideoTexture === !0 && Rn.getTransfer(i.emissiveMap.colorSpace) === "srgb",
|
|
8917
8931
|
premultipliedAlpha: i.premultipliedAlpha,
|
|
8918
8932
|
doubleSided: i.side === 2,
|
|
8919
8933
|
flipSided: i.side === 1,
|
|
@@ -9409,11 +9423,11 @@ function nu(e, t, n) {
|
|
|
9409
9423
|
d.map = new Zn(i.x, i.y, {
|
|
9410
9424
|
format: Ue,
|
|
9411
9425
|
type: Ae,
|
|
9412
|
-
minFilter:
|
|
9413
|
-
magFilter:
|
|
9426
|
+
minFilter: xe,
|
|
9427
|
+
magFilter: xe,
|
|
9414
9428
|
generateMipmaps: !1
|
|
9415
9429
|
}), d.map.texture.name = l.name + ".shadowMap", d.map.depthTexture = new wa(i.x, i.y, ke), d.map.depthTexture.name = l.name + ".shadowMapDepth", d.map.depthTexture.format = ze, d.map.depthTexture.compareFunction = null, d.map.depthTexture.minFilter = U, d.map.depthTexture.magFilter = U;
|
|
9416
|
-
} else l.isPointLight ? (d.map = new Ns(i.x), d.map.depthTexture = new Ta(i.x, Oe)) : (d.map = new Zn(i.x, i.y), d.map.depthTexture = new wa(i.x, i.y, Oe)), d.map.depthTexture.name = l.name + ".shadowMap", d.map.depthTexture.format = ze, this.type === 1 ? (d.map.depthTexture.compareFunction = h ? 518 : 515, d.map.depthTexture.minFilter =
|
|
9430
|
+
} else l.isPointLight ? (d.map = new Ns(i.x), d.map.depthTexture = new Ta(i.x, Oe)) : (d.map = new Zn(i.x, i.y), d.map.depthTexture = new wa(i.x, i.y, Oe)), d.map.depthTexture.name = l.name + ".shadowMap", d.map.depthTexture.format = ze, this.type === 1 ? (d.map.depthTexture.compareFunction = h ? 518 : 515, d.map.depthTexture.minFilter = xe, d.map.depthTexture.magFilter = xe) : (d.map.depthTexture.compareFunction = null, d.map.depthTexture.minFilter = U, d.map.depthTexture.magFilter = U);
|
|
9417
9431
|
d.camera.updateProjectionMatrix();
|
|
9418
9432
|
}
|
|
9419
9433
|
let g = d.map.isWebGLCubeRenderTarget ? 6 : 1;
|
|
@@ -9519,7 +9533,7 @@ function ru(e, t) {
|
|
|
9519
9533
|
return r;
|
|
9520
9534
|
},
|
|
9521
9535
|
setTest: function(t) {
|
|
9522
|
-
t ?
|
|
9536
|
+
t ? se(e.DEPTH_TEST) : ce(e.DEPTH_TEST);
|
|
9523
9537
|
},
|
|
9524
9538
|
setMask: function(t) {
|
|
9525
9539
|
i !== t && !n && (e.depthMask(t), i = t);
|
|
@@ -9571,7 +9585,7 @@ function ru(e, t) {
|
|
|
9571
9585
|
let t = !1, n = null, r = null, i = null, a = null, o = null, s = null, c = null, l = null;
|
|
9572
9586
|
return {
|
|
9573
9587
|
setTest: function(n) {
|
|
9574
|
-
t || (n ?
|
|
9588
|
+
t || (n ? se(e.STENCIL_TEST) : ce(e.STENCIL_TEST));
|
|
9575
9589
|
},
|
|
9576
9590
|
setMask: function(r) {
|
|
9577
9591
|
n !== r && !t && (e.stencilMask(r), n = r);
|
|
@@ -9595,25 +9609,25 @@ function ru(e, t) {
|
|
|
9595
9609
|
}
|
|
9596
9610
|
let a = new n(), o = new r(), s = new i(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = {}, d = {}, f = {}, p = /* @__PURE__ */ new WeakMap(), m = [], h = null, g = !1, _ = null, v = null, y = null, b = null, x = null, S = null, C = null, w = new X(0, 0, 0), T = 0, E = !1, D = null, O = null, k = null, A = null, j = null, M = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), N = !1, ee = 0, te = e.getParameter(e.VERSION);
|
|
9597
9611
|
te.indexOf("WebGL") === -1 ? te.indexOf("OpenGL ES") !== -1 && (ee = parseFloat(/^OpenGL ES (\d)/.exec(te)[1]), N = ee >= 2) : (ee = parseFloat(/^WebGL (\d)/.exec(te)[1]), N = ee >= 1);
|
|
9598
|
-
let P = null, ne = {},
|
|
9599
|
-
function
|
|
9612
|
+
let P = null, ne = {}, F = e.getParameter(e.SCISSOR_BOX), re = e.getParameter(e.VIEWPORT), I = new Yn().fromArray(F), ie = new Yn().fromArray(re);
|
|
9613
|
+
function ae(t, n, r, i) {
|
|
9600
9614
|
let a = /* @__PURE__ */ new Uint8Array(4), o = e.createTexture();
|
|
9601
9615
|
e.bindTexture(t, o), e.texParameteri(t, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(t, e.TEXTURE_MAG_FILTER, e.NEAREST);
|
|
9602
9616
|
for (let o = 0; o < r; o++) t === e.TEXTURE_3D || t === e.TEXTURE_2D_ARRAY ? e.texImage3D(n, 0, e.RGBA, 1, 1, i, 0, e.RGBA, e.UNSIGNED_BYTE, a) : e.texImage2D(n + o, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, a);
|
|
9603
9617
|
return o;
|
|
9604
9618
|
}
|
|
9605
|
-
let
|
|
9606
|
-
|
|
9607
|
-
function
|
|
9619
|
+
let oe = {};
|
|
9620
|
+
oe[e.TEXTURE_2D] = ae(e.TEXTURE_2D, e.TEXTURE_2D, 1), oe[e.TEXTURE_CUBE_MAP] = ae(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6), oe[e.TEXTURE_2D_ARRAY] = ae(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1), oe[e.TEXTURE_3D] = ae(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1), a.setClear(0, 0, 0, 1), o.setClear(1), s.setClear(0), se(e.DEPTH_TEST), o.setFunc(3), me(!1), he(1), se(e.CULL_FACE), R(0);
|
|
9621
|
+
function se(t) {
|
|
9608
9622
|
u[t] !== !0 && (e.enable(t), u[t] = !0);
|
|
9609
9623
|
}
|
|
9610
|
-
function
|
|
9624
|
+
function ce(t) {
|
|
9611
9625
|
u[t] !== !1 && (e.disable(t), u[t] = !1);
|
|
9612
9626
|
}
|
|
9613
|
-
function
|
|
9627
|
+
function le(t, n) {
|
|
9614
9628
|
return f[t] === n ? !1 : (e.bindFramebuffer(t, n), f[t] = n, t === e.DRAW_FRAMEBUFFER && (f[e.FRAMEBUFFER] = n), t === e.FRAMEBUFFER && (f[e.DRAW_FRAMEBUFFER] = n), !0);
|
|
9615
9629
|
}
|
|
9616
|
-
function
|
|
9630
|
+
function ue(t, n) {
|
|
9617
9631
|
let r = m, i = !1;
|
|
9618
9632
|
if (t) {
|
|
9619
9633
|
r = p.get(n), r === void 0 && (r = [], p.set(n, r));
|
|
@@ -9625,16 +9639,16 @@ function ru(e, t) {
|
|
|
9625
9639
|
} else r[0] !== e.BACK && (r[0] = e.BACK, i = !0);
|
|
9626
9640
|
i && e.drawBuffers(r);
|
|
9627
9641
|
}
|
|
9628
|
-
function
|
|
9642
|
+
function de(t) {
|
|
9629
9643
|
return h === t ? !1 : (e.useProgram(t), h = t, !0);
|
|
9630
9644
|
}
|
|
9631
|
-
let
|
|
9645
|
+
let fe = {
|
|
9632
9646
|
100: e.FUNC_ADD,
|
|
9633
9647
|
101: e.FUNC_SUBTRACT,
|
|
9634
9648
|
102: e.FUNC_REVERSE_SUBTRACT
|
|
9635
9649
|
};
|
|
9636
|
-
|
|
9637
|
-
let
|
|
9650
|
+
fe[103] = e.MIN, fe[104] = e.MAX;
|
|
9651
|
+
let L = {
|
|
9638
9652
|
200: e.ZERO,
|
|
9639
9653
|
201: e.ONE,
|
|
9640
9654
|
202: e.SRC_COLOR,
|
|
@@ -9651,12 +9665,12 @@ function ru(e, t) {
|
|
|
9651
9665
|
213: e.CONSTANT_ALPHA,
|
|
9652
9666
|
214: e.ONE_MINUS_CONSTANT_ALPHA
|
|
9653
9667
|
};
|
|
9654
|
-
function
|
|
9668
|
+
function R(t, n, r, i, a, o, s, c, l, u) {
|
|
9655
9669
|
if (t === 0) {
|
|
9656
|
-
g === !0 && (
|
|
9670
|
+
g === !0 && (ce(e.BLEND), g = !1);
|
|
9657
9671
|
return;
|
|
9658
9672
|
}
|
|
9659
|
-
if (g === !1 && (
|
|
9673
|
+
if (g === !1 && (se(e.BLEND), g = !0), t !== 5) {
|
|
9660
9674
|
if (t !== _ || u !== E) {
|
|
9661
9675
|
if ((v !== 100 || x !== 100) && (e.blendEquation(e.FUNC_ADD), v = 100, x = 100), u) switch (t) {
|
|
9662
9676
|
case 1:
|
|
@@ -9696,31 +9710,31 @@ function ru(e, t) {
|
|
|
9696
9710
|
}
|
|
9697
9711
|
return;
|
|
9698
9712
|
}
|
|
9699
|
-
a ||= n, o ||= r, s ||= i, (n !== v || a !== x) && (e.blendEquationSeparate(
|
|
9713
|
+
a ||= n, o ||= r, s ||= i, (n !== v || a !== x) && (e.blendEquationSeparate(fe[n], fe[a]), v = n, x = a), (r !== y || i !== b || o !== S || s !== C) && (e.blendFuncSeparate(L[r], L[i], L[o], L[s]), y = r, b = i, S = o, C = s), (c.equals(w) === !1 || l !== T) && (e.blendColor(c.r, c.g, c.b, l), w.copy(c), T = l), _ = t, E = !1;
|
|
9700
9714
|
}
|
|
9701
|
-
function
|
|
9702
|
-
t.side === 2 ?
|
|
9715
|
+
function pe(t, n) {
|
|
9716
|
+
t.side === 2 ? ce(e.CULL_FACE) : se(e.CULL_FACE);
|
|
9703
9717
|
let r = t.side === 1;
|
|
9704
|
-
n && (r = !r),
|
|
9718
|
+
n && (r = !r), me(r), t.blending === 1 && t.transparent === !1 ? R(0) : R(t.blending, t.blendEquation, t.blendSrc, t.blendDst, t.blendEquationAlpha, t.blendSrcAlpha, t.blendDstAlpha, t.blendColor, t.blendAlpha, t.premultipliedAlpha), o.setFunc(t.depthFunc), o.setTest(t.depthTest), o.setMask(t.depthWrite), a.setMask(t.colorWrite);
|
|
9705
9719
|
let i = t.stencilWrite;
|
|
9706
|
-
s.setTest(i), i && (s.setMask(t.stencilWriteMask), s.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), s.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)),
|
|
9720
|
+
s.setTest(i), i && (s.setMask(t.stencilWriteMask), s.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), s.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), ge(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), t.alphaToCoverage === !0 ? se(e.SAMPLE_ALPHA_TO_COVERAGE) : ce(e.SAMPLE_ALPHA_TO_COVERAGE);
|
|
9707
9721
|
}
|
|
9708
|
-
function
|
|
9722
|
+
function me(t) {
|
|
9709
9723
|
D !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), D = t);
|
|
9710
9724
|
}
|
|
9711
|
-
function
|
|
9712
|
-
t === 0 ?
|
|
9725
|
+
function he(t) {
|
|
9726
|
+
t === 0 ? ce(e.CULL_FACE) : (se(e.CULL_FACE), t !== O && (t === 1 ? e.cullFace(e.BACK) : t === 2 ? e.cullFace(e.FRONT) : e.cullFace(e.FRONT_AND_BACK))), O = t;
|
|
9713
9727
|
}
|
|
9714
|
-
function
|
|
9728
|
+
function z(t) {
|
|
9715
9729
|
t !== k && (N && e.lineWidth(t), k = t);
|
|
9716
9730
|
}
|
|
9717
|
-
function
|
|
9718
|
-
t ? (
|
|
9719
|
-
}
|
|
9720
|
-
function z(t) {
|
|
9721
|
-
t ? ce(e.SCISSOR_TEST) : le(e.SCISSOR_TEST);
|
|
9731
|
+
function ge(t, n, r) {
|
|
9732
|
+
t ? (se(e.POLYGON_OFFSET_FILL), (A !== n || j !== r) && (A = n, j = r, o.getReversed() && (n = -n), e.polygonOffset(n, r))) : ce(e.POLYGON_OFFSET_FILL);
|
|
9722
9733
|
}
|
|
9723
9734
|
function B(t) {
|
|
9735
|
+
t ? se(e.SCISSOR_TEST) : ce(e.SCISSOR_TEST);
|
|
9736
|
+
}
|
|
9737
|
+
function _e(t) {
|
|
9724
9738
|
t === void 0 && (t = e.TEXTURE0 + M - 1), P !== t && (e.activeTexture(t), P = t);
|
|
9725
9739
|
}
|
|
9726
9740
|
function V(t, n, r) {
|
|
@@ -9729,7 +9743,7 @@ function ru(e, t) {
|
|
|
9729
9743
|
i === void 0 && (i = {
|
|
9730
9744
|
type: void 0,
|
|
9731
9745
|
texture: void 0
|
|
9732
|
-
}, ne[r] = i), (i.type !== t || i.texture !== n) && (P !== r && (e.activeTexture(r), P = r), e.bindTexture(t, n ||
|
|
9746
|
+
}, ne[r] = i), (i.type !== t || i.texture !== n) && (P !== r && (e.activeTexture(r), P = r), e.bindTexture(t, n || oe[t]), i.type = t, i.texture = n);
|
|
9733
9747
|
}
|
|
9734
9748
|
function ve() {
|
|
9735
9749
|
let t = ne[P];
|
|
@@ -9756,35 +9770,35 @@ function ru(e, t) {
|
|
|
9756
9770
|
K("WebGLState:", e);
|
|
9757
9771
|
}
|
|
9758
9772
|
}
|
|
9759
|
-
function
|
|
9773
|
+
function be() {
|
|
9760
9774
|
try {
|
|
9761
9775
|
e.texSubImage3D(...arguments);
|
|
9762
9776
|
} catch (e) {
|
|
9763
9777
|
K("WebGLState:", e);
|
|
9764
9778
|
}
|
|
9765
9779
|
}
|
|
9766
|
-
function
|
|
9780
|
+
function xe() {
|
|
9767
9781
|
try {
|
|
9768
9782
|
e.compressedTexSubImage2D(...arguments);
|
|
9769
9783
|
} catch (e) {
|
|
9770
9784
|
K("WebGLState:", e);
|
|
9771
9785
|
}
|
|
9772
9786
|
}
|
|
9773
|
-
function
|
|
9787
|
+
function Se() {
|
|
9774
9788
|
try {
|
|
9775
9789
|
e.compressedTexSubImage3D(...arguments);
|
|
9776
9790
|
} catch (e) {
|
|
9777
9791
|
K("WebGLState:", e);
|
|
9778
9792
|
}
|
|
9779
9793
|
}
|
|
9780
|
-
function
|
|
9794
|
+
function Ce() {
|
|
9781
9795
|
try {
|
|
9782
9796
|
e.texStorage2D(...arguments);
|
|
9783
9797
|
} catch (e) {
|
|
9784
9798
|
K("WebGLState:", e);
|
|
9785
9799
|
}
|
|
9786
9800
|
}
|
|
9787
|
-
function
|
|
9801
|
+
function W() {
|
|
9788
9802
|
try {
|
|
9789
9803
|
e.texStorage3D(...arguments);
|
|
9790
9804
|
} catch (e) {
|
|
@@ -9812,10 +9826,10 @@ function ru(e, t) {
|
|
|
9812
9826
|
d[t] !== n && (e.pixelStorei(t, n), d[t] = n);
|
|
9813
9827
|
}
|
|
9814
9828
|
function Oe(t) {
|
|
9815
|
-
|
|
9829
|
+
I.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), I.copy(t));
|
|
9816
9830
|
}
|
|
9817
9831
|
function ke(t) {
|
|
9818
|
-
|
|
9832
|
+
ie.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), ie.copy(t));
|
|
9819
9833
|
}
|
|
9820
9834
|
function Ae(t, n) {
|
|
9821
9835
|
let r = l.get(n);
|
|
@@ -9828,7 +9842,7 @@ function ru(e, t) {
|
|
|
9828
9842
|
c.get(n) !== r && (e.uniformBlockBinding(n, r, t.__bindingPointIndex), c.set(n, r));
|
|
9829
9843
|
}
|
|
9830
9844
|
function Me() {
|
|
9831
|
-
e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), e.pixelStorei(e.PACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !1), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, e.BROWSER_DEFAULT_WEBGL), e.pixelStorei(e.PACK_ROW_LENGTH, 0), e.pixelStorei(e.PACK_SKIP_PIXELS, 0), e.pixelStorei(e.PACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_ROW_LENGTH, 0), e.pixelStorei(e.UNPACK_IMAGE_HEIGHT, 0), e.pixelStorei(e.UNPACK_SKIP_PIXELS, 0), e.pixelStorei(e.UNPACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_SKIP_IMAGES, 0), u = {}, d = {}, P = null, ne = {}, f = {}, p = /* @__PURE__ */ new WeakMap(), m = [], h = null, g = !1, _ = null, v = null, y = null, b = null, x = null, S = null, C = null, w = new X(0, 0, 0), T = 0, E = !1, D = null, O = null, k = null, A = null, j = null,
|
|
9845
|
+
e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), e.pixelStorei(e.PACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !1), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, e.BROWSER_DEFAULT_WEBGL), e.pixelStorei(e.PACK_ROW_LENGTH, 0), e.pixelStorei(e.PACK_SKIP_PIXELS, 0), e.pixelStorei(e.PACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_ROW_LENGTH, 0), e.pixelStorei(e.UNPACK_IMAGE_HEIGHT, 0), e.pixelStorei(e.UNPACK_SKIP_PIXELS, 0), e.pixelStorei(e.UNPACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_SKIP_IMAGES, 0), u = {}, d = {}, P = null, ne = {}, f = {}, p = /* @__PURE__ */ new WeakMap(), m = [], h = null, g = !1, _ = null, v = null, y = null, b = null, x = null, S = null, C = null, w = new X(0, 0, 0), T = 0, E = !1, D = null, O = null, k = null, A = null, j = null, I.set(0, 0, e.canvas.width, e.canvas.height), ie.set(0, 0, e.canvas.width, e.canvas.height), a.reset(), o.reset(), s.reset();
|
|
9832
9846
|
}
|
|
9833
9847
|
return {
|
|
9834
9848
|
buffers: {
|
|
@@ -9836,19 +9850,19 @@ function ru(e, t) {
|
|
|
9836
9850
|
depth: o,
|
|
9837
9851
|
stencil: s
|
|
9838
9852
|
},
|
|
9839
|
-
enable:
|
|
9840
|
-
disable:
|
|
9841
|
-
bindFramebuffer:
|
|
9842
|
-
drawBuffers:
|
|
9843
|
-
useProgram:
|
|
9844
|
-
setBlending:
|
|
9845
|
-
setMaterial:
|
|
9846
|
-
setFlipSided:
|
|
9847
|
-
setCullFace:
|
|
9848
|
-
setLineWidth:
|
|
9849
|
-
setPolygonOffset:
|
|
9850
|
-
setScissorTest:
|
|
9851
|
-
activeTexture:
|
|
9853
|
+
enable: se,
|
|
9854
|
+
disable: ce,
|
|
9855
|
+
bindFramebuffer: le,
|
|
9856
|
+
drawBuffers: ue,
|
|
9857
|
+
useProgram: de,
|
|
9858
|
+
setBlending: R,
|
|
9859
|
+
setMaterial: pe,
|
|
9860
|
+
setFlipSided: me,
|
|
9861
|
+
setCullFace: he,
|
|
9862
|
+
setLineWidth: z,
|
|
9863
|
+
setPolygonOffset: ge,
|
|
9864
|
+
setScissorTest: B,
|
|
9865
|
+
activeTexture: _e,
|
|
9852
9866
|
bindTexture: V,
|
|
9853
9867
|
unbindTexture: ve,
|
|
9854
9868
|
compressedTexImage2D: H,
|
|
@@ -9859,12 +9873,12 @@ function ru(e, t) {
|
|
|
9859
9873
|
getParameter: Ee,
|
|
9860
9874
|
updateUBOMapping: Ae,
|
|
9861
9875
|
uniformBlockBinding: je,
|
|
9862
|
-
texStorage2D:
|
|
9863
|
-
texStorage3D:
|
|
9876
|
+
texStorage2D: Ce,
|
|
9877
|
+
texStorage3D: W,
|
|
9864
9878
|
texSubImage2D: ye,
|
|
9865
|
-
texSubImage3D:
|
|
9866
|
-
compressedTexSubImage2D:
|
|
9867
|
-
compressedTexSubImage3D:
|
|
9879
|
+
texSubImage3D: be,
|
|
9880
|
+
compressedTexSubImage2D: xe,
|
|
9881
|
+
compressedTexSubImage3D: Se,
|
|
9868
9882
|
scissor: Oe,
|
|
9869
9883
|
viewport: ke,
|
|
9870
9884
|
reset: Me
|
|
@@ -9982,12 +9996,12 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
9982
9996
|
}
|
|
9983
9997
|
function ee(t, i) {
|
|
9984
9998
|
let a = r.get(t);
|
|
9985
|
-
if (t.isVideoTexture &&
|
|
9999
|
+
if (t.isVideoTexture && W(t), t.isRenderTargetTexture === !1 && t.isExternalTexture !== !0 && t.version > 0 && a.__version !== t.version) {
|
|
9986
10000
|
let e = t.image;
|
|
9987
10001
|
if (e === null) G("WebGLRenderer: Texture marked for update but no image data found.");
|
|
9988
10002
|
else if (e.complete === !1) G("WebGLRenderer: Texture marked for update but image is incomplete");
|
|
9989
10003
|
else {
|
|
9990
|
-
|
|
10004
|
+
ce(a, t, i);
|
|
9991
10005
|
return;
|
|
9992
10006
|
}
|
|
9993
10007
|
} else t.isExternalTexture && (a.__webglTexture = t.sourceTexture ? t.sourceTexture : null);
|
|
@@ -9996,7 +10010,7 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
9996
10010
|
function te(t, i) {
|
|
9997
10011
|
let a = r.get(t);
|
|
9998
10012
|
if (t.isRenderTargetTexture === !1 && t.version > 0 && a.__version !== t.version) {
|
|
9999
|
-
|
|
10013
|
+
ce(a, t, i);
|
|
10000
10014
|
return;
|
|
10001
10015
|
} else t.isExternalTexture && (a.__webglTexture = t.sourceTexture ? t.sourceTexture : null);
|
|
10002
10016
|
n.bindTexture(e.TEXTURE_2D_ARRAY, a.__webglTexture, e.TEXTURE0 + i);
|
|
@@ -10004,7 +10018,7 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10004
10018
|
function P(t, i) {
|
|
10005
10019
|
let a = r.get(t);
|
|
10006
10020
|
if (t.isRenderTargetTexture === !1 && t.version > 0 && a.__version !== t.version) {
|
|
10007
|
-
|
|
10021
|
+
ce(a, t, i);
|
|
10008
10022
|
return;
|
|
10009
10023
|
}
|
|
10010
10024
|
n.bindTexture(e.TEXTURE_3D, a.__webglTexture, e.TEXTURE0 + i);
|
|
@@ -10012,23 +10026,23 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10012
10026
|
function ne(t, i) {
|
|
10013
10027
|
let a = r.get(t);
|
|
10014
10028
|
if (t.isCubeDepthTexture !== !0 && t.version > 0 && a.__version !== t.version) {
|
|
10015
|
-
|
|
10029
|
+
le(a, t, i);
|
|
10016
10030
|
return;
|
|
10017
10031
|
}
|
|
10018
10032
|
n.bindTexture(e.TEXTURE_CUBE_MAP, a.__webglTexture, e.TEXTURE0 + i);
|
|
10019
10033
|
}
|
|
10020
|
-
let
|
|
10034
|
+
let F = {
|
|
10021
10035
|
[V]: e.REPEAT,
|
|
10022
10036
|
[ve]: e.CLAMP_TO_EDGE,
|
|
10023
10037
|
[H]: e.MIRRORED_REPEAT
|
|
10024
|
-
},
|
|
10038
|
+
}, re = {
|
|
10025
10039
|
[U]: e.NEAREST,
|
|
10026
10040
|
[ye]: e.NEAREST_MIPMAP_NEAREST,
|
|
10027
|
-
[
|
|
10028
|
-
[
|
|
10029
|
-
[
|
|
10030
|
-
[
|
|
10031
|
-
},
|
|
10041
|
+
[be]: e.NEAREST_MIPMAP_LINEAR,
|
|
10042
|
+
[xe]: e.LINEAR,
|
|
10043
|
+
[Se]: e.LINEAR_MIPMAP_NEAREST,
|
|
10044
|
+
[Ce]: e.LINEAR_MIPMAP_LINEAR
|
|
10045
|
+
}, I = {
|
|
10032
10046
|
512: e.NEVER,
|
|
10033
10047
|
519: e.ALWAYS,
|
|
10034
10048
|
513: e.LESS,
|
|
@@ -10038,8 +10052,8 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10038
10052
|
516: e.GREATER,
|
|
10039
10053
|
517: e.NOTEQUAL
|
|
10040
10054
|
};
|
|
10041
|
-
function
|
|
10042
|
-
if (a.type === 1015 && t.has("OES_texture_float_linear") === !1 && (a.magFilter === 1006 || a.magFilter === 1007 || a.magFilter === 1005 || a.magFilter === 1008 || a.minFilter === 1006 || a.minFilter === 1007 || a.minFilter === 1005 || a.minFilter === 1008) && G("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), e.texParameteri(n, e.TEXTURE_WRAP_S,
|
|
10055
|
+
function ie(n, a) {
|
|
10056
|
+
if (a.type === 1015 && t.has("OES_texture_float_linear") === !1 && (a.magFilter === 1006 || a.magFilter === 1007 || a.magFilter === 1005 || a.magFilter === 1008 || a.minFilter === 1006 || a.minFilter === 1007 || a.minFilter === 1005 || a.minFilter === 1008) && G("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), e.texParameteri(n, e.TEXTURE_WRAP_S, F[a.wrapS]), e.texParameteri(n, e.TEXTURE_WRAP_T, F[a.wrapT]), (n === e.TEXTURE_3D || n === e.TEXTURE_2D_ARRAY) && e.texParameteri(n, e.TEXTURE_WRAP_R, F[a.wrapR]), e.texParameteri(n, e.TEXTURE_MAG_FILTER, re[a.magFilter]), e.texParameteri(n, e.TEXTURE_MIN_FILTER, re[a.minFilter]), a.compareFunction && (e.texParameteri(n, e.TEXTURE_COMPARE_MODE, e.COMPARE_REF_TO_TEXTURE), e.texParameteri(n, e.TEXTURE_COMPARE_FUNC, I[a.compareFunction])), t.has("EXT_texture_filter_anisotropic") === !0) {
|
|
10043
10057
|
if (a.magFilter === 1003 || a.minFilter !== 1005 && a.minFilter !== 1008 || a.type === 1015 && t.has("OES_texture_float_linear") === !1) return;
|
|
10044
10058
|
if (a.anisotropy > 1 || r.get(a).__currentAnisotropy) {
|
|
10045
10059
|
let o = t.get("EXT_texture_filter_anisotropic");
|
|
@@ -10047,7 +10061,7 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10047
10061
|
}
|
|
10048
10062
|
}
|
|
10049
10063
|
}
|
|
10050
|
-
function
|
|
10064
|
+
function ae(t, n) {
|
|
10051
10065
|
let r = !1;
|
|
10052
10066
|
t.__webglInit === void 0 && (t.__webglInit = !0, n.addEventListener("dispose", C));
|
|
10053
10067
|
let i = n.source, a = p.get(i);
|
|
@@ -10063,18 +10077,18 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10063
10077
|
}
|
|
10064
10078
|
return r;
|
|
10065
10079
|
}
|
|
10066
|
-
function
|
|
10080
|
+
function oe(e, t, n) {
|
|
10067
10081
|
return Math.floor(Math.floor(e / n) / t);
|
|
10068
10082
|
}
|
|
10069
|
-
function
|
|
10083
|
+
function se(t, r, i, a) {
|
|
10070
10084
|
let o = t.updateRanges;
|
|
10071
10085
|
if (o.length === 0) n.texSubImage2D(e.TEXTURE_2D, 0, 0, 0, r.width, r.height, i, a, r.data);
|
|
10072
10086
|
else {
|
|
10073
10087
|
o.sort((e, t) => e.start - t.start);
|
|
10074
10088
|
let s = 0;
|
|
10075
10089
|
for (let e = 1; e < o.length; e++) {
|
|
10076
|
-
let t = o[s], n = o[e], i = t.start + t.count, a =
|
|
10077
|
-
n.start <= i + 1 && a === c &&
|
|
10090
|
+
let t = o[s], n = o[e], i = t.start + t.count, a = oe(n.start, r.width, 4), c = oe(t.start, r.width, 4);
|
|
10091
|
+
n.start <= i + 1 && a === c && oe(n.start + n.count - 1, r.width, 4) === a ? t.count = Math.max(t.count, n.start + n.count - t.start) : (++s, o[s] = n);
|
|
10078
10092
|
}
|
|
10079
10093
|
o.length = s + 1;
|
|
10080
10094
|
let c = n.getParameter(e.UNPACK_ROW_LENGTH), l = n.getParameter(e.UNPACK_SKIP_PIXELS), u = n.getParameter(e.UNPACK_SKIP_ROWS);
|
|
@@ -10086,10 +10100,10 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10086
10100
|
t.clearUpdateRanges(), n.pixelStorei(e.UNPACK_ROW_LENGTH, c), n.pixelStorei(e.UNPACK_SKIP_PIXELS, l), n.pixelStorei(e.UNPACK_SKIP_ROWS, u);
|
|
10087
10101
|
}
|
|
10088
10102
|
}
|
|
10089
|
-
function
|
|
10103
|
+
function ce(t, o, s) {
|
|
10090
10104
|
let c = e.TEXTURE_2D;
|
|
10091
10105
|
(o.isDataArrayTexture || o.isCompressedArrayTexture) && (c = e.TEXTURE_2D_ARRAY), o.isData3DTexture && (c = e.TEXTURE_3D);
|
|
10092
|
-
let l =
|
|
10106
|
+
let l = ae(t, o), u = o.source;
|
|
10093
10107
|
n.bindTexture(c, t.__webglTexture, e.TEXTURE0 + s);
|
|
10094
10108
|
let f = r.get(u);
|
|
10095
10109
|
if (u.version !== f.__version || l === !0) {
|
|
@@ -10101,14 +10115,14 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10101
10115
|
let t = g(o.image, !1, i.maxTextureSize);
|
|
10102
10116
|
t = we(o, t);
|
|
10103
10117
|
let r = a.convert(o.format, o.colorSpace), p = a.convert(o.type), m = b(o.internalFormat, r, p, o.normalized, o.colorSpace, o.isVideoTexture);
|
|
10104
|
-
|
|
10118
|
+
ie(c, o);
|
|
10105
10119
|
let h, y = o.mipmaps, C = o.isVideoTexture !== !0, w = f.__version === void 0 || l === !0, T = u.dataReady, E = S(o, t);
|
|
10106
10120
|
if (o.isDepthTexture) m = x(o.format === Be, o.type), w && (C ? n.texStorage2D(e.TEXTURE_2D, 1, m, t.width, t.height) : n.texImage2D(e.TEXTURE_2D, 0, m, t.width, t.height, 0, r, p, null));
|
|
10107
10121
|
else if (o.isDataTexture) if (y.length > 0) {
|
|
10108
10122
|
C && w && n.texStorage2D(e.TEXTURE_2D, E, m, y[0].width, y[0].height);
|
|
10109
10123
|
for (let t = 0, i = y.length; t < i; t++) h = y[t], C ? T && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, h.width, h.height, r, p, h.data) : n.texImage2D(e.TEXTURE_2D, t, m, h.width, h.height, 0, r, p, h.data);
|
|
10110
10124
|
o.generateMipmaps = !1;
|
|
10111
|
-
} else C ? (w && n.texStorage2D(e.TEXTURE_2D, E, m, t.width, t.height), T &&
|
|
10125
|
+
} else C ? (w && n.texStorage2D(e.TEXTURE_2D, E, m, t.width, t.height), T && se(o, t, r, p)) : n.texImage2D(e.TEXTURE_2D, 0, m, t.width, t.height, 0, r, p, t.data);
|
|
10112
10126
|
else if (o.isCompressedTexture) if (o.isCompressedArrayTexture) {
|
|
10113
10127
|
C && w && n.texStorage3D(e.TEXTURE_2D_ARRAY, E, m, y[0].width, y[0].height, t.depth);
|
|
10114
10128
|
for (let i = 0, a = y.length; i < a; i++) if (h = y[i], o.format !== 1023) if (r !== null) if (C) {
|
|
@@ -10175,9 +10189,9 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10175
10189
|
}
|
|
10176
10190
|
t.__version = o.version;
|
|
10177
10191
|
}
|
|
10178
|
-
function
|
|
10192
|
+
function le(t, o, s) {
|
|
10179
10193
|
if (o.image.length !== 6) return;
|
|
10180
|
-
let c =
|
|
10194
|
+
let c = ae(t, o), l = o.source;
|
|
10181
10195
|
n.bindTexture(e.TEXTURE_CUBE_MAP, t.__webglTexture, e.TEXTURE0 + s);
|
|
10182
10196
|
let u = r.get(l);
|
|
10183
10197
|
if (l.version !== u.__version || c === !0) {
|
|
@@ -10187,7 +10201,7 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10187
10201
|
let f = o.isCompressedTexture || o.image[0].isCompressedTexture, p = o.image[0] && o.image[0].isDataTexture, m = [];
|
|
10188
10202
|
for (let e = 0; e < 6; e++) !f && !p ? m[e] = g(o.image[e], !0, i.maxCubemapSize) : m[e] = p ? o.image[e].image : o.image[e], m[e] = we(o, m[e]);
|
|
10189
10203
|
let h = m[0], y = a.convert(o.format, o.colorSpace), x = a.convert(o.type), C = b(o.internalFormat, y, x, o.normalized, o.colorSpace), w = o.isVideoTexture !== !0, T = u.__version === void 0 || c === !0, E = l.dataReady, D = S(o, h);
|
|
10190
|
-
|
|
10204
|
+
ie(e.TEXTURE_CUBE_MAP, o);
|
|
10191
10205
|
let O;
|
|
10192
10206
|
if (f) {
|
|
10193
10207
|
w && T && n.texStorage2D(e.TEXTURE_CUBE_MAP, D, C, h.width, h.height);
|
|
@@ -10222,45 +10236,45 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10222
10236
|
}
|
|
10223
10237
|
t.__version = o.version;
|
|
10224
10238
|
}
|
|
10225
|
-
function
|
|
10239
|
+
function ue(t, i, o, c, l, u) {
|
|
10226
10240
|
let d = a.convert(o.format, o.colorSpace), f = a.convert(o.type), p = b(o.internalFormat, d, f, o.normalized, o.colorSpace), m = r.get(i), h = r.get(o);
|
|
10227
10241
|
if (h.__renderTarget = i, !m.__hasExternalTextures) {
|
|
10228
10242
|
let t = Math.max(1, i.width >> u), r = Math.max(1, i.height >> u);
|
|
10229
10243
|
l === e.TEXTURE_3D || l === e.TEXTURE_2D_ARRAY ? n.texImage3D(l, u, p, t, r, i.depth, 0, d, f, null) : n.texImage2D(l, u, p, t, r, 0, d, f, null);
|
|
10230
10244
|
}
|
|
10231
|
-
n.bindFramebuffer(e.FRAMEBUFFER, t),
|
|
10245
|
+
n.bindFramebuffer(e.FRAMEBUFFER, t), _e(i) ? s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER, c, l, h.__webglTexture, 0, B(i)) : (l === e.TEXTURE_2D || l >= e.TEXTURE_CUBE_MAP_POSITIVE_X && l <= e.TEXTURE_CUBE_MAP_NEGATIVE_Z) && e.framebufferTexture2D(e.FRAMEBUFFER, c, l, h.__webglTexture, u), n.bindFramebuffer(e.FRAMEBUFFER, null);
|
|
10232
10246
|
}
|
|
10233
|
-
function
|
|
10247
|
+
function de(t, n, r) {
|
|
10234
10248
|
if (e.bindRenderbuffer(e.RENDERBUFFER, t), n.depthBuffer) {
|
|
10235
10249
|
let i = n.depthTexture, a = i && i.isDepthTexture ? i.type : null, o = x(n.stencilBuffer, a), c = n.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT;
|
|
10236
|
-
|
|
10250
|
+
_e(n) ? s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER, B(n), o, n.width, n.height) : r ? e.renderbufferStorageMultisample(e.RENDERBUFFER, B(n), o, n.width, n.height) : e.renderbufferStorage(e.RENDERBUFFER, o, n.width, n.height), e.framebufferRenderbuffer(e.FRAMEBUFFER, c, e.RENDERBUFFER, t);
|
|
10237
10251
|
} else {
|
|
10238
10252
|
let t = n.textures;
|
|
10239
10253
|
for (let i = 0; i < t.length; i++) {
|
|
10240
10254
|
let o = t[i], c = a.convert(o.format, o.colorSpace), l = a.convert(o.type), u = b(o.internalFormat, c, l, o.normalized, o.colorSpace);
|
|
10241
|
-
|
|
10255
|
+
_e(n) ? s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER, B(n), u, n.width, n.height) : r ? e.renderbufferStorageMultisample(e.RENDERBUFFER, B(n), u, n.width, n.height) : e.renderbufferStorage(e.RENDERBUFFER, u, n.width, n.height);
|
|
10242
10256
|
}
|
|
10243
10257
|
}
|
|
10244
10258
|
e.bindRenderbuffer(e.RENDERBUFFER, null);
|
|
10245
10259
|
}
|
|
10246
|
-
function
|
|
10260
|
+
function fe(t, i, o) {
|
|
10247
10261
|
let c = i.isWebGLCubeRenderTarget === !0;
|
|
10248
10262
|
if (n.bindFramebuffer(e.FRAMEBUFFER, t), !(i.depthTexture && i.depthTexture.isDepthTexture)) throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
|
|
10249
10263
|
let l = r.get(i.depthTexture);
|
|
10250
10264
|
if (l.__renderTarget = i, (!l.__webglTexture || i.depthTexture.image.width !== i.width || i.depthTexture.image.height !== i.height) && (i.depthTexture.image.width = i.width, i.depthTexture.image.height = i.height, i.depthTexture.needsUpdate = !0), c) {
|
|
10251
10265
|
if (l.__webglInit === void 0 && (l.__webglInit = !0, i.depthTexture.addEventListener("dispose", C)), l.__webglTexture === void 0) {
|
|
10252
|
-
l.__webglTexture = e.createTexture(), n.bindTexture(e.TEXTURE_CUBE_MAP, l.__webglTexture),
|
|
10266
|
+
l.__webglTexture = e.createTexture(), n.bindTexture(e.TEXTURE_CUBE_MAP, l.__webglTexture), ie(e.TEXTURE_CUBE_MAP, i.depthTexture);
|
|
10253
10267
|
let t = a.convert(i.depthTexture.format), r = a.convert(i.depthTexture.type), o;
|
|
10254
10268
|
i.depthTexture.format === 1026 ? o = e.DEPTH_COMPONENT24 : i.depthTexture.format === 1027 && (o = e.DEPTH24_STENCIL8);
|
|
10255
10269
|
for (let n = 0; n < 6; n++) e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + n, 0, o, i.width, i.height, 0, t, r, null);
|
|
10256
10270
|
}
|
|
10257
10271
|
} else ee(i.depthTexture, 0);
|
|
10258
|
-
let u = l.__webglTexture, d =
|
|
10259
|
-
if (i.depthTexture.format === 1026)
|
|
10260
|
-
else if (i.depthTexture.format === 1027)
|
|
10272
|
+
let u = l.__webglTexture, d = B(i), f = c ? e.TEXTURE_CUBE_MAP_POSITIVE_X + o : e.TEXTURE_2D, p = i.depthTexture.format === 1027 ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT;
|
|
10273
|
+
if (i.depthTexture.format === 1026) _e(i) ? s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER, p, f, u, 0, d) : e.framebufferTexture2D(e.FRAMEBUFFER, p, f, u, 0);
|
|
10274
|
+
else if (i.depthTexture.format === 1027) _e(i) ? s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER, p, f, u, 0, d) : e.framebufferTexture2D(e.FRAMEBUFFER, p, f, u, 0);
|
|
10261
10275
|
else throw Error("Unknown depthTexture format");
|
|
10262
10276
|
}
|
|
10263
|
-
function
|
|
10277
|
+
function L(t) {
|
|
10264
10278
|
let i = r.get(t), a = t.isWebGLCubeRenderTarget === !0;
|
|
10265
10279
|
if (i.__boundDepthTexture !== t.depthTexture) {
|
|
10266
10280
|
let e = t.depthTexture;
|
|
@@ -10272,21 +10286,21 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10272
10286
|
}
|
|
10273
10287
|
i.__boundDepthTexture = e;
|
|
10274
10288
|
}
|
|
10275
|
-
if (t.depthTexture && !i.__autoAllocateDepthBuffer) if (a) for (let e = 0; e < 6; e++)
|
|
10289
|
+
if (t.depthTexture && !i.__autoAllocateDepthBuffer) if (a) for (let e = 0; e < 6; e++) fe(i.__webglFramebuffer[e], t, e);
|
|
10276
10290
|
else {
|
|
10277
10291
|
let e = t.texture.mipmaps;
|
|
10278
|
-
e && e.length > 0 ?
|
|
10292
|
+
e && e.length > 0 ? fe(i.__webglFramebuffer[0], t, 0) : fe(i.__webglFramebuffer, t, 0);
|
|
10279
10293
|
}
|
|
10280
10294
|
else if (a) {
|
|
10281
10295
|
i.__webglDepthbuffer = [];
|
|
10282
|
-
for (let r = 0; r < 6; r++) if (n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer[r]), i.__webglDepthbuffer[r] === void 0) i.__webglDepthbuffer[r] = e.createRenderbuffer(),
|
|
10296
|
+
for (let r = 0; r < 6; r++) if (n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer[r]), i.__webglDepthbuffer[r] === void 0) i.__webglDepthbuffer[r] = e.createRenderbuffer(), de(i.__webglDepthbuffer[r], t, !1);
|
|
10283
10297
|
else {
|
|
10284
10298
|
let n = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT, a = i.__webglDepthbuffer[r];
|
|
10285
10299
|
e.bindRenderbuffer(e.RENDERBUFFER, a), e.framebufferRenderbuffer(e.FRAMEBUFFER, n, e.RENDERBUFFER, a);
|
|
10286
10300
|
}
|
|
10287
10301
|
} else {
|
|
10288
10302
|
let r = t.texture.mipmaps;
|
|
10289
|
-
if (r && r.length > 0 ? n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer[0]) : n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer), i.__webglDepthbuffer === void 0) i.__webglDepthbuffer = e.createRenderbuffer(),
|
|
10303
|
+
if (r && r.length > 0 ? n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer[0]) : n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer), i.__webglDepthbuffer === void 0) i.__webglDepthbuffer = e.createRenderbuffer(), de(i.__webglDepthbuffer, t, !1);
|
|
10290
10304
|
else {
|
|
10291
10305
|
let n = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT, r = i.__webglDepthbuffer;
|
|
10292
10306
|
e.bindRenderbuffer(e.RENDERBUFFER, r), e.framebufferRenderbuffer(e.FRAMEBUFFER, n, e.RENDERBUFFER, r);
|
|
@@ -10294,11 +10308,11 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10294
10308
|
}
|
|
10295
10309
|
n.bindFramebuffer(e.FRAMEBUFFER, null);
|
|
10296
10310
|
}
|
|
10297
|
-
function
|
|
10311
|
+
function R(t, n, i) {
|
|
10298
10312
|
let a = r.get(t);
|
|
10299
|
-
n !== void 0 &&
|
|
10313
|
+
n !== void 0 && ue(a.__webglFramebuffer, t, t.texture, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, 0), i !== void 0 && L(t);
|
|
10300
10314
|
}
|
|
10301
|
-
function
|
|
10315
|
+
function pe(t) {
|
|
10302
10316
|
let i = t.texture, s = r.get(t), c = r.get(i);
|
|
10303
10317
|
t.addEventListener("dispose", w);
|
|
10304
10318
|
let l = t.textures, u = t.isWebGLCubeRenderTarget === !0, d = l.length > 1;
|
|
@@ -10317,37 +10331,37 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10317
10331
|
let n = r.get(l[t]);
|
|
10318
10332
|
n.__webglTexture === void 0 && (n.__webglTexture = e.createTexture(), o.memory.textures++);
|
|
10319
10333
|
}
|
|
10320
|
-
if (t.samples > 0 &&
|
|
10334
|
+
if (t.samples > 0 && _e(t) === !1) {
|
|
10321
10335
|
s.__webglMultisampledFramebuffer = e.createFramebuffer(), s.__webglColorRenderbuffer = [], n.bindFramebuffer(e.FRAMEBUFFER, s.__webglMultisampledFramebuffer);
|
|
10322
10336
|
for (let n = 0; n < l.length; n++) {
|
|
10323
10337
|
let r = l[n];
|
|
10324
10338
|
s.__webglColorRenderbuffer[n] = e.createRenderbuffer(), e.bindRenderbuffer(e.RENDERBUFFER, s.__webglColorRenderbuffer[n]);
|
|
10325
|
-
let i = a.convert(r.format, r.colorSpace), o = a.convert(r.type), c = b(r.internalFormat, i, o, r.normalized, r.colorSpace, t.isXRRenderTarget === !0), u =
|
|
10339
|
+
let i = a.convert(r.format, r.colorSpace), o = a.convert(r.type), c = b(r.internalFormat, i, o, r.normalized, r.colorSpace, t.isXRRenderTarget === !0), u = B(t);
|
|
10326
10340
|
e.renderbufferStorageMultisample(e.RENDERBUFFER, u, c, t.width, t.height), e.framebufferRenderbuffer(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + n, e.RENDERBUFFER, s.__webglColorRenderbuffer[n]);
|
|
10327
10341
|
}
|
|
10328
|
-
e.bindRenderbuffer(e.RENDERBUFFER, null), t.depthBuffer && (s.__webglDepthRenderbuffer = e.createRenderbuffer(),
|
|
10342
|
+
e.bindRenderbuffer(e.RENDERBUFFER, null), t.depthBuffer && (s.__webglDepthRenderbuffer = e.createRenderbuffer(), de(s.__webglDepthRenderbuffer, t, !0)), n.bindFramebuffer(e.FRAMEBUFFER, null);
|
|
10329
10343
|
}
|
|
10330
10344
|
}
|
|
10331
10345
|
if (u) {
|
|
10332
|
-
n.bindTexture(e.TEXTURE_CUBE_MAP, c.__webglTexture),
|
|
10333
|
-
for (let n = 0; n < 6; n++) if (i.mipmaps && i.mipmaps.length > 0) for (let r = 0; r < i.mipmaps.length; r++)
|
|
10334
|
-
else
|
|
10346
|
+
n.bindTexture(e.TEXTURE_CUBE_MAP, c.__webglTexture), ie(e.TEXTURE_CUBE_MAP, i);
|
|
10347
|
+
for (let n = 0; n < 6; n++) if (i.mipmaps && i.mipmaps.length > 0) for (let r = 0; r < i.mipmaps.length; r++) ue(s.__webglFramebuffer[n][r], t, i, e.COLOR_ATTACHMENT0, e.TEXTURE_CUBE_MAP_POSITIVE_X + n, r);
|
|
10348
|
+
else ue(s.__webglFramebuffer[n], t, i, e.COLOR_ATTACHMENT0, e.TEXTURE_CUBE_MAP_POSITIVE_X + n, 0);
|
|
10335
10349
|
_(i) && v(e.TEXTURE_CUBE_MAP), n.unbindTexture();
|
|
10336
10350
|
} else if (d) {
|
|
10337
10351
|
for (let i = 0, a = l.length; i < a; i++) {
|
|
10338
10352
|
let a = l[i], o = r.get(a), c = e.TEXTURE_2D;
|
|
10339
|
-
(t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (c = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(c, o.__webglTexture),
|
|
10353
|
+
(t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (c = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(c, o.__webglTexture), ie(c, a), ue(s.__webglFramebuffer, t, a, e.COLOR_ATTACHMENT0 + i, c, 0), _(a) && v(c);
|
|
10340
10354
|
}
|
|
10341
10355
|
n.unbindTexture();
|
|
10342
10356
|
} else {
|
|
10343
10357
|
let r = e.TEXTURE_2D;
|
|
10344
|
-
if ((t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (r = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(r, c.__webglTexture),
|
|
10345
|
-
else
|
|
10358
|
+
if ((t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (r = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(r, c.__webglTexture), ie(r, i), i.mipmaps && i.mipmaps.length > 0) for (let n = 0; n < i.mipmaps.length; n++) ue(s.__webglFramebuffer[n], t, i, e.COLOR_ATTACHMENT0, r, n);
|
|
10359
|
+
else ue(s.__webglFramebuffer, t, i, e.COLOR_ATTACHMENT0, r, 0);
|
|
10346
10360
|
_(i) && v(r), n.unbindTexture();
|
|
10347
10361
|
}
|
|
10348
|
-
t.depthBuffer &&
|
|
10362
|
+
t.depthBuffer && L(t);
|
|
10349
10363
|
}
|
|
10350
|
-
function
|
|
10364
|
+
function me(e) {
|
|
10351
10365
|
let t = e.textures;
|
|
10352
10366
|
for (let i = 0, a = t.length; i < a; i++) {
|
|
10353
10367
|
let a = t[i];
|
|
@@ -10357,10 +10371,10 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10357
10371
|
}
|
|
10358
10372
|
}
|
|
10359
10373
|
}
|
|
10360
|
-
let
|
|
10361
|
-
function
|
|
10374
|
+
let he = [], z = [];
|
|
10375
|
+
function ge(t) {
|
|
10362
10376
|
if (t.samples > 0) {
|
|
10363
|
-
if (
|
|
10377
|
+
if (_e(t) === !1) {
|
|
10364
10378
|
let i = t.textures, a = t.width, o = t.height, s = e.COLOR_BUFFER_BIT, l = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT, u = r.get(t), d = i.length > 1;
|
|
10365
10379
|
if (d) for (let t = 0; t < i.length; t++) n.bindFramebuffer(e.FRAMEBUFFER, u.__webglMultisampledFramebuffer), e.framebufferRenderbuffer(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.RENDERBUFFER, null), n.bindFramebuffer(e.FRAMEBUFFER, u.__webglFramebuffer), e.framebufferTexture2D(e.DRAW_FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.TEXTURE_2D, null, 0);
|
|
10366
10380
|
n.bindFramebuffer(e.READ_FRAMEBUFFER, u.__webglMultisampledFramebuffer);
|
|
@@ -10372,7 +10386,7 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10372
10386
|
let t = r.get(i[n]).__webglTexture;
|
|
10373
10387
|
e.framebufferTexture2D(e.DRAW_FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, t, 0);
|
|
10374
10388
|
}
|
|
10375
|
-
e.blitFramebuffer(0, 0, a, o, 0, 0, a, o, s, e.NEAREST), c === !0 && (
|
|
10389
|
+
e.blitFramebuffer(0, 0, a, o, 0, 0, a, o, s, e.NEAREST), c === !0 && (he.length = 0, z.length = 0, he.push(e.COLOR_ATTACHMENT0 + n), t.depthBuffer && t.resolveDepthBuffer === !1 && (he.push(l), z.push(l), e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER, z)), e.invalidateFramebuffer(e.READ_FRAMEBUFFER, he));
|
|
10376
10390
|
}
|
|
10377
10391
|
if (n.bindFramebuffer(e.READ_FRAMEBUFFER, null), n.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), d) for (let t = 0; t < i.length; t++) {
|
|
10378
10392
|
n.bindFramebuffer(e.FRAMEBUFFER, u.__webglMultisampledFramebuffer), e.framebufferRenderbuffer(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.RENDERBUFFER, u.__webglColorRenderbuffer[t]);
|
|
@@ -10386,14 +10400,14 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10386
10400
|
}
|
|
10387
10401
|
}
|
|
10388
10402
|
}
|
|
10389
|
-
function
|
|
10403
|
+
function B(e) {
|
|
10390
10404
|
return Math.min(i.maxSamples, e.samples);
|
|
10391
10405
|
}
|
|
10392
|
-
function
|
|
10406
|
+
function _e(e) {
|
|
10393
10407
|
let n = r.get(e);
|
|
10394
10408
|
return e.samples > 0 && t.has("WEBGL_multisampled_render_to_texture") === !0 && n.__useRenderToTexture !== !1;
|
|
10395
10409
|
}
|
|
10396
|
-
function
|
|
10410
|
+
function W(e) {
|
|
10397
10411
|
let t = o.render.frame;
|
|
10398
10412
|
u.get(e) !== t && (u.set(e, t), e.update());
|
|
10399
10413
|
}
|
|
@@ -10404,7 +10418,7 @@ function iu(e, t, n, r, i, a, o) {
|
|
|
10404
10418
|
function Te(e) {
|
|
10405
10419
|
return typeof HTMLImageElement < "u" && e instanceof HTMLImageElement ? (l.width = e.naturalWidth || e.width, l.height = e.naturalHeight || e.height) : typeof VideoFrame < "u" && e instanceof VideoFrame ? (l.width = e.displayWidth, l.height = e.displayHeight) : (l.width = e.width, l.height = e.height), l;
|
|
10406
10420
|
}
|
|
10407
|
-
this.allocateTextureUnit = M, this.resetTextureUnits = k, this.getTextureUnits = A, this.setTextureUnits = j, this.setTexture2D = ee, this.setTexture2DArray = te, this.setTexture3D = P, this.setTextureCube = ne, this.rebindTextures =
|
|
10421
|
+
this.allocateTextureUnit = M, this.resetTextureUnits = k, this.getTextureUnits = A, this.setTextureUnits = j, this.setTexture2D = ee, this.setTexture2DArray = te, this.setTexture3D = P, this.setTextureCube = ne, this.rebindTextures = R, this.setupRenderTarget = pe, this.updateRenderTargetMipmap = me, this.updateMultisampleRenderTarget = ge, this.setupDepthRenderbuffer = L, this.setupFrameBufferTexture = ue, this.useMultisampledRTT = _e, this.isReversedDepthBuffer = function() {
|
|
10408
10422
|
return n.buffers.depth.getReversed();
|
|
10409
10423
|
};
|
|
10410
10424
|
}
|
|
@@ -10556,7 +10570,7 @@ var ou = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", su = "
|
|
|
10556
10570
|
}
|
|
10557
10571
|
O = null, k = null, h.reset();
|
|
10558
10572
|
for (let e in g) delete g[e];
|
|
10559
|
-
e.setRenderTarget(v), f = null, d = null, u = null, r = null, y = null,
|
|
10573
|
+
e.setRenderTarget(v), f = null, d = null, u = null, r = null, y = null, I.stop(), n.isPresenting = !1, e.setPixelRatio(C), e.setSize(S.width, S.height, !1), n.dispatchEvent({ type: "sessionend" });
|
|
10560
10574
|
}
|
|
10561
10575
|
this.setFramebufferScaleFactor = function(e) {
|
|
10562
10576
|
i = e, n.isPresenting === !0 && G("WebXRManager: Cannot change framebuffer scale while presenting.");
|
|
@@ -10586,7 +10600,7 @@ var ou = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", su = "
|
|
|
10586
10600
|
};
|
|
10587
10601
|
u = this.getBinding(), d = u.createProjectionLayer(s), r.updateRenderState({ layers: [d] }), e.setPixelRatio(1), e.setSize(d.textureWidth, d.textureHeight, !1), y = new Zn(d.textureWidth, d.textureHeight, {
|
|
10588
10602
|
format: Re,
|
|
10589
|
-
type:
|
|
10603
|
+
type: W,
|
|
10590
10604
|
depthTexture: new wa(d.textureWidth, d.textureHeight, a, void 0, void 0, void 0, void 0, void 0, void 0, n),
|
|
10591
10605
|
stencilBuffer: _.stencil,
|
|
10592
10606
|
colorSpace: e.outputColorSpace,
|
|
@@ -10604,14 +10618,14 @@ var ou = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", su = "
|
|
|
10604
10618
|
};
|
|
10605
10619
|
f = new XRWebGLLayer(r, t, n), r.updateRenderState({ baseLayer: f }), e.setPixelRatio(1), e.setSize(f.framebufferWidth, f.framebufferHeight, !1), y = new Zn(f.framebufferWidth, f.framebufferHeight, {
|
|
10606
10620
|
format: Re,
|
|
10607
|
-
type:
|
|
10621
|
+
type: W,
|
|
10608
10622
|
colorSpace: e.outputColorSpace,
|
|
10609
10623
|
stencilBuffer: _.stencil,
|
|
10610
10624
|
resolveDepthBuffer: f.ignoreDepthValues === !1,
|
|
10611
10625
|
resolveStencilBuffer: f.ignoreDepthValues === !1
|
|
10612
10626
|
});
|
|
10613
10627
|
}
|
|
10614
|
-
y.isXRRenderTarget = !0, this.setFoveation(s), c = null, a = await r.requestReferenceSpace(o),
|
|
10628
|
+
y.isXRRenderTarget = !0, this.setFoveation(s), c = null, a = await r.requestReferenceSpace(o), I.setContext(r), I.start(), n.isPresenting = !0, n.dispatchEvent({ type: "sessionstart" });
|
|
10615
10629
|
}
|
|
10616
10630
|
}, this.getEnvironmentBlendMode = function() {
|
|
10617
10631
|
if (r !== null) return r.environmentBlendMode;
|
|
@@ -10680,8 +10694,8 @@ var ou = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", su = "
|
|
|
10680
10694
|
}, this.getCameraTexture = function(e) {
|
|
10681
10695
|
return g[e];
|
|
10682
10696
|
};
|
|
10683
|
-
let
|
|
10684
|
-
function
|
|
10697
|
+
let F = null;
|
|
10698
|
+
function re(t, i) {
|
|
10685
10699
|
if (l = i.getViewerPose(c || a), p = i, l !== null) {
|
|
10686
10700
|
let t = l.views;
|
|
10687
10701
|
f !== null && (e.setRenderTargetFramebuffer(y, f.framebuffer), e.setRenderTarget(y));
|
|
@@ -10720,14 +10734,14 @@ var ou = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", su = "
|
|
|
10720
10734
|
let t = x[e], n = b[e];
|
|
10721
10735
|
t !== null && n !== void 0 && n.update(t, i, c || a);
|
|
10722
10736
|
}
|
|
10723
|
-
|
|
10737
|
+
F && F(t, i), i.detectedPlanes && n.dispatchEvent({
|
|
10724
10738
|
type: "planesdetected",
|
|
10725
10739
|
data: i
|
|
10726
10740
|
}), p = null;
|
|
10727
10741
|
}
|
|
10728
|
-
let
|
|
10729
|
-
|
|
10730
|
-
|
|
10742
|
+
let I = new ns();
|
|
10743
|
+
I.setAnimationLoop(re), this.setAnimationLoop = function(e) {
|
|
10744
|
+
F = e;
|
|
10731
10745
|
}, this.dispose = function() {};
|
|
10732
10746
|
}
|
|
10733
10747
|
}, uu = /*@__PURE__*/ new er(), du = /*@__PURE__*/ new Y();
|
|
@@ -11391,11 +11405,11 @@ var mu = new Uint16Array([
|
|
|
11391
11405
|
1183
|
|
11392
11406
|
]), hu = null;
|
|
11393
11407
|
function gu() {
|
|
11394
|
-
return hu === null && (hu = new ta(mu, 16, 16, Ue, Ae), hu.name = "DFG_LUT", hu.minFilter =
|
|
11408
|
+
return hu === null && (hu = new ta(mu, 16, 16, Ue, Ae), hu.name = "DFG_LUT", hu.minFilter = xe, hu.magFilter = xe, hu.wrapS = ve, hu.wrapT = ve, hu.generateMipmaps = !1, hu.needsUpdate = !0), hu;
|
|
11395
11409
|
}
|
|
11396
11410
|
var _u = class {
|
|
11397
11411
|
constructor(e = {}) {
|
|
11398
|
-
let { canvas: t = Jt(), context: n = null, depth: r = !0, stencil: i = !1, alpha: a = !1, antialias: o = !1, premultipliedAlpha: s = !0, preserveDrawingBuffer: c = !1, powerPreference: l = "default", failIfMajorPerformanceCaveat: u = !1, reversedDepthBuffer: d = !1, outputBufferType: f =
|
|
11412
|
+
let { canvas: t = Jt(), context: n = null, depth: r = !0, stencil: i = !1, alpha: a = !1, antialias: o = !1, premultipliedAlpha: s = !0, preserveDrawingBuffer: c = !1, powerPreference: l = "default", failIfMajorPerformanceCaveat: u = !1, reversedDepthBuffer: d = !1, outputBufferType: f = W } = e;
|
|
11399
11413
|
this.isWebGLRenderer = !0;
|
|
11400
11414
|
let p;
|
|
11401
11415
|
if (n !== null) {
|
|
@@ -11407,7 +11421,7 @@ var _u = class {
|
|
|
11407
11421
|
We,
|
|
11408
11422
|
He
|
|
11409
11423
|
]), g = /* @__PURE__ */ new Set([
|
|
11410
|
-
|
|
11424
|
+
W,
|
|
11411
11425
|
Oe,
|
|
11412
11426
|
Ee,
|
|
11413
11427
|
Ne,
|
|
@@ -11420,18 +11434,18 @@ var _u = class {
|
|
|
11420
11434
|
}, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = 0, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;
|
|
11421
11435
|
let T = this, E = !1, D = null;
|
|
11422
11436
|
this._outputColorSpace = It;
|
|
11423
|
-
let O = 0, k = 0, A = null, j = -1, M = null, N = new Yn(), ee = new Yn(), te = null, P = new X(0), ne = 0,
|
|
11437
|
+
let O = 0, k = 0, A = null, j = -1, M = null, N = new Yn(), ee = new Yn(), te = null, P = new X(0), ne = 0, F = t.width, re = t.height, I = 1, ie = null, ae = null, oe = new Yn(0, 0, F, re), se = new Yn(0, 0, F, re), ce = !1, le = new la(), ue = !1, de = !1, fe = new er(), L = new J(), R = new Yn(), pe = {
|
|
11424
11438
|
background: null,
|
|
11425
11439
|
fog: null,
|
|
11426
11440
|
environment: null,
|
|
11427
11441
|
overrideMaterial: null,
|
|
11428
11442
|
isScene: !0
|
|
11429
|
-
},
|
|
11430
|
-
function
|
|
11431
|
-
return A === null ?
|
|
11443
|
+
}, me = !1;
|
|
11444
|
+
function he() {
|
|
11445
|
+
return A === null ? I : 1;
|
|
11432
11446
|
}
|
|
11433
|
-
let
|
|
11434
|
-
function
|
|
11447
|
+
let z = n;
|
|
11448
|
+
function ge(e, n) {
|
|
11435
11449
|
return t.getContext(e, n);
|
|
11436
11450
|
}
|
|
11437
11451
|
try {
|
|
@@ -11445,45 +11459,45 @@ var _u = class {
|
|
|
11445
11459
|
powerPreference: l,
|
|
11446
11460
|
failIfMajorPerformanceCaveat: u
|
|
11447
11461
|
};
|
|
11448
|
-
if ("setAttribute" in t && t.setAttribute("data-engine", "three.js r184"), t.addEventListener("webglcontextlost", Je, !1), t.addEventListener("webglcontextrestored", Ye, !1), t.addEventListener("webglcontextcreationerror", Xe, !1),
|
|
11462
|
+
if ("setAttribute" in t && t.setAttribute("data-engine", "three.js r184"), t.addEventListener("webglcontextlost", Je, !1), t.addEventListener("webglcontextrestored", Ye, !1), t.addEventListener("webglcontextcreationerror", Xe, !1), z === null) {
|
|
11449
11463
|
let t = "webgl2";
|
|
11450
|
-
if (
|
|
11464
|
+
if (z = ge(t, e), z === null) throw ge(t) ? Error("Error creating WebGL context with your selected attributes.") : Error("Error creating WebGL context.");
|
|
11451
11465
|
}
|
|
11452
11466
|
} catch (e) {
|
|
11453
11467
|
throw K("WebGLRenderer: " + e.message), e;
|
|
11454
11468
|
}
|
|
11455
|
-
let
|
|
11469
|
+
let B, _e, V, ve, H, U, ye, be, xe, Se, we, Te, De, ke, Pe, Fe, Ie, Le, Re, ze, Be, Ve, Ue;
|
|
11456
11470
|
function Ke() {
|
|
11457
|
-
|
|
11471
|
+
B = new Fs(z), B.init(), Be = new au(z, B), _e = new ds(z, B, e, Be), V = new ru(z, B), _e.reversedDepthBuffer && d && V.buffers.depth.setReversed(!0), ve = new Rs(z), H = new Ll(), U = new iu(z, B, V, H, _e, Be, ve), ye = new Ps(T), be = new rs(z), Ve = new ls(z, be), xe = new Is(z, be, ve, Ve), Se = new Bs(z, xe, be, Ve, ve), Le = new zs(z, _e, U), Pe = new fs(H), we = new Il(T, ye, B, _e, Ve, Pe), Te = new fu(T, H), De = new Vl(), ke = new Jl(B), Ie = new cs(T, ye, V, Se, p, s), Fe = new nu(T, Se, _e), Ue = new pu(z, ve, _e, V), Re = new us(z, B, ve), ze = new Ls(z, B, ve), ve.programs = we.programs, T.capabilities = _e, T.extensions = B, T.properties = H, T.renderLists = De, T.shadowMap = Fe, T.state = V, T.info = ve;
|
|
11458
11472
|
}
|
|
11459
11473
|
Ke(), m !== 1009 && (w = new Hs(m, t.width, t.height, r, i));
|
|
11460
|
-
let qe = new lu(T,
|
|
11474
|
+
let qe = new lu(T, z);
|
|
11461
11475
|
this.xr = qe, this.getContext = function() {
|
|
11462
|
-
return
|
|
11476
|
+
return z;
|
|
11463
11477
|
}, this.getContextAttributes = function() {
|
|
11464
|
-
return
|
|
11478
|
+
return z.getContextAttributes();
|
|
11465
11479
|
}, this.forceContextLoss = function() {
|
|
11466
|
-
let e =
|
|
11480
|
+
let e = B.get("WEBGL_lose_context");
|
|
11467
11481
|
e && e.loseContext();
|
|
11468
11482
|
}, this.forceContextRestore = function() {
|
|
11469
|
-
let e =
|
|
11483
|
+
let e = B.get("WEBGL_lose_context");
|
|
11470
11484
|
e && e.restoreContext();
|
|
11471
11485
|
}, this.getPixelRatio = function() {
|
|
11472
|
-
return
|
|
11486
|
+
return I;
|
|
11473
11487
|
}, this.setPixelRatio = function(e) {
|
|
11474
|
-
e !== void 0 && (
|
|
11488
|
+
e !== void 0 && (I = e, this.setSize(F, re, !1));
|
|
11475
11489
|
}, this.getSize = function(e) {
|
|
11476
|
-
return e.set(
|
|
11490
|
+
return e.set(F, re);
|
|
11477
11491
|
}, this.setSize = function(e, n, r = !0) {
|
|
11478
11492
|
if (qe.isPresenting) {
|
|
11479
11493
|
G("WebGLRenderer: Can't change size while VR device is presenting.");
|
|
11480
11494
|
return;
|
|
11481
11495
|
}
|
|
11482
|
-
|
|
11496
|
+
F = e, re = n, t.width = Math.floor(e * I), t.height = Math.floor(n * I), r === !0 && (t.style.width = e + "px", t.style.height = n + "px"), w !== null && w.setSize(t.width, t.height), this.setViewport(0, 0, e, n);
|
|
11483
11497
|
}, this.getDrawingBufferSize = function(e) {
|
|
11484
|
-
return e.set(
|
|
11498
|
+
return e.set(F * I, re * I).floor();
|
|
11485
11499
|
}, this.setDrawingBufferSize = function(e, n, r) {
|
|
11486
|
-
|
|
11500
|
+
F = e, re = n, I = r, t.width = Math.floor(e * r), t.height = Math.floor(n * r), this.setViewport(0, 0, e, n);
|
|
11487
11501
|
}, this.setEffects = function(e) {
|
|
11488
11502
|
if (m === 1009) {
|
|
11489
11503
|
K("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");
|
|
@@ -11499,21 +11513,21 @@ var _u = class {
|
|
|
11499
11513
|
}, this.getCurrentViewport = function(e) {
|
|
11500
11514
|
return e.copy(N);
|
|
11501
11515
|
}, this.getViewport = function(e) {
|
|
11502
|
-
return e.copy(
|
|
11516
|
+
return e.copy(oe);
|
|
11503
11517
|
}, this.setViewport = function(e, t, n, r) {
|
|
11504
|
-
e.isVector4 ?
|
|
11518
|
+
e.isVector4 ? oe.set(e.x, e.y, e.z, e.w) : oe.set(e, t, n, r), V.viewport(N.copy(oe).multiplyScalar(I).round());
|
|
11505
11519
|
}, this.getScissor = function(e) {
|
|
11506
|
-
return e.copy(
|
|
11520
|
+
return e.copy(se);
|
|
11507
11521
|
}, this.setScissor = function(e, t, n, r) {
|
|
11508
|
-
e.isVector4 ?
|
|
11522
|
+
e.isVector4 ? se.set(e.x, e.y, e.z, e.w) : se.set(e, t, n, r), V.scissor(ee.copy(se).multiplyScalar(I).round());
|
|
11509
11523
|
}, this.getScissorTest = function() {
|
|
11510
|
-
return
|
|
11524
|
+
return ce;
|
|
11511
11525
|
}, this.setScissorTest = function(e) {
|
|
11512
|
-
V.setScissorTest(
|
|
11526
|
+
V.setScissorTest(ce = e);
|
|
11513
11527
|
}, this.setOpaqueSort = function(e) {
|
|
11514
|
-
|
|
11528
|
+
ie = e;
|
|
11515
11529
|
}, this.setTransparentSort = function(e) {
|
|
11516
|
-
|
|
11530
|
+
ae = e;
|
|
11517
11531
|
}, this.getClearColor = function(e) {
|
|
11518
11532
|
return e.copy(Ie.getClearColor());
|
|
11519
11533
|
}, this.setClearColor = function() {
|
|
@@ -11532,10 +11546,10 @@ var _u = class {
|
|
|
11532
11546
|
}
|
|
11533
11547
|
if (e) {
|
|
11534
11548
|
let e = A.texture.type, t = g.has(e), n = Ie.getClearColor(), r = Ie.getClearAlpha(), i = n.r, a = n.g, o = n.b;
|
|
11535
|
-
t ? (_[0] = i, _[1] = a, _[2] = o, _[3] = r,
|
|
11536
|
-
} else r |=
|
|
11549
|
+
t ? (_[0] = i, _[1] = a, _[2] = o, _[3] = r, z.clearBufferuiv(z.COLOR, 0, _)) : (v[0] = i, v[1] = a, v[2] = o, v[3] = r, z.clearBufferiv(z.COLOR, 0, v));
|
|
11550
|
+
} else r |= z.COLOR_BUFFER_BIT;
|
|
11537
11551
|
}
|
|
11538
|
-
t && (r |=
|
|
11552
|
+
t && (r |= z.DEPTH_BUFFER_BIT, this.state.buffers.depth.setMask(!0)), n && (r |= z.STENCIL_BUFFER_BIT, this.state.buffers.stencil.setMask(4294967295)), r !== 0 && z.clear(r);
|
|
11539
11553
|
}, this.clearColor = function() {
|
|
11540
11554
|
this.clear(!0, !1, !1);
|
|
11541
11555
|
}, this.clearDepth = function() {
|
|
@@ -11545,7 +11559,7 @@ var _u = class {
|
|
|
11545
11559
|
}, this.setNodesHandler = function(e) {
|
|
11546
11560
|
e.setRenderer(this), D = e;
|
|
11547
11561
|
}, this.dispose = function() {
|
|
11548
|
-
t.removeEventListener("webglcontextlost", Je, !1), t.removeEventListener("webglcontextrestored", Ye, !1), t.removeEventListener("webglcontextcreationerror", Xe, !1), Ie.dispose(), De.dispose(), ke.dispose(), H.dispose(), ye.dispose(),
|
|
11562
|
+
t.removeEventListener("webglcontextlost", Je, !1), t.removeEventListener("webglcontextrestored", Ye, !1), t.removeEventListener("webglcontextcreationerror", Xe, !1), Ie.dispose(), De.dispose(), ke.dispose(), H.dispose(), ye.dispose(), Se.dispose(), Ve.dispose(), Ue.dispose(), we.dispose(), qe.dispose(), qe.removeEventListener("sessionstart", rt), qe.removeEventListener("sessionend", it), at.stop();
|
|
11549
11563
|
};
|
|
11550
11564
|
function Je(e) {
|
|
11551
11565
|
e.preventDefault(), Zt("WebGLRenderer: Context Lost."), E = !0;
|
|
@@ -11572,12 +11586,12 @@ var _u = class {
|
|
|
11572
11586
|
}), e.isShaderMaterial && we.releaseShaderCache(e));
|
|
11573
11587
|
}
|
|
11574
11588
|
this.renderBufferDirect = function(e, t, n, r, i, a) {
|
|
11575
|
-
t === null && (t =
|
|
11589
|
+
t === null && (t = pe);
|
|
11576
11590
|
let o = i.isMesh && i.matrixWorld.determinant() < 0, s = ht(e, t, n, r, i);
|
|
11577
11591
|
V.setMaterial(r, o);
|
|
11578
11592
|
let c = n.index, l = 1;
|
|
11579
11593
|
if (r.wireframe === !0) {
|
|
11580
|
-
if (c =
|
|
11594
|
+
if (c = xe.getWireframeAttribute(n), c === void 0) return;
|
|
11581
11595
|
l = 2;
|
|
11582
11596
|
}
|
|
11583
11597
|
let u = n.drawRange, d = n.attributes.position, f = u.start * l, p = (u.start + u.count) * l;
|
|
@@ -11586,15 +11600,15 @@ var _u = class {
|
|
|
11586
11600
|
if (m < 0 || m === Infinity) return;
|
|
11587
11601
|
Ve.setup(i, r, s, n, c);
|
|
11588
11602
|
let h, g = Re;
|
|
11589
|
-
if (c !== null && (h =
|
|
11603
|
+
if (c !== null && (h = be.get(c), g = ze, g.setIndex(h)), i.isMesh) r.wireframe === !0 ? (V.setLineWidth(r.wireframeLinewidth * he()), g.setMode(z.LINES)) : g.setMode(z.TRIANGLES);
|
|
11590
11604
|
else if (i.isLine) {
|
|
11591
11605
|
let e = r.linewidth;
|
|
11592
|
-
e === void 0 && (e = 1), V.setLineWidth(e *
|
|
11593
|
-
} else i.isPoints ? g.setMode(
|
|
11594
|
-
if (i.isBatchedMesh) if (
|
|
11606
|
+
e === void 0 && (e = 1), V.setLineWidth(e * he()), i.isLineSegments ? g.setMode(z.LINES) : i.isLineLoop ? g.setMode(z.LINE_LOOP) : g.setMode(z.LINE_STRIP);
|
|
11607
|
+
} else i.isPoints ? g.setMode(z.POINTS) : i.isSprite && g.setMode(z.TRIANGLES);
|
|
11608
|
+
if (i.isBatchedMesh) if (B.get("WEBGL_multi_draw")) g.renderMultiDraw(i._multiDrawStarts, i._multiDrawCounts, i._multiDrawCount);
|
|
11595
11609
|
else {
|
|
11596
|
-
let e = i._multiDrawStarts, t = i._multiDrawCounts, n = i._multiDrawCount, a = c ?
|
|
11597
|
-
for (let r = 0; r < n; r++) o.setValue(
|
|
11610
|
+
let e = i._multiDrawStarts, t = i._multiDrawCounts, n = i._multiDrawCount, a = c ? be.get(c).bytesPerElement : 1, o = H.get(r).currentProgram.getUniforms();
|
|
11611
|
+
for (let r = 0; r < n; r++) o.setValue(z, "_gl_DrawID", r), g.render(e[r] / a, t[r]);
|
|
11598
11612
|
}
|
|
11599
11613
|
else if (i.isInstancedMesh) g.renderInstances(f, m, i.count);
|
|
11600
11614
|
else if (n.isInstancedBufferGeometry) {
|
|
@@ -11633,7 +11647,7 @@ var _u = class {
|
|
|
11633
11647
|
}
|
|
11634
11648
|
setTimeout(n, 10);
|
|
11635
11649
|
}
|
|
11636
|
-
|
|
11650
|
+
B.get("KHR_parallel_shader_compile") === null ? setTimeout(n, 10) : n();
|
|
11637
11651
|
});
|
|
11638
11652
|
};
|
|
11639
11653
|
let tt = null;
|
|
@@ -11657,13 +11671,13 @@ var _u = class {
|
|
|
11657
11671
|
if (E === !0) return;
|
|
11658
11672
|
D !== null && D.renderStart(e, t);
|
|
11659
11673
|
let n = qe.enabled === !0 && qe.isPresenting === !0, r = w !== null && (A === null || n) && w.begin(T, A);
|
|
11660
|
-
if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), qe.enabled === !0 && qe.isPresenting === !0 && (w === null || w.isCompositing() === !1) && (qe.cameraAutoUpdate === !0 && qe.updateCamera(t), t = qe.getCamera()), e.isScene === !0 && e.onBeforeRender(T, e, t, A), x = ke.get(e, C.length), x.init(t), x.state.textureUnits = U.getTextureUnits(), C.push(x),
|
|
11674
|
+
if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), qe.enabled === !0 && qe.isPresenting === !0 && (w === null || w.isCompositing() === !1) && (qe.cameraAutoUpdate === !0 && qe.updateCamera(t), t = qe.getCamera()), e.isScene === !0 && e.onBeforeRender(T, e, t, A), x = ke.get(e, C.length), x.init(t), x.state.textureUnits = U.getTextureUnits(), C.push(x), fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), le.setFromProjectionMatrix(fe, Ut, t.reversedDepth), de = this.localClippingEnabled, ue = Pe.init(this.clippingPlanes, de), b = De.get(e, S.length), b.init(), S.push(b), qe.enabled === !0 && qe.isPresenting === !0) {
|
|
11661
11675
|
let e = T.xr.getDepthSensingMesh();
|
|
11662
11676
|
e !== null && ot(e, t, -Infinity, T.sortObjects);
|
|
11663
11677
|
}
|
|
11664
|
-
ot(e, t, 0, T.sortObjects), b.finish(), T.sortObjects === !0 && b.sort(
|
|
11678
|
+
ot(e, t, 0, T.sortObjects), b.finish(), T.sortObjects === !0 && b.sort(ie, ae), me = qe.enabled === !1 || qe.isPresenting === !1 || qe.hasDepthSensing() === !1, me && Ie.addToRenderList(b, e), this.info.render.frame++, ue === !0 && Pe.beginShadows();
|
|
11665
11679
|
let i = x.state.shadowsArray;
|
|
11666
|
-
if (Fe.render(i, e, t),
|
|
11680
|
+
if (Fe.render(i, e, t), ue === !0 && Pe.endShadows(), this.info.autoReset === !0 && this.info.reset(), (r && w.hasRenderPass()) === !1) {
|
|
11667
11681
|
let n = b.opaque, r = b.transmissive;
|
|
11668
11682
|
if (x.setupLights(), t.isArrayCamera) {
|
|
11669
11683
|
let i = t.cameras;
|
|
@@ -11671,14 +11685,14 @@ var _u = class {
|
|
|
11671
11685
|
let a = i[t];
|
|
11672
11686
|
ct(n, r, e, a);
|
|
11673
11687
|
}
|
|
11674
|
-
|
|
11688
|
+
me && Ie.render(e);
|
|
11675
11689
|
for (let t = 0, n = i.length; t < n; t++) {
|
|
11676
11690
|
let n = i[t];
|
|
11677
11691
|
st(b, e, n, n.viewport);
|
|
11678
11692
|
}
|
|
11679
|
-
} else r.length > 0 && ct(n, r, e, t),
|
|
11693
|
+
} else r.length > 0 && ct(n, r, e, t), me && Ie.render(e), st(b, e, t);
|
|
11680
11694
|
}
|
|
11681
|
-
A !== null && k === 0 && (U.updateMultisampleRenderTarget(A), U.updateRenderTargetMipmap(A)), r && w.end(T), e.isScene === !0 && e.onAfterRender(T, e, t), Ve.resetDefaultState(), j = -1, M = null, C.pop(), C.length > 0 ? (x = C[C.length - 1], U.setTextureUnits(x.state.textureUnits),
|
|
11695
|
+
A !== null && k === 0 && (U.updateMultisampleRenderTarget(A), U.updateRenderTargetMipmap(A)), r && w.end(T), e.isScene === !0 && e.onAfterRender(T, e, t), Ve.resetDefaultState(), j = -1, M = null, C.pop(), C.length > 0 ? (x = C[C.length - 1], U.setTextureUnits(x.state.textureUnits), ue === !0 && Pe.setGlobalState(T.clippingPlanes, x.state.camera)) : x = null, S.pop(), b = S.length > 0 ? S[S.length - 1] : null, D !== null && D.renderEnd();
|
|
11682
11696
|
};
|
|
11683
11697
|
function ot(e, t, n, r) {
|
|
11684
11698
|
if (e.visible === !1) return;
|
|
@@ -11688,20 +11702,20 @@ var _u = class {
|
|
|
11688
11702
|
else if (e.isLightProbeGrid) x.pushLightProbeGrid(e);
|
|
11689
11703
|
else if (e.isLight) x.pushLight(e), e.castShadow && x.pushShadow(e);
|
|
11690
11704
|
else if (e.isSprite) {
|
|
11691
|
-
if (!e.frustumCulled ||
|
|
11692
|
-
r &&
|
|
11693
|
-
let t =
|
|
11694
|
-
i.visible && b.push(e, t, i, n,
|
|
11705
|
+
if (!e.frustumCulled || le.intersectsSprite(e)) {
|
|
11706
|
+
r && R.setFromMatrixPosition(e.matrixWorld).applyMatrix4(fe);
|
|
11707
|
+
let t = Se.update(e), i = e.material;
|
|
11708
|
+
i.visible && b.push(e, t, i, n, R.z, null);
|
|
11695
11709
|
}
|
|
11696
|
-
} else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled ||
|
|
11697
|
-
let t =
|
|
11698
|
-
if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(),
|
|
11710
|
+
} else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || le.intersectsObject(e))) {
|
|
11711
|
+
let t = Se.update(e), i = e.material;
|
|
11712
|
+
if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(), R.copy(t.boundingSphere.center)) : (e.boundingSphere === null && e.computeBoundingSphere(), R.copy(e.boundingSphere.center)), R.applyMatrix4(e.matrixWorld).applyMatrix4(fe)), Array.isArray(i)) {
|
|
11699
11713
|
let r = t.groups;
|
|
11700
11714
|
for (let a = 0, o = r.length; a < o; a++) {
|
|
11701
11715
|
let o = r[a], s = i[o.materialIndex];
|
|
11702
|
-
s && s.visible && b.push(e, t, s, n,
|
|
11716
|
+
s && s.visible && b.push(e, t, s, n, R.z, o);
|
|
11703
11717
|
}
|
|
11704
|
-
} else i.visible && b.push(e, t, i, n,
|
|
11718
|
+
} else i.visible && b.push(e, t, i, n, R.z, null);
|
|
11705
11719
|
}
|
|
11706
11720
|
}
|
|
11707
11721
|
let i = e.children;
|
|
@@ -11709,17 +11723,17 @@ var _u = class {
|
|
|
11709
11723
|
}
|
|
11710
11724
|
function st(e, t, n, r) {
|
|
11711
11725
|
let { opaque: i, transmissive: a, transparent: o } = e;
|
|
11712
|
-
x.setupLightsView(n),
|
|
11726
|
+
x.setupLightsView(n), ue === !0 && Pe.setGlobalState(T.clippingPlanes, n), r && V.viewport(N.copy(r)), i.length > 0 && lt(i, t, n), a.length > 0 && lt(a, t, n), o.length > 0 && lt(o, t, n), V.buffers.depth.setTest(!0), V.buffers.depth.setMask(!0), V.buffers.color.setMask(!0), V.setPolygonOffset(!1);
|
|
11713
11727
|
}
|
|
11714
11728
|
function ct(e, t, n, r) {
|
|
11715
11729
|
if ((n.isScene === !0 ? n.overrideMaterial : null) !== null) return;
|
|
11716
11730
|
if (x.state.transmissionRenderTarget[r.id] === void 0) {
|
|
11717
|
-
let e =
|
|
11731
|
+
let e = B.has("EXT_color_buffer_half_float") || B.has("EXT_color_buffer_float");
|
|
11718
11732
|
x.state.transmissionRenderTarget[r.id] = new Zn(1, 1, {
|
|
11719
11733
|
generateMipmaps: !0,
|
|
11720
|
-
type: e ? Ae :
|
|
11721
|
-
minFilter:
|
|
11722
|
-
samples: Math.max(4,
|
|
11734
|
+
type: e ? Ae : W,
|
|
11735
|
+
minFilter: Ce,
|
|
11736
|
+
samples: Math.max(4, _e.samples),
|
|
11723
11737
|
stencilBuffer: i,
|
|
11724
11738
|
resolveDepthBuffer: !1,
|
|
11725
11739
|
resolveStencilBuffer: !1,
|
|
@@ -11729,11 +11743,11 @@ var _u = class {
|
|
|
11729
11743
|
let a = x.state.transmissionRenderTarget[r.id], o = r.viewport || N;
|
|
11730
11744
|
a.setSize(o.z * T.transmissionResolutionScale, o.w * T.transmissionResolutionScale);
|
|
11731
11745
|
let s = T.getRenderTarget(), c = T.getActiveCubeFace(), l = T.getActiveMipmapLevel();
|
|
11732
|
-
T.setRenderTarget(a), T.getClearColor(P), ne = T.getClearAlpha(), ne < 1 && T.setClearColor(16777215, .5), T.clear(),
|
|
11746
|
+
T.setRenderTarget(a), T.getClearColor(P), ne = T.getClearAlpha(), ne < 1 && T.setClearColor(16777215, .5), T.clear(), me && Ie.render(n);
|
|
11733
11747
|
let u = T.toneMapping;
|
|
11734
11748
|
T.toneMapping = 0;
|
|
11735
11749
|
let d = r.viewport;
|
|
11736
|
-
if (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r),
|
|
11750
|
+
if (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r), ue === !0 && Pe.setGlobalState(T.clippingPlanes, r), lt(e, n, r), U.updateMultisampleRenderTarget(a), U.updateRenderTargetMipmap(a), B.has("WEBGL_multisampled_render_to_texture") === !1) {
|
|
11737
11751
|
let e = !1;
|
|
11738
11752
|
for (let i = 0, a = t.length; i < a; i++) {
|
|
11739
11753
|
let { object: a, geometry: o, material: s, group: c } = t[i];
|
|
@@ -11757,7 +11771,7 @@ var _u = class {
|
|
|
11757
11771
|
e.onBeforeRender(T, t, n, r, i, a), e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse, e.matrixWorld), e.normalMatrix.getNormalMatrix(e.modelViewMatrix), i.onBeforeRender(T, t, n, r, e, a), i.transparent === !0 && i.side === 2 && i.forceSinglePass === !1 ? (i.side = 1, i.needsUpdate = !0, T.renderBufferDirect(n, t, r, i, e, a), i.side = 0, i.needsUpdate = !0, T.renderBufferDirect(n, t, r, i, e, a), i.side = 2) : T.renderBufferDirect(n, t, r, i, e, a), e.onAfterRender(T, t, n, r, i, a);
|
|
11758
11772
|
}
|
|
11759
11773
|
function dt(e, t, n) {
|
|
11760
|
-
t.isScene !== !0 && (t =
|
|
11774
|
+
t.isScene !== !0 && (t = pe);
|
|
11761
11775
|
let r = H.get(e), i = x.state.lights, a = x.state.shadowsArray, o = i.state.version, s = we.getParameters(e, i.state, a, t, n, x.state.lightProbeGridArray), c = we.getProgramCacheKey(s), l = r.programs;
|
|
11762
11776
|
r.environment = e.isMeshStandardMaterial || e.isMeshLambertMaterial || e.isMeshPhongMaterial ? t.environment : null, r.fog = t.fog;
|
|
11763
11777
|
let u = e.isMeshStandardMaterial || e.isMeshLambertMaterial && !e.envMap || e.isMeshPhongMaterial && !e.envMap;
|
|
@@ -11791,11 +11805,11 @@ var _u = class {
|
|
|
11791
11805
|
return null;
|
|
11792
11806
|
}
|
|
11793
11807
|
function ht(e, t, n, r, i) {
|
|
11794
|
-
t.isScene !== !0 && (t =
|
|
11808
|
+
t.isScene !== !0 && (t = pe), U.resetTextureUnits();
|
|
11795
11809
|
let a = t.fog, o = r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial ? t.environment : null, s = A === null ? T.outputColorSpace : A.isXRRenderTarget === !0 ? A.texture.colorSpace : Rn.workingColorSpace, c = r.isMeshStandardMaterial || r.isMeshLambertMaterial && !r.envMap || r.isMeshPhongMaterial && !r.envMap, l = ye.get(r.envMap || o, c), u = r.vertexColors === !0 && !!n.attributes.color && n.attributes.color.itemSize === 4, d = !!n.attributes.tangent && (!!r.normalMap || r.anisotropy > 0), f = !!n.morphAttributes.position, p = !!n.morphAttributes.normal, m = !!n.morphAttributes.color, h = 0;
|
|
11796
11810
|
r.toneMapped && (A === null || A.isXRRenderTarget === !0) && (h = T.toneMapping);
|
|
11797
11811
|
let g = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color, _ = g === void 0 ? 0 : g.length, v = H.get(r), y = x.state.lights;
|
|
11798
|
-
if (
|
|
11812
|
+
if (ue === !0 && (de === !0 || e !== M)) {
|
|
11799
11813
|
let t = e === M && r.id === j;
|
|
11800
11814
|
Pe.setState(r, e, t);
|
|
11801
11815
|
}
|
|
@@ -11809,25 +11823,25 @@ var _u = class {
|
|
|
11809
11823
|
v.lightProbeGrid !== e && (v.lightProbeGrid = e, w = !0);
|
|
11810
11824
|
}
|
|
11811
11825
|
if (C || M !== e) {
|
|
11812
|
-
V.buffers.depth.getReversed() && e.reversedDepth !== !0 && (e._reversedDepth = !0, e.updateProjectionMatrix()), O.setValue(
|
|
11826
|
+
V.buffers.depth.getReversed() && e.reversedDepth !== !0 && (e._reversedDepth = !0, e.updateProjectionMatrix()), O.setValue(z, "projectionMatrix", e.projectionMatrix), O.setValue(z, "viewMatrix", e.matrixWorldInverse);
|
|
11813
11827
|
let t = O.map.cameraPosition;
|
|
11814
|
-
t !== void 0 && t.setValue(
|
|
11828
|
+
t !== void 0 && t.setValue(z, L.setFromMatrixPosition(e.matrixWorld)), _e.logarithmicDepthBuffer && O.setValue(z, "logDepthBufFC", 2 / (Math.log(e.far + 1) / Math.LN2)), (r.isMeshPhongMaterial || r.isMeshToonMaterial || r.isMeshLambertMaterial || r.isMeshBasicMaterial || r.isMeshStandardMaterial || r.isShaderMaterial) && O.setValue(z, "isOrthographic", e.isOrthographicCamera === !0), M !== e && (M = e, w = !0, E = !0);
|
|
11815
11829
|
}
|
|
11816
|
-
if (v.needsLights && (y.state.directionalShadowMap.length > 0 && O.setValue(
|
|
11817
|
-
O.setOptional(
|
|
11830
|
+
if (v.needsLights && (y.state.directionalShadowMap.length > 0 && O.setValue(z, "directionalShadowMap", y.state.directionalShadowMap, U), y.state.spotShadowMap.length > 0 && O.setValue(z, "spotShadowMap", y.state.spotShadowMap, U), y.state.pointShadowMap.length > 0 && O.setValue(z, "pointShadowMap", y.state.pointShadowMap, U)), i.isSkinnedMesh) {
|
|
11831
|
+
O.setOptional(z, i, "bindMatrix"), O.setOptional(z, i, "bindMatrixInverse");
|
|
11818
11832
|
let e = i.skeleton;
|
|
11819
|
-
e && (e.boneTexture === null && e.computeBoneTexture(), O.setValue(
|
|
11833
|
+
e && (e.boneTexture === null && e.computeBoneTexture(), O.setValue(z, "boneTexture", e.boneTexture, U));
|
|
11820
11834
|
}
|
|
11821
|
-
i.isBatchedMesh && (O.setOptional(
|
|
11835
|
+
i.isBatchedMesh && (O.setOptional(z, i, "batchingTexture"), O.setValue(z, "batchingTexture", i._matricesTexture, U), O.setOptional(z, i, "batchingIdTexture"), O.setValue(z, "batchingIdTexture", i._indirectTexture, U), O.setOptional(z, i, "batchingColorTexture"), i._colorsTexture !== null && O.setValue(z, "batchingColorTexture", i._colorsTexture, U));
|
|
11822
11836
|
let N = n.morphAttributes;
|
|
11823
|
-
if ((N.position !== void 0 || N.normal !== void 0 || N.color !== void 0) && Le.update(i, n, S), (w || v.receiveShadow !== i.receiveShadow) && (v.receiveShadow = i.receiveShadow, O.setValue(
|
|
11824
|
-
if (O.setValue(
|
|
11837
|
+
if ((N.position !== void 0 || N.normal !== void 0 || N.color !== void 0) && Le.update(i, n, S), (w || v.receiveShadow !== i.receiveShadow) && (v.receiveShadow = i.receiveShadow, O.setValue(z, "receiveShadow", i.receiveShadow)), (r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial) && r.envMap === null && t.environment !== null && (k.envMapIntensity.value = t.environmentIntensity), k.dfgLUT !== void 0 && (k.dfgLUT.value = gu()), w) {
|
|
11838
|
+
if (O.setValue(z, "toneMappingExposure", T.toneMappingExposure), v.needsLights && gt(k, E), a && r.fog === !0 && Te.refreshFogUniforms(k, a), Te.refreshMaterialUniforms(k, r, I, re, x.state.transmissionRenderTarget[e.id]), v.needsLights && v.lightProbeGrid) {
|
|
11825
11839
|
let e = v.lightProbeGrid;
|
|
11826
11840
|
k.probesSH.value = e.texture, k.probesMin.value.copy(e.boundingBox.min), k.probesMax.value.copy(e.boundingBox.max), k.probesResolution.value.copy(e.resolution);
|
|
11827
11841
|
}
|
|
11828
|
-
Yc.upload(
|
|
11842
|
+
Yc.upload(z, ft(v), k, U);
|
|
11829
11843
|
}
|
|
11830
|
-
if (r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (Yc.upload(
|
|
11844
|
+
if (r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (Yc.upload(z, ft(v), k, U), r.uniformsNeedUpdate = !1), r.isSpriteMaterial && O.setValue(z, "center", i.center), O.setValue(z, "modelViewMatrix", i.modelViewMatrix), O.setValue(z, "normalMatrix", i.normalMatrix), O.setValue(z, "modelMatrix", i.matrixWorld), r.uniformsGroups !== void 0) {
|
|
11831
11845
|
let e = r.uniformsGroups;
|
|
11832
11846
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
11833
11847
|
let n = e[t];
|
|
@@ -11855,14 +11869,14 @@ var _u = class {
|
|
|
11855
11869
|
let n = H.get(e);
|
|
11856
11870
|
n.__webglFramebuffer = t, n.__useDefaultFramebuffer = t === void 0;
|
|
11857
11871
|
};
|
|
11858
|
-
let vt =
|
|
11872
|
+
let vt = z.createFramebuffer();
|
|
11859
11873
|
this.setRenderTarget = function(e, t = 0, n = 0) {
|
|
11860
11874
|
A = e, O = t, k = n;
|
|
11861
11875
|
let r = null, i = !1, a = !1;
|
|
11862
11876
|
if (e) {
|
|
11863
11877
|
let o = H.get(e);
|
|
11864
11878
|
if (o.__useDefaultFramebuffer !== void 0) {
|
|
11865
|
-
V.bindFramebuffer(
|
|
11879
|
+
V.bindFramebuffer(z.FRAMEBUFFER, o.__webglFramebuffer), N.copy(e.viewport), ee.copy(e.scissor), te = e.scissorTest, V.viewport(N), V.scissor(ee), V.setScissorTest(te), j = -1;
|
|
11866
11880
|
return;
|
|
11867
11881
|
} else if (o.__webglFramebuffer === void 0) U.setupRenderTarget(e);
|
|
11868
11882
|
else if (o.__hasExternalTextures) U.rebindTextures(e, H.get(e.texture).__webglTexture, H.get(e.depthTexture).__webglTexture);
|
|
@@ -11877,19 +11891,19 @@ var _u = class {
|
|
|
11877
11891
|
(s.isData3DTexture || s.isDataArrayTexture || s.isCompressedArrayTexture) && (a = !0);
|
|
11878
11892
|
let c = H.get(e).__webglFramebuffer;
|
|
11879
11893
|
e.isWebGLCubeRenderTarget ? (r = Array.isArray(c[t]) ? c[t][n] : c[t], i = !0) : r = e.samples > 0 && U.useMultisampledRTT(e) === !1 ? H.get(e).__webglMultisampledFramebuffer : Array.isArray(c) ? c[n] : c, N.copy(e.viewport), ee.copy(e.scissor), te = e.scissorTest;
|
|
11880
|
-
} else N.copy(
|
|
11881
|
-
if (n !== 0 && (r = vt), V.bindFramebuffer(
|
|
11894
|
+
} else N.copy(oe).multiplyScalar(I).floor(), ee.copy(se).multiplyScalar(I).floor(), te = ce;
|
|
11895
|
+
if (n !== 0 && (r = vt), V.bindFramebuffer(z.FRAMEBUFFER, r) && V.drawBuffers(e, r), V.viewport(N), V.scissor(ee), V.setScissorTest(te), i) {
|
|
11882
11896
|
let r = H.get(e.texture);
|
|
11883
|
-
|
|
11897
|
+
z.framebufferTexture2D(z.FRAMEBUFFER, z.COLOR_ATTACHMENT0, z.TEXTURE_CUBE_MAP_POSITIVE_X + t, r.__webglTexture, n);
|
|
11884
11898
|
} else if (a) {
|
|
11885
11899
|
let r = t;
|
|
11886
11900
|
for (let t = 0; t < e.textures.length; t++) {
|
|
11887
11901
|
let i = H.get(e.textures[t]);
|
|
11888
|
-
|
|
11902
|
+
z.framebufferTextureLayer(z.FRAMEBUFFER, z.COLOR_ATTACHMENT0 + t, i.__webglTexture, n, r);
|
|
11889
11903
|
}
|
|
11890
11904
|
} else if (e !== null && n !== 0) {
|
|
11891
11905
|
let t = H.get(e.texture);
|
|
11892
|
-
|
|
11906
|
+
z.framebufferTexture2D(z.FRAMEBUFFER, z.COLOR_ATTACHMENT0, z.TEXTURE_2D, t.__webglTexture, n);
|
|
11893
11907
|
}
|
|
11894
11908
|
j = -1;
|
|
11895
11909
|
}, this.readRenderTargetPixels = function(e, t, n, r, i, a, o, s = 0) {
|
|
@@ -11899,43 +11913,43 @@ var _u = class {
|
|
|
11899
11913
|
}
|
|
11900
11914
|
let c = H.get(e).__webglFramebuffer;
|
|
11901
11915
|
if (e.isWebGLCubeRenderTarget && o !== void 0 && (c = c[o]), c) {
|
|
11902
|
-
V.bindFramebuffer(
|
|
11916
|
+
V.bindFramebuffer(z.FRAMEBUFFER, c);
|
|
11903
11917
|
try {
|
|
11904
11918
|
let o = e.textures[s], c = o.format, l = o.type;
|
|
11905
|
-
if (e.textures.length > 1 &&
|
|
11919
|
+
if (e.textures.length > 1 && z.readBuffer(z.COLOR_ATTACHMENT0 + s), !_e.textureFormatReadable(c)) {
|
|
11906
11920
|
K("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
|
|
11907
11921
|
return;
|
|
11908
11922
|
}
|
|
11909
|
-
if (!
|
|
11923
|
+
if (!_e.textureTypeReadable(l)) {
|
|
11910
11924
|
K("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
|
|
11911
11925
|
return;
|
|
11912
11926
|
}
|
|
11913
|
-
t >= 0 && t <= e.width - r && n >= 0 && n <= e.height - i &&
|
|
11927
|
+
t >= 0 && t <= e.width - r && n >= 0 && n <= e.height - i && z.readPixels(t, n, r, i, Be.convert(c), Be.convert(l), a);
|
|
11914
11928
|
} finally {
|
|
11915
11929
|
let e = A === null ? null : H.get(A).__webglFramebuffer;
|
|
11916
|
-
V.bindFramebuffer(
|
|
11930
|
+
V.bindFramebuffer(z.FRAMEBUFFER, e);
|
|
11917
11931
|
}
|
|
11918
11932
|
}
|
|
11919
11933
|
}, this.readRenderTargetPixelsAsync = async function(e, t, n, r, i, a, o, s = 0) {
|
|
11920
11934
|
if (!(e && e.isWebGLRenderTarget)) throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
|
|
11921
11935
|
let c = H.get(e).__webglFramebuffer;
|
|
11922
11936
|
if (e.isWebGLCubeRenderTarget && o !== void 0 && (c = c[o]), c) if (t >= 0 && t <= e.width - r && n >= 0 && n <= e.height - i) {
|
|
11923
|
-
V.bindFramebuffer(
|
|
11937
|
+
V.bindFramebuffer(z.FRAMEBUFFER, c);
|
|
11924
11938
|
let o = e.textures[s], l = o.format, u = o.type;
|
|
11925
|
-
if (e.textures.length > 1 &&
|
|
11926
|
-
if (!
|
|
11927
|
-
let d =
|
|
11928
|
-
|
|
11939
|
+
if (e.textures.length > 1 && z.readBuffer(z.COLOR_ATTACHMENT0 + s), !_e.textureFormatReadable(l)) throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");
|
|
11940
|
+
if (!_e.textureTypeReadable(u)) throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");
|
|
11941
|
+
let d = z.createBuffer();
|
|
11942
|
+
z.bindBuffer(z.PIXEL_PACK_BUFFER, d), z.bufferData(z.PIXEL_PACK_BUFFER, a.byteLength, z.STREAM_READ), z.readPixels(t, n, r, i, Be.convert(l), Be.convert(u), 0);
|
|
11929
11943
|
let f = A === null ? null : H.get(A).__webglFramebuffer;
|
|
11930
|
-
V.bindFramebuffer(
|
|
11931
|
-
let p =
|
|
11932
|
-
return
|
|
11944
|
+
V.bindFramebuffer(z.FRAMEBUFFER, f);
|
|
11945
|
+
let p = z.fenceSync(z.SYNC_GPU_COMMANDS_COMPLETE, 0);
|
|
11946
|
+
return z.flush(), await en(z, p, 4), z.bindBuffer(z.PIXEL_PACK_BUFFER, d), z.getBufferSubData(z.PIXEL_PACK_BUFFER, 0, a), z.deleteBuffer(d), z.deleteSync(p), a;
|
|
11933
11947
|
} else throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.");
|
|
11934
11948
|
}, this.copyFramebufferToTexture = function(e, t = null, n = 0) {
|
|
11935
11949
|
let r = 2 ** -n, i = Math.floor(e.image.width * r), a = Math.floor(e.image.height * r), o = t === null ? 0 : t.x, s = t === null ? 0 : t.y;
|
|
11936
|
-
U.setTexture2D(e, 0),
|
|
11950
|
+
U.setTexture2D(e, 0), z.copyTexSubImage2D(z.TEXTURE_2D, n, 0, 0, o, s, i, a), V.unbindTexture();
|
|
11937
11951
|
};
|
|
11938
|
-
let yt =
|
|
11952
|
+
let yt = z.createFramebuffer(), bt = z.createFramebuffer();
|
|
11939
11953
|
this.copyTextureToTexture = function(e, t, n = null, r = null, i = 0, a = 0) {
|
|
11940
11954
|
let o, s, c, l, u, d, f, p, m, h = e.isCompressedTexture ? e.mipmaps[a] : e.image;
|
|
11941
11955
|
if (n !== null) o = n.max.x - n.min.x, s = n.max.y - n.min.y, c = n.isBox3 ? n.max.z - n.min.z : 1, l = n.min.x, u = n.min.y, d = n.isBox3 ? n.min.z : 0;
|
|
@@ -11945,22 +11959,22 @@ var _u = class {
|
|
|
11945
11959
|
}
|
|
11946
11960
|
r === null ? (f = 0, p = 0, m = 0) : (f = r.x, p = r.y, m = r.z);
|
|
11947
11961
|
let g = Be.convert(t.format), _ = Be.convert(t.type), v;
|
|
11948
|
-
t.isData3DTexture ? (U.setTexture3D(t, 0), v =
|
|
11949
|
-
let y = V.getParameter(
|
|
11950
|
-
V.pixelStorei(
|
|
11962
|
+
t.isData3DTexture ? (U.setTexture3D(t, 0), v = z.TEXTURE_3D) : t.isDataArrayTexture || t.isCompressedArrayTexture ? (U.setTexture2DArray(t, 0), v = z.TEXTURE_2D_ARRAY) : (U.setTexture2D(t, 0), v = z.TEXTURE_2D), V.activeTexture(z.TEXTURE0), V.pixelStorei(z.UNPACK_FLIP_Y_WEBGL, t.flipY), V.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha), V.pixelStorei(z.UNPACK_ALIGNMENT, t.unpackAlignment);
|
|
11963
|
+
let y = V.getParameter(z.UNPACK_ROW_LENGTH), b = V.getParameter(z.UNPACK_IMAGE_HEIGHT), x = V.getParameter(z.UNPACK_SKIP_PIXELS), S = V.getParameter(z.UNPACK_SKIP_ROWS), C = V.getParameter(z.UNPACK_SKIP_IMAGES);
|
|
11964
|
+
V.pixelStorei(z.UNPACK_ROW_LENGTH, h.width), V.pixelStorei(z.UNPACK_IMAGE_HEIGHT, h.height), V.pixelStorei(z.UNPACK_SKIP_PIXELS, l), V.pixelStorei(z.UNPACK_SKIP_ROWS, u), V.pixelStorei(z.UNPACK_SKIP_IMAGES, d);
|
|
11951
11965
|
let w = e.isDataArrayTexture || e.isData3DTexture, T = t.isDataArrayTexture || t.isData3DTexture;
|
|
11952
11966
|
if (e.isDepthTexture) {
|
|
11953
11967
|
let n = H.get(e), r = H.get(t), h = H.get(n.__renderTarget), g = H.get(r.__renderTarget);
|
|
11954
|
-
V.bindFramebuffer(
|
|
11955
|
-
for (let n = 0; n < c; n++) w && (
|
|
11956
|
-
V.bindFramebuffer(
|
|
11968
|
+
V.bindFramebuffer(z.READ_FRAMEBUFFER, h.__webglFramebuffer), V.bindFramebuffer(z.DRAW_FRAMEBUFFER, g.__webglFramebuffer);
|
|
11969
|
+
for (let n = 0; n < c; n++) w && (z.framebufferTextureLayer(z.READ_FRAMEBUFFER, z.COLOR_ATTACHMENT0, H.get(e).__webglTexture, i, d + n), z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER, z.COLOR_ATTACHMENT0, H.get(t).__webglTexture, a, m + n)), z.blitFramebuffer(l, u, o, s, f, p, o, s, z.DEPTH_BUFFER_BIT, z.NEAREST);
|
|
11970
|
+
V.bindFramebuffer(z.READ_FRAMEBUFFER, null), V.bindFramebuffer(z.DRAW_FRAMEBUFFER, null);
|
|
11957
11971
|
} else if (i !== 0 || e.isRenderTargetTexture || H.has(e)) {
|
|
11958
11972
|
let n = H.get(e), r = H.get(t);
|
|
11959
|
-
V.bindFramebuffer(
|
|
11960
|
-
for (let e = 0; e < c; e++) w ?
|
|
11961
|
-
V.bindFramebuffer(
|
|
11962
|
-
} else T ? e.isDataTexture || e.isData3DTexture ?
|
|
11963
|
-
V.pixelStorei(
|
|
11973
|
+
V.bindFramebuffer(z.READ_FRAMEBUFFER, yt), V.bindFramebuffer(z.DRAW_FRAMEBUFFER, bt);
|
|
11974
|
+
for (let e = 0; e < c; e++) w ? z.framebufferTextureLayer(z.READ_FRAMEBUFFER, z.COLOR_ATTACHMENT0, n.__webglTexture, i, d + e) : z.framebufferTexture2D(z.READ_FRAMEBUFFER, z.COLOR_ATTACHMENT0, z.TEXTURE_2D, n.__webglTexture, i), T ? z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER, z.COLOR_ATTACHMENT0, r.__webglTexture, a, m + e) : z.framebufferTexture2D(z.DRAW_FRAMEBUFFER, z.COLOR_ATTACHMENT0, z.TEXTURE_2D, r.__webglTexture, a), i === 0 ? T ? z.copyTexSubImage3D(v, a, f, p, m + e, l, u, o, s) : z.copyTexSubImage2D(v, a, f, p, l, u, o, s) : z.blitFramebuffer(l, u, o, s, f, p, o, s, z.COLOR_BUFFER_BIT, z.NEAREST);
|
|
11975
|
+
V.bindFramebuffer(z.READ_FRAMEBUFFER, null), V.bindFramebuffer(z.DRAW_FRAMEBUFFER, null);
|
|
11976
|
+
} else T ? e.isDataTexture || e.isData3DTexture ? z.texSubImage3D(v, a, f, p, m, o, s, c, g, _, h.data) : t.isCompressedArrayTexture ? z.compressedTexSubImage3D(v, a, f, p, m, o, s, c, g, h.data) : z.texSubImage3D(v, a, f, p, m, o, s, c, g, _, h) : e.isDataTexture ? z.texSubImage2D(z.TEXTURE_2D, a, f, p, o, s, g, _, h.data) : e.isCompressedTexture ? z.compressedTexSubImage2D(z.TEXTURE_2D, a, f, p, h.width, h.height, g, h.data) : z.texSubImage2D(z.TEXTURE_2D, a, f, p, o, s, g, _, h);
|
|
11977
|
+
V.pixelStorei(z.UNPACK_ROW_LENGTH, y), V.pixelStorei(z.UNPACK_IMAGE_HEIGHT, b), V.pixelStorei(z.UNPACK_SKIP_PIXELS, x), V.pixelStorei(z.UNPACK_SKIP_ROWS, S), V.pixelStorei(z.UNPACK_SKIP_IMAGES, C), a === 0 && t.generateMipmaps && z.generateMipmap(v), V.unbindTexture();
|
|
11964
11978
|
}, this.initRenderTarget = function(e) {
|
|
11965
11979
|
H.get(e).__webglFramebuffer === void 0 && U.setupRenderTarget(e);
|
|
11966
11980
|
}, this.initTexture = function(e) {
|
|
@@ -11997,12 +12011,12 @@ var _u = class {
|
|
|
11997
12011
|
RIGHT: "ArrowRight",
|
|
11998
12012
|
BOTTOM: "ArrowDown"
|
|
11999
12013
|
}, this.mouseButtons = {
|
|
12000
|
-
LEFT:
|
|
12001
|
-
MIDDLE:
|
|
12002
|
-
RIGHT:
|
|
12014
|
+
LEFT: B.ROTATE,
|
|
12015
|
+
MIDDLE: B.DOLLY,
|
|
12016
|
+
RIGHT: B.PAN
|
|
12003
12017
|
}, this.touches = {
|
|
12004
|
-
ONE:
|
|
12005
|
-
TWO:
|
|
12018
|
+
ONE: _e.ROTATE,
|
|
12019
|
+
TWO: _e.DOLLY_PAN
|
|
12006
12020
|
}, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new J(), this._lastQuaternion = new jn(), this._lastTargetPosition = new J(), this._quat = new jn().setFromUnitVectors(e.up, new J(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Yo(), this._sphericalDelta = new Yo(), this._scale = 1, this._panOffset = new J(), this._rotateStart = new q(), this._rotateEnd = new q(), this._rotateDelta = new q(), this._panStart = new q(), this._panEnd = new q(), this._panDelta = new q(), this._dollyStart = new q(), this._dollyEnd = new q(), this._dollyDelta = new q(), this._dollyDirection = new J(), this._mouse = new q(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Au.bind(this), this._onPointerDown = ku.bind(this), this._onPointerUp = ju.bind(this), this._onContextMenu = Ru.bind(this), this._onMouseWheel = Pu.bind(this), this._onKeyDown = Fu.bind(this), this._onTouchStart = Iu.bind(this), this._onTouchMove = Lu.bind(this), this._onMouseDown = Mu.bind(this), this._onMouseMove = Nu.bind(this), this._interceptControlDown = zu.bind(this), this._interceptControlUp = Bu.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
12007
12021
|
}
|
|
12008
12022
|
set cursorStyle(e) {
|
|
@@ -12305,11 +12319,11 @@ function Mu(e) {
|
|
|
12305
12319
|
default: t = -1;
|
|
12306
12320
|
}
|
|
12307
12321
|
switch (t) {
|
|
12308
|
-
case
|
|
12322
|
+
case B.DOLLY:
|
|
12309
12323
|
if (this.enableZoom === !1) return;
|
|
12310
12324
|
this._handleMouseDownDolly(e), this.state = Eu.DOLLY;
|
|
12311
12325
|
break;
|
|
12312
|
-
case
|
|
12326
|
+
case B.ROTATE:
|
|
12313
12327
|
if (e.ctrlKey || e.metaKey || e.shiftKey) {
|
|
12314
12328
|
if (this.enablePan === !1) return;
|
|
12315
12329
|
this._handleMouseDownPan(e), this.state = Eu.PAN;
|
|
@@ -12318,7 +12332,7 @@ function Mu(e) {
|
|
|
12318
12332
|
this._handleMouseDownRotate(e), this.state = Eu.ROTATE;
|
|
12319
12333
|
}
|
|
12320
12334
|
break;
|
|
12321
|
-
case
|
|
12335
|
+
case B.PAN:
|
|
12322
12336
|
if (e.ctrlKey || e.metaKey || e.shiftKey) {
|
|
12323
12337
|
if (this.enableRotate === !1) return;
|
|
12324
12338
|
this._handleMouseDownRotate(e), this.state = Eu.ROTATE;
|
|
@@ -12357,11 +12371,11 @@ function Iu(e) {
|
|
|
12357
12371
|
switch (this._trackPointer(e), this._pointers.length) {
|
|
12358
12372
|
case 1:
|
|
12359
12373
|
switch (this.touches.ONE) {
|
|
12360
|
-
case
|
|
12374
|
+
case _e.ROTATE:
|
|
12361
12375
|
if (this.enableRotate === !1) return;
|
|
12362
12376
|
this._handleTouchStartRotate(e), this.state = Eu.TOUCH_ROTATE;
|
|
12363
12377
|
break;
|
|
12364
|
-
case
|
|
12378
|
+
case _e.PAN:
|
|
12365
12379
|
if (this.enablePan === !1) return;
|
|
12366
12380
|
this._handleTouchStartPan(e), this.state = Eu.TOUCH_PAN;
|
|
12367
12381
|
break;
|
|
@@ -12370,11 +12384,11 @@ function Iu(e) {
|
|
|
12370
12384
|
break;
|
|
12371
12385
|
case 2:
|
|
12372
12386
|
switch (this.touches.TWO) {
|
|
12373
|
-
case
|
|
12387
|
+
case _e.DOLLY_PAN:
|
|
12374
12388
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
12375
12389
|
this._handleTouchStartDollyPan(e), this.state = Eu.TOUCH_DOLLY_PAN;
|
|
12376
12390
|
break;
|
|
12377
|
-
case
|
|
12391
|
+
case _e.DOLLY_ROTATE:
|
|
12378
12392
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
12379
12393
|
this._handleTouchStartDollyRotate(e), this.state = Eu.TOUCH_DOLLY_ROTATE;
|
|
12380
12394
|
break;
|
|
@@ -13465,7 +13479,7 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13465
13479
|
}, Cd = { class: "menu-label" }, wd = {
|
|
13466
13480
|
key: 1,
|
|
13467
13481
|
class: "menu-shortcut"
|
|
13468
|
-
}, Td = /*#__PURE__*/
|
|
13482
|
+
}, Td = /*#__PURE__*/ R({
|
|
13469
13483
|
__name: "ContextMenu",
|
|
13470
13484
|
props: {
|
|
13471
13485
|
visible: Boolean,
|
|
@@ -13576,7 +13590,7 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13576
13590
|
}, [["__scopeId", "data-v-909aab56"]]), Ed = { class: "viewport-info" }, Dd = {
|
|
13577
13591
|
key: 0,
|
|
13578
13592
|
class: "renderer-badge"
|
|
13579
|
-
}, Od = /*#__PURE__*/
|
|
13593
|
+
}, Od = /*#__PURE__*/ R({
|
|
13580
13594
|
__name: "CadViewport",
|
|
13581
13595
|
props: {
|
|
13582
13596
|
features: Array,
|
|
@@ -13597,7 +13611,7 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13597
13611
|
"toggle-axes"
|
|
13598
13612
|
],
|
|
13599
13613
|
setup(e, { expose: t, emit: n }) {
|
|
13600
|
-
let r = e, s = n, c = y(null), u = y(null), d = y(""), f = w(null), p = w(null), m = w(null), v = y(!1), b = y(0), x = y(0), S, C, E, D, k = /* @__PURE__ */ new Map(), A, j, N = null, ee = null, te = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), ne = (e, t) => `${e}-${JSON.stringify(t)}`,
|
|
13614
|
+
let r = e, s = n, c = y(null), u = y(null), d = y(""), f = w(null), p = w(null), m = w(null), v = y(!1), b = y(0), x = y(0), S, C, E, D, k = /* @__PURE__ */ new Map(), A, j, N = null, ee = null, te = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), ne = (e, t) => `${e}-${JSON.stringify(t)}`, F = (e, t) => {
|
|
13601
13615
|
let n = ne(e, t);
|
|
13602
13616
|
if (te.has(n)) return te.get(n).clone();
|
|
13603
13617
|
let r;
|
|
@@ -13623,7 +13637,7 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13623
13637
|
default: r = new Da(1, 1, 1);
|
|
13624
13638
|
}
|
|
13625
13639
|
return te.set(n, r), r.clone();
|
|
13626
|
-
},
|
|
13640
|
+
}, re = (e = "#409eff") => {
|
|
13627
13641
|
if (P.has(e)) return P.get(e).clone();
|
|
13628
13642
|
let t = new Ga({
|
|
13629
13643
|
color: e,
|
|
@@ -13631,34 +13645,34 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13631
13645
|
roughness: .7
|
|
13632
13646
|
});
|
|
13633
13647
|
return P.set(e, t), t.clone();
|
|
13634
|
-
},
|
|
13648
|
+
}, I = async (e) => {
|
|
13635
13649
|
let { WebGLRenderer: t } = await Promise.resolve().then(() => ts), n = new t({
|
|
13636
13650
|
canvas: e,
|
|
13637
13651
|
antialias: !0
|
|
13638
13652
|
});
|
|
13639
13653
|
return d.value = "WebGL", m.value = n, n;
|
|
13640
|
-
},
|
|
13654
|
+
}, ie = async () => {
|
|
13641
13655
|
if (!c.value || !u.value) return;
|
|
13642
13656
|
let e = c.value.clientWidth, t = c.value.clientHeight;
|
|
13643
|
-
f.value = new Ir(), f.value.background = new X(15790320), p.value = new Co(45, e / t, .1, 1e3), p.value.position.set(3, 2, 3), p.value.lookAt(0, 0, 0), await
|
|
13657
|
+
f.value = new Ir(), f.value.background = new X(15790320), p.value = new Co(45, e / t, .1, 1e3), p.value.position.set(3, 2, 3), p.value.lookAt(0, 0, 0), await I(u.value), m.value.setSize(e, t), m.value.setPixelRatio(Math.min(window.devicePixelRatio, 2)), m.value.shadowMap.enabled = !0, S = new Ou(p.value, m.value.domElement), S.enableDamping = !0, S.dampingFactor = .05, C = new Xu(p.value, m.value.domElement), C.addEventListener("dragging-changed", (e) => {
|
|
13644
13658
|
S.enabled = !e.value;
|
|
13645
|
-
}), C.addEventListener("objectChange",
|
|
13659
|
+
}), C.addEventListener("objectChange", se), E = new Xo(10, 10, 8947848, 13421772), f.value.add(E), D = new Zo(2), f.value.add(D);
|
|
13646
13660
|
let n = new Do(16777215, .6);
|
|
13647
13661
|
f.value.add(n);
|
|
13648
13662
|
let r = new Eo(16777215, .8);
|
|
13649
|
-
r.position.set(5, 10, 7), r.castShadow = !0, f.value.add(r), A = new Go(), j = new q(), u.value.addEventListener("click",
|
|
13650
|
-
},
|
|
13651
|
-
let t = new Z(
|
|
13663
|
+
r.position.set(5, 10, 7), r.castShadow = !0, f.value.add(r), A = new Go(), j = new q(), u.value.addEventListener("click", ce), ee = new ResizeObserver(() => le()), ee.observe(c.value), ue();
|
|
13664
|
+
}, ae = (e) => {
|
|
13665
|
+
let t = new Z(F(e.type, e.params), re(e.color || "#409eff"));
|
|
13652
13666
|
return t.position.set(e.position?.x || 0, e.position?.y || 0, e.position?.z || 0), t.rotation.set(e.rotation?.x || 0, e.rotation?.y || 0, e.rotation?.z || 0), t.scale.set(e.scale?.x || 1, e.scale?.y || 1, e.scale?.z || 1), t.castShadow = !0, t.receiveShadow = !0, t.userData.featureId = e.id, t;
|
|
13653
|
-
},
|
|
13667
|
+
}, oe = () => {
|
|
13654
13668
|
if (!f.value) return;
|
|
13655
13669
|
let e = new Set(r.features.map((e) => e.id));
|
|
13656
13670
|
for (let [t, n] of k) e.has(t) || (f.value.remove(n), n.geometry.dispose(), n.material.dispose(), k.delete(t));
|
|
13657
13671
|
for (let e of r.features) {
|
|
13658
13672
|
let t = k.get(e.id);
|
|
13659
|
-
t ? (t.position.set(e.position?.x || 0, e.position?.y || 0, e.position?.z || 0), t.rotation.set(e.rotation?.x || 0, e.rotation?.y || 0, e.rotation?.z || 0), t.scale.set(e.scale?.x || 1, e.scale?.y || 1, e.scale?.z || 1), t.material.color.set(e.color || "#409eff"), t.visible = e.visible !== !1) : (t =
|
|
13673
|
+
t ? (t.position.set(e.position?.x || 0, e.position?.y || 0, e.position?.z || 0), t.rotation.set(e.rotation?.x || 0, e.rotation?.y || 0, e.rotation?.z || 0), t.scale.set(e.scale?.x || 1, e.scale?.y || 1, e.scale?.z || 1), t.material.color.set(e.color || "#409eff"), t.visible = e.visible !== !1) : (t = ae(e), f.value.add(t), k.set(e.id, t));
|
|
13660
13674
|
}
|
|
13661
|
-
},
|
|
13675
|
+
}, se = () => {
|
|
13662
13676
|
if (!C.object) return;
|
|
13663
13677
|
let e = C.object;
|
|
13664
13678
|
r.activeTool === "move" ? s("position-change", {
|
|
@@ -13674,7 +13688,7 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13674
13688
|
y: e.scale.y,
|
|
13675
13689
|
z: e.scale.z
|
|
13676
13690
|
});
|
|
13677
|
-
},
|
|
13691
|
+
}, ce = (e) => {
|
|
13678
13692
|
if (!u.value || !m.value) return;
|
|
13679
13693
|
let t = u.value.getBoundingClientRect();
|
|
13680
13694
|
j.x = (e.clientX - t.left) / t.width * 2 - 1, j.y = -((e.clientY - t.top) / t.height) * 2 + 1, A.setFromCamera(j, p.value);
|
|
@@ -13683,17 +13697,17 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13683
13697
|
let e = i[0].object.userData.featureId;
|
|
13684
13698
|
s("select", e), r.activeTool !== "select" && C.attach(i[0].object);
|
|
13685
13699
|
} else s("select", null), C.detach();
|
|
13686
|
-
},
|
|
13700
|
+
}, le = () => {
|
|
13687
13701
|
if (!c.value || !p.value || !m.value) return;
|
|
13688
13702
|
let e = c.value.clientWidth, t = c.value.clientHeight;
|
|
13689
13703
|
p.value.aspect = e / t, p.value.updateProjectionMatrix(), m.value.setSize(e, t);
|
|
13704
|
+
}, ue = () => {
|
|
13705
|
+
N = requestAnimationFrame(ue), S.update(), m.value.render(f.value, p.value);
|
|
13690
13706
|
}, de = () => {
|
|
13691
|
-
N = requestAnimationFrame(de), S.update(), m.value.render(f.value, p.value);
|
|
13692
|
-
}, fe = () => {
|
|
13693
13707
|
p.value && (p.value.position.set(3, 2, 3), p.value.lookAt(0, 0, 0), S.target.set(0, 0, 0));
|
|
13694
|
-
},
|
|
13708
|
+
}, fe = (e) => {
|
|
13695
13709
|
b.value = e.clientX, x.value = e.clientY, v.value = !0;
|
|
13696
|
-
},
|
|
13710
|
+
}, L = (e) => {
|
|
13697
13711
|
switch (e) {
|
|
13698
13712
|
case "move":
|
|
13699
13713
|
case "rotate":
|
|
@@ -13707,7 +13721,7 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13707
13721
|
s("duplicate");
|
|
13708
13722
|
break;
|
|
13709
13723
|
case "fit-view":
|
|
13710
|
-
|
|
13724
|
+
de();
|
|
13711
13725
|
break;
|
|
13712
13726
|
case "toggle-grid":
|
|
13713
13727
|
s("toggle-grid");
|
|
@@ -13716,7 +13730,7 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13716
13730
|
s("toggle-axes");
|
|
13717
13731
|
break;
|
|
13718
13732
|
}
|
|
13719
|
-
},
|
|
13733
|
+
}, R = (e) => {
|
|
13720
13734
|
if (!(e.target.tagName === "INPUT" || e.target.tagName === "TEXTAREA")) switch (e.key) {
|
|
13721
13735
|
case "g":
|
|
13722
13736
|
case "G":
|
|
@@ -13732,7 +13746,7 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13732
13746
|
break;
|
|
13733
13747
|
case "f":
|
|
13734
13748
|
case "F":
|
|
13735
|
-
|
|
13749
|
+
de();
|
|
13736
13750
|
break;
|
|
13737
13751
|
case "Delete":
|
|
13738
13752
|
case "Backspace":
|
|
@@ -13742,12 +13756,12 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13742
13756
|
C.detach(), s("select", null);
|
|
13743
13757
|
break;
|
|
13744
13758
|
}
|
|
13745
|
-
},
|
|
13759
|
+
}, pe = () => {
|
|
13746
13760
|
N &&= (cancelAnimationFrame(N), null), ee &&= (ee.disconnect(), null), k.forEach((e) => {
|
|
13747
13761
|
e.geometry.dispose(), e.material.dispose();
|
|
13748
13762
|
}), k.clear(), te.forEach((e) => e.dispose()), te.clear(), P.forEach((e) => e.dispose()), P.clear(), S && S.dispose(), C && C.dispose(), m.value && m.value.dispose();
|
|
13749
13763
|
};
|
|
13750
|
-
return O(() => r.features,
|
|
13764
|
+
return O(() => r.features, oe, { deep: !0 }), O(() => r.selectedId, (e) => {
|
|
13751
13765
|
if (e) {
|
|
13752
13766
|
let t = k.get(e);
|
|
13753
13767
|
t && r.activeTool !== "select" && C.attach(t);
|
|
@@ -13764,9 +13778,9 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13764
13778
|
}), O(() => r.showAxes, (e) => {
|
|
13765
13779
|
D && (D.visible = e);
|
|
13766
13780
|
}), h(async () => {
|
|
13767
|
-
await
|
|
13781
|
+
await ie(), oe(), window.addEventListener("keydown", R);
|
|
13768
13782
|
}), g(() => {
|
|
13769
|
-
window.removeEventListener("keydown",
|
|
13783
|
+
window.removeEventListener("keydown", R), pe();
|
|
13770
13784
|
}), t({
|
|
13771
13785
|
renderer: m,
|
|
13772
13786
|
scene: f,
|
|
@@ -13775,7 +13789,7 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13775
13789
|
class: "cad-viewport",
|
|
13776
13790
|
ref_key: "container",
|
|
13777
13791
|
ref: c,
|
|
13778
|
-
onContextmenu: M(
|
|
13792
|
+
onContextmenu: M(fe, ["prevent"])
|
|
13779
13793
|
}, [
|
|
13780
13794
|
o("canvas", {
|
|
13781
13795
|
ref_key: "canvas",
|
|
@@ -13792,7 +13806,7 @@ var rd = new ur(), id = new J(0, 1, 0), ad = new J(0, 0, 0), od = new er(), sd =
|
|
|
13792
13806
|
x: b.value,
|
|
13793
13807
|
y: x.value,
|
|
13794
13808
|
onClose: t[0] ||= (e) => v.value = !1,
|
|
13795
|
-
onSelect:
|
|
13809
|
+
onSelect: L
|
|
13796
13810
|
}, null, 8, [
|
|
13797
13811
|
"visible",
|
|
13798
13812
|
"x",
|
|
@@ -13950,7 +13964,7 @@ function Nd() {
|
|
|
13950
13964
|
}
|
|
13951
13965
|
//#endregion
|
|
13952
13966
|
//#region ../../src/components/cad/SketchEditor.vue
|
|
13953
|
-
var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__PURE__*/
|
|
13967
|
+
var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__PURE__*/ R({
|
|
13954
13968
|
__name: "SketchEditor",
|
|
13955
13969
|
emits: ["finish", "cancel"],
|
|
13956
13970
|
setup(e, { emit: t }) {
|
|
@@ -13966,7 +13980,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
13966
13980
|
x: (e - b) / 50,
|
|
13967
13981
|
y: -(t - x) / 50
|
|
13968
13982
|
}), N = () => {
|
|
13969
|
-
p && (p.clearRect(0, 0, m, v), p.fillStyle = "#f8f9fa", p.fillRect(0, 0, m, v), ee(), te(), P(),
|
|
13983
|
+
p && (p.clearRect(0, 0, m, v), p.fillStyle = "#f8f9fa", p.fillRect(0, 0, m, v), ee(), te(), P(), oe(), de());
|
|
13970
13984
|
}, ee = () => {
|
|
13971
13985
|
p.strokeStyle = "#e0e0e0", p.lineWidth = .5;
|
|
13972
13986
|
let e = b % 50, t = x % 50;
|
|
@@ -13979,71 +13993,71 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
13979
13993
|
}, ne = (e, t = !1) => {
|
|
13980
13994
|
switch (p.strokeStyle = t ? "#409eff" : "#333", p.fillStyle = t ? "#409eff" : "#666", p.lineWidth = t ? 2 : 1, e.type) {
|
|
13981
13995
|
case "point":
|
|
13982
|
-
|
|
13996
|
+
F(e);
|
|
13983
13997
|
break;
|
|
13984
13998
|
case "line":
|
|
13985
|
-
|
|
13999
|
+
re(e);
|
|
13986
14000
|
break;
|
|
13987
14001
|
case "circle":
|
|
13988
|
-
|
|
14002
|
+
I(e);
|
|
13989
14003
|
break;
|
|
13990
14004
|
case "rectangle":
|
|
13991
|
-
|
|
14005
|
+
ie(e);
|
|
13992
14006
|
break;
|
|
13993
14007
|
case "arc":
|
|
13994
|
-
|
|
14008
|
+
ae(e);
|
|
13995
14009
|
break;
|
|
13996
14010
|
}
|
|
13997
|
-
},
|
|
14011
|
+
}, F = (e) => {
|
|
13998
14012
|
let t = j(e.x, e.y);
|
|
13999
14013
|
p.beginPath(), p.arc(t.x, t.y, 4, 0, Math.PI * 2), p.fill();
|
|
14000
|
-
},
|
|
14014
|
+
}, re = (e) => {
|
|
14001
14015
|
let t = u.value.find((t) => t.id === e.p1Id), n = u.value.find((t) => t.id === e.p2Id);
|
|
14002
14016
|
if (t && n) {
|
|
14003
14017
|
let e = j(t.x, t.y), r = j(n.x, n.y);
|
|
14004
14018
|
p.beginPath(), p.moveTo(e.x, e.y), p.lineTo(r.x, r.y), p.stroke();
|
|
14005
14019
|
}
|
|
14006
|
-
},
|
|
14020
|
+
}, I = (e) => {
|
|
14007
14021
|
let t = u.value.find((t) => t.id === e.centerId);
|
|
14008
14022
|
if (t) {
|
|
14009
14023
|
let n = j(t.x, t.y);
|
|
14010
14024
|
p.beginPath(), p.arc(n.x, n.y, e.radius * 50, 0, Math.PI * 2), p.stroke();
|
|
14011
14025
|
}
|
|
14012
|
-
},
|
|
14026
|
+
}, ie = (e) => {
|
|
14013
14027
|
let t = u.value.find((t) => t.id === e.p1Id), n = u.value.find((t) => t.id === e.p2Id), r = u.value.find((t) => t.id === e.p3Id), i = u.value.find((t) => t.id === e.p4Id);
|
|
14014
14028
|
if (t && n && r && i) {
|
|
14015
14029
|
let e = j(t.x, t.y), a = j(n.x, n.y), o = j(r.x, r.y), s = j(i.x, i.y);
|
|
14016
14030
|
p.beginPath(), p.moveTo(e.x, e.y), p.lineTo(a.x, a.y), p.lineTo(o.x, o.y), p.lineTo(s.x, s.y), p.closePath(), p.stroke();
|
|
14017
14031
|
}
|
|
14018
|
-
},
|
|
14032
|
+
}, ae = (e) => {
|
|
14019
14033
|
let t = u.value.find((t) => t.id === e.centerId);
|
|
14020
14034
|
if (t) {
|
|
14021
14035
|
let n = j(t.x, t.y);
|
|
14022
14036
|
p.beginPath(), p.arc(n.x, n.y, e.radius * 50, -e.endAngle, -e.startAngle), p.stroke();
|
|
14023
14037
|
}
|
|
14024
|
-
},
|
|
14038
|
+
}, oe = () => {
|
|
14025
14039
|
p.strokeStyle = "#409eff", p.lineWidth = 1, p.setLineDash([5, 5]);
|
|
14026
|
-
for (let e of d.value)
|
|
14040
|
+
for (let e of d.value) se(e);
|
|
14027
14041
|
p.setLineDash([]);
|
|
14028
|
-
},
|
|
14042
|
+
}, se = (e) => {
|
|
14029
14043
|
switch (e.type) {
|
|
14030
14044
|
case "distance":
|
|
14031
|
-
|
|
14045
|
+
ce(e);
|
|
14032
14046
|
break;
|
|
14033
14047
|
case "horizontal":
|
|
14034
|
-
|
|
14048
|
+
le(e);
|
|
14035
14049
|
break;
|
|
14036
14050
|
case "vertical":
|
|
14037
|
-
|
|
14051
|
+
ue(e);
|
|
14038
14052
|
break;
|
|
14039
14053
|
}
|
|
14040
|
-
},
|
|
14054
|
+
}, ce = (e) => {
|
|
14041
14055
|
let t = u.value.find((t) => t.id === e.p1Id), n = u.value.find((t) => t.id === e.p2Id);
|
|
14042
14056
|
if (t && n) {
|
|
14043
14057
|
let r = j(t.x, t.y), i = j(n.x, n.y), a = (r.x + i.x) / 2, o = (r.y + i.y) / 2;
|
|
14044
14058
|
p.fillStyle = "#409eff", p.font = "10px Arial", p.fillText(`${e.distance.toFixed(1)}`, a + 5, o - 5);
|
|
14045
14059
|
}
|
|
14046
|
-
},
|
|
14060
|
+
}, le = (e) => {
|
|
14047
14061
|
let t = u.value.find((t) => t.id === e.lineId);
|
|
14048
14062
|
if (t) {
|
|
14049
14063
|
let e = u.value.find((e) => e.id === t.p1Id), n = u.value.find((e) => e.id === t.p2Id);
|
|
@@ -14052,7 +14066,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14052
14066
|
p.fillStyle = "#409eff", p.font = "10px Arial", p.fillText("H", i, a - 10);
|
|
14053
14067
|
}
|
|
14054
14068
|
}
|
|
14055
|
-
},
|
|
14069
|
+
}, ue = (e) => {
|
|
14056
14070
|
let t = u.value.find((t) => t.id === e.lineId);
|
|
14057
14071
|
if (t) {
|
|
14058
14072
|
let e = u.value.find((e) => e.id === t.p1Id), n = u.value.find((e) => e.id === t.p2Id);
|
|
@@ -14061,11 +14075,11 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14061
14075
|
p.fillStyle = "#409eff", p.font = "10px Arial", p.fillText("V", i, a - 10);
|
|
14062
14076
|
}
|
|
14063
14077
|
}
|
|
14064
|
-
},
|
|
14078
|
+
}, de = () => {
|
|
14065
14079
|
E && (p.strokeStyle = "#409eff", p.lineWidth = 1, p.setLineDash([5, 5]), ne(E, !0), p.setLineDash([]));
|
|
14066
|
-
},
|
|
14080
|
+
}, fe = (e) => {
|
|
14067
14081
|
s.value = e, E = null;
|
|
14068
|
-
},
|
|
14082
|
+
}, L = (e) => {
|
|
14069
14083
|
if (s.value === "select") return;
|
|
14070
14084
|
let t = i.value.getBoundingClientRect(), n = M(e.clientX - t.left, e.clientY - t.top), r = `prim_${++O}`;
|
|
14071
14085
|
switch (s.value) {
|
|
@@ -14184,12 +14198,12 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14184
14198
|
break;
|
|
14185
14199
|
}
|
|
14186
14200
|
N();
|
|
14187
|
-
},
|
|
14201
|
+
}, R = (e) => {
|
|
14188
14202
|
(e.button === 1 || e.button === 0 && e.altKey) && (C = !0, w = {
|
|
14189
14203
|
x: e.clientX,
|
|
14190
14204
|
y: e.clientY
|
|
14191
14205
|
}, e.preventDefault());
|
|
14192
|
-
},
|
|
14206
|
+
}, pe = (e) => {
|
|
14193
14207
|
if (C) {
|
|
14194
14208
|
let t = e.clientX - w.x, n = e.clientY - w.y;
|
|
14195
14209
|
b += t, x += n, w = {
|
|
@@ -14197,9 +14211,9 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14197
14211
|
y: e.clientY
|
|
14198
14212
|
}, N();
|
|
14199
14213
|
}
|
|
14200
|
-
},
|
|
14214
|
+
}, me = () => {
|
|
14201
14215
|
C = !1;
|
|
14202
|
-
},
|
|
14216
|
+
}, he = (e) => {
|
|
14203
14217
|
if (!D) {
|
|
14204
14218
|
alert("请先选择一个图元");
|
|
14205
14219
|
return;
|
|
@@ -14222,7 +14236,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14222
14236
|
break;
|
|
14223
14237
|
}
|
|
14224
14238
|
N();
|
|
14225
|
-
},
|
|
14239
|
+
}, z = async () => {
|
|
14226
14240
|
await f.initSolver();
|
|
14227
14241
|
let e = [], t = [];
|
|
14228
14242
|
for (let t of u.value) switch (t.type) {
|
|
@@ -14254,20 +14268,20 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14254
14268
|
} catch (e) {
|
|
14255
14269
|
console.error("Solve failed:", e);
|
|
14256
14270
|
}
|
|
14257
|
-
},
|
|
14271
|
+
}, ge = () => {
|
|
14258
14272
|
u.value = [], d.value = [], E = null, D = null, N();
|
|
14259
|
-
},
|
|
14273
|
+
}, B = () => {
|
|
14260
14274
|
n("finish", {
|
|
14261
14275
|
primitives: u.value,
|
|
14262
14276
|
constraints: d.value
|
|
14263
14277
|
});
|
|
14264
|
-
},
|
|
14278
|
+
}, _e = () => {
|
|
14265
14279
|
A();
|
|
14266
14280
|
};
|
|
14267
14281
|
return h(() => {
|
|
14268
|
-
A(), window.addEventListener("resize",
|
|
14282
|
+
A(), window.addEventListener("resize", _e);
|
|
14269
14283
|
}), g(() => {
|
|
14270
|
-
window.removeEventListener("resize",
|
|
14284
|
+
window.removeEventListener("resize", _e);
|
|
14271
14285
|
}), (e, t) => {
|
|
14272
14286
|
let n = S("Pointer"), f = S("el-icon"), p = S("el-button"), m = S("el-button-group"), h = S("el-divider"), g = S("ArrowDown"), v = S("el-dropdown-item"), y = S("el-dropdown-menu"), b = S("el-dropdown"), x = S("Check"), C = S("Delete");
|
|
14273
14287
|
return _(), a("div", {
|
|
@@ -14281,7 +14295,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14281
14295
|
l(p, {
|
|
14282
14296
|
size: "small",
|
|
14283
14297
|
type: s.value === "select" ? "primary" : "",
|
|
14284
|
-
onClick: t[0] ||= (e) =>
|
|
14298
|
+
onClick: t[0] ||= (e) => fe("select")
|
|
14285
14299
|
}, {
|
|
14286
14300
|
default: k(() => [l(f, null, {
|
|
14287
14301
|
default: k(() => [l(n)]),
|
|
@@ -14292,7 +14306,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14292
14306
|
l(p, {
|
|
14293
14307
|
size: "small",
|
|
14294
14308
|
type: s.value === "point" ? "primary" : "",
|
|
14295
|
-
onClick: t[1] ||= (e) =>
|
|
14309
|
+
onClick: t[1] ||= (e) => fe("point")
|
|
14296
14310
|
}, {
|
|
14297
14311
|
default: k(() => [...t[6] ||= [c(" 点 ", -1)]]),
|
|
14298
14312
|
_: 1
|
|
@@ -14300,7 +14314,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14300
14314
|
l(p, {
|
|
14301
14315
|
size: "small",
|
|
14302
14316
|
type: s.value === "line" ? "primary" : "",
|
|
14303
|
-
onClick: t[2] ||= (e) =>
|
|
14317
|
+
onClick: t[2] ||= (e) => fe("line")
|
|
14304
14318
|
}, {
|
|
14305
14319
|
default: k(() => [...t[7] ||= [c(" 线 ", -1)]]),
|
|
14306
14320
|
_: 1
|
|
@@ -14308,7 +14322,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14308
14322
|
l(p, {
|
|
14309
14323
|
size: "small",
|
|
14310
14324
|
type: s.value === "circle" ? "primary" : "",
|
|
14311
|
-
onClick: t[3] ||= (e) =>
|
|
14325
|
+
onClick: t[3] ||= (e) => fe("circle")
|
|
14312
14326
|
}, {
|
|
14313
14327
|
default: k(() => [...t[8] ||= [c(" 圆 ", -1)]]),
|
|
14314
14328
|
_: 1
|
|
@@ -14316,7 +14330,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14316
14330
|
l(p, {
|
|
14317
14331
|
size: "small",
|
|
14318
14332
|
type: s.value === "rectangle" ? "primary" : "",
|
|
14319
|
-
onClick: t[4] ||= (e) =>
|
|
14333
|
+
onClick: t[4] ||= (e) => fe("rectangle")
|
|
14320
14334
|
}, {
|
|
14321
14335
|
default: k(() => [...t[9] ||= [c(" 矩形 ", -1)]]),
|
|
14322
14336
|
_: 1
|
|
@@ -14324,7 +14338,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14324
14338
|
l(p, {
|
|
14325
14339
|
size: "small",
|
|
14326
14340
|
type: s.value === "arc" ? "primary" : "",
|
|
14327
|
-
onClick: t[5] ||= (e) =>
|
|
14341
|
+
onClick: t[5] ||= (e) => fe("arc")
|
|
14328
14342
|
}, {
|
|
14329
14343
|
default: k(() => [...t[10] ||= [c(" 弧 ", -1)]]),
|
|
14330
14344
|
_: 1
|
|
@@ -14335,7 +14349,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14335
14349
|
l(h, { direction: "vertical" }),
|
|
14336
14350
|
l(b, {
|
|
14337
14351
|
trigger: "click",
|
|
14338
|
-
onCommand:
|
|
14352
|
+
onCommand: he
|
|
14339
14353
|
}, {
|
|
14340
14354
|
dropdown: k(() => [l(y, null, {
|
|
14341
14355
|
default: k(() => [
|
|
@@ -14382,7 +14396,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14382
14396
|
l(h, { direction: "vertical" }),
|
|
14383
14397
|
l(p, {
|
|
14384
14398
|
size: "small",
|
|
14385
|
-
onClick:
|
|
14399
|
+
onClick: z
|
|
14386
14400
|
}, {
|
|
14387
14401
|
default: k(() => [l(f, null, {
|
|
14388
14402
|
default: k(() => [l(x)]),
|
|
@@ -14392,7 +14406,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14392
14406
|
}),
|
|
14393
14407
|
l(p, {
|
|
14394
14408
|
size: "small",
|
|
14395
|
-
onClick:
|
|
14409
|
+
onClick: ge
|
|
14396
14410
|
}, {
|
|
14397
14411
|
default: k(() => [l(f, null, {
|
|
14398
14412
|
default: k(() => [l(C)]),
|
|
@@ -14403,7 +14417,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14403
14417
|
l(p, {
|
|
14404
14418
|
size: "small",
|
|
14405
14419
|
type: "primary",
|
|
14406
|
-
onClick:
|
|
14420
|
+
onClick: B
|
|
14407
14421
|
}, {
|
|
14408
14422
|
default: k(() => [l(f, null, {
|
|
14409
14423
|
default: k(() => [l(x)]),
|
|
@@ -14415,10 +14429,10 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14415
14429
|
o("canvas", {
|
|
14416
14430
|
ref_key: "canvas",
|
|
14417
14431
|
ref: i,
|
|
14418
|
-
onMousedown:
|
|
14419
|
-
onMousemove:
|
|
14420
|
-
onMouseup:
|
|
14421
|
-
onClick:
|
|
14432
|
+
onMousedown: R,
|
|
14433
|
+
onMousemove: pe,
|
|
14434
|
+
onMouseup: me,
|
|
14435
|
+
onClick: L
|
|
14422
14436
|
}, null, 544),
|
|
14423
14437
|
o("div", Fd, [
|
|
14424
14438
|
o("span", null, "工具: " + T(s.value), 1),
|
|
@@ -14431,7 +14445,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14431
14445
|
}, [["__scopeId", "data-v-1382fda0"]]), Ld = { class: "feature-tree" }, Rd = { class: "tree-content" }, zd = ["onClick"], Bd = { class: "feature-icon" }, Vd = ["onBlur", "onKeyup"], Hd = ["onDblclick"], Ud = { class: "item-actions" }, Wd = {
|
|
14432
14446
|
key: 0,
|
|
14433
14447
|
class: "empty-hint"
|
|
14434
|
-
}, Gd = /*#__PURE__*/
|
|
14448
|
+
}, Gd = /*#__PURE__*/ R({
|
|
14435
14449
|
__name: "FeatureTree",
|
|
14436
14450
|
props: {
|
|
14437
14451
|
features: Array,
|
|
@@ -14522,7 +14536,7 @@ var Pd = { class: "sketch-toolbar" }, Fd = { class: "sketch-info" }, Id = /*#__P
|
|
|
14522
14536
|
}, df = {
|
|
14523
14537
|
key: 1,
|
|
14524
14538
|
class: "empty-hint"
|
|
14525
|
-
}, ff = /*#__PURE__*/
|
|
14539
|
+
}, ff = /*#__PURE__*/ R({
|
|
14526
14540
|
__name: "PropertyInspector",
|
|
14527
14541
|
props: { feature: Object },
|
|
14528
14542
|
emits: [
|
|
@@ -14782,30 +14796,30 @@ function pf() {
|
|
|
14782
14796
|
}, ne = () => o.value.length === 0 ? null : {
|
|
14783
14797
|
start: o.value[0].timestamp,
|
|
14784
14798
|
end: o.value[o.value.length - 1].timestamp
|
|
14785
|
-
},
|
|
14799
|
+
}, F = (e, t) => o.value.filter((n) => n.timestamp >= e && n.timestamp <= t), re = (e) => {
|
|
14786
14800
|
let t = o.value.findIndex((t) => t.timestamp >= e);
|
|
14787
|
-
t >= 0 && (s.value = t,
|
|
14788
|
-
},
|
|
14801
|
+
t >= 0 && (s.value = t, I(o.value[t]));
|
|
14802
|
+
}, I = (e) => {
|
|
14789
14803
|
e && (Object.keys(r).forEach((e) => delete r[e]), Object.assign(r, e.deviceData), Object.keys(i).forEach((e) => delete i[e]), Object.assign(i, e.sensorData), a.value = [...e.alarms], u.value = e.timestamp);
|
|
14790
|
-
},
|
|
14804
|
+
}, ie = (e, t) => {
|
|
14791
14805
|
if (c.value) return;
|
|
14792
14806
|
c.value = !0;
|
|
14793
|
-
let n =
|
|
14807
|
+
let n = F(e, t);
|
|
14794
14808
|
if (n.length === 0) {
|
|
14795
14809
|
c.value = !1;
|
|
14796
14810
|
return;
|
|
14797
14811
|
}
|
|
14798
|
-
s.value = 0,
|
|
14812
|
+
s.value = 0, I(n[0]), d = setInterval(() => {
|
|
14799
14813
|
if (s.value++, s.value >= n.length) {
|
|
14800
|
-
|
|
14814
|
+
oe();
|
|
14801
14815
|
return;
|
|
14802
14816
|
}
|
|
14803
|
-
|
|
14817
|
+
I(n[s.value]);
|
|
14804
14818
|
}, 1e3 / l.value);
|
|
14805
|
-
},
|
|
14819
|
+
}, ae = () => {
|
|
14806
14820
|
c.value = !1, d &&= (clearInterval(d), null);
|
|
14807
|
-
},
|
|
14808
|
-
|
|
14821
|
+
}, oe = () => {
|
|
14822
|
+
ae(), s.value = -1, u.value = null;
|
|
14809
14823
|
};
|
|
14810
14824
|
return g(() => {
|
|
14811
14825
|
x(), d && clearInterval(d);
|
|
@@ -14832,27 +14846,27 @@ function pf() {
|
|
|
14832
14846
|
clearAlarm: te,
|
|
14833
14847
|
clearAllAlarms: P,
|
|
14834
14848
|
getHistoryRange: ne,
|
|
14835
|
-
getHistoryData:
|
|
14836
|
-
seekTo:
|
|
14837
|
-
play:
|
|
14838
|
-
pause:
|
|
14839
|
-
stop:
|
|
14849
|
+
getHistoryData: F,
|
|
14850
|
+
seekTo: re,
|
|
14851
|
+
play: ie,
|
|
14852
|
+
pause: ae,
|
|
14853
|
+
stop: oe,
|
|
14840
14854
|
setSpeed: (e) => {
|
|
14841
14855
|
if (l.value = e, c.value) {
|
|
14842
14856
|
let e = s.value;
|
|
14843
|
-
|
|
14857
|
+
ae(), s.value = e;
|
|
14844
14858
|
let t = o.value;
|
|
14845
14859
|
d = setInterval(() => {
|
|
14846
14860
|
if (s.value++, s.value >= t.length) {
|
|
14847
|
-
|
|
14861
|
+
oe();
|
|
14848
14862
|
return;
|
|
14849
14863
|
}
|
|
14850
|
-
|
|
14864
|
+
I(t[s.value]);
|
|
14851
14865
|
}, 1e3 / l.value), c.value = !0;
|
|
14852
14866
|
}
|
|
14853
14867
|
},
|
|
14854
14868
|
exportHistory: (e, t) => {
|
|
14855
|
-
let n =
|
|
14869
|
+
let n = F(e, t), r = new Blob([JSON.stringify(n, null, 2)], { type: "application/json" }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
14856
14870
|
a.href = i, a.download = `digital-twin-history-${e}-${t}.json`, a.click(), URL.revokeObjectURL(i);
|
|
14857
14871
|
},
|
|
14858
14872
|
importHistory: (e) => {
|
|
@@ -15189,7 +15203,7 @@ init();
|
|
|
15189
15203
|
}
|
|
15190
15204
|
};
|
|
15191
15205
|
}
|
|
15192
|
-
var gf = /*#__PURE__*/
|
|
15206
|
+
var gf = /*#__PURE__*/ R({
|
|
15193
15207
|
__name: "DigitalTwinViewport",
|
|
15194
15208
|
props: {
|
|
15195
15209
|
devices: Array,
|
|
@@ -15290,7 +15304,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
15290
15304
|
}, [["__scopeId", "data-v-2c8848ac"]]), _f = { class: "playback-timeline" }, vf = { class: "timeline-header" }, yf = { class: "time-range-picker" }, bf = { class: "track-background" }, xf = ["title"], Sf = { class: "timeline-controls" }, Cf = { class: "controls-left" }, wf = { class: "controls-center" }, Tf = { class: "time-display" }, Ef = { class: "time-display" }, Df = { class: "controls-right" }, Of = {
|
|
15291
15305
|
key: 0,
|
|
15292
15306
|
class: "alarm-summary"
|
|
15293
|
-
}, kf = /*#__PURE__*/
|
|
15307
|
+
}, kf = /*#__PURE__*/ R({
|
|
15294
15308
|
__name: "PlaybackTimeline",
|
|
15295
15309
|
props: {
|
|
15296
15310
|
currentTime: {
|
|
@@ -15440,7 +15454,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
15440
15454
|
onClick: s[1] ||= (e) => n.$emit("stop")
|
|
15441
15455
|
}, {
|
|
15442
15456
|
default: k(() => [l(u, null, {
|
|
15443
|
-
default: k(() => [l(E(
|
|
15457
|
+
default: k(() => [l(E(ue))]),
|
|
15444
15458
|
_: 1
|
|
15445
15459
|
})]),
|
|
15446
15460
|
_: 1
|
|
@@ -15474,7 +15488,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
15474
15488
|
onClick: s[4] ||= (e) => n.$emit("step-forward")
|
|
15475
15489
|
}, {
|
|
15476
15490
|
default: k(() => [l(u, null, {
|
|
15477
|
-
default: k(() => [l(E(
|
|
15491
|
+
default: k(() => [l(E(F))]),
|
|
15478
15492
|
_: 1
|
|
15479
15493
|
})]),
|
|
15480
15494
|
_: 1
|
|
@@ -15521,7 +15535,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
15521
15535
|
title: "导出历史数据"
|
|
15522
15536
|
}, {
|
|
15523
15537
|
default: k(() => [l(u, null, {
|
|
15524
|
-
default: k(() => [l(E(
|
|
15538
|
+
default: k(() => [l(E(oe))]),
|
|
15525
15539
|
_: 1
|
|
15526
15540
|
})]),
|
|
15527
15541
|
_: 1
|
|
@@ -15553,47 +15567,47 @@ var gf = /*#__PURE__*/ L({
|
|
|
15553
15567
|
}, Qf = {
|
|
15554
15568
|
key: 0,
|
|
15555
15569
|
class: "device-panel"
|
|
15556
|
-
}, $f = { class: "panel-header" }, ep = { class: "panel-content" }, tp = { class: "prop-row" }, np = { class: "prop-row" }, rp = /*#__PURE__*/
|
|
15570
|
+
}, $f = { class: "panel-header" }, ep = { class: "panel-content" }, tp = { class: "prop-row" }, np = { class: "prop-row" }, rp = /*#__PURE__*/ R({
|
|
15557
15571
|
__name: "DigitalTwinViewer",
|
|
15558
15572
|
props: { devices: {
|
|
15559
15573
|
type: Array,
|
|
15560
15574
|
default: () => []
|
|
15561
15575
|
} },
|
|
15562
15576
|
setup(e) {
|
|
15563
|
-
let s = e, { isConnected: u, deviceData: d, sensorData: f, alarms: h, connect: g, disconnect: v, sendMessage: x, getDeviceColor: C, getDeviceAnimation: w, getSensorValue: D, getActiveAlarms: O, clearAlarm: A, clearAllAlarms: j, historyData: M, historyIndex: N, isPlaying: ee, playSpeed: te, playbackTime: ne, getHistoryRange:
|
|
15577
|
+
let s = e, { isConnected: u, deviceData: d, sensorData: f, alarms: h, connect: g, disconnect: v, sendMessage: x, getDeviceColor: C, getDeviceAnimation: w, getSensorValue: D, getActiveAlarms: O, clearAlarm: A, clearAllAlarms: j, historyData: M, historyIndex: N, isPlaying: ee, playSpeed: te, playbackTime: ne, getHistoryRange: F, getHistoryData: re, seekTo: I, play: ie, pause: ae, stop: oe, setSpeed: se, exportHistory: ce } = pf(), { isRecording: le, recordedBlob: ue, recordingDuration: de, startRecording: fe, stopRecording: L, downloadRecording: R, formatDuration: pe } = mf(), { downloadAnimationFile: me, downloadStandaloneHTML: he } = hf(), z = y("ws://localhost:8080/digital-twin"), ge = y("3d"), B = y(null), _e = y(null), V = y(null), ve = n(() => O.value), H = n(() => F()), U = (e) => {
|
|
15564
15578
|
let t = f[e];
|
|
15565
15579
|
return t ? !!(t.lastUpdate && Date.now() - t.lastUpdate > 6e4 || t.value && (t.value < 0 || t.value > 100)) : !1;
|
|
15566
15580
|
}, ye = () => {
|
|
15567
|
-
if (ee.value)
|
|
15581
|
+
if (ee.value) ae();
|
|
15568
15582
|
else {
|
|
15569
|
-
let e =
|
|
15570
|
-
e &&
|
|
15583
|
+
let e = F();
|
|
15584
|
+
e && ie(e.start, e.end);
|
|
15571
15585
|
}
|
|
15572
|
-
}, W = () => {
|
|
15573
|
-
se();
|
|
15574
15586
|
}, be = () => {
|
|
15575
|
-
|
|
15587
|
+
oe();
|
|
15576
15588
|
}, xe = () => {
|
|
15577
|
-
N.value
|
|
15578
|
-
}, Se = (
|
|
15579
|
-
|
|
15589
|
+
N.value > 0 && (N.value--, I(M.value[N.value].timestamp));
|
|
15590
|
+
}, Se = () => {
|
|
15591
|
+
N.value < M.value.length - 1 && (N.value++, I(M.value[N.value].timestamp));
|
|
15580
15592
|
}, Ce = (e) => {
|
|
15581
|
-
|
|
15593
|
+
I(e);
|
|
15594
|
+
}, W = (e) => {
|
|
15595
|
+
se(e);
|
|
15582
15596
|
}, we = (e) => {
|
|
15583
|
-
let t =
|
|
15597
|
+
let t = re(e.start, e.end);
|
|
15584
15598
|
t.length > 0 && (M.value = t);
|
|
15585
15599
|
}, Te = () => {
|
|
15586
|
-
let e =
|
|
15587
|
-
e && (
|
|
15600
|
+
let e = F();
|
|
15601
|
+
e && (ce(e.start, e.end), P.success("历史数据已导出"));
|
|
15588
15602
|
}, Ee = () => {
|
|
15589
|
-
if (
|
|
15603
|
+
if (le.value) L(), P.success("录制已停止");
|
|
15590
15604
|
else {
|
|
15591
15605
|
let e = document.querySelector(".view-3d canvas");
|
|
15592
15606
|
if (!e) {
|
|
15593
15607
|
P.warning("请切换到3D视图后再录制");
|
|
15594
15608
|
return;
|
|
15595
15609
|
}
|
|
15596
|
-
|
|
15610
|
+
fe(e) ? P.success("开始录制") : P.error("无法开始录制");
|
|
15597
15611
|
}
|
|
15598
15612
|
}, De = (e) => {
|
|
15599
15613
|
switch (e) {
|
|
@@ -15611,12 +15625,12 @@ var gf = /*#__PURE__*/ L({
|
|
|
15611
15625
|
break;
|
|
15612
15626
|
}
|
|
15613
15627
|
}, Oe = () => {
|
|
15614
|
-
|
|
15628
|
+
me(M.value, He.value, {
|
|
15615
15629
|
title: "数字孪生动画",
|
|
15616
15630
|
filename: "digital-twin-animation"
|
|
15617
15631
|
}) && P.success("动画文件已导出");
|
|
15618
15632
|
}, ke = () => {
|
|
15619
|
-
|
|
15633
|
+
he({
|
|
15620
15634
|
version: "1.0",
|
|
15621
15635
|
type: "digital-twin-animation",
|
|
15622
15636
|
title: "数字孪生回放",
|
|
@@ -15634,11 +15648,11 @@ var gf = /*#__PURE__*/ L({
|
|
|
15634
15648
|
filename: "digital-twin-playback"
|
|
15635
15649
|
}) && P.success("独立HTML播放器已导出");
|
|
15636
15650
|
}, Ae = () => {
|
|
15637
|
-
|
|
15651
|
+
R("digital-twin-recording"), P.success("视频已导出");
|
|
15638
15652
|
}, je = () => {
|
|
15639
|
-
u.value ? (v(), P.info("已断开连接")) : (g(
|
|
15653
|
+
u.value ? (v(), P.info("已断开连接")) : (g(z.value), P.success("正在连接..."));
|
|
15640
15654
|
}, Me = (e) => {
|
|
15641
|
-
|
|
15655
|
+
B.value = e;
|
|
15642
15656
|
}, Ne = (e) => {
|
|
15643
15657
|
let t = d[e];
|
|
15644
15658
|
if (!t) return "info";
|
|
@@ -15686,13 +15700,13 @@ var gf = /*#__PURE__*/ L({
|
|
|
15686
15700
|
}, n.readAsText(t), e.target.value = "";
|
|
15687
15701
|
}, Ve = y([]), He = n(() => Ve.value.length > 0 ? Ve.value : s.devices);
|
|
15688
15702
|
return (n, s) => {
|
|
15689
|
-
let g = S("el-input"), v = S("el-button"), y = S("el-tag"), x = S("el-badge"), w = S("el-button-group"), O = S("VideoCamera"), j = S("el-icon"), N = S("Refresh"), P = S("Upload"),
|
|
15703
|
+
let g = S("el-input"), v = S("el-button"), y = S("el-tag"), x = S("el-badge"), w = S("el-button-group"), O = S("VideoCamera"), j = S("el-icon"), N = S("Refresh"), P = S("Upload"), F = S("Download"), re = S("ArrowDown"), I = S("el-dropdown-item"), ie = S("el-dropdown-menu"), ae = S("el-dropdown"), oe = S("Warning"), se = S("Close");
|
|
15690
15704
|
return _(), a("div", Af, [
|
|
15691
15705
|
o("div", jf, [
|
|
15692
15706
|
o("div", Mf, [
|
|
15693
15707
|
l(g, {
|
|
15694
|
-
modelValue:
|
|
15695
|
-
"onUpdate:modelValue": s[0] ||= (e) =>
|
|
15708
|
+
modelValue: z.value,
|
|
15709
|
+
"onUpdate:modelValue": s[0] ||= (e) => z.value = e,
|
|
15696
15710
|
placeholder: "WebSocket地址 (ws://...)",
|
|
15697
15711
|
size: "small",
|
|
15698
15712
|
style: { width: "300px" },
|
|
@@ -15718,24 +15732,24 @@ var gf = /*#__PURE__*/ L({
|
|
|
15718
15732
|
default: k(() => [
|
|
15719
15733
|
l(v, {
|
|
15720
15734
|
size: "small",
|
|
15721
|
-
type:
|
|
15722
|
-
onClick: s[1] ||= (e) =>
|
|
15735
|
+
type: ge.value === "3d" ? "primary" : "",
|
|
15736
|
+
onClick: s[1] ||= (e) => ge.value = "3d"
|
|
15723
15737
|
}, {
|
|
15724
15738
|
default: k(() => [...s[5] ||= [c(" 3D视图 ", -1)]]),
|
|
15725
15739
|
_: 1
|
|
15726
15740
|
}, 8, ["type"]),
|
|
15727
15741
|
l(v, {
|
|
15728
15742
|
size: "small",
|
|
15729
|
-
type:
|
|
15730
|
-
onClick: s[2] ||= (e) =>
|
|
15743
|
+
type: ge.value === "dashboard" ? "primary" : "",
|
|
15744
|
+
onClick: s[2] ||= (e) => ge.value = "dashboard"
|
|
15731
15745
|
}, {
|
|
15732
15746
|
default: k(() => [...s[6] ||= [c(" 仪表盘 ", -1)]]),
|
|
15733
15747
|
_: 1
|
|
15734
15748
|
}, 8, ["type"]),
|
|
15735
15749
|
l(v, {
|
|
15736
15750
|
size: "small",
|
|
15737
|
-
type:
|
|
15738
|
-
onClick: s[3] ||= (e) =>
|
|
15751
|
+
type: ge.value === "alarms" ? "primary" : "",
|
|
15752
|
+
onClick: s[3] ||= (e) => ge.value = "alarms"
|
|
15739
15753
|
}, {
|
|
15740
15754
|
default: k(() => [s[7] ||= c(" 报警 ", -1), ve.value.length > 0 ? (_(), r(x, {
|
|
15741
15755
|
key: 0,
|
|
@@ -15751,14 +15765,14 @@ var gf = /*#__PURE__*/ L({
|
|
|
15751
15765
|
E(M).length > 0 ? (_(), r(v, {
|
|
15752
15766
|
key: 0,
|
|
15753
15767
|
size: "small",
|
|
15754
|
-
type: E(
|
|
15768
|
+
type: E(le) ? "danger" : "",
|
|
15755
15769
|
onClick: Ee,
|
|
15756
|
-
title: E(
|
|
15770
|
+
title: E(le) ? "停止录制" : "录制视频"
|
|
15757
15771
|
}, {
|
|
15758
15772
|
default: k(() => [l(j, null, {
|
|
15759
15773
|
default: k(() => [l(O)]),
|
|
15760
15774
|
_: 1
|
|
15761
|
-
}), c(" " + T(E(
|
|
15775
|
+
}), c(" " + T(E(le) ? "停止录制 (" + E(pe)(E(de)) + ")" : "录制"), 1)]),
|
|
15762
15776
|
_: 1
|
|
15763
15777
|
}, 8, ["type", "title"])) : i("", !0),
|
|
15764
15778
|
l(v, {
|
|
@@ -15786,31 +15800,31 @@ var gf = /*#__PURE__*/ L({
|
|
|
15786
15800
|
onClick: Re
|
|
15787
15801
|
}, {
|
|
15788
15802
|
default: k(() => [l(j, null, {
|
|
15789
|
-
default: k(() => [l(
|
|
15803
|
+
default: k(() => [l(F)]),
|
|
15790
15804
|
_: 1
|
|
15791
15805
|
})]),
|
|
15792
15806
|
_: 1
|
|
15793
15807
|
}),
|
|
15794
|
-
E(M).length > 0 ? (_(), r(
|
|
15808
|
+
E(M).length > 0 ? (_(), r(ae, {
|
|
15795
15809
|
key: 1,
|
|
15796
15810
|
onCommand: De,
|
|
15797
15811
|
size: "small"
|
|
15798
15812
|
}, {
|
|
15799
|
-
dropdown: k(() => [l(
|
|
15813
|
+
dropdown: k(() => [l(ie, null, {
|
|
15800
15814
|
default: k(() => [
|
|
15801
|
-
l(
|
|
15815
|
+
l(I, { command: "animation" }, {
|
|
15802
15816
|
default: k(() => [...s[9] ||= [c("动画文件", -1)]]),
|
|
15803
15817
|
_: 1
|
|
15804
15818
|
}),
|
|
15805
|
-
l(
|
|
15819
|
+
l(I, { command: "html" }, {
|
|
15806
15820
|
default: k(() => [...s[10] ||= [c("独立HTML播放器", -1)]]),
|
|
15807
15821
|
_: 1
|
|
15808
15822
|
}),
|
|
15809
|
-
l(
|
|
15823
|
+
l(I, { command: "history" }, {
|
|
15810
15824
|
default: k(() => [...s[11] ||= [c("历史数据", -1)]]),
|
|
15811
15825
|
_: 1
|
|
15812
15826
|
}),
|
|
15813
|
-
E(
|
|
15827
|
+
E(ue) ? (_(), r(I, {
|
|
15814
15828
|
key: 0,
|
|
15815
15829
|
command: "video"
|
|
15816
15830
|
}, {
|
|
@@ -15822,7 +15836,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
15822
15836
|
})]),
|
|
15823
15837
|
default: k(() => [l(v, { size: "small" }, {
|
|
15824
15838
|
default: k(() => [s[8] ||= c(" 导出 ", -1), l(j, null, {
|
|
15825
|
-
default: k(() => [l(
|
|
15839
|
+
default: k(() => [l(re)]),
|
|
15826
15840
|
_: 1
|
|
15827
15841
|
})]),
|
|
15828
15842
|
_: 1
|
|
@@ -15839,9 +15853,9 @@ var gf = /*#__PURE__*/ L({
|
|
|
15839
15853
|
style: { display: "none" },
|
|
15840
15854
|
onChange: Be
|
|
15841
15855
|
}, null, 544),
|
|
15842
|
-
o("div", Ff, [
|
|
15856
|
+
o("div", Ff, [ge.value === "3d" ? (_(), a("div", If, [l(gf, {
|
|
15843
15857
|
ref_key: "viewport",
|
|
15844
|
-
ref:
|
|
15858
|
+
ref: _e,
|
|
15845
15859
|
devices: e.devices,
|
|
15846
15860
|
"device-data": E(d),
|
|
15847
15861
|
"sensor-data": E(f),
|
|
@@ -15850,7 +15864,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
15850
15864
|
"devices",
|
|
15851
15865
|
"device-data",
|
|
15852
15866
|
"sensor-data"
|
|
15853
|
-
])])) :
|
|
15867
|
+
])])) : ge.value === "dashboard" ? (_(), a("div", Lf, [o("div", Rf, [(_(!0), a(t, null, b(He.value, (e) => (_(), a("div", {
|
|
15854
15868
|
key: e.id,
|
|
15855
15869
|
class: "device-card",
|
|
15856
15870
|
style: m({ borderColor: E(C)(e.id) }),
|
|
@@ -15871,7 +15885,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
15871
15885
|
key: e.id,
|
|
15872
15886
|
class: "sensor-item"
|
|
15873
15887
|
}, [o("span", Wf, T(e.name) + ":", 1), o("span", Gf, T(E(D)(e.id)), 1)]))), 128))])
|
|
15874
|
-
], 12, zf))), 128))])])) :
|
|
15888
|
+
], 12, zf))), 128))])])) : ge.value === "alarms" ? (_(), a("div", Kf, [o("div", qf, [(_(!0), a(t, null, b(E(h), (e) => (_(), a("div", {
|
|
15875
15889
|
key: e.id,
|
|
15876
15890
|
class: p(["alarm-item", { acknowledged: e.acknowledged }])
|
|
15877
15891
|
}, [
|
|
@@ -15879,7 +15893,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
15879
15893
|
class: "alarm-icon",
|
|
15880
15894
|
style: m({ color: e.severity === "critical" ? "#f56c6c" : "#e6a23c" })
|
|
15881
15895
|
}, [l(j, null, {
|
|
15882
|
-
default: k(() => [l(
|
|
15896
|
+
default: k(() => [l(oe)]),
|
|
15883
15897
|
_: 1
|
|
15884
15898
|
})], 4),
|
|
15885
15899
|
o("div", Jf, [o("div", Yf, T(e.message), 1), o("div", Xf, T(Ie(e.timestamp)), 1)]),
|
|
@@ -15892,26 +15906,26 @@ var gf = /*#__PURE__*/ L({
|
|
|
15892
15906
|
_: 1
|
|
15893
15907
|
}, 8, ["onClick"]))
|
|
15894
15908
|
], 2))), 128)), E(h).length === 0 ? (_(), a("div", Zf, " 暂无报警 ")) : i("", !0)])])) : i("", !0)]),
|
|
15895
|
-
|
|
15909
|
+
B.value ? (_(), a("div", Qf, [o("div", $f, [o("h4", null, T(B.value.name), 1), l(v, {
|
|
15896
15910
|
size: "small",
|
|
15897
15911
|
circle: "",
|
|
15898
|
-
onClick: s[4] ||= (e) =>
|
|
15912
|
+
onClick: s[4] ||= (e) => B.value = null
|
|
15899
15913
|
}, {
|
|
15900
15914
|
default: k(() => [l(j, null, {
|
|
15901
|
-
default: k(() => [l(
|
|
15915
|
+
default: k(() => [l(se)]),
|
|
15902
15916
|
_: 1
|
|
15903
15917
|
})]),
|
|
15904
15918
|
_: 1
|
|
15905
15919
|
})]), o("div", ep, [
|
|
15906
15920
|
o("div", tp, [s[14] ||= o("label", null, "状态", -1), l(y, {
|
|
15907
|
-
type: Ne(
|
|
15921
|
+
type: Ne(B.value.id),
|
|
15908
15922
|
size: "small"
|
|
15909
15923
|
}, {
|
|
15910
|
-
default: k(() => [c(T(Pe(
|
|
15924
|
+
default: k(() => [c(T(Pe(B.value.id)), 1)]),
|
|
15911
15925
|
_: 1
|
|
15912
15926
|
}, 8, ["type"])]),
|
|
15913
|
-
o("div", np, [s[15] ||= o("label", null, "最后更新", -1), o("span", null, T(Ie(Fe(
|
|
15914
|
-
(_(!0), a(t, null, b(
|
|
15927
|
+
o("div", np, [s[15] ||= o("label", null, "最后更新", -1), o("span", null, T(Ie(Fe(B.value.id))), 1)]),
|
|
15928
|
+
(_(!0), a(t, null, b(B.value.sensors, (e) => (_(), a("div", {
|
|
15915
15929
|
key: e.id,
|
|
15916
15930
|
class: "prop-row"
|
|
15917
15931
|
}, [o("label", null, T(e.name), 1), o("span", { class: p({ "sensor-anomaly": U(e.id) }) }, T(E(D)(e.id)), 3)]))), 128))
|
|
@@ -15926,11 +15940,11 @@ var gf = /*#__PURE__*/ L({
|
|
|
15926
15940
|
"play-speed": E(te),
|
|
15927
15941
|
"history-data": E(M),
|
|
15928
15942
|
onTogglePlay: ye,
|
|
15929
|
-
onStop:
|
|
15930
|
-
onStepBack:
|
|
15931
|
-
onStepForward:
|
|
15932
|
-
onSeek:
|
|
15933
|
-
onSpeedChange:
|
|
15943
|
+
onStop: be,
|
|
15944
|
+
onStepBack: xe,
|
|
15945
|
+
onStepForward: Se,
|
|
15946
|
+
onSeek: Ce,
|
|
15947
|
+
onSpeedChange: W,
|
|
15934
15948
|
onRangeChange: we,
|
|
15935
15949
|
onExportHistory: Te
|
|
15936
15950
|
}, null, 8, [
|
|
@@ -15948,7 +15962,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
15948
15962
|
}, [["__scopeId", "data-v-4373a357"]]), ip = { class: "parts-library" }, ap = { class: "library-header" }, op = { class: "library-tabs" }, sp = { class: "parts-list" }, cp = ["onClick"], lp = { class: "part-info" }, up = { class: "part-name" }, dp = { class: "part-desc" }, fp = {
|
|
15949
15963
|
key: 0,
|
|
15950
15964
|
class: "empty-hint"
|
|
15951
|
-
}, pp = /*#__PURE__*/
|
|
15965
|
+
}, pp = /*#__PURE__*/ R({
|
|
15952
15966
|
__name: "PartsLibrary",
|
|
15953
15967
|
emits: ["select-part", "add-to-scene"],
|
|
15954
15968
|
setup(e, { emit: r }) {
|
|
@@ -16198,7 +16212,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
16198
16212
|
}, [["__scopeId", "data-v-3a247ca9"]]), mp = { class: "assembly-constraints" }, hp = { class: "constraints-content" }, gp = { class: "constraint-actions" }, _p = { class: "constraints-list" }, vp = ["onClick"], yp = { class: "constraint-icon" }, bp = { class: "constraint-name" }, xp = { class: "constraint-info" }, Sp = {
|
|
16199
16213
|
key: 0,
|
|
16200
16214
|
class: "empty-hint"
|
|
16201
|
-
}, Cp = /*#__PURE__*/
|
|
16215
|
+
}, Cp = /*#__PURE__*/ R({
|
|
16202
16216
|
__name: "AssemblyConstraints",
|
|
16203
16217
|
props: {
|
|
16204
16218
|
features: Array,
|
|
@@ -16306,7 +16320,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
16306
16320
|
], 10, vp))), 128)), u.value.length === 0 ? (_(), a("div", Sp, " 暂无装配约束 ")) : i("", !0)])])]);
|
|
16307
16321
|
};
|
|
16308
16322
|
}
|
|
16309
|
-
}, [["__scopeId", "data-v-d9a4b72f"]]), wp = { class: "engineering-drawing" }, Tp = { class: "drawing-toolbar" }, Ep = { class: "drawing-container" }, Dp = /*#__PURE__*/
|
|
16323
|
+
}, [["__scopeId", "data-v-d9a4b72f"]]), wp = { class: "engineering-drawing" }, Tp = { class: "drawing-toolbar" }, Ep = { class: "drawing-container" }, Dp = /*#__PURE__*/ R({
|
|
16310
16324
|
__name: "EngineeringDrawing",
|
|
16311
16325
|
props: { features: Array },
|
|
16312
16326
|
setup(e) {
|
|
@@ -16441,7 +16455,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
16441
16455
|
}, Mp = { class: "peers-section" }, Np = { class: "section-header" }, Pp = { class: "peers-list" }, Fp = { class: "peer-item local" }, Ip = { class: "peer-name" }, Lp = { class: "peer-name" }, Rp = {
|
|
16442
16456
|
key: 0,
|
|
16443
16457
|
class: "empty-hint"
|
|
16444
|
-
}, zp = { class: "settings-section" }, Bp = { class: "setting-row" }, Vp = { class: "setting-row" }, Hp = /*#__PURE__*/
|
|
16458
|
+
}, zp = { class: "settings-section" }, Bp = { class: "setting-row" }, Vp = { class: "setting-row" }, Hp = /*#__PURE__*/ R({
|
|
16445
16459
|
__name: "CollaborationPanel",
|
|
16446
16460
|
props: {
|
|
16447
16461
|
isConnected: Boolean,
|
|
@@ -16555,7 +16569,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
16555
16569
|
]);
|
|
16556
16570
|
};
|
|
16557
16571
|
}
|
|
16558
|
-
}, [["__scopeId", "data-v-ab30c2a4"]]), Up = { class: "mobile-header" }, Wp = { class: "app-title" }, Gp = { class: "header-actions" }, Kp = { class: "mobile-content" }, qp = { class: "mobile-bottom-bar" }, Jp = ["onClick"], Yp = { class: "tab-label" }, Xp = /*#__PURE__*/
|
|
16572
|
+
}, [["__scopeId", "data-v-ab30c2a4"]]), Up = { class: "mobile-header" }, Wp = { class: "app-title" }, Gp = { class: "header-actions" }, Kp = { class: "mobile-content" }, qp = { class: "mobile-bottom-bar" }, Jp = ["onClick"], Yp = { class: "tab-label" }, Xp = /*#__PURE__*/ R({
|
|
16559
16573
|
__name: "MobileLayout",
|
|
16560
16574
|
props: {
|
|
16561
16575
|
title: {
|
|
@@ -16690,7 +16704,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
16690
16704
|
}, [["__scopeId", "data-v-a2c1154f"]]), Zp = {
|
|
16691
16705
|
key: 0,
|
|
16692
16706
|
class: "performance-monitor"
|
|
16693
|
-
}, Qp = { class: "monitor-header" }, $p = { class: "monitor-content" }, em = { class: "metric-group" }, tm = { class: "metric-bar" }, nm = { class: "metric-group" }, rm = { class: "metric-value" }, im = { class: "metric-bar" }, am = { class: "metric-group" }, om = { class: "metric-value" }, sm = { class: "metric-group" }, cm = { class: "metric-value" }, lm = { class: "metric-group" }, um = { class: "metric-value" }, dm = { class: "metric-group" }, fm = { class: "metric-value" }, pm = { class: "metric-group" }, mm = { class: "metric-value" }, hm = { class: "metric-group" }, gm = { class: "metric-value" }, _m = { class: "monitor-footer" }, vm = /*#__PURE__*/
|
|
16707
|
+
}, Qp = { class: "monitor-header" }, $p = { class: "monitor-content" }, em = { class: "metric-group" }, tm = { class: "metric-bar" }, nm = { class: "metric-group" }, rm = { class: "metric-value" }, im = { class: "metric-bar" }, am = { class: "metric-group" }, om = { class: "metric-value" }, sm = { class: "metric-group" }, cm = { class: "metric-value" }, lm = { class: "metric-group" }, um = { class: "metric-value" }, dm = { class: "metric-group" }, fm = { class: "metric-value" }, pm = { class: "metric-group" }, mm = { class: "metric-value" }, hm = { class: "metric-group" }, gm = { class: "metric-value" }, _m = { class: "monitor-footer" }, vm = /*#__PURE__*/ R({
|
|
16694
16708
|
__name: "PerformanceMonitor",
|
|
16695
16709
|
props: {
|
|
16696
16710
|
visible: Boolean,
|
|
@@ -16786,7 +16800,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
16786
16800
|
}, [["__scopeId", "data-v-e11de284"]]), ym = {
|
|
16787
16801
|
key: 0,
|
|
16788
16802
|
class: "ai-suggestions"
|
|
16789
|
-
}, bm = { class: "suggestions-list" }, xm = ["onClick"], Sm = { class: "suggestion-icon" }, Cm = { class: "suggestion-content" }, wm = { class: "suggestion-label" }, Tm = { class: "suggestion-desc" }, Em = /*#__PURE__*/
|
|
16803
|
+
}, bm = { class: "suggestions-list" }, xm = ["onClick"], Sm = { class: "suggestion-icon" }, Cm = { class: "suggestion-content" }, wm = { class: "suggestion-label" }, Tm = { class: "suggestion-desc" }, Em = /*#__PURE__*/ R({
|
|
16790
16804
|
__name: "AiSuggestions",
|
|
16791
16805
|
props: { suggestions: {
|
|
16792
16806
|
type: Array,
|
|
@@ -16803,7 +16817,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
16803
16817
|
}, [["__scopeId", "data-v-84571331"]]), Dm = { class: "help-content" }, Om = { class: "help-tabs" }, km = { class: "help-section" }, Am = {
|
|
16804
16818
|
key: 0,
|
|
16805
16819
|
class: "help-section shortcuts-section"
|
|
16806
|
-
}, jm = { class: "shortcut-grid" }, Mm = /*#__PURE__*/
|
|
16820
|
+
}, jm = { class: "shortcut-grid" }, Mm = /*#__PURE__*/ R({
|
|
16807
16821
|
__name: "HelpDialog",
|
|
16808
16822
|
props: { visible: Boolean },
|
|
16809
16823
|
emits: ["close"],
|
|
@@ -16972,7 +16986,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
16972
16986
|
}, Zm = { class: "message-avatar ai" }, Qm = { class: "chat-input-area" }, $m = {
|
|
16973
16987
|
key: 0,
|
|
16974
16988
|
class: "mention-popup"
|
|
16975
|
-
}, eh = ["onClick", "onMouseenter"], th = { key: 1 }, nh = /*#__PURE__*/
|
|
16989
|
+
}, eh = ["onClick", "onMouseenter"], th = { key: 1 }, nh = /*#__PURE__*/ R({
|
|
16976
16990
|
__name: "AiChatPanel",
|
|
16977
16991
|
props: {
|
|
16978
16992
|
visible: {
|
|
@@ -17036,7 +17050,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17036
17050
|
let i = String(r || n.name || "");
|
|
17037
17051
|
return t.has(i) ? !1 : (t.add(i), !0);
|
|
17038
17052
|
})];
|
|
17039
|
-
}), te = n(() => ee.value.length + 1), P = (e) => e.role === "ai" ? "chat-message-ai" : u.isCollab && e.user_id && e.user_id !== u.currentUser.id ? "chat-message-other" : "chat-message-user", ne = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" },
|
|
17053
|
+
}), te = n(() => ee.value.length + 1), P = (e) => e.role === "ai" ? "chat-message-ai" : u.isCollab && e.user_id && e.user_id !== u.currentUser.id ? "chat-message-other" : "chat-message-user", ne = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" }, F = (e) => (e.user_name || "U").charAt(0), I = (e) => {
|
|
17040
17054
|
if (!u.isCollab) return;
|
|
17041
17055
|
let t = typeof e == "string" ? e : e.target?.value || h.value, n = t.length, r = t.lastIndexOf("@", n);
|
|
17042
17056
|
if (r !== -1 && r < n) {
|
|
@@ -17047,20 +17061,20 @@ var gf = /*#__PURE__*/ L({
|
|
|
17047
17061
|
}
|
|
17048
17062
|
}
|
|
17049
17063
|
x.value = !1;
|
|
17050
|
-
},
|
|
17064
|
+
}, oe = () => {
|
|
17051
17065
|
x.value && (w.value = Math.min(w.value + 1, C.value.length - 1));
|
|
17052
|
-
},
|
|
17066
|
+
}, se = () => {
|
|
17053
17067
|
x.value && (w.value = Math.max(w.value - 1, 0));
|
|
17054
|
-
},
|
|
17068
|
+
}, ue = (e) => {
|
|
17055
17069
|
let t = h.value.slice(0, A), n = h.value.slice(A + D.length + 1);
|
|
17056
17070
|
h.value = `${t}@${e.name} ${n}`, x.value = !1;
|
|
17057
|
-
},
|
|
17071
|
+
}, de = (e) => {
|
|
17058
17072
|
if (e) {
|
|
17059
17073
|
if (e.shiftKey) return;
|
|
17060
17074
|
if (x.value) {
|
|
17061
17075
|
let t = C.value[w.value];
|
|
17062
17076
|
if (t) {
|
|
17063
|
-
e.preventDefault(),
|
|
17077
|
+
e.preventDefault(), ue(t);
|
|
17064
17078
|
return;
|
|
17065
17079
|
}
|
|
17066
17080
|
}
|
|
@@ -17074,12 +17088,12 @@ var gf = /*#__PURE__*/ L({
|
|
|
17074
17088
|
e && (n = e[1]);
|
|
17075
17089
|
}
|
|
17076
17090
|
d("send", t, { mentionedUser: n }), h.value = "", x.value = !1;
|
|
17077
|
-
},
|
|
17091
|
+
}, fe = () => {
|
|
17078
17092
|
f(() => {
|
|
17079
17093
|
g.value && (g.value.scrollTop = g.value.scrollHeight);
|
|
17080
17094
|
});
|
|
17081
17095
|
};
|
|
17082
|
-
return O(() => u.messages.length,
|
|
17096
|
+
return O(() => u.messages.length, fe), O(() => u.messages, fe, { deep: !0 }), (n, s) => {
|
|
17083
17097
|
let u = S("el-icon"), f = S("el-tag"), y = S("el-popover"), D = S("el-button"), O = S("el-input");
|
|
17084
17098
|
return e.visible ? (_(), a("div", {
|
|
17085
17099
|
key: 0,
|
|
@@ -17091,7 +17105,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17091
17105
|
size: 18,
|
|
17092
17106
|
color: "#409EFF"
|
|
17093
17107
|
}, {
|
|
17094
|
-
default: k(() => [l(E(
|
|
17108
|
+
default: k(() => [l(E(ce))]),
|
|
17095
17109
|
_: 1
|
|
17096
17110
|
}),
|
|
17097
17111
|
o("span", Fm, T(e.isCollab ? "协作聊天" : "AI 助手"), 1),
|
|
@@ -17137,7 +17151,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17137
17151
|
key: 0,
|
|
17138
17152
|
size: 14
|
|
17139
17153
|
}, {
|
|
17140
|
-
default: k(() => [l(E(
|
|
17154
|
+
default: k(() => [l(E(ce))]),
|
|
17141
17155
|
_: 1
|
|
17142
17156
|
})) : (_(), a("span", zm, T((e.name || "U").charAt(0)), 1))], 4),
|
|
17143
17157
|
o("span", Bm, T(e.name || "未知用户"), 1),
|
|
@@ -17173,7 +17187,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17173
17187
|
size: 18,
|
|
17174
17188
|
color: "#F56C6C"
|
|
17175
17189
|
}, {
|
|
17176
|
-
default: k(() => [l(E(
|
|
17190
|
+
default: k(() => [l(E(re))]),
|
|
17177
17191
|
_: 1
|
|
17178
17192
|
})])) : i("", !0),
|
|
17179
17193
|
l(D, {
|
|
@@ -17184,7 +17198,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17184
17198
|
title: "清空对话"
|
|
17185
17199
|
}, {
|
|
17186
17200
|
default: k(() => [l(u, null, {
|
|
17187
|
-
default: k(() => [l(E(
|
|
17201
|
+
default: k(() => [l(E(ae))]),
|
|
17188
17202
|
_: 1
|
|
17189
17203
|
})]),
|
|
17190
17204
|
_: 1
|
|
@@ -17197,7 +17211,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17197
17211
|
title: "关闭"
|
|
17198
17212
|
}, {
|
|
17199
17213
|
default: k(() => [l(u, null, {
|
|
17200
|
-
default: k(() => [l(E(
|
|
17214
|
+
default: k(() => [l(E(ie))]),
|
|
17201
17215
|
_: 1
|
|
17202
17216
|
})]),
|
|
17203
17217
|
_: 1
|
|
@@ -17213,7 +17227,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17213
17227
|
size: 40,
|
|
17214
17228
|
color: "#c0c4cc"
|
|
17215
17229
|
}, {
|
|
17216
|
-
default: k(() => [l(E(
|
|
17230
|
+
default: k(() => [l(E(ce))]),
|
|
17217
17231
|
_: 1
|
|
17218
17232
|
}),
|
|
17219
17233
|
o("p", null, T(e.isCollab ? "协作聊天室" : "你好!我是 AI 助手"), 1),
|
|
@@ -17229,9 +17243,9 @@ var gf = /*#__PURE__*/ L({
|
|
|
17229
17243
|
key: 0,
|
|
17230
17244
|
size: 16
|
|
17231
17245
|
}, {
|
|
17232
|
-
default: k(() => [l(E(
|
|
17246
|
+
default: k(() => [l(E(ce))]),
|
|
17233
17247
|
_: 1
|
|
17234
|
-
})) : (_(), a("span", Wm, T(
|
|
17248
|
+
})) : (_(), a("span", Wm, T(F(t)), 1))], 4), o("div", Gm, [
|
|
17235
17249
|
e.isCollab && t.role === "user" ? (_(), a("div", Km, [o("span", {
|
|
17236
17250
|
class: "message-sender",
|
|
17237
17251
|
style: m({ color: t.user_color || "#67C23A" })
|
|
@@ -17243,7 +17257,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17243
17257
|
o("div", Ym, T(t.time), 1)
|
|
17244
17258
|
])], 2))), 128)),
|
|
17245
17259
|
e.loading ? (_(), a("div", Xm, [o("div", Zm, [l(u, { size: 16 }, {
|
|
17246
|
-
default: k(() => [l(E(
|
|
17260
|
+
default: k(() => [l(E(ce))]),
|
|
17247
17261
|
_: 1
|
|
17248
17262
|
})]), s[7] ||= o("div", { class: "message-content" }, [o("div", { class: "message-text typing-indicator" }, [
|
|
17249
17263
|
o("span"),
|
|
@@ -17266,11 +17280,11 @@ var gf = /*#__PURE__*/ L({
|
|
|
17266
17280
|
},
|
|
17267
17281
|
placeholder: e.isCollab ? "输入消息... @提及成员" : "输入消息...",
|
|
17268
17282
|
onKeydown: [
|
|
17269
|
-
j(M(
|
|
17270
|
-
j(M(
|
|
17271
|
-
j(M(
|
|
17283
|
+
j(M(de, ["exact"]), ["enter"]),
|
|
17284
|
+
j(M(oe, ["prevent"]), ["down"]),
|
|
17285
|
+
j(M(se, ["prevent"]), ["up"])
|
|
17272
17286
|
],
|
|
17273
|
-
onInput:
|
|
17287
|
+
onInput: I,
|
|
17274
17288
|
resize: "none"
|
|
17275
17289
|
}, null, 8, [
|
|
17276
17290
|
"modelValue",
|
|
@@ -17280,7 +17294,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17280
17294
|
x.value ? (_(), a("div", $m, [(_(!0), a(t, null, b(C.value, (e, t) => (_(), a("div", {
|
|
17281
17295
|
key: e.id || e.clientId,
|
|
17282
17296
|
class: p(["mention-item", { active: t === w.value }]),
|
|
17283
|
-
onClick: (t) =>
|
|
17297
|
+
onClick: (t) => ue(e),
|
|
17284
17298
|
onMouseenter: (e) => w.value = t
|
|
17285
17299
|
}, [o("div", {
|
|
17286
17300
|
class: "mention-avatar",
|
|
@@ -17289,7 +17303,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17289
17303
|
key: 0,
|
|
17290
17304
|
size: 12
|
|
17291
17305
|
}, {
|
|
17292
|
-
default: k(() => [l(E(
|
|
17306
|
+
default: k(() => [l(E(ce))]),
|
|
17293
17307
|
_: 1
|
|
17294
17308
|
})) : (_(), a("span", th, T((e.name || "U").charAt(0)), 1))], 4), o("span", null, T(e.name), 1)], 42, eh))), 128))])) : i("", !0),
|
|
17295
17309
|
l(D, {
|
|
@@ -17297,10 +17311,10 @@ var gf = /*#__PURE__*/ L({
|
|
|
17297
17311
|
type: "primary",
|
|
17298
17312
|
circle: "",
|
|
17299
17313
|
disabled: !h.value.trim() || e.loading,
|
|
17300
|
-
onClick:
|
|
17314
|
+
onClick: de
|
|
17301
17315
|
}, {
|
|
17302
17316
|
default: k(() => [l(u, null, {
|
|
17303
|
-
default: k(() => [l(E(
|
|
17317
|
+
default: k(() => [l(E(le))]),
|
|
17304
17318
|
_: 1
|
|
17305
17319
|
})]),
|
|
17306
17320
|
_: 1
|
|
@@ -17317,7 +17331,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17317
17331
|
saveVersion: async ({ documentId: e, docType: t, content: n, userId: r, userName: i }) => {
|
|
17318
17332
|
if (!e || !t || !n) return null;
|
|
17319
17333
|
try {
|
|
17320
|
-
let { data: a } = await
|
|
17334
|
+
let { data: a } = await de.post(rh, {
|
|
17321
17335
|
document_id: e,
|
|
17322
17336
|
doc_type: t,
|
|
17323
17337
|
content: typeof n == "string" ? n : JSON.stringify(n),
|
|
@@ -17333,7 +17347,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17333
17347
|
if (!n) return [];
|
|
17334
17348
|
t.value = !0;
|
|
17335
17349
|
try {
|
|
17336
|
-
let { data: t } = await
|
|
17350
|
+
let { data: t } = await de.get(rh, {
|
|
17337
17351
|
params: { document_id: n },
|
|
17338
17352
|
timeout: ih
|
|
17339
17353
|
});
|
|
@@ -17346,7 +17360,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17346
17360
|
},
|
|
17347
17361
|
getVersionContent: async (e) => {
|
|
17348
17362
|
try {
|
|
17349
|
-
let { data: t } = await
|
|
17363
|
+
let { data: t } = await de.get(`${rh}/${e}`, { timeout: ih });
|
|
17350
17364
|
return t;
|
|
17351
17365
|
} catch (e) {
|
|
17352
17366
|
return console.warn("[useVersionHistory] Failed to get version content:", e), null;
|
|
@@ -17365,7 +17379,7 @@ var gf = /*#__PURE__*/ L({
|
|
|
17365
17379
|
}, uh = {
|
|
17366
17380
|
key: 0,
|
|
17367
17381
|
class: "current-version"
|
|
17368
|
-
}, dh = { class: "current-version-header" }, fh = { class: "version-number" }, ph = ["onClick"], mh = { class: "version-number" }, hh = { class: "version-user" }, gh = { class: "panel-footer" }, _h = /*#__PURE__*/
|
|
17382
|
+
}, dh = { class: "current-version-header" }, fh = { class: "version-number" }, ph = ["onClick"], mh = { class: "version-number" }, hh = { class: "version-user" }, gh = { class: "panel-footer" }, _h = /*#__PURE__*/ R({
|
|
17369
17383
|
__name: "VersionHistoryPanel",
|
|
17370
17384
|
props: {
|
|
17371
17385
|
modelValue: {
|
|
@@ -17426,13 +17440,13 @@ var gf = /*#__PURE__*/ L({
|
|
|
17426
17440
|
_: 1
|
|
17427
17441
|
}, 8, ["disabled", "loading"])])]),
|
|
17428
17442
|
default: k(() => [o("div", oh, [E(m) ? (_(), a("div", sh, [l(s, { class: "is-loading" }, {
|
|
17429
|
-
default: k(() => [l(E(
|
|
17443
|
+
default: k(() => [l(E(se))]),
|
|
17430
17444
|
_: 1
|
|
17431
17445
|
}), n[1] ||= o("span", null, "加载中...", -1)])) : E(f).length === 0 ? (_(), a("div", ch, [l(s, {
|
|
17432
17446
|
size: 48,
|
|
17433
17447
|
color: "#c0c4cc"
|
|
17434
17448
|
}, {
|
|
17435
|
-
default: k(() => [l(E(
|
|
17449
|
+
default: k(() => [l(E(I))]),
|
|
17436
17450
|
_: 1
|
|
17437
17451
|
}), n[2] ||= o("p", null, "暂无历史版本", -1)])) : (_(), a("div", lh, [w.value ? (_(), a("div", uh, [o("div", dh, [l(u, {
|
|
17438
17452
|
type: "success",
|
|
@@ -17523,7 +17537,7 @@ function vh() {
|
|
|
17523
17537
|
console.warn("[useChat] Failed to push to Y.Array:", e);
|
|
17524
17538
|
}
|
|
17525
17539
|
if (r.roomId) try {
|
|
17526
|
-
await
|
|
17540
|
+
await de.post(u, {
|
|
17527
17541
|
room_id: r.roomId,
|
|
17528
17542
|
role: "user",
|
|
17529
17543
|
content: t,
|
|
@@ -17549,7 +17563,7 @@ function vh() {
|
|
|
17549
17563
|
console.warn("[useChat] Failed to push AI message to Y.Array:", e);
|
|
17550
17564
|
}
|
|
17551
17565
|
if (r) try {
|
|
17552
|
-
await
|
|
17566
|
+
await de.post(u, {
|
|
17553
17567
|
room_id: r,
|
|
17554
17568
|
role: "ai",
|
|
17555
17569
|
content: t,
|
|
@@ -17561,7 +17575,7 @@ function vh() {
|
|
|
17561
17575
|
}
|
|
17562
17576
|
}, b = async (t) => {
|
|
17563
17577
|
if (t) try {
|
|
17564
|
-
let n = await
|
|
17578
|
+
let n = await de.get(u, { params: { room_id: t } });
|
|
17565
17579
|
if (Array.isArray(n.data)) {
|
|
17566
17580
|
let t = n.data.map((e) => ({
|
|
17567
17581
|
_msgId: e._msgId || `hist-${e.id || Date.now()}`,
|
|
@@ -17580,7 +17594,7 @@ function vh() {
|
|
|
17580
17594
|
}
|
|
17581
17595
|
}, x = async (t) => {
|
|
17582
17596
|
if (e.value = [], l.clear(), t) try {
|
|
17583
|
-
await
|
|
17597
|
+
await de.delete(u, { params: { room_id: t } });
|
|
17584
17598
|
} catch (e) {
|
|
17585
17599
|
console.warn("[useChat] Failed to clear messages on server:", e);
|
|
17586
17600
|
}
|
|
@@ -17614,54 +17628,165 @@ function vh() {
|
|
|
17614
17628
|
};
|
|
17615
17629
|
}
|
|
17616
17630
|
//#endregion
|
|
17631
|
+
//#region ../../src/composables/useAiApi.js
|
|
17632
|
+
var yh = [
|
|
17633
|
+
"我可以帮您优化流程图布局、检查节点逻辑,或者提供流程设计建议。请问有什么需要帮助的?",
|
|
17634
|
+
"这个流程图的节点连接看起来很清晰。建议检查一下是否有遗漏的分支或异常处理路径。",
|
|
17635
|
+
"根据当前的流程结构,我建议在关键决策节点后添加明确的条件标注,使流程更易理解。",
|
|
17636
|
+
"流程图中的泳道划分很合理。如果需要,我可以帮您分析各角色的职责分配是否均衡。",
|
|
17637
|
+
"我可以帮您检查流程中是否存在循环依赖或死锁风险。需要我逐条分析吗?",
|
|
17638
|
+
"建议在流程开始和结束节点使用统一的样式,这样可以让读者更快识别流程的起止点。",
|
|
17639
|
+
"这个执行图的逻辑链路比较长,建议在中间添加一些检查点节点,便于流程监控和调试。",
|
|
17640
|
+
"我可以帮您生成流程图的文字说明文档,方便团队成员理解流程细节。"
|
|
17641
|
+
];
|
|
17642
|
+
function bh() {
|
|
17643
|
+
return yh[Math.floor(Math.random() * yh.length)];
|
|
17644
|
+
}
|
|
17645
|
+
async function xh(e, t, n) {
|
|
17646
|
+
let r = { "Content-Type": "application/json" };
|
|
17647
|
+
e.apiKey && (r.Authorization = `Bearer ${e.apiKey}`);
|
|
17648
|
+
let i = await fetch(e.url, {
|
|
17649
|
+
method: "POST",
|
|
17650
|
+
headers: r,
|
|
17651
|
+
body: JSON.stringify({
|
|
17652
|
+
model: e.model || "gpt-4o-mini",
|
|
17653
|
+
messages: t,
|
|
17654
|
+
temperature: e.temperature ?? .7,
|
|
17655
|
+
max_tokens: e.maxTokens ?? 4096
|
|
17656
|
+
}),
|
|
17657
|
+
signal: n
|
|
17658
|
+
});
|
|
17659
|
+
if (!i.ok) {
|
|
17660
|
+
let e = await i.text().catch(() => "");
|
|
17661
|
+
throw Error(`AI API error ${i.status}: ${e}`);
|
|
17662
|
+
}
|
|
17663
|
+
return (await i.json()).choices?.[0]?.message?.content || "";
|
|
17664
|
+
}
|
|
17665
|
+
function Sh(e) {
|
|
17666
|
+
let t = y(!1), n = null, r = () => {
|
|
17667
|
+
let t = typeof e == "function" ? e() : e;
|
|
17668
|
+
return !!(t && t.url);
|
|
17669
|
+
}, i = () => typeof e == "function" ? e() : e || {};
|
|
17670
|
+
return {
|
|
17671
|
+
loading: t,
|
|
17672
|
+
isAvailable: r,
|
|
17673
|
+
chat: async (e, r = []) => {
|
|
17674
|
+
let a = i();
|
|
17675
|
+
if (!a.url) return bh();
|
|
17676
|
+
t.value = !0, n && n.abort(), n = new AbortController();
|
|
17677
|
+
try {
|
|
17678
|
+
return await xh(a, [
|
|
17679
|
+
{
|
|
17680
|
+
role: "system",
|
|
17681
|
+
content: a.chatPrompt || "你是一个有帮助的AI助手,擅长文档编辑和流程设计。请简洁回答用户问题。"
|
|
17682
|
+
},
|
|
17683
|
+
...r.map((e) => ({
|
|
17684
|
+
role: e.role === "ai" ? "assistant" : "user",
|
|
17685
|
+
content: e.content
|
|
17686
|
+
})),
|
|
17687
|
+
{
|
|
17688
|
+
role: "user",
|
|
17689
|
+
content: e
|
|
17690
|
+
}
|
|
17691
|
+
], n.signal);
|
|
17692
|
+
} catch (e) {
|
|
17693
|
+
return e.name === "AbortError" ? "" : (console.warn("[useAiApi] Chat error, falling back to mock:", e), bh());
|
|
17694
|
+
} finally {
|
|
17695
|
+
t.value = !1;
|
|
17696
|
+
}
|
|
17697
|
+
},
|
|
17698
|
+
generate: async (e, r) => {
|
|
17699
|
+
let a = i();
|
|
17700
|
+
if (!a.url) return {
|
|
17701
|
+
success: !1,
|
|
17702
|
+
message: "AI生成功能开发中,敬请期待..."
|
|
17703
|
+
};
|
|
17704
|
+
t.value = !0, n && n.abort(), n = new AbortController();
|
|
17705
|
+
try {
|
|
17706
|
+
let t = await xh(a, [{
|
|
17707
|
+
role: "system",
|
|
17708
|
+
content: a.generatePrompt || `你是一个专业的${r || "流程图"}生成助手。根据用户的描述,生成对应的JSON数据结构。只返回JSON,不要包含其他文字或markdown代码块标记。`
|
|
17709
|
+
}, {
|
|
17710
|
+
role: "user",
|
|
17711
|
+
content: e
|
|
17712
|
+
}], n.signal), i = null;
|
|
17713
|
+
try {
|
|
17714
|
+
let e = t.replace(/^```(?:json)?\s*/i, "").replace(/\s*```$/i, "").trim();
|
|
17715
|
+
i = JSON.parse(e);
|
|
17716
|
+
} catch {
|
|
17717
|
+
i = null;
|
|
17718
|
+
}
|
|
17719
|
+
return {
|
|
17720
|
+
success: !0,
|
|
17721
|
+
content: t,
|
|
17722
|
+
parsed: i
|
|
17723
|
+
};
|
|
17724
|
+
} catch (e) {
|
|
17725
|
+
return e.name === "AbortError" ? {
|
|
17726
|
+
success: !1,
|
|
17727
|
+
message: "已取消"
|
|
17728
|
+
} : (console.warn("[useAiApi] Generate error:", e), {
|
|
17729
|
+
success: !1,
|
|
17730
|
+
message: `AI生成失败: ${e.message}`
|
|
17731
|
+
});
|
|
17732
|
+
} finally {
|
|
17733
|
+
t.value = !1;
|
|
17734
|
+
}
|
|
17735
|
+
},
|
|
17736
|
+
abort: () => {
|
|
17737
|
+
n &&= (n.abort(), null);
|
|
17738
|
+
}
|
|
17739
|
+
};
|
|
17740
|
+
}
|
|
17741
|
+
//#endregion
|
|
17617
17742
|
//#region ../../src/composables/useCadKernel.js
|
|
17618
|
-
var
|
|
17619
|
-
function
|
|
17620
|
-
|
|
17743
|
+
var Ch = null, wh = 0, Th = /* @__PURE__ */ new Map(), Eh = y(!1), Dh = y(!1), Oh = y(null);
|
|
17744
|
+
function kh() {
|
|
17745
|
+
Ch || (Ch = new Worker(new URL(
|
|
17621
17746
|
/* @vite-ignore */
|
|
17622
17747
|
"/assets/cadKernel.worker-UKELAxwq.js",
|
|
17623
17748
|
"" + import.meta.url
|
|
17624
|
-
), { type: "module" }),
|
|
17749
|
+
), { type: "module" }), Ch.onmessage = (e) => {
|
|
17625
17750
|
let { type: t, id: n, result: r, success: i, error: a } = e.data;
|
|
17626
17751
|
if (t === "init-complete") {
|
|
17627
|
-
|
|
17752
|
+
Eh.value = i, Dh.value = !1, i || (Oh.value = a);
|
|
17628
17753
|
return;
|
|
17629
17754
|
}
|
|
17630
|
-
let o =
|
|
17631
|
-
o && (
|
|
17632
|
-
},
|
|
17633
|
-
console.error("Worker error:", e),
|
|
17755
|
+
let o = Th.get(n);
|
|
17756
|
+
o && (Th.delete(n), t === "error" ? o.reject(Error(a)) : o.resolve(r));
|
|
17757
|
+
}, Ch.onerror = (e) => {
|
|
17758
|
+
console.error("Worker error:", e), Dh.value = !1, Oh.value = e.message;
|
|
17634
17759
|
});
|
|
17635
17760
|
}
|
|
17636
|
-
function
|
|
17761
|
+
function Ah(e, t) {
|
|
17637
17762
|
return new Promise((n, r) => {
|
|
17638
|
-
let i = ++
|
|
17639
|
-
|
|
17763
|
+
let i = ++wh;
|
|
17764
|
+
Th.set(i, {
|
|
17640
17765
|
resolve: n,
|
|
17641
17766
|
reject: r
|
|
17642
|
-
}),
|
|
17767
|
+
}), Ch.postMessage({
|
|
17643
17768
|
type: e,
|
|
17644
17769
|
id: i,
|
|
17645
17770
|
data: t
|
|
17646
17771
|
});
|
|
17647
17772
|
});
|
|
17648
17773
|
}
|
|
17649
|
-
function
|
|
17774
|
+
function jh() {
|
|
17650
17775
|
return {
|
|
17651
|
-
isInitialized:
|
|
17652
|
-
isInitializing:
|
|
17653
|
-
initError:
|
|
17776
|
+
isInitialized: Eh,
|
|
17777
|
+
isInitializing: Dh,
|
|
17778
|
+
initError: Oh,
|
|
17654
17779
|
initKernel: async () => {
|
|
17655
|
-
if (
|
|
17656
|
-
if (
|
|
17657
|
-
|
|
17780
|
+
if (Eh.value) return !0;
|
|
17781
|
+
if (Dh.value) return !1;
|
|
17782
|
+
Dh.value = !0, Oh.value = null;
|
|
17658
17783
|
try {
|
|
17659
|
-
return
|
|
17784
|
+
return kh(), await Ah("init", {}), Eh.value;
|
|
17660
17785
|
} catch (e) {
|
|
17661
|
-
return console.error("Failed to initialize CAD kernel:", e),
|
|
17786
|
+
return console.error("Failed to initialize CAD kernel:", e), Oh.value = e.message, !1;
|
|
17662
17787
|
}
|
|
17663
17788
|
},
|
|
17664
|
-
makeBox: (e, t, n, r, i, a) =>
|
|
17789
|
+
makeBox: (e, t, n, r, i, a) => Ah("makeBox", {
|
|
17665
17790
|
x1: e,
|
|
17666
17791
|
y1: t,
|
|
17667
17792
|
z1: n,
|
|
@@ -17669,40 +17794,40 @@ function Dh() {
|
|
|
17669
17794
|
y2: i,
|
|
17670
17795
|
z2: a
|
|
17671
17796
|
}),
|
|
17672
|
-
makeCylinder: (e, t, n = 32) =>
|
|
17797
|
+
makeCylinder: (e, t, n = 32) => Ah("makeCylinder", {
|
|
17673
17798
|
radius: e,
|
|
17674
17799
|
height: t,
|
|
17675
17800
|
segments: n
|
|
17676
17801
|
}),
|
|
17677
|
-
makeSphere: (e, t = 32) =>
|
|
17802
|
+
makeSphere: (e, t = 32) => Ah("makeSphere", {
|
|
17678
17803
|
radius: e,
|
|
17679
17804
|
segments: t
|
|
17680
17805
|
}),
|
|
17681
|
-
booleanUnion: (e, t) =>
|
|
17806
|
+
booleanUnion: (e, t) => Ah("booleanOperation", {
|
|
17682
17807
|
operation: "union",
|
|
17683
17808
|
shape1: e,
|
|
17684
17809
|
shape2: t
|
|
17685
17810
|
}),
|
|
17686
|
-
booleanSubtract: (e, t) =>
|
|
17811
|
+
booleanSubtract: (e, t) => Ah("booleanOperation", {
|
|
17687
17812
|
operation: "subtract",
|
|
17688
17813
|
shape1: e,
|
|
17689
17814
|
shape2: t
|
|
17690
17815
|
}),
|
|
17691
|
-
booleanIntersect: (e, t) =>
|
|
17816
|
+
booleanIntersect: (e, t) => Ah("booleanOperation", {
|
|
17692
17817
|
operation: "intersect",
|
|
17693
17818
|
shape1: e,
|
|
17694
17819
|
shape2: t
|
|
17695
17820
|
}),
|
|
17696
|
-
exportSTEP: (e) =>
|
|
17697
|
-
exportSTL: (e) =>
|
|
17821
|
+
exportSTEP: (e) => Ah("exportSTEP", { shape: e }),
|
|
17822
|
+
exportSTL: (e) => Ah("exportSTL", { shape: e }),
|
|
17698
17823
|
destroy: () => {
|
|
17699
|
-
|
|
17824
|
+
Ch && (Ch.terminate(), Ch = null, Eh.value = !1);
|
|
17700
17825
|
}
|
|
17701
17826
|
};
|
|
17702
17827
|
}
|
|
17703
17828
|
//#endregion
|
|
17704
17829
|
//#region ../../src/composables/useFeatureHistory.js
|
|
17705
|
-
function
|
|
17830
|
+
function Mh(e) {
|
|
17706
17831
|
let t = y([]), r = y(-1), i = n(() => r.value > 0), a = n(() => r.value < t.value.length - 1);
|
|
17707
17832
|
return {
|
|
17708
17833
|
canUndo: i,
|
|
@@ -17720,8 +17845,8 @@ function Oh(e) {
|
|
|
17720
17845
|
}
|
|
17721
17846
|
//#endregion
|
|
17722
17847
|
//#region ../../src/composables/useCollaboration.js
|
|
17723
|
-
function
|
|
17724
|
-
let n = new
|
|
17848
|
+
function Nh(e, t = {}) {
|
|
17849
|
+
let n = new fe.Doc(), r = y(!1), i = y(!1), a = y(null), o = y([]), s = y(!1), c = v({
|
|
17725
17850
|
name: `用户${Math.floor(Math.random() * 1e3)}`,
|
|
17726
17851
|
color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
|
|
17727
17852
|
}), l = null, u = null, d = null, f = () => {
|
|
@@ -17735,7 +17860,7 @@ function kh(e, t = {}) {
|
|
|
17735
17860
|
}, p = () => {
|
|
17736
17861
|
u &&= (clearInterval(u), null);
|
|
17737
17862
|
}, m = (t, c) => {
|
|
17738
|
-
l && h(), l = new
|
|
17863
|
+
l && h(), l = new L({
|
|
17739
17864
|
url: c || `ws://${window.location.hostname}:1234`,
|
|
17740
17865
|
name: t || (typeof e == "object" ? e.value : e),
|
|
17741
17866
|
document: n,
|
|
@@ -17847,16 +17972,16 @@ function kh(e, t = {}) {
|
|
|
17847
17972
|
let r = n.getMap(e);
|
|
17848
17973
|
return r.observe(t), () => r.unobserve(t);
|
|
17849
17974
|
},
|
|
17850
|
-
encodeState: () =>
|
|
17975
|
+
encodeState: () => fe.encodeStateAsUpdate(n),
|
|
17851
17976
|
decodeState: (e) => {
|
|
17852
|
-
|
|
17977
|
+
fe.applyUpdate(n, e);
|
|
17853
17978
|
},
|
|
17854
17979
|
getDocId: () => n.clientID
|
|
17855
17980
|
};
|
|
17856
17981
|
}
|
|
17857
17982
|
//#endregion
|
|
17858
17983
|
//#region ../../src/composables/useOfflineSupport.js
|
|
17859
|
-
function
|
|
17984
|
+
function Ph() {
|
|
17860
17985
|
let e = y(navigator.onLine), t = n(() => !e.value), r = y(null), i = y(!1), a = y("unknown"), o = async () => {
|
|
17861
17986
|
if (!("serviceWorker" in navigator)) return console.warn("Service Worker not supported"), !1;
|
|
17862
17987
|
try {
|
|
@@ -17922,7 +18047,7 @@ function Ah() {
|
|
|
17922
18047
|
}
|
|
17923
18048
|
//#endregion
|
|
17924
18049
|
//#region ../../src/composables/useResponsive.js
|
|
17925
|
-
function
|
|
18050
|
+
function Fh() {
|
|
17926
18051
|
let e = y(window.innerWidth), t = y(window.innerHeight), r = n(() => e.value < 768), i = n(() => e.value >= 768 && e.value < 1024), a = n(() => e.value >= 1024), o = n(() => e.value < 480), s = n(() => e.value > t.value ? "landscape" : "portrait"), c = {
|
|
17927
18052
|
mobile: 768,
|
|
17928
18053
|
tablet: 1024,
|
|
@@ -17970,7 +18095,7 @@ function jh() {
|
|
|
17970
18095
|
}
|
|
17971
18096
|
//#endregion
|
|
17972
18097
|
//#region ../../src/composables/useAIAssist.js
|
|
17973
|
-
function
|
|
18098
|
+
function Ih() {
|
|
17974
18099
|
let e = y(!1), t = y([]), n = v({
|
|
17975
18100
|
commands: [],
|
|
17976
18101
|
patterns: []
|
|
@@ -18224,7 +18349,7 @@ function Mh() {
|
|
|
18224
18349
|
}
|
|
18225
18350
|
//#endregion
|
|
18226
18351
|
//#region ../../src/composables/useXR.js
|
|
18227
|
-
function
|
|
18352
|
+
function Lh() {
|
|
18228
18353
|
let e = y(!1), t = y(!1), n = y(!1), r = y(!1), i = y(null), a = y(null), o = y(null), s = null, c = null, l = null, u = async () => {
|
|
18229
18354
|
if (!navigator.xr) return console.warn("WebXR not supported"), !1;
|
|
18230
18355
|
try {
|
|
@@ -18318,18 +18443,57 @@ function Nh() {
|
|
|
18318
18443
|
}
|
|
18319
18444
|
//#endregion
|
|
18320
18445
|
//#region ../../src/views/CadEditor.vue
|
|
18321
|
-
var
|
|
18446
|
+
var Rh = {
|
|
18322
18447
|
key: 1,
|
|
18323
18448
|
class: "cad-editor"
|
|
18324
|
-
},
|
|
18449
|
+
}, zh = { class: "editor-tabs" }, Bh = { class: "tabs-right" }, Vh = {
|
|
18325
18450
|
key: 1,
|
|
18326
18451
|
class: "collab-users"
|
|
18327
|
-
},
|
|
18452
|
+
}, Hh = ["title"], Uh = { class: "editor-body" }, Wh = { class: "viewport-container" }, Gh = { class: "viewport-container" }, Kh = { class: "status-bar" }, qh = { key: 0 }, Jh = "cad", Yh = /*#__PURE__*/ R({
|
|
18328
18453
|
__name: "CadEditor",
|
|
18454
|
+
props: {
|
|
18455
|
+
docId: {
|
|
18456
|
+
type: [Number, String],
|
|
18457
|
+
default: null
|
|
18458
|
+
},
|
|
18459
|
+
apiBase: {
|
|
18460
|
+
type: String,
|
|
18461
|
+
default: "/api"
|
|
18462
|
+
},
|
|
18463
|
+
saveApi: {
|
|
18464
|
+
type: [String, Function],
|
|
18465
|
+
default: null
|
|
18466
|
+
},
|
|
18467
|
+
loadApi: {
|
|
18468
|
+
type: [String, Function],
|
|
18469
|
+
default: null
|
|
18470
|
+
},
|
|
18471
|
+
wsUrl: {
|
|
18472
|
+
type: String,
|
|
18473
|
+
default: ""
|
|
18474
|
+
},
|
|
18475
|
+
user: {
|
|
18476
|
+
type: Object,
|
|
18477
|
+
default: null
|
|
18478
|
+
},
|
|
18479
|
+
uiConfig: {
|
|
18480
|
+
type: Object,
|
|
18481
|
+
default: () => ({})
|
|
18482
|
+
},
|
|
18483
|
+
aiApi: {
|
|
18484
|
+
type: [String, Object],
|
|
18485
|
+
default: null
|
|
18486
|
+
}
|
|
18487
|
+
},
|
|
18329
18488
|
setup(e) {
|
|
18330
|
-
let s = ee(), u = te(), d =
|
|
18331
|
-
|
|
18332
|
-
|
|
18489
|
+
let s = ee(), u = te(), d = e, f = n(() => ({
|
|
18490
|
+
backButton: "show",
|
|
18491
|
+
titleEditable: !0,
|
|
18492
|
+
authorEditable: !0,
|
|
18493
|
+
...d.uiConfig
|
|
18494
|
+
})), x = n(() => d.docId ?? s.params.id), C = y(null), w = jh(), D = y([]), A = 0, j = Mh(D);
|
|
18495
|
+
Ih();
|
|
18496
|
+
let M = Lh(), { isMobile: N } = Fh(), { isOffline: ne } = Ph(), F = Nh(n(() => x.value || "new-doc")), re = y(!1), I = y(!1), ie = y(null), ae = y("cad"), oe = y(!1), se = y(!1), ce = y(!1), le = y(!1), ue = y(!1), { saveVersion: fe } = ah(), L = vh(), R = Sh(() => d.aiApi), pe = y([]), me = y(!1), he = y(!1), z = y(!1), B = n(() => s.query.collab === "1"), _e = y([]), V = n(() => F.peers.value), ve = [
|
|
18333
18497
|
{
|
|
18334
18498
|
key: "cad",
|
|
18335
18499
|
label: "建模",
|
|
@@ -18350,7 +18514,7 @@ var Ph = {
|
|
|
18350
18514
|
label: "图纸",
|
|
18351
18515
|
icon: "Document"
|
|
18352
18516
|
}
|
|
18353
|
-
],
|
|
18517
|
+
], H = y([
|
|
18354
18518
|
{
|
|
18355
18519
|
id: "motor1",
|
|
18356
18520
|
name: "主电机",
|
|
@@ -18403,17 +18567,17 @@ var Ph = {
|
|
|
18403
18567
|
name: "扭矩"
|
|
18404
18568
|
}]
|
|
18405
18569
|
}
|
|
18406
|
-
]),
|
|
18570
|
+
]), U = v({
|
|
18407
18571
|
id: null,
|
|
18408
18572
|
title: "新建零件",
|
|
18409
18573
|
features: []
|
|
18410
|
-
}),
|
|
18574
|
+
}), ye = y(!1), be = y("select"), xe = y(!0), Se = y(!0), Ce = y(null), W = n(() => D.value.find((e) => e.id === Ce.value)), we = n(() => D.value.filter((e) => e.visible !== !1)), Te = n(() => ({
|
|
18411
18575
|
select: "选择",
|
|
18412
18576
|
move: "移动",
|
|
18413
18577
|
rotate: "旋转",
|
|
18414
18578
|
scale: "缩放",
|
|
18415
18579
|
sketch: "草图"
|
|
18416
|
-
})[
|
|
18580
|
+
})[be.value] || be.value), Ee = {
|
|
18417
18581
|
box: {
|
|
18418
18582
|
type: "box",
|
|
18419
18583
|
label: "立方体",
|
|
@@ -18466,11 +18630,11 @@ var Ph = {
|
|
|
18466
18630
|
height: 1
|
|
18467
18631
|
}
|
|
18468
18632
|
}
|
|
18469
|
-
},
|
|
18470
|
-
let t =
|
|
18633
|
+
}, De = (e) => {
|
|
18634
|
+
let t = Ee[e];
|
|
18471
18635
|
if (!t) return;
|
|
18472
18636
|
let n = {
|
|
18473
|
-
id: `feature-${++
|
|
18637
|
+
id: `feature-${++A}-${Date.now()}`,
|
|
18474
18638
|
type: t.type,
|
|
18475
18639
|
label: t.label,
|
|
18476
18640
|
params: { ...t.params },
|
|
@@ -18492,15 +18656,15 @@ var Ph = {
|
|
|
18492
18656
|
color: "#409eff",
|
|
18493
18657
|
visible: !0
|
|
18494
18658
|
};
|
|
18495
|
-
|
|
18496
|
-
},
|
|
18497
|
-
|
|
18498
|
-
},
|
|
18499
|
-
|
|
18659
|
+
D.value.push(n), Ce.value = n.id, dt(), rt(), P.success(`已添加 ${t.label}`);
|
|
18660
|
+
}, Oe = () => {
|
|
18661
|
+
I.value = !0, be.value = "sketch";
|
|
18662
|
+
}, ke = (e) => {
|
|
18663
|
+
ie.value = e, I.value = !1, be.value = "select";
|
|
18500
18664
|
let t = {
|
|
18501
|
-
id: `feature-${++
|
|
18665
|
+
id: `feature-${++A}-${Date.now()}`,
|
|
18502
18666
|
type: "sketch",
|
|
18503
|
-
label: `草图 ${
|
|
18667
|
+
label: `草图 ${A}`,
|
|
18504
18668
|
params: {
|
|
18505
18669
|
primitives: e.primitives,
|
|
18506
18670
|
constraints: e.constraints
|
|
@@ -18523,24 +18687,24 @@ var Ph = {
|
|
|
18523
18687
|
color: "#409eff",
|
|
18524
18688
|
visible: !0
|
|
18525
18689
|
};
|
|
18526
|
-
|
|
18527
|
-
},
|
|
18528
|
-
|
|
18529
|
-
},
|
|
18690
|
+
D.value.push(t), Ce.value = t.id, dt(), rt(), P.success("草图已完成");
|
|
18691
|
+
}, Ae = () => {
|
|
18692
|
+
I.value = !1, be.value = "select", ie.value = null;
|
|
18693
|
+
}, je = async () => {
|
|
18530
18694
|
if (!W.value || W.value.type !== "sketch") {
|
|
18531
18695
|
P.warning("请先选择一个草图进行拉伸");
|
|
18532
18696
|
return;
|
|
18533
18697
|
}
|
|
18534
|
-
if (!
|
|
18698
|
+
if (!re.value) {
|
|
18535
18699
|
P.warning("CAD内核未就绪,请稍候");
|
|
18536
18700
|
return;
|
|
18537
18701
|
}
|
|
18538
18702
|
try {
|
|
18539
18703
|
W.value.params;
|
|
18540
18704
|
let e = {
|
|
18541
|
-
id: `feature-${++
|
|
18705
|
+
id: `feature-${++A}-${Date.now()}`,
|
|
18542
18706
|
type: "extrude",
|
|
18543
|
-
label: `拉伸 ${
|
|
18707
|
+
label: `拉伸 ${A}`,
|
|
18544
18708
|
params: {
|
|
18545
18709
|
sketchId: W.value.id,
|
|
18546
18710
|
distance: 1
|
|
@@ -18563,24 +18727,24 @@ var Ph = {
|
|
|
18563
18727
|
color: "#409eff",
|
|
18564
18728
|
visible: !0
|
|
18565
18729
|
};
|
|
18566
|
-
|
|
18730
|
+
D.value.push(e), Ce.value = e.id, dt(), rt(), P.success("拉伸特征已创建");
|
|
18567
18731
|
} catch (e) {
|
|
18568
18732
|
console.error("Extrude failed:", e), P.error("拉伸失败: " + e.message);
|
|
18569
18733
|
}
|
|
18570
|
-
},
|
|
18734
|
+
}, Me = async () => {
|
|
18571
18735
|
if (!W.value || W.value.type !== "sketch") {
|
|
18572
18736
|
P.warning("请先选择一个草图进行旋转");
|
|
18573
18737
|
return;
|
|
18574
18738
|
}
|
|
18575
|
-
if (!
|
|
18739
|
+
if (!re.value) {
|
|
18576
18740
|
P.warning("CAD内核未就绪,请稍候");
|
|
18577
18741
|
return;
|
|
18578
18742
|
}
|
|
18579
18743
|
try {
|
|
18580
18744
|
let e = {
|
|
18581
|
-
id: `feature-${++
|
|
18745
|
+
id: `feature-${++A}-${Date.now()}`,
|
|
18582
18746
|
type: "revolve",
|
|
18583
|
-
label: `旋转 ${
|
|
18747
|
+
label: `旋转 ${A}`,
|
|
18584
18748
|
params: {
|
|
18585
18749
|
sketchId: W.value.id,
|
|
18586
18750
|
angle: Math.PI * 2
|
|
@@ -18603,20 +18767,20 @@ var Ph = {
|
|
|
18603
18767
|
color: "#409eff",
|
|
18604
18768
|
visible: !0
|
|
18605
18769
|
};
|
|
18606
|
-
|
|
18770
|
+
D.value.push(e), Ce.value = e.id, dt(), rt(), P.success("旋转特征已创建");
|
|
18607
18771
|
} catch (e) {
|
|
18608
18772
|
console.error("Revolve failed:", e), P.error("旋转失败: " + e.message);
|
|
18609
18773
|
}
|
|
18610
|
-
},
|
|
18774
|
+
}, Ne = async (e) => {
|
|
18611
18775
|
if (!W.value) {
|
|
18612
18776
|
P.warning("请先选择一个特征");
|
|
18613
18777
|
return;
|
|
18614
18778
|
}
|
|
18615
|
-
if (!
|
|
18779
|
+
if (!re.value) {
|
|
18616
18780
|
P.warning("CAD内核未就绪,请稍候");
|
|
18617
18781
|
return;
|
|
18618
18782
|
}
|
|
18619
|
-
let t =
|
|
18783
|
+
let t = D.value.filter((e) => e.selected);
|
|
18620
18784
|
if (t.length < 2) {
|
|
18621
18785
|
P.warning("请选择两个或更多特征进行布尔运算");
|
|
18622
18786
|
return;
|
|
@@ -18627,34 +18791,34 @@ var Ph = {
|
|
|
18627
18791
|
let i = t[r], a = null;
|
|
18628
18792
|
switch (i.type) {
|
|
18629
18793
|
case "box":
|
|
18630
|
-
a =
|
|
18794
|
+
a = w.makeBox(-i.params.width / 2, -i.params.height / 2, -i.params.depth / 2, i.params.width / 2, i.params.height / 2, i.params.depth / 2);
|
|
18631
18795
|
break;
|
|
18632
18796
|
case "cylinder":
|
|
18633
|
-
a =
|
|
18797
|
+
a = w.makeCylinder(i.params.radius, i.params.height, i.params.segments);
|
|
18634
18798
|
break;
|
|
18635
18799
|
case "sphere":
|
|
18636
|
-
a =
|
|
18800
|
+
a = w.makeSphere(i.params.radius, i.params.segments);
|
|
18637
18801
|
break;
|
|
18638
18802
|
case "cone":
|
|
18639
|
-
a =
|
|
18803
|
+
a = w.makeCone(i.params.radius, i.params.height, i.params.segments);
|
|
18640
18804
|
break;
|
|
18641
18805
|
}
|
|
18642
|
-
if (a) if (a =
|
|
18806
|
+
if (a) if (a = w.translateShape(a, i.position.x, i.position.y, i.position.z), n === null) n = a;
|
|
18643
18807
|
else switch (e) {
|
|
18644
18808
|
case "union":
|
|
18645
|
-
n =
|
|
18809
|
+
n = w.booleanUnion(n, a);
|
|
18646
18810
|
break;
|
|
18647
18811
|
case "subtract":
|
|
18648
|
-
n =
|
|
18812
|
+
n = w.booleanSubtract(n, a);
|
|
18649
18813
|
break;
|
|
18650
18814
|
case "intersect":
|
|
18651
|
-
n =
|
|
18815
|
+
n = w.booleanIntersect(n, a);
|
|
18652
18816
|
break;
|
|
18653
18817
|
}
|
|
18654
18818
|
}
|
|
18655
18819
|
if (n) {
|
|
18656
18820
|
let t = {
|
|
18657
|
-
id: `feature-${++
|
|
18821
|
+
id: `feature-${++A}-${Date.now()}`,
|
|
18658
18822
|
type: "boolean",
|
|
18659
18823
|
label: `布尔${e === "union" ? "并集" : e === "subtract" ? "差集" : "交集"}`,
|
|
18660
18824
|
operation: e,
|
|
@@ -18678,16 +18842,16 @@ var Ph = {
|
|
|
18678
18842
|
visible: !0,
|
|
18679
18843
|
shapeData: n
|
|
18680
18844
|
};
|
|
18681
|
-
|
|
18845
|
+
D.value.push(t), Ce.value = t.id, dt(), rt(), P.success("布尔运算完成");
|
|
18682
18846
|
}
|
|
18683
18847
|
} catch (e) {
|
|
18684
18848
|
console.error("Boolean operation failed:", e), P.error("布尔运算失败: " + e.message);
|
|
18685
18849
|
}
|
|
18686
|
-
},
|
|
18687
|
-
|
|
18688
|
-
},
|
|
18689
|
-
|
|
18690
|
-
},
|
|
18850
|
+
}, Pe = (e) => {
|
|
18851
|
+
Ce.value = e;
|
|
18852
|
+
}, Fe = (e) => {
|
|
18853
|
+
D.value = D.value.filter((t) => t.id !== e), Ce.value === e && (Ce.value = null), dt(), rt();
|
|
18854
|
+
}, Ie = () => {
|
|
18691
18855
|
if (!W.value) return;
|
|
18692
18856
|
let e = W.value, t = {
|
|
18693
18857
|
...JSON.parse(JSON.stringify(e)),
|
|
@@ -18699,91 +18863,91 @@ var Ph = {
|
|
|
18699
18863
|
z: e.position?.z || 0
|
|
18700
18864
|
}
|
|
18701
18865
|
};
|
|
18702
|
-
|
|
18703
|
-
},
|
|
18704
|
-
let n =
|
|
18705
|
-
n && (n.label = t),
|
|
18706
|
-
}, Pe = (e) => {
|
|
18707
|
-
let t = x.value.find((t) => t.id === e);
|
|
18708
|
-
t && (t.visible = !t.visible), $e();
|
|
18709
|
-
}, Fe = (e) => {
|
|
18710
|
-
W.value && (W.value.label = e, $e());
|
|
18711
|
-
}, Ie = (e) => {
|
|
18712
|
-
W.value && (W.value.color = e, $e());
|
|
18713
|
-
}, Le = (e) => {
|
|
18714
|
-
W.value && (W.value.position = { ...e }, $e());
|
|
18866
|
+
D.value.push(t), Ce.value = t.id, dt(), rt();
|
|
18867
|
+
}, Le = (e, t) => {
|
|
18868
|
+
let n = D.value.find((t) => t.id === e);
|
|
18869
|
+
n && (n.label = t), dt(), rt();
|
|
18715
18870
|
}, Re = (e) => {
|
|
18716
|
-
|
|
18871
|
+
let t = D.value.find((t) => t.id === e);
|
|
18872
|
+
t && (t.visible = !t.visible), rt();
|
|
18717
18873
|
}, ze = (e) => {
|
|
18718
|
-
W.value && (W.value.
|
|
18874
|
+
W.value && (W.value.label = e, rt());
|
|
18719
18875
|
}, Be = (e) => {
|
|
18720
|
-
W.value && (W.value.
|
|
18721
|
-
...W.value.params,
|
|
18722
|
-
...e
|
|
18723
|
-
}, $e());
|
|
18876
|
+
W.value && (W.value.color = e, rt());
|
|
18724
18877
|
}, Ve = (e) => {
|
|
18725
|
-
|
|
18878
|
+
W.value && (W.value.position = { ...e }, rt());
|
|
18726
18879
|
}, He = (e) => {
|
|
18727
|
-
W.value && (W.value.
|
|
18880
|
+
W.value && (W.value.rotation = { ...e }, rt());
|
|
18728
18881
|
}, Ue = (e) => {
|
|
18729
|
-
W.value && (W.value.
|
|
18882
|
+
W.value && (W.value.scale = { ...e }, rt());
|
|
18730
18883
|
}, We = (e) => {
|
|
18731
|
-
W.value && (W.value.
|
|
18884
|
+
W.value && (W.value.params = {
|
|
18885
|
+
...W.value.params,
|
|
18886
|
+
...e
|
|
18887
|
+
}, rt());
|
|
18732
18888
|
}, Ge = (e) => {
|
|
18733
|
-
|
|
18734
|
-
}, Ke = () => {
|
|
18735
|
-
|
|
18736
|
-
}, qe = () => {
|
|
18737
|
-
|
|
18738
|
-
}, Je = () => {
|
|
18739
|
-
|
|
18740
|
-
}, Ye =
|
|
18741
|
-
|
|
18742
|
-
|
|
18743
|
-
|
|
18744
|
-
|
|
18745
|
-
|
|
18746
|
-
},
|
|
18747
|
-
|
|
18748
|
-
|
|
18749
|
-
|
|
18750
|
-
|
|
18751
|
-
showAxes: U.value
|
|
18752
|
-
});
|
|
18889
|
+
Ce.value = e;
|
|
18890
|
+
}, Ke = (e) => {
|
|
18891
|
+
W.value && (W.value.position = { ...e }, rt());
|
|
18892
|
+
}, qe = (e) => {
|
|
18893
|
+
W.value && (W.value.rotation = { ...e }, rt());
|
|
18894
|
+
}, Je = (e) => {
|
|
18895
|
+
W.value && (W.value.scale = { ...e }, rt());
|
|
18896
|
+
}, Ye = (e) => {
|
|
18897
|
+
be.value = e;
|
|
18898
|
+
}, Xe = () => {
|
|
18899
|
+
C.value?.fitView();
|
|
18900
|
+
}, Ze = () => {
|
|
18901
|
+
xe.value = !xe.value, rt();
|
|
18902
|
+
}, Qe = () => {
|
|
18903
|
+
Se.value = !Se.value, rt();
|
|
18904
|
+
}, $e = async () => {
|
|
18905
|
+
let e = C.value?.scene;
|
|
18906
|
+
e && await M.enterVR(e, C.value?.camera, C.value?.renderer);
|
|
18753
18907
|
}, et = async () => {
|
|
18754
|
-
|
|
18755
|
-
|
|
18908
|
+
let e = C.value?.scene;
|
|
18909
|
+
e && await M.enterAR(e, C.value?.camera, C.value?.renderer);
|
|
18910
|
+
}, tt = n(() => `${window.location.origin}/cad-editor/${nt.value || x.value || ""}`), nt = n(() => U.id), rt = () => {
|
|
18911
|
+
me.value && F.isConnected.value && F.syncToYjs("cad", {
|
|
18912
|
+
title: U.title,
|
|
18913
|
+
features: D.value,
|
|
18914
|
+
showGrid: xe.value,
|
|
18915
|
+
showAxes: Se.value
|
|
18916
|
+
});
|
|
18917
|
+
}, it = async () => {
|
|
18918
|
+
if (me.value) return;
|
|
18919
|
+
if (!U.id && (await bt(), !U.id)) {
|
|
18756
18920
|
P.error("请先保存文档");
|
|
18757
18921
|
return;
|
|
18758
18922
|
}
|
|
18759
|
-
let e = `cad-${
|
|
18760
|
-
|
|
18761
|
-
let t = `用户${Math.floor(Math.random() * 1e3)}`, n = `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`;
|
|
18762
|
-
|
|
18923
|
+
let e = `cad-${U.id}`;
|
|
18924
|
+
F.connect(e, d.wsUrl || void 0);
|
|
18925
|
+
let t = d.user?.name || `用户${Math.floor(Math.random() * 1e3)}`, n = d.user?.color || `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`;
|
|
18926
|
+
F.setLocalUser({
|
|
18763
18927
|
name: t,
|
|
18764
18928
|
color: n
|
|
18765
18929
|
});
|
|
18766
18930
|
let r = () => {
|
|
18767
|
-
if (
|
|
18768
|
-
|
|
18769
|
-
e.title && (
|
|
18770
|
-
}),
|
|
18771
|
-
title:
|
|
18772
|
-
features:
|
|
18773
|
-
showGrid:
|
|
18774
|
-
showAxes:
|
|
18775
|
-
}),
|
|
18776
|
-
let e =
|
|
18931
|
+
if (F.isConnected.value && F.isSynced.value) {
|
|
18932
|
+
F.onRemoteChange("cad", (e) => {
|
|
18933
|
+
e.title && (U.title = e.title), e.features && (D.value = e.features), e.showGrid !== void 0 && (xe.value = e.showGrid), e.showAxes !== void 0 && (Se.value = e.showAxes);
|
|
18934
|
+
}), F.syncToYjs("cad", {
|
|
18935
|
+
title: U.title,
|
|
18936
|
+
features: D.value,
|
|
18937
|
+
showGrid: xe.value,
|
|
18938
|
+
showAxes: Se.value
|
|
18939
|
+
}), me.value = !0, z.value = !0, he.value = !1;
|
|
18940
|
+
let e = F.awareness.value;
|
|
18777
18941
|
e.on("change", () => {
|
|
18778
|
-
|
|
18942
|
+
_e.value = Array.from(e.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
|
|
18779
18943
|
clientId: e,
|
|
18780
18944
|
...t.user
|
|
18781
18945
|
}));
|
|
18782
|
-
}),
|
|
18783
|
-
ydoc:
|
|
18946
|
+
}), L.setCollabContext({
|
|
18947
|
+
ydoc: F.doc,
|
|
18784
18948
|
provider: e?.provider || null,
|
|
18785
|
-
onlineUsers:
|
|
18786
|
-
}),
|
|
18949
|
+
onlineUsers: _e
|
|
18950
|
+
}), L.setCurrentUser({
|
|
18787
18951
|
id: e.clientID,
|
|
18788
18952
|
name: t,
|
|
18789
18953
|
color: n
|
|
@@ -18791,38 +18955,38 @@ var Ph = {
|
|
|
18791
18955
|
} else setTimeout(r, 100);
|
|
18792
18956
|
};
|
|
18793
18957
|
setTimeout(r, 200);
|
|
18794
|
-
},
|
|
18795
|
-
|
|
18796
|
-
},
|
|
18797
|
-
let e =
|
|
18958
|
+
}, at = () => {
|
|
18959
|
+
F.closeCollaboration(), me.value = !1, z.value = !1, oe.value = !1, P.info("协作已关闭");
|
|
18960
|
+
}, ot = () => {
|
|
18961
|
+
let e = x.value;
|
|
18798
18962
|
if (!e) return;
|
|
18799
18963
|
let t = `cad-${e}`;
|
|
18800
|
-
|
|
18801
|
-
let n = `协作人${Math.floor(Math.random() * 1e3)}`, r = `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`;
|
|
18802
|
-
|
|
18964
|
+
F.connect(t, d.wsUrl || void 0);
|
|
18965
|
+
let n = d.user?.name || `协作人${Math.floor(Math.random() * 1e3)}`, r = d.user?.color || `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`;
|
|
18966
|
+
F.setLocalUser({
|
|
18803
18967
|
name: n,
|
|
18804
18968
|
color: r
|
|
18805
18969
|
});
|
|
18806
18970
|
let i = () => {
|
|
18807
|
-
if (
|
|
18808
|
-
if (
|
|
18809
|
-
|
|
18971
|
+
if (F.isConnected.value && F.isSynced.value) {
|
|
18972
|
+
if (F.checkCollaborationClosed()) {
|
|
18973
|
+
F.disconnect(), me.value = !1, P.warning("该协作已关闭,无法加入");
|
|
18810
18974
|
return;
|
|
18811
18975
|
}
|
|
18812
|
-
|
|
18813
|
-
e.title && (
|
|
18814
|
-
}),
|
|
18815
|
-
let e =
|
|
18976
|
+
F.onRemoteChange("cad", (e) => {
|
|
18977
|
+
e.title && (U.title = e.title), e.features && (D.value = e.features), e.showGrid !== void 0 && (xe.value = e.showGrid), e.showAxes !== void 0 && (Se.value = e.showAxes);
|
|
18978
|
+
}), me.value = !0, z.value = !1;
|
|
18979
|
+
let e = F.awareness.value;
|
|
18816
18980
|
e.on("change", () => {
|
|
18817
|
-
|
|
18981
|
+
_e.value = Array.from(e.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
|
|
18818
18982
|
clientId: e,
|
|
18819
18983
|
...t.user
|
|
18820
18984
|
}));
|
|
18821
|
-
}),
|
|
18822
|
-
ydoc:
|
|
18985
|
+
}), L.setCollabContext({
|
|
18986
|
+
ydoc: F.doc,
|
|
18823
18987
|
provider: e?.provider || null,
|
|
18824
|
-
onlineUsers:
|
|
18825
|
-
}),
|
|
18988
|
+
onlineUsers: _e
|
|
18989
|
+
}), L.setCurrentUser({
|
|
18826
18990
|
id: e.clientID,
|
|
18827
18991
|
name: n,
|
|
18828
18992
|
color: r
|
|
@@ -18830,37 +18994,37 @@ var Ph = {
|
|
|
18830
18994
|
} else setTimeout(i, 100);
|
|
18831
18995
|
};
|
|
18832
18996
|
setTimeout(i, 200);
|
|
18833
|
-
},
|
|
18834
|
-
|
|
18835
|
-
},
|
|
18836
|
-
if (
|
|
18997
|
+
}, st = () => {
|
|
18998
|
+
me.value ? at() : it();
|
|
18999
|
+
}, ct = async () => {
|
|
19000
|
+
if (me.value || await it(), !U.id && (await bt(), !U.id)) {
|
|
18837
19001
|
P.warning("请先保存文档后再分享");
|
|
18838
19002
|
return;
|
|
18839
19003
|
}
|
|
18840
|
-
let e = `${window.location.origin}/cad-editor/${
|
|
19004
|
+
let e = `${window.location.origin}/cad-editor/${U.id}?collab=1`;
|
|
18841
19005
|
try {
|
|
18842
19006
|
await navigator.clipboard.writeText(e), P.success("协作链接已复制到剪贴板");
|
|
18843
19007
|
} catch {
|
|
18844
19008
|
P.info("协作链接: " + e);
|
|
18845
19009
|
}
|
|
18846
19010
|
};
|
|
18847
|
-
O(() =>
|
|
18848
|
-
e && (
|
|
19011
|
+
O(() => F.collaborationClosed.value, (e) => {
|
|
19012
|
+
e && (me.value = !1, oe.value = !1);
|
|
18849
19013
|
});
|
|
18850
|
-
let
|
|
18851
|
-
let e =
|
|
18852
|
-
e ? (
|
|
18853
|
-
},
|
|
18854
|
-
let e =
|
|
18855
|
-
e ? (
|
|
18856
|
-
},
|
|
18857
|
-
|
|
18858
|
-
features: JSON.parse(JSON.stringify(
|
|
18859
|
-
selectedId:
|
|
19014
|
+
let lt = () => {
|
|
19015
|
+
let e = j.undo();
|
|
19016
|
+
e ? (D.value = e.features, Ce.value = e.selectedId, P.success("已撤销")) : P.info("没有可撤销的操作");
|
|
19017
|
+
}, ut = () => {
|
|
19018
|
+
let e = j.redo();
|
|
19019
|
+
e ? (D.value = e.features, Ce.value = e.selectedId, P.success("已重做")) : P.info("没有可重做的操作");
|
|
19020
|
+
}, dt = () => {
|
|
19021
|
+
j.pushState({
|
|
19022
|
+
features: JSON.parse(JSON.stringify(D.value)),
|
|
19023
|
+
selectedId: Ce.value
|
|
18860
19024
|
});
|
|
18861
|
-
},
|
|
19025
|
+
}, ft = (e) => {
|
|
18862
19026
|
let t = {
|
|
18863
|
-
id: `feature-${++
|
|
19027
|
+
id: `feature-${++A}-${Date.now()}`,
|
|
18864
19028
|
type: "part",
|
|
18865
19029
|
label: e.name,
|
|
18866
19030
|
params: { ...e.params },
|
|
@@ -18883,107 +19047,109 @@ var Ph = {
|
|
|
18883
19047
|
visible: !0,
|
|
18884
19048
|
partData: e
|
|
18885
19049
|
};
|
|
18886
|
-
|
|
18887
|
-
},
|
|
19050
|
+
D.value.push(t), Ce.value = t.id, dt(), rt(), P.success(`已添加 ${e.name}`);
|
|
19051
|
+
}, pt = (e) => {
|
|
18888
19052
|
console.log("Add constraint:", e), P.success("约束已添加");
|
|
18889
|
-
},
|
|
19053
|
+
}, mt = (e) => {
|
|
18890
19054
|
console.log("Delete constraint:", e), P.success("约束已删除");
|
|
18891
|
-
},
|
|
18892
|
-
u.push("/");
|
|
18893
|
-
},
|
|
18894
|
-
|
|
18895
|
-
|
|
18896
|
-
"根据您的建模需求,我建议先使用草图定义截面轮廓,再通过拉伸或旋转生成实体。",
|
|
18897
|
-
"我可以帮您检查装配约束是否完整,是否有遗漏的配合关系。需要我逐个分析吗?",
|
|
18898
|
-
"数字孪生场景的传感器配置很合理。建议添加实时数据绑定,增强孪生体的真实性。",
|
|
18899
|
-
"建议在复杂装配中使用子装配体功能,这样可以简化特征树结构,提高管理效率。",
|
|
18900
|
-
"我可以帮您优化CAD模型的参数化设计,使其更容易修改和迭代。",
|
|
18901
|
-
"工程图的尺寸标注建议遵循制图标准,我可以帮您检查标注是否规范完整。"
|
|
18902
|
-
], pt = async (e, t = {}) => {
|
|
18903
|
-
let n = B.id ? `${Wh}-${B.id}` : null;
|
|
18904
|
-
await ue.sendMessage(e, {
|
|
19055
|
+
}, ht = () => {
|
|
19056
|
+
d.docId ?? u.push("/");
|
|
19057
|
+
}, gt = async (e, t = {}) => {
|
|
19058
|
+
let n = U.id ? `${Jh}-${U.id}` : null;
|
|
19059
|
+
await L.sendMessage(e, {
|
|
18905
19060
|
...t,
|
|
18906
19061
|
roomId: n
|
|
18907
19062
|
});
|
|
18908
|
-
let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a =
|
|
18909
|
-
(!r || i || a.length === 0)
|
|
18910
|
-
|
|
18911
|
-
|
|
18912
|
-
|
|
18913
|
-
|
|
18914
|
-
|
|
18915
|
-
|
|
18916
|
-
|
|
19063
|
+
let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a = L.collabUsers.value.filter((e) => e.name !== L.currentUser.value.name);
|
|
19064
|
+
if (!r || i || a.length === 0) {
|
|
19065
|
+
L.loading.value = !0;
|
|
19066
|
+
try {
|
|
19067
|
+
let t = await R.chat(e, L.messages.value);
|
|
19068
|
+
L.sendAiMessage(t, n);
|
|
19069
|
+
} catch (e) {
|
|
19070
|
+
L.sendAiMessage("AI 请求失败: " + (e.message || "未知错误"), n);
|
|
19071
|
+
} finally {
|
|
19072
|
+
L.loading.value = !1;
|
|
19073
|
+
}
|
|
19074
|
+
}
|
|
19075
|
+
}, _t = () => {
|
|
19076
|
+
let e = U.id ? `${Jh}-${U.id}` : null;
|
|
19077
|
+
L.clearMessages(e);
|
|
19078
|
+
}, vt = () => {
|
|
19079
|
+
if (!nt.value) {
|
|
18917
19080
|
P.warning("请先保存文档");
|
|
18918
19081
|
return;
|
|
18919
19082
|
}
|
|
18920
|
-
|
|
18921
|
-
},
|
|
19083
|
+
ue.value = !0;
|
|
19084
|
+
}, yt = (e) => {
|
|
18922
19085
|
try {
|
|
18923
19086
|
let t = typeof e == "string" ? JSON.parse(e) : e;
|
|
18924
|
-
t.features && (
|
|
19087
|
+
t.features && (D.value = t.features), t.showGrid !== void 0 && (xe.value = t.showGrid), t.showAxes !== void 0 && (Se.value = t.showAxes);
|
|
18925
19088
|
} catch (e) {
|
|
18926
19089
|
console.error("Version apply error:", e);
|
|
18927
19090
|
}
|
|
18928
|
-
},
|
|
18929
|
-
if (
|
|
19091
|
+
}, bt = async () => {
|
|
19092
|
+
if (B.value && F.collaborationClosed.value) {
|
|
18930
19093
|
P.warning("协作已关闭,无法保存");
|
|
18931
19094
|
return;
|
|
18932
19095
|
}
|
|
18933
|
-
|
|
19096
|
+
ye.value = !0;
|
|
18934
19097
|
try {
|
|
18935
19098
|
let e = {
|
|
18936
|
-
title:
|
|
19099
|
+
title: U.title,
|
|
18937
19100
|
view_type: {
|
|
18938
19101
|
cad: "cad",
|
|
18939
19102
|
"digital-twin": "digital-twin",
|
|
18940
19103
|
assembly: "cad",
|
|
18941
19104
|
drawing: "cad"
|
|
18942
|
-
}[
|
|
19105
|
+
}[ae.value] || "cad",
|
|
18943
19106
|
config: JSON.stringify({
|
|
18944
|
-
features:
|
|
18945
|
-
showGrid:
|
|
18946
|
-
showAxes:
|
|
19107
|
+
features: D.value,
|
|
19108
|
+
showGrid: xe.value,
|
|
19109
|
+
showAxes: Se.value
|
|
18947
19110
|
})
|
|
18948
19111
|
};
|
|
18949
|
-
|
|
18950
|
-
documentId: String(
|
|
18951
|
-
docType:
|
|
19112
|
+
U.id ? typeof d.saveApi == "function" ? await d.saveApi(e, U.id) : d.saveApi ? await de.put(`${d.saveApi}/${U.id}`, e) : await de.put(`${d.apiBase}/explosion-views/${U.id}`, e) : typeof d.saveApi == "function" ? U.id = (await d.saveApi(e)).data?.id : d.saveApi ? U.id = (await de.post(d.saveApi, e)).data?.id : U.id = (await de.post(`${d.apiBase}/explosion-views/`, e)).data.id, P.success("保存成功"), fe({
|
|
19113
|
+
documentId: String(U.id || ""),
|
|
19114
|
+
docType: ae.value === "digital-twin" ? "digital-twin" : "cad",
|
|
18952
19115
|
content: JSON.stringify({
|
|
18953
|
-
features:
|
|
18954
|
-
showGrid:
|
|
18955
|
-
showAxes:
|
|
19116
|
+
features: D.value,
|
|
19117
|
+
showGrid: xe.value,
|
|
19118
|
+
showAxes: Se.value
|
|
18956
19119
|
}),
|
|
18957
|
-
userId: String(
|
|
18958
|
-
userName:
|
|
19120
|
+
userId: String(L.currentUser.value?.id || ""),
|
|
19121
|
+
userName: L.currentUser.value?.name || "未知"
|
|
18959
19122
|
});
|
|
18960
19123
|
} catch (e) {
|
|
18961
19124
|
P.error("保存失败"), console.error(e);
|
|
18962
19125
|
} finally {
|
|
18963
|
-
|
|
19126
|
+
ye.value = !1;
|
|
18964
19127
|
}
|
|
18965
|
-
},
|
|
18966
|
-
|
|
18967
|
-
|
|
19128
|
+
}, xt = async () => {
|
|
19129
|
+
let e = x.value;
|
|
19130
|
+
if (e) {
|
|
19131
|
+
ye.value = !0;
|
|
18968
19132
|
try {
|
|
18969
|
-
let
|
|
18970
|
-
|
|
18971
|
-
|
|
18972
|
-
|
|
19133
|
+
let t;
|
|
19134
|
+
t = typeof d.loadApi == "function" ? await d.loadApi(e) : d.loadApi ? await de.get(`${d.loadApi}/${e}`) : await de.get(`${d.apiBase}/explosion-views/${e}`);
|
|
19135
|
+
let n = t.data;
|
|
19136
|
+
if (U.id = n.id, U.title = n.title, n.config) {
|
|
19137
|
+
let e = JSON.parse(n.config);
|
|
19138
|
+
D.value = e.features || [], xe.value = e.showGrid !== !1, Se.value = e.showAxes !== !1;
|
|
18973
19139
|
}
|
|
18974
19140
|
} catch (e) {
|
|
18975
19141
|
console.error(e), P.error("加载文档失败");
|
|
18976
19142
|
} finally {
|
|
18977
|
-
|
|
19143
|
+
ye.value = !1;
|
|
18978
19144
|
}
|
|
18979
19145
|
}
|
|
18980
|
-
},
|
|
18981
|
-
if (!
|
|
19146
|
+
}, St = async () => {
|
|
19147
|
+
if (!re.value) {
|
|
18982
19148
|
P.warning("CAD内核未就绪,请稍候");
|
|
18983
19149
|
return;
|
|
18984
19150
|
}
|
|
18985
19151
|
try {
|
|
18986
|
-
let e =
|
|
19152
|
+
let e = D.value.filter((e) => e.selected);
|
|
18987
19153
|
if (e.length === 0) {
|
|
18988
19154
|
P.warning("请选择要导出的特征");
|
|
18989
19155
|
return;
|
|
@@ -18993,34 +19159,34 @@ var Ph = {
|
|
|
18993
19159
|
let e = null;
|
|
18994
19160
|
switch (n.type) {
|
|
18995
19161
|
case "box":
|
|
18996
|
-
e =
|
|
19162
|
+
e = w.makeBox(-n.params.width / 2, -n.params.height / 2, -n.params.depth / 2, n.params.width / 2, n.params.height / 2, n.params.depth / 2);
|
|
18997
19163
|
break;
|
|
18998
19164
|
case "cylinder":
|
|
18999
|
-
e =
|
|
19165
|
+
e = w.makeCylinder(n.params.radius, n.params.height, n.params.segments);
|
|
19000
19166
|
break;
|
|
19001
19167
|
case "sphere":
|
|
19002
|
-
e =
|
|
19168
|
+
e = w.makeSphere(n.params.radius, n.params.segments);
|
|
19003
19169
|
break;
|
|
19004
19170
|
case "cone":
|
|
19005
|
-
e =
|
|
19171
|
+
e = w.makeCone(n.params.radius, n.params.height, n.params.segments);
|
|
19006
19172
|
break;
|
|
19007
19173
|
}
|
|
19008
|
-
e && (e =
|
|
19174
|
+
e && (e = w.translateShape(e, n.position.x, n.position.y, n.position.z), t = t === null ? e : w.booleanUnion(t, e));
|
|
19009
19175
|
}
|
|
19010
19176
|
if (t) {
|
|
19011
|
-
let e =
|
|
19012
|
-
r.href = n, r.download = `${
|
|
19177
|
+
let e = w.exportSTEP(t), n = URL.createObjectURL(e), r = U.createElement("a");
|
|
19178
|
+
r.href = n, r.download = `${U.title || "model"}.step`, r.click(), URL.revokeObjectURL(n), P.success("STEP导出成功");
|
|
19013
19179
|
}
|
|
19014
19180
|
} catch (e) {
|
|
19015
19181
|
console.error("STEP export failed:", e), P.error("STEP导出失败: " + e.message);
|
|
19016
19182
|
}
|
|
19017
|
-
},
|
|
19018
|
-
if (!
|
|
19183
|
+
}, Ct = async () => {
|
|
19184
|
+
if (!re.value) {
|
|
19019
19185
|
P.warning("CAD内核未就绪,请稍候");
|
|
19020
19186
|
return;
|
|
19021
19187
|
}
|
|
19022
19188
|
try {
|
|
19023
|
-
let e =
|
|
19189
|
+
let e = D.value.filter((e) => e.selected);
|
|
19024
19190
|
if (e.length === 0) {
|
|
19025
19191
|
P.warning("请选择要导出的特征");
|
|
19026
19192
|
return;
|
|
@@ -19030,73 +19196,73 @@ var Ph = {
|
|
|
19030
19196
|
let e = null;
|
|
19031
19197
|
switch (n.type) {
|
|
19032
19198
|
case "box":
|
|
19033
|
-
e =
|
|
19199
|
+
e = w.makeBox(-n.params.width / 2, -n.params.height / 2, -n.params.depth / 2, n.params.width / 2, n.params.height / 2, n.params.depth / 2);
|
|
19034
19200
|
break;
|
|
19035
19201
|
case "cylinder":
|
|
19036
|
-
e =
|
|
19202
|
+
e = w.makeCylinder(n.params.radius, n.params.height, n.params.segments);
|
|
19037
19203
|
break;
|
|
19038
19204
|
case "sphere":
|
|
19039
|
-
e =
|
|
19205
|
+
e = w.makeSphere(n.params.radius, n.params.segments);
|
|
19040
19206
|
break;
|
|
19041
19207
|
case "cone":
|
|
19042
|
-
e =
|
|
19208
|
+
e = w.makeCone(n.params.radius, n.params.height, n.params.segments);
|
|
19043
19209
|
break;
|
|
19044
19210
|
}
|
|
19045
|
-
e && (e =
|
|
19211
|
+
e && (e = w.translateShape(e, n.position.x, n.position.y, n.position.z), t = t === null ? e : w.booleanUnion(t, e));
|
|
19046
19212
|
}
|
|
19047
19213
|
if (t) {
|
|
19048
|
-
let e =
|
|
19049
|
-
r.href = n, r.download = `${
|
|
19214
|
+
let e = w.exportSTL(t), n = URL.createObjectURL(e), r = U.createElement("a");
|
|
19215
|
+
r.href = n, r.download = `${U.title || "model"}.stl`, r.click(), URL.revokeObjectURL(n), P.success("STL导出成功");
|
|
19050
19216
|
}
|
|
19051
19217
|
} catch (e) {
|
|
19052
19218
|
console.error("STL export failed:", e), P.error("STL导出失败: " + e.message);
|
|
19053
19219
|
}
|
|
19054
|
-
},
|
|
19220
|
+
}, wt = async () => {
|
|
19055
19221
|
P.info("glTF导出功能开发中");
|
|
19056
19222
|
};
|
|
19057
19223
|
return h(async () => {
|
|
19058
|
-
let e = localStorage.getItem("editor-user-name") || `用户${Math.floor(Math.random() * 1e3)}`;
|
|
19059
|
-
localStorage.setItem("editor-user-name", e),
|
|
19060
|
-
id: Date.now(),
|
|
19224
|
+
let e = d.user?.name || localStorage.getItem("editor-user-name") || `用户${Math.floor(Math.random() * 1e3)}`;
|
|
19225
|
+
localStorage.setItem("editor-user-name", e), L.setCurrentUser({
|
|
19226
|
+
id: d.user?.id || Date.now(),
|
|
19061
19227
|
name: e,
|
|
19062
|
-
color: "#409eff"
|
|
19063
|
-
}), await
|
|
19228
|
+
color: d.user?.color || "#409eff"
|
|
19229
|
+
}), await xt(), x.value && s.query.collab === "1" && ot(), await w.initKernel() && (re.value = !0, P.success("CAD内核已就绪"));
|
|
19064
19230
|
}), g(() => {
|
|
19065
|
-
|
|
19231
|
+
M.endSession(), F.isConnected.value && F.disconnect();
|
|
19066
19232
|
}), (e, n) => {
|
|
19067
|
-
let s = S("el-radio-button"), u = S("el-radio-group"),
|
|
19068
|
-
return E(
|
|
19233
|
+
let s = S("el-radio-button"), u = S("el-radio-group"), d = S("el-tag"), h = S("Odometer"), g = S("el-icon"), v = S("el-button"), y = S("QuestionFilled"), w = S("Monitor"), O = S("Share"), A = S("Link"), j = S("Connection");
|
|
19234
|
+
return E(N) ? (_(), r(Xp, {
|
|
19069
19235
|
key: 0,
|
|
19070
|
-
title:
|
|
19071
|
-
tabs:
|
|
19072
|
-
"active-tab":
|
|
19073
|
-
onTabChange: n[0] ||= (e) =>
|
|
19236
|
+
title: U.title,
|
|
19237
|
+
tabs: ve,
|
|
19238
|
+
"active-tab": ae.value,
|
|
19239
|
+
onTabChange: n[0] ||= (e) => ae.value = e
|
|
19074
19240
|
}, {
|
|
19075
19241
|
sidebar: k(() => [l(Gd, {
|
|
19076
|
-
features:
|
|
19077
|
-
"selected-id":
|
|
19078
|
-
onSelect:
|
|
19079
|
-
onDelete:
|
|
19080
|
-
onRename:
|
|
19081
|
-
onToggleVisibility:
|
|
19242
|
+
features: D.value,
|
|
19243
|
+
"selected-id": Ce.value,
|
|
19244
|
+
onSelect: Pe,
|
|
19245
|
+
onDelete: Fe,
|
|
19246
|
+
onRename: Le,
|
|
19247
|
+
onToggleVisibility: Re
|
|
19082
19248
|
}, null, 8, ["features", "selected-id"])]),
|
|
19083
|
-
default: k(() => [
|
|
19249
|
+
default: k(() => [I.value ? (_(), r(Id, {
|
|
19084
19250
|
key: 1,
|
|
19085
|
-
onFinish:
|
|
19086
|
-
onCancel:
|
|
19251
|
+
onFinish: ke,
|
|
19252
|
+
onCancel: Ae
|
|
19087
19253
|
})) : (_(), r(Od, {
|
|
19088
19254
|
key: 0,
|
|
19089
19255
|
ref_key: "viewport",
|
|
19090
|
-
ref:
|
|
19091
|
-
features:
|
|
19092
|
-
"selected-id":
|
|
19093
|
-
"active-tool":
|
|
19094
|
-
"show-grid":
|
|
19095
|
-
"show-axes":
|
|
19096
|
-
onSelect:
|
|
19097
|
-
onPositionChange:
|
|
19098
|
-
onRotationChange:
|
|
19099
|
-
onScaleChange:
|
|
19256
|
+
ref: C,
|
|
19257
|
+
features: we.value,
|
|
19258
|
+
"selected-id": Ce.value,
|
|
19259
|
+
"active-tool": be.value,
|
|
19260
|
+
"show-grid": xe.value,
|
|
19261
|
+
"show-axes": Se.value,
|
|
19262
|
+
onSelect: Ge,
|
|
19263
|
+
onPositionChange: Ke,
|
|
19264
|
+
onRotationChange: qe,
|
|
19265
|
+
onScaleChange: Je
|
|
19100
19266
|
}, null, 8, [
|
|
19101
19267
|
"features",
|
|
19102
19268
|
"selected-id",
|
|
@@ -19105,45 +19271,49 @@ var Ph = {
|
|
|
19105
19271
|
"show-axes"
|
|
19106
19272
|
]))]),
|
|
19107
19273
|
_: 1
|
|
19108
|
-
}, 8, ["title", "active-tab"])) : (_(), a("div",
|
|
19109
|
-
l(
|
|
19110
|
-
title:
|
|
19111
|
-
"onUpdate:title": n[1] ||= (e) =>
|
|
19112
|
-
"is-loading":
|
|
19113
|
-
"active-tool":
|
|
19114
|
-
|
|
19115
|
-
|
|
19116
|
-
|
|
19117
|
-
|
|
19118
|
-
|
|
19119
|
-
|
|
19120
|
-
|
|
19121
|
-
|
|
19122
|
-
|
|
19123
|
-
|
|
19124
|
-
|
|
19125
|
-
|
|
19126
|
-
|
|
19127
|
-
|
|
19128
|
-
|
|
19129
|
-
|
|
19130
|
-
|
|
19131
|
-
|
|
19132
|
-
|
|
19133
|
-
|
|
19134
|
-
|
|
19135
|
-
|
|
19274
|
+
}, 8, ["title", "active-tab"])) : (_(), a("div", Rh, [
|
|
19275
|
+
l(ge, {
|
|
19276
|
+
title: U.title,
|
|
19277
|
+
"onUpdate:title": n[1] ||= (e) => U.title = e,
|
|
19278
|
+
"is-loading": ye.value,
|
|
19279
|
+
"active-tool": be.value,
|
|
19280
|
+
"back-button": f.value.backButton,
|
|
19281
|
+
"title-editable": f.value.titleEditable,
|
|
19282
|
+
onBack: ht,
|
|
19283
|
+
onToolChange: Ye,
|
|
19284
|
+
onAddPrimitive: De,
|
|
19285
|
+
onBooleanOperation: Ne,
|
|
19286
|
+
onStartSketch: Oe,
|
|
19287
|
+
onExtrude: je,
|
|
19288
|
+
onRevolve: Me,
|
|
19289
|
+
onUndo: lt,
|
|
19290
|
+
onRedo: ut,
|
|
19291
|
+
onSave: bt,
|
|
19292
|
+
onExportStep: St,
|
|
19293
|
+
onExportStl: Ct,
|
|
19294
|
+
onExportGlTF: wt,
|
|
19295
|
+
onFitView: Xe,
|
|
19296
|
+
onToggleGrid: Ze,
|
|
19297
|
+
onToggleAxes: Qe,
|
|
19298
|
+
"vr-supported": E(M).vrSupported.value,
|
|
19299
|
+
"ar-supported": E(M).arSupported.value,
|
|
19300
|
+
onEnterVr: $e,
|
|
19301
|
+
onEnterAr: et,
|
|
19302
|
+
"show-history": !!(nt.value || x.value),
|
|
19303
|
+
onHistory: vt
|
|
19136
19304
|
}, null, 8, [
|
|
19137
19305
|
"title",
|
|
19138
19306
|
"is-loading",
|
|
19139
19307
|
"active-tool",
|
|
19308
|
+
"back-button",
|
|
19309
|
+
"title-editable",
|
|
19140
19310
|
"vr-supported",
|
|
19141
19311
|
"ar-supported",
|
|
19142
19312
|
"show-history"
|
|
19143
19313
|
]),
|
|
19144
|
-
o("div",
|
|
19145
|
-
modelValue:
|
|
19146
|
-
"onUpdate:modelValue": n[2] ||= (e) =>
|
|
19314
|
+
o("div", zh, [l(u, {
|
|
19315
|
+
modelValue: ae.value,
|
|
19316
|
+
"onUpdate:modelValue": n[2] ||= (e) => ae.value = e,
|
|
19147
19317
|
size: "small"
|
|
19148
19318
|
}, {
|
|
19149
19319
|
default: k(() => [
|
|
@@ -19165,8 +19335,8 @@ var Ph = {
|
|
|
19165
19335
|
})
|
|
19166
19336
|
]),
|
|
19167
19337
|
_: 1
|
|
19168
|
-
}, 8, ["modelValue"]), o("div",
|
|
19169
|
-
E(
|
|
19338
|
+
}, 8, ["modelValue"]), o("div", Bh, [
|
|
19339
|
+
E(ne) ? (_(), r(d, {
|
|
19170
19340
|
key: 0,
|
|
19171
19341
|
type: "warning",
|
|
19172
19342
|
size: "small"
|
|
@@ -19177,7 +19347,7 @@ var Ph = {
|
|
|
19177
19347
|
l(v, {
|
|
19178
19348
|
size: "small",
|
|
19179
19349
|
circle: "",
|
|
19180
|
-
onClick: n[3] ||= (e) =>
|
|
19350
|
+
onClick: n[3] ||= (e) => se.value = !se.value
|
|
19181
19351
|
}, {
|
|
19182
19352
|
default: k(() => [l(g, null, {
|
|
19183
19353
|
default: k(() => [l(h)]),
|
|
@@ -19188,7 +19358,7 @@ var Ph = {
|
|
|
19188
19358
|
l(v, {
|
|
19189
19359
|
size: "small",
|
|
19190
19360
|
circle: "",
|
|
19191
|
-
onClick: n[4] ||= (e) =>
|
|
19361
|
+
onClick: n[4] ||= (e) => ce.value = !0
|
|
19192
19362
|
}, {
|
|
19193
19363
|
default: k(() => [l(g, null, {
|
|
19194
19364
|
default: k(() => [l(y)]),
|
|
@@ -19199,93 +19369,93 @@ var Ph = {
|
|
|
19199
19369
|
l(v, {
|
|
19200
19370
|
size: "small",
|
|
19201
19371
|
circle: "",
|
|
19202
|
-
type:
|
|
19203
|
-
onClick: n[5] ||= (e) =>
|
|
19372
|
+
type: le.value ? "primary" : "default",
|
|
19373
|
+
onClick: n[5] ||= (e) => le.value = !le.value,
|
|
19204
19374
|
title: "AI助手"
|
|
19205
19375
|
}, {
|
|
19206
19376
|
default: k(() => [l(g, null, {
|
|
19207
|
-
default: k(() => [l(
|
|
19377
|
+
default: k(() => [l(w)]),
|
|
19208
19378
|
_: 1
|
|
19209
19379
|
})]),
|
|
19210
19380
|
_: 1
|
|
19211
19381
|
}, 8, ["type"]),
|
|
19212
|
-
|
|
19382
|
+
V.value.length > 0 ? (_(), a("div", Vh, [(_(!0), a(t, null, b(V.value.slice(0, 5), (e) => (_(), a("div", {
|
|
19213
19383
|
key: e.clientId,
|
|
19214
19384
|
class: "collab-avatar",
|
|
19215
19385
|
style: m({ background: e.color }),
|
|
19216
19386
|
title: e.name
|
|
19217
|
-
}, T(e.name?.charAt(0) || "?"), 13,
|
|
19218
|
-
|
|
19387
|
+
}, T(e.name?.charAt(0) || "?"), 13, Hh))), 128))])) : i("", !0),
|
|
19388
|
+
B.value ? i("", !0) : (_(), r(v, {
|
|
19219
19389
|
key: 2,
|
|
19220
19390
|
size: "small",
|
|
19221
|
-
type:
|
|
19222
|
-
onClick:
|
|
19391
|
+
type: me.value ? "success" : "default",
|
|
19392
|
+
onClick: st
|
|
19223
19393
|
}, {
|
|
19224
19394
|
default: k(() => [l(g, null, {
|
|
19225
|
-
default: k(() => [l(
|
|
19395
|
+
default: k(() => [l(O)]),
|
|
19226
19396
|
_: 1
|
|
19227
|
-
}), o("span", null, T(
|
|
19397
|
+
}), o("span", null, T(me.value ? "协作中" : "协作"), 1)]),
|
|
19228
19398
|
_: 1
|
|
19229
19399
|
}, 8, ["type"])),
|
|
19230
|
-
!
|
|
19400
|
+
!B.value && me.value ? (_(), r(v, {
|
|
19231
19401
|
key: 3,
|
|
19232
19402
|
size: "small",
|
|
19233
19403
|
circle: "",
|
|
19234
|
-
onClick:
|
|
19404
|
+
onClick: ct,
|
|
19235
19405
|
title: "分享链接"
|
|
19236
19406
|
}, {
|
|
19237
19407
|
default: k(() => [l(g, null, {
|
|
19238
|
-
default: k(() => [l(
|
|
19408
|
+
default: k(() => [l(A)]),
|
|
19239
19409
|
_: 1
|
|
19240
19410
|
})]),
|
|
19241
19411
|
_: 1
|
|
19242
19412
|
})) : i("", !0),
|
|
19243
|
-
!
|
|
19413
|
+
!B.value && me.value ? (_(), r(v, {
|
|
19244
19414
|
key: 4,
|
|
19245
19415
|
size: "small",
|
|
19246
19416
|
circle: "",
|
|
19247
|
-
onClick: n[6] ||= (e) =>
|
|
19417
|
+
onClick: n[6] ||= (e) => oe.value = !oe.value,
|
|
19248
19418
|
title: "协作信息"
|
|
19249
19419
|
}, {
|
|
19250
19420
|
default: k(() => [l(g, null, {
|
|
19251
|
-
default: k(() => [l(
|
|
19421
|
+
default: k(() => [l(j)]),
|
|
19252
19422
|
_: 1
|
|
19253
19423
|
})]),
|
|
19254
19424
|
_: 1
|
|
19255
19425
|
})) : i("", !0)
|
|
19256
19426
|
])]),
|
|
19257
|
-
o("div",
|
|
19258
|
-
|
|
19427
|
+
o("div", Uh, [
|
|
19428
|
+
ae.value === "cad" ? (_(), a(t, { key: 0 }, [
|
|
19259
19429
|
l(Gd, {
|
|
19260
|
-
features:
|
|
19261
|
-
"selected-id":
|
|
19262
|
-
onSelect:
|
|
19263
|
-
onDelete:
|
|
19264
|
-
onRename:
|
|
19265
|
-
onToggleVisibility:
|
|
19430
|
+
features: D.value,
|
|
19431
|
+
"selected-id": Ce.value,
|
|
19432
|
+
onSelect: Pe,
|
|
19433
|
+
onDelete: Fe,
|
|
19434
|
+
onRename: Le,
|
|
19435
|
+
onToggleVisibility: Re
|
|
19266
19436
|
}, null, 8, ["features", "selected-id"]),
|
|
19267
|
-
o("div",
|
|
19437
|
+
o("div", Wh, [I.value ? (_(), r(Id, {
|
|
19268
19438
|
key: 1,
|
|
19269
|
-
onFinish:
|
|
19270
|
-
onCancel:
|
|
19439
|
+
onFinish: ke,
|
|
19440
|
+
onCancel: Ae
|
|
19271
19441
|
})) : (_(), r(Od, {
|
|
19272
19442
|
key: 0,
|
|
19273
19443
|
ref_key: "viewport",
|
|
19274
|
-
ref:
|
|
19275
|
-
features:
|
|
19276
|
-
"selected-id":
|
|
19277
|
-
"active-tool":
|
|
19278
|
-
"show-grid":
|
|
19279
|
-
"show-axes":
|
|
19280
|
-
onSelect:
|
|
19281
|
-
onPositionChange:
|
|
19282
|
-
onRotationChange:
|
|
19283
|
-
onScaleChange:
|
|
19284
|
-
onToolChange:
|
|
19285
|
-
onDelete:
|
|
19286
|
-
onDuplicate:
|
|
19287
|
-
onToggleGrid:
|
|
19288
|
-
onToggleAxes:
|
|
19444
|
+
ref: C,
|
|
19445
|
+
features: we.value,
|
|
19446
|
+
"selected-id": Ce.value,
|
|
19447
|
+
"active-tool": be.value,
|
|
19448
|
+
"show-grid": xe.value,
|
|
19449
|
+
"show-axes": Se.value,
|
|
19450
|
+
onSelect: Ge,
|
|
19451
|
+
onPositionChange: Ke,
|
|
19452
|
+
onRotationChange: qe,
|
|
19453
|
+
onScaleChange: Je,
|
|
19454
|
+
onToolChange: Ye,
|
|
19455
|
+
onDelete: Fe,
|
|
19456
|
+
onDuplicate: Ie,
|
|
19457
|
+
onToggleGrid: Ze,
|
|
19458
|
+
onToggleAxes: Qe
|
|
19289
19459
|
}, null, 8, [
|
|
19290
19460
|
"features",
|
|
19291
19461
|
"selected-id",
|
|
@@ -19295,30 +19465,30 @@ var Ph = {
|
|
|
19295
19465
|
]))]),
|
|
19296
19466
|
l(ff, {
|
|
19297
19467
|
feature: W.value,
|
|
19298
|
-
"onUpdate:label":
|
|
19299
|
-
"onUpdate:color":
|
|
19300
|
-
"onUpdate:position":
|
|
19301
|
-
"onUpdate:rotation":
|
|
19302
|
-
"onUpdate:scale":
|
|
19303
|
-
"onUpdate:params":
|
|
19468
|
+
"onUpdate:label": ze,
|
|
19469
|
+
"onUpdate:color": Be,
|
|
19470
|
+
"onUpdate:position": Ve,
|
|
19471
|
+
"onUpdate:rotation": He,
|
|
19472
|
+
"onUpdate:scale": Ue,
|
|
19473
|
+
"onUpdate:params": We
|
|
19304
19474
|
}, null, 8, ["feature"])
|
|
19305
|
-
], 64)) :
|
|
19475
|
+
], 64)) : ae.value === "digital-twin" ? (_(), r(rp, {
|
|
19306
19476
|
key: 1,
|
|
19307
|
-
devices:
|
|
19308
|
-
}, null, 8, ["devices"])) :
|
|
19309
|
-
l(pp, { onAddToScene:
|
|
19310
|
-
o("div",
|
|
19477
|
+
devices: H.value
|
|
19478
|
+
}, null, 8, ["devices"])) : ae.value === "assembly" ? (_(), a(t, { key: 2 }, [
|
|
19479
|
+
l(pp, { onAddToScene: ft }),
|
|
19480
|
+
o("div", Gh, [l(Od, {
|
|
19311
19481
|
ref_key: "viewport",
|
|
19312
|
-
ref:
|
|
19313
|
-
features:
|
|
19314
|
-
"selected-id":
|
|
19315
|
-
"active-tool":
|
|
19316
|
-
"show-grid":
|
|
19317
|
-
"show-axes":
|
|
19318
|
-
onSelect:
|
|
19319
|
-
onPositionChange:
|
|
19320
|
-
onRotationChange:
|
|
19321
|
-
onScaleChange:
|
|
19482
|
+
ref: C,
|
|
19483
|
+
features: we.value,
|
|
19484
|
+
"selected-id": Ce.value,
|
|
19485
|
+
"active-tool": be.value,
|
|
19486
|
+
"show-grid": xe.value,
|
|
19487
|
+
"show-axes": Se.value,
|
|
19488
|
+
onSelect: Ge,
|
|
19489
|
+
onPositionChange: Ke,
|
|
19490
|
+
onRotationChange: qe,
|
|
19491
|
+
onScaleChange: Je
|
|
19322
19492
|
}, null, 8, [
|
|
19323
19493
|
"features",
|
|
19324
19494
|
"selected-id",
|
|
@@ -19327,24 +19497,24 @@ var Ph = {
|
|
|
19327
19497
|
"show-axes"
|
|
19328
19498
|
])]),
|
|
19329
19499
|
l(Cp, {
|
|
19330
|
-
features:
|
|
19331
|
-
"selected-feature-id":
|
|
19332
|
-
onAddConstraint:
|
|
19333
|
-
onDeleteConstraint:
|
|
19500
|
+
features: D.value,
|
|
19501
|
+
"selected-feature-id": Ce.value,
|
|
19502
|
+
onAddConstraint: pt,
|
|
19503
|
+
onDeleteConstraint: mt
|
|
19334
19504
|
}, null, 8, ["features", "selected-feature-id"])
|
|
19335
|
-
], 64)) :
|
|
19505
|
+
], 64)) : ae.value === "drawing" ? (_(), r(Dp, {
|
|
19336
19506
|
key: 3,
|
|
19337
|
-
features:
|
|
19507
|
+
features: D.value
|
|
19338
19508
|
}, null, 8, ["features"])) : i("", !0),
|
|
19339
|
-
|
|
19509
|
+
oe.value && !B.value ? (_(), r(Hp, {
|
|
19340
19510
|
key: 4,
|
|
19341
|
-
"is-connected": E(
|
|
19342
|
-
peers: E(
|
|
19343
|
-
"local-user": E(
|
|
19344
|
-
"share-url":
|
|
19345
|
-
onConnect:
|
|
19346
|
-
onDisconnect:
|
|
19347
|
-
onUpdateUser: E(
|
|
19511
|
+
"is-connected": E(F).isConnected.value,
|
|
19512
|
+
peers: E(F).peers.value,
|
|
19513
|
+
"local-user": E(F).localUser,
|
|
19514
|
+
"share-url": tt.value,
|
|
19515
|
+
onConnect: it,
|
|
19516
|
+
onDisconnect: at,
|
|
19517
|
+
onUpdateUser: E(F).setLocalUser
|
|
19348
19518
|
}, null, 8, [
|
|
19349
19519
|
"is-connected",
|
|
19350
19520
|
"peers",
|
|
@@ -19353,38 +19523,38 @@ var Ph = {
|
|
|
19353
19523
|
"onUpdateUser"
|
|
19354
19524
|
])) : i("", !0),
|
|
19355
19525
|
l(Em, {
|
|
19356
|
-
suggestions:
|
|
19526
|
+
suggestions: pe.value,
|
|
19357
19527
|
onApply: e.handleAiSuggestion
|
|
19358
19528
|
}, null, 8, ["suggestions", "onApply"])
|
|
19359
19529
|
]),
|
|
19360
|
-
o("div",
|
|
19361
|
-
o("span", null, "特征: " + T(
|
|
19362
|
-
W.value ? (_(), a("span",
|
|
19363
|
-
o("span", null, "模式: " + T(
|
|
19364
|
-
o("span", { class: p(E(
|
|
19530
|
+
o("div", Kh, [
|
|
19531
|
+
o("span", null, "特征: " + T(D.value.length), 1),
|
|
19532
|
+
W.value ? (_(), a("span", qh, "选中: " + T(W.value.label), 1)) : i("", !0),
|
|
19533
|
+
o("span", null, "模式: " + T(Te.value), 1),
|
|
19534
|
+
o("span", { class: p(E(ne) ? "offline" : "online") }, T(E(ne) ? "离线" : "在线"), 3)
|
|
19365
19535
|
]),
|
|
19366
19536
|
l(vm, {
|
|
19367
|
-
visible:
|
|
19368
|
-
renderer:
|
|
19369
|
-
onClose: n[7] ||= (e) =>
|
|
19537
|
+
visible: se.value,
|
|
19538
|
+
renderer: C.value?.renderer,
|
|
19539
|
+
onClose: n[7] ||= (e) => se.value = !1
|
|
19370
19540
|
}, null, 8, ["visible", "renderer"]),
|
|
19371
19541
|
l(Mm, {
|
|
19372
|
-
visible:
|
|
19373
|
-
onClose: n[8] ||= (e) =>
|
|
19542
|
+
visible: ce.value,
|
|
19543
|
+
onClose: n[8] ||= (e) => ce.value = !1
|
|
19374
19544
|
}, null, 8, ["visible"]),
|
|
19375
19545
|
l(nh, {
|
|
19376
|
-
visible:
|
|
19377
|
-
messages: E(
|
|
19378
|
-
loading: E(
|
|
19379
|
-
"is-collab": E(
|
|
19380
|
-
"collab-users": E(
|
|
19381
|
-
"current-user": E(
|
|
19382
|
-
"is-owner":
|
|
19383
|
-
onSend:
|
|
19384
|
-
onClose: n[9] ||= (e) =>
|
|
19385
|
-
"unread-mention": E(
|
|
19386
|
-
onClearUnread: n[10] ||= (e) => E(
|
|
19387
|
-
onClear:
|
|
19546
|
+
visible: le.value,
|
|
19547
|
+
messages: E(L).messages.value,
|
|
19548
|
+
loading: E(L).loading.value,
|
|
19549
|
+
"is-collab": E(L).isCollabMode.value,
|
|
19550
|
+
"collab-users": E(L).collabUsers.value,
|
|
19551
|
+
"current-user": E(L).currentUser.value,
|
|
19552
|
+
"is-owner": z.value,
|
|
19553
|
+
onSend: gt,
|
|
19554
|
+
onClose: n[9] ||= (e) => le.value = !1,
|
|
19555
|
+
"unread-mention": E(L).unreadMention.value,
|
|
19556
|
+
onClearUnread: n[10] ||= (e) => E(L).clearUnreadMention(),
|
|
19557
|
+
onClear: _t
|
|
19388
19558
|
}, null, 8, [
|
|
19389
19559
|
"visible",
|
|
19390
19560
|
"messages",
|
|
@@ -19396,15 +19566,15 @@ var Ph = {
|
|
|
19396
19566
|
"unread-mention"
|
|
19397
19567
|
]),
|
|
19398
19568
|
l(_h, {
|
|
19399
|
-
modelValue:
|
|
19400
|
-
"onUpdate:modelValue": n[11] ||= (e) =>
|
|
19401
|
-
"document-id":
|
|
19402
|
-
onApply:
|
|
19569
|
+
modelValue: ue.value,
|
|
19570
|
+
"onUpdate:modelValue": n[11] ||= (e) => ue.value = e,
|
|
19571
|
+
"document-id": nt.value || x.value,
|
|
19572
|
+
onApply: yt
|
|
19403
19573
|
}, null, 8, ["modelValue", "document-id"])
|
|
19404
19574
|
]));
|
|
19405
19575
|
};
|
|
19406
19576
|
}
|
|
19407
|
-
}, [["__scopeId", "data-v-
|
|
19577
|
+
}, [["__scopeId", "data-v-25c323f2"]]), Xh = u({
|
|
19408
19578
|
name: "YourCompanyCad",
|
|
19409
19579
|
props: {
|
|
19410
19580
|
docId: {
|
|
@@ -19415,6 +19585,14 @@ var Ph = {
|
|
|
19415
19585
|
type: String,
|
|
19416
19586
|
default: "/api"
|
|
19417
19587
|
},
|
|
19588
|
+
saveApi: {
|
|
19589
|
+
type: [String, Function],
|
|
19590
|
+
default: null
|
|
19591
|
+
},
|
|
19592
|
+
loadApi: {
|
|
19593
|
+
type: [String, Function],
|
|
19594
|
+
default: null
|
|
19595
|
+
},
|
|
19418
19596
|
wsUrl: {
|
|
19419
19597
|
type: String,
|
|
19420
19598
|
default: ""
|
|
@@ -19427,6 +19605,14 @@ var Ph = {
|
|
|
19427
19605
|
color: ""
|
|
19428
19606
|
})
|
|
19429
19607
|
},
|
|
19608
|
+
uiConfig: {
|
|
19609
|
+
type: Object,
|
|
19610
|
+
default: () => ({})
|
|
19611
|
+
},
|
|
19612
|
+
aiApi: {
|
|
19613
|
+
type: [String, Object],
|
|
19614
|
+
default: null
|
|
19615
|
+
},
|
|
19430
19616
|
roomId: {
|
|
19431
19617
|
type: String,
|
|
19432
19618
|
default: ""
|
|
@@ -19436,8 +19622,8 @@ var Ph = {
|
|
|
19436
19622
|
return () => d("div", {
|
|
19437
19623
|
class: "yourcompany-cad-wrapper",
|
|
19438
19624
|
style: "position:relative"
|
|
19439
|
-
}, [d(
|
|
19625
|
+
}, [d(Yh, { ...e }), d(N)]);
|
|
19440
19626
|
}
|
|
19441
19627
|
});
|
|
19442
19628
|
//#endregion
|
|
19443
|
-
export {
|
|
19629
|
+
export { Xh as default };
|