ss-component-new 1.2.97 → 1.2.99

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-B4z0XNO-.js +304 -0
  2. package/dist/MTLLoader-n_3HPhif.cjs +2 -0
  3. package/dist/OBJLoader-C_JaUegI.cjs +5 -0
  4. package/dist/OBJLoader-Dilcv9TL.js +356 -0
  5. package/dist/{OrbitControls-B85G8nPk.cjs → OrbitControls-8LBwRzcq.cjs} +1 -1
  6. package/dist/{OrbitControls-DFhYzlF3.js → OrbitControls-Cz47Q27N.js} +1 -1
  7. package/dist/{animationData-DfKVkFbz.js → animationData-C8lM4zZj.js} +1 -1
  8. package/dist/{animationData-DxBvEqB1.cjs → animationData-CKcPDmLp.cjs} +1 -1
  9. package/dist/{iconfont-C7kE-QbU.cjs → iconfont-B1cUqs_N.cjs} +1 -1
  10. package/dist/{iconfont-WOKNi2xx.js → iconfont-CUWS5tNH.js} +2 -2
  11. package/dist/{index-D0hovh9R.cjs → index-2hqZ_tND.cjs} +1 -1
  12. package/dist/{index-331j518H.cjs → index-AuEh0RiU.cjs} +1 -1
  13. package/dist/{index-D_igus4A.cjs → index-B2UPNwqJ.cjs} +1 -1
  14. package/dist/{index-BYk9Fb6p.js → index-BCvmfE-Q.js} +3 -3
  15. package/dist/{index-DeOwZgqL.js → index-BDw8DIQx.js} +130 -130
  16. package/dist/{index-CqI3frdZ.js → index-BPv8txj6.js} +6 -6
  17. package/dist/{index-DgZVeYqH.js → index-BQaejVqo.js} +1 -1
  18. package/dist/{index-DSPjcpWK.cjs → index-Ba16ouw0.cjs} +1 -1
  19. package/dist/{index-D_RGoDln.js → index-BaSO3EEl.js} +3 -3
  20. package/dist/{index-DHZMd8iK.cjs → index-BdSiNUC0.cjs} +1 -1
  21. package/dist/{index-BDxPlbe2.cjs → index-BfU8GMj1.cjs} +1 -1
  22. package/dist/{index-Cppt0AsF.cjs → index-BjKKDSDx.cjs} +1 -1
  23. package/dist/{index-C-dlFxRJ.cjs → index-BqgfejIC.cjs} +1 -1
  24. package/dist/{index-BODyH6MD.js → index-BxONUPjM.js} +1 -1
  25. package/dist/{index-BFzMf0GC.js → index-Byp3gJNW.js} +1 -1
  26. package/dist/{index-DJ6qg2Mo.js → index-C7ZsHeLt.js} +3 -3
  27. package/dist/{index-B-AhHUV1.js → index-C9p_wwJ7.js} +6 -6
  28. package/dist/{index-BoTiP0aV.js → index-CKlt750z.js} +1 -1
  29. package/dist/{index-CQRJ3pLh.cjs → index-CQwDw3-2.cjs} +1 -1
  30. package/dist/{index-hhS08X8b.js → index-CR1Ng5ip.js} +3 -3
  31. package/dist/{index-D6u590uA.cjs → index-CZIqVNof.cjs} +1 -1
  32. package/dist/{index-iErxMZBi.cjs → index-C_208RkZ.cjs} +1 -1
  33. package/dist/{index-S1LIIzCa.cjs → index-CqZ1E-Mt.cjs} +1 -1
  34. package/dist/{index-DHjtOySN.js → index-CrNsPd4D.js} +2 -2
  35. package/dist/{index-DrzK0O_g.cjs → index-CvQCAGWI.cjs} +1 -1
  36. package/dist/{index-Cnk_4Zz5.cjs → index-CyCcPnZb.cjs} +1 -1
  37. package/dist/{index-BI7g3c_u.js → index-CyE5qCBb.js} +13 -13
  38. package/dist/{index-DHBoRe9V.cjs → index-D32pAhQk.cjs} +1 -1
  39. package/dist/{index-DRfVnLTN.js → index-DAUjjqaD.js} +391 -391
  40. package/dist/{index-DbDM-XfB.cjs → index-DQTlc6Gq.cjs} +1 -1
  41. package/dist/{index-B_zjoT4m.js → index-DTilOAv_.js} +2 -2
  42. package/dist/{index-_PP-dSm3.cjs → index-D_22J0ok.cjs} +1 -1
  43. package/dist/{index-iZ9BRKg5.js → index-DboUMA_C.js} +1 -1
  44. package/dist/{index-BXv3aZ7v.js → index-DgMQpO6g.js} +1 -1
  45. package/dist/{index-CPAXrzNY.cjs → index-Dh6GqpZF.cjs} +1 -1
  46. package/dist/{index-CZPnP0uy.cjs → index-DhqEoDPT.cjs} +1 -1
  47. package/dist/{index-CeGM8aBH.js → index-DlwlGkyt.js} +2 -2
  48. package/dist/{index-6sZXjGGz.cjs → index-DtDmxPdD.cjs} +1 -1
  49. package/dist/{index-kLDMroPk.js → index-GxmJC9kr.js} +1 -1
  50. package/dist/{index-CLOUp_4j.cjs → index-XKn5AuYT.cjs} +1 -1
  51. package/dist/{index-Cr5if46q.js → index-mEKMjplD.js} +1 -1
  52. package/dist/{index-Bhha7SY3.js → index-vglZ0qjT.js} +1 -1
  53. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DSlAeFA3.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DKwCF412.cjs} +1 -1
  54. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-ERjMISIK.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DqIuWlps.js} +6 -6
  55. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-3GcG1eTD.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CICG8Qah.js} +8908 -8949
  56. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dzyqt2Z-.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-K6lh7Rrj.cjs} +302 -302
  57. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-mJB_yl_P.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-Cpyo5jke.js} +3 -3
  58. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DODc2KPN.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-Cq8VF9uK.cjs} +1 -1
  59. package/dist/{index.vue_vue_type_style_index_1_lang-BH0DRFVE.js → index.vue_vue_type_style_index_1_lang-B_HCEX9y.js} +6 -5
  60. package/dist/{index.vue_vue_type_style_index_1_lang-BRFs_L5R.cjs → index.vue_vue_type_style_index_1_lang-rTLLuvuo.cjs} +5 -5
  61. package/dist/loaderUtil-B0djdt91.js +5 -0
  62. package/dist/loaderUtil-CaWWb8db.cjs +1 -0
  63. package/dist/{main-Z5UMyCj6.js → main-DHx-3OSy.js} +2 -2
  64. package/dist/{main-B541MQH8.cjs → main-DS156sQ4.cjs} +1 -1
  65. package/dist/ss-component.cjs +1 -1
  66. package/dist/ss-component.css +1 -1
  67. package/dist/ss-component.js +9 -9
  68. package/dist/ss-component2.cjs +1 -1
  69. package/dist/ss-component2.js +10 -10
  70. package/dist/{threeModel-tKq0hvaK.cjs → threeModel-CfIK1rQB.cjs} +1 -1
  71. package/dist/{threeModel-BcjGbIJZ.js → threeModel-WYCdw_Ff.js} +4 -4
  72. package/dist/{threePreview-BnPMGQ2H.js → threePreview-C29AR7Mr.js} +310 -305
  73. package/dist/threePreview-Ci8TnUQ8.cjs +1 -0
  74. package/dist/{threeSceneView-DVUTlm6F.cjs → threeSceneView-C2MDCMux.cjs} +2 -2
  75. package/dist/{threeSceneView-BUD002PP.js → threeSceneView-F15mW1mm.js} +7 -7
  76. package/dist/threeSceneViewForCPMPIP-DK4G_ZpP.js +687 -0
  77. package/dist/threeSceneViewForCPMPIP-DuPZn_qv.cjs +5 -0
  78. package/dist/threeTrackPathView-C4eBUMef.cjs +370 -0
  79. package/dist/{threeTrackPathView-DDCEu3Gx.js → threeTrackPathView-DMj6YGxT.js} +436 -427
  80. package/dist/{threeViewerHost-BVeUteVd.js → threeViewerHost-C9ipsMff.js} +2 -2
  81. package/dist/{threeViewerHost-Sda_AoRw.cjs → threeViewerHost-CW6JmOUJ.cjs} +2 -2
  82. package/dist/{urdfTree-Br9VYqKp.cjs → urdfTree-CTiMB7ge.cjs} +1 -1
  83. package/dist/{urdfTree-DaWvX-6R.js → urdfTree-DGEACy9-.js} +1 -1
  84. package/dist/{workpieceTreePanel-BdRaFNRp.js → workpieceTreePanel-C1gy5a8r.js} +53 -52
  85. package/dist/workpieceTreePanel-Ded0Gqke.cjs +1 -0
  86. package/package.json +1 -1
  87. package/dist/MTLLoader-DnouUI-8.js +0 -657
  88. package/dist/MTLLoader-zZDM0NQh.cjs +0 -6
  89. package/dist/obj/model.mtl +0 -42
  90. package/dist/obj/model.obj +0 -26110
  91. package/dist/threePreview-DD0br2ae.cjs +0 -1
  92. package/dist/threeSceneViewForCPMPIP-BYYbyqD7.cjs +0 -5
  93. package/dist/threeSceneViewForCPMPIP-D4RC4BAo.js +0 -683
  94. package/dist/threeTrackPathView-BvUihuyk.cjs +0 -370
  95. package/dist/workpieceTreePanel-Z3aVdOWB.cjs +0 -1
  96. package/public/obj/model.mtl +0 -42
  97. package/public/obj/model.obj +0 -26110
@@ -1,657 +0,0 @@
1
- import { O as Y, R as Z, w as D, C as P, f as S, a5 as H, V as O, aG as _, u as ie, ai as N, ah as Q, ag as R, o as ne, am as X, ao as W, k as K, Q as oe, aB as ae, ad as le, aA as q, Y as $, b2 as ce, a3 as he } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-3GcG1eTD.js";
2
- class xe extends Y {
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 Z(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 o = new DataView(n), a = 32 / 8 * 3 + 32 / 8 * 3 * 3 + 16 / 8, u = o.getUint32(80, !0);
39
- if (80 + 32 / 8 + u * a === o.byteLength)
40
- return !0;
41
- const m = [115, 111, 108, 105, 100];
42
- for (let p = 0; p < 5; p++)
43
- if (i(m, o, p)) return !1;
44
- return !0;
45
- }
46
- function i(n, o, a) {
47
- for (let u = 0, d = n.length; u < d; u++)
48
- if (n[u] !== o.getUint8(a + u)) return !1;
49
- return !0;
50
- }
51
- function e(n) {
52
- const o = new DataView(n), a = o.getUint32(80, !0);
53
- let u, d, m, p = !1, g, b, x, C, v;
54
- for (let y = 0; y < 70; y++)
55
- o.getUint32(y, !1) == 1129270351 && o.getUint8(y + 4) == 82 && o.getUint8(y + 5) == 61 && (p = !0, g = new Float32Array(a * 3 * 3), b = o.getUint8(y + 6) / 255, x = o.getUint8(y + 7) / 255, C = o.getUint8(y + 8) / 255, v = o.getUint8(y + 9) / 255);
56
- const j = 84, f = 12 * 4 + 2, w = new D(), M = new Float32Array(a * 3 * 3), V = new Float32Array(a * 3 * 3), k = new P();
57
- for (let y = 0; y < a; y++) {
58
- const U = j + y * f, G = o.getFloat32(U, !0), z = o.getFloat32(U + 4, !0), B = o.getFloat32(U + 8, !0);
59
- if (p) {
60
- const F = o.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 E = U + F * 12, A = y * 3 * 3 + (F - 1) * 3;
65
- M[A] = o.getFloat32(E, !0), M[A + 1] = o.getFloat32(E + 4, !0), M[A + 2] = o.getFloat32(E + 8, !0), V[A] = G, V[A + 1] = z, V[A + 2] = B, p && (k.setRGB(u, d, m, S), g[A] = k.r, g[A + 1] = k.g, g[A + 2] = k.b);
66
- }
67
- }
68
- return w.setAttribute("position", new H(M, 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 o = new D(), a = /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, M = 0, V = 0;
75
- for (; (f = a.exec(n)) !== null; ) {
76
- M = V;
77
- const k = f[0], y = (f = d.exec(k)) !== null ? f[1] : "";
78
- for (v.push(y); (f = u.exec(k)) !== null; ) {
79
- let z = 0, B = 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]), B++;
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
- B !== 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 = M, G = V - M;
88
- o.userData.groupNames = v, o.addGroup(U, G, w), w++;
89
- }
90
- return o.setAttribute("position", new _(x, 3)), o.setAttribute("normal", new _(C, 3)), o;
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 o = new Uint8Array(n.length);
98
- for (let a = 0; a < n.length; a++)
99
- o[a] = n.charCodeAt(a) & 255;
100
- return o.buffer || o;
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(), T = 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 o = this.vertices.length;
238
- let a = this.parseVertexIndex(t, o), u = this.parseVertexIndex(s, o), d = this.parseVertexIndex(i, o);
239
- if (this.addVertex(a, u, d), this.addColor(a, u, d), h !== void 0 && h !== "") {
240
- const m = this.normals.length;
241
- a = this.parseNormalIndex(h, m), u = this.parseNormalIndex(l, m), d = this.parseNormalIndex(n, m), this.addNormal(a, u, d);
242
- } else
243
- this.addFaceNormal(a, u, d);
244
- if (e !== void 0 && e !== "") {
245
- const m = this.uvs.length;
246
- a = this.parseUVIndex(e, m), u = this.parseUVIndex(r, m), d = this.parseUVIndex(c, m), this.addUV(a, 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 Y {
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 Z(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 o = n.charAt(0);
325
- if (o !== "#")
326
- if (o === "v") {
327
- const a = n.split(ee);
328
- switch (a[0]) {
329
- case "v":
330
- s.vertices.push(
331
- parseFloat(a[1]),
332
- parseFloat(a[2]),
333
- parseFloat(a[3])
334
- ), a.length >= 7 ? (T.setRGB(
335
- parseFloat(a[4]),
336
- parseFloat(a[5]),
337
- parseFloat(a[6]),
338
- S
339
- ), s.colors.push(T.r, T.g, T.b)) : s.colors.push(void 0, void 0, void 0);
340
- break;
341
- case "vn":
342
- s.normals.push(
343
- parseFloat(a[1]),
344
- parseFloat(a[2]),
345
- parseFloat(a[3])
346
- );
347
- break;
348
- case "vt":
349
- s.uvs.push(
350
- parseFloat(a[1]),
351
- parseFloat(a[2])
352
- );
353
- break;
354
- }
355
- } else if (o === "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 (o === "l") {
380
- const a = n.substring(1).trim().split(" ");
381
- let u = [];
382
- const d = [];
383
- if (n.indexOf("/") === -1)
384
- u = a;
385
- else
386
- for (let m = 0, p = a.length; m < p; m++) {
387
- const g = a[m].split("/");
388
- g[0] !== "" && u.push(g[0]), g[1] !== "" && d.push(g[1]);
389
- }
390
- s.addLineGeometry(u, d);
391
- } else if (o === "p") {
392
- const u = n.slice(1).trim().split(" ");
393
- s.addPointGeometry(u);
394
- } else if ((e = ue.exec(n)) !== null) {
395
- const a = (" " + e[0].slice(1).trim()).slice(1);
396
- s.startObject(a);
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 (o === "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 a = s.object.currentMaterial();
410
- a && (a.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], o = n.geometry, a = n.materials, u = o.type === "Line", d = o.type === "Points";
421
- let m = !1;
422
- if (o.vertices.length === 0) continue;
423
- const p = new D();
424
- p.setAttribute("position", new _(o.vertices, 3)), o.normals.length > 0 && p.setAttribute("normal", new _(o.normals, 3)), o.colors.length > 0 && (m = !0, p.setAttribute("color", new _(o.colors, 3))), o.hasUVIndices === !0 && p.setAttribute("uv", new _(o.uvs, 2));
425
- const g = [];
426
- for (let x = 0, C = a.length; x < C; x++) {
427
- const v = a[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
- Q.prototype.copy.call(w, f), w.color.copy(f.color), f = w;
433
- } else if (d && f && !(f instanceof R)) {
434
- const w = new R({ size: 10, sizeAttenuation: !1 });
435
- Q.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 R({ 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 = a.length; x < C; x++) {
443
- const v = a[x];
444
- p.addGroup(v.groupStart, v.groupCount, x);
445
- }
446
- u ? b = new X(p, g) : d ? b = new W(p, g) : b = new K(p, g);
447
- } else
448
- u ? b = new X(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 R({ size: 1, sizeAttenuation: !1 }), l = new D();
453
- l.setAttribute("position", new _(s.vertices, 3)), s.colors.length > 0 && s.colors[0] !== void 0 && (l.setAttribute("color", new _(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 Y {
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 === "" ? oe.extractUrlBase(t) : this.path, h = new Z(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 o = n.indexOf(" ");
509
- let a = o >= 0 ? n.substring(0, o) : n;
510
- a = a.toLowerCase();
511
- let u = o >= 0 ? n.substring(o + 1) : "";
512
- if (u = u.trim(), a === "newmtl")
513
- e = { name: u }, c[u] = e;
514
- else if (a === "ka" || a === "kd" || a === "ks" || a === "ke") {
515
- const d = u.split(r, 3);
516
- e[a] = [parseFloat(d[0]), parseFloat(d[1]), parseFloat(d[2])];
517
- } else
518
- e[a] = 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 : ae, 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), o = s.loadTexture(r(s.baseUrl, n.url));
585
- o.repeat.copy(n.scale), o.offset.copy(n.offset), o.wrapS = s.wrap, o.wrapT = s.wrap, (h === "map" || h === "emissiveMap") && (o.colorSpace = S), e[h] = o;
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 $(1, 1),
640
- offset: new $(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
- };