@billtaofbj/explosion-3d 1.1.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/explosion-3d.css +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +792 -674
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,10 +2,10 @@ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r
|
|
|
2
2
|
import { BrandWatermark as D } from "@billtaofbj/core";
|
|
3
3
|
import { useRoute as O, useRouter as k } from "vue-router";
|
|
4
4
|
import { ElMessage as A } from "element-plus";
|
|
5
|
-
import { Aim as j, ArrowDown as M, ArrowLeft as ee, Bell as te, Box as N, Clock as ne, Close as re, Coin as P, Delete as
|
|
6
|
-
import
|
|
7
|
-
import * as
|
|
8
|
-
import { AnimationClip as
|
|
5
|
+
import { Aim as j, ArrowDown as M, ArrowLeft as ee, Bell as te, Box as N, Clock as ne, Close as re, Coin as P, Delete as ie, Download as F, Expand as I, Fold as ae, Grid as oe, Link as L, Loading as se, Monitor as ce, Promotion as le, Search as ue, SetUp as de, Share as fe, ShoppingBag as pe, Upload as me } from "@element-plus/icons-vue";
|
|
6
|
+
import he from "axios";
|
|
7
|
+
import * as R from "three";
|
|
8
|
+
import { AnimationClip as ge, Bone as _e, Box3 as ve, BoxGeometry as z, BufferAttribute as ye, BufferGeometry as be, ClampToEdgeWrapping as xe, Color as Se, ColorManagement as Ce, Controls as we, CylinderGeometry as B, DirectionalLight as Te, DoubleSide as Ee, Euler as De, FileLoader as Oe, Float32BufferAttribute as ke, FrontSide as Ae, Group as je, ImageBitmapLoader as Me, InstancedBufferAttribute as Ne, InstancedMesh as Pe, InterleavedBuffer as Fe, InterleavedBufferAttribute as V, Interpolant as Ie, InterpolateDiscrete as Le, InterpolateLinear as Re, Line as H, LineBasicMaterial as ze, LineLoop as Be, LineSegments as Ve, LinearFilter as He, LinearMipmapLinearFilter as Ue, LinearMipmapNearestFilter as We, LinearSRGBColorSpace as Ge, Loader as Ke, LoaderUtils as qe, MOUSE as Je, Material as Ye, MathUtils as Xe, Matrix4 as Ze, Mesh as U, MeshBasicMaterial as Qe, MeshPhongMaterial as $e, MeshPhysicalMaterial as et, MeshStandardMaterial as tt, MirroredRepeatWrapping as nt, NearestFilter as rt, NearestMipmapLinearFilter as it, NearestMipmapNearestFilter as at, NumberKeyframeTrack as ot, Object3D as st, OctahedronGeometry as ct, OrthographicCamera as lt, PerspectiveCamera as ut, Plane as dt, PlaneGeometry as ft, PointLight as pt, Points as mt, PointsMaterial as ht, PropertyBinding as gt, Quaternion as W, QuaternionKeyframeTrack as _t, Ray as vt, Raycaster as yt, RepeatWrapping as bt, SRGBColorSpace as xt, Skeleton as St, SkinnedMesh as Ct, Sphere as wt, SphereGeometry as Tt, Spherical as Et, SpotLight as Dt, TOUCH as Ot, Texture as kt, TextureLoader as At, TorusGeometry as jt, TriangleFanDrawMode as Mt, TriangleStripDrawMode as Nt, TrianglesDrawMode as Pt, Vector2 as G, Vector3 as K, VectorKeyframeTrack as Ft } from "three";
|
|
9
9
|
import * as It from "yjs";
|
|
10
10
|
import { HocuspocusProvider as Lt } from "@hocuspocus/provider";
|
|
11
11
|
//#region \0rolldown/runtime.js
|
|
@@ -99,7 +99,7 @@ var Rt = Object.defineProperty, zt = (e, t) => {
|
|
|
99
99
|
let i = String(r || n.name || "");
|
|
100
100
|
return t.has(i) ? !1 : (t.add(i), !0);
|
|
101
101
|
})];
|
|
102
|
-
}), ne = t(() => N.value.length + 1), P = (e) => e.role === "ai" ? "chat-message-ai" : p.isCollab && e.user_id && e.user_id !== p.currentUser.id ? "chat-message-other" : "chat-message-user",
|
|
102
|
+
}), ne = t(() => N.value.length + 1), P = (e) => e.role === "ai" ? "chat-message-ai" : p.isCollab && e.user_id && e.user_id !== p.currentUser.id ? "chat-message-other" : "chat-message-user", F = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" }, I = (e) => (e.user_name || "U").charAt(0), ae = (e) => {
|
|
103
103
|
if (!p.isCollab) return;
|
|
104
104
|
let t = typeof e == "string" ? e : e.target?.value || g.value, n = t.length, r = t.lastIndexOf("@", n);
|
|
105
105
|
if (r !== -1 && r < n) {
|
|
@@ -110,9 +110,9 @@ var Rt = Object.defineProperty, zt = (e, t) => {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
O.value = !1;
|
|
113
|
-
}, L = () => {
|
|
114
|
-
O.value && (A.value = Math.min(A.value + 1, k.value.length - 1));
|
|
115
113
|
}, oe = () => {
|
|
114
|
+
O.value && (A.value = Math.min(A.value + 1, k.value.length - 1));
|
|
115
|
+
}, L = () => {
|
|
116
116
|
O.value && (A.value = Math.max(A.value - 1, 0));
|
|
117
117
|
}, se = (e) => {
|
|
118
118
|
let t = g.value.slice(0, M), n = g.value.slice(M + j.length + 1);
|
|
@@ -247,7 +247,7 @@ var Rt = Object.defineProperty, zt = (e, t) => {
|
|
|
247
247
|
title: "清空对话"
|
|
248
248
|
}, {
|
|
249
249
|
default: w(() => [s(u, null, {
|
|
250
|
-
default: w(() => [s(S(
|
|
250
|
+
default: w(() => [s(S(ie))]),
|
|
251
251
|
_: 1
|
|
252
252
|
})]),
|
|
253
253
|
_: 1
|
|
@@ -287,14 +287,14 @@ var Rt = Object.defineProperty, zt = (e, t) => {
|
|
|
287
287
|
class: d(["chat-message", P(e)])
|
|
288
288
|
}, [a("div", {
|
|
289
289
|
class: "message-avatar",
|
|
290
|
-
style: f(
|
|
290
|
+
style: f(F(e))
|
|
291
291
|
}, [e.role === "ai" ? (h(), n(u, {
|
|
292
292
|
key: 0,
|
|
293
293
|
size: 16
|
|
294
294
|
}, {
|
|
295
295
|
default: w(() => [s(S(ce))]),
|
|
296
296
|
_: 1
|
|
297
|
-
})) : (h(), i("span", Qt, x(
|
|
297
|
+
})) : (h(), i("span", Qt, x(I(e)), 1))], 4), a("div", $t, [
|
|
298
298
|
c.isCollab && e.role === "user" ? (h(), i("div", en, [a("span", {
|
|
299
299
|
class: "message-sender",
|
|
300
300
|
style: f({ color: e.user_color || "#67C23A" })
|
|
@@ -330,8 +330,8 @@ var Rt = Object.defineProperty, zt = (e, t) => {
|
|
|
330
330
|
placeholder: c.isCollab ? "输入消息... @提及成员" : "输入消息...",
|
|
331
331
|
onKeydown: [
|
|
332
332
|
T(E(ue, ["exact"]), ["enter"]),
|
|
333
|
-
T(E(
|
|
334
|
-
T(E(
|
|
333
|
+
T(E(oe, ["prevent"]), ["down"]),
|
|
334
|
+
T(E(L, ["prevent"]), ["up"])
|
|
335
335
|
],
|
|
336
336
|
onInput: ae,
|
|
337
337
|
resize: "none"
|
|
@@ -431,7 +431,7 @@ function fn() {
|
|
|
431
431
|
console.warn("[useChat] Failed to push to Y.Array:", e);
|
|
432
432
|
}
|
|
433
433
|
if (r.roomId) try {
|
|
434
|
-
await
|
|
434
|
+
await he.post(u, {
|
|
435
435
|
room_id: r.roomId,
|
|
436
436
|
role: "user",
|
|
437
437
|
content: t,
|
|
@@ -457,7 +457,7 @@ function fn() {
|
|
|
457
457
|
console.warn("[useChat] Failed to push AI message to Y.Array:", e);
|
|
458
458
|
}
|
|
459
459
|
if (r) try {
|
|
460
|
-
await
|
|
460
|
+
await he.post(u, {
|
|
461
461
|
room_id: r,
|
|
462
462
|
role: "ai",
|
|
463
463
|
content: t,
|
|
@@ -469,7 +469,7 @@ function fn() {
|
|
|
469
469
|
}
|
|
470
470
|
}, b = async (t) => {
|
|
471
471
|
if (t) try {
|
|
472
|
-
let n = await
|
|
472
|
+
let n = await he.get(u, { params: { room_id: t } });
|
|
473
473
|
if (Array.isArray(n.data)) {
|
|
474
474
|
let t = n.data.map((e) => ({
|
|
475
475
|
_msgId: e._msgId || `hist-${e.id || Date.now()}`,
|
|
@@ -488,7 +488,7 @@ function fn() {
|
|
|
488
488
|
}
|
|
489
489
|
}, x = async (t) => {
|
|
490
490
|
if (e.value = [], l.clear(), t) try {
|
|
491
|
-
await
|
|
491
|
+
await he.delete(u, { params: { room_id: t } });
|
|
492
492
|
} catch (e) {
|
|
493
493
|
console.warn("[useChat] Failed to clear messages on server:", e);
|
|
494
494
|
}
|
|
@@ -522,8 +522,119 @@ function fn() {
|
|
|
522
522
|
};
|
|
523
523
|
}
|
|
524
524
|
//#endregion
|
|
525
|
+
//#region ../../src/composables/useAiApi.js
|
|
526
|
+
var pn = [
|
|
527
|
+
"我可以帮您优化流程图布局、检查节点逻辑,或者提供流程设计建议。请问有什么需要帮助的?",
|
|
528
|
+
"这个流程图的节点连接看起来很清晰。建议检查一下是否有遗漏的分支或异常处理路径。",
|
|
529
|
+
"根据当前的流程结构,我建议在关键决策节点后添加明确的条件标注,使流程更易理解。",
|
|
530
|
+
"流程图中的泳道划分很合理。如果需要,我可以帮您分析各角色的职责分配是否均衡。",
|
|
531
|
+
"我可以帮您检查流程中是否存在循环依赖或死锁风险。需要我逐条分析吗?",
|
|
532
|
+
"建议在流程开始和结束节点使用统一的样式,这样可以让读者更快识别流程的起止点。",
|
|
533
|
+
"这个执行图的逻辑链路比较长,建议在中间添加一些检查点节点,便于流程监控和调试。",
|
|
534
|
+
"我可以帮您生成流程图的文字说明文档,方便团队成员理解流程细节。"
|
|
535
|
+
];
|
|
536
|
+
function mn() {
|
|
537
|
+
return pn[Math.floor(Math.random() * pn.length)];
|
|
538
|
+
}
|
|
539
|
+
async function hn(e, t, n) {
|
|
540
|
+
let r = { "Content-Type": "application/json" };
|
|
541
|
+
e.apiKey && (r.Authorization = `Bearer ${e.apiKey}`);
|
|
542
|
+
let i = await fetch(e.url, {
|
|
543
|
+
method: "POST",
|
|
544
|
+
headers: r,
|
|
545
|
+
body: JSON.stringify({
|
|
546
|
+
model: e.model || "gpt-4o-mini",
|
|
547
|
+
messages: t,
|
|
548
|
+
temperature: e.temperature ?? .7,
|
|
549
|
+
max_tokens: e.maxTokens ?? 4096
|
|
550
|
+
}),
|
|
551
|
+
signal: n
|
|
552
|
+
});
|
|
553
|
+
if (!i.ok) {
|
|
554
|
+
let e = await i.text().catch(() => "");
|
|
555
|
+
throw Error(`AI API error ${i.status}: ${e}`);
|
|
556
|
+
}
|
|
557
|
+
return (await i.json()).choices?.[0]?.message?.content || "";
|
|
558
|
+
}
|
|
559
|
+
function gn(e) {
|
|
560
|
+
let t = _(!1), n = null, r = () => {
|
|
561
|
+
let t = typeof e == "function" ? e() : e;
|
|
562
|
+
return !!(t && t.url);
|
|
563
|
+
}, i = () => typeof e == "function" ? e() : e || {};
|
|
564
|
+
return {
|
|
565
|
+
loading: t,
|
|
566
|
+
isAvailable: r,
|
|
567
|
+
chat: async (e, r = []) => {
|
|
568
|
+
let a = i();
|
|
569
|
+
if (!a.url) return mn();
|
|
570
|
+
t.value = !0, n && n.abort(), n = new AbortController();
|
|
571
|
+
try {
|
|
572
|
+
return await hn(a, [
|
|
573
|
+
{
|
|
574
|
+
role: "system",
|
|
575
|
+
content: a.chatPrompt || "你是一个有帮助的AI助手,擅长文档编辑和流程设计。请简洁回答用户问题。"
|
|
576
|
+
},
|
|
577
|
+
...r.map((e) => ({
|
|
578
|
+
role: e.role === "ai" ? "assistant" : "user",
|
|
579
|
+
content: e.content
|
|
580
|
+
})),
|
|
581
|
+
{
|
|
582
|
+
role: "user",
|
|
583
|
+
content: e
|
|
584
|
+
}
|
|
585
|
+
], n.signal);
|
|
586
|
+
} catch (e) {
|
|
587
|
+
return e.name === "AbortError" ? "" : (console.warn("[useAiApi] Chat error, falling back to mock:", e), mn());
|
|
588
|
+
} finally {
|
|
589
|
+
t.value = !1;
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
generate: async (e, r) => {
|
|
593
|
+
let a = i();
|
|
594
|
+
if (!a.url) return {
|
|
595
|
+
success: !1,
|
|
596
|
+
message: "AI生成功能开发中,敬请期待..."
|
|
597
|
+
};
|
|
598
|
+
t.value = !0, n && n.abort(), n = new AbortController();
|
|
599
|
+
try {
|
|
600
|
+
let t = await hn(a, [{
|
|
601
|
+
role: "system",
|
|
602
|
+
content: a.generatePrompt || `你是一个专业的${r || "流程图"}生成助手。根据用户的描述,生成对应的JSON数据结构。只返回JSON,不要包含其他文字或markdown代码块标记。`
|
|
603
|
+
}, {
|
|
604
|
+
role: "user",
|
|
605
|
+
content: e
|
|
606
|
+
}], n.signal), i = null;
|
|
607
|
+
try {
|
|
608
|
+
let e = t.replace(/^```(?:json)?\s*/i, "").replace(/\s*```$/i, "").trim();
|
|
609
|
+
i = JSON.parse(e);
|
|
610
|
+
} catch {
|
|
611
|
+
i = null;
|
|
612
|
+
}
|
|
613
|
+
return {
|
|
614
|
+
success: !0,
|
|
615
|
+
content: t,
|
|
616
|
+
parsed: i
|
|
617
|
+
};
|
|
618
|
+
} catch (e) {
|
|
619
|
+
return e.name === "AbortError" ? {
|
|
620
|
+
success: !1,
|
|
621
|
+
message: "已取消"
|
|
622
|
+
} : (console.warn("[useAiApi] Generate error:", e), {
|
|
623
|
+
success: !1,
|
|
624
|
+
message: `AI生成失败: ${e.message}`
|
|
625
|
+
});
|
|
626
|
+
} finally {
|
|
627
|
+
t.value = !1;
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
abort: () => {
|
|
631
|
+
n &&= (n.abort(), null);
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
//#endregion
|
|
525
636
|
//#region ../../src/composables/useVersionHistory.js
|
|
526
|
-
var
|
|
637
|
+
var _n = "/api/document-versions", vn = 5e3, yn = () => {
|
|
527
638
|
let e = _([]), t = _(!1);
|
|
528
639
|
return {
|
|
529
640
|
versions: e,
|
|
@@ -531,13 +642,13 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
531
642
|
saveVersion: async ({ documentId: e, docType: t, content: n, userId: r, userName: i }) => {
|
|
532
643
|
if (!e || !t || !n) return null;
|
|
533
644
|
try {
|
|
534
|
-
let { data: a } = await
|
|
645
|
+
let { data: a } = await he.post(_n, {
|
|
535
646
|
document_id: e,
|
|
536
647
|
doc_type: t,
|
|
537
648
|
content: typeof n == "string" ? n : JSON.stringify(n),
|
|
538
649
|
user_id: r || null,
|
|
539
650
|
user_name: i || null
|
|
540
|
-
}, { timeout:
|
|
651
|
+
}, { timeout: vn });
|
|
541
652
|
return a;
|
|
542
653
|
} catch (e) {
|
|
543
654
|
return console.warn("[useVersionHistory] Failed to save version:", e), null;
|
|
@@ -547,9 +658,9 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
547
658
|
if (!n) return [];
|
|
548
659
|
t.value = !0;
|
|
549
660
|
try {
|
|
550
|
-
let { data: t } = await
|
|
661
|
+
let { data: t } = await he.get(_n, {
|
|
551
662
|
params: { document_id: n },
|
|
552
|
-
timeout:
|
|
663
|
+
timeout: vn
|
|
553
664
|
});
|
|
554
665
|
return e.value = t, t;
|
|
555
666
|
} catch (t) {
|
|
@@ -560,26 +671,26 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
560
671
|
},
|
|
561
672
|
getVersionContent: async (e) => {
|
|
562
673
|
try {
|
|
563
|
-
let { data: t } = await
|
|
674
|
+
let { data: t } = await he.get(`${_n}/${e}`, { timeout: vn });
|
|
564
675
|
return t;
|
|
565
676
|
} catch (e) {
|
|
566
677
|
return console.warn("[useVersionHistory] Failed to get version content:", e), null;
|
|
567
678
|
}
|
|
568
679
|
}
|
|
569
680
|
};
|
|
570
|
-
},
|
|
681
|
+
}, bn = { class: "version-history-panel" }, xn = {
|
|
571
682
|
key: 0,
|
|
572
683
|
class: "loading-state"
|
|
573
|
-
},
|
|
684
|
+
}, Sn = {
|
|
574
685
|
key: 1,
|
|
575
686
|
class: "empty-state"
|
|
576
|
-
},
|
|
687
|
+
}, Cn = {
|
|
577
688
|
key: 2,
|
|
578
689
|
class: "version-list"
|
|
579
|
-
},
|
|
690
|
+
}, wn = {
|
|
580
691
|
key: 0,
|
|
581
692
|
class: "current-version"
|
|
582
|
-
},
|
|
693
|
+
}, Tn = { class: "current-version-header" }, En = { class: "version-number" }, Dn = ["onClick"], On = { class: "version-number" }, kn = { class: "version-user" }, An = { class: "panel-footer" }, jn = /*#__PURE__*/ Bt({
|
|
583
694
|
__name: "VersionHistoryPanel",
|
|
584
695
|
props: {
|
|
585
696
|
modelValue: {
|
|
@@ -593,7 +704,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
593
704
|
},
|
|
594
705
|
emits: ["update:modelValue", "apply"],
|
|
595
706
|
setup(t, { expose: c, emit: l }) {
|
|
596
|
-
let u = t, f = l, { versions: p, loading: m, loadVersions: g, getVersionContent: b } =
|
|
707
|
+
let u = t, f = l, { versions: p, loading: m, loadVersions: g, getVersionContent: b } = yn(), T = _(!1), E = _(null), D = _(!1), O = _(null);
|
|
597
708
|
C(() => u.modelValue, (e) => {
|
|
598
709
|
T.value = e, e && u.documentId && (E.value = null, g(u.documentId).then((e) => {
|
|
599
710
|
e && e.length > 0 && (O.value = e[0]);
|
|
@@ -630,7 +741,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
630
741
|
size: "420px",
|
|
631
742
|
"before-close": M
|
|
632
743
|
}, {
|
|
633
|
-
footer: w(() => [a("div",
|
|
744
|
+
footer: w(() => [a("div", An, [s(_, {
|
|
634
745
|
type: "primary",
|
|
635
746
|
disabled: !E.value,
|
|
636
747
|
loading: D.value,
|
|
@@ -639,22 +750,22 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
639
750
|
default: w(() => [...c[4] ||= [o(" 切换到此版本 ", -1)]]),
|
|
640
751
|
_: 1
|
|
641
752
|
}, 8, ["disabled", "loading"])])]),
|
|
642
|
-
default: w(() => [a("div",
|
|
753
|
+
default: w(() => [a("div", bn, [S(m) ? (h(), i("div", xn, [s(l, { class: "is-loading" }, {
|
|
643
754
|
default: w(() => [s(S(se))]),
|
|
644
755
|
_: 1
|
|
645
|
-
}), c[1] ||= a("span", null, "加载中...", -1)])) : S(p).length === 0 ? (h(), i("div",
|
|
756
|
+
}), c[1] ||= a("span", null, "加载中...", -1)])) : S(p).length === 0 ? (h(), i("div", Sn, [s(l, {
|
|
646
757
|
size: 48,
|
|
647
758
|
color: "#c0c4cc"
|
|
648
759
|
}, {
|
|
649
760
|
default: w(() => [s(S(ne))]),
|
|
650
761
|
_: 1
|
|
651
|
-
}), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (h(), i("div",
|
|
762
|
+
}), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (h(), i("div", Cn, [O.value ? (h(), i("div", wn, [a("div", Tn, [s(u, {
|
|
652
763
|
type: "success",
|
|
653
764
|
size: "small"
|
|
654
765
|
}, {
|
|
655
766
|
default: w(() => [...c[3] ||= [o("当前版本", -1)]]),
|
|
656
767
|
_: 1
|
|
657
|
-
}), a("span",
|
|
768
|
+
}), a("span", En, "v" + x(O.value.version_number), 1)])])) : r("", !0), s(g, null, {
|
|
658
769
|
default: w(() => [(h(!0), i(e, null, v(S(p), (e) => (h(), n(f, {
|
|
659
770
|
key: e.id,
|
|
660
771
|
timestamp: ee(e.created_at),
|
|
@@ -665,7 +776,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
665
776
|
default: w(() => [a("div", {
|
|
666
777
|
class: d(["version-item", { active: E.value?.id === e.id }]),
|
|
667
778
|
onClick: (t) => k(e)
|
|
668
|
-
}, [a("span",
|
|
779
|
+
}, [a("span", On, "版本号:v" + x(e.version_number), 1), a("span", kn, "提交人:" + x(e.user_name || "未知用户"), 1)], 10, Dn)]),
|
|
669
780
|
_: 2
|
|
670
781
|
}, 1032, [
|
|
671
782
|
"timestamp",
|
|
@@ -678,10 +789,10 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
678
789
|
}, 8, ["modelValue"]);
|
|
679
790
|
};
|
|
680
791
|
}
|
|
681
|
-
}, [["__scopeId", "data-v-87924b7c"]]),
|
|
792
|
+
}, [["__scopeId", "data-v-87924b7c"]]), Mn = { class: "toolbar" }, Nn = { class: "toolbar-left" }, Pn = { class: "toolbar-center" }, Fn = { class: "toolbar-right" }, In = {
|
|
682
793
|
key: 0,
|
|
683
794
|
class: "collab-users"
|
|
684
|
-
},
|
|
795
|
+
}, Ln = ["title"], Rn = /*#__PURE__*/ Bt({
|
|
685
796
|
__name: "Toolbar",
|
|
686
797
|
props: {
|
|
687
798
|
title: {
|
|
@@ -717,8 +828,8 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
717
828
|
let c = t, l = _(c.title);
|
|
718
829
|
return C(() => c.title, (e) => l.value = e), (c, u) => {
|
|
719
830
|
let d = y("el-icon"), p = y("el-button"), m = y("el-input"), g = y("el-tooltip"), _ = y("el-divider"), b = y("el-dropdown-item"), C = y("el-dropdown-menu"), T = y("el-dropdown");
|
|
720
|
-
return h(), i("div",
|
|
721
|
-
a("div",
|
|
831
|
+
return h(), i("div", Mn, [
|
|
832
|
+
a("div", Nn, [s(p, {
|
|
722
833
|
onClick: u[0] ||= (e) => c.$emit("back"),
|
|
723
834
|
size: "small",
|
|
724
835
|
circle: ""
|
|
@@ -736,7 +847,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
736
847
|
class: "title-input",
|
|
737
848
|
size: "small"
|
|
738
849
|
}, null, 8, ["modelValue"])]),
|
|
739
|
-
a("div",
|
|
850
|
+
a("div", Pn, [
|
|
740
851
|
s(g, {
|
|
741
852
|
content: "展开",
|
|
742
853
|
placement: "bottom"
|
|
@@ -747,7 +858,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
747
858
|
onClick: u[3] ||= (e) => c.$emit("explode")
|
|
748
859
|
}, {
|
|
749
860
|
default: w(() => [s(d, null, {
|
|
750
|
-
default: w(() => [s(S(
|
|
861
|
+
default: w(() => [s(S(I))]),
|
|
751
862
|
_: 1
|
|
752
863
|
})]),
|
|
753
864
|
_: 1
|
|
@@ -821,13 +932,13 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
821
932
|
_: 1
|
|
822
933
|
})
|
|
823
934
|
]),
|
|
824
|
-
a("div",
|
|
825
|
-
t.onlineUsers.length > 0 ? (h(), i("div",
|
|
935
|
+
a("div", Fn, [
|
|
936
|
+
t.onlineUsers.length > 0 ? (h(), i("div", In, [(h(!0), i(e, null, v(t.onlineUsers.slice(0, 5), (e) => (h(), i("div", {
|
|
826
937
|
key: e.clientId,
|
|
827
938
|
class: "collab-avatar",
|
|
828
939
|
style: f({ background: e.color }),
|
|
829
940
|
title: e.name
|
|
830
|
-
}, x(e.name?.charAt(0)), 13,
|
|
941
|
+
}, x(e.name?.charAt(0)), 13, Ln))), 128))])) : r("", !0),
|
|
831
942
|
t.isJoinMode ? r("", !0) : (h(), n(p, {
|
|
832
943
|
key: 1,
|
|
833
944
|
size: "small",
|
|
@@ -848,7 +959,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
848
959
|
title: "分享链接"
|
|
849
960
|
}, {
|
|
850
961
|
default: w(() => [s(d, null, {
|
|
851
|
-
default: w(() => [s(S(
|
|
962
|
+
default: w(() => [s(S(L))]),
|
|
852
963
|
_: 1
|
|
853
964
|
})]),
|
|
854
965
|
_: 1
|
|
@@ -900,7 +1011,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
900
1011
|
onClick: u[11] ||= (e) => c.$emit("save")
|
|
901
1012
|
}, {
|
|
902
1013
|
default: w(() => [s(d, null, {
|
|
903
|
-
default: w(() => [s(S(
|
|
1014
|
+
default: w(() => [s(S(F))]),
|
|
904
1015
|
_: 1
|
|
905
1016
|
})]),
|
|
906
1017
|
_: 1
|
|
@@ -922,7 +1033,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
922
1033
|
]);
|
|
923
1034
|
};
|
|
924
1035
|
}
|
|
925
|
-
}, [["__scopeId", "data-v-3ac7baaa"]]),
|
|
1036
|
+
}, [["__scopeId", "data-v-3ac7baaa"]]), zn = { type: "change" }, Bn = { type: "start" }, Vn = { type: "end" }, Hn = new vt(), Un = new dt(), Wn = Math.cos(70 * Xe.DEG2RAD), q = new K(), Gn = 2 * Math.PI, J = {
|
|
926
1037
|
NONE: -1,
|
|
927
1038
|
ROTATE: 0,
|
|
928
1039
|
DOLLY: 1,
|
|
@@ -931,7 +1042,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
931
1042
|
TOUCH_PAN: 4,
|
|
932
1043
|
TOUCH_DOLLY_PAN: 5,
|
|
933
1044
|
TOUCH_DOLLY_ROTATE: 6
|
|
934
|
-
},
|
|
1045
|
+
}, Kn = 1e-6, qn = class extends we {
|
|
935
1046
|
constructor(e, t = null) {
|
|
936
1047
|
super(e, t), this.state = J.NONE, this.target = new K(), this.cursor = new K(), this.minDistance = 0, this.maxDistance = Infinity, this.minZoom = 0, this.maxZoom = Infinity, this.minTargetRadius = 0, this.maxTargetRadius = Infinity, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -Infinity, this.maxAzimuthAngle = Infinity, this.enableDamping = !1, this.dampingFactor = .05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = {
|
|
937
1048
|
LEFT: "ArrowLeft",
|
|
@@ -945,7 +1056,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
945
1056
|
}, this.touches = {
|
|
946
1057
|
ONE: Ot.ROTATE,
|
|
947
1058
|
TWO: Ot.DOLLY_PAN
|
|
948
|
-
}, 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 K(), this._lastQuaternion = new W(), this._lastTargetPosition = new K(), this._quat = new W().setFromUnitVectors(e.up, new K(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Et(), this._sphericalDelta = new Et(), this._scale = 1, this._panOffset = new K(), this._rotateStart = new G(), this._rotateEnd = new G(), this._rotateDelta = new G(), this._panStart = new G(), this._panEnd = new G(), this._panDelta = new G(), this._dollyStart = new G(), this._dollyEnd = new G(), this._dollyDelta = new G(), this._dollyDirection = new K(), this._mouse = new G(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove =
|
|
1059
|
+
}, 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 K(), this._lastQuaternion = new W(), this._lastTargetPosition = new K(), this._quat = new W().setFromUnitVectors(e.up, new K(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Et(), this._sphericalDelta = new Et(), this._scale = 1, this._panOffset = new K(), this._rotateStart = new G(), this._rotateEnd = new G(), this._rotateDelta = new G(), this._panStart = new G(), this._panEnd = new G(), this._panDelta = new G(), this._dollyStart = new G(), this._dollyEnd = new G(), this._dollyDelta = new G(), this._dollyDirection = new K(), this._mouse = new G(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Yn.bind(this), this._onPointerDown = Jn.bind(this), this._onPointerUp = Xn.bind(this), this._onContextMenu = rr.bind(this), this._onMouseWheel = $n.bind(this), this._onKeyDown = er.bind(this), this._onTouchStart = tr.bind(this), this._onTouchMove = nr.bind(this), this._onMouseDown = Zn.bind(this), this._onMouseMove = Qn.bind(this), this._interceptControlDown = ir.bind(this), this._interceptControlUp = ar.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
949
1060
|
}
|
|
950
1061
|
set cursorStyle(e) {
|
|
951
1062
|
this._cursorStyle = e, e === "grab" ? this.domElement.style.cursor = "grab" : this.domElement.style.cursor = "auto";
|
|
@@ -984,7 +1095,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
984
1095
|
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
|
985
1096
|
}
|
|
986
1097
|
reset() {
|
|
987
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
1098
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(zn), this.update(), this.state = J.NONE;
|
|
988
1099
|
}
|
|
989
1100
|
pan(e, t) {
|
|
990
1101
|
this._pan(e, t), this.update();
|
|
@@ -1005,7 +1116,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
1005
1116
|
let t = this.object.position;
|
|
1006
1117
|
q.copy(t).sub(this.target), q.applyQuaternion(this._quat), this._spherical.setFromVector3(q), this.autoRotate && this.state === J.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
|
|
1007
1118
|
let n = this.minAzimuthAngle, r = this.maxAzimuthAngle;
|
|
1008
|
-
isFinite(n) && isFinite(r) && (n < -Math.PI ? n +=
|
|
1119
|
+
isFinite(n) && isFinite(r) && (n < -Math.PI ? n += Gn : n > Math.PI && (n -= Gn), r < -Math.PI ? r += Gn : r > Math.PI && (r -= Gn), n <= r ? this._spherical.theta = Math.max(n, Math.min(r, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (n + r) / 2 ? Math.max(n, this._spherical.theta) : Math.min(r, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
|
|
1009
1120
|
let i = !1;
|
|
1010
1121
|
if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera) this._spherical.radius = this._clampDistance(this._spherical.radius);
|
|
1011
1122
|
else {
|
|
@@ -1027,15 +1138,15 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
1027
1138
|
let r = new K(this._mouse.x, this._mouse.y, 0);
|
|
1028
1139
|
r.unproject(this.object), this.object.position.sub(r).add(t), this.object.updateMatrixWorld(), e = q.length();
|
|
1029
1140
|
} else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
1030
|
-
e !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position) : (
|
|
1141
|
+
e !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position) : (Hn.origin.copy(this.object.position), Hn.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Hn.direction)) < Wn ? this.object.lookAt(this.target) : (Un.setFromNormalAndCoplanarPoint(this.object.up, this.target), Hn.intersectPlane(Un, this.target))));
|
|
1031
1142
|
} else if (this.object.isOrthographicCamera) {
|
|
1032
1143
|
let e = this.object.zoom;
|
|
1033
1144
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), e !== this.object.zoom && (this.object.updateProjectionMatrix(), i = !0);
|
|
1034
1145
|
}
|
|
1035
|
-
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) >
|
|
1146
|
+
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > Kn || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Kn || this._lastTargetPosition.distanceToSquared(this.target) > Kn ? (this.dispatchEvent(zn), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
1036
1147
|
}
|
|
1037
1148
|
_getAutoRotationAngle(e) {
|
|
1038
|
-
return e === null ?
|
|
1149
|
+
return e === null ? Gn / 60 / 60 * this.autoRotateSpeed : Gn / 60 * this.autoRotateSpeed * e;
|
|
1039
1150
|
}
|
|
1040
1151
|
_getZoomScale(e) {
|
|
1041
1152
|
let t = Math.abs(e * .01);
|
|
@@ -1089,7 +1200,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
1089
1200
|
_handleMouseMoveRotate(e) {
|
|
1090
1201
|
this._rotateEnd.set(e.clientX, e.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
1091
1202
|
let t = this.domElement;
|
|
1092
|
-
this._rotateLeft(
|
|
1203
|
+
this._rotateLeft(Gn * this._rotateDelta.x / t.clientHeight), this._rotateUp(Gn * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
|
|
1093
1204
|
}
|
|
1094
1205
|
_handleMouseMoveDolly(e) {
|
|
1095
1206
|
this._dollyEnd.set(e.clientX, e.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
|
|
@@ -1104,16 +1215,16 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
1104
1215
|
let t = !1;
|
|
1105
1216
|
switch (e.code) {
|
|
1106
1217
|
case this.keys.UP:
|
|
1107
|
-
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(
|
|
1218
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(Gn * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), t = !0;
|
|
1108
1219
|
break;
|
|
1109
1220
|
case this.keys.BOTTOM:
|
|
1110
|
-
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-
|
|
1221
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-Gn * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), t = !0;
|
|
1111
1222
|
break;
|
|
1112
1223
|
case this.keys.LEFT:
|
|
1113
|
-
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(
|
|
1224
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(Gn * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), t = !0;
|
|
1114
1225
|
break;
|
|
1115
1226
|
case this.keys.RIGHT:
|
|
1116
|
-
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-
|
|
1227
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-Gn * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), t = !0;
|
|
1117
1228
|
break;
|
|
1118
1229
|
}
|
|
1119
1230
|
t && (e.preventDefault(), this.update());
|
|
@@ -1150,7 +1261,7 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
1150
1261
|
}
|
|
1151
1262
|
this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
1152
1263
|
let t = this.domElement;
|
|
1153
|
-
this._rotateLeft(
|
|
1264
|
+
this._rotateLeft(Gn * this._rotateDelta.x / t.clientHeight), this._rotateUp(Gn * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd);
|
|
1154
1265
|
}
|
|
1155
1266
|
_handleTouchMovePan(e) {
|
|
1156
1267
|
if (this._pointers.length === 1) this._panEnd.set(e.pageX, e.pageY);
|
|
@@ -1211,16 +1322,16 @@ var pn = "/api/document-versions", mn = 5e3, hn = () => {
|
|
|
1211
1322
|
return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;
|
|
1212
1323
|
}
|
|
1213
1324
|
};
|
|
1214
|
-
function
|
|
1325
|
+
function Jn(e) {
|
|
1215
1326
|
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(e.pointerId), this.domElement.ownerDocument.addEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(e) && (this._addPointer(e), e.pointerType === "touch" ? this._onTouchStart(e) : this._onMouseDown(e), this._cursorStyle === "grab" && (this.domElement.style.cursor = "grabbing")));
|
|
1216
1327
|
}
|
|
1217
|
-
function
|
|
1328
|
+
function Yn(e) {
|
|
1218
1329
|
this.enabled !== !1 && (e.pointerType === "touch" ? this._onTouchMove(e) : this._onMouseMove(e));
|
|
1219
1330
|
}
|
|
1220
|
-
function
|
|
1331
|
+
function Xn(e) {
|
|
1221
1332
|
switch (this._removePointer(e), this._pointers.length) {
|
|
1222
1333
|
case 0:
|
|
1223
|
-
this.domElement.releasePointerCapture(e.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
|
1334
|
+
this.domElement.releasePointerCapture(e.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Vn), this.state = J.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
|
|
1224
1335
|
break;
|
|
1225
1336
|
case 1:
|
|
1226
1337
|
let t = this._pointers[0], n = this._pointerPositions[t];
|
|
@@ -1232,7 +1343,7 @@ function Kn(e) {
|
|
|
1232
1343
|
break;
|
|
1233
1344
|
}
|
|
1234
1345
|
}
|
|
1235
|
-
function
|
|
1346
|
+
function Zn(e) {
|
|
1236
1347
|
let t;
|
|
1237
1348
|
switch (e.button) {
|
|
1238
1349
|
case 0:
|
|
@@ -1271,9 +1382,9 @@ function qn(e) {
|
|
|
1271
1382
|
break;
|
|
1272
1383
|
default: this.state = J.NONE;
|
|
1273
1384
|
}
|
|
1274
|
-
this.state !== J.NONE && this.dispatchEvent(
|
|
1385
|
+
this.state !== J.NONE && this.dispatchEvent(Bn);
|
|
1275
1386
|
}
|
|
1276
|
-
function
|
|
1387
|
+
function Qn(e) {
|
|
1277
1388
|
switch (this.state) {
|
|
1278
1389
|
case J.ROTATE:
|
|
1279
1390
|
if (this.enableRotate === !1) return;
|
|
@@ -1289,13 +1400,13 @@ function Jn(e) {
|
|
|
1289
1400
|
break;
|
|
1290
1401
|
}
|
|
1291
1402
|
}
|
|
1292
|
-
function
|
|
1293
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== J.NONE || (e.preventDefault(), this.dispatchEvent(
|
|
1403
|
+
function $n(e) {
|
|
1404
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== J.NONE || (e.preventDefault(), this.dispatchEvent(Bn), this._handleMouseWheel(this._customWheelEvent(e)), this.dispatchEvent(Vn));
|
|
1294
1405
|
}
|
|
1295
|
-
function
|
|
1406
|
+
function er(e) {
|
|
1296
1407
|
this.enabled !== !1 && this._handleKeyDown(e);
|
|
1297
1408
|
}
|
|
1298
|
-
function
|
|
1409
|
+
function tr(e) {
|
|
1299
1410
|
switch (this._trackPointer(e), this._pointers.length) {
|
|
1300
1411
|
case 1:
|
|
1301
1412
|
switch (this.touches.ONE) {
|
|
@@ -1325,9 +1436,9 @@ function Zn(e) {
|
|
|
1325
1436
|
break;
|
|
1326
1437
|
default: this.state = J.NONE;
|
|
1327
1438
|
}
|
|
1328
|
-
this.state !== J.NONE && this.dispatchEvent(
|
|
1439
|
+
this.state !== J.NONE && this.dispatchEvent(Bn);
|
|
1329
1440
|
}
|
|
1330
|
-
function
|
|
1441
|
+
function nr(e) {
|
|
1331
1442
|
switch (this._trackPointer(e), this.state) {
|
|
1332
1443
|
case J.TOUCH_ROTATE:
|
|
1333
1444
|
if (this.enableRotate === !1) return;
|
|
@@ -1348,16 +1459,16 @@ function Qn(e) {
|
|
|
1348
1459
|
default: this.state = J.NONE;
|
|
1349
1460
|
}
|
|
1350
1461
|
}
|
|
1351
|
-
function
|
|
1462
|
+
function rr(e) {
|
|
1352
1463
|
this.enabled !== !1 && e.preventDefault();
|
|
1353
1464
|
}
|
|
1354
|
-
function
|
|
1465
|
+
function ir(e) {
|
|
1355
1466
|
e.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, {
|
|
1356
1467
|
passive: !0,
|
|
1357
1468
|
capture: !0
|
|
1358
1469
|
}));
|
|
1359
1470
|
}
|
|
1360
|
-
function
|
|
1471
|
+
function ar(e) {
|
|
1361
1472
|
e.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, {
|
|
1362
1473
|
passive: !0,
|
|
1363
1474
|
capture: !0
|
|
@@ -1365,24 +1476,24 @@ function tr(e) {
|
|
|
1365
1476
|
}
|
|
1366
1477
|
//#endregion
|
|
1367
1478
|
//#region ../../node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/controls/TransformControls.js
|
|
1368
|
-
var
|
|
1479
|
+
var or = new yt(), Y = new K(), sr = new K(), X = new W(), cr = {
|
|
1369
1480
|
X: new K(1, 0, 0),
|
|
1370
1481
|
Y: new K(0, 1, 0),
|
|
1371
1482
|
Z: new K(0, 0, 1)
|
|
1372
|
-
},
|
|
1483
|
+
}, lr = { type: "change" }, ur = {
|
|
1373
1484
|
type: "mouseDown",
|
|
1374
1485
|
mode: null
|
|
1375
|
-
},
|
|
1486
|
+
}, dr = {
|
|
1376
1487
|
type: "mouseUp",
|
|
1377
1488
|
mode: null
|
|
1378
|
-
},
|
|
1489
|
+
}, fr = { type: "objectChange" }, pr = class extends we {
|
|
1379
1490
|
constructor(e, t = null) {
|
|
1380
1491
|
super(void 0, t);
|
|
1381
|
-
let n = new
|
|
1492
|
+
let n = new Nr(this);
|
|
1382
1493
|
this._root = n;
|
|
1383
|
-
let r = new
|
|
1494
|
+
let r = new Pr();
|
|
1384
1495
|
this._gizmo = r, n.add(r);
|
|
1385
|
-
let i = new
|
|
1496
|
+
let i = new Fr();
|
|
1386
1497
|
this._plane = i, n.add(i);
|
|
1387
1498
|
let a = this;
|
|
1388
1499
|
function o(e, t) {
|
|
@@ -1395,13 +1506,13 @@ var nr = new yt(), Y = new K(), rr = new K(), X = new W(), ir = {
|
|
|
1395
1506
|
n !== t && (n = t, i[e] = t, r[e] = t, a.dispatchEvent({
|
|
1396
1507
|
type: e + "-changed",
|
|
1397
1508
|
value: t
|
|
1398
|
-
}), a.dispatchEvent(
|
|
1509
|
+
}), a.dispatchEvent(lr));
|
|
1399
1510
|
}
|
|
1400
1511
|
}), a[e] = t, i[e] = t, r[e] = t;
|
|
1401
1512
|
}
|
|
1402
1513
|
o("camera", e), o("object", void 0), o("enabled", !0), o("axis", null), o("mode", "translate"), o("translationSnap", null), o("rotationSnap", null), o("scaleSnap", null), o("space", "world"), o("size", 1), o("dragging", !1), o("showX", !0), o("showY", !0), o("showZ", !0), o("showXY", !0), o("showYZ", !0), o("showXZ", !0), o("minX", -Infinity), o("maxX", Infinity), o("minY", -Infinity), o("maxY", Infinity), o("minZ", -Infinity), o("maxZ", Infinity);
|
|
1403
1514
|
let s = new K(), c = new K(), l = new W(), u = new W(), d = new K(), f = new W(), p = new K(), m = new K(), h = new K(), g = new K();
|
|
1404
|
-
o("worldPosition", s), o("worldPositionStart", c), o("worldQuaternion", l), o("worldQuaternionStart", u), o("cameraPosition", d), o("cameraQuaternion", f), o("pointStart", p), o("pointEnd", m), o("rotationAxis", h), o("rotationAngle", 0), o("eye", g), this._offset = new K(), this._startNorm = new K(), this._endNorm = new K(), this._cameraScale = new K(), this._parentPosition = new K(), this._parentQuaternion = new W(), this._parentQuaternionInv = new W(), this._parentScale = new K(), this._worldScaleStart = new K(), this._worldQuaternionInv = new W(), this._worldScale = new K(), this._positionStart = new K(), this._quaternionStart = new W(), this._scaleStart = new K(), this._getPointer =
|
|
1515
|
+
o("worldPosition", s), o("worldPositionStart", c), o("worldQuaternion", l), o("worldQuaternionStart", u), o("cameraPosition", d), o("cameraQuaternion", f), o("pointStart", p), o("pointEnd", m), o("rotationAxis", h), o("rotationAngle", 0), o("eye", g), this._offset = new K(), this._startNorm = new K(), this._endNorm = new K(), this._cameraScale = new K(), this._parentPosition = new K(), this._parentQuaternion = new W(), this._parentQuaternionInv = new W(), this._parentScale = new K(), this._worldScaleStart = new K(), this._worldQuaternionInv = new W(), this._worldScale = new K(), this._positionStart = new K(), this._quaternionStart = new W(), this._scaleStart = new K(), this._getPointer = mr.bind(this), this._onPointerDown = gr.bind(this), this._onPointerHover = hr.bind(this), this._onPointerMove = _r.bind(this), this._onPointerUp = vr.bind(this), t !== null && this.connect(t);
|
|
1405
1516
|
}
|
|
1406
1517
|
connect(e) {
|
|
1407
1518
|
super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
|
|
@@ -1414,40 +1525,40 @@ var nr = new yt(), Y = new K(), rr = new K(), X = new W(), ir = {
|
|
|
1414
1525
|
}
|
|
1415
1526
|
pointerHover(e) {
|
|
1416
1527
|
if (this.object === void 0 || this.dragging === !0) return;
|
|
1417
|
-
e !== null &&
|
|
1418
|
-
let t =
|
|
1528
|
+
e !== null && or.setFromCamera(e, this.camera);
|
|
1529
|
+
let t = yr(this._gizmo.picker[this.mode], or);
|
|
1419
1530
|
t ? this.axis = t.object.name : this.axis = null;
|
|
1420
1531
|
}
|
|
1421
1532
|
pointerDown(e) {
|
|
1422
1533
|
if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
|
|
1423
|
-
e !== null &&
|
|
1424
|
-
let t =
|
|
1425
|
-
t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0,
|
|
1534
|
+
e !== null && or.setFromCamera(e, this.camera);
|
|
1535
|
+
let t = yr(this._plane, or, !0);
|
|
1536
|
+
t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, ur.mode = this.mode, this.dispatchEvent(ur);
|
|
1426
1537
|
}
|
|
1427
1538
|
}
|
|
1428
1539
|
pointerMove(e) {
|
|
1429
1540
|
let t = this.axis, n = this.mode, r = this.object, i = this.space;
|
|
1430
1541
|
if (n === "scale" ? i = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (i = "world"), r === void 0 || t === null || this.dragging === !1 || e !== null && e.button !== -1) return;
|
|
1431
|
-
e !== null &&
|
|
1432
|
-
let a =
|
|
1542
|
+
e !== null && or.setFromCamera(e, this.camera);
|
|
1543
|
+
let a = yr(this._plane, or, !0);
|
|
1433
1544
|
if (a) {
|
|
1434
1545
|
if (this.pointEnd.copy(a.point).sub(this.worldPositionStart), n === "translate") this._offset.copy(this.pointEnd).sub(this.pointStart), i === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), i === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), r.position.copy(this._offset).add(this._positionStart), this.translationSnap && (i === "local" && (r.position.applyQuaternion(X.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (r.position.x = Math.round(r.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (r.position.y = Math.round(r.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (r.position.z = Math.round(r.position.z / this.translationSnap) * this.translationSnap), r.position.applyQuaternion(this._quaternionStart)), i === "world" && (r.parent && r.position.add(Y.setFromMatrixPosition(r.parent.matrixWorld)), t.search("X") !== -1 && (r.position.x = Math.round(r.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (r.position.y = Math.round(r.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (r.position.z = Math.round(r.position.z / this.translationSnap) * this.translationSnap), r.parent && r.position.sub(Y.setFromMatrixPosition(r.parent.matrixWorld)))), r.position.x = Math.max(this.minX, Math.min(this.maxX, r.position.x)), r.position.y = Math.max(this.minY, Math.min(this.maxY, r.position.y)), r.position.z = Math.max(this.minZ, Math.min(this.maxZ, r.position.z));
|
|
1435
1546
|
else if (n === "scale") {
|
|
1436
1547
|
if (t.search("XYZ") !== -1) {
|
|
1437
1548
|
let e = this.pointEnd.length() / this.pointStart.length();
|
|
1438
|
-
this.pointEnd.dot(this.pointStart) < 0 && (e *= -1),
|
|
1439
|
-
} else Y.copy(this.pointStart),
|
|
1440
|
-
r.scale.copy(this._scaleStart).multiply(
|
|
1549
|
+
this.pointEnd.dot(this.pointStart) < 0 && (e *= -1), sr.set(e, e, e);
|
|
1550
|
+
} else Y.copy(this.pointStart), sr.copy(this.pointEnd), Y.applyQuaternion(this._worldQuaternionInv), sr.applyQuaternion(this._worldQuaternionInv), sr.divide(Y), t.search("X") === -1 && (sr.x = 1), t.search("Y") === -1 && (sr.y = 1), t.search("Z") === -1 && (sr.z = 1);
|
|
1551
|
+
r.scale.copy(this._scaleStart).multiply(sr), this.scaleSnap && (t.search("X") !== -1 && (r.scale.x = Math.round(r.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (r.scale.y = Math.round(r.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (r.scale.z = Math.round(r.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
|
|
1441
1552
|
} else if (n === "rotate") {
|
|
1442
1553
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
|
1443
1554
|
let e = 20 / this.worldPosition.distanceTo(Y.setFromMatrixPosition(this.camera.matrixWorld)), n = !1;
|
|
1444
|
-
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(Y.copy(this.rotationAxis).cross(this.eye)) * e) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(
|
|
1555
|
+
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(Y.copy(this.rotationAxis).cross(this.eye)) * e) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(cr[t]), Y.copy(cr[t]), i === "local" && Y.applyQuaternion(this.worldQuaternion), Y.cross(this.eye), Y.length() === 0 ? n = !0 : this.rotationAngle = this._offset.dot(Y.normalize()) * e), (t === "E" || n) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), i === "local" && t !== "E" && t !== "XYZE" ? (r.quaternion.copy(this._quaternionStart), r.quaternion.multiply(X.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), r.quaternion.copy(X.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), r.quaternion.multiply(this._quaternionStart).normalize());
|
|
1445
1556
|
}
|
|
1446
|
-
this.dispatchEvent(
|
|
1557
|
+
this.dispatchEvent(lr), this.dispatchEvent(fr);
|
|
1447
1558
|
}
|
|
1448
1559
|
}
|
|
1449
1560
|
pointerUp(e) {
|
|
1450
|
-
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (
|
|
1561
|
+
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (dr.mode = this.mode, this.dispatchEvent(dr)), this.dragging = !1, this.axis = null);
|
|
1451
1562
|
}
|
|
1452
1563
|
dispose() {
|
|
1453
1564
|
this.disconnect(), this._root.dispose();
|
|
@@ -1459,10 +1570,10 @@ var nr = new yt(), Y = new K(), rr = new K(), X = new W(), ir = {
|
|
|
1459
1570
|
return this.object = void 0, this.axis = null, this._root.visible = !1, this;
|
|
1460
1571
|
}
|
|
1461
1572
|
reset() {
|
|
1462
|
-
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(
|
|
1573
|
+
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(lr), this.dispatchEvent(fr), this.pointStart.copy(this.pointEnd));
|
|
1463
1574
|
}
|
|
1464
1575
|
getRaycaster() {
|
|
1465
|
-
return
|
|
1576
|
+
return or;
|
|
1466
1577
|
}
|
|
1467
1578
|
getMode() {
|
|
1468
1579
|
return this.mode;
|
|
@@ -1490,7 +1601,7 @@ var nr = new yt(), Y = new K(), rr = new K(), X = new W(), ir = {
|
|
|
1490
1601
|
i.xAxis.color.set(e), i.yAxis.color.set(t), i.zAxis.color.set(n), i.active.color.set(r), i.xAxisTransparent.color.set(e), i.yAxisTransparent.color.set(t), i.zAxisTransparent.color.set(n), i.activeTransparent.color.set(r), i.xAxis._color && i.xAxis._color.set(e), i.yAxis._color && i.yAxis._color.set(t), i.zAxis._color && i.zAxis._color.set(n), i.active._color && i.active._color.set(r), i.xAxisTransparent._color && i.xAxisTransparent._color.set(e), i.yAxisTransparent._color && i.yAxisTransparent._color.set(t), i.zAxisTransparent._color && i.zAxisTransparent._color.set(n), i.activeTransparent._color && i.activeTransparent._color.set(r);
|
|
1491
1602
|
}
|
|
1492
1603
|
};
|
|
1493
|
-
function
|
|
1604
|
+
function mr(e) {
|
|
1494
1605
|
if (this.domElement.ownerDocument.pointerLockElement) return {
|
|
1495
1606
|
x: 0,
|
|
1496
1607
|
y: 0,
|
|
@@ -1505,7 +1616,7 @@ function ur(e) {
|
|
|
1505
1616
|
};
|
|
1506
1617
|
}
|
|
1507
1618
|
}
|
|
1508
|
-
function
|
|
1619
|
+
function hr(e) {
|
|
1509
1620
|
if (this.enabled) switch (e.pointerType) {
|
|
1510
1621
|
case "mouse":
|
|
1511
1622
|
case "pen":
|
|
@@ -1513,21 +1624,21 @@ function dr(e) {
|
|
|
1513
1624
|
break;
|
|
1514
1625
|
}
|
|
1515
1626
|
}
|
|
1516
|
-
function
|
|
1627
|
+
function gr(e) {
|
|
1517
1628
|
this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(e.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(e)), this.pointerDown(this._getPointer(e)));
|
|
1518
1629
|
}
|
|
1519
|
-
function
|
|
1630
|
+
function _r(e) {
|
|
1520
1631
|
this.enabled && this.pointerMove(this._getPointer(e));
|
|
1521
1632
|
}
|
|
1522
|
-
function
|
|
1633
|
+
function vr(e) {
|
|
1523
1634
|
this.enabled && (this.domElement.releasePointerCapture(e.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(e)));
|
|
1524
1635
|
}
|
|
1525
|
-
function
|
|
1636
|
+
function yr(e, t, n) {
|
|
1526
1637
|
let r = t.intersectObject(e, !0);
|
|
1527
1638
|
for (let e = 0; e < r.length; e++) if (r[e].object.visible || n) return r[e];
|
|
1528
1639
|
return !1;
|
|
1529
1640
|
}
|
|
1530
|
-
var
|
|
1641
|
+
var br = new De(), Z = new K(0, 1, 0), xr = new K(0, 0, 0), Sr = new Ze(), Cr = new W(), wr = new W(), Tr = new K(), Er = new Ze(), Dr = new K(1, 0, 0), Or = new K(0, 1, 0), kr = new K(0, 0, 1), Ar = new K(), jr = new K(), Mr = new K(), Nr = class extends st {
|
|
1531
1642
|
constructor(e) {
|
|
1532
1643
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
|
1533
1644
|
}
|
|
@@ -1540,7 +1651,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1540
1651
|
e.geometry && e.geometry.dispose(), e.material && e.material.dispose();
|
|
1541
1652
|
});
|
|
1542
1653
|
}
|
|
1543
|
-
},
|
|
1654
|
+
}, Pr = class extends st {
|
|
1544
1655
|
constructor() {
|
|
1545
1656
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
|
1546
1657
|
let e = new Qe({
|
|
@@ -1588,12 +1699,12 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1588
1699
|
zAxisTransparent: l,
|
|
1589
1700
|
activeTransparent: d
|
|
1590
1701
|
};
|
|
1591
|
-
let m = new
|
|
1702
|
+
let m = new B(0, .04, .1, 12);
|
|
1592
1703
|
m.translate(0, .05, 0);
|
|
1593
|
-
let h = new
|
|
1704
|
+
let h = new z(.08, .08, .08);
|
|
1594
1705
|
h.translate(0, .04, 0);
|
|
1595
|
-
let g = new
|
|
1596
|
-
g.setAttribute("position", new
|
|
1706
|
+
let g = new be();
|
|
1707
|
+
g.setAttribute("position", new ke([
|
|
1597
1708
|
0,
|
|
1598
1709
|
0,
|
|
1599
1710
|
0,
|
|
@@ -1601,15 +1712,15 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1601
1712
|
0,
|
|
1602
1713
|
0
|
|
1603
1714
|
], 3));
|
|
1604
|
-
let _ = new
|
|
1715
|
+
let _ = new B(.0075, .0075, .5, 3);
|
|
1605
1716
|
_.translate(0, .25, 0);
|
|
1606
1717
|
function v(e, t) {
|
|
1607
1718
|
let n = new jt(e, .0075, 3, 64, t * Math.PI * 2);
|
|
1608
1719
|
return n.rotateY(Math.PI / 2), n.rotateX(Math.PI / 2), n;
|
|
1609
1720
|
}
|
|
1610
1721
|
function y() {
|
|
1611
|
-
let e = new
|
|
1612
|
-
return e.setAttribute("position", new
|
|
1722
|
+
let e = new be();
|
|
1723
|
+
return e.setAttribute("position", new ke([
|
|
1613
1724
|
0,
|
|
1614
1725
|
0,
|
|
1615
1726
|
0,
|
|
@@ -1723,13 +1834,13 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1723
1834
|
0,
|
|
1724
1835
|
0
|
|
1725
1836
|
]]],
|
|
1726
|
-
XY: [[new U(new
|
|
1837
|
+
XY: [[new U(new z(.15, .15, .01), l), [
|
|
1727
1838
|
.15,
|
|
1728
1839
|
.15,
|
|
1729
1840
|
0
|
|
1730
1841
|
]]],
|
|
1731
1842
|
YZ: [[
|
|
1732
|
-
new U(new
|
|
1843
|
+
new U(new z(.15, .15, .01), s),
|
|
1733
1844
|
[
|
|
1734
1845
|
0,
|
|
1735
1846
|
.15,
|
|
@@ -1742,7 +1853,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1742
1853
|
]
|
|
1743
1854
|
]],
|
|
1744
1855
|
XZ: [[
|
|
1745
|
-
new U(new
|
|
1856
|
+
new U(new z(.15, .15, .01), c),
|
|
1746
1857
|
[
|
|
1747
1858
|
.15,
|
|
1748
1859
|
0,
|
|
@@ -1756,7 +1867,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1756
1867
|
]]
|
|
1757
1868
|
}, x = {
|
|
1758
1869
|
X: [[
|
|
1759
|
-
new U(new
|
|
1870
|
+
new U(new B(.2, 0, .6, 4), n),
|
|
1760
1871
|
[
|
|
1761
1872
|
.3,
|
|
1762
1873
|
0,
|
|
@@ -1768,7 +1879,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1768
1879
|
-Math.PI / 2
|
|
1769
1880
|
]
|
|
1770
1881
|
], [
|
|
1771
|
-
new U(new
|
|
1882
|
+
new U(new B(.2, 0, .6, 4), n),
|
|
1772
1883
|
[
|
|
1773
1884
|
-.3,
|
|
1774
1885
|
0,
|
|
@@ -1780,12 +1891,12 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1780
1891
|
Math.PI / 2
|
|
1781
1892
|
]
|
|
1782
1893
|
]],
|
|
1783
|
-
Y: [[new U(new
|
|
1894
|
+
Y: [[new U(new B(.2, 0, .6, 4), n), [
|
|
1784
1895
|
0,
|
|
1785
1896
|
.3,
|
|
1786
1897
|
0
|
|
1787
1898
|
]], [
|
|
1788
|
-
new U(new
|
|
1899
|
+
new U(new B(.2, 0, .6, 4), n),
|
|
1789
1900
|
[
|
|
1790
1901
|
0,
|
|
1791
1902
|
-.3,
|
|
@@ -1798,7 +1909,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1798
1909
|
]
|
|
1799
1910
|
]],
|
|
1800
1911
|
Z: [[
|
|
1801
|
-
new U(new
|
|
1912
|
+
new U(new B(.2, 0, .6, 4), n),
|
|
1802
1913
|
[
|
|
1803
1914
|
0,
|
|
1804
1915
|
0,
|
|
@@ -1810,7 +1921,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1810
1921
|
0
|
|
1811
1922
|
]
|
|
1812
1923
|
], [
|
|
1813
|
-
new U(new
|
|
1924
|
+
new U(new B(.2, 0, .6, 4), n),
|
|
1814
1925
|
[
|
|
1815
1926
|
0,
|
|
1816
1927
|
0,
|
|
@@ -1823,13 +1934,13 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1823
1934
|
]
|
|
1824
1935
|
]],
|
|
1825
1936
|
XYZ: [[new U(new ct(.2, 0), n)]],
|
|
1826
|
-
XY: [[new U(new
|
|
1937
|
+
XY: [[new U(new z(.2, .2, .01), n), [
|
|
1827
1938
|
.15,
|
|
1828
1939
|
.15,
|
|
1829
1940
|
0
|
|
1830
1941
|
]]],
|
|
1831
1942
|
YZ: [[
|
|
1832
|
-
new U(new
|
|
1943
|
+
new U(new z(.2, .2, .01), n),
|
|
1833
1944
|
[
|
|
1834
1945
|
0,
|
|
1835
1946
|
.15,
|
|
@@ -1842,7 +1953,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1842
1953
|
]
|
|
1843
1954
|
]],
|
|
1844
1955
|
XZ: [[
|
|
1845
|
-
new U(new
|
|
1956
|
+
new U(new z(.2, .2, .01), n),
|
|
1846
1957
|
[
|
|
1847
1958
|
.15,
|
|
1848
1959
|
0,
|
|
@@ -1870,14 +1981,14 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1870
1981
|
"helper"
|
|
1871
1982
|
]],
|
|
1872
1983
|
DELTA: [[
|
|
1873
|
-
new
|
|
1984
|
+
new H(y(), r),
|
|
1874
1985
|
null,
|
|
1875
1986
|
null,
|
|
1876
1987
|
null,
|
|
1877
1988
|
"helper"
|
|
1878
1989
|
]],
|
|
1879
1990
|
X: [[
|
|
1880
|
-
new
|
|
1991
|
+
new H(g, r),
|
|
1881
1992
|
[
|
|
1882
1993
|
-1e3,
|
|
1883
1994
|
0,
|
|
@@ -1892,7 +2003,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1892
2003
|
"helper"
|
|
1893
2004
|
]],
|
|
1894
2005
|
Y: [[
|
|
1895
|
-
new
|
|
2006
|
+
new H(g, r),
|
|
1896
2007
|
[
|
|
1897
2008
|
0,
|
|
1898
2009
|
-1e3,
|
|
@@ -1911,7 +2022,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1911
2022
|
"helper"
|
|
1912
2023
|
]],
|
|
1913
2024
|
Z: [[
|
|
1914
|
-
new
|
|
2025
|
+
new H(g, r),
|
|
1915
2026
|
[
|
|
1916
2027
|
0,
|
|
1917
2028
|
0,
|
|
@@ -1968,7 +2079,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
1968
2079
|
]
|
|
1969
2080
|
]]
|
|
1970
2081
|
}, w = { AXIS: [[
|
|
1971
|
-
new
|
|
2082
|
+
new H(g, r),
|
|
1972
2083
|
[
|
|
1973
2084
|
-1e3,
|
|
1974
2085
|
0,
|
|
@@ -2127,13 +2238,13 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2127
2238
|
]
|
|
2128
2239
|
]
|
|
2129
2240
|
],
|
|
2130
|
-
XY: [[new U(new
|
|
2241
|
+
XY: [[new U(new z(.15, .15, .01), l), [
|
|
2131
2242
|
.15,
|
|
2132
2243
|
.15,
|
|
2133
2244
|
0
|
|
2134
2245
|
]]],
|
|
2135
2246
|
YZ: [[
|
|
2136
|
-
new U(new
|
|
2247
|
+
new U(new z(.15, .15, .01), s),
|
|
2137
2248
|
[
|
|
2138
2249
|
0,
|
|
2139
2250
|
.15,
|
|
@@ -2146,7 +2257,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2146
2257
|
]
|
|
2147
2258
|
]],
|
|
2148
2259
|
XZ: [[
|
|
2149
|
-
new U(new
|
|
2260
|
+
new U(new z(.15, .15, .01), c),
|
|
2150
2261
|
[
|
|
2151
2262
|
.15,
|
|
2152
2263
|
0,
|
|
@@ -2158,10 +2269,10 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2158
2269
|
0
|
|
2159
2270
|
]
|
|
2160
2271
|
]],
|
|
2161
|
-
XYZ: [[new U(new
|
|
2272
|
+
XYZ: [[new U(new z(.1, .1, .1), u)]]
|
|
2162
2273
|
}, D = {
|
|
2163
2274
|
X: [[
|
|
2164
|
-
new U(new
|
|
2275
|
+
new U(new B(.2, 0, .6, 4), n),
|
|
2165
2276
|
[
|
|
2166
2277
|
.3,
|
|
2167
2278
|
0,
|
|
@@ -2173,7 +2284,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2173
2284
|
-Math.PI / 2
|
|
2174
2285
|
]
|
|
2175
2286
|
], [
|
|
2176
|
-
new U(new
|
|
2287
|
+
new U(new B(.2, 0, .6, 4), n),
|
|
2177
2288
|
[
|
|
2178
2289
|
-.3,
|
|
2179
2290
|
0,
|
|
@@ -2185,12 +2296,12 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2185
2296
|
Math.PI / 2
|
|
2186
2297
|
]
|
|
2187
2298
|
]],
|
|
2188
|
-
Y: [[new U(new
|
|
2299
|
+
Y: [[new U(new B(.2, 0, .6, 4), n), [
|
|
2189
2300
|
0,
|
|
2190
2301
|
.3,
|
|
2191
2302
|
0
|
|
2192
2303
|
]], [
|
|
2193
|
-
new U(new
|
|
2304
|
+
new U(new B(.2, 0, .6, 4), n),
|
|
2194
2305
|
[
|
|
2195
2306
|
0,
|
|
2196
2307
|
-.3,
|
|
@@ -2203,7 +2314,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2203
2314
|
]
|
|
2204
2315
|
]],
|
|
2205
2316
|
Z: [[
|
|
2206
|
-
new U(new
|
|
2317
|
+
new U(new B(.2, 0, .6, 4), n),
|
|
2207
2318
|
[
|
|
2208
2319
|
0,
|
|
2209
2320
|
0,
|
|
@@ -2215,7 +2326,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2215
2326
|
0
|
|
2216
2327
|
]
|
|
2217
2328
|
], [
|
|
2218
|
-
new U(new
|
|
2329
|
+
new U(new B(.2, 0, .6, 4), n),
|
|
2219
2330
|
[
|
|
2220
2331
|
0,
|
|
2221
2332
|
0,
|
|
@@ -2227,13 +2338,13 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2227
2338
|
0
|
|
2228
2339
|
]
|
|
2229
2340
|
]],
|
|
2230
|
-
XY: [[new U(new
|
|
2341
|
+
XY: [[new U(new z(.2, .2, .01), n), [
|
|
2231
2342
|
.15,
|
|
2232
2343
|
.15,
|
|
2233
2344
|
0
|
|
2234
2345
|
]]],
|
|
2235
2346
|
YZ: [[
|
|
2236
|
-
new U(new
|
|
2347
|
+
new U(new z(.2, .2, .01), n),
|
|
2237
2348
|
[
|
|
2238
2349
|
0,
|
|
2239
2350
|
.15,
|
|
@@ -2246,7 +2357,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2246
2357
|
]
|
|
2247
2358
|
]],
|
|
2248
2359
|
XZ: [[
|
|
2249
|
-
new U(new
|
|
2360
|
+
new U(new z(.2, .2, .01), n),
|
|
2250
2361
|
[
|
|
2251
2362
|
.15,
|
|
2252
2363
|
0,
|
|
@@ -2258,14 +2369,14 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2258
2369
|
0
|
|
2259
2370
|
]
|
|
2260
2371
|
]],
|
|
2261
|
-
XYZ: [[new U(new
|
|
2372
|
+
XYZ: [[new U(new z(.2, .2, .2), n), [
|
|
2262
2373
|
0,
|
|
2263
2374
|
0,
|
|
2264
2375
|
0
|
|
2265
2376
|
]]]
|
|
2266
2377
|
}, O = {
|
|
2267
2378
|
X: [[
|
|
2268
|
-
new
|
|
2379
|
+
new H(g, r),
|
|
2269
2380
|
[
|
|
2270
2381
|
-1e3,
|
|
2271
2382
|
0,
|
|
@@ -2280,7 +2391,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2280
2391
|
"helper"
|
|
2281
2392
|
]],
|
|
2282
2393
|
Y: [[
|
|
2283
|
-
new
|
|
2394
|
+
new H(g, r),
|
|
2284
2395
|
[
|
|
2285
2396
|
0,
|
|
2286
2397
|
-1e3,
|
|
@@ -2299,7 +2410,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2299
2410
|
"helper"
|
|
2300
2411
|
]],
|
|
2301
2412
|
Z: [[
|
|
2302
|
-
new
|
|
2413
|
+
new H(g, r),
|
|
2303
2414
|
[
|
|
2304
2415
|
0,
|
|
2305
2416
|
0,
|
|
@@ -2331,7 +2442,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2331
2442
|
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = k(b)), this.add(this.gizmo.rotate = k(C)), this.add(this.gizmo.scale = k(E)), this.add(this.picker.translate = k(x)), this.add(this.picker.rotate = k(T)), this.add(this.picker.scale = k(D)), this.add(this.helper.translate = k(S)), this.add(this.helper.rotate = k(w)), this.add(this.helper.scale = k(O)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
2332
2443
|
}
|
|
2333
2444
|
updateMatrixWorld(e) {
|
|
2334
|
-
let t = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion :
|
|
2445
|
+
let t = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : wr;
|
|
2335
2446
|
this.gizmo.translate.visible = this.mode === "translate", this.gizmo.rotate.visible = this.mode === "rotate", this.gizmo.scale.visible = this.mode === "scale", this.helper.translate.visible = this.mode === "translate", this.helper.rotate.visible = this.mode === "rotate", this.helper.scale.visible = this.mode === "scale";
|
|
2336
2447
|
let n = [];
|
|
2337
2448
|
n = n.concat(this.picker[this.mode].children), n = n.concat(this.gizmo[this.mode].children), n = n.concat(this.helper[this.mode].children);
|
|
@@ -2340,25 +2451,25 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2340
2451
|
r.visible = !0, r.rotation.set(0, 0, 0), r.position.copy(this.worldPosition);
|
|
2341
2452
|
let i;
|
|
2342
2453
|
if (i = this.camera.isOrthographicCamera ? (this.camera.top - this.camera.bottom) / this.camera.zoom : this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), r.scale.set(1, 1, 1).multiplyScalar(i * this.size / 4), r.tag === "helper") {
|
|
2343
|
-
r.visible = !1, r.name === "AXIS" ? (r.visible = !!this.axis, this.axis === "X" && (X.setFromEuler(
|
|
2454
|
+
r.visible = !1, r.name === "AXIS" ? (r.visible = !!this.axis, this.axis === "X" && (X.setFromEuler(br.set(0, 0, 0)), r.quaternion.copy(t).multiply(X), Math.abs(Z.copy(Dr).applyQuaternion(t).dot(this.eye)) > .9 && (r.visible = !1)), this.axis === "Y" && (X.setFromEuler(br.set(0, 0, Math.PI / 2)), r.quaternion.copy(t).multiply(X), Math.abs(Z.copy(Or).applyQuaternion(t).dot(this.eye)) > .9 && (r.visible = !1)), this.axis === "Z" && (X.setFromEuler(br.set(0, Math.PI / 2, 0)), r.quaternion.copy(t).multiply(X), Math.abs(Z.copy(kr).applyQuaternion(t).dot(this.eye)) > .9 && (r.visible = !1)), this.axis === "XYZE" && (X.setFromEuler(br.set(0, Math.PI / 2, 0)), Z.copy(this.rotationAxis), r.quaternion.setFromRotationMatrix(Sr.lookAt(xr, Z, Or)), r.quaternion.multiply(X), r.visible = this.dragging), this.axis === "E" && (r.visible = !1)) : r.name === "START" ? (r.position.copy(this.worldPositionStart), r.visible = this.dragging) : r.name === "END" ? (r.position.copy(this.worldPosition), r.visible = this.dragging) : r.name === "DELTA" ? (r.position.copy(this.worldPositionStart), r.quaternion.copy(this.worldQuaternionStart), Y.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), Y.applyQuaternion(this.worldQuaternionStart.clone().invert()), r.scale.copy(Y), r.visible = this.dragging) : (r.quaternion.copy(t), this.dragging ? r.position.copy(this.worldPositionStart) : r.position.copy(this.worldPosition), this.axis && (r.visible = this.axis.search(r.name) !== -1));
|
|
2344
2455
|
continue;
|
|
2345
2456
|
}
|
|
2346
2457
|
if (r.quaternion.copy(t), this.mode === "translate" || this.mode === "scale") {
|
|
2347
2458
|
let e = .99, n = .2;
|
|
2348
|
-
r.name === "X" && Math.abs(Z.copy(
|
|
2349
|
-
} else this.mode === "rotate" && (
|
|
2459
|
+
r.name === "X" && Math.abs(Z.copy(Dr).applyQuaternion(t).dot(this.eye)) > e && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "Y" && Math.abs(Z.copy(Or).applyQuaternion(t).dot(this.eye)) > e && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "Z" && Math.abs(Z.copy(kr).applyQuaternion(t).dot(this.eye)) > e && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "XY" && Math.abs(Z.copy(kr).applyQuaternion(t).dot(this.eye)) < n && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "YZ" && Math.abs(Z.copy(Dr).applyQuaternion(t).dot(this.eye)) < n && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "XZ" && Math.abs(Z.copy(Or).applyQuaternion(t).dot(this.eye)) < n && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1);
|
|
2460
|
+
} else this.mode === "rotate" && (Cr.copy(t), Z.copy(this.eye).applyQuaternion(X.copy(t).invert()), r.name.search("E") !== -1 && r.quaternion.setFromRotationMatrix(Sr.lookAt(this.eye, xr, Or)), r.name === "X" && (X.setFromAxisAngle(Dr, Math.atan2(-Z.y, Z.z)), X.multiplyQuaternions(Cr, X), r.quaternion.copy(X)), r.name === "Y" && (X.setFromAxisAngle(Or, Math.atan2(Z.x, Z.z)), X.multiplyQuaternions(Cr, X), r.quaternion.copy(X)), r.name === "Z" && (X.setFromAxisAngle(kr, Math.atan2(Z.y, Z.x)), X.multiplyQuaternions(Cr, X), r.quaternion.copy(X)));
|
|
2350
2461
|
r.visible = r.visible && (r.name.indexOf("X") === -1 || this.showX), r.visible = r.visible && (r.name.indexOf("Y") === -1 || this.showY), r.visible = r.visible && (r.name.indexOf("Z") === -1 || this.showZ), r.visible = r.visible && (r.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), r.visible = r.visible && (r.name.indexOf("XY") === -1 || this.showXY), r.visible = r.visible && (r.name.indexOf("YZ") === -1 || this.showYZ), r.visible = r.visible && (r.name.indexOf("XZ") === -1 || this.showXZ), r.material._color = r.material._color || r.material.color.clone(), r.material._opacity = r.material._opacity || r.material.opacity, r.material.color.copy(r.material._color), r.material.opacity = r.material._opacity, this.enabled && this.axis && (r.name === this.axis || this.axis.split("").some(function(e) {
|
|
2351
2462
|
return r.name === e;
|
|
2352
2463
|
})) && (r.material.color.copy(this.materialLib.active.color), r.material.opacity = 1);
|
|
2353
2464
|
}
|
|
2354
2465
|
super.updateMatrixWorld(e);
|
|
2355
2466
|
}
|
|
2356
|
-
},
|
|
2467
|
+
}, Fr = class extends U {
|
|
2357
2468
|
constructor() {
|
|
2358
2469
|
super(new ft(1e5, 1e5, 2, 2), new Qe({
|
|
2359
2470
|
visible: !1,
|
|
2360
2471
|
wireframe: !0,
|
|
2361
|
-
side:
|
|
2472
|
+
side: Ee,
|
|
2362
2473
|
transparent: !0,
|
|
2363
2474
|
opacity: .1,
|
|
2364
2475
|
toneMapped: !1
|
|
@@ -2366,39 +2477,39 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2366
2477
|
}
|
|
2367
2478
|
updateMatrixWorld(e) {
|
|
2368
2479
|
let t = this.space;
|
|
2369
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"),
|
|
2480
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), Ar.copy(Dr).applyQuaternion(t === "local" ? this.worldQuaternion : wr), jr.copy(Or).applyQuaternion(t === "local" ? this.worldQuaternion : wr), Mr.copy(kr).applyQuaternion(t === "local" ? this.worldQuaternion : wr), Z.copy(jr), this.mode) {
|
|
2370
2481
|
case "translate":
|
|
2371
2482
|
case "scale":
|
|
2372
2483
|
switch (this.axis) {
|
|
2373
2484
|
case "X":
|
|
2374
|
-
Z.copy(this.eye).cross(
|
|
2485
|
+
Z.copy(this.eye).cross(Ar), Tr.copy(Ar).cross(Z);
|
|
2375
2486
|
break;
|
|
2376
2487
|
case "Y":
|
|
2377
|
-
Z.copy(this.eye).cross(
|
|
2488
|
+
Z.copy(this.eye).cross(jr), Tr.copy(jr).cross(Z);
|
|
2378
2489
|
break;
|
|
2379
2490
|
case "Z":
|
|
2380
|
-
Z.copy(this.eye).cross(
|
|
2491
|
+
Z.copy(this.eye).cross(Mr), Tr.copy(Mr).cross(Z);
|
|
2381
2492
|
break;
|
|
2382
2493
|
case "XY":
|
|
2383
|
-
|
|
2494
|
+
Tr.copy(Mr);
|
|
2384
2495
|
break;
|
|
2385
2496
|
case "YZ":
|
|
2386
|
-
|
|
2497
|
+
Tr.copy(Ar);
|
|
2387
2498
|
break;
|
|
2388
2499
|
case "XZ":
|
|
2389
|
-
Z.copy(
|
|
2500
|
+
Z.copy(Mr), Tr.copy(jr);
|
|
2390
2501
|
break;
|
|
2391
2502
|
case "XYZ":
|
|
2392
2503
|
case "E":
|
|
2393
|
-
|
|
2504
|
+
Tr.set(0, 0, 0);
|
|
2394
2505
|
break;
|
|
2395
2506
|
}
|
|
2396
2507
|
break;
|
|
2397
|
-
default:
|
|
2508
|
+
default: Tr.set(0, 0, 0);
|
|
2398
2509
|
}
|
|
2399
|
-
|
|
2510
|
+
Tr.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Er.lookAt(Y.set(0, 0, 0), Tr, Z), this.quaternion.setFromRotationMatrix(Er)), super.updateMatrixWorld(e);
|
|
2400
2511
|
}
|
|
2401
|
-
},
|
|
2512
|
+
}, Ir = class extends st {
|
|
2402
2513
|
constructor(e = document.createElement("div")) {
|
|
2403
2514
|
super(), this.isCSS2DObject = !0, this.element = e, this.element.style.position = "absolute", this.element.style.userSelect = "none", this.element.setAttribute("draggable", !1), this.center = new G(.5, .5), this.addEventListener("removed", function() {
|
|
2404
2515
|
this.traverse(function(e) {
|
|
@@ -2409,7 +2520,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2409
2520
|
copy(e, t) {
|
|
2410
2521
|
return super.copy(e, t), this.element = e.element.cloneNode(!0), this.center = e.center, this;
|
|
2411
2522
|
}
|
|
2412
|
-
},
|
|
2523
|
+
}, Lr = new K(), Rr = new Ze(), zr = new Ze(), Br = new K(), Vr = new K(), Hr = class {
|
|
2413
2524
|
constructor(e = {}) {
|
|
2414
2525
|
let t = this, n, r, i, a, o = { objects: /* @__PURE__ */ new WeakMap() }, s = e.element === void 0 ? document.createElement("div") : e.element;
|
|
2415
2526
|
s.style.overflow = "hidden", this.domElement = s, this.sortObjects = !0, this.getSize = function() {
|
|
@@ -2418,7 +2529,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2418
2529
|
height: r
|
|
2419
2530
|
};
|
|
2420
2531
|
}, this.render = function(e, t) {
|
|
2421
|
-
e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(),
|
|
2532
|
+
e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Rr.copy(t.matrixWorldInverse), zr.multiplyMatrices(t.projectionMatrix, Rr), l(e, e, t), this.sortObjects && f(e);
|
|
2422
2533
|
}, this.setSize = function(e, t) {
|
|
2423
2534
|
n = e, r = t, i = n / 2, a = r / 2, s.style.width = e + "px", s.style.height = t + "px";
|
|
2424
2535
|
};
|
|
@@ -2432,16 +2543,16 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2432
2543
|
return;
|
|
2433
2544
|
}
|
|
2434
2545
|
if (e.isCSS2DObject) {
|
|
2435
|
-
|
|
2436
|
-
let c =
|
|
2437
|
-
l.style.display = c === !0 ? "" : "none", c === !0 && (e.onBeforeRender(t, n, r), l.style.transform = "translate(" + -100 * e.center.x + "%," + -100 * e.center.y + "%)translate(" + (
|
|
2546
|
+
Lr.setFromMatrixPosition(e.matrixWorld), Lr.applyMatrix4(zr);
|
|
2547
|
+
let c = Lr.z >= -1 && Lr.z <= 1 && e.layers.test(r.layers) === !0, l = e.element;
|
|
2548
|
+
l.style.display = c === !0 ? "" : "none", c === !0 && (e.onBeforeRender(t, n, r), l.style.transform = "translate(" + -100 * e.center.x + "%," + -100 * e.center.y + "%)translate(" + (Lr.x * i + i) + "px," + (-Lr.y * a + a) + "px)", l.parentNode !== s && s.appendChild(l), e.onAfterRender(t, n, r));
|
|
2438
2549
|
let d = { distanceToCameraSquared: u(r, e) };
|
|
2439
2550
|
o.objects.set(e, d);
|
|
2440
2551
|
}
|
|
2441
2552
|
for (let t = 0, i = e.children.length; t < i; t++) l(e.children[t], n, r);
|
|
2442
2553
|
}
|
|
2443
2554
|
function u(e, t) {
|
|
2444
|
-
return
|
|
2555
|
+
return Br.setFromMatrixPosition(e.matrixWorld), Vr.setFromMatrixPosition(t.matrixWorld), Br.distanceToSquared(Vr);
|
|
2445
2556
|
}
|
|
2446
2557
|
function d(e) {
|
|
2447
2558
|
let t = [];
|
|
@@ -2459,7 +2570,7 @@ var gr = new Ee(), Z = new K(0, 1, 0), _r = new K(0, 0, 0), vr = new Ze(), yr =
|
|
|
2459
2570
|
};
|
|
2460
2571
|
//#endregion
|
|
2461
2572
|
//#region ../../node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/utils/BufferGeometryUtils.js
|
|
2462
|
-
function
|
|
2573
|
+
function Ur(e, t) {
|
|
2463
2574
|
if (t === Pt) return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), e;
|
|
2464
2575
|
if (t === Mt || t === Nt) {
|
|
2465
2576
|
let n = e.getIndex();
|
|
@@ -2480,9 +2591,9 @@ function zr(e, t) {
|
|
|
2480
2591
|
}
|
|
2481
2592
|
//#endregion
|
|
2482
2593
|
//#region ../../node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/utils/SkeletonUtils.js
|
|
2483
|
-
function
|
|
2594
|
+
function Wr(e) {
|
|
2484
2595
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = e.clone();
|
|
2485
|
-
return
|
|
2596
|
+
return Gr(e, r, function(e, r) {
|
|
2486
2597
|
t.set(r, e), n.set(e, r);
|
|
2487
2598
|
}), r.traverse(function(e) {
|
|
2488
2599
|
if (!e.isSkinnedMesh) return;
|
|
@@ -2492,50 +2603,50 @@ function Br(e) {
|
|
|
2492
2603
|
}), r.bind(r.skeleton, r.bindMatrix);
|
|
2493
2604
|
}), r;
|
|
2494
2605
|
}
|
|
2495
|
-
function
|
|
2606
|
+
function Gr(e, t, n) {
|
|
2496
2607
|
n(e, t);
|
|
2497
|
-
for (let r = 0; r < e.children.length; r++)
|
|
2608
|
+
for (let r = 0; r < e.children.length; r++) Gr(e.children[r], t.children[r], n);
|
|
2498
2609
|
}
|
|
2499
2610
|
//#endregion
|
|
2500
2611
|
//#region ../../node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/loaders/GLTFLoader.js
|
|
2501
|
-
var
|
|
2612
|
+
var Kr = /* @__PURE__ */ zt({ GLTFLoader: () => qr }), qr = class extends Ke {
|
|
2502
2613
|
constructor(e) {
|
|
2503
2614
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(e) {
|
|
2504
|
-
return new
|
|
2615
|
+
return new Qr(e);
|
|
2505
2616
|
}), this.register(function(e) {
|
|
2506
|
-
return new
|
|
2617
|
+
return new $r(e);
|
|
2507
2618
|
}), this.register(function(e) {
|
|
2508
|
-
return new
|
|
2619
|
+
return new ci(e);
|
|
2509
2620
|
}), this.register(function(e) {
|
|
2510
|
-
return new
|
|
2621
|
+
return new li(e);
|
|
2511
2622
|
}), this.register(function(e) {
|
|
2512
|
-
return new
|
|
2623
|
+
return new ui(e);
|
|
2513
2624
|
}), this.register(function(e) {
|
|
2514
|
-
return new
|
|
2625
|
+
return new ti(e);
|
|
2515
2626
|
}), this.register(function(e) {
|
|
2516
|
-
return new
|
|
2627
|
+
return new ni(e);
|
|
2517
2628
|
}), this.register(function(e) {
|
|
2518
|
-
return new
|
|
2629
|
+
return new ri(e);
|
|
2519
2630
|
}), this.register(function(e) {
|
|
2520
|
-
return new
|
|
2631
|
+
return new ii(e);
|
|
2521
2632
|
}), this.register(function(e) {
|
|
2522
|
-
return new
|
|
2633
|
+
return new Zr(e);
|
|
2523
2634
|
}), this.register(function(e) {
|
|
2524
|
-
return new
|
|
2635
|
+
return new ai(e);
|
|
2525
2636
|
}), this.register(function(e) {
|
|
2526
|
-
return new
|
|
2637
|
+
return new ei(e);
|
|
2527
2638
|
}), this.register(function(e) {
|
|
2528
|
-
return new
|
|
2639
|
+
return new si(e);
|
|
2529
2640
|
}), this.register(function(e) {
|
|
2530
|
-
return new
|
|
2641
|
+
return new oi(e);
|
|
2531
2642
|
}), this.register(function(e) {
|
|
2532
|
-
return new
|
|
2643
|
+
return new Yr(e);
|
|
2533
2644
|
}), this.register(function(e) {
|
|
2534
|
-
return new
|
|
2645
|
+
return new di(e, $.EXT_MESHOPT_COMPRESSION);
|
|
2535
2646
|
}), this.register(function(e) {
|
|
2536
|
-
return new
|
|
2647
|
+
return new di(e, $.KHR_MESHOPT_COMPRESSION);
|
|
2537
2648
|
}), this.register(function(e) {
|
|
2538
|
-
return new
|
|
2649
|
+
return new fi(e);
|
|
2539
2650
|
});
|
|
2540
2651
|
}
|
|
2541
2652
|
load(e, t, n, r) {
|
|
@@ -2548,7 +2659,7 @@ var Hr = /* @__PURE__ */ zt({ GLTFLoader: () => Ur }), Ur = class extends Ke {
|
|
|
2548
2659
|
this.manager.itemStart(e);
|
|
2549
2660
|
let o = function(t) {
|
|
2550
2661
|
r ? r(t) : console.error(t), i.manager.itemError(e), i.manager.itemEnd(e);
|
|
2551
|
-
}, s = new
|
|
2662
|
+
}, s = new Oe(this.manager);
|
|
2552
2663
|
s.setPath(this.path), s.setResponseType("arraybuffer"), s.setRequestHeader(this.requestHeader), s.setWithCredentials(this.withCredentials), s.load(e, function(n) {
|
|
2553
2664
|
try {
|
|
2554
2665
|
i.parse(n, a, function(n) {
|
|
@@ -2577,9 +2688,9 @@ var Hr = /* @__PURE__ */ zt({ GLTFLoader: () => Ur }), Ur = class extends Ke {
|
|
|
2577
2688
|
parse(e, t, n, r) {
|
|
2578
2689
|
let i, a = {}, o = {}, s = new TextDecoder();
|
|
2579
2690
|
if (typeof e == "string") i = JSON.parse(e);
|
|
2580
|
-
else if (e instanceof ArrayBuffer) if (s.decode(new Uint8Array(e, 0, 4)) ===
|
|
2691
|
+
else if (e instanceof ArrayBuffer) if (s.decode(new Uint8Array(e, 0, 4)) === pi) {
|
|
2581
2692
|
try {
|
|
2582
|
-
a[$.KHR_BINARY_GLTF] = new
|
|
2693
|
+
a[$.KHR_BINARY_GLTF] = new gi(e);
|
|
2583
2694
|
} catch (e) {
|
|
2584
2695
|
r && r(e);
|
|
2585
2696
|
return;
|
|
@@ -2591,7 +2702,7 @@ var Hr = /* @__PURE__ */ zt({ GLTFLoader: () => Ur }), Ur = class extends Ke {
|
|
|
2591
2702
|
r && r(/* @__PURE__ */ Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
2592
2703
|
return;
|
|
2593
2704
|
}
|
|
2594
|
-
let c = new
|
|
2705
|
+
let c = new Hi(i, {
|
|
2595
2706
|
path: t || this.resourcePath || "",
|
|
2596
2707
|
crossOrigin: this.crossOrigin,
|
|
2597
2708
|
requestHeader: this.requestHeader,
|
|
@@ -2608,16 +2719,16 @@ var Hr = /* @__PURE__ */ zt({ GLTFLoader: () => Ur }), Ur = class extends Ke {
|
|
|
2608
2719
|
let t = i.extensionsUsed[e], n = i.extensionsRequired || [];
|
|
2609
2720
|
switch (t) {
|
|
2610
2721
|
case $.KHR_MATERIALS_UNLIT:
|
|
2611
|
-
a[t] = new
|
|
2722
|
+
a[t] = new Xr();
|
|
2612
2723
|
break;
|
|
2613
2724
|
case $.KHR_DRACO_MESH_COMPRESSION:
|
|
2614
|
-
a[t] = new
|
|
2725
|
+
a[t] = new _i(i, this.dracoLoader);
|
|
2615
2726
|
break;
|
|
2616
2727
|
case $.KHR_TEXTURE_TRANSFORM:
|
|
2617
|
-
a[t] = new
|
|
2728
|
+
a[t] = new vi();
|
|
2618
2729
|
break;
|
|
2619
2730
|
case $.KHR_MESH_QUANTIZATION:
|
|
2620
|
-
a[t] = new
|
|
2731
|
+
a[t] = new yi();
|
|
2621
2732
|
break;
|
|
2622
2733
|
default: n.indexOf(t) >= 0 && o[t] === void 0 && console.warn("THREE.GLTFLoader: Unknown extension \"" + t + "\".");
|
|
2623
2734
|
}
|
|
@@ -2631,7 +2742,7 @@ var Hr = /* @__PURE__ */ zt({ GLTFLoader: () => Ur }), Ur = class extends Ke {
|
|
|
2631
2742
|
});
|
|
2632
2743
|
}
|
|
2633
2744
|
};
|
|
2634
|
-
function
|
|
2745
|
+
function Jr() {
|
|
2635
2746
|
let e = {};
|
|
2636
2747
|
return {
|
|
2637
2748
|
get: function(t) {
|
|
@@ -2676,7 +2787,7 @@ var $ = {
|
|
|
2676
2787
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
2677
2788
|
KHR_MESHOPT_COMPRESSION: "KHR_meshopt_compression",
|
|
2678
2789
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
2679
|
-
},
|
|
2790
|
+
}, Yr = class {
|
|
2680
2791
|
constructor(e) {
|
|
2681
2792
|
this.parser = e, this.name = $.KHR_LIGHTS_PUNCTUAL, this.cache = {
|
|
2682
2793
|
refs: {},
|
|
@@ -2693,12 +2804,12 @@ var $ = {
|
|
|
2693
2804
|
_loadLight(e) {
|
|
2694
2805
|
let t = this.parser, n = "light:" + e, r = t.cache.get(n);
|
|
2695
2806
|
if (r) return r;
|
|
2696
|
-
let i = t.json, a = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e], o, s = new
|
|
2807
|
+
let i = t.json, a = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e], o, s = new Se(16777215);
|
|
2697
2808
|
a.color !== void 0 && s.setRGB(a.color[0], a.color[1], a.color[2], Ge);
|
|
2698
2809
|
let c = a.range === void 0 ? 0 : a.range;
|
|
2699
2810
|
switch (a.type) {
|
|
2700
2811
|
case "directional":
|
|
2701
|
-
o = new
|
|
2812
|
+
o = new Te(s), o.target.position.set(0, 0, -1), o.add(o.target);
|
|
2702
2813
|
break;
|
|
2703
2814
|
case "point":
|
|
2704
2815
|
o = new pt(s), o.distance = c;
|
|
@@ -2708,7 +2819,7 @@ var $ = {
|
|
|
2708
2819
|
break;
|
|
2709
2820
|
default: throw Error("THREE.GLTFLoader: Unexpected light type: " + a.type);
|
|
2710
2821
|
}
|
|
2711
|
-
return o.position.set(0, 0, 0),
|
|
2822
|
+
return o.position.set(0, 0, 0), Pi(o, a), a.intensity !== void 0 && (o.intensity = a.intensity), o.name = t.createUniqueName(a.name || "light_" + e), r = Promise.resolve(o), t.cache.add(n, r), r;
|
|
2712
2823
|
}
|
|
2713
2824
|
getDependency(e, t) {
|
|
2714
2825
|
if (e === "light") return this._loadLight(t);
|
|
@@ -2719,7 +2830,7 @@ var $ = {
|
|
|
2719
2830
|
return n._getNodeRef(t.cache, i, e);
|
|
2720
2831
|
});
|
|
2721
2832
|
}
|
|
2722
|
-
},
|
|
2833
|
+
}, Xr = class {
|
|
2723
2834
|
constructor() {
|
|
2724
2835
|
this.name = $.KHR_MATERIALS_UNLIT;
|
|
2725
2836
|
}
|
|
@@ -2728,7 +2839,7 @@ var $ = {
|
|
|
2728
2839
|
}
|
|
2729
2840
|
extendParams(e, t, n) {
|
|
2730
2841
|
let r = [];
|
|
2731
|
-
e.color = new
|
|
2842
|
+
e.color = new Se(1, 1, 1), e.opacity = 1;
|
|
2732
2843
|
let i = t.pbrMetallicRoughness;
|
|
2733
2844
|
if (i) {
|
|
2734
2845
|
if (Array.isArray(i.baseColorFactor)) {
|
|
@@ -2739,7 +2850,7 @@ var $ = {
|
|
|
2739
2850
|
}
|
|
2740
2851
|
return Promise.all(r);
|
|
2741
2852
|
}
|
|
2742
|
-
},
|
|
2853
|
+
}, Zr = class {
|
|
2743
2854
|
constructor(e) {
|
|
2744
2855
|
this.parser = e, this.name = $.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
2745
2856
|
}
|
|
@@ -2747,7 +2858,7 @@ var $ = {
|
|
|
2747
2858
|
let n = Q(this.parser, e, this.name);
|
|
2748
2859
|
return n === null || n.emissiveStrength !== void 0 && (t.emissiveIntensity = n.emissiveStrength), Promise.resolve();
|
|
2749
2860
|
}
|
|
2750
|
-
},
|
|
2861
|
+
}, Qr = class {
|
|
2751
2862
|
constructor(e) {
|
|
2752
2863
|
this.parser = e, this.name = $.KHR_MATERIALS_CLEARCOAT;
|
|
2753
2864
|
}
|
|
@@ -2764,7 +2875,7 @@ var $ = {
|
|
|
2764
2875
|
}
|
|
2765
2876
|
return Promise.all(r);
|
|
2766
2877
|
}
|
|
2767
|
-
},
|
|
2878
|
+
}, $r = class {
|
|
2768
2879
|
constructor(e) {
|
|
2769
2880
|
this.parser = e, this.name = $.KHR_MATERIALS_DISPERSION;
|
|
2770
2881
|
}
|
|
@@ -2775,7 +2886,7 @@ var $ = {
|
|
|
2775
2886
|
let n = Q(this.parser, e, this.name);
|
|
2776
2887
|
return n === null || (t.dispersion = n.dispersion === void 0 ? 0 : n.dispersion), Promise.resolve();
|
|
2777
2888
|
}
|
|
2778
|
-
},
|
|
2889
|
+
}, ei = class {
|
|
2779
2890
|
constructor(e) {
|
|
2780
2891
|
this.parser = e, this.name = $.KHR_MATERIALS_IRIDESCENCE;
|
|
2781
2892
|
}
|
|
@@ -2788,7 +2899,7 @@ var $ = {
|
|
|
2788
2899
|
let r = [];
|
|
2789
2900
|
return n.iridescenceFactor !== void 0 && (t.iridescence = n.iridescenceFactor), n.iridescenceTexture !== void 0 && r.push(this.parser.assignTexture(t, "iridescenceMap", n.iridescenceTexture)), n.iridescenceIor !== void 0 && (t.iridescenceIOR = n.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), n.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = n.iridescenceThicknessMinimum), n.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = n.iridescenceThicknessMaximum), n.iridescenceThicknessTexture !== void 0 && r.push(this.parser.assignTexture(t, "iridescenceThicknessMap", n.iridescenceThicknessTexture)), Promise.all(r);
|
|
2790
2901
|
}
|
|
2791
|
-
},
|
|
2902
|
+
}, ti = class {
|
|
2792
2903
|
constructor(e) {
|
|
2793
2904
|
this.parser = e, this.name = $.KHR_MATERIALS_SHEEN;
|
|
2794
2905
|
}
|
|
@@ -2799,13 +2910,13 @@ var $ = {
|
|
|
2799
2910
|
let n = Q(this.parser, e, this.name);
|
|
2800
2911
|
if (n === null) return Promise.resolve();
|
|
2801
2912
|
let r = [];
|
|
2802
|
-
if (t.sheenColor = new
|
|
2913
|
+
if (t.sheenColor = new Se(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, n.sheenColorFactor !== void 0) {
|
|
2803
2914
|
let e = n.sheenColorFactor;
|
|
2804
2915
|
t.sheenColor.setRGB(e[0], e[1], e[2], Ge);
|
|
2805
2916
|
}
|
|
2806
2917
|
return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && r.push(this.parser.assignTexture(t, "sheenColorMap", n.sheenColorTexture, xt)), n.sheenRoughnessTexture !== void 0 && r.push(this.parser.assignTexture(t, "sheenRoughnessMap", n.sheenRoughnessTexture)), Promise.all(r);
|
|
2807
2918
|
}
|
|
2808
|
-
},
|
|
2919
|
+
}, ni = class {
|
|
2809
2920
|
constructor(e) {
|
|
2810
2921
|
this.parser = e, this.name = $.KHR_MATERIALS_TRANSMISSION;
|
|
2811
2922
|
}
|
|
@@ -2818,7 +2929,7 @@ var $ = {
|
|
|
2818
2929
|
let r = [];
|
|
2819
2930
|
return n.transmissionFactor !== void 0 && (t.transmission = n.transmissionFactor), n.transmissionTexture !== void 0 && r.push(this.parser.assignTexture(t, "transmissionMap", n.transmissionTexture)), Promise.all(r);
|
|
2820
2931
|
}
|
|
2821
|
-
},
|
|
2932
|
+
}, ri = class {
|
|
2822
2933
|
constructor(e) {
|
|
2823
2934
|
this.parser = e, this.name = $.KHR_MATERIALS_VOLUME;
|
|
2824
2935
|
}
|
|
@@ -2835,9 +2946,9 @@ var $ = {
|
|
|
2835
2946
|
1,
|
|
2836
2947
|
1
|
|
2837
2948
|
];
|
|
2838
|
-
return t.attenuationColor = new
|
|
2949
|
+
return t.attenuationColor = new Se().setRGB(i[0], i[1], i[2], Ge), Promise.all(r);
|
|
2839
2950
|
}
|
|
2840
|
-
},
|
|
2951
|
+
}, ii = class {
|
|
2841
2952
|
constructor(e) {
|
|
2842
2953
|
this.parser = e, this.name = $.KHR_MATERIALS_IOR;
|
|
2843
2954
|
}
|
|
@@ -2848,7 +2959,7 @@ var $ = {
|
|
|
2848
2959
|
let n = Q(this.parser, e, this.name);
|
|
2849
2960
|
return n === null ? Promise.resolve() : (t.ior = n.ior === void 0 ? 1.5 : n.ior, t.ior === 0 && (t.ior = 1e3), Promise.resolve());
|
|
2850
2961
|
}
|
|
2851
|
-
},
|
|
2962
|
+
}, ai = class {
|
|
2852
2963
|
constructor(e) {
|
|
2853
2964
|
this.parser = e, this.name = $.KHR_MATERIALS_SPECULAR;
|
|
2854
2965
|
}
|
|
@@ -2865,9 +2976,9 @@ var $ = {
|
|
|
2865
2976
|
1,
|
|
2866
2977
|
1
|
|
2867
2978
|
];
|
|
2868
|
-
return t.specularColor = new
|
|
2979
|
+
return t.specularColor = new Se().setRGB(i[0], i[1], i[2], Ge), n.specularColorTexture !== void 0 && r.push(this.parser.assignTexture(t, "specularColorMap", n.specularColorTexture, xt)), Promise.all(r);
|
|
2869
2980
|
}
|
|
2870
|
-
},
|
|
2981
|
+
}, oi = class {
|
|
2871
2982
|
constructor(e) {
|
|
2872
2983
|
this.parser = e, this.name = $.EXT_MATERIALS_BUMP;
|
|
2873
2984
|
}
|
|
@@ -2880,7 +2991,7 @@ var $ = {
|
|
|
2880
2991
|
let r = [];
|
|
2881
2992
|
return t.bumpScale = n.bumpFactor === void 0 ? 1 : n.bumpFactor, n.bumpTexture !== void 0 && r.push(this.parser.assignTexture(t, "bumpMap", n.bumpTexture)), Promise.all(r);
|
|
2882
2993
|
}
|
|
2883
|
-
},
|
|
2994
|
+
}, si = class {
|
|
2884
2995
|
constructor(e) {
|
|
2885
2996
|
this.parser = e, this.name = $.KHR_MATERIALS_ANISOTROPY;
|
|
2886
2997
|
}
|
|
@@ -2893,7 +3004,7 @@ var $ = {
|
|
|
2893
3004
|
let r = [];
|
|
2894
3005
|
return n.anisotropyStrength !== void 0 && (t.anisotropy = n.anisotropyStrength), n.anisotropyRotation !== void 0 && (t.anisotropyRotation = n.anisotropyRotation), n.anisotropyTexture !== void 0 && r.push(this.parser.assignTexture(t, "anisotropyMap", n.anisotropyTexture)), Promise.all(r);
|
|
2895
3006
|
}
|
|
2896
|
-
},
|
|
3007
|
+
}, ci = class {
|
|
2897
3008
|
constructor(e) {
|
|
2898
3009
|
this.parser = e, this.name = $.KHR_TEXTURE_BASISU;
|
|
2899
3010
|
}
|
|
@@ -2907,7 +3018,7 @@ var $ = {
|
|
|
2907
3018
|
}
|
|
2908
3019
|
return t.loadTextureImage(e, i.source, a);
|
|
2909
3020
|
}
|
|
2910
|
-
},
|
|
3021
|
+
}, li = class {
|
|
2911
3022
|
constructor(e) {
|
|
2912
3023
|
this.parser = e, this.name = $.EXT_TEXTURE_WEBP;
|
|
2913
3024
|
}
|
|
@@ -2921,7 +3032,7 @@ var $ = {
|
|
|
2921
3032
|
}
|
|
2922
3033
|
return n.loadTextureImage(e, a.source, s);
|
|
2923
3034
|
}
|
|
2924
|
-
},
|
|
3035
|
+
}, ui = class {
|
|
2925
3036
|
constructor(e) {
|
|
2926
3037
|
this.parser = e, this.name = $.EXT_TEXTURE_AVIF;
|
|
2927
3038
|
}
|
|
@@ -2935,7 +3046,7 @@ var $ = {
|
|
|
2935
3046
|
}
|
|
2936
3047
|
return n.loadTextureImage(e, a.source, s);
|
|
2937
3048
|
}
|
|
2938
|
-
},
|
|
3049
|
+
}, di = class {
|
|
2939
3050
|
constructor(e, t) {
|
|
2940
3051
|
this.name = t, this.parser = e;
|
|
2941
3052
|
}
|
|
@@ -2958,7 +3069,7 @@ var $ = {
|
|
|
2958
3069
|
});
|
|
2959
3070
|
} else return null;
|
|
2960
3071
|
}
|
|
2961
|
-
},
|
|
3072
|
+
}, fi = class {
|
|
2962
3073
|
constructor(e) {
|
|
2963
3074
|
this.name = $.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
2964
3075
|
}
|
|
@@ -2966,53 +3077,53 @@ var $ = {
|
|
|
2966
3077
|
let t = this.parser.json, n = t.nodes[e];
|
|
2967
3078
|
if (!n.extensions || !n.extensions[this.name] || n.mesh === void 0) return null;
|
|
2968
3079
|
let r = t.meshes[n.mesh];
|
|
2969
|
-
for (let e of r.primitives) if (e.mode !==
|
|
3080
|
+
for (let e of r.primitives) if (e.mode !== Ci.TRIANGLES && e.mode !== Ci.TRIANGLE_STRIP && e.mode !== Ci.TRIANGLE_FAN && e.mode !== void 0) return null;
|
|
2970
3081
|
let i = n.extensions[this.name].attributes, a = [], o = {};
|
|
2971
3082
|
for (let e in i) a.push(this.parser.getDependency("accessor", i[e]).then((t) => (o[e] = t, o[e])));
|
|
2972
3083
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((e) => {
|
|
2973
3084
|
let t = e.pop(), n = t.isGroup ? t.children : [t], r = e[0].count, i = [];
|
|
2974
3085
|
for (let e of n) {
|
|
2975
|
-
let t = new Ze(), n = new K(), a = new W(), s = new K(1, 1, 1), c = new
|
|
3086
|
+
let t = new Ze(), n = new K(), a = new W(), s = new K(1, 1, 1), c = new Pe(e.geometry, e.material, r);
|
|
2976
3087
|
for (let e = 0; e < r; e++) o.TRANSLATION && n.fromBufferAttribute(o.TRANSLATION, e), o.ROTATION && a.fromBufferAttribute(o.ROTATION, e), o.SCALE && s.fromBufferAttribute(o.SCALE, e), c.setMatrixAt(e, t.compose(n, a, s));
|
|
2977
3088
|
for (let t in o) if (t === "_COLOR_0") {
|
|
2978
3089
|
let e = o[t];
|
|
2979
|
-
c.instanceColor = new
|
|
3090
|
+
c.instanceColor = new Ne(e.array, e.itemSize, e.normalized);
|
|
2980
3091
|
} else t !== "TRANSLATION" && t !== "ROTATION" && t !== "SCALE" && e.geometry.setAttribute(t, o[t]);
|
|
2981
3092
|
st.prototype.copy.call(c, e), this.parser.assignFinalMaterial(c), i.push(c);
|
|
2982
3093
|
}
|
|
2983
3094
|
return t.isGroup ? (t.clear(), t.add(...i), t) : i[0];
|
|
2984
3095
|
}));
|
|
2985
3096
|
}
|
|
2986
|
-
},
|
|
3097
|
+
}, pi = "glTF", mi = 12, hi = {
|
|
2987
3098
|
JSON: 1313821514,
|
|
2988
3099
|
BIN: 5130562
|
|
2989
|
-
},
|
|
3100
|
+
}, gi = class {
|
|
2990
3101
|
constructor(e) {
|
|
2991
3102
|
this.name = $.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
2992
|
-
let t = new DataView(e, 0,
|
|
3103
|
+
let t = new DataView(e, 0, mi), n = new TextDecoder();
|
|
2993
3104
|
if (this.header = {
|
|
2994
3105
|
magic: n.decode(new Uint8Array(e.slice(0, 4))),
|
|
2995
3106
|
version: t.getUint32(4, !0),
|
|
2996
3107
|
length: t.getUint32(8, !0)
|
|
2997
|
-
}, this.header.magic !==
|
|
3108
|
+
}, this.header.magic !== pi) throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
2998
3109
|
if (this.header.version < 2) throw Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
2999
|
-
let r = this.header.length -
|
|
3110
|
+
let r = this.header.length - mi, i = new DataView(e, mi), a = 0;
|
|
3000
3111
|
for (; a < r;) {
|
|
3001
3112
|
let t = i.getUint32(a, !0);
|
|
3002
3113
|
a += 4;
|
|
3003
3114
|
let r = i.getUint32(a, !0);
|
|
3004
|
-
if (a += 4, r ===
|
|
3005
|
-
let r = new Uint8Array(e,
|
|
3115
|
+
if (a += 4, r === hi.JSON) {
|
|
3116
|
+
let r = new Uint8Array(e, mi + a, t);
|
|
3006
3117
|
this.content = n.decode(r);
|
|
3007
|
-
} else if (r ===
|
|
3008
|
-
let n =
|
|
3118
|
+
} else if (r === hi.BIN) {
|
|
3119
|
+
let n = mi + a;
|
|
3009
3120
|
this.body = e.slice(n, n + t);
|
|
3010
3121
|
}
|
|
3011
3122
|
a += t;
|
|
3012
3123
|
}
|
|
3013
3124
|
if (this.content === null) throw Error("THREE.GLTFLoader: JSON content not found.");
|
|
3014
3125
|
}
|
|
3015
|
-
},
|
|
3126
|
+
}, _i = class {
|
|
3016
3127
|
constructor(e, t) {
|
|
3017
3128
|
if (!t) throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
3018
3129
|
this.name = $.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
|
|
@@ -3020,14 +3131,14 @@ var $ = {
|
|
|
3020
3131
|
decodePrimitive(e, t) {
|
|
3021
3132
|
let n = this.json, r = this.dracoLoader, i = e.extensions[this.name].bufferView, a = e.extensions[this.name].attributes, o = {}, s = {}, c = {};
|
|
3022
3133
|
for (let e in a) {
|
|
3023
|
-
let t =
|
|
3134
|
+
let t = Oi[e] || e.toLowerCase();
|
|
3024
3135
|
o[t] = a[e];
|
|
3025
3136
|
}
|
|
3026
3137
|
for (let t in e.attributes) {
|
|
3027
|
-
let r =
|
|
3138
|
+
let r = Oi[t] || t.toLowerCase();
|
|
3028
3139
|
if (a[t] !== void 0) {
|
|
3029
3140
|
let i = n.accessors[e.attributes[t]];
|
|
3030
|
-
c[r] =
|
|
3141
|
+
c[r] = wi[i.componentType].name, s[r] = i.normalized === !0;
|
|
3031
3142
|
}
|
|
3032
3143
|
}
|
|
3033
3144
|
return t.getDependency("bufferView", i).then(function(e) {
|
|
@@ -3042,18 +3153,18 @@ var $ = {
|
|
|
3042
3153
|
});
|
|
3043
3154
|
});
|
|
3044
3155
|
}
|
|
3045
|
-
},
|
|
3156
|
+
}, vi = class {
|
|
3046
3157
|
constructor() {
|
|
3047
3158
|
this.name = $.KHR_TEXTURE_TRANSFORM;
|
|
3048
3159
|
}
|
|
3049
3160
|
extendTexture(e, t) {
|
|
3050
3161
|
return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 ? e : (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0, e);
|
|
3051
3162
|
}
|
|
3052
|
-
},
|
|
3163
|
+
}, yi = class {
|
|
3053
3164
|
constructor() {
|
|
3054
3165
|
this.name = $.KHR_MESH_QUANTIZATION;
|
|
3055
3166
|
}
|
|
3056
|
-
},
|
|
3167
|
+
}, bi = class extends Ie {
|
|
3057
3168
|
constructor(e, t, n, r) {
|
|
3058
3169
|
super(e, t, n, r);
|
|
3059
3170
|
}
|
|
@@ -3070,12 +3181,12 @@ var $ = {
|
|
|
3070
3181
|
}
|
|
3071
3182
|
return i;
|
|
3072
3183
|
}
|
|
3073
|
-
},
|
|
3184
|
+
}, xi = new W(), Si = class extends bi {
|
|
3074
3185
|
interpolate_(e, t, n, r) {
|
|
3075
3186
|
let i = super.interpolate_(e, t, n, r);
|
|
3076
|
-
return
|
|
3187
|
+
return xi.fromArray(i).normalize().toArray(i), i;
|
|
3077
3188
|
}
|
|
3078
|
-
},
|
|
3189
|
+
}, Ci = {
|
|
3079
3190
|
FLOAT: 5126,
|
|
3080
3191
|
FLOAT_MAT3: 35675,
|
|
3081
3192
|
FLOAT_MAT4: 35676,
|
|
@@ -3094,25 +3205,25 @@ var $ = {
|
|
|
3094
3205
|
TRIANGLE_FAN: 6,
|
|
3095
3206
|
UNSIGNED_BYTE: 5121,
|
|
3096
3207
|
UNSIGNED_SHORT: 5123
|
|
3097
|
-
},
|
|
3208
|
+
}, wi = {
|
|
3098
3209
|
5120: Int8Array,
|
|
3099
3210
|
5121: Uint8Array,
|
|
3100
3211
|
5122: Int16Array,
|
|
3101
3212
|
5123: Uint16Array,
|
|
3102
3213
|
5125: Uint32Array,
|
|
3103
3214
|
5126: Float32Array
|
|
3104
|
-
},
|
|
3215
|
+
}, Ti = {
|
|
3105
3216
|
9728: rt,
|
|
3106
3217
|
9729: He,
|
|
3107
3218
|
9984: at,
|
|
3108
3219
|
9985: We,
|
|
3109
3220
|
9986: it,
|
|
3110
3221
|
9987: Ue
|
|
3111
|
-
},
|
|
3112
|
-
33071:
|
|
3222
|
+
}, Ei = {
|
|
3223
|
+
33071: xe,
|
|
3113
3224
|
33648: nt,
|
|
3114
3225
|
10497: bt
|
|
3115
|
-
},
|
|
3226
|
+
}, Di = {
|
|
3116
3227
|
SCALAR: 1,
|
|
3117
3228
|
VEC2: 2,
|
|
3118
3229
|
VEC3: 3,
|
|
@@ -3120,7 +3231,7 @@ var $ = {
|
|
|
3120
3231
|
MAT2: 4,
|
|
3121
3232
|
MAT3: 9,
|
|
3122
3233
|
MAT4: 16
|
|
3123
|
-
},
|
|
3234
|
+
}, Oi = {
|
|
3124
3235
|
POSITION: "position",
|
|
3125
3236
|
NORMAL: "normal",
|
|
3126
3237
|
TANGENT: "tangent",
|
|
@@ -3131,21 +3242,21 @@ var $ = {
|
|
|
3131
3242
|
COLOR_0: "color",
|
|
3132
3243
|
WEIGHTS_0: "skinWeight",
|
|
3133
3244
|
JOINTS_0: "skinIndex"
|
|
3134
|
-
},
|
|
3245
|
+
}, ki = {
|
|
3135
3246
|
scale: "scale",
|
|
3136
3247
|
translation: "position",
|
|
3137
3248
|
rotation: "quaternion",
|
|
3138
3249
|
weights: "morphTargetInfluences"
|
|
3139
|
-
},
|
|
3250
|
+
}, Ai = {
|
|
3140
3251
|
CUBICSPLINE: void 0,
|
|
3141
|
-
LINEAR:
|
|
3142
|
-
STEP:
|
|
3143
|
-
},
|
|
3252
|
+
LINEAR: Re,
|
|
3253
|
+
STEP: Le
|
|
3254
|
+
}, ji = {
|
|
3144
3255
|
OPAQUE: "OPAQUE",
|
|
3145
3256
|
MASK: "MASK",
|
|
3146
3257
|
BLEND: "BLEND"
|
|
3147
3258
|
};
|
|
3148
|
-
function
|
|
3259
|
+
function Mi(e) {
|
|
3149
3260
|
return e.DefaultMaterial === void 0 && (e.DefaultMaterial = new tt({
|
|
3150
3261
|
color: 16777215,
|
|
3151
3262
|
emissive: 0,
|
|
@@ -3153,16 +3264,16 @@ function Oi(e) {
|
|
|
3153
3264
|
roughness: 1,
|
|
3154
3265
|
transparent: !1,
|
|
3155
3266
|
depthTest: !0,
|
|
3156
|
-
side:
|
|
3267
|
+
side: Ae
|
|
3157
3268
|
})), e.DefaultMaterial;
|
|
3158
3269
|
}
|
|
3159
|
-
function
|
|
3270
|
+
function Ni(e, t, n) {
|
|
3160
3271
|
for (let r in n.extensions) e[r] === void 0 && (t.userData.gltfExtensions = t.userData.gltfExtensions || {}, t.userData.gltfExtensions[r] = n.extensions[r]);
|
|
3161
3272
|
}
|
|
3162
|
-
function
|
|
3273
|
+
function Pi(e, t) {
|
|
3163
3274
|
t.extras !== void 0 && (typeof t.extras == "object" ? Object.assign(e.userData, t.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + t.extras));
|
|
3164
3275
|
}
|
|
3165
|
-
function
|
|
3276
|
+
function Fi(e, t, n) {
|
|
3166
3277
|
let r = !1, i = !1, a = !1;
|
|
3167
3278
|
for (let e = 0, n = t.length; e < n; e++) {
|
|
3168
3279
|
let n = t[e];
|
|
@@ -3194,7 +3305,7 @@ function ji(e, t, n) {
|
|
|
3194
3305
|
return r && (e.morphAttributes.position = n), i && (e.morphAttributes.normal = o), a && (e.morphAttributes.color = s), e.morphTargetsRelative = !0, e;
|
|
3195
3306
|
});
|
|
3196
3307
|
}
|
|
3197
|
-
function
|
|
3308
|
+
function Ii(e, t) {
|
|
3198
3309
|
if (e.updateMorphTargets(), t.weights !== void 0) for (let n = 0, r = t.weights.length; n < r; n++) e.morphTargetInfluences[n] = t.weights[n];
|
|
3199
3310
|
if (t.extras && Array.isArray(t.extras.targetNames)) {
|
|
3200
3311
|
let n = t.extras.targetNames;
|
|
@@ -3204,17 +3315,17 @@ function Mi(e, t) {
|
|
|
3204
3315
|
} else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
3205
3316
|
}
|
|
3206
3317
|
}
|
|
3207
|
-
function
|
|
3318
|
+
function Li(e) {
|
|
3208
3319
|
let t, n = e.extensions && e.extensions[$.KHR_DRACO_MESH_COMPRESSION];
|
|
3209
|
-
if (t = n ? "draco:" + n.bufferView + ":" + n.indices + ":" +
|
|
3320
|
+
if (t = n ? "draco:" + n.bufferView + ":" + n.indices + ":" + Ri(n.attributes) : e.indices + ":" + Ri(e.attributes) + ":" + e.mode, e.targets !== void 0) for (let n = 0, r = e.targets.length; n < r; n++) t += ":" + Ri(e.targets[n]);
|
|
3210
3321
|
return t;
|
|
3211
3322
|
}
|
|
3212
|
-
function
|
|
3323
|
+
function Ri(e) {
|
|
3213
3324
|
let t = "", n = Object.keys(e).sort();
|
|
3214
3325
|
for (let r = 0, i = n.length; r < i; r++) t += n[r] + ":" + e[n[r]] + ";";
|
|
3215
3326
|
return t;
|
|
3216
3327
|
}
|
|
3217
|
-
function
|
|
3328
|
+
function zi(e) {
|
|
3218
3329
|
switch (e) {
|
|
3219
3330
|
case Int8Array: return 1 / 127;
|
|
3220
3331
|
case Uint8Array: return 1 / 255;
|
|
@@ -3223,12 +3334,12 @@ function Fi(e) {
|
|
|
3223
3334
|
default: throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
3224
3335
|
}
|
|
3225
3336
|
}
|
|
3226
|
-
function
|
|
3337
|
+
function Bi(e) {
|
|
3227
3338
|
return e.search(/\.jpe?g($|\?)/i) > 0 || e.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : e.search(/\.webp($|\?)/i) > 0 || e.search(/^data\:image\/webp/) === 0 ? "image/webp" : e.search(/\.ktx2($|\?)/i) > 0 || e.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
3228
3339
|
}
|
|
3229
|
-
var
|
|
3340
|
+
var Vi = new Ze(), Hi = class {
|
|
3230
3341
|
constructor(e = {}, t = {}) {
|
|
3231
|
-
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new
|
|
3342
|
+
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new Jr(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = {
|
|
3232
3343
|
refs: {},
|
|
3233
3344
|
uses: {}
|
|
3234
3345
|
}, this.cameraCache = {
|
|
@@ -3245,7 +3356,7 @@ var Li = new Ze(), Ri = class {
|
|
|
3245
3356
|
let t = e.match(/Version\/(\d+)/);
|
|
3246
3357
|
r = n && t ? parseInt(t[1], 10) : -1, i = e.indexOf("Firefox") > -1, a = i ? e.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
3247
3358
|
}
|
|
3248
|
-
typeof createImageBitmap > "u" || n && r < 17 || i && a < 98 ? this.textureLoader = new At(this.options.manager) : this.textureLoader = new
|
|
3359
|
+
typeof createImageBitmap > "u" || n && r < 17 || i && a < 98 ? this.textureLoader = new At(this.options.manager) : this.textureLoader = new Me(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Oe(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
3249
3360
|
}
|
|
3250
3361
|
setExtensions(e) {
|
|
3251
3362
|
this.extensions = e;
|
|
@@ -3275,7 +3386,7 @@ var Li = new Ze(), Ri = class {
|
|
|
3275
3386
|
parser: n,
|
|
3276
3387
|
userData: {}
|
|
3277
3388
|
};
|
|
3278
|
-
return
|
|
3389
|
+
return Ni(i, a, r), Pi(a, r), Promise.all(n._invokeAll(function(e) {
|
|
3279
3390
|
return e.afterRoot && e.afterRoot(a);
|
|
3280
3391
|
})).then(function() {
|
|
3281
3392
|
for (let e of a.scenes) e.updateMatrixWorld();
|
|
@@ -3415,19 +3526,19 @@ var Li = new Ze(), Ri = class {
|
|
|
3415
3526
|
loadAccessor(e) {
|
|
3416
3527
|
let t = this, n = this.json, r = this.json.accessors[e];
|
|
3417
3528
|
if (r.bufferView === void 0 && r.sparse === void 0) {
|
|
3418
|
-
let e =
|
|
3419
|
-
return Promise.resolve(new
|
|
3529
|
+
let e = Di[r.type], t = wi[r.componentType], n = r.normalized === !0, i = new t(r.count * e);
|
|
3530
|
+
return Promise.resolve(new ye(i, e, n));
|
|
3420
3531
|
}
|
|
3421
3532
|
let i = [];
|
|
3422
3533
|
return r.bufferView === void 0 ? i.push(null) : i.push(this.getDependency("bufferView", r.bufferView)), r.sparse !== void 0 && (i.push(this.getDependency("bufferView", r.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", r.sparse.values.bufferView))), Promise.all(i).then(function(e) {
|
|
3423
|
-
let i = e[0], a =
|
|
3534
|
+
let i = e[0], a = Di[r.type], o = wi[r.componentType], s = o.BYTES_PER_ELEMENT, c = s * a, l = r.byteOffset || 0, u = r.bufferView === void 0 ? void 0 : n.bufferViews[r.bufferView].byteStride, d = r.normalized === !0, f, p;
|
|
3424
3535
|
if (u && u !== c) {
|
|
3425
3536
|
let e = Math.floor(l / u), n = "InterleavedBuffer:" + r.bufferView + ":" + r.componentType + ":" + e + ":" + r.count, c = t.cache.get(n);
|
|
3426
|
-
c || (f = new o(i, e * u, r.count * u / s), c = new
|
|
3427
|
-
} else f = i === null ? new o(r.count * a) : new o(i, l, r.count * a), p = new
|
|
3537
|
+
c || (f = new o(i, e * u, r.count * u / s), c = new Fe(f, u / s), t.cache.add(n, c)), p = new V(c, a, l % u / s, d);
|
|
3538
|
+
} else f = i === null ? new o(r.count * a) : new o(i, l, r.count * a), p = new ye(f, a, d);
|
|
3428
3539
|
if (r.sparse !== void 0) {
|
|
3429
|
-
let t =
|
|
3430
|
-
i !== null && (p = new
|
|
3540
|
+
let t = Di.SCALAR, n = wi[r.sparse.indices.componentType], s = r.sparse.indices.byteOffset || 0, c = r.sparse.values.byteOffset || 0, l = new n(e[1], s, r.sparse.count * t), u = new o(e[2], c, r.sparse.count * a);
|
|
3541
|
+
i !== null && (p = new ye(p.array.slice(), p.itemSize, p.normalized)), p.normalized = !1;
|
|
3431
3542
|
for (let e = 0, t = l.length; e < t; e++) {
|
|
3432
3543
|
let t = l[e];
|
|
3433
3544
|
if (p.setX(t, u[e * a]), a >= 2 && p.setY(t, u[e * a + 1]), a >= 3 && p.setZ(t, u[e * a + 2]), a >= 4 && p.setW(t, u[e * a + 3]), a >= 5) throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
@@ -3451,7 +3562,7 @@ var Li = new Ze(), Ri = class {
|
|
|
3451
3562
|
let c = this.loadImageSource(t, n).then(function(t) {
|
|
3452
3563
|
t.flipY = !1, t.name = a.name || o.name || "", t.name === "" && typeof o.uri == "string" && o.uri.startsWith("data:image/") === !1 && (t.name = o.uri);
|
|
3453
3564
|
let n = (i.samplers || {})[a.sampler] || {};
|
|
3454
|
-
return t.magFilter =
|
|
3565
|
+
return t.magFilter = Ti[n.magFilter] || He, t.minFilter = Ti[n.minFilter] || Ue, t.wrapS = Ei[n.wrapS] || bt, t.wrapT = Ei[n.wrapT] || bt, t.generateMipmaps = !t.isCompressedTexture && t.minFilter !== rt && t.minFilter !== He, r.associations.set(t, { textures: e }), t;
|
|
3455
3566
|
}).catch(function() {
|
|
3456
3567
|
return null;
|
|
3457
3568
|
});
|
|
@@ -3476,7 +3587,7 @@ var Li = new Ze(), Ri = class {
|
|
|
3476
3587
|
}), t.load(qe.resolveURL(e, i.path), a, void 0, r);
|
|
3477
3588
|
});
|
|
3478
3589
|
}).then(function(e) {
|
|
3479
|
-
return c === !0 && o.revokeObjectURL(s),
|
|
3590
|
+
return c === !0 && o.revokeObjectURL(s), Pi(e, a), e.userData.mimeType = a.mimeType || Bi(a.uri), e;
|
|
3480
3591
|
}).catch(function(e) {
|
|
3481
3592
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", s), e;
|
|
3482
3593
|
});
|
|
@@ -3523,7 +3634,7 @@ var Li = new Ze(), Ri = class {
|
|
|
3523
3634
|
a = e.getMaterialType(), c.push(e.extendParams(o, i, t));
|
|
3524
3635
|
} else {
|
|
3525
3636
|
let n = i.pbrMetallicRoughness || {};
|
|
3526
|
-
if (o.color = new
|
|
3637
|
+
if (o.color = new Se(1, 1, 1), o.opacity = 1, Array.isArray(n.baseColorFactor)) {
|
|
3527
3638
|
let e = n.baseColorFactor;
|
|
3528
3639
|
o.color.setRGB(e[0], e[1], e[2], Ge), o.opacity = e[3];
|
|
3529
3640
|
}
|
|
@@ -3533,19 +3644,19 @@ var Li = new Ze(), Ri = class {
|
|
|
3533
3644
|
return t.extendMaterialParams && t.extendMaterialParams(e, o);
|
|
3534
3645
|
})));
|
|
3535
3646
|
}
|
|
3536
|
-
i.doubleSided === !0 && (o.side =
|
|
3537
|
-
let l = i.alphaMode ||
|
|
3538
|
-
if (l ===
|
|
3647
|
+
i.doubleSided === !0 && (o.side = Ee);
|
|
3648
|
+
let l = i.alphaMode || ji.OPAQUE;
|
|
3649
|
+
if (l === ji.BLEND ? (o.transparent = !0, o.depthWrite = !1) : (o.transparent = !1, l === ji.MASK && (o.alphaTest = i.alphaCutoff === void 0 ? .5 : i.alphaCutoff)), i.normalTexture !== void 0 && a !== Qe && (c.push(t.assignTexture(o, "normalMap", i.normalTexture)), o.normalScale = new G(1, 1), i.normalTexture.scale !== void 0)) {
|
|
3539
3650
|
let e = i.normalTexture.scale;
|
|
3540
3651
|
o.normalScale.set(e, e);
|
|
3541
3652
|
}
|
|
3542
3653
|
if (i.occlusionTexture !== void 0 && a !== Qe && (c.push(t.assignTexture(o, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (o.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && a !== Qe) {
|
|
3543
3654
|
let e = i.emissiveFactor;
|
|
3544
|
-
o.emissive = new
|
|
3655
|
+
o.emissive = new Se().setRGB(e[0], e[1], e[2], Ge);
|
|
3545
3656
|
}
|
|
3546
3657
|
return i.emissiveTexture !== void 0 && a !== Qe && c.push(t.assignTexture(o, "emissiveMap", i.emissiveTexture, xt)), Promise.all(c).then(function() {
|
|
3547
3658
|
let n = new a(o);
|
|
3548
|
-
return i.name && (n.name = i.name),
|
|
3659
|
+
return i.name && (n.name = i.name), Pi(n, i), t.associations.set(n, { materials: e }), i.extensions && Ni(r, n, i), n;
|
|
3549
3660
|
});
|
|
3550
3661
|
}
|
|
3551
3662
|
createUniqueName(e) {
|
|
@@ -3556,16 +3667,16 @@ var Li = new Ze(), Ri = class {
|
|
|
3556
3667
|
let t = this, n = this.extensions, r = this.primitiveCache;
|
|
3557
3668
|
function i(e) {
|
|
3558
3669
|
return n[$.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e, t).then(function(n) {
|
|
3559
|
-
return
|
|
3670
|
+
return Wi(n, e, t);
|
|
3560
3671
|
});
|
|
3561
3672
|
}
|
|
3562
3673
|
let a = [];
|
|
3563
3674
|
for (let n = 0, o = e.length; n < o; n++) {
|
|
3564
|
-
let o = e[n], s =
|
|
3675
|
+
let o = e[n], s = Li(o), c = r[s];
|
|
3565
3676
|
if (c) a.push(c.promise);
|
|
3566
3677
|
else {
|
|
3567
3678
|
let e;
|
|
3568
|
-
e = o.extensions && o.extensions[$.KHR_DRACO_MESH_COMPRESSION] ? i(o) :
|
|
3679
|
+
e = o.extensions && o.extensions[$.KHR_DRACO_MESH_COMPRESSION] ? i(o) : Wi(new be(), o, t), r[s] = {
|
|
3569
3680
|
primitive: o,
|
|
3570
3681
|
promise: e
|
|
3571
3682
|
}, a.push(e);
|
|
@@ -3576,28 +3687,28 @@ var Li = new Ze(), Ri = class {
|
|
|
3576
3687
|
loadMesh(e) {
|
|
3577
3688
|
let t = this, n = this.json, r = this.extensions, i = n.meshes[e], a = i.primitives, o = [];
|
|
3578
3689
|
for (let e = 0, t = a.length; e < t; e++) {
|
|
3579
|
-
let t = a[e].material === void 0 ?
|
|
3690
|
+
let t = a[e].material === void 0 ? Mi(this.cache) : this.getDependency("material", a[e].material);
|
|
3580
3691
|
o.push(t);
|
|
3581
3692
|
}
|
|
3582
3693
|
return o.push(t.loadGeometries(a)), Promise.all(o).then(function(n) {
|
|
3583
3694
|
let o = n.slice(0, n.length - 1), s = n[n.length - 1], c = [];
|
|
3584
3695
|
for (let n = 0, l = s.length; n < l; n++) {
|
|
3585
3696
|
let l = s[n], u = a[n], d, f = o[n];
|
|
3586
|
-
if (u.mode ===
|
|
3587
|
-
else if (u.mode ===
|
|
3588
|
-
else if (u.mode ===
|
|
3589
|
-
else if (u.mode ===
|
|
3590
|
-
else if (u.mode ===
|
|
3697
|
+
if (u.mode === Ci.TRIANGLES || u.mode === Ci.TRIANGLE_STRIP || u.mode === Ci.TRIANGLE_FAN || u.mode === void 0) d = i.isSkinnedMesh === !0 ? new Ct(l, f) : new U(l, f), d.isSkinnedMesh === !0 && d.normalizeSkinWeights(), u.mode === Ci.TRIANGLE_STRIP ? d.geometry = Ur(d.geometry, Nt) : u.mode === Ci.TRIANGLE_FAN && (d.geometry = Ur(d.geometry, Mt));
|
|
3698
|
+
else if (u.mode === Ci.LINES) d = new Ve(l, f);
|
|
3699
|
+
else if (u.mode === Ci.LINE_STRIP) d = new H(l, f);
|
|
3700
|
+
else if (u.mode === Ci.LINE_LOOP) d = new Be(l, f);
|
|
3701
|
+
else if (u.mode === Ci.POINTS) d = new mt(l, f);
|
|
3591
3702
|
else throw Error("THREE.GLTFLoader: Primitive mode unsupported: " + u.mode);
|
|
3592
|
-
Object.keys(d.geometry.morphAttributes).length > 0 &&
|
|
3703
|
+
Object.keys(d.geometry.morphAttributes).length > 0 && Ii(d, i), d.name = t.createUniqueName(i.name || "mesh_" + e), Pi(d, i), u.extensions && Ni(r, d, u), t.assignFinalMaterial(d), c.push(d);
|
|
3593
3704
|
}
|
|
3594
3705
|
for (let n = 0, r = c.length; n < r; n++) t.associations.set(c[n], {
|
|
3595
3706
|
meshes: e,
|
|
3596
3707
|
primitives: n
|
|
3597
3708
|
});
|
|
3598
|
-
if (c.length === 1) return i.extensions &&
|
|
3599
|
-
let l = new
|
|
3600
|
-
i.extensions &&
|
|
3709
|
+
if (c.length === 1) return i.extensions && Ni(r, c[0], i), c[0];
|
|
3710
|
+
let l = new je();
|
|
3711
|
+
i.extensions && Ni(r, l, i), t.associations.set(l, { meshes: e });
|
|
3601
3712
|
for (let e = 0, t = c.length; e < t; e++) l.add(c[e]);
|
|
3602
3713
|
return l;
|
|
3603
3714
|
});
|
|
@@ -3608,7 +3719,7 @@ var Li = new Ze(), Ri = class {
|
|
|
3608
3719
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
3609
3720
|
return;
|
|
3610
3721
|
}
|
|
3611
|
-
return n.type === "perspective" ? t = new ut(Xe.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6) : n.type === "orthographic" && (t = new lt(-r.xmag, r.xmag, r.ymag, -r.ymag, r.znear, r.zfar)), n.name && (t.name = this.createUniqueName(n.name)),
|
|
3722
|
+
return n.type === "perspective" ? t = new ut(Xe.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6) : n.type === "orthographic" && (t = new lt(-r.xmag, r.xmag, r.ymag, -r.ymag, r.znear, r.zfar)), n.name && (t.name = this.createUniqueName(n.name)), Pi(t, n), Promise.resolve(t);
|
|
3612
3723
|
}
|
|
3613
3724
|
loadSkin(e) {
|
|
3614
3725
|
let t = this.json.skins[e], n = [];
|
|
@@ -3647,8 +3758,8 @@ var Li = new Ze(), Ri = class {
|
|
|
3647
3758
|
let p = n._createAnimationTracks(r, i, u, d, f);
|
|
3648
3759
|
if (p) for (let e = 0; e < p.length; e++) l.push(p[e]);
|
|
3649
3760
|
}
|
|
3650
|
-
let u = new
|
|
3651
|
-
return
|
|
3761
|
+
let u = new ge(i, void 0, l);
|
|
3762
|
+
return Pi(u, r), u;
|
|
3652
3763
|
});
|
|
3653
3764
|
}
|
|
3654
3765
|
createNodeMesh(e) {
|
|
@@ -3671,7 +3782,7 @@ var Li = new Ze(), Ri = class {
|
|
|
3671
3782
|
]).then(function(e) {
|
|
3672
3783
|
let t = e[0], n = e[1], r = e[2];
|
|
3673
3784
|
r !== null && t.traverse(function(e) {
|
|
3674
|
-
e.isSkinnedMesh && e.bind(r,
|
|
3785
|
+
e.isSkinnedMesh && e.bind(r, Vi);
|
|
3675
3786
|
});
|
|
3676
3787
|
for (let e = 0, r = n.length; e < r; e++) t.add(n[e]);
|
|
3677
3788
|
if (t.userData.pivot !== void 0 && n.length > 0) {
|
|
@@ -3695,8 +3806,8 @@ var Li = new Ze(), Ri = class {
|
|
|
3695
3806
|
o.push(e);
|
|
3696
3807
|
}), this.nodeCache[e] = Promise.all(o).then(function(t) {
|
|
3697
3808
|
let o;
|
|
3698
|
-
if (o = i.isBone === !0 ? new
|
|
3699
|
-
if (i.name && (o.userData.name = i.name, o.name = a),
|
|
3809
|
+
if (o = i.isBone === !0 ? new _e() : t.length > 1 ? new je() : t.length === 1 ? t[0] : new st(), o !== t[0]) for (let e = 0, n = t.length; e < n; e++) o.add(t[e]);
|
|
3810
|
+
if (i.name && (o.userData.name = i.name, o.name = a), Pi(o, i), i.extensions && Ni(n, o, i), i.matrix !== void 0) {
|
|
3700
3811
|
let e = new Ze();
|
|
3701
3812
|
e.fromArray(i.matrix), o.applyMatrix4(e);
|
|
3702
3813
|
} else i.translation !== void 0 && o.position.fromArray(i.translation), i.rotation !== void 0 && o.quaternion.fromArray(i.rotation), i.scale !== void 0 && o.scale.fromArray(i.scale);
|
|
@@ -3709,14 +3820,14 @@ var Li = new Ze(), Ri = class {
|
|
|
3709
3820
|
}), this.nodeCache[e];
|
|
3710
3821
|
}
|
|
3711
3822
|
loadScene(e) {
|
|
3712
|
-
let t = this.extensions, n = this.json.scenes[e], r = this, i = new
|
|
3713
|
-
n.name && (i.name = r.createUniqueName(n.name)),
|
|
3823
|
+
let t = this.extensions, n = this.json.scenes[e], r = this, i = new je();
|
|
3824
|
+
n.name && (i.name = r.createUniqueName(n.name)), Pi(i, n), n.extensions && Ni(t, i, n);
|
|
3714
3825
|
let a = n.nodes || [], o = [];
|
|
3715
3826
|
for (let e = 0, t = a.length; e < t; e++) o.push(r.getDependency("node", a[e]));
|
|
3716
3827
|
return Promise.all(o).then(function(e) {
|
|
3717
3828
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
3718
3829
|
let n = e[t];
|
|
3719
|
-
n.parent === null ? i.add(n) : i.add(
|
|
3830
|
+
n.parent === null ? i.add(n) : i.add(Wr(n));
|
|
3720
3831
|
}
|
|
3721
3832
|
return r.associations = ((e) => {
|
|
3722
3833
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3733,17 +3844,17 @@ var Li = new Ze(), Ri = class {
|
|
|
3733
3844
|
function c(e) {
|
|
3734
3845
|
e.morphTargetInfluences && s.push(e.name ? e.name : e.uuid);
|
|
3735
3846
|
}
|
|
3736
|
-
|
|
3847
|
+
ki[i.path] === ki.weights ? (c(e), e.isGroup && e.children.forEach(c)) : s.push(o);
|
|
3737
3848
|
let l;
|
|
3738
|
-
switch (
|
|
3739
|
-
case
|
|
3849
|
+
switch (ki[i.path]) {
|
|
3850
|
+
case ki.weights:
|
|
3740
3851
|
l = ot;
|
|
3741
3852
|
break;
|
|
3742
|
-
case
|
|
3853
|
+
case ki.rotation:
|
|
3743
3854
|
l = _t;
|
|
3744
3855
|
break;
|
|
3745
|
-
case
|
|
3746
|
-
case
|
|
3856
|
+
case ki.translation:
|
|
3857
|
+
case ki.scale:
|
|
3747
3858
|
l = Ft;
|
|
3748
3859
|
break;
|
|
3749
3860
|
default:
|
|
@@ -3757,9 +3868,9 @@ var Li = new Ze(), Ri = class {
|
|
|
3757
3868
|
}
|
|
3758
3869
|
break;
|
|
3759
3870
|
}
|
|
3760
|
-
let u = r.interpolation === void 0 ?
|
|
3871
|
+
let u = r.interpolation === void 0 ? Re : Ai[r.interpolation], d = this._getArrayFromAccessor(n);
|
|
3761
3872
|
for (let e = 0, n = s.length; e < n; e++) {
|
|
3762
|
-
let n = new l(s[e] + "." +
|
|
3873
|
+
let n = new l(s[e] + "." + ki[i.path], t.array, d, u);
|
|
3763
3874
|
r.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(n), a.push(n);
|
|
3764
3875
|
}
|
|
3765
3876
|
return a;
|
|
@@ -3767,7 +3878,7 @@ var Li = new Ze(), Ri = class {
|
|
|
3767
3878
|
_getArrayFromAccessor(e) {
|
|
3768
3879
|
let t = e.array;
|
|
3769
3880
|
if (e.normalized) {
|
|
3770
|
-
let e =
|
|
3881
|
+
let e = zi(t.constructor), n = new Float32Array(t.length);
|
|
3771
3882
|
for (let r = 0, i = t.length; r < i; r++) n[r] = t[r] * e;
|
|
3772
3883
|
t = n;
|
|
3773
3884
|
}
|
|
@@ -3775,17 +3886,17 @@ var Li = new Ze(), Ri = class {
|
|
|
3775
3886
|
}
|
|
3776
3887
|
_createCubicSplineTrackInterpolant(e) {
|
|
3777
3888
|
e.createInterpolant = function(e) {
|
|
3778
|
-
return new (this instanceof _t ?
|
|
3889
|
+
return new (this instanceof _t ? Si : bi)(this.times, this.values, this.getValueSize() / 3, e);
|
|
3779
3890
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
3780
3891
|
}
|
|
3781
3892
|
};
|
|
3782
|
-
function
|
|
3783
|
-
let r = t.attributes, i = new
|
|
3893
|
+
function Ui(e, t, n) {
|
|
3894
|
+
let r = t.attributes, i = new ve();
|
|
3784
3895
|
if (r.POSITION !== void 0) {
|
|
3785
3896
|
let e = n.json.accessors[r.POSITION], t = e.min, a = e.max;
|
|
3786
3897
|
if (t !== void 0 && a !== void 0) {
|
|
3787
3898
|
if (i.set(new K(t[0], t[1], t[2]), new K(a[0], a[1], a[2])), e.normalized) {
|
|
3788
|
-
let t =
|
|
3899
|
+
let t = zi(wi[e.componentType]);
|
|
3789
3900
|
i.min.multiplyScalar(t), i.max.multiplyScalar(t);
|
|
3790
3901
|
}
|
|
3791
3902
|
} else {
|
|
@@ -3802,7 +3913,7 @@ function zi(e, t, n) {
|
|
|
3802
3913
|
let r = n.json.accessors[i.POSITION], a = r.min, o = r.max;
|
|
3803
3914
|
if (a !== void 0 && o !== void 0) {
|
|
3804
3915
|
if (t.setX(Math.max(Math.abs(a[0]), Math.abs(o[0]))), t.setY(Math.max(Math.abs(a[1]), Math.abs(o[1]))), t.setZ(Math.max(Math.abs(a[2]), Math.abs(o[2]))), r.normalized) {
|
|
3805
|
-
let e =
|
|
3916
|
+
let e = zi(wi[r.componentType]);
|
|
3806
3917
|
t.multiplyScalar(e);
|
|
3807
3918
|
}
|
|
3808
3919
|
e.max(t);
|
|
@@ -3815,7 +3926,7 @@ function zi(e, t, n) {
|
|
|
3815
3926
|
let o = new wt();
|
|
3816
3927
|
i.getCenter(o.center), o.radius = i.min.distanceTo(i.max) / 2, e.boundingSphere = o;
|
|
3817
3928
|
}
|
|
3818
|
-
function
|
|
3929
|
+
function Wi(e, t, n) {
|
|
3819
3930
|
let r = t.attributes, i = [];
|
|
3820
3931
|
function a(t, r) {
|
|
3821
3932
|
return n.getDependency("accessor", t).then(function(t) {
|
|
@@ -3823,7 +3934,7 @@ function Bi(e, t, n) {
|
|
|
3823
3934
|
});
|
|
3824
3935
|
}
|
|
3825
3936
|
for (let t in r) {
|
|
3826
|
-
let n =
|
|
3937
|
+
let n = Oi[t] || t.toLowerCase();
|
|
3827
3938
|
n in e.attributes || i.push(a(r[t], n));
|
|
3828
3939
|
}
|
|
3829
3940
|
if (t.indices !== void 0 && !e.index) {
|
|
@@ -3832,14 +3943,14 @@ function Bi(e, t, n) {
|
|
|
3832
3943
|
});
|
|
3833
3944
|
i.push(r);
|
|
3834
3945
|
}
|
|
3835
|
-
return
|
|
3836
|
-
return t.targets === void 0 ? e :
|
|
3946
|
+
return Ce.workingColorSpace !== Ge && "COLOR_0" in r && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Ce.workingColorSpace}" not supported.`), Pi(e, t), Ui(e, t, n), Promise.all(i).then(function() {
|
|
3947
|
+
return t.targets === void 0 ? e : Fi(e, t.targets, n);
|
|
3837
3948
|
});
|
|
3838
3949
|
}
|
|
3839
3950
|
//#endregion
|
|
3840
3951
|
//#region ../../node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/loaders/OBJLoader.js
|
|
3841
|
-
var
|
|
3842
|
-
function
|
|
3952
|
+
var Gi = /^[og]\s*(.+)?/, Ki = /^mtllib /, qi = /^usemtl /, Ji = /^usemap /, Yi = /\s+/, Xi = new K(), Zi = new K(), Qi = new K(), $i = new K(), ea = new K(), ta = new Se();
|
|
3953
|
+
function na() {
|
|
3843
3954
|
let e = {
|
|
3844
3955
|
objects: [],
|
|
3845
3956
|
object: {},
|
|
@@ -3945,7 +4056,7 @@ function Qi() {
|
|
|
3945
4056
|
},
|
|
3946
4057
|
addFaceNormal: function(e, t, n) {
|
|
3947
4058
|
let r = this.vertices, i = this.object.geometry.normals;
|
|
3948
|
-
|
|
4059
|
+
Xi.fromArray(r, e), Zi.fromArray(r, t), Qi.fromArray(r, n), ea.subVectors(Qi, Zi), $i.subVectors(Xi, Zi), ea.cross($i), ea.normalize(), i.push(ea.x, ea.y, ea.z), i.push(ea.x, ea.y, ea.z), i.push(ea.x, ea.y, ea.z);
|
|
3949
4060
|
},
|
|
3950
4061
|
addColor: function(e, t, n) {
|
|
3951
4062
|
let r = this.colors, i = this.object.geometry.colors;
|
|
@@ -3991,12 +4102,12 @@ function Qi() {
|
|
|
3991
4102
|
};
|
|
3992
4103
|
return e.startObject("", !1), e;
|
|
3993
4104
|
}
|
|
3994
|
-
var
|
|
4105
|
+
var ra = class extends Ke {
|
|
3995
4106
|
constructor(e) {
|
|
3996
4107
|
super(e), this.materials = null;
|
|
3997
4108
|
}
|
|
3998
4109
|
load(e, t, n, r) {
|
|
3999
|
-
let i = this, a = new
|
|
4110
|
+
let i = this, a = new Oe(this.manager);
|
|
4000
4111
|
a.setPath(this.path), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(e, function(n) {
|
|
4001
4112
|
try {
|
|
4002
4113
|
t(i.parse(n));
|
|
@@ -4009,7 +4120,7 @@ var $i = class extends Ke {
|
|
|
4009
4120
|
return this.materials = e, this;
|
|
4010
4121
|
}
|
|
4011
4122
|
parse(e) {
|
|
4012
|
-
let t = new
|
|
4123
|
+
let t = new na();
|
|
4013
4124
|
e.indexOf("\r\n") !== -1 && (e = e.replace(/\r\n/g, "\n")), e.indexOf("\\\n") !== -1 && (e = e.replace(/\\\n/g, ""));
|
|
4014
4125
|
let n = e.split("\n"), r = [];
|
|
4015
4126
|
for (let e = 0, i = n.length; e < i; e++) {
|
|
@@ -4017,10 +4128,10 @@ var $i = class extends Ke {
|
|
|
4017
4128
|
if (i.length === 0) continue;
|
|
4018
4129
|
let a = i.charAt(0);
|
|
4019
4130
|
if (a !== "#") if (a === "v") {
|
|
4020
|
-
let e = i.split(
|
|
4131
|
+
let e = i.split(Yi);
|
|
4021
4132
|
switch (e[0]) {
|
|
4022
4133
|
case "v":
|
|
4023
|
-
t.vertices.push(parseFloat(e[1]), parseFloat(e[2]), parseFloat(e[3])), e.length >= 7 ? (
|
|
4134
|
+
t.vertices.push(parseFloat(e[1]), parseFloat(e[2]), parseFloat(e[3])), e.length >= 7 ? (ta.setRGB(parseFloat(e[4]), parseFloat(e[5]), parseFloat(e[6]), xt), t.colors.push(ta.r, ta.g, ta.b)) : t.colors.push(void 0, void 0, void 0);
|
|
4024
4135
|
break;
|
|
4025
4136
|
case "vn":
|
|
4026
4137
|
t.normals.push(parseFloat(e[1]), parseFloat(e[2]), parseFloat(e[3]));
|
|
@@ -4030,7 +4141,7 @@ var $i = class extends Ke {
|
|
|
4030
4141
|
break;
|
|
4031
4142
|
}
|
|
4032
4143
|
} else if (a === "f") {
|
|
4033
|
-
let e = i.slice(1).trim().split(
|
|
4144
|
+
let e = i.slice(1).trim().split(Yi), n = [];
|
|
4034
4145
|
for (let t = 0, r = e.length; t < r; t++) {
|
|
4035
4146
|
let r = e[t];
|
|
4036
4147
|
if (r.length > 0) {
|
|
@@ -4054,12 +4165,12 @@ var $i = class extends Ke {
|
|
|
4054
4165
|
} else if (a === "p") {
|
|
4055
4166
|
let e = i.slice(1).trim().split(" ");
|
|
4056
4167
|
t.addPointGeometry(e);
|
|
4057
|
-
} else if ((r =
|
|
4168
|
+
} else if ((r = Gi.exec(i)) !== null) {
|
|
4058
4169
|
let e = (" " + r[0].slice(1).trim()).slice(1);
|
|
4059
4170
|
t.startObject(e);
|
|
4060
|
-
} else if (
|
|
4061
|
-
else if (
|
|
4062
|
-
else if (
|
|
4171
|
+
} else if (qi.test(i)) t.object.startMaterial(i.substring(7).trim(), t.materialLibraries);
|
|
4172
|
+
else if (Ki.test(i)) t.materialLibraries.push(i.substring(7).trim());
|
|
4173
|
+
else if (Ji.test(i)) console.warn("THREE.OBJLoader: Rendering identifier \"usemap\" not supported. Textures must be defined in MTL files.");
|
|
4063
4174
|
else if (a === "s") {
|
|
4064
4175
|
if (r = i.split(" "), r.length > 1) {
|
|
4065
4176
|
let e = r[1].trim().toLowerCase();
|
|
@@ -4073,12 +4184,12 @@ var $i = class extends Ke {
|
|
|
4073
4184
|
}
|
|
4074
4185
|
}
|
|
4075
4186
|
t.finalize();
|
|
4076
|
-
let i = new
|
|
4187
|
+
let i = new je();
|
|
4077
4188
|
if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0)) for (let e = 0, n = t.objects.length; e < n; e++) {
|
|
4078
4189
|
let n = t.objects[e], r = n.geometry, a = n.materials, o = r.type === "Line", s = r.type === "Points", c = !1;
|
|
4079
4190
|
if (r.vertices.length === 0) continue;
|
|
4080
|
-
let l = new
|
|
4081
|
-
l.setAttribute("position", new
|
|
4191
|
+
let l = new be();
|
|
4192
|
+
l.setAttribute("position", new ke(r.vertices, 3)), r.normals.length > 0 && l.setAttribute("normal", new ke(r.normals, 3)), r.colors.length > 0 && (c = !0, l.setAttribute("color", new ke(r.colors, 3))), r.hasUVIndices === !0 && l.setAttribute("uv", new ke(r.uvs, 2));
|
|
4082
4193
|
let u = [];
|
|
4083
4194
|
for (let e = 0, n = a.length; e < n; e++) {
|
|
4084
4195
|
let n = a[e], r = n.name + "_" + n.smooth + "_" + c, i = t.materials[r];
|
|
@@ -4113,14 +4224,14 @@ var $i = class extends Ke {
|
|
|
4113
4224
|
let e = new ht({
|
|
4114
4225
|
size: 1,
|
|
4115
4226
|
sizeAttenuation: !1
|
|
4116
|
-
}), n = new
|
|
4117
|
-
n.setAttribute("position", new
|
|
4227
|
+
}), n = new be();
|
|
4228
|
+
n.setAttribute("position", new ke(t.vertices, 3)), t.colors.length > 0 && t.colors[0] !== void 0 && (n.setAttribute("color", new ke(t.colors, 3)), e.vertexColors = !0);
|
|
4118
4229
|
let r = new mt(n, e);
|
|
4119
4230
|
i.add(r);
|
|
4120
4231
|
}
|
|
4121
4232
|
return i;
|
|
4122
4233
|
}
|
|
4123
|
-
},
|
|
4234
|
+
}, ia = /*#__PURE__*/ Bt({
|
|
4124
4235
|
__name: "Viewport3D",
|
|
4125
4236
|
props: {
|
|
4126
4237
|
meshes: {
|
|
@@ -4149,17 +4260,17 @@ var $i = class extends Ke {
|
|
|
4149
4260
|
setup(e, { expose: t, emit: n }) {
|
|
4150
4261
|
let r = e, o = n, s = _(null), c = _(null), l = _(null), u, d, f, g, v, y, b, x, S = {}, w = {}, T = null, E = /* @__PURE__ */ new Set(), D = () => {
|
|
4151
4262
|
let e = c.value, t = s.value;
|
|
4152
|
-
u = new
|
|
4263
|
+
u = new R.Scene(), u.background = new R.Color(15790320), d = new R.PerspectiveCamera(50, t.clientWidth / t.clientHeight, .1, 1e3), d.position.set(5, 5, 8), f = new R.WebGLRenderer({
|
|
4153
4264
|
canvas: e,
|
|
4154
4265
|
antialias: !0
|
|
4155
|
-
}), f.setSize(t.clientWidth, t.clientHeight), f.setPixelRatio(window.devicePixelRatio), g = new
|
|
4266
|
+
}), f.setSize(t.clientWidth, t.clientHeight), f.setPixelRatio(window.devicePixelRatio), g = new Hr(), g.setSize(t.clientWidth, t.clientHeight), g.domElement.style.position = "absolute", g.domElement.style.top = "0", g.domElement.style.left = "0", g.domElement.style.pointerEvents = "none", t.appendChild(g.domElement), v = new qn(d, f.domElement), v.enableDamping = !0, y = new pr(d, f.domElement), y.addEventListener("dragging-changed", (e) => {
|
|
4156
4267
|
v.enabled = !e.value;
|
|
4157
|
-
}), y.addEventListener("objectChange", P), b = new
|
|
4158
|
-
let n = new
|
|
4268
|
+
}), y.addEventListener("objectChange", P), b = new R.Raycaster(), x = new R.Vector2();
|
|
4269
|
+
let n = new R.AmbientLight(16777215, .6);
|
|
4159
4270
|
u.add(n);
|
|
4160
|
-
let r = new
|
|
4271
|
+
let r = new R.DirectionalLight(16777215, .8);
|
|
4161
4272
|
r.position.set(5, 10, 7), u.add(r);
|
|
4162
|
-
let i = new
|
|
4273
|
+
let i = new R.GridHelper(20, 20, 13421772, 14737632);
|
|
4163
4274
|
u.add(i), O();
|
|
4164
4275
|
}, O = () => {
|
|
4165
4276
|
T = requestAnimationFrame(O), v.update(), f.render(u, d), g.render(u, d);
|
|
@@ -4167,103 +4278,103 @@ var $i = class extends Ke {
|
|
|
4167
4278
|
let t, n = e.scale || 1;
|
|
4168
4279
|
switch (e.shape) {
|
|
4169
4280
|
case "cube":
|
|
4170
|
-
t = new
|
|
4281
|
+
t = new R.BoxGeometry(n, n, n);
|
|
4171
4282
|
break;
|
|
4172
4283
|
case "sphere":
|
|
4173
|
-
t = new
|
|
4284
|
+
t = new R.SphereGeometry(n * .5, 32, 32);
|
|
4174
4285
|
break;
|
|
4175
4286
|
case "cylinder":
|
|
4176
|
-
t = new
|
|
4287
|
+
t = new R.CylinderGeometry(n * .4, n * .4, n, 32);
|
|
4177
4288
|
break;
|
|
4178
4289
|
case "cone":
|
|
4179
|
-
t = new
|
|
4290
|
+
t = new R.ConeGeometry(n * .4, n, 32);
|
|
4180
4291
|
break;
|
|
4181
4292
|
case "torus":
|
|
4182
|
-
t = new
|
|
4293
|
+
t = new R.TorusGeometry(n * .4, n * .15, 16, 48);
|
|
4183
4294
|
break;
|
|
4184
4295
|
case "tetrahedron":
|
|
4185
|
-
t = new
|
|
4296
|
+
t = new R.TetrahedronGeometry(n * .5);
|
|
4186
4297
|
break;
|
|
4187
4298
|
case "octahedron":
|
|
4188
|
-
t = new
|
|
4299
|
+
t = new R.OctahedronGeometry(n * .5);
|
|
4189
4300
|
break;
|
|
4190
4301
|
case "dodecahedron":
|
|
4191
|
-
t = new
|
|
4302
|
+
t = new R.DodecahedronGeometry(n * .5);
|
|
4192
4303
|
break;
|
|
4193
4304
|
case "icosahedron":
|
|
4194
|
-
t = new
|
|
4305
|
+
t = new R.IcosahedronGeometry(n * .5);
|
|
4195
4306
|
break;
|
|
4196
4307
|
case "torusKnot":
|
|
4197
|
-
t = new
|
|
4308
|
+
t = new R.TorusKnotGeometry(n * .3, n * .08, 100, 16);
|
|
4198
4309
|
break;
|
|
4199
4310
|
case "capsule":
|
|
4200
|
-
t = new
|
|
4311
|
+
t = new R.CapsuleGeometry(n * .25, n * .5, 16, 32);
|
|
4201
4312
|
break;
|
|
4202
4313
|
case "ring":
|
|
4203
|
-
t = new
|
|
4314
|
+
t = new R.RingGeometry(n * .2, n * .5, 32);
|
|
4204
4315
|
break;
|
|
4205
4316
|
case "plane":
|
|
4206
|
-
t = new
|
|
4317
|
+
t = new R.PlaneGeometry(n, n);
|
|
4207
4318
|
break;
|
|
4208
4319
|
case "circle":
|
|
4209
|
-
t = new
|
|
4320
|
+
t = new R.CircleGeometry(n * .5, 32);
|
|
4210
4321
|
break;
|
|
4211
4322
|
case "tube":
|
|
4212
|
-
t = new
|
|
4213
|
-
new
|
|
4214
|
-
new
|
|
4215
|
-
new
|
|
4216
|
-
new
|
|
4217
|
-
new
|
|
4323
|
+
t = new R.TubeGeometry(new R.CatmullRomCurve3([
|
|
4324
|
+
new R.Vector3(-n * .4, 0, 0),
|
|
4325
|
+
new R.Vector3(-n * .2, n * .2, 0),
|
|
4326
|
+
new R.Vector3(0, 0, n * .2),
|
|
4327
|
+
new R.Vector3(n * .2, -n * .2, 0),
|
|
4328
|
+
new R.Vector3(n * .4, 0, 0)
|
|
4218
4329
|
]), 64, n * .08, 16, !1);
|
|
4219
4330
|
break;
|
|
4220
4331
|
case "lathe":
|
|
4221
|
-
t = new
|
|
4222
|
-
new
|
|
4223
|
-
new
|
|
4224
|
-
new
|
|
4225
|
-
new
|
|
4226
|
-
new
|
|
4332
|
+
t = new R.LatheGeometry([
|
|
4333
|
+
new R.Vector2(0, -n * .5),
|
|
4334
|
+
new R.Vector2(n * .3, -n * .3),
|
|
4335
|
+
new R.Vector2(n * .4, 0),
|
|
4336
|
+
new R.Vector2(n * .3, n * .3),
|
|
4337
|
+
new R.Vector2(0, n * .5)
|
|
4227
4338
|
], 32);
|
|
4228
4339
|
break;
|
|
4229
4340
|
case "pyramid": {
|
|
4230
|
-
let e = new
|
|
4231
|
-
e.moveTo(0, n * .5), e.lineTo(-n * .5, -n * .5), e.lineTo(n * .5, -n * .5), e.closePath(), t = new
|
|
4341
|
+
let e = new R.Shape();
|
|
4342
|
+
e.moveTo(0, n * .5), e.lineTo(-n * .5, -n * .5), e.lineTo(n * .5, -n * .5), e.closePath(), t = new R.ExtrudeGeometry(e, {
|
|
4232
4343
|
depth: n * .5,
|
|
4233
4344
|
bevelEnabled: !1
|
|
4234
4345
|
}), t.center();
|
|
4235
4346
|
break;
|
|
4236
4347
|
}
|
|
4237
4348
|
case "star": {
|
|
4238
|
-
let e = new
|
|
4349
|
+
let e = new R.Shape(), r = n * .5, i = n * .2;
|
|
4239
4350
|
for (let t = 0; t < 10; t++) {
|
|
4240
4351
|
let n = t % 2 == 0 ? r : i, a = t * Math.PI / 5 - Math.PI / 2;
|
|
4241
4352
|
t === 0 ? e.moveTo(Math.cos(a) * n, Math.sin(a) * n) : e.lineTo(Math.cos(a) * n, Math.sin(a) * n);
|
|
4242
4353
|
}
|
|
4243
|
-
e.closePath(), t = new
|
|
4354
|
+
e.closePath(), t = new R.ExtrudeGeometry(e, {
|
|
4244
4355
|
depth: n * .2,
|
|
4245
4356
|
bevelEnabled: !1
|
|
4246
4357
|
}), t.center();
|
|
4247
4358
|
break;
|
|
4248
4359
|
}
|
|
4249
4360
|
case "arrow": {
|
|
4250
|
-
let e = new
|
|
4251
|
-
e.moveTo(0, n * .5), e.lineTo(n * .3, n * .1), e.lineTo(n * .15, n * .1), e.lineTo(n * .15, -n * .5), e.lineTo(-n * .15, -n * .5), e.lineTo(-n * .15, n * .1), e.lineTo(-n * .3, n * .1), e.closePath(), t = new
|
|
4361
|
+
let e = new R.Shape();
|
|
4362
|
+
e.moveTo(0, n * .5), e.lineTo(n * .3, n * .1), e.lineTo(n * .15, n * .1), e.lineTo(n * .15, -n * .5), e.lineTo(-n * .15, -n * .5), e.lineTo(-n * .15, n * .1), e.lineTo(-n * .3, n * .1), e.closePath(), t = new R.ExtrudeGeometry(e, {
|
|
4252
4363
|
depth: n * .15,
|
|
4253
4364
|
bevelEnabled: !1
|
|
4254
4365
|
}), t.center();
|
|
4255
4366
|
break;
|
|
4256
4367
|
}
|
|
4257
4368
|
case "heart": {
|
|
4258
|
-
let e = new
|
|
4259
|
-
e.moveTo(0, n * .3), e.bezierCurveTo(0, n * .5, -n * .5, n * .5, -n * .5, n * .1), e.bezierCurveTo(-n * .5, -n * .3, 0, -n * .3, 0, -n * .5), e.bezierCurveTo(0, -n * .3, n * .5, -n * .3, n * .5, n * .1), e.bezierCurveTo(n * .5, n * .5, 0, n * .5, 0, n * .3), t = new
|
|
4369
|
+
let e = new R.Shape();
|
|
4370
|
+
e.moveTo(0, n * .3), e.bezierCurveTo(0, n * .5, -n * .5, n * .5, -n * .5, n * .1), e.bezierCurveTo(-n * .5, -n * .3, 0, -n * .3, 0, -n * .5), e.bezierCurveTo(0, -n * .3, n * .5, -n * .3, n * .5, n * .1), e.bezierCurveTo(n * .5, n * .5, 0, n * .5, 0, n * .3), t = new R.ExtrudeGeometry(e, {
|
|
4260
4371
|
depth: n * .2,
|
|
4261
4372
|
bevelEnabled: !1
|
|
4262
4373
|
}), t.center();
|
|
4263
4374
|
break;
|
|
4264
4375
|
}
|
|
4265
4376
|
case "gear": {
|
|
4266
|
-
let e = new
|
|
4377
|
+
let e = new R.Shape();
|
|
4267
4378
|
n * .5;
|
|
4268
4379
|
let r = n * .4, i = n * .08;
|
|
4269
4380
|
for (let t = 0; t < 12; t++) {
|
|
@@ -4271,37 +4382,37 @@ var $i = class extends Ke {
|
|
|
4271
4382
|
t === 0 && e.moveTo(Math.cos(n) * r, Math.sin(n) * r), e.lineTo(Math.cos(a) * r, Math.sin(a) * r), e.lineTo(Math.cos(a) * (r + i), Math.sin(a) * (r + i)), e.lineTo(Math.cos(o) * (r + i), Math.sin(o) * (r + i)), e.lineTo(Math.cos(s) * r, Math.sin(s) * r);
|
|
4272
4383
|
}
|
|
4273
4384
|
e.closePath();
|
|
4274
|
-
let a = new
|
|
4275
|
-
a.absarc(0, 0, n * .12, 0, Math.PI * 2, !0), e.holes.push(a), t = new
|
|
4385
|
+
let a = new R.Path();
|
|
4386
|
+
a.absarc(0, 0, n * .12, 0, Math.PI * 2, !0), e.holes.push(a), t = new R.ExtrudeGeometry(e, {
|
|
4276
4387
|
depth: n * .15,
|
|
4277
4388
|
bevelEnabled: !1
|
|
4278
4389
|
}), t.center();
|
|
4279
4390
|
break;
|
|
4280
4391
|
}
|
|
4281
4392
|
case "bearing":
|
|
4282
|
-
t = new
|
|
4393
|
+
t = new R.TorusGeometry(n * .35, n * .08, 16, 48);
|
|
4283
4394
|
break;
|
|
4284
4395
|
case "bolt": {
|
|
4285
|
-
let e = new
|
|
4396
|
+
let e = new R.Shape();
|
|
4286
4397
|
for (let t = 0; t < 6; t++) {
|
|
4287
4398
|
let r = t / 6 * Math.PI * 2 - Math.PI / 2, i = n * .18;
|
|
4288
4399
|
t === 0 ? e.moveTo(Math.cos(r) * i, Math.sin(r) * i) : e.lineTo(Math.cos(r) * i, Math.sin(r) * i);
|
|
4289
4400
|
}
|
|
4290
|
-
e.closePath(), t = new
|
|
4401
|
+
e.closePath(), t = new R.ExtrudeGeometry(e, {
|
|
4291
4402
|
depth: n * .15,
|
|
4292
4403
|
bevelEnabled: !1
|
|
4293
4404
|
}), t.center();
|
|
4294
4405
|
break;
|
|
4295
4406
|
}
|
|
4296
4407
|
case "nut": {
|
|
4297
|
-
let e = new
|
|
4408
|
+
let e = new R.Shape();
|
|
4298
4409
|
for (let t = 0; t < 6; t++) {
|
|
4299
4410
|
let r = t / 6 * Math.PI * 2 - Math.PI / 2, i = n * .22;
|
|
4300
4411
|
t === 0 ? e.moveTo(Math.cos(r) * i, Math.sin(r) * i) : e.lineTo(Math.cos(r) * i, Math.sin(r) * i);
|
|
4301
4412
|
}
|
|
4302
4413
|
e.closePath();
|
|
4303
|
-
let r = new
|
|
4304
|
-
r.absarc(0, 0, n * .1, 0, Math.PI * 2, !0), e.holes.push(r), t = new
|
|
4414
|
+
let r = new R.Path();
|
|
4415
|
+
r.absarc(0, 0, n * .1, 0, Math.PI * 2, !0), e.holes.push(r), t = new R.ExtrudeGeometry(e, {
|
|
4305
4416
|
depth: n * .12,
|
|
4306
4417
|
bevelEnabled: !1
|
|
4307
4418
|
}), t.center();
|
|
@@ -4311,83 +4422,83 @@ var $i = class extends Ke {
|
|
|
4311
4422
|
let e = [], r = n * .2, i = n * .8;
|
|
4312
4423
|
for (let t = 0; t <= 192; t++) {
|
|
4313
4424
|
let n = t / 192, a = n * 6 * Math.PI * 2;
|
|
4314
|
-
e.push(new
|
|
4425
|
+
e.push(new R.Vector3(Math.cos(a) * r, (n - .5) * i, Math.sin(a) * r));
|
|
4315
4426
|
}
|
|
4316
|
-
let a = new
|
|
4317
|
-
t = new
|
|
4427
|
+
let a = new R.CatmullRomCurve3(e);
|
|
4428
|
+
t = new R.TubeGeometry(a, 200, n * .025, 8, !1);
|
|
4318
4429
|
break;
|
|
4319
4430
|
}
|
|
4320
4431
|
case "shaft":
|
|
4321
|
-
t = new
|
|
4432
|
+
t = new R.CylinderGeometry(n * .12, n * .12, n * .9, 32);
|
|
4322
4433
|
break;
|
|
4323
4434
|
case "flange": {
|
|
4324
|
-
let e = new
|
|
4435
|
+
let e = new R.Shape();
|
|
4325
4436
|
e.absarc(0, 0, n * .45, 0, Math.PI * 2, !1);
|
|
4326
|
-
let r = new
|
|
4327
|
-
r.absarc(0, 0, n * .15, 0, Math.PI * 2, !0), e.holes.push(r), t = new
|
|
4437
|
+
let r = new R.Path();
|
|
4438
|
+
r.absarc(0, 0, n * .15, 0, Math.PI * 2, !0), e.holes.push(r), t = new R.ExtrudeGeometry(e, {
|
|
4328
4439
|
depth: n * .1,
|
|
4329
4440
|
bevelEnabled: !1
|
|
4330
4441
|
}), t.center();
|
|
4331
4442
|
break;
|
|
4332
4443
|
}
|
|
4333
4444
|
case "coupling":
|
|
4334
|
-
t = new
|
|
4445
|
+
t = new R.CylinderGeometry(n * .25, n * .25, n * .4, 32);
|
|
4335
4446
|
break;
|
|
4336
4447
|
case "lBracket": {
|
|
4337
|
-
let e = new
|
|
4338
|
-
e.moveTo(-n * .3, -n * .3), e.lineTo(-n * .3, n * .3), e.lineTo(-n * .15, n * .3), e.lineTo(-n * .15, -n * .15), e.lineTo(n * .3, -n * .15), e.lineTo(n * .3, -n * .3), e.closePath(), t = new
|
|
4448
|
+
let e = new R.Shape();
|
|
4449
|
+
e.moveTo(-n * .3, -n * .3), e.lineTo(-n * .3, n * .3), e.lineTo(-n * .15, n * .3), e.lineTo(-n * .15, -n * .15), e.lineTo(n * .3, -n * .15), e.lineTo(n * .3, -n * .3), e.closePath(), t = new R.ExtrudeGeometry(e, {
|
|
4339
4450
|
depth: n * .1,
|
|
4340
4451
|
bevelEnabled: !1
|
|
4341
4452
|
}), t.center();
|
|
4342
4453
|
break;
|
|
4343
4454
|
}
|
|
4344
4455
|
case "uChannel": {
|
|
4345
|
-
let e = new
|
|
4346
|
-
e.moveTo(-n * .3, -n * .3), e.lineTo(-n * .3, n * .3), e.lineTo(-n * .15, n * .3), e.lineTo(-n * .15, -n * .15), e.lineTo(n * .15, -n * .15), e.lineTo(n * .15, n * .3), e.lineTo(n * .3, n * .3), e.lineTo(n * .3, -n * .3), e.closePath(), t = new
|
|
4456
|
+
let e = new R.Shape();
|
|
4457
|
+
e.moveTo(-n * .3, -n * .3), e.lineTo(-n * .3, n * .3), e.lineTo(-n * .15, n * .3), e.lineTo(-n * .15, -n * .15), e.lineTo(n * .15, -n * .15), e.lineTo(n * .15, n * .3), e.lineTo(n * .3, n * .3), e.lineTo(n * .3, -n * .3), e.closePath(), t = new R.ExtrudeGeometry(e, {
|
|
4347
4458
|
depth: n * .1,
|
|
4348
4459
|
bevelEnabled: !1
|
|
4349
4460
|
}), t.center();
|
|
4350
4461
|
break;
|
|
4351
4462
|
}
|
|
4352
4463
|
case "boxHousing":
|
|
4353
|
-
t = new
|
|
4464
|
+
t = new R.BoxGeometry(n * .6, n * .4, n * .5);
|
|
4354
4465
|
break;
|
|
4355
4466
|
case "endCap":
|
|
4356
|
-
t = new
|
|
4467
|
+
t = new R.CylinderGeometry(n * .35, n * .35, n * .08, 32);
|
|
4357
4468
|
break;
|
|
4358
4469
|
case "handle":
|
|
4359
|
-
t = new
|
|
4470
|
+
t = new R.CapsuleGeometry(n * .08, n * .4, 16, 32);
|
|
4360
4471
|
break;
|
|
4361
4472
|
case "button":
|
|
4362
|
-
t = new
|
|
4473
|
+
t = new R.CylinderGeometry(n * .15, n * .15, n * .05, 32);
|
|
4363
4474
|
break;
|
|
4364
4475
|
case "knob":
|
|
4365
|
-
t = new
|
|
4476
|
+
t = new R.SphereGeometry(n * .2, 32, 32);
|
|
4366
4477
|
break;
|
|
4367
4478
|
case "displayFrame": {
|
|
4368
|
-
let e = new
|
|
4479
|
+
let e = new R.Shape();
|
|
4369
4480
|
e.moveTo(-n * .4, -n * .3), e.lineTo(-n * .4, n * .3), e.lineTo(n * .4, n * .3), e.lineTo(n * .4, -n * .3), e.closePath();
|
|
4370
|
-
let r = new
|
|
4371
|
-
r.moveTo(-n * .32, -n * .22), r.lineTo(-n * .32, n * .22), r.lineTo(n * .32, n * .22), r.lineTo(n * .32, -n * .22), r.closePath(), e.holes.push(r), t = new
|
|
4481
|
+
let r = new R.Path();
|
|
4482
|
+
r.moveTo(-n * .32, -n * .22), r.lineTo(-n * .32, n * .22), r.lineTo(n * .32, n * .22), r.lineTo(n * .32, -n * .22), r.closePath(), e.holes.push(r), t = new R.ExtrudeGeometry(e, {
|
|
4372
4483
|
depth: n * .08,
|
|
4373
4484
|
bevelEnabled: !1
|
|
4374
4485
|
}), t.center();
|
|
4375
4486
|
break;
|
|
4376
4487
|
}
|
|
4377
|
-
default: t = new
|
|
4488
|
+
default: t = new R.BoxGeometry(n, n, n);
|
|
4378
4489
|
}
|
|
4379
|
-
let r = new
|
|
4490
|
+
let r = new R.MeshPhongMaterial({
|
|
4380
4491
|
color: e.color || 4235007,
|
|
4381
4492
|
transparent: !0,
|
|
4382
4493
|
opacity: .85
|
|
4383
|
-
}), i = new
|
|
4494
|
+
}), i = new R.Mesh(t, r);
|
|
4384
4495
|
return i.position.set(e.x || 0, e.y || 0, e.z || 0), i.userData = { id: e.id }, i;
|
|
4385
4496
|
}, A = (e) => {
|
|
4386
4497
|
let t = document.createElement("div");
|
|
4387
4498
|
t.className = "part-label", t.innerHTML = `<span class="part-name">${e.label || e.shape}</span>${e.notes ? `<span class="part-notes">${e.notes}</span>` : ""}`, t.addEventListener("dblclick", (t) => {
|
|
4388
4499
|
t.stopPropagation(), o("double-click", e.id);
|
|
4389
4500
|
});
|
|
4390
|
-
let n = new
|
|
4501
|
+
let n = new Ir(t);
|
|
4391
4502
|
return n.position.set(0, (e.scale || 1) * .5 + .3, 0), n;
|
|
4392
4503
|
}, j = (e) => r.meshes.filter((t) => t.parentId === e), M = (e) => {
|
|
4393
4504
|
if (!e.parentId) return !0;
|
|
@@ -4410,24 +4521,24 @@ var $i = class extends Ke {
|
|
|
4410
4521
|
if (!r.meshes.length) return;
|
|
4411
4522
|
let e = r.meshes.filter((e) => !e.parentId);
|
|
4412
4523
|
if (!e.length) return;
|
|
4413
|
-
let t = new
|
|
4414
|
-
e.forEach((e) => t.add(new
|
|
4524
|
+
let t = new R.Vector3();
|
|
4525
|
+
e.forEach((e) => t.add(new R.Vector3(e.x || 0, e.y || 0, e.z || 0))), t.divideScalar(e.length), r.meshes.forEach((e) => {
|
|
4415
4526
|
let n = S[e.id];
|
|
4416
4527
|
if (!n) return;
|
|
4417
4528
|
let i = e.x || 0, a = e.y || 0, o = e.z || 0;
|
|
4418
4529
|
if (e.parentId) {
|
|
4419
4530
|
let t = r.meshes.find((t) => t.id === e.parentId);
|
|
4420
4531
|
if (t) {
|
|
4421
|
-
let e = S[t.id], s = t.x || 0, c = t.y || 0, l = t.z || 0, u = i - s, d = a - c, f = o - l, p = new
|
|
4532
|
+
let e = S[t.id], s = t.x || 0, c = t.y || 0, l = t.z || 0, u = i - s, d = a - c, f = o - l, p = new R.Vector3(u, d, f);
|
|
4422
4533
|
p.length() < .01 && p.set(Math.random() - .5, Math.random() - .5, Math.random() - .5), p.normalize();
|
|
4423
|
-
let m = e ? e.position : new
|
|
4534
|
+
let m = e ? e.position : new R.Vector3(s, c, l);
|
|
4424
4535
|
n.position.set(m.x + u + p.x * r.explodeFactor * 1.5, m.y + d + p.y * r.explodeFactor * 1.5, m.z + f + p.z * r.explodeFactor * 1.5);
|
|
4425
4536
|
} else n.position.set(i, a, o);
|
|
4426
4537
|
} else {
|
|
4427
|
-
let e = new
|
|
4538
|
+
let e = new R.Vector3(i - t.x, a - t.y, o - t.z);
|
|
4428
4539
|
e.length() < .01 && e.set(Math.random() - .5, Math.random() - .5, Math.random() - .5), e.normalize(), n.position.set(i + e.x * r.explodeFactor, a + e.y * r.explodeFactor, o + e.z * r.explodeFactor);
|
|
4429
4540
|
}
|
|
4430
|
-
e.id === r.selectedId ? n.material.emissive = new
|
|
4541
|
+
e.id === r.selectedId ? n.material.emissive = new R.Color(4491519) : n.material.emissive = new R.Color(0);
|
|
4431
4542
|
});
|
|
4432
4543
|
}, N = (e) => {
|
|
4433
4544
|
E.has(e) ? E.delete(e) : E.add(e), ee();
|
|
@@ -4458,7 +4569,7 @@ var $i = class extends Ke {
|
|
|
4458
4569
|
y: Math.round(e.position.y * 100) / 100,
|
|
4459
4570
|
z: Math.round(e.position.z * 100) / 100
|
|
4460
4571
|
});
|
|
4461
|
-
},
|
|
4572
|
+
}, ie = () => {
|
|
4462
4573
|
let e = s.value;
|
|
4463
4574
|
!e || !f || (d.aspect = e.clientWidth / e.clientHeight, d.updateProjectionMatrix(), f.setSize(e.clientWidth, e.clientHeight), g.setSize(e.clientWidth, e.clientHeight));
|
|
4464
4575
|
};
|
|
@@ -4467,7 +4578,7 @@ var $i = class extends Ke {
|
|
|
4467
4578
|
d.position.set(5, 5, 8), v.target.set(0, 0, 0), v.update();
|
|
4468
4579
|
},
|
|
4469
4580
|
loadGLTF: (e) => {
|
|
4470
|
-
new
|
|
4581
|
+
new qr().load(e, (e) => {
|
|
4471
4582
|
let t = e.scene;
|
|
4472
4583
|
t.traverse((e) => {
|
|
4473
4584
|
e.isMesh && (e.material.color.set(4235007), e.material.transparent = !0, e.material.opacity = .85);
|
|
@@ -4475,7 +4586,7 @@ var $i = class extends Ke {
|
|
|
4475
4586
|
});
|
|
4476
4587
|
},
|
|
4477
4588
|
loadOBJ: (e) => {
|
|
4478
|
-
new
|
|
4589
|
+
new ra().load(e, (e) => {
|
|
4479
4590
|
e.traverse((e) => {
|
|
4480
4591
|
e.isMesh && (e.material.color.set(4235007), e.material.transparent = !0, e.material.opacity = .85);
|
|
4481
4592
|
}), u.add(e);
|
|
@@ -4485,9 +4596,9 @@ var $i = class extends Ke {
|
|
|
4485
4596
|
}), C(() => r.meshes, ee, { deep: !0 }), C(() => r.explodeFactor, te), C(() => r.selectedId, (e) => {
|
|
4486
4597
|
te(), e && S[e] ? y.attach(S[e]) : y.detach();
|
|
4487
4598
|
}), C(() => r.expandLevel, ee), p(() => {
|
|
4488
|
-
D(), ee(), c.value.addEventListener("click", ne), c.value.addEventListener("dblclick", re), window.addEventListener("resize",
|
|
4599
|
+
D(), ee(), c.value.addEventListener("click", ne), c.value.addEventListener("dblclick", re), window.addEventListener("resize", ie);
|
|
4489
4600
|
}), m(() => {
|
|
4490
|
-
cancelAnimationFrame(T), c.value?.removeEventListener("click", ne), c.value?.removeEventListener("dblclick", re), window.removeEventListener("resize",
|
|
4601
|
+
cancelAnimationFrame(T), c.value?.removeEventListener("click", ne), c.value?.removeEventListener("dblclick", re), window.removeEventListener("resize", ie), u?.traverse((e) => {
|
|
4491
4602
|
e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((e) => e.dispose()) : e.material.dispose());
|
|
4492
4603
|
}), v?.dispose(), y?.dispose(), f?.dispose(), g?.domElement?.parentElement?.removeChild(g.domElement);
|
|
4493
4604
|
}), (e, t) => (h(), i("div", {
|
|
@@ -4503,10 +4614,10 @@ var $i = class extends Ke {
|
|
|
4503
4614
|
class: "label-layer"
|
|
4504
4615
|
}, null, 512)], 512));
|
|
4505
4616
|
}
|
|
4506
|
-
}, [["__scopeId", "data-v-1fe4a338"]]),
|
|
4617
|
+
}, [["__scopeId", "data-v-1fe4a338"]]), aa = { class: "library-header" }, oa = { key: 0 }, sa = {
|
|
4507
4618
|
key: 0,
|
|
4508
4619
|
class: "library-body"
|
|
4509
|
-
},
|
|
4620
|
+
}, ca = { class: "library-top" }, la = { class: "category-tabs" }, ua = { class: "model-list" }, da = ["onDragstart", "onClick"], fa = { class: "model-info" }, pa = { class: "model-name" }, ma = { class: "model-desc" }, ha = { class: "library-bottom" }, ga = /*#__PURE__*/ Bt({
|
|
4510
4621
|
__name: "ModelLibrary",
|
|
4511
4622
|
props: { models: {
|
|
4512
4623
|
type: Array,
|
|
@@ -4535,7 +4646,7 @@ var $i = class extends Ke {
|
|
|
4535
4646
|
};
|
|
4536
4647
|
return (t, c) => {
|
|
4537
4648
|
let l = y("el-icon"), u = y("el-button"), p = y("el-input"), _ = y("el-tooltip"), k = y("el-divider");
|
|
4538
|
-
return h(), i("div", { class: d(["model-library", { collapsed: m.value }]) }, [a("div",
|
|
4649
|
+
return h(), i("div", { class: d(["model-library", { collapsed: m.value }]) }, [a("div", aa, [m.value ? r("", !0) : (h(), i("span", oa, "模型库")), s(u, {
|
|
4539
4650
|
size: "small",
|
|
4540
4651
|
circle: "",
|
|
4541
4652
|
onClick: c[0] ||= (e) => m.value = !m.value
|
|
@@ -4545,8 +4656,8 @@ var $i = class extends Ke {
|
|
|
4545
4656
|
_: 1
|
|
4546
4657
|
})]),
|
|
4547
4658
|
_: 1
|
|
4548
|
-
})]), m.value ? r("", !0) : (h(), i("div",
|
|
4549
|
-
a("div",
|
|
4659
|
+
})]), m.value ? r("", !0) : (h(), i("div", sa, [
|
|
4660
|
+
a("div", ca, [s(p, {
|
|
4550
4661
|
modelValue: g.value,
|
|
4551
4662
|
"onUpdate:modelValue": c[1] ||= (e) => g.value = e,
|
|
4552
4663
|
placeholder: "搜索模型...",
|
|
@@ -4559,7 +4670,7 @@ var $i = class extends Ke {
|
|
|
4559
4670
|
_: 1
|
|
4560
4671
|
})]),
|
|
4561
4672
|
_: 1
|
|
4562
|
-
}, 8, ["modelValue"]), a("div",
|
|
4673
|
+
}, 8, ["modelValue"]), a("div", la, [
|
|
4563
4674
|
s(_, {
|
|
4564
4675
|
content: "全部",
|
|
4565
4676
|
placement: "top"
|
|
@@ -4568,7 +4679,7 @@ var $i = class extends Ke {
|
|
|
4568
4679
|
class: d(["tab-btn", { active: C.value === "all" }]),
|
|
4569
4680
|
onClick: c[2] ||= (e) => C.value = "all"
|
|
4570
4681
|
}, [s(l, null, {
|
|
4571
|
-
default: w(() => [s(S(
|
|
4682
|
+
default: w(() => [s(S(oe))]),
|
|
4572
4683
|
_: 1
|
|
4573
4684
|
})], 2)]),
|
|
4574
4685
|
_: 1
|
|
@@ -4626,7 +4737,7 @@ var $i = class extends Ke {
|
|
|
4626
4737
|
_: 1
|
|
4627
4738
|
})
|
|
4628
4739
|
])]),
|
|
4629
|
-
a("div",
|
|
4740
|
+
a("div", ua, [(h(!0), i(e, null, v(E.value, (e) => (h(), i("div", {
|
|
4630
4741
|
key: e.id,
|
|
4631
4742
|
class: "model-item",
|
|
4632
4743
|
draggable: "true",
|
|
@@ -4635,8 +4746,8 @@ var $i = class extends Ke {
|
|
|
4635
4746
|
}, [a("div", {
|
|
4636
4747
|
class: "model-icon",
|
|
4637
4748
|
style: f({ background: e.color })
|
|
4638
|
-
}, x(e.icon), 5), a("div",
|
|
4639
|
-
a("div",
|
|
4749
|
+
}, x(e.icon), 5), a("div", fa, [a("span", pa, x(e.name), 1), a("span", ma, x(e.desc), 1)])], 40, da))), 128))]),
|
|
4750
|
+
a("div", ha, [
|
|
4640
4751
|
s(k, { style: { margin: "8px 0" } }),
|
|
4641
4752
|
c[10] ||= a("div", { class: "section-title" }, "URL导入", -1),
|
|
4642
4753
|
s(p, {
|
|
@@ -4651,7 +4762,7 @@ var $i = class extends Ke {
|
|
|
4651
4762
|
disabled: !T.value
|
|
4652
4763
|
}, {
|
|
4653
4764
|
default: w(() => [s(l, null, {
|
|
4654
|
-
default: w(() => [s(S(
|
|
4765
|
+
default: w(() => [s(S(F))]),
|
|
4655
4766
|
_: 1
|
|
4656
4767
|
})]),
|
|
4657
4768
|
_: 1
|
|
@@ -4673,22 +4784,22 @@ var $i = class extends Ke {
|
|
|
4673
4784
|
]))], 2);
|
|
4674
4785
|
};
|
|
4675
4786
|
}
|
|
4676
|
-
}, [["__scopeId", "data-v-d4c40fe8"]]),
|
|
4787
|
+
}, [["__scopeId", "data-v-d4c40fe8"]]), _a = { class: "explosion-panel" }, va = { class: "panel-section" }, ya = {
|
|
4677
4788
|
key: 0,
|
|
4678
4789
|
class: "upload-placeholder"
|
|
4679
|
-
},
|
|
4790
|
+
}, ba = {
|
|
4680
4791
|
key: 1,
|
|
4681
4792
|
class: "preview-area"
|
|
4682
|
-
},
|
|
4793
|
+
}, xa = ["src"], Sa = { class: "mode-tabs" }, Ca = { class: "api-config" }, wa = {
|
|
4683
4794
|
key: 0,
|
|
4684
4795
|
class: "progress-bar"
|
|
4685
|
-
},
|
|
4796
|
+
}, Ta = {
|
|
4686
4797
|
key: 1,
|
|
4687
4798
|
class: "error-text"
|
|
4688
|
-
},
|
|
4799
|
+
}, Ea = { class: "panel-section" }, Da = { class: "control-row" }, Oa = { class: "control-row" }, ka = { class: "btn-row" }, Aa = { class: "panel-section" }, ja = { class: "section-title" }, Ma = { class: "parts-list" }, Na = ["onMouseenter"], Pa = {
|
|
4689
4800
|
key: 0,
|
|
4690
4801
|
class: "empty-hint"
|
|
4691
|
-
},
|
|
4802
|
+
}, Fa = /*#__PURE__*/ Bt({
|
|
4692
4803
|
__name: "ModelExplosionPanel",
|
|
4693
4804
|
props: {
|
|
4694
4805
|
parts: {
|
|
@@ -4772,10 +4883,10 @@ var $i = class extends Ke {
|
|
|
4772
4883
|
p("provider-change", b.value), p("api-key-change", S.value), D.value === "both" ? p("generate-both") : p("generate");
|
|
4773
4884
|
};
|
|
4774
4885
|
return (t, l) => {
|
|
4775
|
-
let u = y("Upload"), p = y("el-icon"), _ = y("Close"), N = y("el-button"), P = y("el-option"),
|
|
4776
|
-
return h(), i("div",
|
|
4886
|
+
let u = y("Upload"), p = y("el-icon"), _ = y("Close"), N = y("el-button"), P = y("el-option"), ie = y("el-option-group"), F = y("el-select"), I = y("el-input"), ae = y("el-divider"), oe = y("el-slider"), L = y("el-checkbox"), se = y("el-color-picker");
|
|
4887
|
+
return h(), i("div", _a, [
|
|
4777
4888
|
l[24] ||= a("div", { class: "panel-header" }, [a("h4", null, "模型爆炸图")], -1),
|
|
4778
|
-
a("div",
|
|
4889
|
+
a("div", va, [
|
|
4779
4890
|
l[18] ||= a("div", { class: "section-title" }, "图片生成3D", -1),
|
|
4780
4891
|
a("div", {
|
|
4781
4892
|
class: "upload-area",
|
|
@@ -4789,10 +4900,10 @@ var $i = class extends Ke {
|
|
|
4789
4900
|
accept: "image/*",
|
|
4790
4901
|
style: { display: "none" },
|
|
4791
4902
|
onChange: ee
|
|
4792
|
-
}, null, 544), g.value ? (h(), i("div",
|
|
4903
|
+
}, null, 544), g.value ? (h(), i("div", ba, [a("img", {
|
|
4793
4904
|
src: g.value,
|
|
4794
4905
|
class: "preview-img"
|
|
4795
|
-
}, null, 8,
|
|
4906
|
+
}, null, 8, xa), s(N, {
|
|
4796
4907
|
size: "small",
|
|
4797
4908
|
circle: "",
|
|
4798
4909
|
class: "remove-btn",
|
|
@@ -4803,7 +4914,7 @@ var $i = class extends Ke {
|
|
|
4803
4914
|
_: 1
|
|
4804
4915
|
})]),
|
|
4805
4916
|
_: 1
|
|
4806
|
-
})])) : (h(), i("div",
|
|
4917
|
+
})])) : (h(), i("div", ya, [
|
|
4807
4918
|
s(p, { size: 28 }, {
|
|
4808
4919
|
default: w(() => [s(u)]),
|
|
4809
4920
|
_: 1
|
|
@@ -4811,7 +4922,7 @@ var $i = class extends Ke {
|
|
|
4811
4922
|
l[13] ||= a("span", null, "点击或拖拽图片到此处", -1),
|
|
4812
4923
|
l[14] ||= a("span", { class: "upload-hint" }, "支持 JPG/PNG,建议正方形产品图", -1)
|
|
4813
4924
|
]))], 32),
|
|
4814
|
-
a("div",
|
|
4925
|
+
a("div", Sa, [
|
|
4815
4926
|
a("div", {
|
|
4816
4927
|
class: d(["mode-tab", { active: D.value === "fast" }]),
|
|
4817
4928
|
onClick: l[1] ||= (e) => D.value = "fast"
|
|
@@ -4837,7 +4948,7 @@ var $i = class extends Ke {
|
|
|
4837
4948
|
a("span", { class: "mode-desc" }, "先预览后替换", -1)
|
|
4838
4949
|
]], 2)
|
|
4839
4950
|
]),
|
|
4840
|
-
a("div",
|
|
4951
|
+
a("div", Ca, [s(F, {
|
|
4841
4952
|
modelValue: b.value,
|
|
4842
4953
|
"onUpdate:modelValue": l[4] ||= (e) => b.value = e,
|
|
4843
4954
|
size: "small",
|
|
@@ -4846,7 +4957,7 @@ var $i = class extends Ke {
|
|
|
4846
4957
|
"margin-bottom": "6px"
|
|
4847
4958
|
}
|
|
4848
4959
|
}, {
|
|
4849
|
-
default: w(() => [D.value === "fast" ? (h(), n(
|
|
4960
|
+
default: w(() => [D.value === "fast" ? (h(), n(ie, {
|
|
4850
4961
|
key: 0,
|
|
4851
4962
|
label: "快速模式"
|
|
4852
4963
|
}, {
|
|
@@ -4856,7 +4967,7 @@ var $i = class extends Ke {
|
|
|
4856
4967
|
label: e.name
|
|
4857
4968
|
}, null, 8, ["value", "label"]))), 128))]),
|
|
4858
4969
|
_: 1
|
|
4859
|
-
})) : D.value === "quality" ? (h(), n(
|
|
4970
|
+
})) : D.value === "quality" ? (h(), n(ie, {
|
|
4860
4971
|
key: 1,
|
|
4861
4972
|
label: "高质量模式"
|
|
4862
4973
|
}, {
|
|
@@ -4866,7 +4977,7 @@ var $i = class extends Ke {
|
|
|
4866
4977
|
label: e.name
|
|
4867
4978
|
}, null, 8, ["value", "label"]))), 128))]),
|
|
4868
4979
|
_: 1
|
|
4869
|
-
})) : (h(), n(
|
|
4980
|
+
})) : (h(), n(ie, {
|
|
4870
4981
|
key: 2,
|
|
4871
4982
|
label: "全部提供商"
|
|
4872
4983
|
}, {
|
|
@@ -4878,7 +4989,7 @@ var $i = class extends Ke {
|
|
|
4878
4989
|
_: 1
|
|
4879
4990
|
}))]),
|
|
4880
4991
|
_: 1
|
|
4881
|
-
}, 8, ["modelValue"]), s(
|
|
4992
|
+
}, 8, ["modelValue"]), s(I, {
|
|
4882
4993
|
modelValue: S.value,
|
|
4883
4994
|
"onUpdate:modelValue": l[5] ||= (e) => S.value = e,
|
|
4884
4995
|
size: "small",
|
|
@@ -4900,16 +5011,16 @@ var $i = class extends Ke {
|
|
|
4900
5011
|
default: w(() => [o(x(c.isGenerating ? c.generationStatus : j.value), 1)]),
|
|
4901
5012
|
_: 1
|
|
4902
5013
|
}, 8, ["loading", "disabled"]),
|
|
4903
|
-
c.isGenerating ? (h(), i("div",
|
|
5014
|
+
c.isGenerating ? (h(), i("div", wa, [a("div", {
|
|
4904
5015
|
class: "progress-fill",
|
|
4905
5016
|
style: f({ width: c.generationProgress + "%" })
|
|
4906
5017
|
}, null, 4)])) : r("", !0),
|
|
4907
|
-
c.genError ? (h(), i("div",
|
|
5018
|
+
c.genError ? (h(), i("div", Ta, x(c.genError), 1)) : r("", !0)
|
|
4908
5019
|
]),
|
|
4909
5020
|
s(ae),
|
|
4910
|
-
a("div",
|
|
5021
|
+
a("div", Ea, [
|
|
4911
5022
|
l[23] ||= a("div", { class: "section-title" }, "爆炸控制", -1),
|
|
4912
|
-
a("div",
|
|
5023
|
+
a("div", Da, [l[19] ||= a("label", null, "样式", -1), s(F, {
|
|
4913
5024
|
modelValue: C.value,
|
|
4914
5025
|
"onUpdate:modelValue": l[6] ||= (e) => C.value = e,
|
|
4915
5026
|
size: "small",
|
|
@@ -4935,7 +5046,7 @@ var $i = class extends Ke {
|
|
|
4935
5046
|
]),
|
|
4936
5047
|
_: 1
|
|
4937
5048
|
}, 8, ["modelValue"])]),
|
|
4938
|
-
a("div",
|
|
5049
|
+
a("div", Oa, [l[20] ||= a("label", null, "爆炸程度", -1), s(oe, {
|
|
4939
5050
|
modelValue: T.value,
|
|
4940
5051
|
"onUpdate:modelValue": l[8] ||= (e) => T.value = e,
|
|
4941
5052
|
min: 0,
|
|
@@ -4944,7 +5055,7 @@ var $i = class extends Ke {
|
|
|
4944
5055
|
size: "small",
|
|
4945
5056
|
onInput: l[9] ||= (e) => t.$emit("explosion-change", e / 100)
|
|
4946
5057
|
}, null, 8, ["modelValue"])]),
|
|
4947
|
-
a("div",
|
|
5058
|
+
a("div", ka, [s(N, {
|
|
4948
5059
|
size: "small",
|
|
4949
5060
|
onClick: l[10] ||= (e) => t.$emit("explode")
|
|
4950
5061
|
}, {
|
|
@@ -4959,13 +5070,13 @@ var $i = class extends Ke {
|
|
|
4959
5070
|
})])
|
|
4960
5071
|
]),
|
|
4961
5072
|
s(ae),
|
|
4962
|
-
a("div",
|
|
5073
|
+
a("div", Aa, [a("div", ja, "零件列表 (" + x(c.parts.length) + ")", 1), a("div", Ma, [(h(!0), i(e, null, v(c.parts, (e) => (h(), i("div", {
|
|
4963
5074
|
key: e.id,
|
|
4964
5075
|
class: d(["part-item", { hidden: !e.visible }]),
|
|
4965
5076
|
onMouseenter: (n) => t.$emit("highlight", e.id),
|
|
4966
5077
|
onMouseleave: l[12] ||= (e) => t.$emit("clear-highlight")
|
|
4967
5078
|
}, [
|
|
4968
|
-
s(
|
|
5079
|
+
s(L, {
|
|
4969
5080
|
"model-value": e.visible,
|
|
4970
5081
|
onChange: (n) => t.$emit("toggle-visibility", e.id)
|
|
4971
5082
|
}, null, 8, ["model-value", "onChange"]),
|
|
@@ -4973,7 +5084,7 @@ var $i = class extends Ke {
|
|
|
4973
5084
|
class: "part-color",
|
|
4974
5085
|
style: f({ background: "#" + e.color.getHexString() })
|
|
4975
5086
|
}, null, 4),
|
|
4976
|
-
s(
|
|
5087
|
+
s(I, {
|
|
4977
5088
|
modelValue: e.name,
|
|
4978
5089
|
"onUpdate:modelValue": (t) => e.name = t,
|
|
4979
5090
|
size: "small",
|
|
@@ -4989,14 +5100,14 @@ var $i = class extends Ke {
|
|
|
4989
5100
|
size: "small",
|
|
4990
5101
|
onChange: (n) => t.$emit("color-change", e.id, n)
|
|
4991
5102
|
}, null, 8, ["model-value", "onChange"])
|
|
4992
|
-
], 42,
|
|
5103
|
+
], 42, Na))), 128)), c.parts.length === 0 ? (h(), i("div", Pa, " 请先上传3D模型或图片生成模型 ")) : r("", !0)])])
|
|
4993
5104
|
]);
|
|
4994
5105
|
};
|
|
4995
5106
|
}
|
|
4996
5107
|
}, [["__scopeId", "data-v-4261bfa5"]]);
|
|
4997
5108
|
//#endregion
|
|
4998
5109
|
//#region ../../src/composables/useExplosionCollaboration.js
|
|
4999
|
-
function
|
|
5110
|
+
function Ia(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
|
|
5000
5111
|
let r = new It.Doc(), i = _(!1), a = _(!1), o = _(!1), s = _(!1), c = _([]), l = null, u = null, d = null, f = null, p = !1, h = null, g = `ws://${window.location.hostname || "localhost"}:1234`, v = `${t}-${e}`, y = () => {
|
|
5001
5112
|
b(), h = setInterval(() => {
|
|
5002
5113
|
if (l && l.connection && l.connection.ws && l.connection.ws.readyState === WebSocket.CLOSED) try {
|
|
@@ -5111,8 +5222,8 @@ function Ma(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
|
|
|
5111
5222
|
}
|
|
5112
5223
|
//#endregion
|
|
5113
5224
|
//#region ../../src/composables/useExplosion3dCollaboration.js
|
|
5114
|
-
var
|
|
5115
|
-
let n =
|
|
5225
|
+
var La = (e, { onRemoteChange: t } = {}) => {
|
|
5226
|
+
let n = Ia(e, {
|
|
5116
5227
|
roomPrefix: "explosion-3d",
|
|
5117
5228
|
syncKey: "_data"
|
|
5118
5229
|
});
|
|
@@ -5139,7 +5250,7 @@ var Na = (e, { onRemoteChange: t } = {}) => {
|
|
|
5139
5250
|
pushToYjs: r,
|
|
5140
5251
|
pullFromYjs: i
|
|
5141
5252
|
};
|
|
5142
|
-
},
|
|
5253
|
+
}, Ra = class {
|
|
5143
5254
|
constructor(e) {
|
|
5144
5255
|
this.parent = Array.from({ length: e }, (e, t) => t), this.rank = Array(e).fill(0);
|
|
5145
5256
|
}
|
|
@@ -5151,10 +5262,10 @@ var Na = (e, { onRemoteChange: t } = {}) => {
|
|
|
5151
5262
|
n !== r && (this.rank[n] < this.rank[r] ? this.parent[n] = r : this.rank[n] > this.rank[r] ? this.parent[r] = n : (this.parent[r] = n, this.rank[n]++));
|
|
5152
5263
|
}
|
|
5153
5264
|
};
|
|
5154
|
-
function
|
|
5265
|
+
function za(e) {
|
|
5155
5266
|
let t = e.getAttribute("position"), n = e.getIndex();
|
|
5156
5267
|
if (!t || !n) return [0];
|
|
5157
|
-
let r = t.count, i = new
|
|
5268
|
+
let r = t.count, i = new Ra(r);
|
|
5158
5269
|
for (let e = 0; e < n.count; e += 3) {
|
|
5159
5270
|
let t = n.getX(e), r = n.getX(e + 1), a = n.getX(e + 2);
|
|
5160
5271
|
i.union(t, r), i.union(r, a);
|
|
@@ -5166,7 +5277,7 @@ function Fa(e) {
|
|
|
5166
5277
|
}
|
|
5167
5278
|
return Array.from(a.values());
|
|
5168
5279
|
}
|
|
5169
|
-
function
|
|
5280
|
+
function Ba(e, t) {
|
|
5170
5281
|
let n = e.getAttribute("position"), r = e.getAttribute("normal"), i = e.getAttribute("uv"), a = [], o = [], s = [], c = [], l = /* @__PURE__ */ new Map(), u = 0, d = e.getIndex();
|
|
5171
5282
|
for (let e = 0; e < t.length; e++) {
|
|
5172
5283
|
let c = t[e];
|
|
@@ -5176,18 +5287,18 @@ function Ia(e, t) {
|
|
|
5176
5287
|
let n = d.getX(e), r = d.getX(e + 1), i = d.getX(e + 2);
|
|
5177
5288
|
t.includes(n) && t.includes(r) && t.includes(i) && c.push(l.get(n), l.get(r), l.get(i));
|
|
5178
5289
|
}
|
|
5179
|
-
let f = new
|
|
5180
|
-
return f.setAttribute("position", new
|
|
5290
|
+
let f = new R.BufferGeometry();
|
|
5291
|
+
return f.setAttribute("position", new R.Float32BufferAttribute(a, 3)), o.length && f.setAttribute("normal", new R.Float32BufferAttribute(o, 3)), s.length && f.setAttribute("uv", new R.Float32BufferAttribute(s, 2)), c.length && f.setIndex(c), f.computeBoundingBox(), f.computeBoundingSphere(), f;
|
|
5181
5292
|
}
|
|
5182
|
-
function
|
|
5183
|
-
let t = new
|
|
5293
|
+
function Va(e) {
|
|
5294
|
+
let t = new R.Box3().setFromBufferAttribute(e.getAttribute("position")), n = new R.Vector3();
|
|
5184
5295
|
return t.getCenter(n), n;
|
|
5185
5296
|
}
|
|
5186
|
-
function
|
|
5187
|
-
return new
|
|
5297
|
+
function Ha(e) {
|
|
5298
|
+
return new R.Box3().setFromBufferAttribute(e.getAttribute("position"));
|
|
5188
5299
|
}
|
|
5189
|
-
function
|
|
5190
|
-
let e = g([]), t = _([]), n = _(!1), r = _(0), i = _(new
|
|
5300
|
+
function Ua() {
|
|
5301
|
+
let e = g([]), t = _([]), n = _(!1), r = _(0), i = _(new R.Vector3(0, 0, 0)), a = _("radial"), o = _(new R.Vector3(0, 0, 0)), s = _(1), c = (n) => {
|
|
5191
5302
|
e.length = 0;
|
|
5192
5303
|
let r = [];
|
|
5193
5304
|
if (n.traverse((e) => {
|
|
@@ -5196,9 +5307,9 @@ function za() {
|
|
|
5196
5307
|
let a = 0;
|
|
5197
5308
|
if (r.forEach((t) => {
|
|
5198
5309
|
let n = t.geometry.index ? t.geometry : t.geometry.toNonIndexed();
|
|
5199
|
-
|
|
5310
|
+
za(n).forEach((r) => {
|
|
5200
5311
|
if (r.length < 3) return;
|
|
5201
|
-
let i =
|
|
5312
|
+
let i = Ba(n, r), o = Va(i), s = Ha(i), c = new R.Matrix4();
|
|
5202
5313
|
t.updateWorldMatrix(!0, !1), c.copy(t.matrixWorld), o.applyMatrix4(c), e.push({
|
|
5203
5314
|
id: `part_${a}`,
|
|
5204
5315
|
name: `零件 ${a + 1}`,
|
|
@@ -5207,21 +5318,21 @@ function za() {
|
|
|
5207
5318
|
currentCentroid: o.clone(),
|
|
5208
5319
|
originalPosition: t.position.clone(),
|
|
5209
5320
|
bbox: s,
|
|
5210
|
-
color: t.material.color ? t.material.color.clone() : new
|
|
5321
|
+
color: t.material.color ? t.material.color.clone() : new R.Color(4235007),
|
|
5211
5322
|
material: t.material.clone(),
|
|
5212
5323
|
visible: !0,
|
|
5213
5324
|
opacity: 1,
|
|
5214
|
-
explodedOffset: new
|
|
5325
|
+
explodedOffset: new R.Vector3(0, 0, 0)
|
|
5215
5326
|
}), a++;
|
|
5216
5327
|
});
|
|
5217
5328
|
}), e.length > 0) {
|
|
5218
|
-
let n = new
|
|
5219
|
-
e.forEach((e) => n.expandByPoint(e.originalCentroid)), n.getCenter(o.value), s.value = n.getSize(new
|
|
5329
|
+
let n = new R.Box3();
|
|
5330
|
+
e.forEach((e) => n.expandByPoint(e.originalCentroid)), n.getCenter(o.value), s.value = n.getSize(new R.Vector3()).length() / 2, i.value.copy(o.value), t.value = e.map((e) => e.originalCentroid.clone());
|
|
5220
5331
|
}
|
|
5221
5332
|
}, l = (t, n) => {
|
|
5222
5333
|
let r = i.value, a = s.value * 1.5;
|
|
5223
5334
|
e.forEach((i) => {
|
|
5224
|
-
let o = new
|
|
5335
|
+
let o = new R.Vector3().subVectors(i.originalCentroid, r);
|
|
5225
5336
|
switch (o.length() < .001 && o.set(0, 1, 0), o.normalize(), t) {
|
|
5226
5337
|
case "radial":
|
|
5227
5338
|
i.explodedOffset.copy(o).multiplyScalar(a * n);
|
|
@@ -5278,18 +5389,18 @@ function za() {
|
|
|
5278
5389
|
setPartOpacity: v,
|
|
5279
5390
|
highlightPart: (t) => {
|
|
5280
5391
|
e.forEach((e) => {
|
|
5281
|
-
e.id === t ? e.material.emissive = new
|
|
5392
|
+
e.id === t ? e.material.emissive = new R.Color(4473924) : e.material.emissive = new R.Color(0);
|
|
5282
5393
|
});
|
|
5283
5394
|
},
|
|
5284
5395
|
clearHighlight: () => {
|
|
5285
5396
|
e.forEach((e) => {
|
|
5286
|
-
e.material.emissive = new
|
|
5397
|
+
e.material.emissive = new R.Color(0);
|
|
5287
5398
|
});
|
|
5288
5399
|
},
|
|
5289
5400
|
createExplosionMesh: () => {
|
|
5290
|
-
let t = new
|
|
5401
|
+
let t = new R.Group();
|
|
5291
5402
|
return t.name = "explosion_model", e.forEach((e) => {
|
|
5292
|
-
let n = new
|
|
5403
|
+
let n = new R.Mesh(e.geometry, e.material);
|
|
5293
5404
|
n.name = e.id, n.position.copy(e.explodedOffset), n.userData = {
|
|
5294
5405
|
partId: e.id,
|
|
5295
5406
|
partName: e.name
|
|
@@ -5318,7 +5429,7 @@ function za() {
|
|
|
5318
5429
|
}
|
|
5319
5430
|
//#endregion
|
|
5320
5431
|
//#region ../../src/composables/useImageTo3D.js
|
|
5321
|
-
var
|
|
5432
|
+
var Wa = {
|
|
5322
5433
|
triposr_cloud: {
|
|
5323
5434
|
name: "TripoSR (云端)",
|
|
5324
5435
|
description: "快速生成,A100上<0.5秒",
|
|
@@ -5459,8 +5570,8 @@ var Ba = {
|
|
|
5459
5570
|
} : null
|
|
5460
5571
|
}
|
|
5461
5572
|
};
|
|
5462
|
-
function
|
|
5463
|
-
let e = _(!1), t = _(0), n = _(""), r = _(null), i = _(null), a = _(null), o = _("triposr_cloud"), s = _(""), c = _({ baseUrl: "" }), l = null, u = (e) => Object.entries(
|
|
5573
|
+
function Ga() {
|
|
5574
|
+
let e = _(!1), t = _(0), n = _(""), r = _(null), i = _(null), a = _(null), o = _("triposr_cloud"), s = _(""), c = _({ baseUrl: "" }), l = null, u = (e) => Object.entries(Wa).filter(([, t]) => t.speed === e).reduce((e, [t, n]) => ({
|
|
5464
5575
|
...e,
|
|
5465
5576
|
[t]: n
|
|
5466
5577
|
}), {}), d = () => u("fast"), f = () => u("quality"), p = (e) => {
|
|
@@ -5480,7 +5591,7 @@ function Va() {
|
|
|
5480
5591
|
e.width = i, e.height = a, e.getContext("2d").drawImage(r, 0, 0, i, a), e.toBlob((e) => n(e), "image/jpeg", .9);
|
|
5481
5592
|
}, r.src = URL.createObjectURL(e);
|
|
5482
5593
|
}), v = async (i, c) => {
|
|
5483
|
-
let l = c || o.value, u =
|
|
5594
|
+
let l = c || o.value, u = Wa[l];
|
|
5484
5595
|
if (!u) return a.value = "不支持的API提供商", !1;
|
|
5485
5596
|
if (u.speed === "quality" && !s.value && !l.includes("local")) return a.value = "高质量模式需要API Key", !1;
|
|
5486
5597
|
e.value = !0, t.value = 0, n.value = `正在处理图片 (${u.name})...`, a.value = null, r.value = null;
|
|
@@ -5509,7 +5620,7 @@ function Va() {
|
|
|
5509
5620
|
e.value = !1;
|
|
5510
5621
|
}
|
|
5511
5622
|
}, y = async (e, r) => {
|
|
5512
|
-
let a =
|
|
5623
|
+
let a = Wa[r || o.value], l = a.speed === "quality" ? 200 : 120, u = a.speed === "quality" ? 3e3 : 2e3;
|
|
5513
5624
|
for (let r = 0; r < l; r++) {
|
|
5514
5625
|
await new Promise((e) => setTimeout(e, u));
|
|
5515
5626
|
try {
|
|
@@ -5536,7 +5647,7 @@ function Va() {
|
|
|
5536
5647
|
provider: o,
|
|
5537
5648
|
apiKey: s,
|
|
5538
5649
|
customConfig: c,
|
|
5539
|
-
API_PROVIDERS:
|
|
5650
|
+
API_PROVIDERS: Wa,
|
|
5540
5651
|
fastProviders: d,
|
|
5541
5652
|
qualityProviders: f,
|
|
5542
5653
|
setProvider: p,
|
|
@@ -5544,7 +5655,7 @@ function Va() {
|
|
|
5544
5655
|
setCustomConfig: h,
|
|
5545
5656
|
generateFromImage: v,
|
|
5546
5657
|
generateFromUrl: async (i, c) => {
|
|
5547
|
-
let l = c || o.value, u =
|
|
5658
|
+
let l = c || o.value, u = Wa[l];
|
|
5548
5659
|
if (!u) return a.value = "不支持的API提供商", !1;
|
|
5549
5660
|
e.value = !0, t.value = 0, n.value = `正在从URL生成3D模型 (${u.name})...`, a.value = null;
|
|
5550
5661
|
try {
|
|
@@ -5577,7 +5688,7 @@ function Va() {
|
|
|
5577
5688
|
try {
|
|
5578
5689
|
let e = await g(i), t = new FileReader(), n = await new Promise((n) => {
|
|
5579
5690
|
t.onload = () => n(t.result), t.readAsDataURL(e);
|
|
5580
|
-
}), r =
|
|
5691
|
+
}), r = Wa.triposr_cloud, a = typeof r.headers == "function" ? r.headers(s.value) : r.headers, c = r.createBody(n), l = await fetch(r.url, {
|
|
5581
5692
|
method: r.method,
|
|
5582
5693
|
headers: a,
|
|
5583
5694
|
body: JSON.stringify(c)
|
|
@@ -5593,7 +5704,7 @@ function Va() {
|
|
|
5593
5704
|
try {
|
|
5594
5705
|
let e = await g(i), t = new FileReader(), n = await new Promise((n) => {
|
|
5595
5706
|
t.onload = () => n(t.result), t.readAsDataURL(e);
|
|
5596
|
-
}), r =
|
|
5707
|
+
}), r = Wa.instantmesh_cloud, a = typeof r.headers == "function" ? r.headers(s.value) : r.headers, o = r.createBody(n), l = await fetch(r.url, {
|
|
5597
5708
|
method: r.method,
|
|
5598
5709
|
headers: a,
|
|
5599
5710
|
body: JSON.stringify(o)
|
|
@@ -5628,10 +5739,10 @@ function Va() {
|
|
|
5628
5739
|
}
|
|
5629
5740
|
//#endregion
|
|
5630
5741
|
//#region ../../src/views/Explosion3dEditor.vue
|
|
5631
|
-
var
|
|
5742
|
+
var Ka = { class: "explosion-3d-editor" }, qa = { class: "editor-body" }, Ja = { class: "side-panel" }, Ya = { class: "panel-section" }, Xa = ["onClick"], Za = { class: "mesh-name" }, Qa = {
|
|
5632
5743
|
key: 0,
|
|
5633
5744
|
class: "panel-section"
|
|
5634
|
-
},
|
|
5745
|
+
}, $a = { class: "prop-row" }, eo = { class: "prop-row" }, to = { class: "prop-row" }, no = { class: "prop-row" }, ro = { class: "prop-row" }, io = { class: "prop-row" }, ao = { class: "prop-row" }, oo = { class: "prop-row" }, so = { class: "panel-section" }, co = { class: "prop-row" }, lo = "explosion-3d", uo = /*#__PURE__*/ Bt({
|
|
5635
5746
|
__name: "Explosion3dEditor",
|
|
5636
5747
|
props: {
|
|
5637
5748
|
docId: {
|
|
@@ -5661,6 +5772,10 @@ var Ha = { class: "explosion-3d-editor" }, Ua = { class: "editor-body" }, Wa = {
|
|
|
5661
5772
|
uiConfig: {
|
|
5662
5773
|
type: Object,
|
|
5663
5774
|
default: () => ({})
|
|
5775
|
+
},
|
|
5776
|
+
aiApi: {
|
|
5777
|
+
type: [String, Object],
|
|
5778
|
+
default: null
|
|
5664
5779
|
}
|
|
5665
5780
|
},
|
|
5666
5781
|
setup(o) {
|
|
@@ -5669,28 +5784,28 @@ var Ha = { class: "explosion-3d-editor" }, Ua = { class: "editor-body" }, Wa = {
|
|
|
5669
5784
|
titleEditable: !0,
|
|
5670
5785
|
authorEditable: !0,
|
|
5671
5786
|
...c.uiConfig
|
|
5672
|
-
})), u = t(() => c.docId ?? T.params.id), T = O(), D = k(), j = _(c.docId ?? null), M = _(null), ee = _(null), te = _(null), N = _(!1), ne = _(!1), { saveVersion: re } =
|
|
5787
|
+
})), u = t(() => c.docId ?? T.params.id), T = O(), D = k(), j = _(c.docId ?? null), M = _(null), ee = _(null), te = _(null), N = _(!1), ne = _(!1), { saveVersion: re } = yn(), P = fn(), ie = gn(() => c.aiApi), F = g({
|
|
5673
5788
|
title: "3D爆炸图",
|
|
5674
5789
|
meshes: []
|
|
5675
|
-
}), I = _(!1),
|
|
5790
|
+
}), I = _(!1), ae = _(!1), oe = _(!1), L = null, se = _(null), ce = _(0), le = _("radial"), ue = _(/* @__PURE__ */ new Set()), de = 0, { parts: fe, isExploded: pe, explosionFactor: me, explosionStyle: R, analyzeModel: ge, explode: _e, assemble: ve, setPartColor: z, setPartLabel: ye, togglePartVisibility: be, highlightPart: xe, clearHighlight: Se, createExplosionMesh: Ce, exportPartsConfig: we } = Ua(), { isGenerating: B, generationProgress: Te, generationStatus: Ee, generatedModelUrl: De, error: Oe, provider: ke, apiKey: Ae, API_PROVIDERS: je, setProvider: Me, setApiKey: Ne, generateFromImage: Pe, clearResult: Fe } = Ga(), V = t(() => F.meshes.find((e) => e.id === se.value)), Ie = t(() => V.value ? F.meshes.filter((e) => e.id !== se.value && !Le(e.id, V.value.id)) : []), Le = (e, t) => {
|
|
5676
5791
|
let n = F.meshes.find((t) => t.id === e);
|
|
5677
|
-
return !n || !n.parentId ? !1 : n.parentId === t ? !0 :
|
|
5678
|
-
},
|
|
5679
|
-
|
|
5680
|
-
}, Be = async () => {
|
|
5681
|
-
Le && await Me(Le) && Te.value && (A.success("3D模型生成成功,正在加载..."), He(Te.value));
|
|
5792
|
+
return !n || !n.parentId ? !1 : n.parentId === t ? !0 : Le(n.parentId, t);
|
|
5793
|
+
}, Re = (e) => F.meshes.filter((t) => t.parentId === e), H = null, ze = _(!1), Be = (e) => {
|
|
5794
|
+
H = e;
|
|
5682
5795
|
}, Ve = async () => {
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5796
|
+
H && await Pe(H) && De.value && (A.success("3D模型生成成功,正在加载..."), Ue(De.value));
|
|
5797
|
+
}, He = async () => {
|
|
5798
|
+
if (!H) return;
|
|
5799
|
+
let e = await generateBoth(H);
|
|
5800
|
+
e && (e.fast && (A.success("快速预览模型已生成"), Ue(e.fast)), e.quality && e.quality !== e.fast && setTimeout(() => {
|
|
5801
|
+
A.info("高质量模型已生成,正在替换..."), Ue(e.quality);
|
|
5687
5802
|
}, 1e3));
|
|
5688
|
-
},
|
|
5803
|
+
}, Ue = async (e) => {
|
|
5689
5804
|
try {
|
|
5690
|
-
let { GLTFLoader: t } = await Promise.resolve().then(() =>
|
|
5805
|
+
let { GLTFLoader: t } = await Promise.resolve().then(() => Kr);
|
|
5691
5806
|
new t().load(e, (e) => {
|
|
5692
5807
|
let t = e.scene;
|
|
5693
|
-
|
|
5808
|
+
ge(t), fe.forEach((e) => {
|
|
5694
5809
|
let t = {
|
|
5695
5810
|
id: "auto_" + Date.now() + "_" + Math.random().toString(36).substr(2, 4),
|
|
5696
5811
|
label: e.name,
|
|
@@ -5705,26 +5820,26 @@ var Ha = { class: "explosion-3d-editor" }, Ua = { class: "editor-body" }, Wa = {
|
|
|
5705
5820
|
animSpeed: 1
|
|
5706
5821
|
};
|
|
5707
5822
|
F.meshes.push(t);
|
|
5708
|
-
}),
|
|
5823
|
+
}), ze.value = !0, dt(), A.success(`已识别 ${fe.length} 个零件`);
|
|
5709
5824
|
}, void 0, (e) => {
|
|
5710
5825
|
A.error("模型加载失败: " + e.message);
|
|
5711
5826
|
});
|
|
5712
5827
|
} catch (e) {
|
|
5713
5828
|
A.error("加载模型失败: " + e.message);
|
|
5714
5829
|
}
|
|
5715
|
-
}, Ue = (e) => {
|
|
5716
|
-
he(e);
|
|
5717
5830
|
}, We = (e) => {
|
|
5718
|
-
|
|
5719
|
-
}, Ge = () => {
|
|
5720
|
-
|
|
5831
|
+
_e(e);
|
|
5832
|
+
}, Ge = (e) => {
|
|
5833
|
+
R.value = e;
|
|
5721
5834
|
}, Ke = () => {
|
|
5722
|
-
|
|
5723
|
-
}, qe = (
|
|
5724
|
-
|
|
5725
|
-
}, Je = () => {
|
|
5726
|
-
|
|
5727
|
-
}, Ye = {
|
|
5835
|
+
_e(1);
|
|
5836
|
+
}, qe = () => {
|
|
5837
|
+
ve();
|
|
5838
|
+
}, Je = (e) => {
|
|
5839
|
+
xe(e);
|
|
5840
|
+
}, Ye = () => {
|
|
5841
|
+
Se();
|
|
5842
|
+
}, Xe = {
|
|
5728
5843
|
cube: {
|
|
5729
5844
|
label: "立方体",
|
|
5730
5845
|
shape: "cube",
|
|
@@ -5845,7 +5960,7 @@ var Ha = { class: "explosion-3d-editor" }, Ua = { class: "editor-body" }, Wa = {
|
|
|
5845
5960
|
scale: 1,
|
|
5846
5961
|
color: "#f56c6c"
|
|
5847
5962
|
}
|
|
5848
|
-
},
|
|
5963
|
+
}, Ze = [
|
|
5849
5964
|
{
|
|
5850
5965
|
id: "cube",
|
|
5851
5966
|
name: "立方体",
|
|
@@ -5996,16 +6111,16 @@ var Ha = { class: "explosion-3d-editor" }, Ua = { class: "editor-body" }, Wa = {
|
|
|
5996
6111
|
shape: "endCap",
|
|
5997
6112
|
scale: 1
|
|
5998
6113
|
}
|
|
5999
|
-
],
|
|
6114
|
+
], U = (e) => {
|
|
6000
6115
|
if (e === "upload") {
|
|
6001
6116
|
ee.value?.click();
|
|
6002
6117
|
return;
|
|
6003
6118
|
}
|
|
6004
|
-
let t =
|
|
6119
|
+
let t = Xe[e];
|
|
6005
6120
|
if (!t) return;
|
|
6006
6121
|
let n = F.meshes.length * (Math.PI * 2 / Math.max(F.meshes.length + 1, 4)), r = 2 + F.meshes.length * .5;
|
|
6007
6122
|
F.meshes.push({
|
|
6008
|
-
id: `mesh-${++
|
|
6123
|
+
id: `mesh-${++de}-${Date.now()}`,
|
|
6009
6124
|
...t,
|
|
6010
6125
|
notes: "",
|
|
6011
6126
|
parentId: null,
|
|
@@ -6013,10 +6128,10 @@ var Ha = { class: "explosion-3d-editor" }, Ua = { class: "editor-body" }, Wa = {
|
|
|
6013
6128
|
y: .5,
|
|
6014
6129
|
z: Math.sin(n) * r
|
|
6015
6130
|
}), dt();
|
|
6016
|
-
},
|
|
6131
|
+
}, Qe = (e) => {
|
|
6017
6132
|
let t = F.meshes.length * (Math.PI * 2 / Math.max(F.meshes.length + 1, 4)), n = 2 + F.meshes.length * .5;
|
|
6018
6133
|
F.meshes.push({
|
|
6019
|
-
id: `mesh-${++
|
|
6134
|
+
id: `mesh-${++de}-${Date.now()}`,
|
|
6020
6135
|
label: e.name,
|
|
6021
6136
|
shape: e.shape,
|
|
6022
6137
|
scale: e.scale,
|
|
@@ -6027,46 +6142,45 @@ var Ha = { class: "explosion-3d-editor" }, Ua = { class: "editor-body" }, Wa = {
|
|
|
6027
6142
|
y: .5,
|
|
6028
6143
|
z: Math.sin(t) * n
|
|
6029
6144
|
}), dt();
|
|
6030
|
-
}, Qe = (e) => {
|
|
6031
|
-
M.value && (e.endsWith(".obj") ? M.value.loadOBJ(e) : M.value.loadGLTF(e));
|
|
6032
6145
|
}, $e = (e) => {
|
|
6033
|
-
|
|
6034
|
-
}, et = (
|
|
6146
|
+
M.value && (e.endsWith(".obj") ? M.value.loadOBJ(e) : M.value.loadGLTF(e));
|
|
6147
|
+
}, et = (e) => {
|
|
6148
|
+
se.value = e;
|
|
6149
|
+
}, tt = ({ id: e, x: t, y: n, z: r }) => {
|
|
6035
6150
|
let i = F.meshes.find((t) => t.id === e);
|
|
6036
6151
|
i && (i.x = t, i.y = n, i.z = r, dt());
|
|
6037
|
-
}, tt = (e) => {
|
|
6038
|
-
F.meshes.find((t) => t.id === e) && Ie(e).length > 0 && (M.value?.toggleExpand(e), le.value.has(e) ? le.value.delete(e) : le.value.add(e));
|
|
6039
6152
|
}, nt = (e) => {
|
|
6153
|
+
F.meshes.find((t) => t.id === e) && Re(e).length > 0 && (M.value?.toggleExpand(e), ue.value.has(e) ? ue.value.delete(e) : ue.value.add(e));
|
|
6154
|
+
}, rt = (e) => {
|
|
6040
6155
|
F.meshes.forEach((t) => {
|
|
6041
6156
|
t.parentId === e && (t.parentId = null);
|
|
6042
|
-
}), F.meshes = F.meshes.filter((t) => t.id !== e),
|
|
6043
|
-
}, rt = () => {
|
|
6044
|
-
se.value = Math.min(5, se.value + 1);
|
|
6157
|
+
}), F.meshes = F.meshes.filter((t) => t.id !== e), se.value === e && (se.value = null), dt();
|
|
6045
6158
|
}, it = () => {
|
|
6046
|
-
|
|
6159
|
+
ce.value = Math.min(5, ce.value + 1);
|
|
6047
6160
|
}, at = () => {
|
|
6161
|
+
ce.value = Math.max(0, ce.value - 1);
|
|
6162
|
+
}, ot = () => {
|
|
6048
6163
|
c.docId ?? D.push("/");
|
|
6049
|
-
},
|
|
6050
|
-
|
|
6051
|
-
"这个3D爆炸图的模型摆放很合理。建议调整爆炸距离,让各部件层次更加分明。",
|
|
6052
|
-
"根据当前的3D模型结构,我建议为关键部件添加材质和颜色区分,提高视觉效果。",
|
|
6053
|
-
"我可以帮您检查3D模型中是否有重叠或位置异常的部件。需要我逐个分析吗?",
|
|
6054
|
-
"建议使用径向爆炸方式展示球形结构,使用轴向爆炸展示圆柱形结构。",
|
|
6055
|
-
"3D爆炸图的交互体验不错。如果需要,我可以帮您优化相机角度和光照设置。",
|
|
6056
|
-
"我可以帮您分析模型文件的格式兼容性,建议使用glTF格式获得更好的Web性能。",
|
|
6057
|
-
"建议为3D爆炸图添加动画过渡效果,让装配过程的展示更加流畅自然。"
|
|
6058
|
-
], st = async (e, t = {}) => {
|
|
6059
|
-
let n = j.value ? `${ao}-${j.value}` : null;
|
|
6164
|
+
}, st = async (e, t = {}) => {
|
|
6165
|
+
let n = j.value ? `${lo}-${j.value}` : null;
|
|
6060
6166
|
await P.sendMessage(e, {
|
|
6061
6167
|
...t,
|
|
6062
6168
|
roomId: n
|
|
6063
6169
|
});
|
|
6064
6170
|
let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a = P.collabUsers.value.filter((e) => e.name !== P.currentUser.value.name);
|
|
6065
|
-
(!r || i || a.length === 0)
|
|
6066
|
-
P.
|
|
6067
|
-
|
|
6171
|
+
if (!r || i || a.length === 0) {
|
|
6172
|
+
P.loading.value = !0;
|
|
6173
|
+
try {
|
|
6174
|
+
let t = await ie.chat(e, P.messages.value);
|
|
6175
|
+
P.sendAiMessage(t, n);
|
|
6176
|
+
} catch (e) {
|
|
6177
|
+
P.sendAiMessage("AI 请求失败: " + (e.message || "未知错误"), n);
|
|
6178
|
+
} finally {
|
|
6179
|
+
P.loading.value = !1;
|
|
6180
|
+
}
|
|
6181
|
+
}
|
|
6068
6182
|
}, ct = () => {
|
|
6069
|
-
let e = j.value ? `${
|
|
6183
|
+
let e = j.value ? `${lo}-${j.value}` : null;
|
|
6070
6184
|
P.clearMessages(e);
|
|
6071
6185
|
}, lt = () => {
|
|
6072
6186
|
if (!j.value) {
|
|
@@ -6077,27 +6191,27 @@ var Ha = { class: "explosion-3d-editor" }, Ua = { class: "editor-body" }, Wa = {
|
|
|
6077
6191
|
}, ut = (e) => {
|
|
6078
6192
|
try {
|
|
6079
6193
|
let t = typeof e == "string" ? JSON.parse(e) : e;
|
|
6080
|
-
t.title && (F.title = t.title), t.explodeStyle && (
|
|
6194
|
+
t.title && (F.title = t.title), t.explodeStyle && (le.value = t.explodeStyle), t.meshes && (F.meshes = t.meshes.map((e) => ({
|
|
6081
6195
|
notes: "",
|
|
6082
6196
|
parentId: null,
|
|
6083
6197
|
...e
|
|
6084
|
-
}))),
|
|
6198
|
+
}))), se.value = null;
|
|
6085
6199
|
} catch (e) {
|
|
6086
6200
|
console.error("Version apply error:", e);
|
|
6087
6201
|
}
|
|
6088
6202
|
}, dt = () => {
|
|
6089
6203
|
I.value && L && L.pushToYjs(F);
|
|
6090
6204
|
};
|
|
6091
|
-
C(
|
|
6205
|
+
C(V, () => {
|
|
6092
6206
|
dt();
|
|
6093
6207
|
}, { deep: !0 });
|
|
6094
6208
|
let ft = () => ({
|
|
6095
6209
|
version: "1.0",
|
|
6096
6210
|
title: F.title,
|
|
6097
|
-
explodeStyle:
|
|
6211
|
+
explodeStyle: le.value,
|
|
6098
6212
|
meshes: F.meshes.map((e) => ({ ...e }))
|
|
6099
6213
|
}), pt = async () => {
|
|
6100
|
-
if (I.value && L?.collaborationClosed.value && !
|
|
6214
|
+
if (I.value && L?.collaborationClosed.value && !oe.value) {
|
|
6101
6215
|
A.warning("协作已关闭,无法保存");
|
|
6102
6216
|
return;
|
|
6103
6217
|
}
|
|
@@ -6107,10 +6221,10 @@ var Ha = { class: "explosion-3d-editor" }, Ua = { class: "editor-body" }, Wa = {
|
|
|
6107
6221
|
view_type: "model3d",
|
|
6108
6222
|
config: JSON.stringify(ft())
|
|
6109
6223
|
};
|
|
6110
|
-
if (j.value) typeof c.saveApi == "function" ? await c.saveApi(e, j.value) : c.saveApi ? await
|
|
6224
|
+
if (j.value) typeof c.saveApi == "function" ? await c.saveApi(e, j.value) : c.saveApi ? await he.put(`${c.saveApi}/${j.value}`, e) : await he.put(`${c.apiBase}/explosion-views/${j.value}`, e);
|
|
6111
6225
|
else {
|
|
6112
6226
|
let t;
|
|
6113
|
-
t = typeof c.saveApi == "function" ? await c.saveApi(e) : c.saveApi ? await
|
|
6227
|
+
t = typeof c.saveApi == "function" ? await c.saveApi(e) : c.saveApi ? await he.post(c.saveApi, e) : await he.post(`${c.apiBase}/explosion-views/`, e), j.value = t.data.id;
|
|
6114
6228
|
}
|
|
6115
6229
|
A.success("保存成功"), re({
|
|
6116
6230
|
documentId: j.value,
|
|
@@ -6126,7 +6240,7 @@ var Ha = { class: "explosion-3d-editor" }, Ua = { class: "editor-body" }, Wa = {
|
|
|
6126
6240
|
let e = u.value;
|
|
6127
6241
|
if (e) try {
|
|
6128
6242
|
let t;
|
|
6129
|
-
t = typeof c.loadApi == "function" ? await c.loadApi(e) : c.loadApi ? await
|
|
6243
|
+
t = typeof c.loadApi == "function" ? await c.loadApi(e) : c.loadApi ? await he.get(`${c.loadApi}/${e}`) : await he.get(`${c.apiBase}/explosion-views/${e}`);
|
|
6130
6244
|
let n = t.data;
|
|
6131
6245
|
if (j.value = n.id, F.title = n.title, n.config) {
|
|
6132
6246
|
let e = JSON.parse(n.config);
|
|
@@ -6134,15 +6248,15 @@ var Ha = { class: "explosion-3d-editor" }, Ua = { class: "editor-body" }, Wa = {
|
|
|
6134
6248
|
notes: "",
|
|
6135
6249
|
parentId: null,
|
|
6136
6250
|
...e
|
|
6137
|
-
})),
|
|
6251
|
+
})), le.value = e.explodeStyle || "radial";
|
|
6138
6252
|
}
|
|
6139
6253
|
} catch (e) {
|
|
6140
6254
|
console.error(e);
|
|
6141
6255
|
}
|
|
6142
6256
|
else {
|
|
6143
|
-
let e =
|
|
6257
|
+
let e = Xe.cube;
|
|
6144
6258
|
F.meshes.push({
|
|
6145
|
-
id: `mesh-${++
|
|
6259
|
+
id: `mesh-${++de}`,
|
|
6146
6260
|
...e,
|
|
6147
6261
|
notes: "",
|
|
6148
6262
|
parentId: null,
|
|
@@ -6150,16 +6264,16 @@ var Ha = { class: "explosion-3d-editor" }, Ua = { class: "editor-body" }, Wa = {
|
|
|
6150
6264
|
y: .5,
|
|
6151
6265
|
z: 0
|
|
6152
6266
|
}), F.meshes.push({
|
|
6153
|
-
id: `mesh-${++
|
|
6154
|
-
...
|
|
6267
|
+
id: `mesh-${++de}`,
|
|
6268
|
+
...Xe.sphere,
|
|
6155
6269
|
notes: "",
|
|
6156
6270
|
parentId: null,
|
|
6157
6271
|
x: 2,
|
|
6158
6272
|
y: .5,
|
|
6159
6273
|
z: 0
|
|
6160
6274
|
}), F.meshes.push({
|
|
6161
|
-
id: `mesh-${++
|
|
6162
|
-
...
|
|
6275
|
+
id: `mesh-${++de}`,
|
|
6276
|
+
...Xe.cylinder,
|
|
6163
6277
|
notes: "",
|
|
6164
6278
|
parentId: null,
|
|
6165
6279
|
x: 0,
|
|
@@ -6187,11 +6301,11 @@ var Ha = { class: "explosion-3d-editor" }, Ua = { class: "editor-body" }, Wa = {
|
|
|
6187
6301
|
n.onload = (e) => {
|
|
6188
6302
|
try {
|
|
6189
6303
|
let t = JSON.parse(e.target.result);
|
|
6190
|
-
F.title = t.title || "3D爆炸图",
|
|
6304
|
+
F.title = t.title || "3D爆炸图", le.value = t.explodeStyle || "radial", F.meshes = (t.meshes || []).map((e) => ({
|
|
6191
6305
|
notes: "",
|
|
6192
6306
|
parentId: null,
|
|
6193
6307
|
...e
|
|
6194
|
-
})),
|
|
6308
|
+
})), se.value = null, dt(), A.success("JSON导入成功");
|
|
6195
6309
|
} catch {
|
|
6196
6310
|
A.error("JSON文件格式错误");
|
|
6197
6311
|
}
|
|
@@ -6396,13 +6510,13 @@ animate();
|
|
|
6396
6510
|
let n = new FormData();
|
|
6397
6511
|
n.append("file", t);
|
|
6398
6512
|
try {
|
|
6399
|
-
let e = await
|
|
6513
|
+
let e = await he.post(`${c.apiBase}/files/upload/image`, n), r = e.data.url || e.data.file_path, i = t.name.split(".").pop().toLowerCase();
|
|
6400
6514
|
i === "gltf" || i === "glb" ? M.value?.loadGLTF(r) : i === "obj" && M.value?.loadOBJ(r), A.success("模型加载成功");
|
|
6401
6515
|
} catch {
|
|
6402
6516
|
A.error("模型上传失败");
|
|
6403
6517
|
}
|
|
6404
6518
|
}, bt = (e) => {
|
|
6405
|
-
L &&= (L.destroy(), null), L =
|
|
6519
|
+
L &&= (L.destroy(), null), L = La(e, { onRemoteChange: (e) => {
|
|
6406
6520
|
e.title && (F.title = e.title), e.meshes && (F.meshes = (e.meshes || []).map((e) => ({
|
|
6407
6521
|
notes: "",
|
|
6408
6522
|
parentId: null,
|
|
@@ -6427,7 +6541,7 @@ animate();
|
|
|
6427
6541
|
notes: "",
|
|
6428
6542
|
parentId: null,
|
|
6429
6543
|
...e
|
|
6430
|
-
})))) : F.meshes.length > 0 && L.pushToYjs(F), I.value = !0,
|
|
6544
|
+
})))) : F.meshes.length > 0 && L.pushToYjs(F), I.value = !0, oe.value = !0, ae.value = !1, P.setCollabContext({
|
|
6431
6545
|
ydoc: L.ydoc,
|
|
6432
6546
|
provider: L.provider,
|
|
6433
6547
|
onlineUsers: L.onlineUsers
|
|
@@ -6440,7 +6554,7 @@ animate();
|
|
|
6440
6554
|
};
|
|
6441
6555
|
setTimeout(t, 200);
|
|
6442
6556
|
}, St = () => {
|
|
6443
|
-
L && (L.closeCollaboration(), I.value = !1,
|
|
6557
|
+
L && (L.closeCollaboration(), I.value = !1, oe.value = !1, A.info("协作已关闭"));
|
|
6444
6558
|
}, Ct = () => {
|
|
6445
6559
|
let e = u.value;
|
|
6446
6560
|
if (!e) return;
|
|
@@ -6460,7 +6574,7 @@ animate();
|
|
|
6460
6574
|
notes: "",
|
|
6461
6575
|
parentId: null,
|
|
6462
6576
|
...e
|
|
6463
|
-
})))), I.value = !0,
|
|
6577
|
+
})))), I.value = !0, oe.value = !1, P.setCollabContext({
|
|
6464
6578
|
ydoc: L.ydoc,
|
|
6465
6579
|
provider: L.provider,
|
|
6466
6580
|
onlineUsers: L.onlineUsers
|
|
@@ -6497,8 +6611,8 @@ animate();
|
|
|
6497
6611
|
L &&= (L.destroy(), null);
|
|
6498
6612
|
}), (t, o) => {
|
|
6499
6613
|
let c = y("el-icon"), p = y("el-button"), m = y("Delete"), g = y("el-input"), _ = y("el-option"), C = y("el-select"), D = y("el-color-picker"), O = y("el-slider"), k = y("el-divider"), A = y("Monitor");
|
|
6500
|
-
return h(), i("div",
|
|
6501
|
-
s(
|
|
6614
|
+
return h(), i("div", Ka, [
|
|
6615
|
+
s(Rn, {
|
|
6502
6616
|
title: F.title,
|
|
6503
6617
|
"onUpdate:title": o[0] ||= (e) => F.title = e,
|
|
6504
6618
|
"is-connected": I.value,
|
|
@@ -6506,11 +6620,11 @@ animate();
|
|
|
6506
6620
|
"is-join-mode": S(T).query.collab === "1",
|
|
6507
6621
|
"back-button": l.value.backButton,
|
|
6508
6622
|
"title-editable": l.value.titleEditable,
|
|
6509
|
-
onBack:
|
|
6510
|
-
onAddPrimitive:
|
|
6511
|
-
onExplode:
|
|
6512
|
-
onCollapse:
|
|
6513
|
-
onExplodeStyle: o[1] ||= (e) =>
|
|
6623
|
+
onBack: ot,
|
|
6624
|
+
onAddPrimitive: U,
|
|
6625
|
+
onExplode: it,
|
|
6626
|
+
onCollapse: at,
|
|
6627
|
+
onExplodeStyle: o[1] ||= (e) => le.value = e,
|
|
6514
6628
|
onResetCamera: o[2] ||= (e) => t.$refs.viewport?.resetCamera(),
|
|
6515
6629
|
onExport: ht,
|
|
6516
6630
|
onSave: pt,
|
|
@@ -6544,50 +6658,50 @@ animate();
|
|
|
6544
6658
|
style: { display: "none" },
|
|
6545
6659
|
onChange: _t
|
|
6546
6660
|
}, null, 544),
|
|
6547
|
-
a("div",
|
|
6548
|
-
s(
|
|
6549
|
-
models:
|
|
6550
|
-
onAddModel:
|
|
6551
|
-
onAddUrl:
|
|
6661
|
+
a("div", qa, [
|
|
6662
|
+
s(ga, {
|
|
6663
|
+
models: Ze,
|
|
6664
|
+
onAddModel: Qe,
|
|
6665
|
+
onAddUrl: $e,
|
|
6552
6666
|
onUploadFile: o[3] ||= (e) => ee.value?.click()
|
|
6553
6667
|
}),
|
|
6554
|
-
s(
|
|
6668
|
+
s(ia, {
|
|
6555
6669
|
ref_key: "viewport",
|
|
6556
6670
|
ref: M,
|
|
6557
6671
|
meshes: F.meshes,
|
|
6558
|
-
"selected-id":
|
|
6559
|
-
"explode-factor":
|
|
6560
|
-
onSelect:
|
|
6561
|
-
onDoubleClick:
|
|
6562
|
-
onPositionChange:
|
|
6672
|
+
"selected-id": se.value,
|
|
6673
|
+
"explode-factor": ce.value,
|
|
6674
|
+
onSelect: et,
|
|
6675
|
+
onDoubleClick: nt,
|
|
6676
|
+
onPositionChange: tt
|
|
6563
6677
|
}, null, 8, [
|
|
6564
6678
|
"meshes",
|
|
6565
6679
|
"selected-id",
|
|
6566
6680
|
"explode-factor"
|
|
6567
6681
|
]),
|
|
6568
|
-
a("div",
|
|
6569
|
-
a("div",
|
|
6682
|
+
a("div", Ja, [
|
|
6683
|
+
a("div", Ya, [o[17] ||= a("h4", null, "零件列表", -1), (h(!0), i(e, null, v(F.meshes, (e) => (h(), i("div", {
|
|
6570
6684
|
key: e.id,
|
|
6571
6685
|
class: d(["mesh-item", {
|
|
6572
|
-
selected:
|
|
6686
|
+
selected: se.value === e.id,
|
|
6573
6687
|
"is-child": e.parentId
|
|
6574
6688
|
}]),
|
|
6575
|
-
onClick: (t) =>
|
|
6689
|
+
onClick: (t) => et(e.id)
|
|
6576
6690
|
}, [
|
|
6577
6691
|
a("span", {
|
|
6578
6692
|
class: "mesh-color",
|
|
6579
6693
|
style: f({ background: e.color })
|
|
6580
6694
|
}, null, 4),
|
|
6581
|
-
a("span",
|
|
6582
|
-
|
|
6695
|
+
a("span", Za, x(e.label), 1),
|
|
6696
|
+
Re(e.id).length ? (h(), n(p, {
|
|
6583
6697
|
key: 0,
|
|
6584
6698
|
size: "small",
|
|
6585
6699
|
circle: "",
|
|
6586
6700
|
onClick: E((n) => t.$refs.viewport?.toggleExpand(e.id), ["stop"]),
|
|
6587
|
-
title:
|
|
6701
|
+
title: ue.value.has(e.id) ? "收起" : "展开"
|
|
6588
6702
|
}, {
|
|
6589
6703
|
default: w(() => [s(c, null, {
|
|
6590
|
-
default: w(() => [(h(), n(b(
|
|
6704
|
+
default: w(() => [(h(), n(b(ue.value.has(e.id) ? "FolderOpened" : "Folder")))]),
|
|
6591
6705
|
_: 2
|
|
6592
6706
|
}, 1024)]),
|
|
6593
6707
|
_: 2
|
|
@@ -6595,7 +6709,7 @@ animate();
|
|
|
6595
6709
|
s(p, {
|
|
6596
6710
|
size: "small",
|
|
6597
6711
|
circle: "",
|
|
6598
|
-
onClick: E((t) =>
|
|
6712
|
+
onClick: E((t) => rt(e.id), ["stop"])
|
|
6599
6713
|
}, {
|
|
6600
6714
|
default: w(() => [s(c, null, {
|
|
6601
6715
|
default: w(() => [s(m)]),
|
|
@@ -6603,72 +6717,72 @@ animate();
|
|
|
6603
6717
|
})]),
|
|
6604
6718
|
_: 1
|
|
6605
6719
|
}, 8, ["onClick"])
|
|
6606
|
-
], 10,
|
|
6607
|
-
|
|
6720
|
+
], 10, Xa))), 128))]),
|
|
6721
|
+
V.value ? (h(), i("div", Qa, [
|
|
6608
6722
|
o[26] ||= a("h4", null, "属性", -1),
|
|
6609
|
-
a("div",
|
|
6610
|
-
modelValue:
|
|
6611
|
-
"onUpdate:modelValue": o[4] ||= (e) =>
|
|
6723
|
+
a("div", $a, [o[18] ||= a("label", null, "名称", -1), s(g, {
|
|
6724
|
+
modelValue: V.value.label,
|
|
6725
|
+
"onUpdate:modelValue": o[4] ||= (e) => V.value.label = e,
|
|
6612
6726
|
size: "small"
|
|
6613
6727
|
}, null, 8, ["modelValue"])]),
|
|
6614
|
-
a("div",
|
|
6615
|
-
modelValue:
|
|
6616
|
-
"onUpdate:modelValue": o[5] ||= (e) =>
|
|
6728
|
+
a("div", eo, [o[19] ||= a("label", null, "备注", -1), s(g, {
|
|
6729
|
+
modelValue: V.value.notes,
|
|
6730
|
+
"onUpdate:modelValue": o[5] ||= (e) => V.value.notes = e,
|
|
6617
6731
|
type: "textarea",
|
|
6618
6732
|
rows: 2,
|
|
6619
6733
|
size: "small",
|
|
6620
6734
|
placeholder: "输入零件备注信息"
|
|
6621
6735
|
}, null, 8, ["modelValue"])]),
|
|
6622
|
-
a("div",
|
|
6623
|
-
modelValue:
|
|
6624
|
-
"onUpdate:modelValue": o[6] ||= (e) =>
|
|
6736
|
+
a("div", to, [o[20] ||= a("label", null, "父零件", -1), s(C, {
|
|
6737
|
+
modelValue: V.value.parentId,
|
|
6738
|
+
"onUpdate:modelValue": o[6] ||= (e) => V.value.parentId = e,
|
|
6625
6739
|
size: "small",
|
|
6626
6740
|
clearable: "",
|
|
6627
6741
|
placeholder: "无(顶级零件)",
|
|
6628
6742
|
style: { width: "100%" }
|
|
6629
6743
|
}, {
|
|
6630
|
-
default: w(() => [(h(!0), i(e, null, v(
|
|
6744
|
+
default: w(() => [(h(!0), i(e, null, v(Ie.value, (e) => (h(), n(_, {
|
|
6631
6745
|
key: e.id,
|
|
6632
6746
|
label: e.label,
|
|
6633
6747
|
value: e.id
|
|
6634
6748
|
}, null, 8, ["label", "value"]))), 128))]),
|
|
6635
6749
|
_: 1
|
|
6636
6750
|
}, 8, ["modelValue"])]),
|
|
6637
|
-
a("div",
|
|
6638
|
-
modelValue:
|
|
6639
|
-
"onUpdate:modelValue": o[7] ||= (e) =>
|
|
6751
|
+
a("div", no, [o[21] ||= a("label", null, "颜色", -1), s(D, {
|
|
6752
|
+
modelValue: V.value.color,
|
|
6753
|
+
"onUpdate:modelValue": o[7] ||= (e) => V.value.color = e,
|
|
6640
6754
|
size: "small"
|
|
6641
6755
|
}, null, 8, ["modelValue"])]),
|
|
6642
|
-
a("div",
|
|
6643
|
-
modelValue:
|
|
6644
|
-
"onUpdate:modelValue": o[8] ||= (e) =>
|
|
6756
|
+
a("div", ro, [o[22] ||= a("label", null, "缩放", -1), s(O, {
|
|
6757
|
+
modelValue: V.value.scale,
|
|
6758
|
+
"onUpdate:modelValue": o[8] ||= (e) => V.value.scale = e,
|
|
6645
6759
|
min: .2,
|
|
6646
6760
|
max: 5,
|
|
6647
6761
|
step: .1,
|
|
6648
6762
|
"show-input": "",
|
|
6649
6763
|
"input-size": "small"
|
|
6650
6764
|
}, null, 8, ["modelValue"])]),
|
|
6651
|
-
a("div",
|
|
6652
|
-
modelValue:
|
|
6653
|
-
"onUpdate:modelValue": o[9] ||= (e) =>
|
|
6765
|
+
a("div", io, [o[23] ||= a("label", null, "X", -1), s(O, {
|
|
6766
|
+
modelValue: V.value.x,
|
|
6767
|
+
"onUpdate:modelValue": o[9] ||= (e) => V.value.x = e,
|
|
6654
6768
|
min: -10,
|
|
6655
6769
|
max: 10,
|
|
6656
6770
|
step: .1,
|
|
6657
6771
|
"show-input": "",
|
|
6658
6772
|
"input-size": "small"
|
|
6659
6773
|
}, null, 8, ["modelValue"])]),
|
|
6660
|
-
a("div",
|
|
6661
|
-
modelValue:
|
|
6662
|
-
"onUpdate:modelValue": o[10] ||= (e) =>
|
|
6774
|
+
a("div", ao, [o[24] ||= a("label", null, "Y", -1), s(O, {
|
|
6775
|
+
modelValue: V.value.y,
|
|
6776
|
+
"onUpdate:modelValue": o[10] ||= (e) => V.value.y = e,
|
|
6663
6777
|
min: -10,
|
|
6664
6778
|
max: 10,
|
|
6665
6779
|
step: .1,
|
|
6666
6780
|
"show-input": "",
|
|
6667
6781
|
"input-size": "small"
|
|
6668
6782
|
}, null, 8, ["modelValue"])]),
|
|
6669
|
-
a("div",
|
|
6670
|
-
modelValue:
|
|
6671
|
-
"onUpdate:modelValue": o[11] ||= (e) =>
|
|
6783
|
+
a("div", oo, [o[25] ||= a("label", null, "Z", -1), s(O, {
|
|
6784
|
+
modelValue: V.value.z,
|
|
6785
|
+
"onUpdate:modelValue": o[11] ||= (e) => V.value.z = e,
|
|
6672
6786
|
min: -10,
|
|
6673
6787
|
max: 10,
|
|
6674
6788
|
step: .1,
|
|
@@ -6676,36 +6790,36 @@ animate();
|
|
|
6676
6790
|
"input-size": "small"
|
|
6677
6791
|
}, null, 8, ["modelValue"])])
|
|
6678
6792
|
])) : r("", !0),
|
|
6679
|
-
a("div",
|
|
6680
|
-
modelValue:
|
|
6681
|
-
"onUpdate:modelValue": o[12] ||= (e) =>
|
|
6793
|
+
a("div", so, [o[28] ||= a("h4", null, "展开控制", -1), a("div", co, [o[27] ||= a("label", null, "展开程度", -1), s(O, {
|
|
6794
|
+
modelValue: ce.value,
|
|
6795
|
+
"onUpdate:modelValue": o[12] ||= (e) => ce.value = e,
|
|
6682
6796
|
min: 0,
|
|
6683
6797
|
max: 5,
|
|
6684
6798
|
step: .1
|
|
6685
6799
|
}, null, 8, ["modelValue"])])]),
|
|
6686
6800
|
s(k),
|
|
6687
|
-
s(
|
|
6688
|
-
parts: S(
|
|
6689
|
-
"is-exploded": S(
|
|
6690
|
-
"explosion-factor": S(
|
|
6691
|
-
"is-generating": S(
|
|
6692
|
-
"generation-progress": S(
|
|
6693
|
-
"generation-status": S(
|
|
6694
|
-
"gen-error": S(
|
|
6695
|
-
providers: S(
|
|
6696
|
-
"current-provider": S(
|
|
6697
|
-
"api-key": S(
|
|
6698
|
-
onGenerate:
|
|
6699
|
-
onGenerateBoth:
|
|
6700
|
-
onExplosionChange:
|
|
6701
|
-
onStyleChange:
|
|
6702
|
-
onExplode:
|
|
6703
|
-
onAssemble:
|
|
6704
|
-
onHighlight:
|
|
6705
|
-
onClearHighlight:
|
|
6706
|
-
onFileSelected:
|
|
6707
|
-
onProviderChange: S(
|
|
6708
|
-
onApiKeyChange: S(
|
|
6801
|
+
s(Fa, {
|
|
6802
|
+
parts: S(fe),
|
|
6803
|
+
"is-exploded": S(pe),
|
|
6804
|
+
"explosion-factor": S(me),
|
|
6805
|
+
"is-generating": S(B),
|
|
6806
|
+
"generation-progress": S(Te),
|
|
6807
|
+
"generation-status": S(Ee),
|
|
6808
|
+
"gen-error": S(Oe),
|
|
6809
|
+
providers: S(je),
|
|
6810
|
+
"current-provider": S(ke),
|
|
6811
|
+
"api-key": S(Ae),
|
|
6812
|
+
onGenerate: Ve,
|
|
6813
|
+
onGenerateBoth: He,
|
|
6814
|
+
onExplosionChange: We,
|
|
6815
|
+
onStyleChange: Ge,
|
|
6816
|
+
onExplode: Ke,
|
|
6817
|
+
onAssemble: qe,
|
|
6818
|
+
onHighlight: Je,
|
|
6819
|
+
onClearHighlight: Ye,
|
|
6820
|
+
onFileSelected: Be,
|
|
6821
|
+
onProviderChange: S(Me),
|
|
6822
|
+
onApiKeyChange: S(Ne)
|
|
6709
6823
|
}, null, 8, [
|
|
6710
6824
|
"parts",
|
|
6711
6825
|
"is-exploded",
|
|
@@ -6743,7 +6857,7 @@ animate();
|
|
|
6743
6857
|
"is-collab": S(P).isCollabMode.value,
|
|
6744
6858
|
"collab-users": S(P).collabUsers.value,
|
|
6745
6859
|
"current-user": S(P).currentUser.value,
|
|
6746
|
-
"is-owner":
|
|
6860
|
+
"is-owner": oe.value,
|
|
6747
6861
|
onSend: st,
|
|
6748
6862
|
onClose: o[14] ||= (e) => N.value = !1,
|
|
6749
6863
|
"unread-mention": S(P).unreadMention.value,
|
|
@@ -6759,7 +6873,7 @@ animate();
|
|
|
6759
6873
|
"is-owner",
|
|
6760
6874
|
"unread-mention"
|
|
6761
6875
|
]),
|
|
6762
|
-
s(
|
|
6876
|
+
s(jn, {
|
|
6763
6877
|
modelValue: ne.value,
|
|
6764
6878
|
"onUpdate:modelValue": o[16] ||= (e) => ne.value = e,
|
|
6765
6879
|
"document-id": j.value || u.value,
|
|
@@ -6768,7 +6882,7 @@ animate();
|
|
|
6768
6882
|
]);
|
|
6769
6883
|
};
|
|
6770
6884
|
}
|
|
6771
|
-
}, [["__scopeId", "data-v-
|
|
6885
|
+
}, [["__scopeId", "data-v-70a7c24e"]]), fo = c({
|
|
6772
6886
|
name: "YourCompanyExplosion3d",
|
|
6773
6887
|
props: {
|
|
6774
6888
|
docId: {
|
|
@@ -6803,6 +6917,10 @@ animate();
|
|
|
6803
6917
|
type: Object,
|
|
6804
6918
|
default: () => ({})
|
|
6805
6919
|
},
|
|
6920
|
+
aiApi: {
|
|
6921
|
+
type: [String, Object],
|
|
6922
|
+
default: null
|
|
6923
|
+
},
|
|
6806
6924
|
roomId: {
|
|
6807
6925
|
type: String,
|
|
6808
6926
|
default: ""
|
|
@@ -6812,8 +6930,8 @@ animate();
|
|
|
6812
6930
|
return () => l("div", {
|
|
6813
6931
|
class: "yourcompany-explosion-3d-wrapper",
|
|
6814
6932
|
style: "position:relative"
|
|
6815
|
-
}, [l(
|
|
6933
|
+
}, [l(uo, { ...e }), l(D)]);
|
|
6816
6934
|
}
|
|
6817
6935
|
});
|
|
6818
6936
|
//#endregion
|
|
6819
|
-
export {
|
|
6937
|
+
export { fo as default };
|