ss-component-new 1.3.657 → 1.3.659

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 (82) hide show
  1. package/dist/config.js +1 -1
  2. package/dist/index-CQG5_ZDD.js +1084 -0
  3. package/dist/index-C_HX7GAm.js +8849 -0
  4. package/dist/index-ZPct7ETq.js +180 -0
  5. package/dist/platform-BsULsE0-.js +16684 -0
  6. package/dist/ss-component.css +2 -8
  7. package/dist/ss-component.js +26 -67
  8. package/dist/ss-component2.js +15 -75
  9. package/dist/ss-component3.js +785 -9
  10. package/package.json +4 -4
  11. package/public/config.js +1 -1
  12. package/dist/MTLLoader-DI0avKtj.js +0 -657
  13. package/dist/URDFLoader-PUxvYFDe.js +0 -2304
  14. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  15. package/dist/animationData-05aVUytq.js +0 -83
  16. package/dist/array-M5UIzgFU.js +0 -1044
  17. package/dist/clone-Ddn1p6-1.js +0 -8
  18. package/dist/eleIcon-BWVKfp5t.js +0 -29
  19. package/dist/iconfont-BNdGaGPn.js +0 -1018
  20. package/dist/icons/svg/Update.svg +0 -1
  21. package/dist/icons/svg/functionList.svg +0 -1
  22. package/dist/icons/svg/uploadCopy.svg +0 -1
  23. package/dist/index-B7ESWQK3.js +0 -468
  24. package/dist/index-BDhIWgKn.js +0 -658
  25. package/dist/index-BFYqRqws.js +0 -83
  26. package/dist/index-BFqUz4pN.js +0 -52
  27. package/dist/index-BP1mKUQP.js +0 -627
  28. package/dist/index-BczRQX8N.js +0 -407
  29. package/dist/index-BnrvtCYj.js +0 -55
  30. package/dist/index-Bpr501oZ.js +0 -78
  31. package/dist/index-BtOiWnaj.js +0 -117
  32. package/dist/index-BvbZiTVB.js +0 -342
  33. package/dist/index-Bvvz41NY.js +0 -44
  34. package/dist/index-C9DBY1gg.js +0 -103
  35. package/dist/index-CFFbhR3G.js +0 -996
  36. package/dist/index-COr2mcbl.js +0 -48
  37. package/dist/index-CV_jQDcg.js +0 -9
  38. package/dist/index-CXV4riUN.js +0 -864
  39. package/dist/index-CXe4q28L.js +0 -447
  40. package/dist/index-CYKmHhSo.js +0 -61974
  41. package/dist/index-ChNfRlIP.js +0 -596
  42. package/dist/index-D-5v1Jx7.js +0 -93
  43. package/dist/index-D4LcEpQ7.js +0 -619
  44. package/dist/index-DGObzWyL.js +0 -8984
  45. package/dist/index-DJ59jXR0.js +0 -28483
  46. package/dist/index-DJrzqi4-.js +0 -209
  47. package/dist/index-D_kI6aHR.js +0 -98
  48. package/dist/index-Dr9Wt5nC.js +0 -84
  49. package/dist/index-Dwt0Wlg_.js +0 -201
  50. package/dist/index-DxBEJThZ.js +0 -93
  51. package/dist/index-DyOIxMCm.js +0 -11769
  52. package/dist/index-J_lJ8THH.js +0 -107
  53. package/dist/index-MgxLPMC2.js +0 -30
  54. package/dist/index-SeW03TeK.js +0 -2623
  55. package/dist/index-WPJbEuld.js +0 -62
  56. package/dist/index-WuWGP1Bp.js +0 -24847
  57. package/dist/index-YVR3acYT.js +0 -61
  58. package/dist/index-dD-mKgue.js +0 -27
  59. package/dist/index-uF-ibwG0.js +0 -9
  60. package/dist/index-yRXVIg-Q.js +0 -98
  61. package/dist/index.vue_vue_type_script_setup_true_lang-DwbHXtUp.js +0 -55
  62. package/dist/index.vue_vue_type_style_index_0_scoped_39e1db95_lang-CG9X8aa2.js +0 -137728
  63. package/dist/isString-CoCw_sp3.js +0 -8
  64. package/dist/localIcon-CoJHw5ss.js +0 -76
  65. package/dist/main-6nOFPtBP.js +0 -502
  66. package/dist/menuIndex-Dt0NyAyE.js +0 -159
  67. package/dist/request-DiogHwkN.js +0 -9465
  68. package/dist/threeModel-CO0qgNsr.js +0 -1108
  69. package/dist/threePreview-BHLSA5YS.js +0 -2259
  70. package/dist/threeSceneView-C2e1Jcsq.js +0 -1289
  71. package/dist/threeSceneViewForCPMPIP-DSLQhiGf.js +0 -538
  72. package/dist/threeTrackPathView-BR8-g2Tr.js +0 -620
  73. package/dist/threeViewerHost-DSHo_0Ag.js +0 -233
  74. package/dist/urdfTree-IEJgkVzs.js +0 -254
  75. package/dist/workpieceTreePanel-aZV2ut3W.js +0 -555
  76. package/public/icons/svg/Update.svg +0 -1
  77. package/public/icons/svg/functionList.svg +0 -1
  78. package/public/icons/svg/uploadCopy.svg +0 -1
  79. /package/dist/icons/svg/{tableClose.svg → table-close.svg} +0 -0
  80. /package/dist/icons/svg/{tableExpand.svg → table-expand.svg} +0 -0
  81. /package/public/icons/svg/{tableClose.svg → table-close.svg} +0 -0
  82. /package/public/icons/svg/{tableExpand.svg → table-expand.svg} +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ss-component-new",
3
3
  "private": false,
4
- "version": "1.3.657",
4
+ "version": "1.3.659",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -13,7 +13,7 @@
13
13
  "dev": "vite",
14
14
  "build": "node --max-old-space-size=8192 ./node_modules/vite/bin/vite build",
15
15
  "preview": "vite preview",
16
- "build:lib": "set NODE_OPTIONS=--max-old-space-size=8192 && vite build",
16
+ "build:lib": "vite build",
17
17
  "prepublishOnly": "npm run build:lib"
18
18
  },
19
19
  "dependencies": {
@@ -59,6 +59,7 @@
59
59
  "devDependencies": {
60
60
  "@types/lodash-es": "^4.17.12",
61
61
  "@types/node": "^22.14.1",
62
+ "@types/sortablejs": "^1.15.9",
62
63
  "@types/three": "^0.177.0",
63
64
  "@vitejs/plugin-vue": "^5.2.3",
64
65
  "@vue/tsconfig": "^0.7.0",
@@ -73,6 +74,5 @@
73
74
  "vite-plugin-vue-devtools": "^7.7.7",
74
75
  "vite-plugin-vue-inspector": "^5.3.2",
75
76
  "vue-tsc": "^2.2.10"
76
- },
77
- "packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264"
77
+ }
78
78
  }
package/public/config.js CHANGED
@@ -5,7 +5,7 @@ window.__env__ = {
5
5
  "VITE_PUBLIC_PATH": "",
6
6
  "VITE_SM_PUBLIC_KEY": "0484C7466D950E120E5ECE5DD85D0C90EAA85081A3A2BD7C57AE6DC822EFCCBD66620C67B0103FC8DD280E36C3B282977B722AAEC3C56518EDCEBAFB72C5A05312",
7
7
  "VITE_API_URL": "http://222.92.178.198:62001",
8
- "VITE_API_NEW_URL": "http://222.92.178.198:63002",
8
+ "VITE_API_NEW_URL": "http://222.92.178.198:63003",
9
9
  "VITE_REPORT_URL": "http://139.196.154.85:20031",
10
10
  "VITE_FACE_RECOGNITION_API_URL": "http://139.196.154.85:20015",
11
11
  "VITE_DEFAULT_USER": "",
@@ -1,657 +0,0 @@
1
- import { R as Z, U as Y, u as D, C as P, c as S, a1 as H, V as O, Y as k, s as ie, a2 as N, aI as X, _ as T, k as ne, aM as $, $ as W, h as K, an as ae, a4 as oe, aF as le, aZ as q, ap as Q, b9 as ce, aw as he } from "./index.vue_vue_type_style_index_0_scoped_39e1db95_lang-CG9X8aa2.js";
2
- class xe extends Z {
3
- /**
4
- * Constructs a new STL loader.
5
- *
6
- * @param {LoadingManager} [manager] - The loading manager.
7
- */
8
- constructor(t) {
9
- super(t);
10
- }
11
- /**
12
- * Starts loading from the given URL and passes the loaded STL asset
13
- * to the `onLoad()` callback.
14
- *
15
- * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.
16
- * @param {function(BufferGeometry)} onLoad - Executed when the loading process has been finished.
17
- * @param {onProgressCallback} onProgress - Executed while the loading is in progress.
18
- * @param {onErrorCallback} onError - Executed when errors occur.
19
- */
20
- load(t, s, i, e) {
21
- const r = this, c = new Y(this.manager);
22
- c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(t, function(h) {
23
- try {
24
- s(r.parse(h));
25
- } catch (l) {
26
- e ? e(l) : console.error(l), r.manager.itemError(t);
27
- }
28
- }, i, e);
29
- }
30
- /**
31
- * Parses the given STL data and returns the resulting geometry.
32
- *
33
- * @param {ArrayBuffer} data - The raw STL data as an array buffer.
34
- * @return {BufferGeometry} The parsed geometry.
35
- */
36
- parse(t) {
37
- function s(n) {
38
- const a = new DataView(n), o = 32 / 8 * 3 + 32 / 8 * 3 * 3 + 16 / 8, u = a.getUint32(80, !0);
39
- if (80 + 32 / 8 + u * o === a.byteLength)
40
- return !0;
41
- const m = [115, 111, 108, 105, 100];
42
- for (let p = 0; p < 5; p++)
43
- if (i(m, a, p)) return !1;
44
- return !0;
45
- }
46
- function i(n, a, o) {
47
- for (let u = 0, d = n.length; u < d; u++)
48
- if (n[u] !== a.getUint8(o + u)) return !1;
49
- return !0;
50
- }
51
- function e(n) {
52
- const a = new DataView(n), o = a.getUint32(80, !0);
53
- let u, d, m, p = !1, g, b, x, C, v;
54
- for (let y = 0; y < 70; y++)
55
- a.getUint32(y, !1) == 1129270351 && a.getUint8(y + 4) == 82 && a.getUint8(y + 5) == 61 && (p = !0, g = new Float32Array(o * 3 * 3), b = a.getUint8(y + 6) / 255, x = a.getUint8(y + 7) / 255, C = a.getUint8(y + 8) / 255, v = a.getUint8(y + 9) / 255);
56
- const j = 84, f = 50, w = new D(), _ = new Float32Array(o * 3 * 3), V = new Float32Array(o * 3 * 3), A = new P();
57
- for (let y = 0; y < o; y++) {
58
- const U = j + y * f, E = a.getFloat32(U, !0), z = a.getFloat32(U + 4, !0), R = a.getFloat32(U + 8, !0);
59
- if (p) {
60
- const F = a.getUint16(U + 48, !0);
61
- (F & 32768) === 0 ? (u = (F & 31) / 31, d = (F >> 5 & 31) / 31, m = (F >> 10 & 31) / 31) : (u = b, d = x, m = C);
62
- }
63
- for (let F = 1; F <= 3; F++) {
64
- const G = U + F * 12, M = y * 3 * 3 + (F - 1) * 3;
65
- _[M] = a.getFloat32(G, !0), _[M + 1] = a.getFloat32(G + 4, !0), _[M + 2] = a.getFloat32(G + 8, !0), V[M] = E, V[M + 1] = z, V[M + 2] = R, p && (A.setRGB(u, d, m, S), g[M] = A.r, g[M + 1] = A.g, g[M + 2] = A.b);
66
- }
67
- }
68
- return w.setAttribute("position", new H(_, 3)), w.setAttribute("normal", new H(V, 3)), p && (w.setAttribute("color", new H(g, 3)), w.hasColors = !0, w.alpha = v), w;
69
- }
70
- function r(n) {
71
- const a = new D(), o = /solid([\s\S]*?)endsolid/g, u = /facet([\s\S]*?)endfacet/g, d = /solid\s(.+)/;
72
- let m = 0;
73
- const p = /[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source, g = new RegExp("vertex" + p + p + p, "g"), b = new RegExp("normal" + p + p + p, "g"), x = [], C = [], v = [], j = new O();
74
- let f, w = 0, _ = 0, V = 0;
75
- for (; (f = o.exec(n)) !== null; ) {
76
- _ = V;
77
- const A = f[0], y = (f = d.exec(A)) !== null ? f[1] : "";
78
- for (v.push(y); (f = u.exec(A)) !== null; ) {
79
- let z = 0, R = 0;
80
- const F = f[0];
81
- for (; (f = b.exec(F)) !== null; )
82
- j.x = parseFloat(f[1]), j.y = parseFloat(f[2]), j.z = parseFloat(f[3]), R++;
83
- for (; (f = g.exec(F)) !== null; )
84
- x.push(parseFloat(f[1]), parseFloat(f[2]), parseFloat(f[3])), C.push(j.x, j.y, j.z), z++, V++;
85
- R !== 1 && console.error("THREE.STLLoader: Something isn't right with the normal of face number " + m), z !== 3 && console.error("THREE.STLLoader: Something isn't right with the vertices of face number " + m), m++;
86
- }
87
- const U = _, E = V - _;
88
- a.userData.groupNames = v, a.addGroup(U, E, w), w++;
89
- }
90
- return a.setAttribute("position", new k(x, 3)), a.setAttribute("normal", new k(C, 3)), a;
91
- }
92
- function c(n) {
93
- return typeof n != "string" ? new TextDecoder().decode(n) : n;
94
- }
95
- function h(n) {
96
- if (typeof n == "string") {
97
- const a = new Uint8Array(n.length);
98
- for (let o = 0; o < n.length; o++)
99
- a[o] = n.charCodeAt(o) & 255;
100
- return a.buffer || a;
101
- } else
102
- return n;
103
- }
104
- const l = h(t);
105
- return s(l) ? e(l) : r(c(t));
106
- }
107
- }
108
- const ue = /^[og]\s*(.+)?/, pe = /^mtllib /, fe = /^usemtl /, de = /^usemap /, ee = /\s+/, te = new O(), J = new O(), se = new O(), re = new O(), L = new O(), B = new P();
109
- function me() {
110
- const I = {
111
- objects: [],
112
- object: {},
113
- vertices: [],
114
- normals: [],
115
- colors: [],
116
- uvs: [],
117
- materials: {},
118
- materialLibraries: [],
119
- startObject: function(t, s) {
120
- if (this.object && this.object.fromDeclaration === !1) {
121
- this.object.name = t, this.object.fromDeclaration = s !== !1;
122
- return;
123
- }
124
- const i = this.object && typeof this.object.currentMaterial == "function" ? this.object.currentMaterial() : void 0;
125
- if (this.object && typeof this.object._finalize == "function" && this.object._finalize(!0), this.object = {
126
- name: t || "",
127
- fromDeclaration: s !== !1,
128
- geometry: {
129
- vertices: [],
130
- normals: [],
131
- colors: [],
132
- uvs: [],
133
- hasUVIndices: !1
134
- },
135
- materials: [],
136
- smooth: !0,
137
- startMaterial: function(e, r) {
138
- const c = this._finalize(!1);
139
- c && (c.inherited || c.groupCount <= 0) && this.materials.splice(c.index, 1);
140
- const h = {
141
- index: this.materials.length,
142
- name: e || "",
143
- mtllib: Array.isArray(r) && r.length > 0 ? r[r.length - 1] : "",
144
- smooth: c !== void 0 ? c.smooth : this.smooth,
145
- groupStart: c !== void 0 ? c.groupEnd : 0,
146
- groupEnd: -1,
147
- groupCount: -1,
148
- inherited: !1,
149
- clone: function(l) {
150
- const n = {
151
- index: typeof l == "number" ? l : this.index,
152
- name: this.name,
153
- mtllib: this.mtllib,
154
- smooth: this.smooth,
155
- groupStart: 0,
156
- groupEnd: -1,
157
- groupCount: -1,
158
- inherited: !1
159
- };
160
- return n.clone = this.clone.bind(n), n;
161
- }
162
- };
163
- return this.materials.push(h), h;
164
- },
165
- currentMaterial: function() {
166
- if (this.materials.length > 0)
167
- return this.materials[this.materials.length - 1];
168
- },
169
- _finalize: function(e) {
170
- const r = this.currentMaterial();
171
- if (r && r.groupEnd === -1 && (r.groupEnd = this.geometry.vertices.length / 3, r.groupCount = r.groupEnd - r.groupStart, r.inherited = !1), e && this.materials.length > 1)
172
- for (let c = this.materials.length - 1; c >= 0; c--)
173
- this.materials[c].groupCount <= 0 && this.materials.splice(c, 1);
174
- return e && this.materials.length === 0 && this.materials.push({
175
- name: "",
176
- smooth: this.smooth
177
- }), r;
178
- }
179
- }, i && i.name && typeof i.clone == "function") {
180
- const e = i.clone(0);
181
- e.inherited = !0, this.object.materials.push(e);
182
- }
183
- this.objects.push(this.object);
184
- },
185
- finalize: function() {
186
- this.object && typeof this.object._finalize == "function" && this.object._finalize(!0);
187
- },
188
- parseVertexIndex: function(t, s) {
189
- const i = parseInt(t, 10);
190
- return (i >= 0 ? i - 1 : i + s / 3) * 3;
191
- },
192
- parseNormalIndex: function(t, s) {
193
- const i = parseInt(t, 10);
194
- return (i >= 0 ? i - 1 : i + s / 3) * 3;
195
- },
196
- parseUVIndex: function(t, s) {
197
- const i = parseInt(t, 10);
198
- return (i >= 0 ? i - 1 : i + s / 2) * 2;
199
- },
200
- addVertex: function(t, s, i) {
201
- const e = this.vertices, r = this.object.geometry.vertices;
202
- r.push(e[t + 0], e[t + 1], e[t + 2]), r.push(e[s + 0], e[s + 1], e[s + 2]), r.push(e[i + 0], e[i + 1], e[i + 2]);
203
- },
204
- addVertexPoint: function(t) {
205
- const s = this.vertices;
206
- this.object.geometry.vertices.push(s[t + 0], s[t + 1], s[t + 2]);
207
- },
208
- addVertexLine: function(t) {
209
- const s = this.vertices;
210
- this.object.geometry.vertices.push(s[t + 0], s[t + 1], s[t + 2]);
211
- },
212
- addNormal: function(t, s, i) {
213
- const e = this.normals, r = this.object.geometry.normals;
214
- r.push(e[t + 0], e[t + 1], e[t + 2]), r.push(e[s + 0], e[s + 1], e[s + 2]), r.push(e[i + 0], e[i + 1], e[i + 2]);
215
- },
216
- addFaceNormal: function(t, s, i) {
217
- const e = this.vertices, r = this.object.geometry.normals;
218
- te.fromArray(e, t), J.fromArray(e, s), se.fromArray(e, i), L.subVectors(se, J), re.subVectors(te, J), L.cross(re), L.normalize(), r.push(L.x, L.y, L.z), r.push(L.x, L.y, L.z), r.push(L.x, L.y, L.z);
219
- },
220
- addColor: function(t, s, i) {
221
- const e = this.colors, r = this.object.geometry.colors;
222
- e[t] !== void 0 && r.push(e[t + 0], e[t + 1], e[t + 2]), e[s] !== void 0 && r.push(e[s + 0], e[s + 1], e[s + 2]), e[i] !== void 0 && r.push(e[i + 0], e[i + 1], e[i + 2]);
223
- },
224
- addUV: function(t, s, i) {
225
- const e = this.uvs, r = this.object.geometry.uvs;
226
- r.push(e[t + 0], e[t + 1]), r.push(e[s + 0], e[s + 1]), r.push(e[i + 0], e[i + 1]);
227
- },
228
- addDefaultUV: function() {
229
- const t = this.object.geometry.uvs;
230
- t.push(0, 0), t.push(0, 0), t.push(0, 0);
231
- },
232
- addUVLine: function(t) {
233
- const s = this.uvs;
234
- this.object.geometry.uvs.push(s[t + 0], s[t + 1]);
235
- },
236
- addFace: function(t, s, i, e, r, c, h, l, n) {
237
- const a = this.vertices.length;
238
- let o = this.parseVertexIndex(t, a), u = this.parseVertexIndex(s, a), d = this.parseVertexIndex(i, a);
239
- if (this.addVertex(o, u, d), this.addColor(o, u, d), h !== void 0 && h !== "") {
240
- const m = this.normals.length;
241
- o = this.parseNormalIndex(h, m), u = this.parseNormalIndex(l, m), d = this.parseNormalIndex(n, m), this.addNormal(o, u, d);
242
- } else
243
- this.addFaceNormal(o, u, d);
244
- if (e !== void 0 && e !== "") {
245
- const m = this.uvs.length;
246
- o = this.parseUVIndex(e, m), u = this.parseUVIndex(r, m), d = this.parseUVIndex(c, m), this.addUV(o, u, d), this.object.geometry.hasUVIndices = !0;
247
- } else
248
- this.addDefaultUV();
249
- },
250
- addPointGeometry: function(t) {
251
- this.object.geometry.type = "Points";
252
- const s = this.vertices.length;
253
- for (let i = 0, e = t.length; i < e; i++) {
254
- const r = this.parseVertexIndex(t[i], s);
255
- this.addVertexPoint(r), this.addColor(r);
256
- }
257
- },
258
- addLineGeometry: function(t, s) {
259
- this.object.geometry.type = "Line";
260
- const i = this.vertices.length, e = this.uvs.length;
261
- for (let r = 0, c = t.length; r < c; r++)
262
- this.addVertexLine(this.parseVertexIndex(t[r], i));
263
- for (let r = 0, c = s.length; r < c; r++)
264
- this.addUVLine(this.parseUVIndex(s[r], e));
265
- }
266
- };
267
- return I.startObject("", !1), I;
268
- }
269
- class we extends Z {
270
- /**
271
- * Constructs a new OBJ loader.
272
- *
273
- * @param {LoadingManager} [manager] - The loading manager.
274
- */
275
- constructor(t) {
276
- super(t), this.materials = null;
277
- }
278
- /**
279
- * Starts loading from the given URL and passes the loaded OBJ asset
280
- * to the `onLoad()` callback.
281
- *
282
- * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.
283
- * @param {function(Group)} onLoad - Executed when the loading process has been finished.
284
- * @param {onProgressCallback} onProgress - Executed while the loading is in progress.
285
- * @param {onErrorCallback} onError - Executed when errors occur.
286
- */
287
- load(t, s, i, e) {
288
- const r = this, c = new Y(this.manager);
289
- c.setPath(this.path), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(t, function(h) {
290
- try {
291
- s(r.parse(h));
292
- } catch (l) {
293
- e ? e(l) : console.error(l), r.manager.itemError(t);
294
- }
295
- }, i, e);
296
- }
297
- /**
298
- * Sets the material creator for this OBJ. This object is loaded via {@link MTLLoader}.
299
- *
300
- * @param {MaterialCreator} materials - An object that creates the materials for this OBJ.
301
- * @return {OBJLoader} A reference to this loader.
302
- */
303
- setMaterials(t) {
304
- return this.materials = t, this;
305
- }
306
- /**
307
- * Parses the given OBJ data and returns the resulting group.
308
- *
309
- * @param {string} text - The raw OBJ data as a string.
310
- * @return {Group} The parsed OBJ.
311
- */
312
- parse(t) {
313
- const s = new me();
314
- t.indexOf(`\r
315
- `) !== -1 && (t = t.replace(/\r\n/g, `
316
- `)), t.indexOf(`\\
317
- `) !== -1 && (t = t.replace(/\\\n/g, ""));
318
- const i = t.split(`
319
- `);
320
- let e = [];
321
- for (let h = 0, l = i.length; h < l; h++) {
322
- const n = i[h].trimStart();
323
- if (n.length === 0) continue;
324
- const a = n.charAt(0);
325
- if (a !== "#")
326
- if (a === "v") {
327
- const o = n.split(ee);
328
- switch (o[0]) {
329
- case "v":
330
- s.vertices.push(
331
- parseFloat(o[1]),
332
- parseFloat(o[2]),
333
- parseFloat(o[3])
334
- ), o.length >= 7 ? (B.setRGB(
335
- parseFloat(o[4]),
336
- parseFloat(o[5]),
337
- parseFloat(o[6]),
338
- S
339
- ), s.colors.push(B.r, B.g, B.b)) : s.colors.push(void 0, void 0, void 0);
340
- break;
341
- case "vn":
342
- s.normals.push(
343
- parseFloat(o[1]),
344
- parseFloat(o[2]),
345
- parseFloat(o[3])
346
- );
347
- break;
348
- case "vt":
349
- s.uvs.push(
350
- parseFloat(o[1]),
351
- parseFloat(o[2])
352
- );
353
- break;
354
- }
355
- } else if (a === "f") {
356
- const u = n.slice(1).trim().split(ee), d = [];
357
- for (let p = 0, g = u.length; p < g; p++) {
358
- const b = u[p];
359
- if (b.length > 0) {
360
- const x = b.split("/");
361
- d.push(x);
362
- }
363
- }
364
- const m = d[0];
365
- for (let p = 1, g = d.length - 1; p < g; p++) {
366
- const b = d[p], x = d[p + 1];
367
- s.addFace(
368
- m[0],
369
- b[0],
370
- x[0],
371
- m[1],
372
- b[1],
373
- x[1],
374
- m[2],
375
- b[2],
376
- x[2]
377
- );
378
- }
379
- } else if (a === "l") {
380
- const o = n.substring(1).trim().split(" ");
381
- let u = [];
382
- const d = [];
383
- if (n.indexOf("/") === -1)
384
- u = o;
385
- else
386
- for (let m = 0, p = o.length; m < p; m++) {
387
- const g = o[m].split("/");
388
- g[0] !== "" && u.push(g[0]), g[1] !== "" && d.push(g[1]);
389
- }
390
- s.addLineGeometry(u, d);
391
- } else if (a === "p") {
392
- const u = n.slice(1).trim().split(" ");
393
- s.addPointGeometry(u);
394
- } else if ((e = ue.exec(n)) !== null) {
395
- const o = (" " + e[0].slice(1).trim()).slice(1);
396
- s.startObject(o);
397
- } else if (fe.test(n))
398
- s.object.startMaterial(n.substring(7).trim(), s.materialLibraries);
399
- else if (pe.test(n))
400
- s.materialLibraries.push(n.substring(7).trim());
401
- else if (de.test(n))
402
- console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');
403
- else if (a === "s") {
404
- if (e = n.split(" "), e.length > 1) {
405
- const u = e[1].trim().toLowerCase();
406
- s.object.smooth = u !== "0" && u !== "off";
407
- } else
408
- s.object.smooth = !0;
409
- const o = s.object.currentMaterial();
410
- o && (o.smooth = s.object.smooth);
411
- } else {
412
- if (n === "\0") continue;
413
- console.warn('THREE.OBJLoader: Unexpected line: "' + n + '"');
414
- }
415
- }
416
- s.finalize();
417
- const r = new ie();
418
- if (r.materialLibraries = [].concat(s.materialLibraries), !(s.objects.length === 1 && s.objects[0].geometry.vertices.length === 0) === !0)
419
- for (let h = 0, l = s.objects.length; h < l; h++) {
420
- const n = s.objects[h], a = n.geometry, o = n.materials, u = a.type === "Line", d = a.type === "Points";
421
- let m = !1;
422
- if (a.vertices.length === 0) continue;
423
- const p = new D();
424
- p.setAttribute("position", new k(a.vertices, 3)), a.normals.length > 0 && p.setAttribute("normal", new k(a.normals, 3)), a.colors.length > 0 && (m = !0, p.setAttribute("color", new k(a.colors, 3))), a.hasUVIndices === !0 && p.setAttribute("uv", new k(a.uvs, 2));
425
- const g = [];
426
- for (let x = 0, C = o.length; x < C; x++) {
427
- const v = o[x], j = v.name + "_" + v.smooth + "_" + m;
428
- let f = s.materials[j];
429
- if (this.materials !== null) {
430
- if (f = this.materials.create(v.name), u && f && !(f instanceof N)) {
431
- const w = new N();
432
- X.prototype.copy.call(w, f), w.color.copy(f.color), f = w;
433
- } else if (d && f && !(f instanceof T)) {
434
- const w = new T({ size: 10, sizeAttenuation: !1 });
435
- X.prototype.copy.call(w, f), w.color.copy(f.color), w.map = f.map, f = w;
436
- }
437
- }
438
- f === void 0 && (u ? f = new N() : d ? f = new T({ size: 1, sizeAttenuation: !1 }) : f = new ne(), f.name = v.name, f.flatShading = !v.smooth, f.vertexColors = m, s.materials[j] = f), g.push(f);
439
- }
440
- let b;
441
- if (g.length > 1) {
442
- for (let x = 0, C = o.length; x < C; x++) {
443
- const v = o[x];
444
- p.addGroup(v.groupStart, v.groupCount, x);
445
- }
446
- u ? b = new $(p, g) : d ? b = new W(p, g) : b = new K(p, g);
447
- } else
448
- u ? b = new $(p, g[0]) : d ? b = new W(p, g[0]) : b = new K(p, g[0]);
449
- b.name = n.name, r.add(b);
450
- }
451
- else if (s.vertices.length > 0) {
452
- const h = new T({ size: 1, sizeAttenuation: !1 }), l = new D();
453
- l.setAttribute("position", new k(s.vertices, 3)), s.colors.length > 0 && s.colors[0] !== void 0 && (l.setAttribute("color", new k(s.colors, 3)), h.vertexColors = !0);
454
- const n = new W(l, h);
455
- r.add(n);
456
- }
457
- return r;
458
- }
459
- }
460
- class ye extends Z {
461
- constructor(t) {
462
- super(t);
463
- }
464
- /**
465
- * Starts loading from the given URL and passes the loaded MTL asset
466
- * to the `onLoad()` callback.
467
- *
468
- * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.
469
- * @param {function(MaterialCreator)} onLoad - Executed when the loading process has been finished.
470
- * @param {onProgressCallback} onProgress - Executed while the loading is in progress.
471
- * @param {onErrorCallback} onError - Executed when errors occur.
472
- */
473
- load(t, s, i, e) {
474
- const r = this, c = this.path === "" ? ae.extractUrlBase(t) : this.path, h = new Y(this.manager);
475
- h.setPath(this.path), h.setRequestHeader(this.requestHeader), h.setWithCredentials(this.withCredentials), h.load(t, function(l) {
476
- try {
477
- s(r.parse(l, c));
478
- } catch (n) {
479
- e ? e(n) : console.error(n), r.manager.itemError(t);
480
- }
481
- }, i, e);
482
- }
483
- /**
484
- * Sets the material options.
485
- *
486
- * @param {MTLLoader~MaterialOptions} value - The material options.
487
- * @return {MTLLoader} A reference to this loader.
488
- */
489
- setMaterialOptions(t) {
490
- return this.materialOptions = t, this;
491
- }
492
- /**
493
- * Parses the given MTL data and returns the resulting material creator.
494
- *
495
- * @param {string} text - The raw MTL data as a string.
496
- * @param {string} path - The URL base path.
497
- * @return {MaterialCreator} The material creator.
498
- */
499
- parse(t, s) {
500
- const i = t.split(`
501
- `);
502
- let e = {};
503
- const r = /\s+/, c = {};
504
- for (let l = 0; l < i.length; l++) {
505
- let n = i[l];
506
- if (n = n.trim(), n.length === 0 || n.charAt(0) === "#")
507
- continue;
508
- const a = n.indexOf(" ");
509
- let o = a >= 0 ? n.substring(0, a) : n;
510
- o = o.toLowerCase();
511
- let u = a >= 0 ? n.substring(a + 1) : "";
512
- if (u = u.trim(), o === "newmtl")
513
- e = { name: u }, c[u] = e;
514
- else if (o === "ka" || o === "kd" || o === "ks" || o === "ke") {
515
- const d = u.split(r, 3);
516
- e[o] = [parseFloat(d[0]), parseFloat(d[1]), parseFloat(d[2])];
517
- } else
518
- e[o] = u;
519
- }
520
- const h = new ge(this.resourcePath || s, this.materialOptions);
521
- return h.setCrossOrigin(this.crossOrigin), h.setManager(this.manager), h.setMaterials(c), h;
522
- }
523
- }
524
- class ge {
525
- constructor(t = "", s = {}) {
526
- this.baseUrl = t, this.options = s, this.materialsInfo = {}, this.materials = {}, this.materialsArray = [], this.nameLookup = {}, this.crossOrigin = "anonymous", this.side = this.options.side !== void 0 ? this.options.side : oe, this.wrap = this.options.wrap !== void 0 ? this.options.wrap : le;
527
- }
528
- setCrossOrigin(t) {
529
- return this.crossOrigin = t, this;
530
- }
531
- setManager(t) {
532
- this.manager = t;
533
- }
534
- setMaterials(t) {
535
- this.materialsInfo = this.convert(t), this.materials = {}, this.materialsArray = [], this.nameLookup = {};
536
- }
537
- convert(t) {
538
- if (!this.options) return t;
539
- const s = {};
540
- for (const i in t) {
541
- const e = t[i], r = {};
542
- s[i] = r;
543
- for (const c in e) {
544
- let h = !0, l = e[c];
545
- const n = c.toLowerCase();
546
- switch (n) {
547
- case "kd":
548
- case "ka":
549
- case "ks":
550
- this.options && this.options.normalizeRGB && (l = [l[0] / 255, l[1] / 255, l[2] / 255]), this.options && this.options.ignoreZeroRGBs && l[0] === 0 && l[1] === 0 && l[2] === 0 && (h = !1);
551
- break;
552
- }
553
- h && (r[n] = l);
554
- }
555
- }
556
- return s;
557
- }
558
- preload() {
559
- for (const t in this.materialsInfo)
560
- this.create(t);
561
- }
562
- getIndex(t) {
563
- return this.nameLookup[t];
564
- }
565
- getAsArray() {
566
- let t = 0;
567
- for (const s in this.materialsInfo)
568
- this.materialsArray[t] = this.create(s), this.nameLookup[s] = t, t++;
569
- return this.materialsArray;
570
- }
571
- create(t) {
572
- return this.materials[t] === void 0 && this.createMaterial_(t), this.materials[t];
573
- }
574
- createMaterial_(t) {
575
- const s = this, i = this.materialsInfo[t], e = {
576
- name: t,
577
- side: this.side
578
- };
579
- function r(h, l) {
580
- return typeof l != "string" || l === "" ? "" : /^https?:\/\//i.test(l) ? l : h + l;
581
- }
582
- function c(h, l) {
583
- if (e[h]) return;
584
- const n = s.getTextureParams(l, e), a = s.loadTexture(r(s.baseUrl, n.url));
585
- a.repeat.copy(n.scale), a.offset.copy(n.offset), a.wrapS = s.wrap, a.wrapT = s.wrap, (h === "map" || h === "emissiveMap") && (a.colorSpace = S), e[h] = a;
586
- }
587
- for (const h in i) {
588
- const l = i[h];
589
- let n;
590
- if (l !== "")
591
- switch (h.toLowerCase()) {
592
- // Ns is material specular exponent
593
- case "kd":
594
- e.color = q.colorSpaceToWorking(new P().fromArray(l), S);
595
- break;
596
- case "ks":
597
- e.specular = q.colorSpaceToWorking(new P().fromArray(l), S);
598
- break;
599
- case "ke":
600
- e.emissive = q.colorSpaceToWorking(new P().fromArray(l), S);
601
- break;
602
- case "map_kd":
603
- c("map", l);
604
- break;
605
- case "map_ks":
606
- c("specularMap", l);
607
- break;
608
- case "map_ke":
609
- c("emissiveMap", l);
610
- break;
611
- case "norm":
612
- c("normalMap", l);
613
- break;
614
- case "map_bump":
615
- case "bump":
616
- c("bumpMap", l);
617
- break;
618
- case "disp":
619
- c("displacementMap", l);
620
- break;
621
- case "map_d":
622
- c("alphaMap", l), e.transparent = !0;
623
- break;
624
- case "ns":
625
- e.shininess = parseFloat(l);
626
- break;
627
- case "d":
628
- n = parseFloat(l), n < 1 && (e.opacity = n, e.transparent = !0);
629
- break;
630
- case "tr":
631
- n = parseFloat(l), this.options && this.options.invertTrProperty && (n = 1 - n), n > 0 && (e.opacity = 1 - n, e.transparent = !0);
632
- break;
633
- }
634
- }
635
- return this.materials[t] = new ne(e), this.materials[t];
636
- }
637
- getTextureParams(t, s) {
638
- const i = {
639
- scale: new Q(1, 1),
640
- offset: new Q(0, 0)
641
- }, e = t.split(/\s+/);
642
- let r;
643
- return r = e.indexOf("-bm"), r >= 0 && (s.bumpScale = parseFloat(e[r + 1]), e.splice(r, 2)), r = e.indexOf("-mm"), r >= 0 && (s.displacementBias = parseFloat(e[r + 1]), s.displacementScale = parseFloat(e[r + 2]), e.splice(r, 3)), r = e.indexOf("-s"), r >= 0 && (i.scale.set(parseFloat(e[r + 1]), parseFloat(e[r + 2])), e.splice(r, 4)), r = e.indexOf("-o"), r >= 0 && (i.offset.set(parseFloat(e[r + 1]), parseFloat(e[r + 2])), e.splice(r, 4)), i.url = e.join(" ").trim(), i;
644
- }
645
- loadTexture(t, s, i, e, r) {
646
- const c = this.manager !== void 0 ? this.manager : ce;
647
- let h = c.getHandler(t);
648
- h === null && (h = new he(c)), h.setCrossOrigin && h.setCrossOrigin(this.crossOrigin);
649
- const l = h.load(t, i, e, r);
650
- return s !== void 0 && (l.mapping = s), l;
651
- }
652
- }
653
- export {
654
- ye as M,
655
- we as O,
656
- xe as S
657
- };