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,1458 +0,0 @@
1
- import { defineComponent as Be, computed as W, ref as z, resolveComponent as H, createElementBlock as ye, openBlock as $, createElementVNode as h, createVNode as w, withCtx as oe, toDisplayString as X, shallowRef as Y, watch as ut, onMounted as dt, onBeforeUnmount as ft, withDirectives as Z, createCommentVNode as pe, unref as D, renderSlot as Ae, createBlock as Ue, vShow as K } from "vue";
2
- import { u as mt, a as pt, b as ht, C as vt, f as gt, d as Ee } from "./iconfont-BgB-_U_6.js";
3
- import { bO as yt, aZ as we, bP as xe, bG as V, bQ as wt, $ as ae, bN as De, _ as x, bR as xt, bS as te, bT as Fe, bb as Oe, bU as ne, ac as bt, bV as q, bW as _t, al as St, am as je, a1 as se, an as Ct, aN as zt, b2 as At, a$ as Ut, b0 as Et, bX as Mt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dgy71NC0.js";
4
- import { E as ie } from "./index-DIUrwul5.js";
5
- import { U as Lt, J as Pt } from "./urdfTree-DLpxOUSk.js";
6
- import { l as Tt } from "./loaderUtil-BFbM8t6R.js";
7
- import { _ as Ie } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
- import { T as C } from "./svgIcon-D-_fXUBL.js";
9
- import { i as kt } from "./isString-CN3i5s9o.js";
10
- const Me = new ae(), J = new x();
11
- class Ne extends yt {
12
- /**
13
- * Constructs a new line segments geometry.
14
- */
15
- constructor() {
16
- super(), this.isLineSegmentsGeometry = !0, this.type = "LineSegmentsGeometry";
17
- 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], o = [0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5];
18
- this.setIndex(o), this.setAttribute("position", new we(e, 3)), this.setAttribute("uv", new we(t, 2));
19
- }
20
- /**
21
- * Applies the given 4x4 transformation matrix to the geometry.
22
- *
23
- * @param {Matrix4} matrix - The matrix to apply.
24
- * @return {LineSegmentsGeometry} A reference to this instance.
25
- */
26
- applyMatrix4(e) {
27
- const t = this.attributes.instanceStart, o = this.attributes.instanceEnd;
28
- return t !== void 0 && (t.applyMatrix4(e), o.applyMatrix4(e), t.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this;
29
- }
30
- /**
31
- * Sets the given line positions for this geometry. The length must be a multiple of six since
32
- * each line segment is defined by a start end vertex in the pattern `(xyz xyz)`.
33
- *
34
- * @param {Float32Array|Array<number>} array - The position data to set.
35
- * @return {LineSegmentsGeometry} A reference to this geometry.
36
- */
37
- setPositions(e) {
38
- let t;
39
- e instanceof Float32Array ? t = e : Array.isArray(e) && (t = new Float32Array(e));
40
- const o = new xe(t, 6, 1);
41
- return this.setAttribute("instanceStart", new V(o, 3, 0)), this.setAttribute("instanceEnd", new V(o, 3, 3)), this.instanceCount = this.attributes.instanceStart.count, this.computeBoundingBox(), this.computeBoundingSphere(), this;
42
- }
43
- /**
44
- * Sets the given line colors for this geometry. The length must be a multiple of six since
45
- * each line segment is defined by a start end color in the pattern `(rgb rgb)`.
46
- *
47
- * @param {Float32Array|Array<number>} array - The position data to set.
48
- * @return {LineSegmentsGeometry} A reference to this geometry.
49
- */
50
- setColors(e) {
51
- let t;
52
- e instanceof Float32Array ? t = e : Array.isArray(e) && (t = new Float32Array(e));
53
- const o = new xe(t, 6, 1);
54
- return this.setAttribute("instanceColorStart", new V(o, 3, 0)), this.setAttribute("instanceColorEnd", new V(o, 3, 3)), this;
55
- }
56
- /**
57
- * Setups this line segments geometry from the given wireframe geometry.
58
- *
59
- * @param {WireframeGeometry} geometry - The geometry that should be used as a data source for this geometry.
60
- * @return {LineSegmentsGeometry} A reference to this geometry.
61
- */
62
- fromWireframeGeometry(e) {
63
- return this.setPositions(e.attributes.position.array), this;
64
- }
65
- /**
66
- * Setups this line segments geometry from the given edges geometry.
67
- *
68
- * @param {EdgesGeometry} geometry - The geometry that should be used as a data source for this geometry.
69
- * @return {LineSegmentsGeometry} A reference to this geometry.
70
- */
71
- fromEdgesGeometry(e) {
72
- return this.setPositions(e.attributes.position.array), this;
73
- }
74
- /**
75
- * Setups this line segments geometry from the given mesh.
76
- *
77
- * @param {Mesh} mesh - The mesh geometry that should be used as a data source for this geometry.
78
- * @return {LineSegmentsGeometry} A reference to this geometry.
79
- */
80
- fromMesh(e) {
81
- return this.fromWireframeGeometry(new wt(e.geometry)), this;
82
- }
83
- /**
84
- * Setups this line segments geometry from the given line segments.
85
- *
86
- * @param {LineSegments} lineSegments - The line segments that should be used as a data source for this geometry.
87
- * Assumes the source geometry is not using indices.
88
- * @return {LineSegmentsGeometry} A reference to this geometry.
89
- */
90
- fromLineSegments(e) {
91
- const t = e.geometry;
92
- return this.setPositions(t.attributes.position.array), this;
93
- }
94
- computeBoundingBox() {
95
- this.boundingBox === null && (this.boundingBox = new ae());
96
- const e = this.attributes.instanceStart, t = this.attributes.instanceEnd;
97
- e !== void 0 && t !== void 0 && (this.boundingBox.setFromBufferAttribute(e), Me.setFromBufferAttribute(t), this.boundingBox.union(Me));
98
- }
99
- computeBoundingSphere() {
100
- this.boundingSphere === null && (this.boundingSphere = new De()), this.boundingBox === null && this.computeBoundingBox();
101
- const e = this.attributes.instanceStart, t = this.attributes.instanceEnd;
102
- if (e !== void 0 && t !== void 0) {
103
- const o = this.boundingSphere.center;
104
- this.boundingBox.getCenter(o);
105
- let n = 0;
106
- for (let s = 0, r = e.count; s < r; s++)
107
- J.fromBufferAttribute(e, s), n = Math.max(n, o.distanceToSquared(J)), J.fromBufferAttribute(t, s), n = Math.max(n, o.distanceToSquared(J));
108
- 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);
109
- }
110
- }
111
- toJSON() {
112
- }
113
- }
114
- ne.line = {
115
- worldUnits: { value: 1 },
116
- linewidth: { value: 1 },
117
- resolution: { value: new Oe(1, 1) },
118
- dashOffset: { value: 0 },
119
- dashScale: { value: 1 },
120
- dashSize: { value: 1 },
121
- gapSize: { value: 1 }
122
- // todo FIX - maybe change to totalSize
123
- };
124
- te.line = {
125
- uniforms: Fe.merge([
126
- ne.common,
127
- ne.fog,
128
- ne.line
129
- ]),
130
- vertexShader: (
131
- /* glsl */
132
- `
133
- #include <common>
134
- #include <color_pars_vertex>
135
- #include <fog_pars_vertex>
136
- #include <logdepthbuf_pars_vertex>
137
- #include <clipping_planes_pars_vertex>
138
-
139
- uniform float linewidth;
140
- uniform vec2 resolution;
141
-
142
- attribute vec3 instanceStart;
143
- attribute vec3 instanceEnd;
144
-
145
- attribute vec3 instanceColorStart;
146
- attribute vec3 instanceColorEnd;
147
-
148
- #ifdef WORLD_UNITS
149
-
150
- varying vec4 worldPos;
151
- varying vec3 worldStart;
152
- varying vec3 worldEnd;
153
-
154
- #ifdef USE_DASH
155
-
156
- varying vec2 vUv;
157
-
158
- #endif
159
-
160
- #else
161
-
162
- varying vec2 vUv;
163
-
164
- #endif
165
-
166
- #ifdef USE_DASH
167
-
168
- uniform float dashScale;
169
- attribute float instanceDistanceStart;
170
- attribute float instanceDistanceEnd;
171
- varying float vLineDistance;
172
-
173
- #endif
174
-
175
- void trimSegment( const in vec4 start, inout vec4 end ) {
176
-
177
- // trim end segment so it terminates between the camera plane and the near plane
178
-
179
- // conservative estimate of the near plane
180
- float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
181
- float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
182
- float nearEstimate = - 0.5 * b / a;
183
-
184
- float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
185
-
186
- end.xyz = mix( start.xyz, end.xyz, alpha );
187
-
188
- }
189
-
190
- void main() {
191
-
192
- #ifdef USE_COLOR
193
-
194
- vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
195
-
196
- #endif
197
-
198
- #ifdef USE_DASH
199
-
200
- vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
201
- vUv = uv;
202
-
203
- #endif
204
-
205
- float aspect = resolution.x / resolution.y;
206
-
207
- // camera space
208
- vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
209
- vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
210
-
211
- #ifdef WORLD_UNITS
212
-
213
- worldStart = start.xyz;
214
- worldEnd = end.xyz;
215
-
216
- #else
217
-
218
- vUv = uv;
219
-
220
- #endif
221
-
222
- // special case for perspective projection, and segments that terminate either in, or behind, the camera plane
223
- // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
224
- // but we need to perform ndc-space calculations in the shader, so we must address this issue directly
225
- // perhaps there is a more elegant solution -- WestLangley
226
-
227
- bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
228
-
229
- if ( perspective ) {
230
-
231
- if ( start.z < 0.0 && end.z >= 0.0 ) {
232
-
233
- trimSegment( start, end );
234
-
235
- } else if ( end.z < 0.0 && start.z >= 0.0 ) {
236
-
237
- trimSegment( end, start );
238
-
239
- }
240
-
241
- }
242
-
243
- // clip space
244
- vec4 clipStart = projectionMatrix * start;
245
- vec4 clipEnd = projectionMatrix * end;
246
-
247
- // ndc space
248
- vec3 ndcStart = clipStart.xyz / clipStart.w;
249
- vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
250
-
251
- // direction
252
- vec2 dir = ndcEnd.xy - ndcStart.xy;
253
-
254
- // account for clip-space aspect ratio
255
- dir.x *= aspect;
256
- dir = normalize( dir );
257
-
258
- #ifdef WORLD_UNITS
259
-
260
- vec3 worldDir = normalize( end.xyz - start.xyz );
261
- vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );
262
- vec3 worldUp = normalize( cross( worldDir, tmpFwd ) );
263
- vec3 worldFwd = cross( worldDir, worldUp );
264
- worldPos = position.y < 0.5 ? start: end;
265
-
266
- // height offset
267
- float hw = linewidth * 0.5;
268
- worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;
269
-
270
- // don't extend the line if we're rendering dashes because we
271
- // won't be rendering the endcaps
272
- #ifndef USE_DASH
273
-
274
- // cap extension
275
- worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;
276
-
277
- // add width to the box
278
- worldPos.xyz += worldFwd * hw;
279
-
280
- // endcaps
281
- if ( position.y > 1.0 || position.y < 0.0 ) {
282
-
283
- worldPos.xyz -= worldFwd * 2.0 * hw;
284
-
285
- }
286
-
287
- #endif
288
-
289
- // project the worldpos
290
- vec4 clip = projectionMatrix * worldPos;
291
-
292
- // shift the depth of the projected points so the line
293
- // segments overlap neatly
294
- vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
295
- clip.z = clipPose.z * clip.w;
296
-
297
- #else
298
-
299
- vec2 offset = vec2( dir.y, - dir.x );
300
- // undo aspect ratio adjustment
301
- dir.x /= aspect;
302
- offset.x /= aspect;
303
-
304
- // sign flip
305
- if ( position.x < 0.0 ) offset *= - 1.0;
306
-
307
- // endcaps
308
- if ( position.y < 0.0 ) {
309
-
310
- offset += - dir;
311
-
312
- } else if ( position.y > 1.0 ) {
313
-
314
- offset += dir;
315
-
316
- }
317
-
318
- // adjust for linewidth
319
- offset *= linewidth;
320
-
321
- // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
322
- offset /= resolution.y;
323
-
324
- // select end
325
- vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
326
-
327
- // back to clip space
328
- offset *= clip.w;
329
-
330
- clip.xy += offset;
331
-
332
- #endif
333
-
334
- gl_Position = clip;
335
-
336
- vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
337
-
338
- #include <logdepthbuf_vertex>
339
- #include <clipping_planes_vertex>
340
- #include <fog_vertex>
341
-
342
- }
343
- `
344
- ),
345
- fragmentShader: (
346
- /* glsl */
347
- `
348
- uniform vec3 diffuse;
349
- uniform float opacity;
350
- uniform float linewidth;
351
-
352
- #ifdef USE_DASH
353
-
354
- uniform float dashOffset;
355
- uniform float dashSize;
356
- uniform float gapSize;
357
-
358
- #endif
359
-
360
- varying float vLineDistance;
361
-
362
- #ifdef WORLD_UNITS
363
-
364
- varying vec4 worldPos;
365
- varying vec3 worldStart;
366
- varying vec3 worldEnd;
367
-
368
- #ifdef USE_DASH
369
-
370
- varying vec2 vUv;
371
-
372
- #endif
373
-
374
- #else
375
-
376
- varying vec2 vUv;
377
-
378
- #endif
379
-
380
- #include <common>
381
- #include <color_pars_fragment>
382
- #include <fog_pars_fragment>
383
- #include <logdepthbuf_pars_fragment>
384
- #include <clipping_planes_pars_fragment>
385
-
386
- vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
387
-
388
- float mua;
389
- float mub;
390
-
391
- vec3 p13 = p1 - p3;
392
- vec3 p43 = p4 - p3;
393
-
394
- vec3 p21 = p2 - p1;
395
-
396
- float d1343 = dot( p13, p43 );
397
- float d4321 = dot( p43, p21 );
398
- float d1321 = dot( p13, p21 );
399
- float d4343 = dot( p43, p43 );
400
- float d2121 = dot( p21, p21 );
401
-
402
- float denom = d2121 * d4343 - d4321 * d4321;
403
-
404
- float numer = d1343 * d4321 - d1321 * d4343;
405
-
406
- mua = numer / denom;
407
- mua = clamp( mua, 0.0, 1.0 );
408
- mub = ( d1343 + d4321 * ( mua ) ) / d4343;
409
- mub = clamp( mub, 0.0, 1.0 );
410
-
411
- return vec2( mua, mub );
412
-
413
- }
414
-
415
- void main() {
416
-
417
- float alpha = opacity;
418
- vec4 diffuseColor = vec4( diffuse, alpha );
419
-
420
- #include <clipping_planes_fragment>
421
-
422
- #ifdef USE_DASH
423
-
424
- if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
425
-
426
- if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
427
-
428
- #endif
429
-
430
- #ifdef WORLD_UNITS
431
-
432
- // Find the closest points on the view ray and the line segment
433
- vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
434
- vec3 lineDir = worldEnd - worldStart;
435
- vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
436
-
437
- vec3 p1 = worldStart + lineDir * params.x;
438
- vec3 p2 = rayEnd * params.y;
439
- vec3 delta = p1 - p2;
440
- float len = length( delta );
441
- float norm = len / linewidth;
442
-
443
- #ifndef USE_DASH
444
-
445
- #ifdef USE_ALPHA_TO_COVERAGE
446
-
447
- float dnorm = fwidth( norm );
448
- alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
449
-
450
- #else
451
-
452
- if ( norm > 0.5 ) {
453
-
454
- discard;
455
-
456
- }
457
-
458
- #endif
459
-
460
- #endif
461
-
462
- #else
463
-
464
- #ifdef USE_ALPHA_TO_COVERAGE
465
-
466
- // artifacts appear on some hardware if a derivative is taken within a conditional
467
- float a = vUv.x;
468
- float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
469
- float len2 = a * a + b * b;
470
- float dlen = fwidth( len2 );
471
-
472
- if ( abs( vUv.y ) > 1.0 ) {
473
-
474
- alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
475
-
476
- }
477
-
478
- #else
479
-
480
- if ( abs( vUv.y ) > 1.0 ) {
481
-
482
- float a = vUv.x;
483
- float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
484
- float len2 = a * a + b * b;
485
-
486
- if ( len2 > 1.0 ) discard;
487
-
488
- }
489
-
490
- #endif
491
-
492
- #endif
493
-
494
- #include <logdepthbuf_fragment>
495
- #include <color_fragment>
496
-
497
- gl_FragColor = vec4( diffuseColor.rgb, alpha );
498
-
499
- #include <tonemapping_fragment>
500
- #include <colorspace_fragment>
501
- #include <fog_fragment>
502
- #include <premultiplied_alpha_fragment>
503
-
504
- }
505
- `
506
- )
507
- };
508
- class be extends xt {
509
- /**
510
- * Constructs a new line segments geometry.
511
- *
512
- * @param {Object} [parameters] - An object with one or more properties
513
- * defining the material's appearance. Any property of the material
514
- * (including any property from inherited materials) can be passed
515
- * in here. Color values can be passed any type of value accepted
516
- * by {@link Color#set}.
517
- */
518
- constructor(e) {
519
- super({
520
- type: "LineMaterial",
521
- uniforms: Fe.clone(te.line.uniforms),
522
- vertexShader: te.line.vertexShader,
523
- fragmentShader: te.line.fragmentShader,
524
- clipping: !0
525
- // required for clipping support
526
- }), this.isLineMaterial = !0, this.setValues(e);
527
- }
528
- /**
529
- * The material's color.
530
- *
531
- * @type {Color}
532
- * @default (1,1,1)
533
- */
534
- get color() {
535
- return this.uniforms.diffuse.value;
536
- }
537
- set color(e) {
538
- this.uniforms.diffuse.value = e;
539
- }
540
- /**
541
- * Whether the material's sizes (width, dash gaps) are in world units.
542
- *
543
- * @type {boolean}
544
- * @default false
545
- */
546
- get worldUnits() {
547
- return "WORLD_UNITS" in this.defines;
548
- }
549
- set worldUnits(e) {
550
- e === !0 ? this.defines.WORLD_UNITS = "" : delete this.defines.WORLD_UNITS;
551
- }
552
- /**
553
- * Controls line thickness in CSS pixel units when `worldUnits` is `false` (default),
554
- * or in world units when `worldUnits` is `true`.
555
- *
556
- * @type {number}
557
- * @default 1
558
- */
559
- get linewidth() {
560
- return this.uniforms.linewidth.value;
561
- }
562
- set linewidth(e) {
563
- this.uniforms.linewidth && (this.uniforms.linewidth.value = e);
564
- }
565
- /**
566
- * Whether the line is dashed, or solid.
567
- *
568
- * @type {boolean}
569
- * @default false
570
- */
571
- get dashed() {
572
- return "USE_DASH" in this.defines;
573
- }
574
- set dashed(e) {
575
- e === !0 !== this.dashed && (this.needsUpdate = !0), e === !0 ? this.defines.USE_DASH = "" : delete this.defines.USE_DASH;
576
- }
577
- /**
578
- * The scale of the dashes and gaps.
579
- *
580
- * @type {number}
581
- * @default 1
582
- */
583
- get dashScale() {
584
- return this.uniforms.dashScale.value;
585
- }
586
- set dashScale(e) {
587
- this.uniforms.dashScale.value = e;
588
- }
589
- /**
590
- * The size of the dash.
591
- *
592
- * @type {number}
593
- * @default 1
594
- */
595
- get dashSize() {
596
- return this.uniforms.dashSize.value;
597
- }
598
- set dashSize(e) {
599
- this.uniforms.dashSize.value = e;
600
- }
601
- /**
602
- * Where in the dash cycle the dash starts.
603
- *
604
- * @type {number}
605
- * @default 0
606
- */
607
- get dashOffset() {
608
- return this.uniforms.dashOffset.value;
609
- }
610
- set dashOffset(e) {
611
- this.uniforms.dashOffset.value = e;
612
- }
613
- /**
614
- * The size of the gap.
615
- *
616
- * @type {number}
617
- * @default 0
618
- */
619
- get gapSize() {
620
- return this.uniforms.gapSize.value;
621
- }
622
- set gapSize(e) {
623
- this.uniforms.gapSize.value = e;
624
- }
625
- /**
626
- * The opacity.
627
- *
628
- * @type {number}
629
- * @default 1
630
- */
631
- get opacity() {
632
- return this.uniforms.opacity.value;
633
- }
634
- set opacity(e) {
635
- this.uniforms && (this.uniforms.opacity.value = e);
636
- }
637
- /**
638
- * The size of the viewport, in screen pixels. This must be kept updated to make
639
- * screen-space rendering accurate.The `LineSegments2.onBeforeRender` callback
640
- * performs the update for visible objects.
641
- *
642
- * @type {Vector2}
643
- */
644
- get resolution() {
645
- return this.uniforms.resolution.value;
646
- }
647
- set resolution(e) {
648
- this.uniforms.resolution.value.copy(e);
649
- }
650
- /**
651
- * Whether to use alphaToCoverage or not. When enabled, this can improve the
652
- * anti-aliasing of line edges when using MSAA.
653
- *
654
- * @type {boolean}
655
- */
656
- get alphaToCoverage() {
657
- return "USE_ALPHA_TO_COVERAGE" in this.defines;
658
- }
659
- set alphaToCoverage(e) {
660
- this.defines && (e === !0 !== this.alphaToCoverage && (this.needsUpdate = !0), e === !0 ? this.defines.USE_ALPHA_TO_COVERAGE = "" : delete this.defines.USE_ALPHA_TO_COVERAGE);
661
- }
662
- }
663
- const he = new q(), Le = new x(), Pe = new x(), b = new q(), _ = new q(), E = new q(), ve = new x(), ge = new St(), S = new _t(), Te = new x(), Q = new ae(), ee = new De(), M = new q();
664
- let L, I;
665
- function ke(i, e, t) {
666
- return M.set(0, 0, -e, 1).applyMatrix4(i.projectionMatrix), M.multiplyScalar(1 / M.w), M.x = I / t.width, M.y = I / t.height, M.applyMatrix4(i.projectionMatrixInverse), M.multiplyScalar(1 / M.w), Math.abs(Math.max(M.x, M.y));
667
- }
668
- function Bt(i, e) {
669
- const t = i.matrixWorld, o = i.geometry, n = o.attributes.instanceStart, s = o.attributes.instanceEnd, r = Math.min(o.instanceCount, n.count);
670
- for (let a = 0, u = r; a < u; a++) {
671
- S.start.fromBufferAttribute(n, a), S.end.fromBufferAttribute(s, a), S.applyMatrix4(t);
672
- const c = new x(), f = new x();
673
- L.distanceSqToSegment(S.start, S.end, f, c), f.distanceTo(c) < I * 0.5 && e.push({
674
- point: f,
675
- pointOnLine: c,
676
- distance: L.origin.distanceTo(f),
677
- object: i,
678
- face: null,
679
- faceIndex: a,
680
- uv: null,
681
- uv1: null
682
- });
683
- }
684
- }
685
- function Dt(i, e, t) {
686
- const o = e.projectionMatrix, s = i.material.resolution, r = i.matrixWorld, a = i.geometry, u = a.attributes.instanceStart, c = a.attributes.instanceEnd, f = Math.min(a.instanceCount, u.count), d = -e.near;
687
- L.at(1, E), E.w = 1, E.applyMatrix4(e.matrixWorldInverse), E.applyMatrix4(o), E.multiplyScalar(1 / E.w), E.x *= s.x / 2, E.y *= s.y / 2, E.z = 0, ve.copy(E), ge.multiplyMatrices(e.matrixWorldInverse, r);
688
- for (let p = 0, P = f; p < P; p++) {
689
- if (b.fromBufferAttribute(u, p), _.fromBufferAttribute(c, p), b.w = 1, _.w = 1, b.applyMatrix4(ge), _.applyMatrix4(ge), b.z > d && _.z > d)
690
- continue;
691
- if (b.z > d) {
692
- const g = b.z - _.z, U = (b.z - d) / g;
693
- b.lerp(_, U);
694
- } else if (_.z > d) {
695
- const g = _.z - b.z, U = (_.z - d) / g;
696
- _.lerp(b, U);
697
- }
698
- b.applyMatrix4(o), _.applyMatrix4(o), b.multiplyScalar(1 / b.w), _.multiplyScalar(1 / _.w), b.x *= s.x / 2, b.y *= s.y / 2, _.x *= s.x / 2, _.y *= s.y / 2, S.start.copy(b), S.start.z = 0, S.end.copy(_), S.end.z = 0;
699
- const A = S.closestPointToPointParameter(ve, !0);
700
- S.at(A, Te);
701
- const v = je.lerp(b.z, _.z, A), F = v >= -1 && v <= 1, y = ve.distanceTo(Te) < I * 0.5;
702
- if (F && y) {
703
- S.start.fromBufferAttribute(u, p), S.end.fromBufferAttribute(c, p), S.start.applyMatrix4(r), S.end.applyMatrix4(r);
704
- const g = new x(), U = new x();
705
- L.distanceSqToSegment(S.start, S.end, U, g), t.push({
706
- point: U,
707
- pointOnLine: g,
708
- distance: L.origin.distanceTo(U),
709
- object: i,
710
- face: null,
711
- faceIndex: p,
712
- uv: null,
713
- uv1: null
714
- });
715
- }
716
- }
717
- }
718
- class Ft extends bt {
719
- /**
720
- * Constructs a new wide line.
721
- *
722
- * @param {LineSegmentsGeometry} [geometry] - The line geometry.
723
- * @param {LineMaterial} [material] - The line material.
724
- */
725
- constructor(e = new Ne(), t = new be({ color: Math.random() * 16777215 })) {
726
- super(e, t), this.isLineSegments2 = !0, this.type = "LineSegments2";
727
- }
728
- /**
729
- * Computes an array of distance values which are necessary for rendering dashed lines.
730
- * For each vertex in the geometry, the method calculates the cumulative length from the
731
- * current point to the very beginning of the line.
732
- *
733
- * @return {LineSegments2} A reference to this instance.
734
- */
735
- computeLineDistances() {
736
- const e = this.geometry, t = e.attributes.instanceStart, o = e.attributes.instanceEnd, n = new Float32Array(2 * t.count);
737
- for (let r = 0, a = 0, u = t.count; r < u; r++, a += 2)
738
- Le.fromBufferAttribute(t, r), Pe.fromBufferAttribute(o, r), n[a] = a === 0 ? 0 : n[a - 1], n[a + 1] = n[a] + Le.distanceTo(Pe);
739
- const s = new xe(n, 2, 1);
740
- return e.setAttribute("instanceDistanceStart", new V(s, 1, 0)), e.setAttribute("instanceDistanceEnd", new V(s, 1, 1)), this;
741
- }
742
- /**
743
- * Computes intersection points between a casted ray and this instance.
744
- *
745
- * @param {Raycaster} raycaster - The raycaster.
746
- * @param {Array<Object>} intersects - The target array that holds the intersection points.
747
- */
748
- raycast(e, t) {
749
- const o = this.material.worldUnits, n = e.camera;
750
- n === null && !o && console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');
751
- const s = e.params.Line2 !== void 0 && e.params.Line2.threshold || 0;
752
- L = e.ray;
753
- const r = this.matrixWorld, a = this.geometry, u = this.material;
754
- I = u.linewidth + s, a.boundingSphere === null && a.computeBoundingSphere(), ee.copy(a.boundingSphere).applyMatrix4(r);
755
- let c;
756
- if (o)
757
- c = I * 0.5;
758
- else {
759
- const d = Math.max(n.near, ee.distanceToPoint(L.origin));
760
- c = ke(n, d, u.resolution);
761
- }
762
- if (ee.radius += c, L.intersectsSphere(ee) === !1)
763
- return;
764
- a.boundingBox === null && a.computeBoundingBox(), Q.copy(a.boundingBox).applyMatrix4(r);
765
- let f;
766
- if (o)
767
- f = I * 0.5;
768
- else {
769
- const d = Math.max(n.near, Q.distanceToPoint(L.origin));
770
- f = ke(n, d, u.resolution);
771
- }
772
- Q.expandByScalar(f), L.intersectsBox(Q) !== !1 && (o ? Bt(this, t) : Dt(this, n, t));
773
- }
774
- onBeforeRender(e) {
775
- const t = this.material.uniforms;
776
- t && t.resolution && (e.getViewport(he), this.material.uniforms.resolution.value.set(he.z, he.w));
777
- }
778
- }
779
- class We extends Ne {
780
- /**
781
- * Constructs a new line geometry.
782
- */
783
- constructor() {
784
- super(), this.isLineGeometry = !0, this.type = "LineGeometry";
785
- }
786
- /**
787
- * Sets the given line positions for this geometry.
788
- *
789
- * @param {Float32Array|Array<number>} array - The position data to set.
790
- * @return {LineGeometry} A reference to this geometry.
791
- */
792
- setPositions(e) {
793
- const t = e.length - 3, o = new Float32Array(2 * t);
794
- for (let n = 0; n < t; n += 3)
795
- 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];
796
- return super.setPositions(o), this;
797
- }
798
- /**
799
- * Sets the given line colors for this geometry.
800
- *
801
- * @param {Float32Array|Array<number>} array - The position data to set.
802
- * @return {LineGeometry} A reference to this geometry.
803
- */
804
- setColors(e) {
805
- const t = e.length - 3, o = new Float32Array(2 * t);
806
- for (let n = 0; n < t; n += 3)
807
- 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];
808
- return super.setColors(o), this;
809
- }
810
- /**
811
- * Setups this line segments geometry from the given sequence of points.
812
- *
813
- * @param {Array<Vector3|Vector2>} points - An array of points in 2D or 3D space.
814
- * @return {LineGeometry} A reference to this geometry.
815
- */
816
- setFromPoints(e) {
817
- const t = e.length - 1, o = new Float32Array(6 * t);
818
- for (let n = 0; n < t; n++)
819
- o[6 * n] = e[n].x, o[6 * n + 1] = e[n].y, o[6 * n + 2] = e[n].z || 0, o[6 * n + 3] = e[n + 1].x, o[6 * n + 4] = e[n + 1].y, o[6 * n + 5] = e[n + 1].z || 0;
820
- return super.setPositions(o), this;
821
- }
822
- /**
823
- * Setups this line segments geometry from the given line.
824
- *
825
- * @param {Line} line - The line that should be used as a data source for this geometry.
826
- * @return {LineGeometry} A reference to this geometry.
827
- */
828
- fromLine(e) {
829
- const t = e.geometry;
830
- return this.setPositions(t.attributes.position.array), this;
831
- }
832
- }
833
- class Ot extends Ft {
834
- /**
835
- * Constructs a new wide line.
836
- *
837
- * @param {LineGeometry} [geometry] - The line geometry.
838
- * @param {LineMaterial} [material] - The line material.
839
- */
840
- constructor(e = new We(), t = new be({ color: Math.random() * 16777215 })) {
841
- super(e, t), this.isLine2 = !0, this.type = "Line2";
842
- }
843
- }
844
- async function jt(i) {
845
- return await Tt(i);
846
- }
847
- function It(i, e) {
848
- i.position.copy(e);
849
- }
850
- function Nt(i, e, t = new se(16711680)) {
851
- const o = new x();
852
- e.getWorldPosition(o);
853
- const n = i.geometry.attributes.position, s = i.geometry.attributes.color, r = new se(55551);
854
- let a = 1 / 0, u = -1;
855
- for (let c = 0; c < n.count; c++) {
856
- const d = new x().fromBufferAttribute(n, c).distanceTo(o);
857
- d < a && (a = d, u = c);
858
- }
859
- for (let c = 0; c < s.count; c++) r.toArray(s.array, c * 3);
860
- if (u !== -1) {
861
- const c = t.toArray(), f = u * 3 + 2;
862
- for (let d = 0; d < f; d = d + 3)
863
- s.array[d] = c[0], s.array[d + 1] = c[1], s.array[d + 2] = c[2];
864
- }
865
- s.needsUpdate = !0;
866
- }
867
- function Ve(i, e, t, o = new se(16711680)) {
868
- It(i, e), Nt(t, i, o);
869
- }
870
- const Wt = { class: "panel-content" }, Vt = { class: "animation-controls" }, Gt = { class: "control-row" }, Rt = { class: "control-row" }, Ht = { class: "frame-info" }, $t = { class: "control-row" }, Xt = /* @__PURE__ */ Be({
871
- __name: "trackAnimationPanel",
872
- props: {
873
- cloud: {},
874
- knife: {},
875
- vectors: {}
876
- },
877
- emits: ["getThreeData"],
878
- setup(i, { expose: e, emit: t }) {
879
- const o = i, n = W(() => o.vectors), s = z(!1), r = z(0), a = z(100);
880
- let u = !1;
881
- const c = (y) => `第 ${y + 1} 帧`, f = (y) => {
882
- if (y < 0 || y >= n.value.length) {
883
- console.error(`帧索引 ${y} 超出范围`);
884
- return;
885
- }
886
- const g = n.value[y];
887
- r.value = y, Ve(o.knife, g, o.cloud);
888
- }, d = async () => {
889
- if (n.value.length === 0) {
890
- ie.error("无法播放动画:无数据");
891
- return;
892
- }
893
- if (!s.value) {
894
- s.value = !0, u = !1, n.value.length - 1 === r.value && (r.value = 0);
895
- try {
896
- for (let y = r.value + 1; y < n.value.length && !u; y++)
897
- await new Promise((g) => setTimeout(g, a.value)), f(y);
898
- u || ie.success("动画播放完成");
899
- } catch (y) {
900
- console.error("动画播放出错:", y);
901
- } finally {
902
- s.value = !1;
903
- }
904
- }
905
- }, p = () => {
906
- u = !0, s.value = !1, ie.info("动画已停止");
907
- }, P = (y) => {
908
- s.value && p(), f(y);
909
- }, T = () => {
910
- s.value && p(), !(r.value + 1 >= n.value.length) && f(r.value + 1);
911
- }, A = () => {
912
- s.value && p(), r.value !== 0 && f(r.value - 1);
913
- }, v = () => {
914
- r.value = 0;
915
- };
916
- return e({ playAnimation: d, stopAnimation: p, forwardFrame: T, backwardFrame: A, resetAnimationFrame: v, reset: async () => {
917
- await p(), v();
918
- } }), (y, g) => {
919
- const U = H("el-input-number"), le = H("el-form-item"), ce = H("el-form"), ue = H("el-slider");
920
- return $(), ye("div", Wt, [
921
- h("div", Vt, [
922
- h("div", Gt, [
923
- w(ce, {
924
- "label-width": "auto",
925
- style: { width: "100%" }
926
- }, {
927
- default: oe(() => [
928
- w(le, {
929
- label: "帧间隔 (ms):",
930
- prop: "frameDuration"
931
- }, {
932
- default: oe(() => [
933
- w(U, {
934
- modelValue: a.value,
935
- "onUpdate:modelValue": g[0] || (g[0] = (N) => a.value = N),
936
- min: 0,
937
- max: 5e3,
938
- step: 10,
939
- style: { width: "100%" }
940
- }, null, 8, ["modelValue"])
941
- ]),
942
- _: 1
943
- })
944
- ]),
945
- _: 1
946
- })
947
- ]),
948
- h("div", Rt, [
949
- g[2] || (g[2] = h("label", null, "当前帧:", -1)),
950
- h("span", Ht, X(r.value + 1) + " / " + X(n.value.length), 1)
951
- ]),
952
- h("div", $t, [
953
- g[3] || (g[3] = h("label", null, "动画进度:", -1)),
954
- w(ue, {
955
- modelValue: r.value,
956
- "onUpdate:modelValue": g[1] || (g[1] = (N) => r.value = N),
957
- min: 0,
958
- max: n.value.length > 0 ? n.value.length - 1 : 0,
959
- step: 1,
960
- "format-tooltip": c,
961
- onInput: P,
962
- disabled: n.value.length === 0,
963
- style: { "flex-grow": "1", margin: "0 10px" }
964
- }, null, 8, ["modelValue", "max", "disabled"])
965
- ])
966
- ])
967
- ]);
968
- };
969
- }
970
- }), qt = /* @__PURE__ */ Ie(Xt, [["__scopeId", "data-v-f6fc7a8c"]]);
971
- function Yt(i) {
972
- const e = [];
973
- return i.forEach((t) => {
974
- const [o, n, s] = t.trim().split(/\s+/);
975
- e.push(+o, +n, +s);
976
- }), e;
977
- }
978
- function re(i, e, t) {
979
- switch (i) {
980
- case "X":
981
- e.x = +t || 0;
982
- break;
983
- case "Y":
984
- e.y = +t || 0;
985
- break;
986
- case "Z":
987
- e.z = +t || 0;
988
- break;
989
- }
990
- }
991
- function Zt(i) {
992
- const e = [], t = ["X", "Y", "Z"];
993
- return i.forEach((o) => {
994
- const n = {
995
- x: 0,
996
- y: 0,
997
- z: 0
998
- }, s = o.trim();
999
- if (!s)
1000
- return;
1001
- let r = null, a = "";
1002
- for (let u = 0; u < (s == null ? void 0 : s.length); u++) {
1003
- const c = s[u], f = t.find((d) => d === c);
1004
- if (f) {
1005
- r && re(r, n, a), a = "", r = f;
1006
- continue;
1007
- }
1008
- a = a + c;
1009
- }
1010
- re(r, n, a), e.push(n.x, n.y, n.z);
1011
- }), e;
1012
- }
1013
- const Kt = (i) => i == null ? void 0 : i.filter((t) => t.includes("=")), Jt = (i) => i.replace(/,/g, ""), Qt = (i) => i == null ? void 0 : i.map((t) => Jt(t)), en = (i) => {
1014
- const e = Kt(i);
1015
- return Qt(e);
1016
- };
1017
- function tn(i) {
1018
- const e = en(i), t = [];
1019
- return e.forEach((o) => {
1020
- var d, p, P, T, A, v;
1021
- let [n, s, r, a] = o.trim().split(/\s+/);
1022
- s = (d = s == null ? void 0 : s.trim) == null ? void 0 : d.call(s), r = (p = r == null ? void 0 : r.trim) == null ? void 0 : p.call(r), a = (P = a == null ? void 0 : a.trim) == null ? void 0 : P.call(a);
1023
- const [, u] = (T = s == null ? void 0 : s.split) == null ? void 0 : T.call(s, "="), [, c] = (A = r == null ? void 0 : r.split) == null ? void 0 : A.call(r, "="), [, f] = (v = a == null ? void 0 : a.split) == null ? void 0 : v.call(a, "=");
1024
- t.push(+u, +c, +f);
1025
- }), t;
1026
- }
1027
- const nn = (i) => i >= "0" && i <= "9", on = (i) => i === "+" || i === "-", sn = (i) => i === ".";
1028
- function rn(i) {
1029
- return nn(i) || on(i) || sn(i);
1030
- }
1031
- function an(i) {
1032
- const e = [], t = /* @__PURE__ */ new Set(["X", "Y", "Z"]);
1033
- return i.forEach((o) => {
1034
- const n = {
1035
- x: 0,
1036
- y: 0,
1037
- z: 0
1038
- }, s = o.trim();
1039
- if (!s)
1040
- return;
1041
- let r = null, a = "";
1042
- for (let u = 0; u < (s == null ? void 0 : s.length); u++) {
1043
- const c = s[u], f = t.has(c) ? c : null, d = rn(c);
1044
- if (f || !d) {
1045
- r && re(r, n, a), r = f, a = "";
1046
- continue;
1047
- }
1048
- a = a + c;
1049
- }
1050
- r && re(r, n, a), e.push(n.x, n.y, n.z);
1051
- }), e;
1052
- }
1053
- function ln(i) {
1054
- return i == null ? void 0 : i.includes("=");
1055
- }
1056
- async function cn(i) {
1057
- var n, s;
1058
- const e = (n = i == null ? void 0 : i.trim()) == null ? void 0 : n.split(/\r?\n/);
1059
- if (ln(i))
1060
- return tn(e);
1061
- const t = e == null ? void 0 : e[0], o = (s = t == null ? void 0 : t.trim()) == null ? void 0 : s.split(/\s+/);
1062
- if ((o == null ? void 0 : o.length) >= 3)
1063
- return Yt(e);
1064
- if ((o == null ? void 0 : o.length) === 1)
1065
- return Zt(e);
1066
- }
1067
- async function un(i) {
1068
- const e = i.trim().split(/\r?\n/), t = [];
1069
- return e.forEach((o) => {
1070
- const n = o.trim().split(/\s+/);
1071
- if (n.length != 3)
1072
- return;
1073
- const [s, r, a] = n;
1074
- t.push(+s, +r, +a);
1075
- }), t;
1076
- }
1077
- async function dn(i) {
1078
- const e = i.trim().split(/\r?\n/), t = [];
1079
- return e.forEach((o) => {
1080
- const n = o.trim().split(/\s+/);
1081
- if (n.length != 3)
1082
- return;
1083
- const [s, r, a] = n;
1084
- t.push(+s, +r, +a);
1085
- }), t;
1086
- }
1087
- async function fn(i) {
1088
- let e = i.trim().split(/\r?\n/);
1089
- return e = e.filter((o) => {
1090
- const n = o.startsWith("X"), s = o.startsWith("G") && o.includes("X");
1091
- return n || s;
1092
- }), an(e);
1093
- }
1094
- async function mn(i, e) {
1095
- const { isCyd: t, isUv: o, isCpt: n, isNc: s } = e;
1096
- return o ? cn(i) : t ? dn(i) : n ? un(i) : s ? fn(i) : [];
1097
- }
1098
- function pn(i) {
1099
- const e = [];
1100
- for (let t = 0; t < i.length; t += 3)
1101
- e.push(new x(i[t], i[t + 1], i[t + 2]));
1102
- return e;
1103
- }
1104
- function hn(i, e) {
1105
- if (!e || e.length < 3)
1106
- return;
1107
- const { scene: t, camera: o, renderer: n, controls: s } = i();
1108
- if (!t || !o || !n || !s)
1109
- return;
1110
- const r = [];
1111
- for (let p = 0; p < e.length; p += 3)
1112
- r.push(new x(e[p], e[p + 1], e[p + 2]));
1113
- const u = new Ct(r, !1, "catmullrom", 0.5).getPoints(150).flatMap((p) => [p.x, p.y, p.z]), c = new We();
1114
- c.setPositions(u);
1115
- const f = new be({
1116
- color: 55551,
1117
- linewidth: 3,
1118
- // 像素宽度,可 >1
1119
- resolution: new Oe(window.innerWidth, window.innerHeight)
1120
- }), d = new Ot(c, f);
1121
- return d.name = "轨迹路径", t.add(d), d;
1122
- }
1123
- function vn(i, e, t, o = 4, n = 50) {
1124
- let s = 1 / 0, r = -1 / 0, a = 1 / 0, u = -1 / 0, c = 1 / 0, f = -1 / 0;
1125
- for (let v = 0; v < i.length; v += 3) {
1126
- const F = i[v], y = i[v + 1], g = i[v + 2];
1127
- s = Math.min(s, F), r = Math.max(r, F), a = Math.min(a, y), u = Math.max(u, y), c = Math.min(c, g), f = Math.max(f, g);
1128
- }
1129
- const p = Math.sqrt((r - s) ** 2 + (u - a) ** 2 + (f - c) ** 2) * 0.05, P = je.degToRad(e.fov), T = 2 * Math.tan(P / 2) * n, A = p / T * t.domElement.height * (o / 4);
1130
- return Math.min(0.4, A);
1131
- }
1132
- function gn(i) {
1133
- if (i.length % 3 !== 0)
1134
- return console.error("points array length is not a multiple of 3:", i), null;
1135
- const e = new zt();
1136
- e.setAttribute("position", new we(i, 3));
1137
- const t = new Float32Array(i.length);
1138
- for (let s = 0; s < i.length; s += 3)
1139
- t[s] = 0, t[s + 1] = 0.847, t[s + 2] = 1;
1140
- e.setAttribute("color", new At(t, 3));
1141
- const o = new Ut({
1142
- vertexColors: !0,
1143
- size: 0.4,
1144
- // 像素世界单位
1145
- sizeAttenuation: !0
1146
- }), n = new Et(e, o);
1147
- return o.needsUpdate = !0, n;
1148
- }
1149
- function yn(i, e) {
1150
- const t = new ae().setFromArray(e), o = [
1151
- new x(t.min.x, t.min.y, t.min.z),
1152
- new x(t.max.x, t.min.y, t.min.z),
1153
- new x(t.min.x, t.max.y, t.min.z),
1154
- new x(t.min.x, t.min.y, t.max.z),
1155
- new x(t.max.x, t.max.y, t.min.z),
1156
- new x(t.max.x, t.min.y, t.max.z),
1157
- new x(t.min.x, t.max.y, t.max.z),
1158
- new x(t.max.x, t.max.y, t.max.z)
1159
- ];
1160
- let n = 0;
1161
- for (const s of o)
1162
- n = Math.max(n, s.distanceTo(i.position));
1163
- return n;
1164
- }
1165
- function wn(i, e) {
1166
- if (!e)
1167
- return;
1168
- const { scene: t, camera: o, renderer: n, controls: s } = i();
1169
- if (!t || !o || !n || !s)
1170
- return;
1171
- const r = gn(e);
1172
- if (!r)
1173
- return;
1174
- r.name = "轨迹路径", t.add(r);
1175
- const a = vn(e, o, n, 0.1, 50);
1176
- r.material.size = a;
1177
- const u = yn(o, e);
1178
- return o.far = u * 1.2, o.updateProjectionMatrix(), r;
1179
- }
1180
- const xn = { class: "obj-viewer-container" }, bn = { class: "buttonGroup-topLeft" }, _n = { class: "buttonGroup-left" }, Sn = { class: "buttonGroup-right" }, Cn = { class: "buttonGroup-bottom" }, zn = { class: "left-panel" }, An = { class: "panel-header" }, Un = { class: "panel-body" }, En = { class: "right-panel" }, Mn = { class: "panel-header" }, Ln = { class: "panel-body" }, Pn = {
1181
- key: 0,
1182
- class: "loading-overlay"
1183
- }, Tn = /* @__PURE__ */ Be({
1184
- __name: "threeTrackPathView",
1185
- props: {
1186
- fileBlobs: {},
1187
- threeData: { default: () => "" },
1188
- trackFileType: {}
1189
- },
1190
- setup(i) {
1191
- const e = i, t = z(null), o = z(!1), n = z(""), s = z(), r = z(!1), a = z(""), u = z(!1), c = z(""), f = Y(null), d = Y(null), {
1192
- currentModels: p,
1193
- resetView: P,
1194
- initThreeJS: T,
1195
- handleResize: A,
1196
- getThreeJSObjects: v,
1197
- cleanup: F,
1198
- setModels: y,
1199
- setAndFitModels: g,
1200
- axesHelperVisible: U,
1201
- toggleAxesVisibility: le,
1202
- zoomIn: ce,
1203
- zoomOut: ue
1204
- } = mt(t), { isAnimating: N, toggleAnimation: Ge, startAnimation: kn, stopAnimation: Re } = pt(v, p), { isClipping: He, activeClippingAxis: _e, toggleClipping: $e, updateClippingPlanes: Xe } = ht(v, p), qe = () => {
1205
- le();
1206
- }, Ye = (l) => {
1207
- _e.value = l, Xe();
1208
- }, de = (l) => {
1209
- r.value = !0, a.value = l, l === "剖面视图" && !He.value && $e();
1210
- }, fe = (l) => {
1211
- u.value = !0, c.value = l;
1212
- }, me = z([]), G = z([]), Ze = W(() => {
1213
- var m;
1214
- return (m = e.trackFileType) == null ? void 0 : m.isUv;
1215
- }), Ke = W(() => {
1216
- var m;
1217
- return (m = e.trackFileType) == null ? void 0 : m.isCyd;
1218
- }), Je = W(() => {
1219
- var m;
1220
- return (m = e.trackFileType) == null ? void 0 : m.isCpt;
1221
- }), O = W(() => {
1222
- var m;
1223
- return (m = e.trackFileType) == null ? void 0 : m.isNc;
1224
- }), Se = W(() => {
1225
- const l = e.fileBlobs || [];
1226
- return l == null ? void 0 : l[0];
1227
- });
1228
- let k = Y(), j = Y();
1229
- const Qe = () => {
1230
- const { scene: l } = v();
1231
- k.value && l && (Ee(k.value, l), k.value = null);
1232
- }, et = () => {
1233
- const { scene: l } = v();
1234
- j.value && l && (Ee(j.value, l), j.value = null);
1235
- }, Ce = () => {
1236
- Qe(), et();
1237
- }, tt = async (l) => {
1238
- const m = URL.createObjectURL(l), R = await Mt(m);
1239
- if (URL.revokeObjectURL(m), kt(R)) {
1240
- me.value = await mn(R, e.trackFileType) || [];
1241
- const B = me.value;
1242
- Ze.value && (k.value = hn(v, B)), (Ke.value || Je.value || O.value) && (k.value = wn(v, B));
1243
- }
1244
- }, nt = async () => {
1245
- var l, m;
1246
- j.value = await jt("http://222.92.178.198:55002/CPMPIP/Cut/1_4%20Single%20Flute%20End%20Mill-Cut002.obj"), G.value = pn(me.value), G.value && G.value.length && (Ve(j.value, G.value[0], k.value, new se(16711680)), (m = (l = d.value) == null ? void 0 : l.add) == null || m.call(l, j.value));
1247
- }, ze = async (l) => {
1248
- Ce(), await tt(l), k.value && gt(v, k.value), O.value && nt();
1249
- };
1250
- ut(() => Se.value, async (l) => {
1251
- l && await ze(l);
1252
- }, {
1253
- immediate: !0,
1254
- deep: !0
1255
- });
1256
- const it = async () => {
1257
- var l;
1258
- await ((l = s == null ? void 0 : s.value) == null ? void 0 : l.reset()), await ze(Se.value);
1259
- }, ot = () => {
1260
- var l;
1261
- O.value && ((l = s == null ? void 0 : s.value) == null || l.playAnimation());
1262
- }, st = () => {
1263
- var l;
1264
- O.value && ((l = s == null ? void 0 : s.value) == null || l.stopAnimation());
1265
- }, rt = () => {
1266
- var l;
1267
- O.value && ((l = s == null ? void 0 : s.value) == null || l.forwardFrame());
1268
- }, at = () => {
1269
- var l;
1270
- O.value && ((l = s == null ? void 0 : s.value) == null || l.backwardFrame());
1271
- }, lt = () => {
1272
- T(), window.addEventListener("resize", A);
1273
- const l = v();
1274
- d.value = l.scene, d.value && (d.value.name = "CPMPIP");
1275
- }, ct = () => {
1276
- window.removeEventListener("resize", A), N.value && Re(), Ce(), F();
1277
- };
1278
- return dt(async () => {
1279
- try {
1280
- lt();
1281
- } catch (l) {
1282
- console.error("Three.js 初始化失败:", l), ie.error("渲染引擎初始化失败!");
1283
- }
1284
- }), ft(() => {
1285
- ct();
1286
- }), (l, m) => {
1287
- const R = H("el-scrollbar");
1288
- return $(), ye("div", xn, [
1289
- h("div", {
1290
- ref_key: "threejsContainer",
1291
- ref: t,
1292
- class: "threejs-container"
1293
- }, null, 512),
1294
- h("div", bn, [
1295
- w(C, {
1296
- name: "viewReset",
1297
- size: "24",
1298
- onClick: it,
1299
- title: "重置"
1300
- }),
1301
- w(C, {
1302
- name: "fangda",
1303
- size: "24",
1304
- title: "放大",
1305
- onClick: D(ce)
1306
- }, null, 8, ["onClick"]),
1307
- w(C, {
1308
- name: "suoxiao",
1309
- size: "24",
1310
- title: "缩小",
1311
- onClick: D(ue)
1312
- }, null, 8, ["onClick"]),
1313
- w(C, {
1314
- name: "lookAround",
1315
- size: "24",
1316
- onClick: D(Ge),
1317
- title: D(N) ? "停止动画" : "动画视图"
1318
- }, null, 8, ["onClick", "title"]),
1319
- w(C, {
1320
- name: "zuobiaoxi",
1321
- size: "24",
1322
- active: D(U),
1323
- onClick: qe,
1324
- title: "显隐坐标轴"
1325
- }, null, 8, ["active"])
1326
- ]),
1327
- h("div", _n, [
1328
- Ae(l.$slots, "button-left", { switchRightPanel: de }, void 0, !0),
1329
- w(C, {
1330
- name: "jiegoushu",
1331
- size: "24",
1332
- onClick: m[0] || (m[0] = (B) => de("场景树")),
1333
- active: r.value && a.value === "场景树",
1334
- title: "场景树"
1335
- }, null, 8, ["active"]),
1336
- w(C, {
1337
- name: "clipping",
1338
- size: "24",
1339
- onClick: m[1] || (m[1] = (B) => de("剖面视图")),
1340
- active: r.value && a.value === "剖面视图",
1341
- title: "剖面视图"
1342
- }, null, 8, ["active"])
1343
- ]),
1344
- h("div", Sn, [
1345
- Ae(l.$slots, "button-right", { switchRightPanel: fe }, void 0, !0),
1346
- w(C, {
1347
- name: "guanjiekongzhi",
1348
- size: "24",
1349
- onClick: m[2] || (m[2] = (B) => fe("关节控制")),
1350
- active: u.value && c.value === "关节控制",
1351
- title: "关节控制"
1352
- }, null, 8, ["active"]),
1353
- w(C, {
1354
- name: "donghuafangzhen",
1355
- size: "24",
1356
- title: "动画仿真",
1357
- onClick: m[3] || (m[3] = (B) => fe("动画仿真")),
1358
- active: u.value && c.value === "动画仿真"
1359
- }, null, 8, ["active"])
1360
- ]),
1361
- h("div", Cn, [
1362
- w(C, {
1363
- name: "kuaitui",
1364
- size: "24",
1365
- backgroundColor: "#ffffff",
1366
- title: "快退",
1367
- onClick: at
1368
- }),
1369
- w(C, {
1370
- name: "bofang",
1371
- size: "24",
1372
- backgroundColor: "#ffffff",
1373
- title: "播放",
1374
- onClick: ot
1375
- }),
1376
- w(C, {
1377
- name: "kuaijin",
1378
- size: "24",
1379
- backgroundColor: "#ffffff",
1380
- title: "快进",
1381
- onClick: rt
1382
- }),
1383
- w(C, {
1384
- name: "zanting",
1385
- size: "24",
1386
- backgroundColor: "#ffffff",
1387
- title: "暂停",
1388
- onClick: st
1389
- })
1390
- ]),
1391
- Z(h("div", zn, [
1392
- h("div", An, [
1393
- h("span", null, X(a.value), 1),
1394
- h("span", {
1395
- class: "close",
1396
- onClick: m[4] || (m[4] = (B) => r.value = !1)
1397
- }, " X ")
1398
- ]),
1399
- h("div", Un, [
1400
- w(R, { height: "100%" }, {
1401
- default: oe(() => [
1402
- a.value === "场景树" ? ($(), Ue(Lt, {
1403
- key: 0,
1404
- model: f.value
1405
- }, null, 8, ["model"])) : pe("", !0),
1406
- a.value === "剖面视图" ? ($(), Ue(vt, {
1407
- key: 1,
1408
- value: D(_e),
1409
- onChange: Ye
1410
- }, null, 8, ["value"])) : pe("", !0)
1411
- ]),
1412
- _: 1
1413
- })
1414
- ])
1415
- ], 512), [
1416
- [K, r.value]
1417
- ]),
1418
- Z(h("div", En, [
1419
- h("div", Mn, [
1420
- h("span", null, X(c.value), 1),
1421
- h("span", {
1422
- class: "close",
1423
- onClick: m[5] || (m[5] = (B) => u.value = !1)
1424
- }, " X ")
1425
- ]),
1426
- h("div", Ln, [
1427
- w(R, { height: "100%" }, {
1428
- default: oe(() => [
1429
- Z(w(Pt, { model: f.value }, null, 8, ["model"]), [
1430
- [K, c.value === "关节控制"]
1431
- ]),
1432
- Z(w(qt, {
1433
- ref_key: "animationPanelRef",
1434
- ref: s,
1435
- cloud: D(k),
1436
- knife: D(j),
1437
- vectors: G.value
1438
- }, null, 8, ["cloud", "knife", "vectors"]), [
1439
- [K, c.value === "动画仿真" && O.value]
1440
- ])
1441
- ]),
1442
- _: 1
1443
- })
1444
- ])
1445
- ], 512), [
1446
- [K, u.value]
1447
- ]),
1448
- o.value ? ($(), ye("div", Pn, [
1449
- m[6] || (m[6] = h("div", { class: "loading-spinner" }, null, -1)),
1450
- h("p", null, X(n.value), 1)
1451
- ])) : pe("", !0)
1452
- ]);
1453
- };
1454
- }
1455
- }), Gn = /* @__PURE__ */ Ie(Tn, [["__scopeId", "data-v-b1ec1b6d"]]);
1456
- export {
1457
- Gn as default
1458
- };