ss-component-new 1.2.23 → 1.2.25

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.
Files changed (143) hide show
  1. package/dist/MTLLoader-AqmsmIp6.cjs +6 -0
  2. package/dist/MTLLoader-DJNdEDx2.js +609 -0
  3. package/dist/OrbitControls-Bj5caXhQ.js +419 -0
  4. package/dist/OrbitControls-rTIa-2s-.cjs +1 -0
  5. package/dist/{animationData-Bwh55Xw6.cjs → animationData-Bc9LlHz0.cjs} +1 -1
  6. package/dist/{animationData-D0TJ-9dd.js → animationData-Ca4l4roD.js} +4 -4
  7. package/dist/array-Baxi4C30.cjs +11 -0
  8. package/dist/array-Ca6KqnNx.js +1142 -0
  9. package/dist/{dataUtil-i5X2xhin.cjs → dataUtil-Cg2dZbrV.cjs} +1 -1
  10. package/dist/{dataUtil-gEKo7CEq.js → dataUtil-DUI9Vz64.js} +2 -2
  11. package/dist/{fileUtil-GIRXMs25.cjs → fileUtil-CTTbs0aJ.cjs} +1 -1
  12. package/dist/{fileUtil-CN00xr9W.js → fileUtil-CWt--rV-.js} +1 -1
  13. package/dist/{iconfont-C9-pGpAJ.cjs → iconfont-BaUxcJrk.cjs} +1 -1
  14. package/dist/{iconfont-DTSZW2AU.js → iconfont-D886hAXy.js} +2 -2
  15. package/dist/icons/svg//345/215/225/345/205/203/345/272/223.svg +1 -0
  16. package/dist/icons/svg//346/250/241/345/236/213/347/256/241/347/220/206.svg +1 -0
  17. package/dist/icons/svg//346/265/201/347/250/213/345/272/223.svg +1 -0
  18. package/dist/icons/svg//347/225/214/351/235/242/344/277/256/346/224/271.svg +1 -0
  19. package/dist/{index-BOJUyAaV.cjs → index-1z9RrjZc.cjs} +1 -1
  20. package/dist/{index-DSlPg3dk.cjs → index-9wWF5fgR.cjs} +1 -1
  21. package/dist/index-B-I7BsZI.js +2570 -0
  22. package/dist/{index-CqYUVCh5.js → index-B-p8m73c.js} +12 -12
  23. package/dist/{index-CK54pscx.cjs → index-B1qlTlfX.cjs} +1 -1
  24. package/dist/{index-BD5yZDAq.js → index-B5iT5NR0.js} +2 -2
  25. package/dist/{index-BkIFY0hK.cjs → index-B8MyAHnT.cjs} +1 -1
  26. package/dist/{index-7oJ8Ile4.js → index-BLW6fsom.js} +1 -1
  27. package/dist/{index-DbCNaQ87.cjs → index-BMK703KG.cjs} +1 -1
  28. package/dist/{index-eH9RMVXv.cjs → index-BNYCmfv9.cjs} +1 -1
  29. package/dist/{index-ThNNBX7h.js → index-BQkk6yoU.js} +1 -1
  30. package/dist/index-BQq7Cw_K.cjs +1 -0
  31. package/dist/{index-pmcRbjPd.cjs → index-BZENxsjL.cjs} +1 -1
  32. package/dist/{index-BNYeBPmi.cjs → index-BZoOaP9C.cjs} +1 -1
  33. package/dist/{index-G_cKl_J4.js → index-B_jnPuBE.js} +275 -270
  34. package/dist/{index-XXKsLOYd.js → index-Bke5IOmW.js} +2 -2
  35. package/dist/{index-DrWIUUZK.cjs → index-BtfS9ULE.cjs} +1 -1
  36. package/dist/{index-CvC2498b.js → index-BuLPXgWU.js} +5 -5
  37. package/dist/index-BxXOWAHT.cjs +1 -0
  38. package/dist/{index-2fqHNrPg.js → index-C8OFJprL.js} +4 -4
  39. package/dist/{index-CtXpoEg0.cjs → index-C9OPT3q5.cjs} +1 -1
  40. package/dist/{index-D8Y3imz9.cjs → index-CEV2ULrI.cjs} +1 -1
  41. package/dist/{index-BTTpV9o2.js → index-CTRrKUtw.js} +14 -14
  42. package/dist/{index-CptCatmL.js → index-CYmHP5Ky.js} +48 -32
  43. package/dist/{index-Dfwm0xPp.cjs → index-Cb0d2cT8.cjs} +1 -1
  44. package/dist/{index-Cl6HMOao.js → index-CeeMzEXY.js} +1 -1
  45. package/dist/{index-tttYIzsn.cjs → index-CjI5pDiU.cjs} +1 -1
  46. package/dist/{index-DEs8s152.js → index-CmUjrEkz.js} +6 -6
  47. package/dist/index-CtE7IIJq.js +7297 -0
  48. package/dist/{index-DSchKIyh.cjs → index-CxnH4vfV.cjs} +1 -1
  49. package/dist/index-CyY9deE5.cjs +1 -0
  50. package/dist/{index-DlIkbsRf.js → index-Cyk3pWtk.js} +6 -6
  51. package/dist/index-D-eD7QhS.js +654 -0
  52. package/dist/{index-NlkdTb--.js → index-D0odjY-X.js} +4 -4
  53. package/dist/{index-B0dydZDW.js → index-D1cjMjid.js} +1 -1
  54. package/dist/index-D5gT6DCZ.cjs +1 -0
  55. package/dist/{index-CvrBt7bU.js → index-D7GiDyDn.js} +6 -6
  56. package/dist/index-D88kGgy-.cjs +1 -0
  57. package/dist/{index-DMbCaqEC.cjs → index-DEExEFRs.cjs} +13 -13
  58. package/dist/{index-DllJulGH.cjs → index-DFMKBytS.cjs} +1 -1
  59. package/dist/{index-Dm_WlV6R.js → index-DNe_JGg0.js} +1 -1
  60. package/dist/{index-Bvk4OpkL.js → index-DTCPY-4V.js} +2 -2
  61. package/dist/{index-BTfg83yY.cjs → index-DTuCopl-.cjs} +1 -1
  62. package/dist/{index-BwEfrokO.js → index-DVSVJAdn.js} +2 -2
  63. package/dist/{index-7Ru3e632.cjs → index-DYr8VySV.cjs} +1 -1
  64. package/dist/{index-BQBxzTyE.js → index-DkA_gjlb.js} +2 -2
  65. package/dist/{index-7gU0r1We.cjs → index-Dkoh6zZr.cjs} +1 -1
  66. package/dist/{index-DNs9XPOG.js → index-DpE6q48b.js} +2 -2
  67. package/dist/{index-BVFL7Z_0.js → index-DqAAn-WP.js} +5 -5
  68. package/dist/{index-DHp714Ep.cjs → index-DrgssxCP.cjs} +1 -1
  69. package/dist/{index-Bt2MaT2G.js → index-J98IKvqx.js} +6 -6
  70. package/dist/{index-C6C5VWbs.cjs → index-PNi4RMPc.cjs} +1 -1
  71. package/dist/index-XXEzSATd.js +158 -0
  72. package/dist/{index-CADH_aSQ.cjs → index-clFmHtGU.cjs} +1 -1
  73. package/dist/{index-Be1LJMUR.js → index-pFuDv6dx.js} +2 -2
  74. package/dist/{index-BuSsSHAY.js → index-sk7jYyaG.js} +2301 -2282
  75. package/dist/{index-DQ3y1xkr.cjs → index-vmURlfDn.cjs} +1 -1
  76. package/dist/{index-BXEOQo2c.cjs → index-yyc7_nsV.cjs} +1 -1
  77. package/dist/index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BCjeeJqj.cjs +5675 -0
  78. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CtycIAIT.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-aFJhRTyx.js} +41519 -48931
  79. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-De0avjy5.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-Dv39W1q4.js} +6 -6
  80. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DhMDLOg8.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-OXHjy9ED.cjs} +1 -1
  81. package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-C4gG2WxT.cjs +56 -0
  82. package/dist/{index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-CEcxaThh.js → index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-CEIVtyL9.js} +10702 -10654
  83. package/dist/index.vue_vue_type_style_index_1_lang-D0ileuYo.cjs +32 -0
  84. package/dist/index.vue_vue_type_style_index_1_lang-DOP0uVOd.cjs +5 -0
  85. package/dist/index.vue_vue_type_style_index_1_lang-DSKzPKLD.js +8262 -0
  86. package/dist/{index.vue_vue_type_style_index_1_lang-DzZEPkuk.js → index.vue_vue_type_style_index_1_lang-DkkdpQbZ.js} +1368 -1456
  87. package/dist/{isString-CELwppr9.cjs → isString-BmAegMGI.cjs} +1 -1
  88. package/dist/{isString-DvY0kl3S.js → isString-CohCsKzS.js} +1 -1
  89. package/dist/{main-DQXqHTYg.js → main-B4gwcsBp.js} +5 -5
  90. package/dist/{main-yiUkyrA7.cjs → main-HIDJ5ncj.cjs} +1 -1
  91. package/dist/ss-component.cjs +1 -1
  92. package/dist/ss-component.css +2 -2
  93. package/dist/ss-component.js +11 -11
  94. package/dist/ss-component2.cjs +1 -1
  95. package/dist/ss-component2.js +12 -12
  96. package/dist/{threeModel-BiWZCOOI.js → threeModel-LJMbJaUb.js} +5 -5
  97. package/dist/{threeModel-Cva5i9Dy.cjs → threeModel-tRhkTPHD.cjs} +1 -1
  98. package/dist/threePreview-CeCm5KTT.cjs +1 -0
  99. package/dist/{threePreview-CjFKHY3_.js → threePreview-CqWnM1XW.js} +442 -541
  100. package/dist/{threeSceneView-DM8uof_D.cjs → threeSceneView-CTChIfwR.cjs} +1 -1
  101. package/dist/{threeSceneView-DPTQ_xR-.js → threeSceneView-D2mX_5N9.js} +11 -11
  102. package/dist/{threeSceneViewForCPMPIP-D5jl1r-h.cjs → threeSceneViewForCPMPIP-C_MBwi1O.cjs} +1 -1
  103. package/dist/{threeSceneViewForCPMPIP-Bqb44i-c.js → threeSceneViewForCPMPIP-CpVcogbP.js} +10 -10
  104. package/dist/{threeTrackPathView-BvxoafSz.js → threeTrackPathView-DMTpRQTP.js} +172 -354
  105. package/dist/threeTrackPathView-Deim_dX7.cjs +371 -0
  106. package/dist/threeViewerHost-BMrWNnGK.cjs +1 -0
  107. package/dist/{threeViewerHost-CKmZPGir.js → threeViewerHost-WXqI_L3g.js} +91 -78
  108. package/dist/{urdfTree-BxuavyNQ.js → urdfTree-BX92weHU.js} +1 -1
  109. package/dist/{urdfTree-wR2vnG4s.cjs → urdfTree-CbDb_7PZ.cjs} +1 -1
  110. package/dist/{workpieceTreePanel-C2BXrv3k.cjs → workpieceTreePanel-CbTolK6t.cjs} +1 -1
  111. package/dist/{workpieceTreePanel-CSKzSdIt.js → workpieceTreePanel-Q4S9btz3.js} +18 -18
  112. package/package.json +1 -1
  113. package/public/icons/svg//345/215/225/345/205/203/345/272/223.svg +1 -0
  114. package/public/icons/svg//346/250/241/345/236/213/347/256/241/347/220/206.svg +1 -0
  115. package/public/icons/svg//346/265/201/347/250/213/345/272/223.svg +1 -0
  116. package/public/icons/svg//347/225/214/351/235/242/344/277/256/346/224/271.svg +1 -0
  117. package/dist/MTLLoader-B8MnfNfT.cjs +0 -6
  118. package/dist/MTLLoader-BD3cbBAW.js +0 -657
  119. package/dist/OrbitControls-2UHRU9Fu.cjs +0 -1
  120. package/dist/OrbitControls-D1pz0uFI.js +0 -458
  121. package/dist/array-DMPAgNcb.cjs +0 -11
  122. package/dist/array-DTXrs6ZK.js +0 -1207
  123. package/dist/index-BLwwxnzs.cjs +0 -1
  124. package/dist/index-BVdolwlx.js +0 -7293
  125. package/dist/index-Bm3FE_ss.js +0 -504
  126. package/dist/index-BpTrDbkf.js +0 -22
  127. package/dist/index-C54wX50t.cjs +0 -1
  128. package/dist/index-CFriKZ-T.cjs +0 -1
  129. package/dist/index-CsOz5vsv.cjs +0 -1
  130. package/dist/index-D4pN9YmB.js +0 -144
  131. package/dist/index-DOhvzke2.js +0 -24
  132. package/dist/index-DPX3w6cO.js +0 -2643
  133. package/dist/index-DR9beXhk.cjs +0 -1
  134. package/dist/index-Do8zI4DM.cjs +0 -1
  135. package/dist/index-dwX_BHyo.cjs +0 -1
  136. package/dist/index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-D6X3fCNs.cjs +0 -5677
  137. package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-DLuOs1IZ.cjs +0 -56
  138. package/dist/index.vue_vue_type_style_index_1_lang-B0l6QIWy.js +0 -7806
  139. package/dist/index.vue_vue_type_style_index_1_lang-CC1o5rIu.cjs +0 -32
  140. package/dist/index.vue_vue_type_style_index_1_lang-Chzrrthw.cjs +0 -6
  141. package/dist/threePreview-BNvDY6xx.cjs +0 -1
  142. package/dist/threeTrackPathView-DgnuPrBe.cjs +0 -370
  143. package/dist/threeViewerHost-D80V4Cfh.cjs +0 -1
@@ -0,0 +1,371 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),D=require("./iconfont-BaUxcJrk.cjs"),s=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BCjeeJqj.cjs"),ge=require("./fileUtil-CTTbs0aJ.cjs"),ye=require("./index-1z9RrjZc.cjs"),Z=require("./urdfTree-CbDb_7PZ.cjs"),v=require("./svgIcon-CUM54R6L.cjs"),we=require("./isString-BmAegMGI.cjs"),Se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),J=new s.Box3,R=new s.Vector3;class ie extends s.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],o=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(o),this.setAttribute("position",new s.Float32BufferAttribute(e,3)),this.setAttribute("uv",new s.Float32BufferAttribute(i,2))}applyMatrix4(e){const i=this.attributes.instanceStart,o=this.attributes.instanceEnd;return i!==void 0&&(i.applyMatrix4(e),o.applyMatrix4(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new s.InstancedInterleavedBuffer(i,6,1);return this.setAttribute("instanceStart",new s.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceEnd",new s.InterleavedBufferAttribute(o,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new s.InstancedInterleavedBuffer(i,6,1);return this.setAttribute("instanceColorStart",new s.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceColorEnd",new s.InterleavedBufferAttribute(o,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new s.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const i=e.geometry;return this.setPositions(i.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new s.Box3);const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;e!==void 0&&i!==void 0&&(this.boundingBox.setFromBufferAttribute(e),J.setFromBufferAttribute(i),this.boundingBox.union(J))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new s.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;if(e!==void 0&&i!==void 0){const o=this.boundingSphere.center;this.boundingBox.getCenter(o);let n=0;for(let c=0,d=e.count;c<d;c++)R.fromBufferAttribute(e,c),n=Math.max(n,o.distanceToSquared(R)),R.fromBufferAttribute(i,c),n=Math.max(n,o.distanceToSquared(R));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}s.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new s.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};s.ShaderLib.line={uniforms:s.UniformsUtils.merge([s.UniformsLib.common,s.UniformsLib.fog,s.UniformsLib.line]),vertexShader:`
2
+ #include <common>
3
+ #include <color_pars_vertex>
4
+ #include <fog_pars_vertex>
5
+ #include <logdepthbuf_pars_vertex>
6
+ #include <clipping_planes_pars_vertex>
7
+
8
+ uniform float linewidth;
9
+ uniform vec2 resolution;
10
+
11
+ attribute vec3 instanceStart;
12
+ attribute vec3 instanceEnd;
13
+
14
+ attribute vec3 instanceColorStart;
15
+ attribute vec3 instanceColorEnd;
16
+
17
+ #ifdef WORLD_UNITS
18
+
19
+ varying vec4 worldPos;
20
+ varying vec3 worldStart;
21
+ varying vec3 worldEnd;
22
+
23
+ #ifdef USE_DASH
24
+
25
+ varying vec2 vUv;
26
+
27
+ #endif
28
+
29
+ #else
30
+
31
+ varying vec2 vUv;
32
+
33
+ #endif
34
+
35
+ #ifdef USE_DASH
36
+
37
+ uniform float dashScale;
38
+ attribute float instanceDistanceStart;
39
+ attribute float instanceDistanceEnd;
40
+ varying float vLineDistance;
41
+
42
+ #endif
43
+
44
+ void trimSegment( const in vec4 start, inout vec4 end ) {
45
+
46
+ // trim end segment so it terminates between the camera plane and the near plane
47
+
48
+ // conservative estimate of the near plane
49
+ float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
50
+ float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
51
+ float nearEstimate = - 0.5 * b / a;
52
+
53
+ float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
54
+
55
+ end.xyz = mix( start.xyz, end.xyz, alpha );
56
+
57
+ }
58
+
59
+ void main() {
60
+
61
+ #ifdef USE_COLOR
62
+
63
+ vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
64
+
65
+ #endif
66
+
67
+ #ifdef USE_DASH
68
+
69
+ vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
70
+ vUv = uv;
71
+
72
+ #endif
73
+
74
+ float aspect = resolution.x / resolution.y;
75
+
76
+ // camera space
77
+ vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
78
+ vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
79
+
80
+ #ifdef WORLD_UNITS
81
+
82
+ worldStart = start.xyz;
83
+ worldEnd = end.xyz;
84
+
85
+ #else
86
+
87
+ vUv = uv;
88
+
89
+ #endif
90
+
91
+ // special case for perspective projection, and segments that terminate either in, or behind, the camera plane
92
+ // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
93
+ // but we need to perform ndc-space calculations in the shader, so we must address this issue directly
94
+ // perhaps there is a more elegant solution -- WestLangley
95
+
96
+ bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
97
+
98
+ if ( perspective ) {
99
+
100
+ if ( start.z < 0.0 && end.z >= 0.0 ) {
101
+
102
+ trimSegment( start, end );
103
+
104
+ } else if ( end.z < 0.0 && start.z >= 0.0 ) {
105
+
106
+ trimSegment( end, start );
107
+
108
+ }
109
+
110
+ }
111
+
112
+ // clip space
113
+ vec4 clipStart = projectionMatrix * start;
114
+ vec4 clipEnd = projectionMatrix * end;
115
+
116
+ // ndc space
117
+ vec3 ndcStart = clipStart.xyz / clipStart.w;
118
+ vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
119
+
120
+ // direction
121
+ vec2 dir = ndcEnd.xy - ndcStart.xy;
122
+
123
+ // account for clip-space aspect ratio
124
+ dir.x *= aspect;
125
+ dir = normalize( dir );
126
+
127
+ #ifdef WORLD_UNITS
128
+
129
+ vec3 worldDir = normalize( end.xyz - start.xyz );
130
+ vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );
131
+ vec3 worldUp = normalize( cross( worldDir, tmpFwd ) );
132
+ vec3 worldFwd = cross( worldDir, worldUp );
133
+ worldPos = position.y < 0.5 ? start: end;
134
+
135
+ // height offset
136
+ float hw = linewidth * 0.5;
137
+ worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;
138
+
139
+ // don't extend the line if we're rendering dashes because we
140
+ // won't be rendering the endcaps
141
+ #ifndef USE_DASH
142
+
143
+ // cap extension
144
+ worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;
145
+
146
+ // add width to the box
147
+ worldPos.xyz += worldFwd * hw;
148
+
149
+ // endcaps
150
+ if ( position.y > 1.0 || position.y < 0.0 ) {
151
+
152
+ worldPos.xyz -= worldFwd * 2.0 * hw;
153
+
154
+ }
155
+
156
+ #endif
157
+
158
+ // project the worldpos
159
+ vec4 clip = projectionMatrix * worldPos;
160
+
161
+ // shift the depth of the projected points so the line
162
+ // segments overlap neatly
163
+ vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
164
+ clip.z = clipPose.z * clip.w;
165
+
166
+ #else
167
+
168
+ vec2 offset = vec2( dir.y, - dir.x );
169
+ // undo aspect ratio adjustment
170
+ dir.x /= aspect;
171
+ offset.x /= aspect;
172
+
173
+ // sign flip
174
+ if ( position.x < 0.0 ) offset *= - 1.0;
175
+
176
+ // endcaps
177
+ if ( position.y < 0.0 ) {
178
+
179
+ offset += - dir;
180
+
181
+ } else if ( position.y > 1.0 ) {
182
+
183
+ offset += dir;
184
+
185
+ }
186
+
187
+ // adjust for linewidth
188
+ offset *= linewidth;
189
+
190
+ // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
191
+ offset /= resolution.y;
192
+
193
+ // select end
194
+ vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
195
+
196
+ // back to clip space
197
+ offset *= clip.w;
198
+
199
+ clip.xy += offset;
200
+
201
+ #endif
202
+
203
+ gl_Position = clip;
204
+
205
+ vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
206
+
207
+ #include <logdepthbuf_vertex>
208
+ #include <clipping_planes_vertex>
209
+ #include <fog_vertex>
210
+
211
+ }
212
+ `,fragmentShader:`
213
+ uniform vec3 diffuse;
214
+ uniform float opacity;
215
+ uniform float linewidth;
216
+
217
+ #ifdef USE_DASH
218
+
219
+ uniform float dashOffset;
220
+ uniform float dashSize;
221
+ uniform float gapSize;
222
+
223
+ #endif
224
+
225
+ varying float vLineDistance;
226
+
227
+ #ifdef WORLD_UNITS
228
+
229
+ varying vec4 worldPos;
230
+ varying vec3 worldStart;
231
+ varying vec3 worldEnd;
232
+
233
+ #ifdef USE_DASH
234
+
235
+ varying vec2 vUv;
236
+
237
+ #endif
238
+
239
+ #else
240
+
241
+ varying vec2 vUv;
242
+
243
+ #endif
244
+
245
+ #include <common>
246
+ #include <color_pars_fragment>
247
+ #include <fog_pars_fragment>
248
+ #include <logdepthbuf_pars_fragment>
249
+ #include <clipping_planes_pars_fragment>
250
+
251
+ vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
252
+
253
+ float mua;
254
+ float mub;
255
+
256
+ vec3 p13 = p1 - p3;
257
+ vec3 p43 = p4 - p3;
258
+
259
+ vec3 p21 = p2 - p1;
260
+
261
+ float d1343 = dot( p13, p43 );
262
+ float d4321 = dot( p43, p21 );
263
+ float d1321 = dot( p13, p21 );
264
+ float d4343 = dot( p43, p43 );
265
+ float d2121 = dot( p21, p21 );
266
+
267
+ float denom = d2121 * d4343 - d4321 * d4321;
268
+
269
+ float numer = d1343 * d4321 - d1321 * d4343;
270
+
271
+ mua = numer / denom;
272
+ mua = clamp( mua, 0.0, 1.0 );
273
+ mub = ( d1343 + d4321 * ( mua ) ) / d4343;
274
+ mub = clamp( mub, 0.0, 1.0 );
275
+
276
+ return vec2( mua, mub );
277
+
278
+ }
279
+
280
+ void main() {
281
+
282
+ #include <clipping_planes_fragment>
283
+
284
+ #ifdef USE_DASH
285
+
286
+ if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
287
+
288
+ if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
289
+
290
+ #endif
291
+
292
+ float alpha = opacity;
293
+
294
+ #ifdef WORLD_UNITS
295
+
296
+ // Find the closest points on the view ray and the line segment
297
+ vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
298
+ vec3 lineDir = worldEnd - worldStart;
299
+ vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
300
+
301
+ vec3 p1 = worldStart + lineDir * params.x;
302
+ vec3 p2 = rayEnd * params.y;
303
+ vec3 delta = p1 - p2;
304
+ float len = length( delta );
305
+ float norm = len / linewidth;
306
+
307
+ #ifndef USE_DASH
308
+
309
+ #ifdef USE_ALPHA_TO_COVERAGE
310
+
311
+ float dnorm = fwidth( norm );
312
+ alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
313
+
314
+ #else
315
+
316
+ if ( norm > 0.5 ) {
317
+
318
+ discard;
319
+
320
+ }
321
+
322
+ #endif
323
+
324
+ #endif
325
+
326
+ #else
327
+
328
+ #ifdef USE_ALPHA_TO_COVERAGE
329
+
330
+ // artifacts appear on some hardware if a derivative is taken within a conditional
331
+ float a = vUv.x;
332
+ float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
333
+ float len2 = a * a + b * b;
334
+ float dlen = fwidth( len2 );
335
+
336
+ if ( abs( vUv.y ) > 1.0 ) {
337
+
338
+ alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
339
+
340
+ }
341
+
342
+ #else
343
+
344
+ if ( abs( vUv.y ) > 1.0 ) {
345
+
346
+ float a = vUv.x;
347
+ float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
348
+ float len2 = a * a + b * b;
349
+
350
+ if ( len2 > 1.0 ) discard;
351
+
352
+ }
353
+
354
+ #endif
355
+
356
+ #endif
357
+
358
+ vec4 diffuseColor = vec4( diffuse, alpha );
359
+
360
+ #include <logdepthbuf_fragment>
361
+ #include <color_fragment>
362
+
363
+ gl_FragColor = vec4( diffuseColor.rgb, alpha );
364
+
365
+ #include <tonemapping_fragment>
366
+ #include <colorspace_fragment>
367
+ #include <fog_fragment>
368
+ #include <premultiplied_alpha_fragment>
369
+
370
+ }
371
+ `};class q extends s.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:s.UniformsUtils.clone(s.ShaderLib.line.uniforms),vertexShader:s.ShaderLib.line.vertexShader,fragmentShader:s.ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const K=new s.Vector3,Q=new s.Vector3,w=new s.Vector4,S=new s.Vector4,V=new s.Vector4,W=new s.Vector3,H=new s.Matrix4,x=new s.Line3,ee=new s.Vector3,F=new s.Box3,G=new s.Sphere,_=new s.Vector4;let U,A;function te(a,e,i){return _.set(0,0,-e,1).applyMatrix4(a.projectionMatrix),_.multiplyScalar(1/_.w),_.x=A/i.width,_.y=A/i.height,_.applyMatrix4(a.projectionMatrixInverse),_.multiplyScalar(1/_.w),Math.abs(Math.max(_.x,_.y))}function xe(a,e){const i=a.matrixWorld,o=a.geometry,n=o.attributes.instanceStart,c=o.attributes.instanceEnd,d=Math.min(o.instanceCount,n.count);for(let l=0,u=d;l<u;l++){x.start.fromBufferAttribute(n,l),x.end.fromBufferAttribute(c,l),x.applyMatrix4(i);const f=new s.Vector3,m=new s.Vector3;U.distanceSqToSegment(x.start,x.end,m,f),m.distanceTo(f)<A*.5&&e.push({point:m,pointOnLine:f,distance:U.origin.distanceTo(m),object:a,face:null,faceIndex:l,uv:null,uv1:null})}}function be(a,e,i){const o=e.projectionMatrix,c=a.material.resolution,d=a.matrixWorld,l=a.geometry,u=l.attributes.instanceStart,f=l.attributes.instanceEnd,m=Math.min(l.instanceCount,u.count),y=-e.near;U.at(1,V),V.w=1,V.applyMatrix4(e.matrixWorldInverse),V.applyMatrix4(o),V.multiplyScalar(1/V.w),V.x*=c.x/2,V.y*=c.y/2,V.z=0,W.copy(V),H.multiplyMatrices(e.matrixWorldInverse,d);for(let g=0,N=m;g<N;g++){if(w.fromBufferAttribute(u,g),S.fromBufferAttribute(f,g),w.w=1,S.w=1,w.applyMatrix4(H),S.applyMatrix4(H),w.z>y&&S.z>y)continue;if(w.z>y){const C=w.z-S.z,T=(w.z-y)/C;w.lerp(S,T)}else if(S.z>y){const C=S.z-w.z,T=(S.z-y)/C;S.lerp(w,T)}w.applyMatrix4(o),S.applyMatrix4(o),w.multiplyScalar(1/w.w),S.multiplyScalar(1/S.w),w.x*=c.x/2,w.y*=c.y/2,S.x*=c.x/2,S.y*=c.y/2,x.start.copy(w),x.start.z=0,x.end.copy(S),x.end.z=0;const B=x.closestPointToPointParameter(W,!0);x.at(B,ee);const E=s.MathUtils.lerp(w.z,S.z,B),b=E>=-1&&E<=1,I=W.distanceTo(ee)<A*.5;if(b&&I){x.start.fromBufferAttribute(u,g),x.end.fromBufferAttribute(f,g),x.start.applyMatrix4(d),x.end.applyMatrix4(d);const C=new s.Vector3,T=new s.Vector3;U.distanceSqToSegment(x.start,x.end,T,C),i.push({point:T,pointOnLine:C,distance:U.origin.distanceTo(T),object:a,face:null,faceIndex:g,uv:null,uv1:null})}}}class ze extends s.Mesh{constructor(e=new ie,i=new q({color:Math.random()*16777215})){super(e,i),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,i=e.attributes.instanceStart,o=e.attributes.instanceEnd,n=new Float32Array(2*i.count);for(let d=0,l=0,u=i.count;d<u;d++,l+=2)K.fromBufferAttribute(i,d),Q.fromBufferAttribute(o,d),n[l]=l===0?0:n[l-1],n[l+1]=n[l]+K.distanceTo(Q);const c=new s.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new s.InterleavedBufferAttribute(c,1,0)),e.setAttribute("instanceDistanceEnd",new s.InterleavedBufferAttribute(c,1,1)),this}raycast(e,i){const o=this.material.worldUnits,n=e.camera;n===null&&!o&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const c=e.params.Line2!==void 0&&e.params.Line2.threshold||0;U=e.ray;const d=this.matrixWorld,l=this.geometry,u=this.material;A=u.linewidth+c,l.boundingSphere===null&&l.computeBoundingSphere(),G.copy(l.boundingSphere).applyMatrix4(d);let f;if(o)f=A*.5;else{const y=Math.max(n.near,G.distanceToPoint(U.origin));f=te(n,y,u.resolution)}if(G.radius+=f,U.intersectsSphere(G)===!1)return;l.boundingBox===null&&l.computeBoundingBox(),F.copy(l.boundingBox).applyMatrix4(d);let m;if(o)m=A*.5;else{const y=Math.max(n.near,F.distanceToPoint(U.origin));m=te(n,y,u.resolution)}F.expandByScalar(m),U.intersectsBox(F)!==!1&&(o?xe(this,i):be(this,n,i))}}class oe extends ie{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const i=e.length-3,o=new Float32Array(2*i);for(let n=0;n<i;n+=3)o[2*n]=e[n],o[2*n+1]=e[n+1],o[2*n+2]=e[n+2],o[2*n+3]=e[n+3],o[2*n+4]=e[n+4],o[2*n+5]=e[n+5];return super.setPositions(o),this}setColors(e){const i=e.length-3,o=new Float32Array(2*i);for(let n=0;n<i;n+=3)o[2*n]=e[n],o[2*n+1]=e[n+1],o[2*n+2]=e[n+2],o[2*n+3]=e[n+3],o[2*n+4]=e[n+4],o[2*n+5]=e[n+5];return super.setColors(o),this}fromLine(e){const i=e.geometry;return this.setPositions(i.attributes.position.array),this}}class Ee extends ze{constructor(e=new oe,i=new q({color:Math.random()*16777215})){super(e,i),this.isLine2=!0,this.type="Line2"}}function Ce(a){const e=[];return a.forEach(i=>{const[o,n,c]=i.trim().split(/\s+/);e.push(+o,+n,+c)}),e}function ne(a,e,i){switch(a){case"X":e.x=+i||0;break;case"Y":e.y=+i||0;break;case"Z":e.z=+i||0;break}}function Ve(a){const e=[],i=["X","Y","Z"];return a.forEach(o=>{const n={x:0,y:0,z:0},c=o.trim();if(!c)return;let d=null,l="";for(let u=0;u<(c==null?void 0:c.length);u++){const f=c[u],m=i.find(y=>y===f);if(m){d&&ne(d,n,l),l="",d=m;continue}l=l+f}ne(d,n,l),e.push(n.x,n.y,n.z)}),e}async function _e(a){var n,c;const e=(n=a==null?void 0:a.trim())==null?void 0:n.split(/\r?\n/),i=e==null?void 0:e[0],o=(c=i==null?void 0:i.trim())==null?void 0:c.split(/\s+/);if((o==null?void 0:o.length)>=3)return Ce(e);if((o==null?void 0:o.length)===1)return Ve(e)}async function Ue(a){const e=a.trim().split(/\r?\n/),i=[];return e.forEach(o=>{const n=o.trim().split(/\s+/);if(n.length!=3)return;const[c,d,l]=n;i.push(+c,+d,+l)}),i}async function Te(a){const e=a.trim().split(/\r?\n/),i=[];return e.forEach(o=>{const n=o.trim().split(/\s+/);if(n.length!=3)return;const[c,d,l]=n;i.push(+c,+d,+l)}),i}async function Me(a,e){const{isCyd:i,isUv:o,isCpt:n}=e;return o?_e(a):i?Te(a):n?Ue(a):[]}function Ae(a,e){if(!e||e.length<3)return;const{scene:i,camera:o,renderer:n,controls:c}=a();if(!i||!o||!n||!c)return;const d=[];for(let g=0;g<e.length;g+=3)d.push(new s.Vector3(e[g],e[g+1],e[g+2]));const u=new s.CatmullRomCurve3(d,!1,"catmullrom",.5).getPoints(150).flatMap(g=>[g.x,g.y,g.z]),f=new oe;f.setPositions(u);const m=new q({color:55551,linewidth:3,resolution:new s.Vector2(window.innerWidth,window.innerHeight)}),y=new Ee(f,m);return y.name="轨迹路径",i.add(y),y}function Ne(a,e,i,o=4,n=50){let c=1/0,d=-1/0,l=1/0,u=-1/0,f=1/0,m=-1/0;for(let E=0;E<a.length;E+=3){const b=a[E],I=a[E+1],C=a[E+2];c=Math.min(c,b),d=Math.max(d,b),l=Math.min(l,I),u=Math.max(u,I),f=Math.min(f,C),m=Math.max(m,C)}const g=Math.sqrt((d-c)**2+(u-l)**2+(m-f)**2)*.05,N=s.MathUtils.degToRad(e.fov),O=2*Math.tan(N/2)*n,B=g/O*i.domElement.height*(o/4);return Math.max(1,B)}function Be(a){const e=new s.BufferGeometry;e.setAttribute("position",new s.Float32BufferAttribute(a,3));const i=new s.PointsMaterial({color:55551,size:1,sizeAttenuation:!1});return new s.Points(e,i)}function Ie(a,e){if(!e)return;const{scene:i,camera:o,renderer:n,controls:c}=a();if(!i||!o||!n||!c)return;const d=Be(e);d.name="轨迹路径",i.add(d);const l=Ne(e,o,n,.5,50);return d.material.size=l,d}const Le={class:"obj-viewer-container"},Pe={class:"buttonGroup-top"},ke={class:"buttonGroup-topLeft"},De={class:"buttonGroup-left"},Oe={class:"buttonGroup-right"},je={class:"buttonGroup-bottom"},Re={class:"left-panel"},Fe={class:"panel-header"},Ge={class:"panel-body"},We={key:1,class:"clipping-content"},He={class:"radio-group"},qe={class:"radio-label"},$e={class:"radio-label"},Xe={class:"radio-label"},Ye={class:"radio-label"},Ze={class:"right-panel"},Je={class:"panel-header"},Ke={class:"panel-body"},Qe={key:0,class:"loading-overlay"},et=t.defineComponent({__name:"threeTrackPathView",props:{fileUrls:{},threeData:{default:()=>""},trackFileType:{}},emits:["getAnimationData","getThreeData"],setup(a,{emit:e}){const i=e,o=a,n=t.ref(null),c=t.ref(!1),d=t.ref(""),l=t.ref(!1),u=t.ref(""),f=t.ref(!1),m=t.ref(""),y=t.shallowRef(null),g=t.shallowRef(null),{currentModels:N,resetView:O,initThreeJS:B,handleResize:E,getThreeJSObjects:b,cleanup:I,axesHelperVisible:C,toggleAxesVisibility:T}=D.useThreeJS(n),{isAnimating:$,toggleAnimation:re,stopAnimation:se}=D.useAnimation(b,N),{isClipping:ae,activeClippingAxis:z,toggleClipping:le,updateClippingPlanes:M}=D.useClipping(b,N),ce=()=>{T()},P=p=>{l.value=!0,u.value=p,p==="剖面视图"&&!ae.value&&le()},j=p=>{f.value=!0,m.value=p,p==="动画仿真"&&i("getAnimationData")},X=t.ref([]),de=t.computed(()=>{var r;return(r=o.trackFileType)==null?void 0:r.isUv}),ue=t.computed(()=>{var r;return(r=o.trackFileType)==null?void 0:r.isCyd}),fe=t.computed(()=>{var r;return(r=o.trackFileType)==null?void 0:r.isCpt}),pe=t.computed(()=>{const p=o.fileUrls||[];return p==null?void 0:p[0]});let L=null;const Y=()=>{const{scene:p}=b();L&&p&&(D.disposeObj(L,p),L=null)},me=async p=>{const r=await ge.readFileText(p);if(we.isString(r)){X.value=await Me(r,o.trackFileType)||[];const k=X.value;de.value&&(L=Ae(b,k)),(ue.value||fe.value)&&(L=Ie(b,k)),D.frameCameraToMesh(b,L)}};t.watch(()=>pe.value,async p=>{p&&(Y(),await me(p))},{immediate:!0,deep:!0});const he=()=>{B(),window.addEventListener("resize",E);const p=b();g.value=p.scene,g.value&&(g.value.name="CPMPIP")},ve=()=>{window.removeEventListener("resize",E),$.value&&se(),Y(),I()};return t.onMounted(async()=>{try{he()}catch(p){console.error("Three.js 初始化失败:",p),ye.ElMessage.error("渲染引擎初始化失败!")}}),t.onBeforeUnmount(()=>{ve()}),(p,r)=>{const k=t.resolveComponent("el-scrollbar");return t.openBlock(),t.createElementBlock("div",Le,[t.createElementVNode("div",{ref_key:"threejsContainer",ref:n,class:"threejs-container"},null,512),t.createElementVNode("div",Pe,[t.createVNode(v.ThreeSvgIcon,{name:"guanjianjiexi",size:"34"}),t.createVNode(v.ThreeSvgIcon,{name:"guanjiekongzhi",size:"34"}),t.createVNode(v.ThreeSvgIcon,{name:"gongyishengcheng",size:"34"}),t.createVNode(v.ThreeSvgIcon,{name:"buchangshezhi",size:"34"}),t.createVNode(v.ThreeSvgIcon,{name:"shuchujiagongchengxu",size:"34"})]),t.createElementVNode("div",ke,[t.createVNode(v.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:t.unref(O),title:"重置"},null,8,["onClick"]),t.createVNode(v.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大"}),t.createVNode(v.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),t.createVNode(v.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:t.unref(re),title:t.unref($)?"停止动画":"动画视图"},null,8,["onClick","title"]),t.createVNode(v.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:t.unref(C),onClick:ce,title:"显隐坐标轴"},null,8,["active"])]),t.createElementVNode("div",De,[t.renderSlot(p.$slots,"button-left",{switchRightPanel:P},void 0,!0),t.createVNode(v.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:r[0]||(r[0]=h=>P("场景树")),active:l.value&&u.value==="场景树",title:"场景树"},null,8,["active"]),t.createVNode(v.ThreeSvgIcon,{name:"clipping",size:"24",onClick:r[1]||(r[1]=h=>P("剖面视图")),active:l.value&&u.value==="剖面视图",title:"剖面视图"},null,8,["active"]),t.createVNode(v.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",onClick:r[2]||(r[2]=h=>P("场景树3"))}),t.createVNode(v.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",onClick:r[3]||(r[3]=h=>P("场景4"))})]),t.createElementVNode("div",Oe,[t.renderSlot(p.$slots,"button-right",{switchRightPanel:j},void 0,!0),t.createVNode(v.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"}),t.createVNode(v.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:r[4]||(r[4]=h=>j("关节控制")),active:f.value&&m.value==="关节控制",title:"关节控制"},null,8,["active"]),t.createVNode(v.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:r[5]||(r[5]=h=>j("动画仿真")),active:f.value&&m.value==="动画仿真"},null,8,["active"]),t.createVNode(v.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"urdf动画",onClick:r[6]||(r[6]=h=>j("urdf动画")),active:f.value&&m.value==="urdf动画"},null,8,["active"]),t.createVNode(v.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"})]),t.createElementVNode("div",je,[t.createVNode(v.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:r[7]||(r[7]=()=>{})}),t.createVNode(v.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:r[8]||(r[8]=()=>{})}),t.createVNode(v.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:r[9]||(r[9]=()=>{})}),t.createVNode(v.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:r[10]||(r[10]=()=>{})}),t.createVNode(v.ThreeSvgIcon,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:r[11]||(r[11]=()=>{})})]),t.withDirectives(t.createElementVNode("div",Re,[t.createElementVNode("div",Fe,[t.createElementVNode("span",null,t.toDisplayString(u.value),1),t.createElementVNode("span",{class:"close",onClick:r[12]||(r[12]=h=>l.value=!1)}," X ")]),t.createElementVNode("div",Ge,[t.createVNode(k,{height:"100%"},{default:t.withCtx(()=>[u.value==="场景树"?(t.openBlock(),t.createBlock(Z.UrdfTree,{key:0,model:y.value},null,8,["model"])):t.createCommentVNode("",!0),u.value==="剖面视图"?(t.openBlock(),t.createElementBlock("div",We,[t.createElementVNode("div",He,[t.createElementVNode("label",qe,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":r[13]||(r[13]=h=>t.isRef(z)?z.value=h:null),onChange:r[14]||(r[14]=(...h)=>t.unref(M)&&t.unref(M)(...h))},null,544),[[t.vModelRadio,t.unref(z)]]),r[22]||(r[22]=t.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),t.createElementVNode("label",$e,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":r[15]||(r[15]=h=>t.isRef(z)?z.value=h:null),onChange:r[16]||(r[16]=(...h)=>t.unref(M)&&t.unref(M)(...h))},null,544),[[t.vModelRadio,t.unref(z)]]),r[23]||(r[23]=t.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),t.createElementVNode("label",Xe,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":r[17]||(r[17]=h=>t.isRef(z)?z.value=h:null),onChange:r[18]||(r[18]=(...h)=>t.unref(M)&&t.unref(M)(...h))},null,544),[[t.vModelRadio,t.unref(z)]]),r[24]||(r[24]=t.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),t.createElementVNode("label",Ye,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":r[19]||(r[19]=h=>t.isRef(z)?z.value=h:null),onChange:r[20]||(r[20]=(...h)=>t.unref(M)&&t.unref(M)(...h))},null,544),[[t.vModelRadio,t.unref(z)]]),r[25]||(r[25]=t.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):t.createCommentVNode("",!0)]),_:1})])],512),[[t.vShow,l.value]]),t.withDirectives(t.createElementVNode("div",Ze,[t.createElementVNode("div",Je,[t.createElementVNode("span",null,t.toDisplayString(m.value),1),t.createElementVNode("span",{class:"close",onClick:r[21]||(r[21]=h=>f.value=!1)}," X ")]),t.createElementVNode("div",Ke,[t.createVNode(k,{height:"100%"},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(Z.JointPanel,{model:y.value},null,8,["model"]),[[t.vShow,m.value==="关节控制"]])]),_:1})])],512),[[t.vShow,f.value]]),c.value?(t.openBlock(),t.createElementBlock("div",Qe,[r[26]||(r[26]=t.createElementVNode("div",{class:"loading-spinner"},null,-1)),t.createElementVNode("p",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0)])}}}),tt=Se._export_sfc(et,[["__scopeId","data-v-c3ad7441"]]);exports.default=tt;
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),f=require("./index-1z9RrjZc.cjs"),A=require("./index.vue_vue_type_style_index_1_lang-D0ileuYo.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BCjeeJqj.cjs");const H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function O(c){const m=sessionStorage.getItem("loginToken")??"123456";return f.service({url:"/api/sysFile/uploadFile",method:"post",data:c,headers:{Authorization:m,"Content-Type":"multipart/form-data"}})}function B(c){const m=sessionStorage.getItem("loginToken")??"123456";return f.service({url:"/api/sysFile/downloadFile",method:"post",data:c,headers:{Authorization:m,Accept:"application/octet-stream"},responseType:"blob"})}function q(c){const m=sessionStorage.getItem("loginToken")??"123456";return f.service({url:"/api/sysFile/uploadFiles",method:"post",data:c,headers:{Authorization:m,"Content-Type":"multipart/form-data"}})}const I=f.defineStore("threeState",{state:()=>({data:{extension:"",url:[],data:{},isThreeScene:!0}}),actions:{setData(c){this.data=c},getData(){return this.data}}});function R(){const c=A.useMenuState(f.pinia),{platform:m}=f.storeToRefs(c),T=I(f.pinia),b=e.computed(()=>{var n;return(n=T==null?void 0:T.data)==null?void 0:n.extension}),p=["uv","cpt","cyd"],y=["urdf"],s=["obj","stl"],o=[...p,...y,...s],F=n=>{if(!C())throw new Error("不是三维系统");T.setData(n)},h=()=>T.getData(),C=()=>m.value==="three",u=n=>{const i=n==null?void 0:n.toLowerCase(),l=i==null?void 0:i.lastIndexOf(".");let v=i;return l>=0&&(v=v==null?void 0:v.slice(l+1)),v},S=n=>{if(!n)return!1;const i=u(n);return o==null?void 0:o.includes(i)};return{getData:h,setData:F,isThreeSystem:C,isUrdf:n=>{if(!n)return!1;const i=u(n);return y==null?void 0:y.includes(i)},isGeneralFile:n=>{if(!n)return!1;const i=u(n);return s==null?void 0:s.includes(i)},isTrackPathFile:n=>{if(!n)return!1;const i=u(n);return p==null?void 0:p.includes(i)},isThreeFile:S,isUseBackdrop:n=>C()&&S(n),initTrackFileType:n=>{if(!n)return{isCpt:!1,isCyd:!1,isUv:!1};const i=u(n),l=p==null?void 0:p.find(k=>k===i);return{isCpt:l==="cpt",isCyd:l==="cyd",isUv:l==="uv"}},getFileExtension:u,extraExtension:b}}const L={class:"top-menu"},x={key:4,class:"loading"},z=e.defineComponent({__name:"threeViewerHost",props:{fileUrls:{default:()=>[]},host:{default:"inline"},extension:{},animationData:{default:()=>({})},width:{default:"100%"},height:{default:"100%"},threeData:{},componentType:{}},emits:["getThreeData"],setup(c,{emit:m}){const T=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneView-CTChIfwR.cjs"))),b=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threePreview-CeCm5KTT.cjs"))),p=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeTrackPathView-Deim_dX7.cjs"))),y=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneViewForCPMPIP-C_MBwi1O.cjs"))),s={ROBOT_SCENE:"robot",LATHE_SCENE:"latheScene",CPMPIP_SCENE:"cpmpip",PREVIEW:"preview"},o=c,F=A.useMenuState(f.pinia),{platName:h}=f.storeToRefs(F),{isGeneralFile:C,isUrdf:u,isTrackPathFile:S,extraExtension:_}=R(),w=e.computed(()=>(o==null?void 0:o.extension)||_.value),P=e.computed(()=>{var t,r;return(r=(t=o==null?void 0:o.threeData)==null?void 0:t.data)==null?void 0:r.trackFileType}),E=e.computed(()=>{var r;if(o.componentType)switch(o.componentType){case"robot":return s.ROBOT_SCENE;case"latheScene":return s.LATHE_SCENE;case"cpmpip":return s.CPMPIP_SCENE;case"preview":return s.PREVIEW}const t=(r=o==null?void 0:o.fileUrls)==null?void 0:r[0];return C(t)?s.PREVIEW:(h==null?void 0:h.value)==="CPMPIP"&&(u(t)||u(w.value))?s.CPMPIP_SCENE:(h==null?void 0:h.value)==="SFRTubeBend"&&(u(t)||u(w.value))?s.ROBOT_SCENE:S(w.value)&&P.value?s.LATHE_SCENE:s.PREVIEW}),D=m,n=e.ref([]),i=e.ref(!1);function l(t){try{const r=new URL(t).pathname,d=r.substring(r.lastIndexOf("/")+1);return decodeURIComponent(d)}catch(r){return console.error("无法解析URL以提取文件名:",t,r),"未知文件名"}}async function v(t){let r,d;if(/^https?:\/\//.test(t))try{const a=await fetch(t);if(!a.ok)throw new Error(`下载文件失败: ${a.statusText} (URL: ${t})`);r=await a.blob(),d=l(t)}catch(a){throw console.error("使用 fetch 下载文件时出错:",a),a}else try{const a=await B({url:t});if(a.status!==200)throw new Error(`下载失败: ${a.status}`);const g=a.headers["content-disposition"];d=k(g)||"无文件名",r=a.data}catch(a){throw console.error("通过 API 下载文件时出错:",a),a}return new File([r],d,{type:r.type})}function k(t){if(!t)return;const r=t.match(/filename\*\s*=\s*([^;]+)/i);if(r){let a=r[1].trim();a=a.replace(/^"(.*)"$/,"$1");const g=a.split("''");if(g.length===2){const M=g[0].toUpperCase(),U=g[1];try{if(M==="UTF-8")return decodeURIComponent(U)}catch{}return U}try{return decodeURIComponent(a)}catch{return a}}const d=t.match(/filename\s*=\s*("?)([^";]+)\1/i);if(d)return d[2].trim()}async function N(t){if(!t||!t.length){n.value=[];return}i.value=!0;try{const r=await Promise.all(t.map(d=>v(d)));n.value=r}catch(r){console.error("文件下载时发生错误:",r),n.value=[]}finally{i.value=!1}}const $=()=>{D("getThreeData")};return e.watch(()=>o.fileUrls,async t=>{await N(t??[])},{immediate:!0,deep:!0}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([o.host==="electron"?"mv-electron":"mv-inline","three-platform"])},[e.createElementVNode("div",L,[e.renderSlot(t.$slots,"top-menu",{},void 0,!0)]),E.value===s.ROBOT_SCENE?(e.openBlock(),e.createBlock(e.unref(T),{key:0,"file-blobs":n.value,"animation-data":t.animationData,onGetThreeData:$,threeData:o.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(t.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(t.$slots,"management-page",{},void 0,!0)]),_:3},8,["file-blobs","animation-data","threeData"])):E.value===s.LATHE_SCENE?(e.openBlock(),e.createBlock(e.unref(p),{key:1,fileUrls:t.fileUrls,threeData:o.threeData,trackFileType:P.value},{"button-left":e.withCtx(()=>[e.renderSlot(t.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(t.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileUrls","threeData","trackFileType"])):E.value===s.CPMPIP_SCENE?(e.openBlock(),e.createBlock(e.unref(y),{key:2,"file-blobs":n.value,threeData:o.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(t.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(t.$slots,"management-page",{},void 0,!0)]),_:3},8,["file-blobs","threeData"])):E.value===s.PREVIEW?(e.openBlock(),e.createBlock(e.unref(b),{key:3,"file-blobs":n.value,"animation-data":t.animationData},{"button-left":e.withCtx(()=>[e.renderSlot(t.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(t.$slots,"management-page",{},void 0,!0)]),_:3},8,["file-blobs","animation-data"])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("div",x," 文件下载中,请稍候... ")):e.createCommentVNode("",!0)],2))}}),V=H._export_sfc(z,[["__scopeId","data-v-a4f0efb1"]]),W=Object.freeze(Object.defineProperty({__proto__:null,default:V},Symbol.toStringTag,{value:"Module"}));exports.ThreeViewerHost=V;exports.downloadAvatarApi=B;exports.threeViewerHost=W;exports.uploadAmountApi=q;exports.uploadFile=O;exports.useThreeState=I;exports.useThreeSystem=R;