ss-component-new 1.2.4 → 1.2.6
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/{animationData-CfT99nMO.cjs → animationData-B0K2ghu6.cjs} +1 -1
- package/dist/{animationData-9n1X4UvO.js → animationData-GqECkAbz.js} +4 -4
- package/dist/{array-pg68Qbs1.js → array-D65aMM6H.js} +1 -1
- package/dist/{array-BPHS7JFA.cjs → array-DMPAgNcb.cjs} +1 -1
- package/dist/config.js +1 -1
- package/dist/{index-bj8hK6Pe.js → index--rLSLEk3.js} +2 -2
- package/dist/{index-B8J_v2Ky.cjs → index-67QO-qDa.cjs} +1 -1
- package/dist/{index-DOlPMLvf.cjs → index-87kRWJv8.cjs} +1 -1
- package/dist/{index-CdPbJekh.js → index-8Dyi4QCI.js} +185 -186
- package/dist/{index-CK_O7QdV.cjs → index-8yRiF_z8.cjs} +1 -1
- package/dist/{index-B5srJr0o.js → index-9zEdW6xv.js} +2 -2
- package/dist/{index-CAHYTZ1Q.cjs → index-B14iwpkN.cjs} +1 -1
- package/dist/{index-DJ1PTHpx.cjs → index-B7hLDNQ6.cjs} +1 -1
- package/dist/{index-DBScQH7L.js → index-BEoEUXZe.js} +166 -166
- package/dist/{index-BOVdAFDH.cjs → index-BHJ-tVLT.cjs} +1 -1
- package/dist/{index-Dk8D9SRm.js → index-BMMYAqF1.js} +1 -1
- package/dist/{index-DFg-bhPI.js → index-BNOx3XL5.js} +1 -1
- package/dist/{index-CMlYJD5U.cjs → index-BNvpuVyw.cjs} +1 -1
- package/dist/{index-d6tSWKtY.cjs → index-BOJUyAaV.cjs} +2 -2
- package/dist/{index-B5vIeQUq.cjs → index-BYUPvuvs.cjs} +1 -1
- package/dist/{index-LXb5DfDE.cjs → index-BaRkv5oc.cjs} +1 -1
- package/dist/{index-Bx4qIiIa.cjs → index-BpR7F1Fp.cjs} +1 -1
- package/dist/{index-BjXcyVvp.js → index-Bs2K1FVH.js} +2 -2
- package/dist/{index-Bsdjuxq1.cjs → index-BsM9qdbC.cjs} +1 -1
- package/dist/{index-CyP2hcVu.js → index-BsfJJu0R.js} +6 -6
- package/dist/{index-BAj0dyBF.js → index-Bw_JtuzR.js} +3 -3
- package/dist/{index-BuKHInQb.js → index-C1FOuBuy.js} +1 -1
- package/dist/{index-NFCeQcv4.cjs → index-C5CKSB0e.cjs} +1 -1
- package/dist/{index-CCsSOTaB.js → index-C8UOMPgt.js} +2 -2
- package/dist/{index-CCIJ-P3X.cjs → index-CA-FC_OL.cjs} +1 -1
- package/dist/{index-CDXq3gs4.js → index-CArSUfnV.js} +19 -19
- package/dist/{index-8CcD03tl.js → index-CBuqdsPh.js} +6 -6
- package/dist/{index---6UATT0.js → index-CMCrQ36H.js} +3 -3
- package/dist/{index-CpE8hbs0.js → index-CRj9VM12.js} +6 -6
- package/dist/{index-C1lB8apW.js → index-CRrAiL5l.js} +4 -4
- package/dist/{index-BNNxPuEV.js → index-CShBWCYm.js} +1 -1
- package/dist/{index-FxX6NP0J.js → index-CTkF2kl_.js} +1 -1
- package/dist/{index-DCf7Tz40.cjs → index-CZaBF851.cjs} +1 -1
- package/dist/{index-Y7MUJdPv.js → index-CbA74tCL.js} +2 -2
- package/dist/{index-B5gNufYw.js → index-CbDu4gfZ.js} +2 -2
- package/dist/{index-zQVJFawn.cjs → index-CePZE-QA.cjs} +1 -1
- package/dist/{index-Bi7yv8jC.cjs → index-CedgKpsz.cjs} +1 -1
- package/dist/{index-C0HHmjrg.cjs → index-Cm3z0Vmi.cjs} +1 -1
- package/dist/{index-BEJOd_29.js → index-D-WcrLQv.js} +4 -4
- package/dist/{index-D-r_YKrq.cjs → index-D6mwkqWY.cjs} +2 -2
- package/dist/index-D8510-YQ.cjs +1 -0
- package/dist/{index-DPyzaxnq.cjs → index-D9oqICYV.cjs} +1 -1
- package/dist/{index-DSsZtYMz.js → index-DGepdvRW.js} +2 -2
- package/dist/{index-D0_4keB8.js → index-DGi-ANHr.js} +5 -5
- package/dist/{index-CLtFz5gE.js → index-DJGsDpDp.js} +3 -3
- package/dist/{index-B9nZeing.cjs → index-DPBmAgEA.cjs} +1 -1
- package/dist/{index-xHEf6hcO.js → index-DPWc4No_.js} +2 -2
- package/dist/{index-BrsIZVyD.cjs → index-DSchKIyh.cjs} +1 -1
- package/dist/{index-UN4JU0ly.js → index-DV_ZZQBO.js} +2 -2
- package/dist/{index-1DtctdYW.cjs → index-DVmoPvzr.cjs} +1 -1
- package/dist/{index-BKhDFqMM.cjs → index-DWs7-g1h.cjs} +1 -1
- package/dist/{index-DszzdQnM.cjs → index-DZ8a7BZ1.cjs} +1 -1
- package/dist/{index-nUEWiqy9.cjs → index-DcUUpSE1.cjs} +1 -1
- package/dist/{index-DsHRVZ0E.js → index-DvpVQvAe.js} +2 -2
- package/dist/{index-DPaTtF3h.cjs → index-FK1YYpjN.cjs} +1 -1
- package/dist/{index-DEwcUkb-.js → index-HvKjB6_P.js} +3 -3
- package/dist/{index-PIEkAjRf.js → index-LADv0t0E.js} +11 -11
- package/dist/{index-DS5z17Mc.js → index-_66uQhcl.js} +7 -7
- package/dist/{index-CxNBcsll.cjs → index-_uyv24Pt.cjs} +1 -1
- package/dist/{index-pLeOyTaj.js → index-g4qw0jRy.js} +6 -6
- package/dist/{index-C-AOuDkl.cjs → index-mtuIEfrj.cjs} +1 -1
- package/dist/{index-CmlXlH2b.cjs → index-tttYIzsn.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Cmc1oALS.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BSOYWm_U.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BTu7I4mn.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DIMJusrg.js} +2 -2
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-C795GAHK.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-D2VLEzGB.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-Bg_c-oAL.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-D58IzjOR.js} +6 -6
- package/dist/{index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-Bn5qXF4J.cjs → index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-BnNwKutS.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-9kDr7Iek.js → index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-CJCvJvBM.js} +13 -13
- package/dist/{index.vue_vue_type_style_index_1_lang-Exyt6qTf.js → index.vue_vue_type_style_index_1_lang-D5Hjs-g0.js} +31 -25
- package/dist/{index.vue_vue_type_style_index_1_lang-Bn7P4fYM.cjs → index.vue_vue_type_style_index_1_lang-H_pReDxj.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-zN5mc8b0.cjs → index.vue_vue_type_style_index_1_lang-N-_9ZJEf.cjs} +2 -2
- package/dist/{index.vue_vue_type_style_index_1_lang-D1n_3_F6.js → index.vue_vue_type_style_index_1_lang-hBa3nAgx.js} +3 -3
- package/dist/{isString-BAN9KLwf.js → isString--ZVOCy4V.js} +1 -1
- package/dist/{isString-ChvWbctO.cjs → isString-CELwppr9.cjs} +1 -1
- package/dist/{main-BUEuCNq-.cjs → main-C6Iw-pcH.cjs} +1 -1
- package/dist/{main-Dk3BZDsa.js → main-CygliYyN.js} +5 -5
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +11 -11
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +12 -12
- package/dist/{threeLatheView-DfSxRY8B.cjs → threeLatheView-CdUoB0Te.cjs} +1 -1
- package/dist/{threeLatheView-DcuDjVv0.js → threeLatheView-DzpPpdDr.js} +2 -2
- package/dist/{threeModel-DjjtL0-a.cjs → threeModel-BUCLJlE5.cjs} +1 -1
- package/dist/{threeModel-YRFvkgXU.js → threeModel-BfMMeZCc.js} +3 -3
- package/dist/{threePreview-CyYfnbB6.js → threePreview-BEqzg370.js} +1 -1
- package/dist/{threePreview-ByUYJkts.cjs → threePreview-C-JW_pcY.cjs} +1 -1
- package/dist/threeSceneView-BTsG2QJg.cjs +5 -0
- package/dist/threeSceneView-DV5dsTZZ.js +1471 -0
- package/dist/{threeSceneViewForCPMPIP-axjwKt9X.js → threeSceneViewForCPMPIP-Bexwqkry.js} +7 -7
- package/dist/{threeSceneViewForCPMPIP-DA-twBdG.cjs → threeSceneViewForCPMPIP-DwLWGNUd.cjs} +1 -1
- package/dist/{threeViewerHost-B02OtfCk.cjs → threeViewerHost-CRqcYbJE.cjs} +1 -1
- package/dist/{threeViewerHost-D7L1FW__.js → threeViewerHost-CTjd2V1D.js} +4 -4
- package/dist/{useRayCaster-CAqupK7D.js → useRayCaster-D0_7oJan.js} +1 -1
- package/dist/{useRayCaster-ClcofJkf.cjs → useRayCaster-DN56HpNP.cjs} +1 -1
- package/package.json +1 -1
- package/public/config.js +1 -1
- package/dist/index-5hLZZ6t-.cjs +0 -1
- package/dist/threeSceneView-mhrcH0WG.cjs +0 -5
- package/dist/threeSceneView-zvyCHrp1.js +0 -1469
package/dist/ss-component.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { defineAsyncComponent as o } from "vue";
|
|
2
2
|
import { S as I } from "./index-BHtNKL1L.js";
|
|
3
|
-
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
4
|
-
import { u as C } from "./index.vue_vue_type_style_index_1_lang-
|
|
5
|
-
import "./index-
|
|
3
|
+
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DIMJusrg.js";
|
|
4
|
+
import { u as C } from "./index.vue_vue_type_style_index_1_lang-D5Hjs-g0.js";
|
|
5
|
+
import "./index-DV_ZZQBO.js";
|
|
6
6
|
import u from "./ss-component2.js";
|
|
7
7
|
import { t as g, c as T, b as P } from "./index-C2usxP_Q.js";
|
|
8
|
-
const n = o(() => import("./main-
|
|
8
|
+
const n = o(() => import("./main-CygliYyN.js"));
|
|
9
9
|
n.install = (t) => {
|
|
10
10
|
t.component("ssComponent", n);
|
|
11
11
|
};
|
|
12
|
-
const s = o(() => import("./index-
|
|
12
|
+
const s = o(() => import("./index-_66uQhcl.js").then((t) => t.k));
|
|
13
13
|
s.install = (t) => {
|
|
14
14
|
t.component("ssTab", s);
|
|
15
15
|
};
|
|
16
|
-
const r = o(() => import("./index-
|
|
16
|
+
const r = o(() => import("./index-CShBWCYm.js"));
|
|
17
17
|
r.install = (t) => {
|
|
18
18
|
t.component("ssMenu", r);
|
|
19
19
|
};
|
|
20
|
-
const m = o(() => import("./index-
|
|
20
|
+
const m = o(() => import("./index-LADv0t0E.js"));
|
|
21
21
|
m.install = (t) => {
|
|
22
22
|
t.component("ssMenuComponent", m);
|
|
23
23
|
};
|
|
24
|
-
const i = o(() => import("./index-
|
|
24
|
+
const i = o(() => import("./index-DGepdvRW.js"));
|
|
25
25
|
i.install = (t) => {
|
|
26
26
|
t.component("ssCanvas", i);
|
|
27
27
|
};
|
|
@@ -29,15 +29,15 @@ const c = o(() => import("./index-DiRBJiMW.js"));
|
|
|
29
29
|
c.install = (t) => {
|
|
30
30
|
t.component("ssFold", c);
|
|
31
31
|
};
|
|
32
|
-
const a = o(() => import("./index
|
|
32
|
+
const a = o(() => import("./index--rLSLEk3.js").then((t) => t.i));
|
|
33
33
|
a.install = (t) => {
|
|
34
34
|
t.component("ssAvatar", a);
|
|
35
35
|
};
|
|
36
|
-
const l = o(() => import("./threeModel-
|
|
36
|
+
const l = o(() => import("./threeModel-BfMMeZCc.js"));
|
|
37
37
|
l.install = (t) => {
|
|
38
38
|
t.component("ssThree", l);
|
|
39
39
|
};
|
|
40
|
-
const p = o(() => import("./threeViewerHost-
|
|
40
|
+
const p = o(() => import("./threeViewerHost-CTjd2V1D.js").then((t) => t.t));
|
|
41
41
|
p.install = (t) => {
|
|
42
42
|
t.component("threeViewerHost", p);
|
|
43
43
|
};
|
package/dist/ss-component2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("vue-router"),t=[{path:"/tenant",name:"Tenant",component:async()=>Promise.resolve().then(()=>require("./index-
|
|
1
|
+
"use strict";const n=require("vue-router"),t=[{path:"/tenant",name:"Tenant",component:async()=>Promise.resolve().then(()=>require("./index-DSchKIyh.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-BHJ-tVLT.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-BsM9qdbC.cjs")),children:[{path:"系统配置/站内信",name:"Message",component:async()=>Promise.resolve().then(()=>require("./index-DPIg2S6M.cjs"))},{path:"系统配置/自动生成",name:"Automatic",component:async()=>Promise.resolve().then(()=>require("./index-B2BAJXIH.cjs"))},{path:"平台管理/菜单管理",name:"Menu",component:async()=>Promise.resolve().then(()=>require("./index-87kRWJv8.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-Cm3z0Vmi.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-C5CKSB0e.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-BYUPvuvs.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-D9oqICYV.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-DPBmAgEA.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-67QO-qDa.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-CZaBF851.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-B14iwpkN.cjs"))}]}],o=n.createRouter({history:n.createWebHashHistory(),routes:t});o.beforeEach((r,s,e)=>{!sessionStorage.getItem("loginToken")&&r.path!=="/login"?e("/login"):e()});module.exports=o;
|
package/dist/ss-component2.js
CHANGED
|
@@ -3,17 +3,17 @@ const a = [
|
|
|
3
3
|
{
|
|
4
4
|
path: "/tenant",
|
|
5
5
|
name: "Tenant",
|
|
6
|
-
component: async () => import("./index-
|
|
6
|
+
component: async () => import("./index-C1FOuBuy.js")
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
path: "/login",
|
|
10
10
|
name: "Login",
|
|
11
|
-
component: async () => import("./index-
|
|
11
|
+
component: async () => import("./index-Bw_JtuzR.js")
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
path: "/",
|
|
15
15
|
name: "Model",
|
|
16
|
-
component: async () => import("./index-
|
|
16
|
+
component: async () => import("./index-CArSUfnV.js"),
|
|
17
17
|
// component: async ()=>import('@/components/views/model/component/main.vue'),
|
|
18
18
|
// component: async ()=>import('@/components/views/canvas/index.vue'),
|
|
19
19
|
// component: async ()=>import('@/components/views/test/index.vue'),
|
|
@@ -31,47 +31,47 @@ const a = [
|
|
|
31
31
|
{
|
|
32
32
|
path: "平台管理/菜单管理",
|
|
33
33
|
name: "Menu",
|
|
34
|
-
component: async () => import("./index-
|
|
34
|
+
component: async () => import("./index-BsfJJu0R.js")
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
path: "平台管理/主菜单管理",
|
|
38
38
|
name: "MainMenu",
|
|
39
|
-
component: async () => import("./index-
|
|
39
|
+
component: async () => import("./index-D-WcrLQv.js")
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
path: "系统管理/个人中心",
|
|
43
43
|
name: "PersonalCenter",
|
|
44
|
-
component: async () => import("./index-
|
|
44
|
+
component: async () => import("./index-g4qw0jRy.js")
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
path: "系统管理/职位管理",
|
|
48
48
|
name: "Post",
|
|
49
|
-
component: async () => import("./index-
|
|
49
|
+
component: async () => import("./index-CRrAiL5l.js")
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
path: "系统管理/用户管理",
|
|
53
53
|
name: "User",
|
|
54
|
-
component: async () => import("./index
|
|
54
|
+
component: async () => import("./index-CMCrQ36H.js")
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
path: "系统管理/角色管理",
|
|
58
58
|
name: "Role",
|
|
59
|
-
component: async () => import("./index-
|
|
59
|
+
component: async () => import("./index-HvKjB6_P.js")
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
path: "系统管理/部门管理",
|
|
63
63
|
name: "Dept",
|
|
64
|
-
component: async () => import("./index-
|
|
64
|
+
component: async () => import("./index-DGi-ANHr.js")
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
path: "系统维护/登录日志",
|
|
68
68
|
name: "LoginLog",
|
|
69
|
-
component: async () => import("./index-
|
|
69
|
+
component: async () => import("./index-DPWc4No_.js")
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
path: "系统维护/操作日志",
|
|
73
73
|
name: "OperateLog",
|
|
74
|
-
component: async () => import("./index-
|
|
74
|
+
component: async () => import("./index-C8UOMPgt.js")
|
|
75
75
|
}
|
|
76
76
|
// {
|
|
77
77
|
// path: 'priority',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./iconfont-t5epssvu.cjs"),U=require("./urdfTree-CCktg0FK.cjs"),N=require("./three-viewport-gizmo-BV37JzRa.cjs"),J=require("./isString-ChvWbctO.cjs"),_=require("./index-d6tSWKtY.cjs"),K=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function Q(o){const n=[];return o.forEach(i=>{const[l,s,r]=i.trim().split(/\s+/);n.push(+l,+s,+r)}),n}function X(o,n,i){switch(o){case"X":n.x=+i||0;break;case"Y":n.y=+i||0;break;case"Z":n.z=+i||0;break}}function W(o){const n=[],i=["X","Y","Z"];return o.forEach(l=>{const s={x:0,y:0,z:0},r=l.trim();if(!r)return;let d=null,f="";for(let m=0;m<(r==null?void 0:r.length);m++){const v=r[m],g=i.find(C=>C===v);if(g){d&&X(d,s,f),f="",d=g;continue}f=f+v}X(d,s,f),n.push(s.x,s.y,s.z)}),n}async function ee(o){var s,r;const n=(s=o==null?void 0:o.trim())==null?void 0:s.split(/\r?\n/),i=n==null?void 0:n[0],l=(r=i==null?void 0:i.trim())==null?void 0:r.split(/\s+/);if((l==null?void 0:l.length)>=3)return Q(n);if((l==null?void 0:l.length)===1)return W(n)}async function te(o){const n=o.trim().split(/\r?\n/),i=[];return n.forEach(l=>{const s=l.trim().split(/\s+/);if(s.length!=3)return;const[r,d,f]=s;i.push(+r,+d,+f)}),i}async function ne(o){const n=o.trim().split(/\r?\n/),i=[];return n.forEach(l=>{const s=l.trim().split(/\s+/);if(s.length!=3)return;const[r,d,f]=s;i.push(+r,+d,+f)}),i}async function oe(o,n){const{isCyd:i,isUv:l,isCpt:s}=n;return l?ee(o):i?ne(o):s?te(o):[]}function ie(o,n,i,l=4,s=50){let r=1/0,d=-1/0,f=1/0,m=-1/0,v=1/0,g=-1/0;for(let h=0;h<o.length;h+=3){const V=o[h],b=o[h+1],E=o[h+2];r=Math.min(r,V),d=Math.max(d,V),f=Math.min(f,b),m=Math.max(m,b),v=Math.min(v,E),g=Math.max(g,E)}const y=Math.sqrt((d-r)**2+(m-f)**2+(g-v)**2)*.05,k=N.MathUtils.degToRad(n.fov),P=2*Math.tan(k/2)*s,M=y/P*i.domElement.height*(l/4);return Math.max(1,M)}function le(o){const n=new N.BufferGeometry;n.setAttribute("position",new N.Float32BufferAttribute(o,3));const i=new N.PointsMaterial({color:55551,size:1,sizeAttenuation:!1});return new N.Points(n,i)}function ae(o,n){if(!n)return;const{scene:i,camera:l,renderer:s,controls:r}=o();if(!i||!l||!s||!r)return;const d=le(n);d.name="轨迹路径",i.add(d);const f=ie(n,l,s,.5,50);d.material.size=f;const m=new N.Box3().setFromObject(d),v=m.getCenter(new N.Vector3),g=m.getSize(new N.Vector3),C=Math.max(g.x,g.y,g.z),y=l.fov*(Math.PI/180);let k=Math.abs(C/2/Math.tan(y/2));return k*=1.2,l.position.set(v.x,v.y,v.z+k),l.lookAt(v),r==null||r.target.copy(v),d}const se={class:"obj-viewer-container"},re={class:"buttonGroup-top"},ce={class:"buttonGroup-topLeft"},ue={class:"buttonGroup-left"},de={class:"buttonGroup-right"},fe={class:"buttonGroup-bottom"},ve={class:"left-panel"},me={class:"panel-header"},ge={class:"panel-body"},pe={key:1,class:"clipping-content"},he={class:"radio-group"},Ve={class:"radio-label"},ze={class:"radio-label"},Ne={class:"radio-label"},Ce={class:"radio-label"},ye={class:"right-panel"},ke={class:"panel-header"},xe={class:"panel-body"},we={key:0,class:"loading-overlay"},be=e.defineComponent({__name:"threeLatheView",props:{fileUrls:{},threeData:{default:()=>""},trackFileType:{}},emits:["getAnimationData","getThreeData"],setup(o,{emit:n}){const i=n,l=o,s=e.ref(null),r=e.ref(!1),d=e.ref(""),f=e.ref(!1),m=e.ref(""),v=e.ref(!1),g=e.ref(""),C=e.shallowRef(null),y=e.shallowRef(null),{currentModels:k,resetView:P,initThreeJS:M,handleResize:h,getThreeJSObjects:V,cleanup:b,axesHelperVisible:E,toggleAxesVisibility:$}=a.useThreeJS(s),{isAnimating:R,toggleAnimation:q,stopAnimation:G}=a.useAnimation(V,k),{isClipping:L,activeClippingAxis:p,toggleClipping:Y,updateClippingPlanes:z}=a.useClipping(V,k),Z=()=>{$()},I=u=>{f.value=!0,m.value=u,u==="剖面视图"&&!L.value&&Y()},j=u=>{v.value=!0,g.value=u,u==="动画仿真"&&i("getAnimationData")},A=e.ref([]),F=u=>new Promise(async(t,x)=>{const H=await(await fetch(u)).blob(),S=new FileReader;S.onload=function(B){var w;t((w=B.target)==null?void 0:w.result)},S.onerror=B=>{const{error:w}=S;x(w==null?void 0:w.message)},S.readAsText(H)}),O=e.computed(()=>{const u=l.fileUrls||[];return u==null?void 0:u[0]});let D=null;const T=()=>{if(D){const{scene:u}=V();u==null||u.remove(D)}};return e.watch(()=>O.value,async u=>{if(!u)return;T();const t=await F(u);if(J.isString(t)){A.value=await oe(t,l.trackFileType)||[];const x=A.value;D=ae(V,x)}},{immediate:!0,deep:!0}),e.onMounted(async()=>{try{M(),window.addEventListener("resize",h);const u=V();y.value=u.scene,y.value&&(y.value.name="CPMPIP")}catch(u){console.error("Three.js 初始化失败:",u),_.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{m.value="",g.value="",window.removeEventListener("resize",h),R.value&&G(),T(),b()}),(u,t)=>{const x=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:s,class:"threejs-container"},null,512),e.createElementVNode("div",re,[e.createVNode(a.SvgIcon,{name:"guanjianjiexi",size:"34"}),e.createVNode(a.SvgIcon,{name:"guanjiekongzhi",size:"34"}),e.createVNode(a.SvgIcon,{name:"gongyishengcheng",size:"34"}),e.createVNode(a.SvgIcon,{name:"buchangshezhi",size:"34"}),e.createVNode(a.SvgIcon,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",ce,[e.createVNode(a.SvgIcon,{name:"viewReset",size:"24",onClick:e.unref(P),title:"重置"},null,8,["onClick"]),e.createVNode(a.SvgIcon,{name:"fangda",size:"24",title:"放大"}),e.createVNode(a.SvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(a.SvgIcon,{name:"lookAround",size:"24",onClick:e.unref(q),title:e.unref(R)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(a.SvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(E),onClick:Z,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",ue,[e.createVNode(a.SvgIcon,{name:"jiegoushu",size:"24",onClick:t[0]||(t[0]=c=>I("场景树")),active:f.value&&m.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(a.SvgIcon,{name:"clipping",size:"24",onClick:t[1]||(t[1]=c=>I("剖面视图")),active:f.value&&m.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24",onClick:t[2]||(t[2]=c=>I("场景树3"))}),e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24",onClick:t[3]||(t[3]=c=>I("场景4"))})]),e.createElementVNode("div",de,[e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24"}),e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24"}),e.createVNode(a.SvgIcon,{name:"guanjiekongzhi",size:"24",onClick:t[4]||(t[4]=c=>j("关节控制")),active:v.value&&g.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:t[5]||(t[5]=c=>j("动画仿真")),active:v.value&&g.value==="动画仿真"},null,8,["active"]),e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24",title:"urdf动画",onClick:t[6]||(t[6]=c=>j("urdf动画")),active:v.value&&g.value==="urdf动画"},null,8,["active"]),e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",fe,[e.createVNode(a.SvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:t[7]||(t[7]=()=>{})}),e.createVNode(a.SvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:t[8]||(t[8]=()=>{})}),e.createVNode(a.SvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:t[9]||(t[9]=()=>{})}),e.createVNode(a.SvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:t[10]||(t[10]=()=>{})}),e.createVNode(a.SvgIcon,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:t[11]||(t[11]=()=>{})})]),e.withDirectives(e.createElementVNode("div",ve,[e.createElementVNode("div",me,[e.createElementVNode("span",null,e.toDisplayString(m.value),1),e.createElementVNode("span",{class:"close",onClick:t[12]||(t[12]=c=>f.value=!1)}," X ")]),e.createElementVNode("div",ge,[e.createVNode(x,{height:"100%"},{default:e.withCtx(()=>[m.value==="场景树"?(e.openBlock(),e.createBlock(U.UrdfTree,{key:0,model:C.value},null,8,["model"])):e.createCommentVNode("",!0),m.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("div",he,[e.createElementVNode("label",Ve,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":t[13]||(t[13]=c=>e.isRef(p)?p.value=c:null),onChange:t[14]||(t[14]=(...c)=>e.unref(z)&&e.unref(z)(...c))},null,544),[[e.vModelRadio,e.unref(p)]]),t[22]||(t[22]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",ze,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":t[15]||(t[15]=c=>e.isRef(p)?p.value=c:null),onChange:t[16]||(t[16]=(...c)=>e.unref(z)&&e.unref(z)(...c))},null,544),[[e.vModelRadio,e.unref(p)]]),t[23]||(t[23]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Ne,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":t[17]||(t[17]=c=>e.isRef(p)?p.value=c:null),onChange:t[18]||(t[18]=(...c)=>e.unref(z)&&e.unref(z)(...c))},null,544),[[e.vModelRadio,e.unref(p)]]),t[24]||(t[24]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Ce,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":t[19]||(t[19]=c=>e.isRef(p)?p.value=c:null),onChange:t[20]||(t[20]=(...c)=>e.unref(z)&&e.unref(z)(...c))},null,544),[[e.vModelRadio,e.unref(p)]]),t[25]||(t[25]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})])],512),[[e.vShow,f.value]]),e.withDirectives(e.createElementVNode("div",ye,[e.createElementVNode("div",ke,[e.createElementVNode("span",null,e.toDisplayString(g.value),1),e.createElementVNode("span",{class:"close",onClick:t[21]||(t[21]=c=>v.value=!1)}," X ")]),e.createElementVNode("div",xe,[e.createVNode(x,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(U.JointPanel,{model:C.value},null,8,["model"]),[[e.vShow,g.value==="关节控制"]])]),_:1})])],512),[[e.vShow,v.value]]),r.value?(e.openBlock(),e.createElementBlock("div",we,[t[26]||(t[26]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(d.value),1)])):e.createCommentVNode("",!0)])}}}),Ee=K._export_sfc(be,[["__scopeId","data-v-d5ac3f12"]]);exports.default=Ee;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./iconfont-t5epssvu.cjs"),U=require("./urdfTree-CCktg0FK.cjs"),N=require("./three-viewport-gizmo-BV37JzRa.cjs"),J=require("./isString-CELwppr9.cjs"),_=require("./index-BOJUyAaV.cjs"),K=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function Q(o){const n=[];return o.forEach(i=>{const[l,s,r]=i.trim().split(/\s+/);n.push(+l,+s,+r)}),n}function X(o,n,i){switch(o){case"X":n.x=+i||0;break;case"Y":n.y=+i||0;break;case"Z":n.z=+i||0;break}}function W(o){const n=[],i=["X","Y","Z"];return o.forEach(l=>{const s={x:0,y:0,z:0},r=l.trim();if(!r)return;let d=null,f="";for(let m=0;m<(r==null?void 0:r.length);m++){const v=r[m],g=i.find(C=>C===v);if(g){d&&X(d,s,f),f="",d=g;continue}f=f+v}X(d,s,f),n.push(s.x,s.y,s.z)}),n}async function ee(o){var s,r;const n=(s=o==null?void 0:o.trim())==null?void 0:s.split(/\r?\n/),i=n==null?void 0:n[0],l=(r=i==null?void 0:i.trim())==null?void 0:r.split(/\s+/);if((l==null?void 0:l.length)>=3)return Q(n);if((l==null?void 0:l.length)===1)return W(n)}async function te(o){const n=o.trim().split(/\r?\n/),i=[];return n.forEach(l=>{const s=l.trim().split(/\s+/);if(s.length!=3)return;const[r,d,f]=s;i.push(+r,+d,+f)}),i}async function ne(o){const n=o.trim().split(/\r?\n/),i=[];return n.forEach(l=>{const s=l.trim().split(/\s+/);if(s.length!=3)return;const[r,d,f]=s;i.push(+r,+d,+f)}),i}async function oe(o,n){const{isCyd:i,isUv:l,isCpt:s}=n;return l?ee(o):i?ne(o):s?te(o):[]}function ie(o,n,i,l=4,s=50){let r=1/0,d=-1/0,f=1/0,m=-1/0,v=1/0,g=-1/0;for(let h=0;h<o.length;h+=3){const V=o[h],b=o[h+1],E=o[h+2];r=Math.min(r,V),d=Math.max(d,V),f=Math.min(f,b),m=Math.max(m,b),v=Math.min(v,E),g=Math.max(g,E)}const y=Math.sqrt((d-r)**2+(m-f)**2+(g-v)**2)*.05,k=N.MathUtils.degToRad(n.fov),P=2*Math.tan(k/2)*s,M=y/P*i.domElement.height*(l/4);return Math.max(1,M)}function le(o){const n=new N.BufferGeometry;n.setAttribute("position",new N.Float32BufferAttribute(o,3));const i=new N.PointsMaterial({color:55551,size:1,sizeAttenuation:!1});return new N.Points(n,i)}function ae(o,n){if(!n)return;const{scene:i,camera:l,renderer:s,controls:r}=o();if(!i||!l||!s||!r)return;const d=le(n);d.name="轨迹路径",i.add(d);const f=ie(n,l,s,.5,50);d.material.size=f;const m=new N.Box3().setFromObject(d),v=m.getCenter(new N.Vector3),g=m.getSize(new N.Vector3),C=Math.max(g.x,g.y,g.z),y=l.fov*(Math.PI/180);let k=Math.abs(C/2/Math.tan(y/2));return k*=1.2,l.position.set(v.x,v.y,v.z+k),l.lookAt(v),r==null||r.target.copy(v),d}const se={class:"obj-viewer-container"},re={class:"buttonGroup-top"},ce={class:"buttonGroup-topLeft"},ue={class:"buttonGroup-left"},de={class:"buttonGroup-right"},fe={class:"buttonGroup-bottom"},ve={class:"left-panel"},me={class:"panel-header"},ge={class:"panel-body"},pe={key:1,class:"clipping-content"},he={class:"radio-group"},Ve={class:"radio-label"},ze={class:"radio-label"},Ne={class:"radio-label"},Ce={class:"radio-label"},ye={class:"right-panel"},ke={class:"panel-header"},xe={class:"panel-body"},we={key:0,class:"loading-overlay"},be=e.defineComponent({__name:"threeLatheView",props:{fileUrls:{},threeData:{default:()=>""},trackFileType:{}},emits:["getAnimationData","getThreeData"],setup(o,{emit:n}){const i=n,l=o,s=e.ref(null),r=e.ref(!1),d=e.ref(""),f=e.ref(!1),m=e.ref(""),v=e.ref(!1),g=e.ref(""),C=e.shallowRef(null),y=e.shallowRef(null),{currentModels:k,resetView:P,initThreeJS:M,handleResize:h,getThreeJSObjects:V,cleanup:b,axesHelperVisible:E,toggleAxesVisibility:$}=a.useThreeJS(s),{isAnimating:R,toggleAnimation:q,stopAnimation:G}=a.useAnimation(V,k),{isClipping:L,activeClippingAxis:p,toggleClipping:Y,updateClippingPlanes:z}=a.useClipping(V,k),Z=()=>{$()},I=u=>{f.value=!0,m.value=u,u==="剖面视图"&&!L.value&&Y()},j=u=>{v.value=!0,g.value=u,u==="动画仿真"&&i("getAnimationData")},A=e.ref([]),F=u=>new Promise(async(t,x)=>{const H=await(await fetch(u)).blob(),S=new FileReader;S.onload=function(B){var w;t((w=B.target)==null?void 0:w.result)},S.onerror=B=>{const{error:w}=S;x(w==null?void 0:w.message)},S.readAsText(H)}),O=e.computed(()=>{const u=l.fileUrls||[];return u==null?void 0:u[0]});let D=null;const T=()=>{if(D){const{scene:u}=V();u==null||u.remove(D)}};return e.watch(()=>O.value,async u=>{if(!u)return;T();const t=await F(u);if(J.isString(t)){A.value=await oe(t,l.trackFileType)||[];const x=A.value;D=ae(V,x)}},{immediate:!0,deep:!0}),e.onMounted(async()=>{try{M(),window.addEventListener("resize",h);const u=V();y.value=u.scene,y.value&&(y.value.name="CPMPIP")}catch(u){console.error("Three.js 初始化失败:",u),_.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{m.value="",g.value="",window.removeEventListener("resize",h),R.value&&G(),T(),b()}),(u,t)=>{const x=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:s,class:"threejs-container"},null,512),e.createElementVNode("div",re,[e.createVNode(a.SvgIcon,{name:"guanjianjiexi",size:"34"}),e.createVNode(a.SvgIcon,{name:"guanjiekongzhi",size:"34"}),e.createVNode(a.SvgIcon,{name:"gongyishengcheng",size:"34"}),e.createVNode(a.SvgIcon,{name:"buchangshezhi",size:"34"}),e.createVNode(a.SvgIcon,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",ce,[e.createVNode(a.SvgIcon,{name:"viewReset",size:"24",onClick:e.unref(P),title:"重置"},null,8,["onClick"]),e.createVNode(a.SvgIcon,{name:"fangda",size:"24",title:"放大"}),e.createVNode(a.SvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(a.SvgIcon,{name:"lookAround",size:"24",onClick:e.unref(q),title:e.unref(R)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(a.SvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(E),onClick:Z,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",ue,[e.createVNode(a.SvgIcon,{name:"jiegoushu",size:"24",onClick:t[0]||(t[0]=c=>I("场景树")),active:f.value&&m.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(a.SvgIcon,{name:"clipping",size:"24",onClick:t[1]||(t[1]=c=>I("剖面视图")),active:f.value&&m.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24",onClick:t[2]||(t[2]=c=>I("场景树3"))}),e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24",onClick:t[3]||(t[3]=c=>I("场景4"))})]),e.createElementVNode("div",de,[e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24"}),e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24"}),e.createVNode(a.SvgIcon,{name:"guanjiekongzhi",size:"24",onClick:t[4]||(t[4]=c=>j("关节控制")),active:v.value&&g.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:t[5]||(t[5]=c=>j("动画仿真")),active:v.value&&g.value==="动画仿真"},null,8,["active"]),e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24",title:"urdf动画",onClick:t[6]||(t[6]=c=>j("urdf动画")),active:v.value&&g.value==="urdf动画"},null,8,["active"]),e.createVNode(a.SvgIcon,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",fe,[e.createVNode(a.SvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:t[7]||(t[7]=()=>{})}),e.createVNode(a.SvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:t[8]||(t[8]=()=>{})}),e.createVNode(a.SvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:t[9]||(t[9]=()=>{})}),e.createVNode(a.SvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:t[10]||(t[10]=()=>{})}),e.createVNode(a.SvgIcon,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:t[11]||(t[11]=()=>{})})]),e.withDirectives(e.createElementVNode("div",ve,[e.createElementVNode("div",me,[e.createElementVNode("span",null,e.toDisplayString(m.value),1),e.createElementVNode("span",{class:"close",onClick:t[12]||(t[12]=c=>f.value=!1)}," X ")]),e.createElementVNode("div",ge,[e.createVNode(x,{height:"100%"},{default:e.withCtx(()=>[m.value==="场景树"?(e.openBlock(),e.createBlock(U.UrdfTree,{key:0,model:C.value},null,8,["model"])):e.createCommentVNode("",!0),m.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("div",he,[e.createElementVNode("label",Ve,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":t[13]||(t[13]=c=>e.isRef(p)?p.value=c:null),onChange:t[14]||(t[14]=(...c)=>e.unref(z)&&e.unref(z)(...c))},null,544),[[e.vModelRadio,e.unref(p)]]),t[22]||(t[22]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",ze,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":t[15]||(t[15]=c=>e.isRef(p)?p.value=c:null),onChange:t[16]||(t[16]=(...c)=>e.unref(z)&&e.unref(z)(...c))},null,544),[[e.vModelRadio,e.unref(p)]]),t[23]||(t[23]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Ne,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":t[17]||(t[17]=c=>e.isRef(p)?p.value=c:null),onChange:t[18]||(t[18]=(...c)=>e.unref(z)&&e.unref(z)(...c))},null,544),[[e.vModelRadio,e.unref(p)]]),t[24]||(t[24]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Ce,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":t[19]||(t[19]=c=>e.isRef(p)?p.value=c:null),onChange:t[20]||(t[20]=(...c)=>e.unref(z)&&e.unref(z)(...c))},null,544),[[e.vModelRadio,e.unref(p)]]),t[25]||(t[25]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})])],512),[[e.vShow,f.value]]),e.withDirectives(e.createElementVNode("div",ye,[e.createElementVNode("div",ke,[e.createElementVNode("span",null,e.toDisplayString(g.value),1),e.createElementVNode("span",{class:"close",onClick:t[21]||(t[21]=c=>v.value=!1)}," X ")]),e.createElementVNode("div",xe,[e.createVNode(x,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(U.JointPanel,{model:C.value},null,8,["model"]),[[e.vShow,g.value==="关节控制"]])]),_:1})])],512),[[e.vShow,v.value]]),r.value?(e.openBlock(),e.createElementBlock("div",we,[t[26]||(t[26]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(d.value),1)])):e.createCommentVNode("",!0)])}}}),Ee=K._export_sfc(be,[["__scopeId","data-v-d5ac3f12"]]);exports.default=Ee;
|
|
@@ -2,8 +2,8 @@ import { defineComponent as ae, ref as b, shallowRef as N, computed as re, watch
|
|
|
2
2
|
import { u as ve, a as ge, b as pe, S as c } from "./iconfont-ljBfzBSE.js";
|
|
3
3
|
import { U as he, J as ze } from "./urdfTree-BuTtRGdl.js";
|
|
4
4
|
import { B as Ce, V as _, p as ye, ax as xe, a9 as be, ah as ke, l as we } from "./three-viewport-gizmo-BHznJ6W3.js";
|
|
5
|
-
import { i as Pe } from "./isString
|
|
6
|
-
import { E as Me } from "./index-
|
|
5
|
+
import { i as Pe } from "./isString--ZVOCy4V.js";
|
|
6
|
+
import { E as Me } from "./index-DV_ZZQBO.js";
|
|
7
7
|
import { _ as je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
function Ae(o) {
|
|
9
9
|
const n = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./three-viewport-gizmo-BV37JzRa.cjs"),pe=require("./OrbitControls-Co_9huz0.cjs"),me=require("./index-zQVJFawn.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-Bn7P4fYM.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./index-d6tSWKtY.cjs");function ve(z){let h=null,u=null,d=null,g=null,x=null,P=null,c=null,E=null;const D=1e3/30;let S=0;const b=e.ref([]),r=e.ref(new n.Vector3),k=e.ref(new n.Vector3),y=()=>{if(!z.value)return;h=new n.Scene,h.background=new n.Color(15790320);const m=z.value;u=new n.PerspectiveCamera(75,m.clientWidth/m.clientHeight,.1,1e4),u.position.set(8,-8,6),u.up.set(0,0,1),u.lookAt(0,0,0),d=new n.WebGLRenderer({antialias:!0,alpha:!0}),d.setSize(m.clientWidth,m.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,m.appendChild(d.domElement),g=new pe.OrbitControls(u,d.domElement),g.enableDamping=!0,g.dampingFactor=.05,g.mouseButtons={LEFT:null,MIDDLE:n.MOUSE.PAN,RIGHT:n.MOUSE.ROTATE},g.panSpeed=.7,x=new n.Xe(u,d,{container:m,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),x.attachControls(g),f(),C()},t=(m,l)=>{c&&(h.remove(c),c.dispose()),E&&(h.remove(E),E.geometry.dispose(),E.material.dispose());const _=Math.min(Math.max(Math.floor(m/20),30),40);c=new n.GridHelper(m,_,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),h.add(c);const B=new n.PlaneGeometry(m,m),O=new n.ShadowMaterial({opacity:.3,color:0});E=new n.Mesh(B,O),E.position.copy(l),E.position.z-=.01,E.receiveShadow=!0,h.add(E)},p=()=>{if(b.value.length===0)return;const m=new n.Box3;let l=!1;if(b.value.forEach(X=>{if(X.userData.boundingBox)m.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);m.union(Z.box),l=!0}else m.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const _=m.getSize(new n.Vector3),B=m.getCenter(new n.Vector3),O=Math.max(_.x,_.y,_.z),j=Math.max(O*8,50),q=new n.Vector3(B.x,B.y,m.min.z);t(j,q)},f=()=>{const m=new n.AmbientLight(4210752,.6);h.add(m);const l=new n.DirectionalLight(16777215,2);l.position.set(10,10,8),l.castShadow=!0,l.shadow.mapSize.width=4096,l.shadow.mapSize.height=4096,l.shadow.camera.near=.5,l.shadow.camera.far=50,l.shadow.camera.left=-50,l.shadow.camera.right=50,l.shadow.camera.top=50,l.shadow.camera.bottom=-50,h.add(l);const _=new n.DirectionalLight(16777215,.8);_.position.set(-8,-8,6),h.add(_);const B=new n.DirectionalLight(16777215,.6);B.position.set(0,-15,2),h.add(B);const O=new n.HemisphereLight(16777215,4473924,.8);h.add(O);const j=new n.PointLight(16777215,1,50);j.position.set(15,15,15),h.add(j);const q=new n.PointLight(16777215,.5,50);q.position.set(-15,-15,15),h.add(q)},C=()=>{P=requestAnimationFrame(C),g&&g.update();const m=performance.now(),l=m-S;l<D||(S=m-l%D,d&&h&&u&&d.render(h,u),x&&x.render())},I=m=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(_=>{m[_]&&m[_].dispose&&m[_].dispose()}),m.dispose&&m.dispose()},A=m=>{m==null||m.traverse(l=>{l.geometry&&l.geometry.dispose(),l.material&&(Array.isArray(l.material)?l.material.forEach(_=>{I(_)}):I(l.material))})};return{currentModels:b,initialCameraPosition:r,initialTargetPosition:k,initThreeJS:y,handleResize:()=>{if(!z.value||!u||!d||!x)return;const m=z.value,l=m.clientWidth,_=m.clientHeight;u.aspect=l/_,u.updateProjectionMatrix(),d.setSize(l,_),x.update()},fitCameraToAllModels:m=>{if(!u||!g||b.value.length===0)return;const l=new n.Box3;let _=!1;if(b.value.forEach(Z=>{if(Z.userData.boundingBox)l.union(Z.userData.boundingBox),_=!0;else if(Z.userData.modelId&&m.has(Z.userData.modelId)){const ee=m.get(Z.userData.modelId);l.union(ee.box),_=!0}else l.expandByObject(Z),_=!0}),!_){console.warn("无法计算包围盒");return}const B=l.getSize(new n.Vector3),O=l.getCenter(new n.Vector3),q=Math.max(B.x,B.y,B.z)*.8,X=new n.Vector3(O.x+q,O.y-q,O.z+q);u.position.copy(X),u.lookAt(O),g.target.copy(O),g.update(),r.value.copy(X),k.value.copy(O),p()},getThreeJSObjects:()=>({scene:h,camera:u,renderer:d,controls:g,gizmo:x}),clearAllModels:()=>{if(!h)return;b.value.forEach(l=>{h.remove(l),A(l)});const m=[];h.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==E&&m.push(l)}),m.forEach(l=>{h.remove(l),A(l)}),b.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),c&&c.dispose(),E&&(E.geometry.dispose(),E.material.dispose()),d&&d.dispose(),g&&g.dispose(),x&&x.dispose()},updateGridForModels:p}}function he(z,h){const u=e.ref(!1);let d=null,g=12700,x=new n.Vector3,P=new n.Vector3,c=new n.Vector3,E=0,F=null;const D=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,S=t=>{const p=new n.Vector3,f=E*1.2,C=new n.Vector3(c.x+f,c.y,c.z),I=new n.Vector3(c.x,c.y+f,c.z),A=new n.Vector3(c.x,c.y-f,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*f,p.z=c.z+Math.sin($)*f,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(C,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*f,p.y=c.y+Math.cos(J)*f,p.z=c.z}else{const L=(t-.881)/.119,$=D(L);p.lerpVectors(A,x,$)}return p},b=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const f=Date.now()-d,C=Math.min(f/g,1);if(C>=1){k();return}const I=S(C);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(b)},r=()=>{if(h.value.length===0)return;const{camera:t,controls:p}=z();if(!t||!p)return;x.copy(t.position),P.copy(p.target);const f=new n.Box3;h.value.forEach(U=>{f.expandByObject(U)});const C=f.getSize(new n.Vector3);c=f.getCenter(new n.Vector3),E=Math.max(C.x,C.y,C.z)*1.2;const I=new n.Vector3(c.x+E*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const U=Date.now()-$,Y=Math.min(U/L,1),m=D(Y);t.position.lerpVectors(A,I,m),t.lookAt(c),p.target.copy(c),Y<1?requestAnimationFrame(J):(u.value=!0,d=null,b())};J()},k=()=>{u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{controls:t}=z();t&&(t.enabled=!0,t.target.copy(P))};return{isAnimating:u,toggleAnimation:()=>{if(u.value){u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{camera:t,controls:p}=z();if(!t||!p)return;p.enabled=!0;const f=t.position.clone(),C=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),U=D(J);t.position.lerpVectors(f,x,U),p.target.lerpVectors(C,P,U),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function ge(z,h){const u=e.ref(!1),d=e.ref("none");let g=[],x=[],P=new n.Box3,c=new n.Vector3;const E=()=>{g=[new n.Plane(new n.Vector3(1,0,0),0),new n.Plane(new n.Vector3(0,1,0),0),new n.Plane(new n.Vector3(0,0,1),0)]},F=()=>{P.makeEmpty(),h.value.forEach(y=>{P.expandByObject(y)}),c=P.getCenter(new n.Vector3)},D=y=>{const t=P.getSize(new n.Vector3);let p,f,C;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(0,0,0));const I=new n.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:n.DoubleSide,depthWrite:!1}),A=new n.Mesh(p,I);return A.position.copy(f),A.rotation.copy(C),A},S=()=>{if(b(),r(),d.value==="none")return;F();let y=null;if(d.value==="x"?(g[0].constant=-c.x,y=g[0]):d.value==="y"?(g[1].constant=-c.y,y=g[1]):d.value==="z"&&(g[2].constant=-c.z,y=g[2]),y){h.value.forEach(p=>{p.traverse(f=>{f.isMesh&&f.material&&(Array.isArray(f.material)?f.material.forEach(C=>{C.clippingPlanes=[y]}):f.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},b=()=>{h.value.forEach(y=>{y.traverse(t=>{t.isMesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(p=>{p.clippingPlanes=[]}):t.material.clippingPlanes=[])})})},r=()=>{const{scene:y}=z();y&&x.forEach(t=>{y.remove(t),t.geometry.dispose(),t.material.dispose()}),x=[]};return{isClipping:u,activeClippingAxis:d,toggleClipping:()=>{u.value=!u.value,u.value?(E(),h.value.length>0&&F()):(d.value="none",b(),r())},updateClippingPlanes:S,clearClippingPlanes:b,clearClippingMeshes:r}}const ye={class:"panel-content"},we={__name:"animationPanel",props:{animationData:Object,model:Object},setup(z){const h=z;e.ref();const u=e.ref();return e.watch(()=>[h==null?void 0:h.animationData],()=>{var g;let d=((g=re.cloneDeep(h==null?void 0:h.animationData))==null?void 0:g["输出(动画数据)Content"])??[];d&&(u.value=d)},{deep:!0,immediate:!0}),(d,g)=>{var x,P,c;return e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(me.ssTable,{itemData:(x=u.value)==null?void 0:x.compData,key:(P=u.value)==null?void 0:P.id,index:(c=u.value)==null?void 0:c.id,showHeader:!1},null,8,["itemData","index"]))])}}},xe=oe._export_sfc(we,[["__scopeId","data-v-2387536e"]]),Ve={class:"panel-content"},Me={key:0,class:"joints-list"},ke={class:"joint-info-row"},Pe={class:"joint-left"},Ce={class:"joint-name"},Ee={class:"joint-range"},be={class:"joint-type"},_e={key:0,class:"joint-control-row"},ze={class:"slider-container"},De=["min","max","value","onInput","disabled"],Ne={class:"value-display"},Se={class:"joint-value"},Be={class:"unit"},Ae={key:1,class:"empty-state"},ae=.001,Re=1e3,ue=60,Fe={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(z,{expose:h}){const u=z;e.ref(!0);const d=e.ref([]),g=e.ref(null),x=e.ref(null),P=e.ref(12.5),c=e.ref(),E=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),b=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Re/ue/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;E.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=re.cloneDeep(o))==null?void 0:i["输出(动画数据)"])??[];v&&v.length>0&&(f=v)},{deep:!0}),e.computed(()=>f.length>0);const C=(o,v=!1)=>o==="revolute"?v?Math.PI:-Math.PI:o==="prismatic"?v?1:-1:0,I=()=>{if(!g.value)return re.ElMessage.error("未加载 URDF"),!1;let o=null;return g.value.traverse(v=>{o||v.name==="Pipe_Link"&&v.traverse(i=>{i instanceof n.Mesh&&!o&&(o=i)})}),o?(o.position.y-=F.value*ae,c.value=o,o.material=new n.MeshPhongMaterial({color:11184810,shininess:80,side:n.DoubleSide}),!0):(re.ElMessage.error('在 "Pipe_Link" 内未找到任何 Mesh'),!1)},A=o=>{if(!o||!o.joints)return console.warn("URDF模型没有关节信息"),[];let v=null;if(o.traverse(V=>{V.name==="Pipe_Link"&&!v&&(v=V)}),v)c.value=v;else return console.warn("未找到管子模型"),[];const i=[];return Object.keys(o.joints).forEach(V=>{const s=o.joints[V];if(s._jointType==="fixed")return;const a=s.limit?{lower:s.limit.lower??C(s._jointType,!1),upper:s.limit.upper??C(s._jointType,!0)}:{lower:C(s._jointType,!1),upper:C(s._jointType,!0)};i.push({name:V,type:s._jointType||"unknown",limit:a,currentValue:s.angle||0,urdfJoint:s})}),i.sort((V,s)=>V.name.localeCompare(s.name))},L=(o,v)=>{const i=d.value.find(s=>s.name===o);if(!i)return;const V=parseFloat(v);if(i.limit){const s=Math.max(i.limit.lower,Math.min(i.limit.upper,V));i.currentValue=s}else i.currentValue=V;u.model&&u.model.setJointValue?u.model.setJointValue(o,i.currentValue):i.urdfJoint&&i.urdfJoint.setJointValue(i.currentValue)},$=o=>o.reduce((v,i)=>{let V=0;const s=i.Y??0,a=i.C??0,w=i.R??0;return s>0&&(V+=s),a>0&&w>0&&(V+=w*y(a)),v+V},0),J=o=>{const v=[],i=o.Y??0,V=o.B??0,s=o.C??0,a=o.R??0,w={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!i&&!s)return v;if(v.push(w.pos.clone()),V!==0){const G=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(G),w.localZ.applyMatrix4(G)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae)),v.push(w.pos.clone())),s>0&&a>0){const G=y(s),T=a*ae,W=w.pos.clone().add(w.localX.clone().multiplyScalar(-T)),R=Math.max(16,Math.ceil(s/5));for(let M=1;M<=R;M++){const H=G*M/R,K=new n.Matrix4().makeRotationAxis(w.localZ,H),se=w.localX.clone().multiplyScalar(T).applyMatrix4(K),ie=W.clone().add(se);v.push(ie)}}return v},U=(o,v=0)=>{let i=f.slice(0,o+1);const V=f[o+1];if(V&&v>0){const R={...V,B:(V.B??0)*v,C:(V.C??0)*v};i.push(R)}const s=$(i),a=Math.max(0,E.value-s),w=[];w.push(new n.Vector3(0,0,0));const G=new n.Vector3(0,a*ae,0);a>0&&w.push(G);let T={pos:G.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const W=[];for(let R=i.length-1;R>=0;R--){const M=i[R],H=J(M);if(H.length>0){const K=H.map(Q=>{const ne=Q.clone(),de=new n.Matrix4;return de.makeBasis(T.localX,T.localY,T.localZ),ne.applyMatrix4(de),ne.add(T.pos)});W.push(K);const te=K[K.length-1];T.pos=te.clone();const se=M.B??0,ie=M.C??0;if(se!==0){const Q=new n.Matrix4().makeRotationAxis(T.localY,y(se));T.localX.applyMatrix4(Q),T.localZ.applyMatrix4(Q)}if(ie>0){const Q=y(ie),ne=new n.Matrix4().makeRotationAxis(T.localZ,Q);T.localY.applyMatrix4(ne),T.localX.applyMatrix4(ne)}}}for(const R of W)R.length>1&&w.push(...R.slice(1));w.length<2&&w.push(new n.Vector3(0,.001,0));try{const R=new n.CatmullRomCurve3(w,!1,"catmullrom",.01),M=new n.TubeGeometry(R,Math.max(2,w.length*4),P.value*ae,18,!1);c.value.geometry.dispose(),c.value.geometry=M}catch(R){console.error("管件更新失败",R)}},Y=(o,v,i=1)=>{o&&(Object.keys(o).forEach(V=>{const s=o[V],a=d.value.find(w=>w.name===V);a&&(a.currentValue=s,u.model&&u.model.setJointValue?u.model.setJointValue(V,s):a.urdfJoint&&a.urdfJoint.setJointValue(s))}),U(v,i))},m=(o,v,i)=>o+(v-o)*i,l=(o,v,i)=>{if(!o||!v)return o||v;const V={};return Object.keys(o).forEach(s=>{const a=o[s],w=v[s];V[s]=m(a,w||a,i)}),V},_=()=>{if(f.length===0){console.warn("没有动画数据");return}I(),D.value=!0,S.value=!1,b.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=b.value;if(o>=f.length-1){const s=f[f.length-1];Y(s,f.length-1,1),j();return}const v=r.value/ue,i=f[o],V=f[o+1];if(V){const s=l(i,V,v);Y(s,o,v)}else Y(i,o);r.value++,r.value>ue&&(r.value=0,b.value++),k.value=setTimeout(B,p())},O=()=>{S.value=!0,k.value&&(clearTimeout(k.value),k.value=null)},j=()=>{D.value=!1,S.value=!1,t.value=1,k.value&&(clearTimeout(k.value),k.value=null)};h({startAnimation:_,pauseAnimation:O,stopAnimation:j,resetAll:()=>{j(),b.value=0,r.value=0,d.value.forEach(o=>{(o.type==="revolute"||o.type==="prismatic")&&L(o.name,0)}),U(-1,0)},fastForward:()=>{t.value<4&&(t.value=Math.min(4,t.value*2))},fastBackward:()=>{t.value>.25&&(t.value=Math.max(.25,t.value/2))}}),e.watch(()=>u.model,o=>{o?(g.value=o,d.value=A(o)):d.value=[]},{immediate:!0});const ee=()=>{!u.model||D.value&&!S.value||d.value.forEach(o=>{o.urdfJoint&&o.urdfJoint.angle!==void 0&&(o.currentValue=o.urdfJoint.angle)})},le=()=>{const o=()=>{ee(),x.value=requestAnimationFrame(o)};o()},ce=()=>{x.value&&(cancelAnimationFrame(x.value),x.value=null)};return e.onMounted(()=>{le()}),e.onUnmounted(()=>{ce(),j()}),(o,v)=>(e.openBlock(),e.createElementBlock("div",Ve,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,i=>{var V,s,a,w;return e.openBlock(),e.createElementBlock("div",{key:i.name,class:"joint-item"},[e.createElementVNode("div",ke,[e.createElementVNode("div",Pe,[e.createElementVNode("span",Ce,e.toDisplayString(i.name),1),e.createElementVNode("span",Ee," ["+e.toDisplayString(((V=i.limit)==null?void 0:V.lower.toFixed(2))??(i.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((s=i.limit)==null?void 0:s.upper.toFixed(2))??(i.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",be,e.toDisplayString(i.type),1)]),i.type==="revolute"||i.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",ze,[e.createElementVNode("input",{type:"range",min:((a=i.limit)==null?void 0:a.lower)??(i.type==="revolute"?-Math.PI:-1),max:((w=i.limit)==null?void 0:w.upper)??(i.type==="revolute"?Math.PI:1),step:.01,value:i.currentValue,onInput:G=>L(i.name,G.target.value),class:"joint-slider",disabled:D.value&&!S.value},null,40,De)]),e.createElementVNode("div",Ne,[e.createElementVNode("span",Se,e.toDisplayString(i.currentValue?Number(i.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Be,e.toDisplayString(i.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Ae,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},Te=oe._export_sfc(Fe,[["__scopeId","data-v-035ae936"]]),Le={class:"panel-content"},Ie="id",$e={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:z=>["breadth","firstLevel"].includes(z)}},emits:["nodeClick"],setup(z,{emit:h}){const u=z,d=h,g=e.ref([]),x={children:"children",label:"label"},P=r=>{d("nodeClick",r)},c=(r,k=0)=>{const y=[];return Array.isArray(r)&&(r==null?void 0:r.length)>0&&r.forEach(t=>{if(!(t!=null&&t.isMesh)&&((t==null?void 0:t.type)==="URDFJoint"||(t==null?void 0:t.type)==="URDFLink")){const p={name:t==null?void 0:t.name,label:t==null?void 0:t.name,show:!0,level:k+1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:c(t==null?void 0:t.children,k+1),path:t==null?void 0:t.name};y.push(p)}}),y},E=r=>r?[{name:r==null?void 0:r.name,label:r==null?void 0:r.name,show:!0,level:1,isPenultimate:!1,type:r==null?void 0:r.type,id:r==null?void 0:r.id,limit:(r==null?void 0:r.limit)??"",children:c(r==null?void 0:r.children,1),path:r==null?void 0:r.name}]:[],F=(r,k)=>{const y=[],t=[...r];for(;t.length>0&&y.length<k;){const p=t.shift();p.children&&p.children.length>0&&(y.push(p.id),t.push(...p.children))}return y},D=(r,k)=>{const y=[];return r.forEach(t=>{if(t.children&&t.children.length>0){y.push(t.id);const p=t.children.filter(f=>f.children&&f.children.length>0).slice(0,k).map(f=>f.id);y.push(...p)}}),y.slice(0,k+1)},S=e.computed(()=>!g.value||g.value.length===0?[]:u.expandStrategy==="firstLevel"?D(g.value,u.maxExpandCount):F(g.value,u.maxExpandCount)),b=e.computed(()=>u!=null&&u.model?E(u.model):[]);return e.watch(b,r=>{g.value=JSON.parse(JSON.stringify(r))},{immediate:!0}),(r,k)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(y,{data:g.value,props:x,"default-expanded-keys":S.value,"node-key":Ie,onNodeClick:P},null,8,["data","default-expanded-keys"])])}}},Je=oe._export_sfc($e,[["__scopeId","data-v-290ff4e1"]]),Oe=["xlink:href"],Ge=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(z){const h=z,u=e.computed(()=>({backgroundColor:h.backgroundColor})),d=e.computed(()=>`#${h.prefix}-${h.name}`),g=e.computed(()=>{const{size:x}=h;let P=`${x}`;return P=`${P.replace("px","")}px`,{width:P,height:P}});return(x,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:x.active}]),style:e.normalizeStyle(u.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[x.$attrs.class,x.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(g.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":d.value},null,8,Oe)],6))],6))}}),N=oe._export_sfc(Ge,[["__scopeId","data-v-3150a90b"]]),Ue={class:"obj-viewer-container"},je={class:"buttonGroup-top"},qe={class:"buttonGroup-topLeft"},Xe={class:"buttonGroup-left"},He={class:"buttonGroup-right"},Ye={class:"buttonGroup-bottom"},Ze={class:"left-panel"},We={class:"panel-header"},Ke={key:1,class:"clipping-content"},Qe={class:"radio-group"},et={class:"radio-label"},tt={class:"radio-label"},nt={class:"radio-label"},at={class:"radio-label"},ot={class:"right-panel"},lt={class:"panel-header"},st={key:0,class:"loading-overlay"},it={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(z,{expose:h,emit:u}){const d=u;let g=null,x=!1;const P=e.ref(null),c=e.ref(!1),E=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),b=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:f,handleResize:C,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(P),{isAnimating:J,toggleAnimation:U,stopAnimation:Y}=he(A,y),{isClipping:m,activeClippingAxis:l,toggleClipping:_,updateClippingPlanes:B}=ge(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=fe.useModelLoader(A,y,c,E,L),Z=()=>{if(F.value||y.value.length===0)return;F.value=!0,J.value&&Y();const{camera:s,controls:a}=A();if(!s||!a)return;a.enabled=!0;const w=H=>H<.5?4*H*H*H:1-Math.pow(-2*H+2,3)/2,G=s.position.clone(),T=a.target.clone(),W=1500,R=Date.now(),M=()=>{const H=Date.now()-R,K=Math.min(H/W,1),te=w(K);s.position.lerpVectors(G,t.value,te),a.target.lerpVectors(T,p.value,te),K<1?requestAnimationFrame(M):F.value=!1};M()},ee=async()=>x?Promise.resolve():new Promise(s=>{const a=()=>{x?s():requestAnimationFrame(a)};a()}),le=async(s,a)=>{try{await ee(),J.value&&Y(),m.value&&_();const w=await a(s);return I(X),w}catch(w){throw console.error("加载模型失败:",w),w}},ce=async s=>le(s,O),o=async s=>le(s,j),v=s=>{D.value=!0,S.value=s,s==="剖面视图"&&!m.value&&_()},i=s=>{b.value=!0,r.value=s,s==="动画仿真"&&d("getAnimationData")},V=()=>{e.nextTick(()=>{var s;(s=k.value)==null||s.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{f(),g=A().scene,x=!0,window.addEventListener("resize",C)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",C),J.value&&Y(),$()}),h({addModelsFromUrls:ce,loadModelByDefaultPath:o}),(s,a)=>{var G,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Ue,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:P,class:"threejs-container"},null,512),e.createElementVNode("div",je,[e.createVNode(N,{name:"guanjianjiexi",size:"34"}),e.createVNode(N,{name:"guanjiekongzhi",size:"34"}),e.createVNode(N,{name:"gongyishengcheng",size:"34"}),e.createVNode(N,{name:"buchangshezhi",size:"34"}),e.createVNode(N,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",qe,[e.createVNode(N,{name:"viewReset",size:"24",onClick:Z,title:"重置"}),e.createVNode(N,{name:"fangda",size:"24",title:"放大"}),e.createVNode(N,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(N,{name:"lookAround",size:"24",onClick:e.unref(U),title:e.unref(J)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",Xe,[e.createVNode(N,{name:"jiegoushu",size:"24",onClick:a[0]||(a[0]=M=>v("场景树")),active:D.value&&S.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(N,{name:"clipping",size:"24",onClick:a[1]||(a[1]=M=>v("剖面视图")),active:D.value&&S.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[2]||(a[2]=M=>v("场景树3"))}),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[3]||(a[3]=M=>v("场景4"))})]),e.createElementVNode("div",He,[e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"guanjiekongzhi",size:"24",onClick:a[4]||(a[4]=M=>i("关节控制")),active:b.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:a[5]||(a[5]=M=>i("动画仿真")),active:b.value&&r.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",Ye,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(G=k.value)==null?void 0:G.fastBackward},null,8,["onClick"]),e.createVNode(N,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:V}),e.createVNode(N,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(T=k.value)==null?void 0:T.fastForward},null,8,["onClick"]),e.createVNode(N,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(W=k.value)==null?void 0:W.pauseAnimation},null,8,["onClick"]),e.createVNode(N,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(R=k.value)==null?void 0:R.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",Ze,[e.createElementVNode("div",We,[e.createElementVNode("span",null,e.toDisplayString(S.value),1),e.createElementVNode("span",{class:"close",onClick:a[6]||(a[6]=M=>D.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[S.value==="场景树"?(e.openBlock(),e.createBlock(Je,{key:0,model:e.unref(q)},null,8,["model"])):e.createCommentVNode("",!0),S.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("label",et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":a[7]||(a[7]=M=>e.isRef(l)?l.value=M:null),onChange:a[8]||(a[8]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[16]||(a[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",tt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":a[9]||(a[9]=M=>e.isRef(l)?l.value=M:null),onChange:a[10]||(a[10]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[17]||(a[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",nt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":a[11]||(a[11]=M=>e.isRef(l)?l.value=M:null),onChange:a[12]||(a[12]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[18]||(a[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",at,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":a[13]||(a[13]=M=>e.isRef(l)?l.value=M:null),onChange:a[14]||(a[14]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[19]||(a[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,D.value]]),e.withDirectives(e.createElementVNode("div",ot,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:a[15]||(a[15]=M=>b.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(Te,{ref_key:"jointRef",ref:k,model:e.unref(q),scene:e.unref(g),animationData:z.animationData},null,8,["model","scene","animationData"]),[[e.vShow,r.value==="关节控制"]]),e.withDirectives(e.createVNode(xe,{animationData:z.animationData},null,8,["animationData"]),[[e.vShow,r.value==="动画仿真"]])]),_:1})],512),[[e.vShow,b.value]]),c.value?(e.openBlock(),e.createElementBlock("div",st,[a[20]||(a[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(E.value),1)])):e.createCommentVNode("",!0)])}}},rt=oe._export_sfc(it,[["__scopeId","data-v-7bc47bb3"]]);exports.default=rt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./three-viewport-gizmo-BV37JzRa.cjs"),pe=require("./OrbitControls-Co_9huz0.cjs"),me=require("./index-CePZE-QA.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-H_pReDxj.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./index-BOJUyAaV.cjs");function ve(z){let h=null,u=null,d=null,g=null,x=null,P=null,c=null,E=null;const D=1e3/30;let S=0;const b=e.ref([]),r=e.ref(new n.Vector3),k=e.ref(new n.Vector3),y=()=>{if(!z.value)return;h=new n.Scene,h.background=new n.Color(15790320);const m=z.value;u=new n.PerspectiveCamera(75,m.clientWidth/m.clientHeight,.1,1e4),u.position.set(8,-8,6),u.up.set(0,0,1),u.lookAt(0,0,0),d=new n.WebGLRenderer({antialias:!0,alpha:!0}),d.setSize(m.clientWidth,m.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,m.appendChild(d.domElement),g=new pe.OrbitControls(u,d.domElement),g.enableDamping=!0,g.dampingFactor=.05,g.mouseButtons={LEFT:null,MIDDLE:n.MOUSE.PAN,RIGHT:n.MOUSE.ROTATE},g.panSpeed=.7,x=new n.Xe(u,d,{container:m,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),x.attachControls(g),f(),C()},t=(m,l)=>{c&&(h.remove(c),c.dispose()),E&&(h.remove(E),E.geometry.dispose(),E.material.dispose());const _=Math.min(Math.max(Math.floor(m/20),30),40);c=new n.GridHelper(m,_,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),h.add(c);const B=new n.PlaneGeometry(m,m),O=new n.ShadowMaterial({opacity:.3,color:0});E=new n.Mesh(B,O),E.position.copy(l),E.position.z-=.01,E.receiveShadow=!0,h.add(E)},p=()=>{if(b.value.length===0)return;const m=new n.Box3;let l=!1;if(b.value.forEach(X=>{if(X.userData.boundingBox)m.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);m.union(Z.box),l=!0}else m.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const _=m.getSize(new n.Vector3),B=m.getCenter(new n.Vector3),O=Math.max(_.x,_.y,_.z),j=Math.max(O*8,50),q=new n.Vector3(B.x,B.y,m.min.z);t(j,q)},f=()=>{const m=new n.AmbientLight(4210752,.6);h.add(m);const l=new n.DirectionalLight(16777215,2);l.position.set(10,10,8),l.castShadow=!0,l.shadow.mapSize.width=4096,l.shadow.mapSize.height=4096,l.shadow.camera.near=.5,l.shadow.camera.far=50,l.shadow.camera.left=-50,l.shadow.camera.right=50,l.shadow.camera.top=50,l.shadow.camera.bottom=-50,h.add(l);const _=new n.DirectionalLight(16777215,.8);_.position.set(-8,-8,6),h.add(_);const B=new n.DirectionalLight(16777215,.6);B.position.set(0,-15,2),h.add(B);const O=new n.HemisphereLight(16777215,4473924,.8);h.add(O);const j=new n.PointLight(16777215,1,50);j.position.set(15,15,15),h.add(j);const q=new n.PointLight(16777215,.5,50);q.position.set(-15,-15,15),h.add(q)},C=()=>{P=requestAnimationFrame(C),g&&g.update();const m=performance.now(),l=m-S;l<D||(S=m-l%D,d&&h&&u&&d.render(h,u),x&&x.render())},I=m=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(_=>{m[_]&&m[_].dispose&&m[_].dispose()}),m.dispose&&m.dispose()},A=m=>{m==null||m.traverse(l=>{l.geometry&&l.geometry.dispose(),l.material&&(Array.isArray(l.material)?l.material.forEach(_=>{I(_)}):I(l.material))})};return{currentModels:b,initialCameraPosition:r,initialTargetPosition:k,initThreeJS:y,handleResize:()=>{if(!z.value||!u||!d||!x)return;const m=z.value,l=m.clientWidth,_=m.clientHeight;u.aspect=l/_,u.updateProjectionMatrix(),d.setSize(l,_),x.update()},fitCameraToAllModels:m=>{if(!u||!g||b.value.length===0)return;const l=new n.Box3;let _=!1;if(b.value.forEach(Z=>{if(Z.userData.boundingBox)l.union(Z.userData.boundingBox),_=!0;else if(Z.userData.modelId&&m.has(Z.userData.modelId)){const ee=m.get(Z.userData.modelId);l.union(ee.box),_=!0}else l.expandByObject(Z),_=!0}),!_){console.warn("无法计算包围盒");return}const B=l.getSize(new n.Vector3),O=l.getCenter(new n.Vector3),q=Math.max(B.x,B.y,B.z)*.8,X=new n.Vector3(O.x+q,O.y-q,O.z+q);u.position.copy(X),u.lookAt(O),g.target.copy(O),g.update(),r.value.copy(X),k.value.copy(O),p()},getThreeJSObjects:()=>({scene:h,camera:u,renderer:d,controls:g,gizmo:x}),clearAllModels:()=>{if(!h)return;b.value.forEach(l=>{h.remove(l),A(l)});const m=[];h.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==E&&m.push(l)}),m.forEach(l=>{h.remove(l),A(l)}),b.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),c&&c.dispose(),E&&(E.geometry.dispose(),E.material.dispose()),d&&d.dispose(),g&&g.dispose(),x&&x.dispose()},updateGridForModels:p}}function he(z,h){const u=e.ref(!1);let d=null,g=12700,x=new n.Vector3,P=new n.Vector3,c=new n.Vector3,E=0,F=null;const D=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,S=t=>{const p=new n.Vector3,f=E*1.2,C=new n.Vector3(c.x+f,c.y,c.z),I=new n.Vector3(c.x,c.y+f,c.z),A=new n.Vector3(c.x,c.y-f,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*f,p.z=c.z+Math.sin($)*f,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(C,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*f,p.y=c.y+Math.cos(J)*f,p.z=c.z}else{const L=(t-.881)/.119,$=D(L);p.lerpVectors(A,x,$)}return p},b=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const f=Date.now()-d,C=Math.min(f/g,1);if(C>=1){k();return}const I=S(C);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(b)},r=()=>{if(h.value.length===0)return;const{camera:t,controls:p}=z();if(!t||!p)return;x.copy(t.position),P.copy(p.target);const f=new n.Box3;h.value.forEach(U=>{f.expandByObject(U)});const C=f.getSize(new n.Vector3);c=f.getCenter(new n.Vector3),E=Math.max(C.x,C.y,C.z)*1.2;const I=new n.Vector3(c.x+E*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const U=Date.now()-$,Y=Math.min(U/L,1),m=D(Y);t.position.lerpVectors(A,I,m),t.lookAt(c),p.target.copy(c),Y<1?requestAnimationFrame(J):(u.value=!0,d=null,b())};J()},k=()=>{u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{controls:t}=z();t&&(t.enabled=!0,t.target.copy(P))};return{isAnimating:u,toggleAnimation:()=>{if(u.value){u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{camera:t,controls:p}=z();if(!t||!p)return;p.enabled=!0;const f=t.position.clone(),C=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),U=D(J);t.position.lerpVectors(f,x,U),p.target.lerpVectors(C,P,U),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function ge(z,h){const u=e.ref(!1),d=e.ref("none");let g=[],x=[],P=new n.Box3,c=new n.Vector3;const E=()=>{g=[new n.Plane(new n.Vector3(1,0,0),0),new n.Plane(new n.Vector3(0,1,0),0),new n.Plane(new n.Vector3(0,0,1),0)]},F=()=>{P.makeEmpty(),h.value.forEach(y=>{P.expandByObject(y)}),c=P.getCenter(new n.Vector3)},D=y=>{const t=P.getSize(new n.Vector3);let p,f,C;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(0,0,0));const I=new n.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:n.DoubleSide,depthWrite:!1}),A=new n.Mesh(p,I);return A.position.copy(f),A.rotation.copy(C),A},S=()=>{if(b(),r(),d.value==="none")return;F();let y=null;if(d.value==="x"?(g[0].constant=-c.x,y=g[0]):d.value==="y"?(g[1].constant=-c.y,y=g[1]):d.value==="z"&&(g[2].constant=-c.z,y=g[2]),y){h.value.forEach(p=>{p.traverse(f=>{f.isMesh&&f.material&&(Array.isArray(f.material)?f.material.forEach(C=>{C.clippingPlanes=[y]}):f.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},b=()=>{h.value.forEach(y=>{y.traverse(t=>{t.isMesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(p=>{p.clippingPlanes=[]}):t.material.clippingPlanes=[])})})},r=()=>{const{scene:y}=z();y&&x.forEach(t=>{y.remove(t),t.geometry.dispose(),t.material.dispose()}),x=[]};return{isClipping:u,activeClippingAxis:d,toggleClipping:()=>{u.value=!u.value,u.value?(E(),h.value.length>0&&F()):(d.value="none",b(),r())},updateClippingPlanes:S,clearClippingPlanes:b,clearClippingMeshes:r}}const ye={class:"panel-content"},we={__name:"animationPanel",props:{animationData:Object,model:Object},setup(z){const h=z;e.ref();const u=e.ref();return e.watch(()=>[h==null?void 0:h.animationData],()=>{var g;let d=((g=re.cloneDeep(h==null?void 0:h.animationData))==null?void 0:g["输出(动画数据)Content"])??[];d&&(u.value=d)},{deep:!0,immediate:!0}),(d,g)=>{var x,P,c;return e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(me.ssTable,{itemData:(x=u.value)==null?void 0:x.compData,key:(P=u.value)==null?void 0:P.id,index:(c=u.value)==null?void 0:c.id,showHeader:!1},null,8,["itemData","index"]))])}}},xe=oe._export_sfc(we,[["__scopeId","data-v-2387536e"]]),Ve={class:"panel-content"},Me={key:0,class:"joints-list"},ke={class:"joint-info-row"},Pe={class:"joint-left"},Ce={class:"joint-name"},Ee={class:"joint-range"},be={class:"joint-type"},_e={key:0,class:"joint-control-row"},ze={class:"slider-container"},De=["min","max","value","onInput","disabled"],Ne={class:"value-display"},Se={class:"joint-value"},Be={class:"unit"},Ae={key:1,class:"empty-state"},ae=.001,Re=1e3,ue=60,Fe={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(z,{expose:h}){const u=z;e.ref(!0);const d=e.ref([]),g=e.ref(null),x=e.ref(null),P=e.ref(12.5),c=e.ref(),E=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),b=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Re/ue/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;E.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=re.cloneDeep(o))==null?void 0:i["输出(动画数据)"])??[];v&&v.length>0&&(f=v)},{deep:!0}),e.computed(()=>f.length>0);const C=(o,v=!1)=>o==="revolute"?v?Math.PI:-Math.PI:o==="prismatic"?v?1:-1:0,I=()=>{if(!g.value)return re.ElMessage.error("未加载 URDF"),!1;let o=null;return g.value.traverse(v=>{o||v.name==="Pipe_Link"&&v.traverse(i=>{i instanceof n.Mesh&&!o&&(o=i)})}),o?(o.position.y-=F.value*ae,c.value=o,o.material=new n.MeshPhongMaterial({color:11184810,shininess:80,side:n.DoubleSide}),!0):(re.ElMessage.error('在 "Pipe_Link" 内未找到任何 Mesh'),!1)},A=o=>{if(!o||!o.joints)return console.warn("URDF模型没有关节信息"),[];let v=null;if(o.traverse(V=>{V.name==="Pipe_Link"&&!v&&(v=V)}),v)c.value=v;else return console.warn("未找到管子模型"),[];const i=[];return Object.keys(o.joints).forEach(V=>{const s=o.joints[V];if(s._jointType==="fixed")return;const a=s.limit?{lower:s.limit.lower??C(s._jointType,!1),upper:s.limit.upper??C(s._jointType,!0)}:{lower:C(s._jointType,!1),upper:C(s._jointType,!0)};i.push({name:V,type:s._jointType||"unknown",limit:a,currentValue:s.angle||0,urdfJoint:s})}),i.sort((V,s)=>V.name.localeCompare(s.name))},L=(o,v)=>{const i=d.value.find(s=>s.name===o);if(!i)return;const V=parseFloat(v);if(i.limit){const s=Math.max(i.limit.lower,Math.min(i.limit.upper,V));i.currentValue=s}else i.currentValue=V;u.model&&u.model.setJointValue?u.model.setJointValue(o,i.currentValue):i.urdfJoint&&i.urdfJoint.setJointValue(i.currentValue)},$=o=>o.reduce((v,i)=>{let V=0;const s=i.Y??0,a=i.C??0,w=i.R??0;return s>0&&(V+=s),a>0&&w>0&&(V+=w*y(a)),v+V},0),J=o=>{const v=[],i=o.Y??0,V=o.B??0,s=o.C??0,a=o.R??0,w={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!i&&!s)return v;if(v.push(w.pos.clone()),V!==0){const G=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(G),w.localZ.applyMatrix4(G)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae)),v.push(w.pos.clone())),s>0&&a>0){const G=y(s),T=a*ae,W=w.pos.clone().add(w.localX.clone().multiplyScalar(-T)),R=Math.max(16,Math.ceil(s/5));for(let M=1;M<=R;M++){const H=G*M/R,K=new n.Matrix4().makeRotationAxis(w.localZ,H),se=w.localX.clone().multiplyScalar(T).applyMatrix4(K),ie=W.clone().add(se);v.push(ie)}}return v},U=(o,v=0)=>{let i=f.slice(0,o+1);const V=f[o+1];if(V&&v>0){const R={...V,B:(V.B??0)*v,C:(V.C??0)*v};i.push(R)}const s=$(i),a=Math.max(0,E.value-s),w=[];w.push(new n.Vector3(0,0,0));const G=new n.Vector3(0,a*ae,0);a>0&&w.push(G);let T={pos:G.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const W=[];for(let R=i.length-1;R>=0;R--){const M=i[R],H=J(M);if(H.length>0){const K=H.map(Q=>{const ne=Q.clone(),de=new n.Matrix4;return de.makeBasis(T.localX,T.localY,T.localZ),ne.applyMatrix4(de),ne.add(T.pos)});W.push(K);const te=K[K.length-1];T.pos=te.clone();const se=M.B??0,ie=M.C??0;if(se!==0){const Q=new n.Matrix4().makeRotationAxis(T.localY,y(se));T.localX.applyMatrix4(Q),T.localZ.applyMatrix4(Q)}if(ie>0){const Q=y(ie),ne=new n.Matrix4().makeRotationAxis(T.localZ,Q);T.localY.applyMatrix4(ne),T.localX.applyMatrix4(ne)}}}for(const R of W)R.length>1&&w.push(...R.slice(1));w.length<2&&w.push(new n.Vector3(0,.001,0));try{const R=new n.CatmullRomCurve3(w,!1,"catmullrom",.01),M=new n.TubeGeometry(R,Math.max(2,w.length*4),P.value*ae,18,!1);c.value.geometry.dispose(),c.value.geometry=M}catch(R){console.error("管件更新失败",R)}},Y=(o,v,i=1)=>{o&&(Object.keys(o).forEach(V=>{const s=o[V],a=d.value.find(w=>w.name===V);a&&(a.currentValue=s,u.model&&u.model.setJointValue?u.model.setJointValue(V,s):a.urdfJoint&&a.urdfJoint.setJointValue(s))}),U(v,i))},m=(o,v,i)=>o+(v-o)*i,l=(o,v,i)=>{if(!o||!v)return o||v;const V={};return Object.keys(o).forEach(s=>{const a=o[s],w=v[s];V[s]=m(a,w||a,i)}),V},_=()=>{if(f.length===0){console.warn("没有动画数据");return}I(),D.value=!0,S.value=!1,b.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=b.value;if(o>=f.length-1){const s=f[f.length-1];Y(s,f.length-1,1),j();return}const v=r.value/ue,i=f[o],V=f[o+1];if(V){const s=l(i,V,v);Y(s,o,v)}else Y(i,o);r.value++,r.value>ue&&(r.value=0,b.value++),k.value=setTimeout(B,p())},O=()=>{S.value=!0,k.value&&(clearTimeout(k.value),k.value=null)},j=()=>{D.value=!1,S.value=!1,t.value=1,k.value&&(clearTimeout(k.value),k.value=null)};h({startAnimation:_,pauseAnimation:O,stopAnimation:j,resetAll:()=>{j(),b.value=0,r.value=0,d.value.forEach(o=>{(o.type==="revolute"||o.type==="prismatic")&&L(o.name,0)}),U(-1,0)},fastForward:()=>{t.value<4&&(t.value=Math.min(4,t.value*2))},fastBackward:()=>{t.value>.25&&(t.value=Math.max(.25,t.value/2))}}),e.watch(()=>u.model,o=>{o?(g.value=o,d.value=A(o)):d.value=[]},{immediate:!0});const ee=()=>{!u.model||D.value&&!S.value||d.value.forEach(o=>{o.urdfJoint&&o.urdfJoint.angle!==void 0&&(o.currentValue=o.urdfJoint.angle)})},le=()=>{const o=()=>{ee(),x.value=requestAnimationFrame(o)};o()},ce=()=>{x.value&&(cancelAnimationFrame(x.value),x.value=null)};return e.onMounted(()=>{le()}),e.onUnmounted(()=>{ce(),j()}),(o,v)=>(e.openBlock(),e.createElementBlock("div",Ve,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,i=>{var V,s,a,w;return e.openBlock(),e.createElementBlock("div",{key:i.name,class:"joint-item"},[e.createElementVNode("div",ke,[e.createElementVNode("div",Pe,[e.createElementVNode("span",Ce,e.toDisplayString(i.name),1),e.createElementVNode("span",Ee," ["+e.toDisplayString(((V=i.limit)==null?void 0:V.lower.toFixed(2))??(i.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((s=i.limit)==null?void 0:s.upper.toFixed(2))??(i.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",be,e.toDisplayString(i.type),1)]),i.type==="revolute"||i.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",ze,[e.createElementVNode("input",{type:"range",min:((a=i.limit)==null?void 0:a.lower)??(i.type==="revolute"?-Math.PI:-1),max:((w=i.limit)==null?void 0:w.upper)??(i.type==="revolute"?Math.PI:1),step:.01,value:i.currentValue,onInput:G=>L(i.name,G.target.value),class:"joint-slider",disabled:D.value&&!S.value},null,40,De)]),e.createElementVNode("div",Ne,[e.createElementVNode("span",Se,e.toDisplayString(i.currentValue?Number(i.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Be,e.toDisplayString(i.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Ae,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},Te=oe._export_sfc(Fe,[["__scopeId","data-v-035ae936"]]),Le={class:"panel-content"},Ie="id",$e={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:z=>["breadth","firstLevel"].includes(z)}},emits:["nodeClick"],setup(z,{emit:h}){const u=z,d=h,g=e.ref([]),x={children:"children",label:"label"},P=r=>{d("nodeClick",r)},c=(r,k=0)=>{const y=[];return Array.isArray(r)&&(r==null?void 0:r.length)>0&&r.forEach(t=>{if(!(t!=null&&t.isMesh)&&((t==null?void 0:t.type)==="URDFJoint"||(t==null?void 0:t.type)==="URDFLink")){const p={name:t==null?void 0:t.name,label:t==null?void 0:t.name,show:!0,level:k+1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:c(t==null?void 0:t.children,k+1),path:t==null?void 0:t.name};y.push(p)}}),y},E=r=>r?[{name:r==null?void 0:r.name,label:r==null?void 0:r.name,show:!0,level:1,isPenultimate:!1,type:r==null?void 0:r.type,id:r==null?void 0:r.id,limit:(r==null?void 0:r.limit)??"",children:c(r==null?void 0:r.children,1),path:r==null?void 0:r.name}]:[],F=(r,k)=>{const y=[],t=[...r];for(;t.length>0&&y.length<k;){const p=t.shift();p.children&&p.children.length>0&&(y.push(p.id),t.push(...p.children))}return y},D=(r,k)=>{const y=[];return r.forEach(t=>{if(t.children&&t.children.length>0){y.push(t.id);const p=t.children.filter(f=>f.children&&f.children.length>0).slice(0,k).map(f=>f.id);y.push(...p)}}),y.slice(0,k+1)},S=e.computed(()=>!g.value||g.value.length===0?[]:u.expandStrategy==="firstLevel"?D(g.value,u.maxExpandCount):F(g.value,u.maxExpandCount)),b=e.computed(()=>u!=null&&u.model?E(u.model):[]);return e.watch(b,r=>{g.value=JSON.parse(JSON.stringify(r))},{immediate:!0}),(r,k)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(y,{data:g.value,props:x,"default-expanded-keys":S.value,"node-key":Ie,onNodeClick:P},null,8,["data","default-expanded-keys"])])}}},Je=oe._export_sfc($e,[["__scopeId","data-v-290ff4e1"]]),Oe=["xlink:href"],Ge=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(z){const h=z,u=e.computed(()=>({backgroundColor:h.backgroundColor})),d=e.computed(()=>`#${h.prefix}-${h.name}`),g=e.computed(()=>{const{size:x}=h;let P=`${x}`;return P=`${P.replace("px","")}px`,{width:P,height:P}});return(x,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:x.active}]),style:e.normalizeStyle(u.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[x.$attrs.class,x.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(g.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":d.value},null,8,Oe)],6))],6))}}),N=oe._export_sfc(Ge,[["__scopeId","data-v-3150a90b"]]),Ue={class:"obj-viewer-container"},je={class:"buttonGroup-top"},qe={class:"buttonGroup-topLeft"},Xe={class:"buttonGroup-left"},He={class:"buttonGroup-right"},Ye={class:"buttonGroup-bottom"},Ze={class:"left-panel"},We={class:"panel-header"},Ke={key:1,class:"clipping-content"},Qe={class:"radio-group"},et={class:"radio-label"},tt={class:"radio-label"},nt={class:"radio-label"},at={class:"radio-label"},ot={class:"right-panel"},lt={class:"panel-header"},st={key:0,class:"loading-overlay"},it={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(z,{expose:h,emit:u}){const d=u;let g=null,x=!1;const P=e.ref(null),c=e.ref(!1),E=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),b=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:f,handleResize:C,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(P),{isAnimating:J,toggleAnimation:U,stopAnimation:Y}=he(A,y),{isClipping:m,activeClippingAxis:l,toggleClipping:_,updateClippingPlanes:B}=ge(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=fe.useModelLoader(A,y,c,E,L),Z=()=>{if(F.value||y.value.length===0)return;F.value=!0,J.value&&Y();const{camera:s,controls:a}=A();if(!s||!a)return;a.enabled=!0;const w=H=>H<.5?4*H*H*H:1-Math.pow(-2*H+2,3)/2,G=s.position.clone(),T=a.target.clone(),W=1500,R=Date.now(),M=()=>{const H=Date.now()-R,K=Math.min(H/W,1),te=w(K);s.position.lerpVectors(G,t.value,te),a.target.lerpVectors(T,p.value,te),K<1?requestAnimationFrame(M):F.value=!1};M()},ee=async()=>x?Promise.resolve():new Promise(s=>{const a=()=>{x?s():requestAnimationFrame(a)};a()}),le=async(s,a)=>{try{await ee(),J.value&&Y(),m.value&&_();const w=await a(s);return I(X),w}catch(w){throw console.error("加载模型失败:",w),w}},ce=async s=>le(s,O),o=async s=>le(s,j),v=s=>{D.value=!0,S.value=s,s==="剖面视图"&&!m.value&&_()},i=s=>{b.value=!0,r.value=s,s==="动画仿真"&&d("getAnimationData")},V=()=>{e.nextTick(()=>{var s;(s=k.value)==null||s.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{f(),g=A().scene,x=!0,window.addEventListener("resize",C)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",C),J.value&&Y(),$()}),h({addModelsFromUrls:ce,loadModelByDefaultPath:o}),(s,a)=>{var G,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Ue,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:P,class:"threejs-container"},null,512),e.createElementVNode("div",je,[e.createVNode(N,{name:"guanjianjiexi",size:"34"}),e.createVNode(N,{name:"guanjiekongzhi",size:"34"}),e.createVNode(N,{name:"gongyishengcheng",size:"34"}),e.createVNode(N,{name:"buchangshezhi",size:"34"}),e.createVNode(N,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",qe,[e.createVNode(N,{name:"viewReset",size:"24",onClick:Z,title:"重置"}),e.createVNode(N,{name:"fangda",size:"24",title:"放大"}),e.createVNode(N,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(N,{name:"lookAround",size:"24",onClick:e.unref(U),title:e.unref(J)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",Xe,[e.createVNode(N,{name:"jiegoushu",size:"24",onClick:a[0]||(a[0]=M=>v("场景树")),active:D.value&&S.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(N,{name:"clipping",size:"24",onClick:a[1]||(a[1]=M=>v("剖面视图")),active:D.value&&S.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[2]||(a[2]=M=>v("场景树3"))}),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[3]||(a[3]=M=>v("场景4"))})]),e.createElementVNode("div",He,[e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"guanjiekongzhi",size:"24",onClick:a[4]||(a[4]=M=>i("关节控制")),active:b.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:a[5]||(a[5]=M=>i("动画仿真")),active:b.value&&r.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",Ye,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(G=k.value)==null?void 0:G.fastBackward},null,8,["onClick"]),e.createVNode(N,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:V}),e.createVNode(N,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(T=k.value)==null?void 0:T.fastForward},null,8,["onClick"]),e.createVNode(N,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(W=k.value)==null?void 0:W.pauseAnimation},null,8,["onClick"]),e.createVNode(N,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(R=k.value)==null?void 0:R.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",Ze,[e.createElementVNode("div",We,[e.createElementVNode("span",null,e.toDisplayString(S.value),1),e.createElementVNode("span",{class:"close",onClick:a[6]||(a[6]=M=>D.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[S.value==="场景树"?(e.openBlock(),e.createBlock(Je,{key:0,model:e.unref(q)},null,8,["model"])):e.createCommentVNode("",!0),S.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("label",et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":a[7]||(a[7]=M=>e.isRef(l)?l.value=M:null),onChange:a[8]||(a[8]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[16]||(a[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",tt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":a[9]||(a[9]=M=>e.isRef(l)?l.value=M:null),onChange:a[10]||(a[10]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[17]||(a[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",nt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":a[11]||(a[11]=M=>e.isRef(l)?l.value=M:null),onChange:a[12]||(a[12]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[18]||(a[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",at,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":a[13]||(a[13]=M=>e.isRef(l)?l.value=M:null),onChange:a[14]||(a[14]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[19]||(a[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,D.value]]),e.withDirectives(e.createElementVNode("div",ot,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:a[15]||(a[15]=M=>b.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(Te,{ref_key:"jointRef",ref:k,model:e.unref(q),scene:e.unref(g),animationData:z.animationData},null,8,["model","scene","animationData"]),[[e.vShow,r.value==="关节控制"]]),e.withDirectives(e.createVNode(xe,{animationData:z.animationData},null,8,["animationData"]),[[e.vShow,r.value==="动画仿真"]])]),_:1})],512),[[e.vShow,b.value]]),c.value?(e.openBlock(),e.createElementBlock("div",st,[a[20]||(a[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(E.value),1)])):e.createCommentVNode("",!0)])}}},rt=oe._export_sfc(it,[["__scopeId","data-v-7bc47bb3"]]);exports.default=rt;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ref as b, watch as Pe, createElementBlock as q, openBlock as H, createBlock as Le, computed as ie, onMounted as $e, onUnmounted as je, Fragment as Xe, renderList as He, createElementVNode as h, createCommentVNode as xe, toDisplayString as ae, resolveComponent as Je, createVNode as z, defineComponent as Ye, normalizeStyle as Ee, normalizeClass as Fe, nextTick as Be, onBeforeUnmount as qe, withDirectives as se, unref as O, withCtx as Te, isRef as he, vModelRadio as ye, vShow as we } from "vue";
|
|
2
2
|
import { V as M, B as be, S as Ze, C as We, P as Ke, W as Ne, a as Qe, A as et, b as tt, M as Re, X as nt, G as at, c as Me, d as ot, e as De, f as st, D as ke, H as lt, g as Ve, h as Oe, i as Ue, j as ze, E as _e, k as de, l as it, m as rt, T as ct } from "./three-viewport-gizmo-BHznJ6W3.js";
|
|
3
3
|
import { O as ut } from "./OrbitControls-DA4VpOM_.js";
|
|
4
|
-
import { s as dt } from "./index-
|
|
5
|
-
import { u as pt } from "./index.vue_vue_type_style_index_1_lang-
|
|
4
|
+
import { s as dt } from "./index-BEoEUXZe.js";
|
|
5
|
+
import { u as pt } from "./index.vue_vue_type_style_index_1_lang-hBa3nAgx.js";
|
|
6
6
|
import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
-
import { c as Ge, E as Ie } from "./index-
|
|
7
|
+
import { c as Ge, E as Ie } from "./index-DV_ZZQBO.js";
|
|
8
8
|
function mt(E) {
|
|
9
9
|
let f = null, r = null, c = null, v = null, w = null, k = null, i = null, A = null;
|
|
10
10
|
const F = 1e3 / 30;
|
|
@@ -2,7 +2,7 @@ import { ref as K, shallowRef as je, defineComponent as Be, watch as Z, onMounte
|
|
|
2
2
|
import { u as Ye, a as $e, b as Je, S as j } from "./iconfont-ljBfzBSE.js";
|
|
3
3
|
import { M as Qe, O as Ze, S as en } from "./STLLoader-DmGTF0Nv.js";
|
|
4
4
|
import { v as nn, w as ce, x as ye, y as tn, z as W, F as be, I as O, J as Se, C as G, K as F, b as Y, N as sn, g as rn, D as on, k as Q, V as B, O as an, Q as Ne, R as cn, U as Ie, Y as ln, Z as un, _ as te, $ as dn, a0 as Ce, a1 as fn, a2 as hn, a3 as pn, a4 as le, a5 as Oe, a6 as ue, a7 as mn, a8 as gn, a9 as Tn, aa as se, ab as xn, n as ve, i as Rn, ac as q, ad as En, p as An, ae as Ln, e as ke, af as _n, r as Mn, ag as wn, ah as yn, o as re, P as bn, l as Sn, ai as Nn, aj as In, ak as Cn, al as On, am as vn, an as Fe, ao as kn, ap as me, aq as ge, ar as Te, as as xe, at as Re, au as Fn, av as Pn, B as Pe, aw as Dn, h as Hn } from "./three-viewport-gizmo-BHznJ6W3.js";
|
|
5
|
-
import { E as Ee } from "./index-
|
|
5
|
+
import { E as Ee } from "./index-DV_ZZQBO.js";
|
|
6
6
|
import { _ as Un } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
function Ae(d, n) {
|
|
8
8
|
if (n === nn)
|