ss-component-new 1.2.111 → 1.2.113

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 (97) hide show
  1. package/dist/{MTLLoader-hWX_D7j7.js → MTLLoader-CxvMDUe0.js} +1 -1
  2. package/dist/{MTLLoader-BgOTItOM.cjs → MTLLoader-DGjQiY9j.cjs} +1 -1
  3. package/dist/{OBJLoader-C3tq7BYe.cjs → OBJLoader-DJpc8vUj.cjs} +1 -1
  4. package/dist/{OBJLoader-BukOM4Nu.js → OBJLoader-qAJoaDam.js} +1 -1
  5. package/dist/{OrbitControls-jkIlFyOy.js → OrbitControls-BMEUSilq.js} +1 -1
  6. package/dist/{OrbitControls-DKRnuekm.cjs → OrbitControls-Y0_MwO63.cjs} +1 -1
  7. package/dist/{URDFLoader-VSdgVBcE.js → URDFLoader-DFaB1rOB.js} +97 -97
  8. package/dist/{URDFLoader-CX_gwIob.cjs → URDFLoader-z_OD751c.cjs} +1 -1
  9. package/dist/{animationData-B6OrW5p6.js → animationData-Clde34ha.js} +7 -7
  10. package/dist/{animationData-C7dHVqYg.cjs → animationData-DcdD2uXH.cjs} +1 -1
  11. package/dist/{array-B_QF2OoW.js → array-DdC5qADi.js} +1 -1
  12. package/dist/{array-BgZ91brz.cjs → array-DyI9Z7da.cjs} +1 -1
  13. package/dist/{iconfont-BgB-_U_6.js → iconfont-BXKkx1g6.js} +88 -88
  14. package/dist/iconfont-Bi9FnKuf.cjs +1 -0
  15. package/dist/{index-d_PGJZkK.js → index-4PVKlafX.js} +1 -1
  16. package/dist/{index-CT0ojXx1.cjs → index-6hYePeg5.cjs} +1 -1
  17. package/dist/{index-cgzu94nF.cjs → index-B1DG30Df.cjs} +1 -1
  18. package/dist/{index-azgr74so.js → index-B8eH4yd_.js} +1 -1
  19. package/dist/{index-CUKZC4Nj.js → index-BAvTpFlb.js} +1 -1
  20. package/dist/{index-CbzP4t5J.cjs → index-BDUgsfdc.cjs} +1 -1
  21. package/dist/{index-DkTkLUFp.js → index-BGYM_yzB.js} +1 -1
  22. package/dist/index-BUC9msP6.cjs +1 -0
  23. package/dist/{index-9Bq99VYB.cjs → index-BWdy2G65.cjs} +1 -1
  24. package/dist/{index-BOfis0vA.js → index-BZBOlP5a.js} +3 -3
  25. package/dist/{index-Bx40M9YE.js → index-BfVijxl4.js} +1 -1
  26. package/dist/{index-CcCFQb0J.cjs → index-BgMxvBrj.cjs} +1 -1
  27. package/dist/{index-BheoHyAf.cjs → index-BsyhUS4V.cjs} +1 -1
  28. package/dist/{index-B2-FEPjF.js → index-BxrVd7R_.js} +1 -1
  29. package/dist/{index-BcQjNx-Q.cjs → index-C5pOxrIu.cjs} +1 -1
  30. package/dist/{index-Co-G3YR2.cjs → index-C6VrMmAM.cjs} +1 -1
  31. package/dist/{index-Cyq0NQxD.js → index-CH7VgZsg.js} +4 -4
  32. package/dist/{index-DTM9dTrs.js → index-CKtVnHqz.js} +1 -1
  33. package/dist/{index-D4M6WyOm.js → index-CL-M8PGp.js} +3422 -3421
  34. package/dist/{index-BPP3Oi4x.js → index-CNyI4C5D.js} +4 -4
  35. package/dist/{index-ClqfqYxq.cjs → index-CWUgMjDD.cjs} +1 -1
  36. package/dist/{index-C1XnW8VT.cjs → index-CXPAg3zi.cjs} +1 -1
  37. package/dist/{index-DPGM3-ZE.js → index-Cag9EKDi.js} +9 -9
  38. package/dist/{index-BNGaTEx5.cjs → index-Ce63svvK.cjs} +1 -1
  39. package/dist/{index-Dll9lcYi.js → index-Cfh6xox2.js} +1 -1
  40. package/dist/{index-D-h6ztpZ.cjs → index-CoVIQ7yB.cjs} +1 -1
  41. package/dist/{index-ygHebc1d.js → index-CrLgmQwX.js} +16 -16
  42. package/dist/{index-DaMyMwHq.js → index-Ct7FxVrb.js} +1 -1
  43. package/dist/{index-BKWeM8bu.js → index-D2J4nD2U.js} +3 -3
  44. package/dist/{index-CCixZ8x2.cjs → index-D6gzqbUQ.cjs} +1 -1
  45. package/dist/{index-DQW-r04P.js → index-D7uWgp_G.js} +1 -1
  46. package/dist/{index-Cs6-4hum.js → index-DZ6iK-To.js} +2 -2
  47. package/dist/{index-B_CKxC0N.cjs → index-Ddk7mQP9.cjs} +1 -1
  48. package/dist/{index-DbDdlA5q.js → index-Ddl5YPaT.js} +7 -7
  49. package/dist/{index-BE67ZntN.js → index-Dn7a-X3Y.js} +2 -2
  50. package/dist/index-DnoDETkE.cjs +1 -0
  51. package/dist/{index-9ASTWGRl.cjs → index-DvR7fcc6.cjs} +1 -1
  52. package/dist/{index-i-fwIxhy.cjs → index-Dw15nvpm.cjs} +1 -1
  53. package/dist/{index-DalbUyWu.cjs → index-DyLovBRT.cjs} +1 -1
  54. package/dist/{index-Cjs5dfSY.cjs → index-Md9bylWp.cjs} +1 -1
  55. package/dist/{index-Bnhk2Wum.js → index-OXqTOaYL.js} +1 -1
  56. package/dist/{index-6kcPKvxJ.cjs → index-PGBtNsFS.cjs} +1 -1
  57. package/dist/{index-VMUoElNW.js → index-bNwKGgV2.js} +4 -4
  58. package/dist/{index-Cf1Y1Sze.cjs → index-lOzwjQZi.cjs} +1 -1
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BgpRnb6p.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-D1CNkdop.js} +9 -9
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-cYS0o50W.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DzZjQSCB.cjs} +2 -2
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dgy71NC0.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DV9lk-8w.js} +22 -31
  62. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-o8Cf7V1D.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-D_eVz0Sp.cjs} +149 -149
  63. package/dist/{index.vue_vue_type_style_index_0_scoped_140f5e74_lang-D5E2HyCn.cjs → index.vue_vue_type_style_index_0_scoped_140f5e74_lang-Bo97w4bj.cjs} +1 -1
  64. package/dist/{index.vue_vue_type_style_index_0_scoped_140f5e74_lang-BEM7doEB.js → index.vue_vue_type_style_index_0_scoped_140f5e74_lang-Deyo5lI4.js} +4 -4
  65. package/dist/{index.vue_vue_type_style_index_1_lang-C6g1KtOz.cjs → index.vue_vue_type_style_index_1_lang-BwsR7epS.cjs} +1 -1
  66. package/dist/{index.vue_vue_type_style_index_1_lang-Cqs4qqQV.js → index.vue_vue_type_style_index_1_lang-Duqg1WtV.js} +4 -4
  67. package/dist/{loaderUtil-BFbM8t6R.js → loaderUtil-1wRb28no.js} +1 -1
  68. package/dist/{loaderUtil-DWuLgv1P.cjs → loaderUtil-Cq8QCp9W.cjs} +1 -1
  69. package/dist/{main-BlxcR1aO.js → main-5e5sWLUD.js} +3 -3
  70. package/dist/{main-BIJA7Oyr.cjs → main-CBFpUWMt.cjs} +1 -1
  71. package/dist/ss-component.cjs +1 -1
  72. package/dist/ss-component.css +1 -1
  73. package/dist/ss-component.js +9 -9
  74. package/dist/ss-component2.cjs +1 -1
  75. package/dist/ss-component2.js +10 -10
  76. package/dist/{threeModel-wFgYGhPU.cjs → threeModel-BbUQzHU5.cjs} +1 -1
  77. package/dist/{threeModel-B8-8TvnY.js → threeModel-BqpIaxlN.js} +4 -4
  78. package/dist/{threePreview-vuENkCyX.cjs → threePreview-Aib1ZmEj.cjs} +1 -1
  79. package/dist/{threePreview-BgJvhDAL.js → threePreview-B-BL8PZx.js} +4 -4
  80. package/dist/{threeSceneView-D18FzdLv.js → threeSceneView-BVK89QUf.js} +8 -8
  81. package/dist/{threeSceneView-B7qSJrwR.cjs → threeSceneView-CLF-6z2y.cjs} +1 -1
  82. package/dist/{threeSceneViewForCPMPIP-RT8liwZe.js → threeSceneViewForCPMPIP-BjV_TpZd.js} +7 -7
  83. package/dist/{threeSceneViewForCPMPIP-9yi6jiex.cjs → threeSceneViewForCPMPIP-wW_fS1HP.cjs} +1 -1
  84. package/dist/threeTrackPathView-BwlIgu4k.js +605 -0
  85. package/dist/threeTrackPathView-CjpKhUbd.cjs +1 -0
  86. package/dist/{threeViewerHost-DeU3hwnv.js → threeViewerHost-D3LMGTE2.js} +2 -2
  87. package/dist/{threeViewerHost-LpwVv2oj.cjs → threeViewerHost-EljVz9SK.cjs} +1 -1
  88. package/dist/{urdfTree-DLpxOUSk.js → urdfTree-C1_9e3Ka.js} +1 -1
  89. package/dist/{urdfTree-DE-KsOZc.cjs → urdfTree-W9sGK4ua.cjs} +1 -1
  90. package/dist/{workpieceTreePanel-D2M5yIk2.js → workpieceTreePanel-B5YNWinu.js} +47 -47
  91. package/dist/{workpieceTreePanel-D0Y23OeS.cjs → workpieceTreePanel-DrSgMdW9.cjs} +1 -1
  92. package/package.json +1 -1
  93. package/dist/iconfont-DU9A12zM.cjs +0 -1
  94. package/dist/index-B-6muHKY.cjs +0 -1
  95. package/dist/index-CRIDwb3u.cjs +0 -1
  96. package/dist/threeTrackPathView-DWGdVtPl.js +0 -1458
  97. package/dist/threeTrackPathView-cB27_BKX.cjs +0 -370
@@ -1,370 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),P=require("./iconfont-DU9A12zM.cjs"),l=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-o8Cf7V1D.cjs"),R=require("./index-C8qRkCgn.cjs"),se=require("./urdfTree-DE-KsOZc.cjs"),De=require("./loaderUtil-DWuLgv1P.cjs"),fe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S=require("./svgIcon-CUM54R6L.cjs"),Ie=require("./isString--eJE54G5.cjs"),ae=new l.Box3,j=new l.Vector3;class me extends l.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],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],r=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(r),this.setAttribute("position",new l.Float32BufferAttribute(e,3)),this.setAttribute("uv",new l.Float32BufferAttribute(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,r=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),r.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const r=new l.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new l.InterleavedBufferAttribute(r,3,0)),this.setAttribute("instanceEnd",new l.InterleavedBufferAttribute(r,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const r=new l.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceColorStart",new l.InterleavedBufferAttribute(r,3,0)),this.setAttribute("instanceColorEnd",new l.InterleavedBufferAttribute(r,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 l.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new l.Box3);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),ae.setFromBufferAttribute(t),this.boundingBox.union(ae))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new l.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const r=this.boundingSphere.center;this.boundingBox.getCenter(r);let n=0;for(let s=0,a=e.count;s<a;s++)j.fromBufferAttribute(e,s),n=Math.max(n,r.distanceToSquared(j)),j.fromBufferAttribute(t,s),n=Math.max(n,r.distanceToSquared(j));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(){}}l.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new l.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};l.ShaderLib.line={uniforms:l.UniformsUtils.merge([l.UniformsLib.common,l.UniformsLib.fog,l.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
- float alpha = opacity;
283
- vec4 diffuseColor = vec4( diffuse, alpha );
284
-
285
- #include <clipping_planes_fragment>
286
-
287
- #ifdef USE_DASH
288
-
289
- if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
290
-
291
- if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
292
-
293
- #endif
294
-
295
- #ifdef WORLD_UNITS
296
-
297
- // Find the closest points on the view ray and the line segment
298
- vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
299
- vec3 lineDir = worldEnd - worldStart;
300
- vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
301
-
302
- vec3 p1 = worldStart + lineDir * params.x;
303
- vec3 p2 = rayEnd * params.y;
304
- vec3 delta = p1 - p2;
305
- float len = length( delta );
306
- float norm = len / linewidth;
307
-
308
- #ifndef USE_DASH
309
-
310
- #ifdef USE_ALPHA_TO_COVERAGE
311
-
312
- float dnorm = fwidth( norm );
313
- alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
314
-
315
- #else
316
-
317
- if ( norm > 0.5 ) {
318
-
319
- discard;
320
-
321
- }
322
-
323
- #endif
324
-
325
- #endif
326
-
327
- #else
328
-
329
- #ifdef USE_ALPHA_TO_COVERAGE
330
-
331
- // artifacts appear on some hardware if a derivative is taken within a conditional
332
- float a = vUv.x;
333
- float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
334
- float len2 = a * a + b * b;
335
- float dlen = fwidth( len2 );
336
-
337
- if ( abs( vUv.y ) > 1.0 ) {
338
-
339
- alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
340
-
341
- }
342
-
343
- #else
344
-
345
- if ( abs( vUv.y ) > 1.0 ) {
346
-
347
- float a = vUv.x;
348
- float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
349
- float len2 = a * a + b * b;
350
-
351
- if ( len2 > 1.0 ) discard;
352
-
353
- }
354
-
355
- #endif
356
-
357
- #endif
358
-
359
- #include <logdepthbuf_fragment>
360
- #include <color_fragment>
361
-
362
- gl_FragColor = vec4( diffuseColor.rgb, alpha );
363
-
364
- #include <tonemapping_fragment>
365
- #include <colorspace_fragment>
366
- #include <fog_fragment>
367
- #include <premultiplied_alpha_fragment>
368
-
369
- }
370
- `};class te extends l.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:l.UniformsUtils.clone(l.ShaderLib.line.uniforms),vertexShader:l.ShaderLib.line.vertexShader,fragmentShader:l.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 J=new l.Vector4,le=new l.Vector3,ce=new l.Vector3,x=new l.Vector4,b=new l.Vector4,z=new l.Vector4,Q=new l.Vector3,ee=new l.Matrix4,_=new l.Line3,ue=new l.Vector3,W=new l.Box3,G=new l.Sphere,V=new l.Vector4;let A,D;function de(o,e,t){return V.set(0,0,-e,1).applyMatrix4(o.projectionMatrix),V.multiplyScalar(1/V.w),V.x=D/t.width,V.y=D/t.height,V.applyMatrix4(o.projectionMatrixInverse),V.multiplyScalar(1/V.w),Math.abs(Math.max(V.x,V.y))}function Fe(o,e){const t=o.matrixWorld,r=o.geometry,n=r.attributes.instanceStart,s=r.attributes.instanceEnd,a=Math.min(r.instanceCount,n.count);for(let c=0,f=a;c<f;c++){_.start.fromBufferAttribute(n,c),_.end.fromBufferAttribute(s,c),_.applyMatrix4(t);const d=new l.Vector3,p=new l.Vector3;A.distanceSqToSegment(_.start,_.end,p,d),p.distanceTo(d)<D*.5&&e.push({point:p,pointOnLine:d,distance:A.origin.distanceTo(p),object:o,face:null,faceIndex:c,uv:null,uv1:null})}}function Oe(o,e,t){const r=e.projectionMatrix,s=o.material.resolution,a=o.matrixWorld,c=o.geometry,f=c.attributes.instanceStart,d=c.attributes.instanceEnd,p=Math.min(c.instanceCount,f.count),m=-e.near;A.at(1,z),z.w=1,z.applyMatrix4(e.matrixWorldInverse),z.applyMatrix4(r),z.multiplyScalar(1/z.w),z.x*=s.x/2,z.y*=s.y/2,z.z=0,Q.copy(z),ee.multiplyMatrices(e.matrixWorldInverse,a);for(let v=0,U=p;v<U;v++){if(x.fromBufferAttribute(f,v),b.fromBufferAttribute(d,v),x.w=1,b.w=1,x.applyMatrix4(ee),b.applyMatrix4(ee),x.z>m&&b.z>m)continue;if(x.z>m){const y=x.z-b.z,E=(x.z-m)/y;x.lerp(b,E)}else if(b.z>m){const y=b.z-x.z,E=(b.z-m)/y;b.lerp(x,E)}x.applyMatrix4(r),b.applyMatrix4(r),x.multiplyScalar(1/x.w),b.multiplyScalar(1/b.w),x.x*=s.x/2,x.y*=s.y/2,b.x*=s.x/2,b.y*=s.y/2,_.start.copy(x),_.start.z=0,_.end.copy(b),_.end.z=0;const C=_.closestPointToPointParameter(Q,!0);_.at(C,ue);const g=l.MathUtils.lerp(x.z,b.z,C),L=g>=-1&&g<=1,w=Q.distanceTo(ue)<D*.5;if(L&&w){_.start.fromBufferAttribute(f,v),_.end.fromBufferAttribute(d,v),_.start.applyMatrix4(a),_.end.applyMatrix4(a);const y=new l.Vector3,E=new l.Vector3;A.distanceSqToSegment(_.start,_.end,E,y),t.push({point:E,pointOnLine:y,distance:A.origin.distanceTo(E),object:o,face:null,faceIndex:v,uv:null,uv1:null})}}}class je extends l.Mesh{constructor(e=new me,t=new te({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,n=new Float32Array(2*t.count);for(let a=0,c=0,f=t.count;a<f;a++,c+=2)le.fromBufferAttribute(t,a),ce.fromBufferAttribute(r,a),n[c]=c===0?0:n[c-1],n[c+1]=n[c]+le.distanceTo(ce);const s=new l.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new l.InterleavedBufferAttribute(s,1,0)),e.setAttribute("instanceDistanceEnd",new l.InterleavedBufferAttribute(s,1,1)),this}raycast(e,t){const r=this.material.worldUnits,n=e.camera;n===null&&!r&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const s=e.params.Line2!==void 0&&e.params.Line2.threshold||0;A=e.ray;const a=this.matrixWorld,c=this.geometry,f=this.material;D=f.linewidth+s,c.boundingSphere===null&&c.computeBoundingSphere(),G.copy(c.boundingSphere).applyMatrix4(a);let d;if(r)d=D*.5;else{const m=Math.max(n.near,G.distanceToPoint(A.origin));d=de(n,m,f.resolution)}if(G.radius+=d,A.intersectsSphere(G)===!1)return;c.boundingBox===null&&c.computeBoundingBox(),W.copy(c.boundingBox).applyMatrix4(a);let p;if(r)p=D*.5;else{const m=Math.max(n.near,W.distanceToPoint(A.origin));p=de(n,m,f.resolution)}W.expandByScalar(p),A.intersectsBox(W)!==!1&&(r?Fe(this,t):Oe(this,n,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(J),this.material.uniforms.resolution.value.set(J.z,J.w))}}class pe extends me{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,r=new Float32Array(2*t);for(let n=0;n<t;n+=3)r[2*n]=e[n],r[2*n+1]=e[n+1],r[2*n+2]=e[n+2],r[2*n+3]=e[n+3],r[2*n+4]=e[n+4],r[2*n+5]=e[n+5];return super.setPositions(r),this}setColors(e){const t=e.length-3,r=new Float32Array(2*t);for(let n=0;n<t;n+=3)r[2*n]=e[n],r[2*n+1]=e[n+1],r[2*n+2]=e[n+2],r[2*n+3]=e[n+3],r[2*n+4]=e[n+4],r[2*n+5]=e[n+5];return super.setColors(r),this}setFromPoints(e){const t=e.length-1,r=new Float32Array(6*t);for(let n=0;n<t;n++)r[6*n]=e[n].x,r[6*n+1]=e[n].y,r[6*n+2]=e[n].z||0,r[6*n+3]=e[n+1].x,r[6*n+4]=e[n+1].y,r[6*n+5]=e[n+1].z||0;return super.setPositions(r),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class We extends je{constructor(e=new pe,t=new te({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}async function Ge(o){return await De.loadObjByUrl(o)}function Re(o,e){o.position.copy(e)}function He(o,e,t=new l.Color(16711680)){const r=new l.Vector3;e.getWorldPosition(r);const n=o.geometry.attributes.position,s=o.geometry.attributes.color,a=new l.Color(55551);let c=1/0,f=-1;for(let d=0;d<n.count;d++){const m=new l.Vector3().fromBufferAttribute(n,d).distanceTo(r);m<c&&(c=m,f=d)}for(let d=0;d<s.count;d++)a.toArray(s.array,d*3);if(f!==-1){const d=t.toArray(),p=f*3+2;for(let m=0;m<p;m=m+3)s.array[m]=d[0],s.array[m+1]=d[1],s.array[m+2]=d[2]}s.needsUpdate=!0}function he(o,e,t,r=new l.Color(16711680)){Re(o,e),He(t,o,r)}const qe={class:"panel-content"},$e={class:"animation-controls"},Xe={class:"control-row"},Ye={class:"control-row"},Ze={class:"frame-info"},Ke={class:"control-row"},Je=i.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(o,{expose:e,emit:t}){const r=o,n=i.computed(()=>r.vectors),s=i.ref(!1),a=i.ref(0),c=i.ref(100);let f=!1;const d=w=>`第 ${w+1} 帧`,p=w=>{if(w<0||w>=n.value.length){console.error(`帧索引 ${w} 超出范围`);return}const y=n.value[w];a.value=w,he(r.knife,y,r.cloud)},m=async()=>{if(n.value.length===0){R.ElMessage.error("无法播放动画:无数据");return}if(!s.value){s.value=!0,f=!1,n.value.length-1===a.value&&(a.value=0);try{for(let w=a.value+1;w<n.value.length&&!f;w++)await new Promise(y=>setTimeout(y,c.value)),p(w);f||R.ElMessage.success("动画播放完成")}catch(w){console.error("动画播放出错:",w)}finally{s.value=!1}}},v=()=>{f=!0,s.value=!1,R.ElMessage.info("动画已停止")},U=w=>{s.value&&v(),p(w)},T=()=>{s.value&&v(),!(a.value+1>=n.value.length)&&p(a.value+1)},C=()=>{s.value&&v(),a.value!==0&&p(a.value-1)},g=()=>{a.value=0};return e({playAnimation:m,stopAnimation:v,forwardFrame:T,backwardFrame:C,resetAnimationFrame:g,reset:async()=>{await v(),g()}}),(w,y)=>{const E=i.resolveComponent("el-input-number"),q=i.resolveComponent("el-form-item"),$=i.resolveComponent("el-form"),X=i.resolveComponent("el-slider");return i.openBlock(),i.createElementBlock("div",qe,[i.createElementVNode("div",$e,[i.createElementVNode("div",Xe,[i.createVNode($,{"label-width":"auto",style:{width:"100%"}},{default:i.withCtx(()=>[i.createVNode(q,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:i.withCtx(()=>[i.createVNode(E,{modelValue:c.value,"onUpdate:modelValue":y[0]||(y[0]=I=>c.value=I),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),i.createElementVNode("div",Ye,[y[2]||(y[2]=i.createElementVNode("label",null,"当前帧:",-1)),i.createElementVNode("span",Ze,i.toDisplayString(a.value+1)+" / "+i.toDisplayString(n.value.length),1)]),i.createElementVNode("div",Ke,[y[3]||(y[3]=i.createElementVNode("label",null,"动画进度:",-1)),i.createVNode(X,{modelValue:a.value,"onUpdate:modelValue":y[1]||(y[1]=I=>a.value=I),min:0,max:n.value.length>0?n.value.length-1:0,step:1,"format-tooltip":d,onInput:U,disabled:n.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])])])])}}}),Qe=fe._export_sfc(Je,[["__scopeId","data-v-f6fc7a8c"]]);function et(o){const e=[];return o.forEach(t=>{const[r,n,s]=t.trim().split(/\s+/);e.push(+r,+n,+s)}),e}function H(o,e,t){switch(o){case"X":e.x=+t||0;break;case"Y":e.y=+t||0;break;case"Z":e.z=+t||0;break}}function tt(o){const e=[],t=["X","Y","Z"];return o.forEach(r=>{const n={x:0,y:0,z:0},s=r.trim();if(!s)return;let a=null,c="";for(let f=0;f<(s==null?void 0:s.length);f++){const d=s[f],p=t.find(m=>m===d);if(p){a&&H(a,n,c),c="",a=p;continue}c=c+d}H(a,n,c),e.push(n.x,n.y,n.z)}),e}const nt=o=>o==null?void 0:o.filter(t=>t.includes("=")),it=o=>o.replace(/,/g,""),ot=o=>o==null?void 0:o.map(t=>it(t)),rt=o=>{const e=nt(o);return ot(e)};function st(o){const e=rt(o),t=[];return e.forEach(r=>{var m,v,U,T,C,g;let[n,s,a,c]=r.trim().split(/\s+/);s=(m=s==null?void 0:s.trim)==null?void 0:m.call(s),a=(v=a==null?void 0:a.trim)==null?void 0:v.call(a),c=(U=c==null?void 0:c.trim)==null?void 0:U.call(c);const[,f]=(T=s==null?void 0:s.split)==null?void 0:T.call(s,"="),[,d]=(C=a==null?void 0:a.split)==null?void 0:C.call(a,"="),[,p]=(g=c==null?void 0:c.split)==null?void 0:g.call(c,"=");t.push(+f,+d,+p)}),t}const at=o=>o>="0"&&o<="9",lt=o=>o==="+"||o==="-",ct=o=>o===".";function ut(o){return at(o)||lt(o)||ct(o)}function dt(o){const e=[],t=new Set(["X","Y","Z"]);return o.forEach(r=>{const n={x:0,y:0,z:0},s=r.trim();if(!s)return;let a=null,c="";for(let f=0;f<(s==null?void 0:s.length);f++){const d=s[f],p=t.has(d)?d:null,m=ut(d);if(p||!m){a&&H(a,n,c),a=p,c="";continue}c=c+d}a&&H(a,n,c),e.push(n.x,n.y,n.z)}),e}function ft(o){return o==null?void 0:o.includes("=")}async function mt(o){var n,s;const e=(n=o==null?void 0:o.trim())==null?void 0:n.split(/\r?\n/);if(ft(o))return st(e);const t=e==null?void 0:e[0],r=(s=t==null?void 0:t.trim())==null?void 0:s.split(/\s+/);if((r==null?void 0:r.length)>=3)return et(e);if((r==null?void 0:r.length)===1)return tt(e)}async function pt(o){const e=o.trim().split(/\r?\n/),t=[];return e.forEach(r=>{const n=r.trim().split(/\s+/);if(n.length!=3)return;const[s,a,c]=n;t.push(+s,+a,+c)}),t}async function ht(o){const e=o.trim().split(/\r?\n/),t=[];return e.forEach(r=>{const n=r.trim().split(/\s+/);if(n.length!=3)return;const[s,a,c]=n;t.push(+s,+a,+c)}),t}async function vt(o){let e=o.trim().split(/\r?\n/);return e=e.filter(r=>{const n=r.startsWith("X"),s=r.startsWith("G")&&r.includes("X");return n||s}),dt(e)}async function gt(o,e){const{isCyd:t,isUv:r,isCpt:n,isNc:s}=e;return r?mt(o):t?ht(o):n?pt(o):s?vt(o):[]}function yt(o){const e=[];for(let t=0;t<o.length;t+=3)e.push(new l.Vector3(o[t],o[t+1],o[t+2]));return e}function wt(o,e){if(!e||e.length<3)return;const{scene:t,camera:r,renderer:n,controls:s}=o();if(!t||!r||!n||!s)return;const a=[];for(let v=0;v<e.length;v+=3)a.push(new l.Vector3(e[v],e[v+1],e[v+2]));const f=new l.CatmullRomCurve3(a,!1,"catmullrom",.5).getPoints(150).flatMap(v=>[v.x,v.y,v.z]),d=new pe;d.setPositions(f);const p=new te({color:55551,linewidth:3,resolution:new l.Vector2(window.innerWidth,window.innerHeight)}),m=new We(d,p);return m.name="轨迹路径",t.add(m),m}function xt(o,e,t,r=4,n=50){let s=1/0,a=-1/0,c=1/0,f=-1/0,d=1/0,p=-1/0;for(let g=0;g<o.length;g+=3){const L=o[g],w=o[g+1],y=o[g+2];s=Math.min(s,L),a=Math.max(a,L),c=Math.min(c,w),f=Math.max(f,w),d=Math.min(d,y),p=Math.max(p,y)}const v=Math.sqrt((a-s)**2+(f-c)**2+(p-d)**2)*.05,U=l.MathUtils.degToRad(e.fov),T=2*Math.tan(U/2)*n,C=v/T*t.domElement.height*(r/4);return Math.min(.4,C)}function bt(o){if(o.length%3!==0)return console.error("points array length is not a multiple of 3:",o),null;const e=new l.BufferGeometry;e.setAttribute("position",new l.Float32BufferAttribute(o,3));const t=new Float32Array(o.length);for(let s=0;s<o.length;s+=3)t[s]=0,t[s+1]=.847,t[s+2]=1;e.setAttribute("color",new l.BufferAttribute(t,3));const r=new l.PointsMaterial({vertexColors:!0,size:.4,sizeAttenuation:!0}),n=new l.Points(e,r);return r.needsUpdate=!0,n}function _t(o,e){const t=new l.Box3().setFromArray(e),r=[new l.Vector3(t.min.x,t.min.y,t.min.z),new l.Vector3(t.max.x,t.min.y,t.min.z),new l.Vector3(t.min.x,t.max.y,t.min.z),new l.Vector3(t.min.x,t.min.y,t.max.z),new l.Vector3(t.max.x,t.max.y,t.min.z),new l.Vector3(t.max.x,t.min.y,t.max.z),new l.Vector3(t.min.x,t.max.y,t.max.z),new l.Vector3(t.max.x,t.max.y,t.max.z)];let n=0;for(const s of r)n=Math.max(n,s.distanceTo(o.position));return n}function St(o,e){if(!e)return;const{scene:t,camera:r,renderer:n,controls:s}=o();if(!t||!r||!n||!s)return;const a=bt(e);if(!a)return;a.name="轨迹路径",t.add(a);const c=xt(e,r,n,.1,50);a.material.size=c;const f=_t(r,e);return r.far=f*1.2,r.updateProjectionMatrix(),a}const Ct={class:"obj-viewer-container"},Et={class:"buttonGroup-topLeft"},zt={class:"buttonGroup-left"},Vt={class:"buttonGroup-right"},At={class:"buttonGroup-bottom"},Ut={class:"left-panel"},Tt={class:"panel-header"},Bt={class:"panel-body"},Mt={class:"right-panel"},Lt={class:"panel-header"},Nt={class:"panel-body"},kt={key:0,class:"loading-overlay"},Pt=i.defineComponent({__name:"threeTrackPathView",props:{fileBlobs:{},threeData:{default:()=>""},trackFileType:{}},setup(o){const e=o,t=i.ref(null),r=i.ref(!1),n=i.ref(""),s=i.ref(),a=i.ref(!1),c=i.ref(""),f=i.ref(!1),d=i.ref(""),p=i.shallowRef(null),m=i.shallowRef(null),{currentModels:v,resetView:U,initThreeJS:T,handleResize:C,getThreeJSObjects:g,cleanup:L,setModels:w,setAndFitModels:y,axesHelperVisible:E,toggleAxesVisibility:q,zoomIn:$,zoomOut:X}=P.useThreeJS(t),{isAnimating:I,toggleAnimation:ve,startAnimation:It,stopAnimation:ge}=P.useAnimation(g,v),{isClipping:ye,activeClippingAxis:ne,toggleClipping:we,updateClippingPlanes:xe}=P.useClipping(g,v),be=()=>{q()},_e=u=>{ne.value=u,xe()},Y=u=>{a.value=!0,c.value=u,u==="剖面视图"&&!ye.value&&we()},Z=u=>{f.value=!0,d.value=u},K=i.ref([]),F=i.ref([]),Se=i.computed(()=>{var h;return(h=e.trackFileType)==null?void 0:h.isUv}),Ce=i.computed(()=>{var h;return(h=e.trackFileType)==null?void 0:h.isCyd}),Ee=i.computed(()=>{var h;return(h=e.trackFileType)==null?void 0:h.isCpt}),N=i.computed(()=>{var h;return(h=e.trackFileType)==null?void 0:h.isNc}),ie=i.computed(()=>{const u=e.fileBlobs||[];return u==null?void 0:u[0]});let B=i.shallowRef(),k=i.shallowRef();const ze=()=>{const{scene:u}=g();B.value&&u&&(P.disposeObj(B.value,u),B.value=null)},Ve=()=>{const{scene:u}=g();k.value&&u&&(P.disposeObj(k.value,u),k.value=null)},oe=()=>{ze(),Ve()},Ae=async u=>{const h=URL.createObjectURL(u),O=await l.readFileText(h);if(URL.revokeObjectURL(h),Ie.isString(O)){K.value=await gt(O,e.trackFileType)||[];const M=K.value;Se.value&&(B.value=wt(g,M)),(Ce.value||Ee.value||N.value)&&(B.value=St(g,M))}},Ue=async()=>{var u,h;k.value=await Ge("http://222.92.178.198:55002/CPMPIP/Cut/1_4%20Single%20Flute%20End%20Mill-Cut002.obj"),F.value=yt(K.value),F.value&&F.value.length&&(he(k.value,F.value[0],B.value,new l.Color(16711680)),(h=(u=m.value)==null?void 0:u.add)==null||h.call(u,k.value))},re=async u=>{oe(),await Ae(u),B.value&&P.frameCameraToObject3D(g,B.value),N.value&&Ue()};i.watch(()=>ie.value,async u=>{u&&await re(u)},{immediate:!0,deep:!0});const Te=async()=>{var u;await((u=s==null?void 0:s.value)==null?void 0:u.reset()),await re(ie.value)},Be=()=>{var u;N.value&&((u=s==null?void 0:s.value)==null||u.playAnimation())},Me=()=>{var u;N.value&&((u=s==null?void 0:s.value)==null||u.stopAnimation())},Le=()=>{var u;N.value&&((u=s==null?void 0:s.value)==null||u.forwardFrame())},Ne=()=>{var u;N.value&&((u=s==null?void 0:s.value)==null||u.backwardFrame())},ke=()=>{T(),window.addEventListener("resize",C);const u=g();m.value=u.scene,m.value&&(m.value.name="CPMPIP")},Pe=()=>{window.removeEventListener("resize",C),I.value&&ge(),oe(),L()};return i.onMounted(async()=>{try{ke()}catch(u){console.error("Three.js 初始化失败:",u),R.ElMessage.error("渲染引擎初始化失败!")}}),i.onBeforeUnmount(()=>{Pe()}),(u,h)=>{const O=i.resolveComponent("el-scrollbar");return i.openBlock(),i.createElementBlock("div",Ct,[i.createElementVNode("div",{ref_key:"threejsContainer",ref:t,class:"threejs-container"},null,512),i.createElementVNode("div",Et,[i.createVNode(S.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:Te,title:"重置"}),i.createVNode(S.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:i.unref($)},null,8,["onClick"]),i.createVNode(S.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:i.unref(X)},null,8,["onClick"]),i.createVNode(S.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:i.unref(ve),title:i.unref(I)?"停止动画":"动画视图"},null,8,["onClick","title"]),i.createVNode(S.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:i.unref(E),onClick:be,title:"显隐坐标轴"},null,8,["active"])]),i.createElementVNode("div",zt,[i.renderSlot(u.$slots,"button-left",{switchRightPanel:Y},void 0,!0),i.createVNode(S.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:h[0]||(h[0]=M=>Y("场景树")),active:a.value&&c.value==="场景树",title:"场景树"},null,8,["active"]),i.createVNode(S.ThreeSvgIcon,{name:"clipping",size:"24",onClick:h[1]||(h[1]=M=>Y("剖面视图")),active:a.value&&c.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),i.createElementVNode("div",Vt,[i.renderSlot(u.$slots,"button-right",{switchRightPanel:Z},void 0,!0),i.createVNode(S.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:h[2]||(h[2]=M=>Z("关节控制")),active:f.value&&d.value==="关节控制",title:"关节控制"},null,8,["active"]),i.createVNode(S.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:h[3]||(h[3]=M=>Z("动画仿真")),active:f.value&&d.value==="动画仿真"},null,8,["active"])]),i.createElementVNode("div",At,[i.createVNode(S.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:Ne}),i.createVNode(S.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:Be}),i.createVNode(S.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:Le}),i.createVNode(S.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Me})]),i.withDirectives(i.createElementVNode("div",Ut,[i.createElementVNode("div",Tt,[i.createElementVNode("span",null,i.toDisplayString(c.value),1),i.createElementVNode("span",{class:"close",onClick:h[4]||(h[4]=M=>a.value=!1)}," X ")]),i.createElementVNode("div",Bt,[i.createVNode(O,{height:"100%"},{default:i.withCtx(()=>[c.value==="场景树"?(i.openBlock(),i.createBlock(se.UrdfTree,{key:0,model:p.value},null,8,["model"])):i.createCommentVNode("",!0),c.value==="剖面视图"?(i.openBlock(),i.createBlock(P.ClippingPanel,{key:1,value:i.unref(ne),onChange:_e},null,8,["value"])):i.createCommentVNode("",!0)]),_:1})])],512),[[i.vShow,a.value]]),i.withDirectives(i.createElementVNode("div",Mt,[i.createElementVNode("div",Lt,[i.createElementVNode("span",null,i.toDisplayString(d.value),1),i.createElementVNode("span",{class:"close",onClick:h[5]||(h[5]=M=>f.value=!1)}," X ")]),i.createElementVNode("div",Nt,[i.createVNode(O,{height:"100%"},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(se.JointPanel,{model:p.value},null,8,["model"]),[[i.vShow,d.value==="关节控制"]]),i.withDirectives(i.createVNode(Qe,{ref_key:"animationPanelRef",ref:s,cloud:i.unref(B),knife:i.unref(k),vectors:F.value},null,8,["cloud","knife","vectors"]),[[i.vShow,d.value==="动画仿真"&&N.value]])]),_:1})])],512),[[i.vShow,f.value]]),r.value?(i.openBlock(),i.createElementBlock("div",kt,[h[6]||(h[6]=i.createElementVNode("div",{class:"loading-spinner"},null,-1)),i.createElementVNode("p",null,i.toDisplayString(n.value),1)])):i.createCommentVNode("",!0)])}}}),Dt=fe._export_sfc(Pt,[["__scopeId","data-v-b1ec1b6d"]]);exports.default=Dt;