ss-component-new 1.1.1007 → 1.2.1

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 (132) hide show
  1. package/dist/OrbitControls-D1lM0xvz.cjs +1 -0
  2. package/dist/OrbitControls-DI8fa9gz.js +419 -0
  3. package/dist/STLLoader-KxFIlfhN.cjs +6 -0
  4. package/dist/STLLoader-memlq1bT.js +609 -0
  5. package/dist/{animationData-Bu38Hl4M.js → animationData-BDq02_ir.js} +14 -14
  6. package/dist/animationData-BRDoJBuV.cjs +1 -0
  7. package/dist/{array-DljC5ibo.js → array-A59WrroX.js} +1 -1
  8. package/dist/{array-BPHS7JFA.cjs → array-BtZq8qON.cjs} +1 -1
  9. package/dist/config.js +1 -1
  10. package/dist/{iconfont-pt17sMx3.js → iconfont-7cEds3Xj.js} +2 -2
  11. package/dist/{iconfont-t5epssvu.cjs → iconfont-CsuwJCas.cjs} +1 -1
  12. package/dist/{index-d6tSWKtY.cjs → index-1z9RrjZc.cjs} +1 -1
  13. package/dist/{index-QSIG57Cs.cjs → index-6t33eejU.cjs} +1 -1
  14. package/dist/{index-DqAoBcTD.cjs → index-B1ul2ExO.cjs} +1 -1
  15. package/dist/{index-BlbmO49N.js → index-B35e4i9n.js} +2 -2
  16. package/dist/{index-Da8C2puT.js → index-B9j8fCyS.js} +2 -2
  17. package/dist/index-BB6zZsmY.cjs +1 -0
  18. package/dist/{index-Cxyot1Se.js → index-BTrjEMt1.js} +4 -4
  19. package/dist/{index-CZ3UyOmT.cjs → index-B_k7wRBo.cjs} +1 -1
  20. package/dist/{index-B2lf8ui6.cjs → index-BdL8I_2i.cjs} +1 -1
  21. package/dist/{index-DQ4-s08u.js → index-BeTQ6ief.js} +4 -4
  22. package/dist/{index--7AqRoC1.js → index-BgJn4mlV.js} +4 -4
  23. package/dist/{index-BCeME5xm.js → index-BqCCREh3.js} +6 -6
  24. package/dist/{index-D3DLg4SF.js → index-BvPC1LSv.js} +18 -18
  25. package/dist/{index-oNErZJKp.js → index-BwjuTBrR.js} +1 -1
  26. package/dist/index-BxPnA2or.js +7294 -0
  27. package/dist/{index-CabdCJxd.js → index-C23iUpXa.js} +7 -7
  28. package/dist/{index-VfEaAkaq.cjs → index-C3CD2NW8.cjs} +1 -1
  29. package/dist/{index-DmXN3-YT.js → index-C461j30b.js} +1 -1
  30. package/dist/{index-B8xZFJ-x.js → index-C6Uddqal.js} +2 -2
  31. package/dist/{index-BtHzGwZt.js → index-CFg3-0Tk.js} +2 -2
  32. package/dist/{index-BstWDfX-.cjs → index-CJzA3AAO.cjs} +1 -1
  33. package/dist/{index-BRJVgxUP.cjs → index-CNJzNn6z.cjs} +1 -1
  34. package/dist/{index-C-KrU6Qo.cjs → index-CVl84S8B.cjs} +1 -1
  35. package/dist/{index-CZEK1c2_.js → index-CYp77kPp.js} +176 -176
  36. package/dist/{index-BCIKC9PE.js → index-C_VamYcq.js} +6 -6
  37. package/dist/{index-CmlXlH2b.cjs → index-CjI5pDiU.cjs} +1 -1
  38. package/dist/{index-efKjAh7G.cjs → index-CrWFG4Wb.cjs} +1 -1
  39. package/dist/{index-DIehhXd9.cjs → index-Crd4LGue.cjs} +1 -1
  40. package/dist/{index-feAp8_X8.cjs → index-CtG-uyjY.cjs} +1 -1
  41. package/dist/{index-DHy1RHXi.cjs → index-CtPy-3S1.cjs} +1 -1
  42. package/dist/{index-D3VTHlZh.js → index-CvEj4aiY.js} +4 -4
  43. package/dist/{index-DzcelPVu.cjs → index-Cx302rHQ.cjs} +1 -1
  44. package/dist/{index-BrsIZVyD.cjs → index-CxnH4vfV.cjs} +1 -1
  45. package/dist/{index-hsKO-I_N.js → index-Cz03X-rX.js} +1 -1
  46. package/dist/{index-DxggSUtV.cjs → index-D8S0DVkq.cjs} +1 -1
  47. package/dist/{index-BuBVqjpx.js → index-DH0dVg0N.js} +7 -7
  48. package/dist/{index-oCii55Zs.cjs → index-DIm3MBK_.cjs} +1 -1
  49. package/dist/{index-CnqhOUek.js → index-DNE4QDIf.js} +3 -3
  50. package/dist/{index-BCXz_U9h.cjs → index-DQTI3BuS.cjs} +1 -1
  51. package/dist/{index-De9VWWmT.cjs → index-DS3OziT5.cjs} +1 -1
  52. package/dist/{index-Hm2_zeiV.js → index-DVvt9_w0.js} +1 -1
  53. package/dist/{index-DqhAoamS.cjs → index-DmB0dlGH.cjs} +1 -1
  54. package/dist/index-Dn9I5-1H.cjs +1 -0
  55. package/dist/{index-s1sBvg7-.cjs → index-DqaA5Rvx.cjs} +1 -1
  56. package/dist/{index-Bu-yHmJc.cjs → index-DqquxuCt.cjs} +1 -1
  57. package/dist/{index-DsIUgynO.js → index-DygW4mGC.js} +6 -6
  58. package/dist/{index-1gIP1dMc.cjs → index-HFf3Z0Ft.cjs} +1 -1
  59. package/dist/{index-BvDv1IKK.cjs → index-Kg96Vvn5.cjs} +1 -1
  60. package/dist/{index-DaBbEkRJ.js → index-N7dEiXLQ.js} +13 -13
  61. package/dist/index-TXrydBPq.cjs +1 -0
  62. package/dist/{index-BcBpmCfF.cjs → index-XQxaEXgz.cjs} +1 -1
  63. package/dist/{index-BHNtRl-8.js → index-Y5i13RsM.js} +3 -3
  64. package/dist/{index-CrKg8KZt.js → index-YQnrEK_K.js} +1069 -1061
  65. package/dist/{index-Jyps1gRD.js → index-aneoZx5F.js} +24 -24
  66. package/dist/{index-BdY8Qg-6.cjs → index-byBdKAky.cjs} +1 -1
  67. package/dist/{index-DWuAa5Ws.js → index-db5CgGrA.js} +394 -394
  68. package/dist/{index-TwtUdAMm.js → index-dqBbhGfy.js} +6 -6
  69. package/dist/{index-Dw_nYMhJ.cjs → index-gjDjqhNq.cjs} +2 -2
  70. package/dist/{index-K1m0RQMs.js → index-nq9fleOT.js} +2 -2
  71. package/dist/{index-oI1HUneF.js → index-qoqka5Nb.js} +1 -1
  72. package/dist/{index-DZHLGAn0.js → index-wHil9Fox.js} +2 -2
  73. package/dist/{index-Dtk-Fgm3.js → index-wq8KZGnQ.js} +5 -5
  74. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CPiIzB84.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CzcK5mCc.cjs} +1 -1
  75. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DC4zFlOQ.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dmm4yqcc.js} +2 -2
  76. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DMhv31o4.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-B0Ivzvcp.js} +6 -6
  77. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DV4d1URg.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-xm0hMPwT.cjs} +1 -1
  78. package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-CMx9TLjC.cjs +56 -0
  79. package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-Czu5g16A.js +37436 -0
  80. package/dist/{index.vue_vue_type_style_index_1_lang-DgDibOnl.js → index.vue_vue_type_style_index_1_lang-AXp5rRSK.js} +76 -76
  81. package/dist/{index.vue_vue_type_style_index_1_lang-B1fiFPmj.js → index.vue_vue_type_style_index_1_lang-BxEXAMMV.js} +5012 -5100
  82. package/dist/{index.vue_vue_type_style_index_1_lang-CwJCb_rE.cjs → index.vue_vue_type_style_index_1_lang-CXwGS60-.cjs} +45 -46
  83. package/dist/{index.vue_vue_type_style_index_1_lang-B2vK-1an.cjs → index.vue_vue_type_style_index_1_lang-j5HrYuvy.cjs} +1 -1
  84. package/dist/{isString-D3DhambW.js → isString-BNK38WbE.js} +1 -1
  85. package/dist/{isString-ChvWbctO.cjs → isString-BmAegMGI.cjs} +1 -1
  86. package/dist/{main-YesjKNW0.cjs → main-BgpAXuSa.cjs} +1 -1
  87. package/dist/{main-DjvWp72p.js → main-t7yIujwl.js} +5 -5
  88. package/dist/ss-component.cjs +1 -1
  89. package/dist/ss-component.css +1 -1
  90. package/dist/ss-component.js +11 -11
  91. package/dist/ss-component2.cjs +1 -1
  92. package/dist/ss-component2.js +12 -12
  93. package/dist/three-viewport-gizmo-BxFHxv_x.js +18587 -0
  94. package/dist/three-viewport-gizmo-CwaL5sMV.cjs +4195 -0
  95. package/dist/{threeLatheView-DfSxRY8B.cjs → threeLatheView-BzHB-t_G.cjs} +1 -1
  96. package/dist/{threeLatheView-Mc00lYo0.js → threeLatheView-sTBlm0tt.js} +4 -4
  97. package/dist/{threeModel-DgfyuwYi.js → threeModel-11Yk8w2d.js} +5 -5
  98. package/dist/{threeModel-B7tOOzr9.cjs → threeModel-BudPgWiX.cjs} +1 -1
  99. package/dist/threePreview-Cy7NY-gw.cjs +1 -0
  100. package/dist/threePreview-DPyqhBkJ.js +1873 -0
  101. package/dist/threeSceneView-Bwed326O.js +1469 -0
  102. package/dist/threeSceneView-DT-STxuj.cjs +5 -0
  103. package/dist/{threeSceneViewForCPMPIP-Dw2bZRas.js → threeSceneViewForCPMPIP-PgPPGBxu.js} +90 -91
  104. package/dist/{threeSceneViewForCPMPIP-fWzzwARt.cjs → threeSceneViewForCPMPIP-RRDb_tZ0.cjs} +3 -3
  105. package/dist/{threeViewerHost-C9qoD_Tp.cjs → threeViewerHost-Brgx-J3Q.cjs} +1 -1
  106. package/dist/{threeViewerHost-D6c0lK4U.js → threeViewerHost-k5I66uBW.js} +8 -8
  107. package/dist/useRayCaster-CLcetetd.cjs +1 -0
  108. package/dist/{useRayCaster-Y_Q5getG.js → useRayCaster-TCYe6KMI.js} +14 -14
  109. package/package.json +1 -1
  110. package/public/config.js +1 -1
  111. package/dist/OrbitControls-C0QRmW6_.js +0 -458
  112. package/dist/OrbitControls-Co_9huz0.cjs +0 -1
  113. package/dist/STLLoader-CiUjaQtA.js +0 -657
  114. package/dist/STLLoader-RU7KqloS.cjs +0 -6
  115. package/dist/animationData-BjR16KKI.cjs +0 -1
  116. package/dist/index-BIg5JGtJ.js +0 -3370
  117. package/dist/index-BgImAL2B.cjs +0 -1
  118. package/dist/index-BuijIgJr.cjs +0 -1
  119. package/dist/index-Daqeta0F.cjs +0 -1
  120. package/dist/index-LnraLHWy.js +0 -7214
  121. package/dist/index-ama5teB1.cjs +0 -1
  122. package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-CycvdKIn.js +0 -34104
  123. package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-DnbT8HgZ.cjs +0 -56
  124. package/dist/isUndefined-7lpU02Ef.cjs +0 -1
  125. package/dist/isUndefined-BqsKWawv.js +0 -84
  126. package/dist/three-viewport-gizmo-BV37JzRa.cjs +0 -4197
  127. package/dist/three-viewport-gizmo-CkQ98n-T.js +0 -26015
  128. package/dist/threePreview-ByUYJkts.cjs +0 -1
  129. package/dist/threePreview-CkZ9LLXO.js +0 -1972
  130. package/dist/threeSceneView-BxK4ycgs.js +0 -1472
  131. package/dist/threeSceneView-DK1eRng9.cjs +0 -5
  132. package/dist/useRayCaster-BkcK_aF1.cjs +0 -1
@@ -0,0 +1,609 @@
1
+ import { y as J, F as W, C as P, o as re, p as T, ax as M, ab as E, aa as Y, a9 as R, h as se, af as Z, ah as H, e as X, V as I, z as ne, au as ie, a6 as oe, J as K, aD as ae, Y as le, b as ce, _ as N } from "./three-viewport-gizmo-BxFHxv_x.js";
2
+ const he = /^[og]\s*(.+)?/, ue = /^mtllib /, pe = /^usemtl /, fe = /^usemap /, Q = /\s+/, $ = new I(), q = new I(), ee = new I(), te = new I(), F = new I(), B = new P();
3
+ function de() {
4
+ const S = {
5
+ objects: [],
6
+ object: {},
7
+ vertices: [],
8
+ normals: [],
9
+ colors: [],
10
+ uvs: [],
11
+ materials: {},
12
+ materialLibraries: [],
13
+ startObject: function(e, s) {
14
+ if (this.object && this.object.fromDeclaration === !1) {
15
+ this.object.name = e, this.object.fromDeclaration = s !== !1;
16
+ return;
17
+ }
18
+ const i = this.object && typeof this.object.currentMaterial == "function" ? this.object.currentMaterial() : void 0;
19
+ if (this.object && typeof this.object._finalize == "function" && this.object._finalize(!0), this.object = {
20
+ name: e || "",
21
+ fromDeclaration: s !== !1,
22
+ geometry: {
23
+ vertices: [],
24
+ normals: [],
25
+ colors: [],
26
+ uvs: [],
27
+ hasUVIndices: !1
28
+ },
29
+ materials: [],
30
+ smooth: !0,
31
+ startMaterial: function(t, r) {
32
+ const h = this._finalize(!1);
33
+ h && (h.inherited || h.groupCount <= 0) && this.materials.splice(h.index, 1);
34
+ const c = {
35
+ index: this.materials.length,
36
+ name: t || "",
37
+ mtllib: Array.isArray(r) && r.length > 0 ? r[r.length - 1] : "",
38
+ smooth: h !== void 0 ? h.smooth : this.smooth,
39
+ groupStart: h !== void 0 ? h.groupEnd : 0,
40
+ groupEnd: -1,
41
+ groupCount: -1,
42
+ inherited: !1,
43
+ clone: function(l) {
44
+ const n = {
45
+ index: typeof l == "number" ? l : this.index,
46
+ name: this.name,
47
+ mtllib: this.mtllib,
48
+ smooth: this.smooth,
49
+ groupStart: 0,
50
+ groupEnd: -1,
51
+ groupCount: -1,
52
+ inherited: !1
53
+ };
54
+ return n.clone = this.clone.bind(n), n;
55
+ }
56
+ };
57
+ return this.materials.push(c), c;
58
+ },
59
+ currentMaterial: function() {
60
+ if (this.materials.length > 0)
61
+ return this.materials[this.materials.length - 1];
62
+ },
63
+ _finalize: function(t) {
64
+ const r = this.currentMaterial();
65
+ if (r && r.groupEnd === -1 && (r.groupEnd = this.geometry.vertices.length / 3, r.groupCount = r.groupEnd - r.groupStart, r.inherited = !1), t && this.materials.length > 1)
66
+ for (let h = this.materials.length - 1; h >= 0; h--)
67
+ this.materials[h].groupCount <= 0 && this.materials.splice(h, 1);
68
+ return t && this.materials.length === 0 && this.materials.push({
69
+ name: "",
70
+ smooth: this.smooth
71
+ }), r;
72
+ }
73
+ }, i && i.name && typeof i.clone == "function") {
74
+ const t = i.clone(0);
75
+ t.inherited = !0, this.object.materials.push(t);
76
+ }
77
+ this.objects.push(this.object);
78
+ },
79
+ finalize: function() {
80
+ this.object && typeof this.object._finalize == "function" && this.object._finalize(!0);
81
+ },
82
+ parseVertexIndex: function(e, s) {
83
+ const i = parseInt(e, 10);
84
+ return (i >= 0 ? i - 1 : i + s / 3) * 3;
85
+ },
86
+ parseNormalIndex: function(e, s) {
87
+ const i = parseInt(e, 10);
88
+ return (i >= 0 ? i - 1 : i + s / 3) * 3;
89
+ },
90
+ parseUVIndex: function(e, s) {
91
+ const i = parseInt(e, 10);
92
+ return (i >= 0 ? i - 1 : i + s / 2) * 2;
93
+ },
94
+ addVertex: function(e, s, i) {
95
+ const t = this.vertices, r = this.object.geometry.vertices;
96
+ r.push(t[e + 0], t[e + 1], t[e + 2]), r.push(t[s + 0], t[s + 1], t[s + 2]), r.push(t[i + 0], t[i + 1], t[i + 2]);
97
+ },
98
+ addVertexPoint: function(e) {
99
+ const s = this.vertices;
100
+ this.object.geometry.vertices.push(s[e + 0], s[e + 1], s[e + 2]);
101
+ },
102
+ addVertexLine: function(e) {
103
+ const s = this.vertices;
104
+ this.object.geometry.vertices.push(s[e + 0], s[e + 1], s[e + 2]);
105
+ },
106
+ addNormal: function(e, s, i) {
107
+ const t = this.normals, r = this.object.geometry.normals;
108
+ r.push(t[e + 0], t[e + 1], t[e + 2]), r.push(t[s + 0], t[s + 1], t[s + 2]), r.push(t[i + 0], t[i + 1], t[i + 2]);
109
+ },
110
+ addFaceNormal: function(e, s, i) {
111
+ const t = this.vertices, r = this.object.geometry.normals;
112
+ $.fromArray(t, e), q.fromArray(t, s), ee.fromArray(t, i), F.subVectors(ee, q), te.subVectors($, q), F.cross(te), F.normalize(), r.push(F.x, F.y, F.z), r.push(F.x, F.y, F.z), r.push(F.x, F.y, F.z);
113
+ },
114
+ addColor: function(e, s, i) {
115
+ const t = this.colors, r = this.object.geometry.colors;
116
+ t[e] !== void 0 && r.push(t[e + 0], t[e + 1], t[e + 2]), t[s] !== void 0 && r.push(t[s + 0], t[s + 1], t[s + 2]), t[i] !== void 0 && r.push(t[i + 0], t[i + 1], t[i + 2]);
117
+ },
118
+ addUV: function(e, s, i) {
119
+ const t = this.uvs, r = this.object.geometry.uvs;
120
+ r.push(t[e + 0], t[e + 1]), r.push(t[s + 0], t[s + 1]), r.push(t[i + 0], t[i + 1]);
121
+ },
122
+ addDefaultUV: function() {
123
+ const e = this.object.geometry.uvs;
124
+ e.push(0, 0), e.push(0, 0), e.push(0, 0);
125
+ },
126
+ addUVLine: function(e) {
127
+ const s = this.uvs;
128
+ this.object.geometry.uvs.push(s[e + 0], s[e + 1]);
129
+ },
130
+ addFace: function(e, s, i, t, r, h, c, l, n) {
131
+ const o = this.vertices.length;
132
+ let a = this.parseVertexIndex(e, o), u = this.parseVertexIndex(s, o), d = this.parseVertexIndex(i, o);
133
+ if (this.addVertex(a, u, d), this.addColor(a, u, d), c !== void 0 && c !== "") {
134
+ const m = this.normals.length;
135
+ a = this.parseNormalIndex(c, m), u = this.parseNormalIndex(l, m), d = this.parseNormalIndex(n, m), this.addNormal(a, u, d);
136
+ } else
137
+ this.addFaceNormal(a, u, d);
138
+ if (t !== void 0 && t !== "") {
139
+ const m = this.uvs.length;
140
+ a = this.parseUVIndex(t, m), u = this.parseUVIndex(r, m), d = this.parseUVIndex(h, m), this.addUV(a, u, d), this.object.geometry.hasUVIndices = !0;
141
+ } else
142
+ this.addDefaultUV();
143
+ },
144
+ addPointGeometry: function(e) {
145
+ this.object.geometry.type = "Points";
146
+ const s = this.vertices.length;
147
+ for (let i = 0, t = e.length; i < t; i++) {
148
+ const r = this.parseVertexIndex(e[i], s);
149
+ this.addVertexPoint(r), this.addColor(r);
150
+ }
151
+ },
152
+ addLineGeometry: function(e, s) {
153
+ this.object.geometry.type = "Line";
154
+ const i = this.vertices.length, t = this.uvs.length;
155
+ for (let r = 0, h = e.length; r < h; r++)
156
+ this.addVertexLine(this.parseVertexIndex(e[r], i));
157
+ for (let r = 0, h = s.length; r < h; r++)
158
+ this.addUVLine(this.parseUVIndex(s[r], t));
159
+ }
160
+ };
161
+ return S.startObject("", !1), S;
162
+ }
163
+ class be extends J {
164
+ constructor(e) {
165
+ super(e), this.materials = null;
166
+ }
167
+ load(e, s, i, t) {
168
+ const r = this, h = new W(this.manager);
169
+ h.setPath(this.path), h.setRequestHeader(this.requestHeader), h.setWithCredentials(this.withCredentials), h.load(e, function(c) {
170
+ try {
171
+ s(r.parse(c));
172
+ } catch (l) {
173
+ t ? t(l) : console.error(l), r.manager.itemError(e);
174
+ }
175
+ }, i, t);
176
+ }
177
+ setMaterials(e) {
178
+ return this.materials = e, this;
179
+ }
180
+ parse(e) {
181
+ const s = new de();
182
+ e.indexOf(`\r
183
+ `) !== -1 && (e = e.replace(/\r\n/g, `
184
+ `)), e.indexOf(`\\
185
+ `) !== -1 && (e = e.replace(/\\\n/g, ""));
186
+ const i = e.split(`
187
+ `);
188
+ let t = [];
189
+ for (let c = 0, l = i.length; c < l; c++) {
190
+ const n = i[c].trimStart();
191
+ if (n.length === 0) continue;
192
+ const o = n.charAt(0);
193
+ if (o !== "#")
194
+ if (o === "v") {
195
+ const a = n.split(Q);
196
+ switch (a[0]) {
197
+ case "v":
198
+ s.vertices.push(
199
+ parseFloat(a[1]),
200
+ parseFloat(a[2]),
201
+ parseFloat(a[3])
202
+ ), a.length >= 7 ? (B.setRGB(
203
+ parseFloat(a[4]),
204
+ parseFloat(a[5]),
205
+ parseFloat(a[6])
206
+ ).convertSRGBToLinear(), s.colors.push(B.r, B.g, B.b)) : s.colors.push(void 0, void 0, void 0);
207
+ break;
208
+ case "vn":
209
+ s.normals.push(
210
+ parseFloat(a[1]),
211
+ parseFloat(a[2]),
212
+ parseFloat(a[3])
213
+ );
214
+ break;
215
+ case "vt":
216
+ s.uvs.push(
217
+ parseFloat(a[1]),
218
+ parseFloat(a[2])
219
+ );
220
+ break;
221
+ }
222
+ } else if (o === "f") {
223
+ const u = n.slice(1).trim().split(Q), d = [];
224
+ for (let p = 0, g = u.length; p < g; p++) {
225
+ const b = u[p];
226
+ if (b.length > 0) {
227
+ const x = b.split("/");
228
+ d.push(x);
229
+ }
230
+ }
231
+ const m = d[0];
232
+ for (let p = 1, g = d.length - 1; p < g; p++) {
233
+ const b = d[p], x = d[p + 1];
234
+ s.addFace(
235
+ m[0],
236
+ b[0],
237
+ x[0],
238
+ m[1],
239
+ b[1],
240
+ x[1],
241
+ m[2],
242
+ b[2],
243
+ x[2]
244
+ );
245
+ }
246
+ } else if (o === "l") {
247
+ const a = n.substring(1).trim().split(" ");
248
+ let u = [];
249
+ const d = [];
250
+ if (n.indexOf("/") === -1)
251
+ u = a;
252
+ else
253
+ for (let m = 0, p = a.length; m < p; m++) {
254
+ const g = a[m].split("/");
255
+ g[0] !== "" && u.push(g[0]), g[1] !== "" && d.push(g[1]);
256
+ }
257
+ s.addLineGeometry(u, d);
258
+ } else if (o === "p") {
259
+ const u = n.slice(1).trim().split(" ");
260
+ s.addPointGeometry(u);
261
+ } else if ((t = he.exec(n)) !== null) {
262
+ const a = (" " + t[0].slice(1).trim()).slice(1);
263
+ s.startObject(a);
264
+ } else if (pe.test(n))
265
+ s.object.startMaterial(n.substring(7).trim(), s.materialLibraries);
266
+ else if (ue.test(n))
267
+ s.materialLibraries.push(n.substring(7).trim());
268
+ else if (fe.test(n))
269
+ console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');
270
+ else if (o === "s") {
271
+ if (t = n.split(" "), t.length > 1) {
272
+ const u = t[1].trim().toLowerCase();
273
+ s.object.smooth = u !== "0" && u !== "off";
274
+ } else
275
+ s.object.smooth = !0;
276
+ const a = s.object.currentMaterial();
277
+ a && (a.smooth = s.object.smooth);
278
+ } else {
279
+ if (n === "\0") continue;
280
+ console.warn('THREE.OBJLoader: Unexpected line: "' + n + '"');
281
+ }
282
+ }
283
+ s.finalize();
284
+ const r = new re();
285
+ if (r.materialLibraries = [].concat(s.materialLibraries), !(s.objects.length === 1 && s.objects[0].geometry.vertices.length === 0) === !0)
286
+ for (let c = 0, l = s.objects.length; c < l; c++) {
287
+ const n = s.objects[c], o = n.geometry, a = n.materials, u = o.type === "Line", d = o.type === "Points";
288
+ let m = !1;
289
+ if (o.vertices.length === 0) continue;
290
+ const p = new T();
291
+ p.setAttribute("position", new M(o.vertices, 3)), o.normals.length > 0 && p.setAttribute("normal", new M(o.normals, 3)), o.colors.length > 0 && (m = !0, p.setAttribute("color", new M(o.colors, 3))), o.hasUVIndices === !0 && p.setAttribute("uv", new M(o.uvs, 2));
292
+ const g = [];
293
+ for (let x = 0, C = a.length; x < C; x++) {
294
+ const v = a[x], j = v.name + "_" + v.smooth + "_" + m;
295
+ let f = s.materials[j];
296
+ if (this.materials !== null) {
297
+ if (f = this.materials.create(v.name), u && f && !(f instanceof E)) {
298
+ const w = new E();
299
+ Y.prototype.copy.call(w, f), w.color.copy(f.color), f = w;
300
+ } else if (d && f && !(f instanceof R)) {
301
+ const w = new R({ size: 10, sizeAttenuation: !1 });
302
+ Y.prototype.copy.call(w, f), w.color.copy(f.color), w.map = f.map, f = w;
303
+ }
304
+ }
305
+ f === void 0 && (u ? f = new E() : d ? f = new R({ size: 1, sizeAttenuation: !1 }) : f = new se(), f.name = v.name, f.flatShading = !v.smooth, f.vertexColors = m, s.materials[j] = f), g.push(f);
306
+ }
307
+ let b;
308
+ if (g.length > 1) {
309
+ for (let x = 0, C = a.length; x < C; x++) {
310
+ const v = a[x];
311
+ p.addGroup(v.groupStart, v.groupCount, x);
312
+ }
313
+ u ? b = new Z(p, g) : d ? b = new H(p, g) : b = new X(p, g);
314
+ } else
315
+ u ? b = new Z(p, g[0]) : d ? b = new H(p, g[0]) : b = new X(p, g[0]);
316
+ b.name = n.name, r.add(b);
317
+ }
318
+ else if (s.vertices.length > 0) {
319
+ const c = new R({ size: 1, sizeAttenuation: !1 }), l = new T();
320
+ l.setAttribute("position", new M(s.vertices, 3)), s.colors.length > 0 && s.colors[0] !== void 0 && (l.setAttribute("color", new M(s.colors, 3)), c.vertexColors = !0);
321
+ const n = new H(l, c);
322
+ r.add(n);
323
+ }
324
+ return r;
325
+ }
326
+ }
327
+ class xe extends J {
328
+ constructor(e) {
329
+ super(e);
330
+ }
331
+ /**
332
+ * Loads and parses a MTL asset from a URL.
333
+ *
334
+ * @param {String} url - URL to the MTL file.
335
+ * @param {Function} [onLoad] - Callback invoked with the loaded object.
336
+ * @param {Function} [onProgress] - Callback for download progress.
337
+ * @param {Function} [onError] - Callback for download errors.
338
+ *
339
+ * @see setPath setResourcePath
340
+ *
341
+ * @note In order for relative texture references to resolve correctly
342
+ * you must call setResourcePath() explicitly prior to load.
343
+ */
344
+ load(e, s, i, t) {
345
+ const r = this, h = this.path === "" ? ne.extractUrlBase(e) : this.path, c = new W(this.manager);
346
+ c.setPath(this.path), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(e, function(l) {
347
+ try {
348
+ s(r.parse(l, h));
349
+ } catch (n) {
350
+ t ? t(n) : console.error(n), r.manager.itemError(e);
351
+ }
352
+ }, i, t);
353
+ }
354
+ setMaterialOptions(e) {
355
+ return this.materialOptions = e, this;
356
+ }
357
+ /**
358
+ * Parses a MTL file.
359
+ *
360
+ * @param {String} text - Content of MTL file
361
+ * @return {MaterialCreator}
362
+ *
363
+ * @see setPath setResourcePath
364
+ *
365
+ * @note In order for relative texture references to resolve correctly
366
+ * you must call setResourcePath() explicitly prior to parse.
367
+ */
368
+ parse(e, s) {
369
+ const i = e.split(`
370
+ `);
371
+ let t = {};
372
+ const r = /\s+/, h = {};
373
+ for (let l = 0; l < i.length; l++) {
374
+ let n = i[l];
375
+ if (n = n.trim(), n.length === 0 || n.charAt(0) === "#")
376
+ continue;
377
+ const o = n.indexOf(" ");
378
+ let a = o >= 0 ? n.substring(0, o) : n;
379
+ a = a.toLowerCase();
380
+ let u = o >= 0 ? n.substring(o + 1) : "";
381
+ if (u = u.trim(), a === "newmtl")
382
+ t = { name: u }, h[u] = t;
383
+ else if (a === "ka" || a === "kd" || a === "ks" || a === "ke") {
384
+ const d = u.split(r, 3);
385
+ t[a] = [parseFloat(d[0]), parseFloat(d[1]), parseFloat(d[2])];
386
+ } else
387
+ t[a] = u;
388
+ }
389
+ const c = new me(this.resourcePath || s, this.materialOptions);
390
+ return c.setCrossOrigin(this.crossOrigin), c.setManager(this.manager), c.setMaterials(h), c;
391
+ }
392
+ }
393
+ class me {
394
+ constructor(e = "", s = {}) {
395
+ this.baseUrl = e, this.options = s, this.materialsInfo = {}, this.materials = {}, this.materialsArray = [], this.nameLookup = {}, this.crossOrigin = "anonymous", this.side = this.options.side !== void 0 ? this.options.side : ie, this.wrap = this.options.wrap !== void 0 ? this.options.wrap : oe;
396
+ }
397
+ setCrossOrigin(e) {
398
+ return this.crossOrigin = e, this;
399
+ }
400
+ setManager(e) {
401
+ this.manager = e;
402
+ }
403
+ setMaterials(e) {
404
+ this.materialsInfo = this.convert(e), this.materials = {}, this.materialsArray = [], this.nameLookup = {};
405
+ }
406
+ convert(e) {
407
+ if (!this.options) return e;
408
+ const s = {};
409
+ for (const i in e) {
410
+ const t = e[i], r = {};
411
+ s[i] = r;
412
+ for (const h in t) {
413
+ let c = !0, l = t[h];
414
+ const n = h.toLowerCase();
415
+ switch (n) {
416
+ case "kd":
417
+ case "ka":
418
+ case "ks":
419
+ 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 && (c = !1);
420
+ break;
421
+ }
422
+ c && (r[n] = l);
423
+ }
424
+ }
425
+ return s;
426
+ }
427
+ preload() {
428
+ for (const e in this.materialsInfo)
429
+ this.create(e);
430
+ }
431
+ getIndex(e) {
432
+ return this.nameLookup[e];
433
+ }
434
+ getAsArray() {
435
+ let e = 0;
436
+ for (const s in this.materialsInfo)
437
+ this.materialsArray[e] = this.create(s), this.nameLookup[s] = e, e++;
438
+ return this.materialsArray;
439
+ }
440
+ create(e) {
441
+ return this.materials[e] === void 0 && this.createMaterial_(e), this.materials[e];
442
+ }
443
+ createMaterial_(e) {
444
+ const s = this, i = this.materialsInfo[e], t = {
445
+ name: e,
446
+ side: this.side
447
+ };
448
+ function r(c, l) {
449
+ return typeof l != "string" || l === "" ? "" : /^https?:\/\//i.test(l) ? l : c + l;
450
+ }
451
+ function h(c, l) {
452
+ if (t[c]) return;
453
+ const n = s.getTextureParams(l, t), o = s.loadTexture(r(s.baseUrl, n.url));
454
+ o.repeat.copy(n.scale), o.offset.copy(n.offset), o.wrapS = s.wrap, o.wrapT = s.wrap, (c === "map" || c === "emissiveMap") && (o.colorSpace = ce), t[c] = o;
455
+ }
456
+ for (const c in i) {
457
+ const l = i[c];
458
+ let n;
459
+ if (l !== "")
460
+ switch (c.toLowerCase()) {
461
+ // Ns is material specular exponent
462
+ case "kd":
463
+ t.color = new P().fromArray(l).convertSRGBToLinear();
464
+ break;
465
+ case "ks":
466
+ t.specular = new P().fromArray(l).convertSRGBToLinear();
467
+ break;
468
+ case "ke":
469
+ t.emissive = new P().fromArray(l).convertSRGBToLinear();
470
+ break;
471
+ case "map_kd":
472
+ h("map", l);
473
+ break;
474
+ case "map_ks":
475
+ h("specularMap", l);
476
+ break;
477
+ case "map_ke":
478
+ h("emissiveMap", l);
479
+ break;
480
+ case "norm":
481
+ h("normalMap", l);
482
+ break;
483
+ case "map_bump":
484
+ case "bump":
485
+ h("bumpMap", l);
486
+ break;
487
+ case "map_d":
488
+ h("alphaMap", l), t.transparent = !0;
489
+ break;
490
+ case "ns":
491
+ t.shininess = parseFloat(l);
492
+ break;
493
+ case "d":
494
+ n = parseFloat(l), n < 1 && (t.opacity = n, t.transparent = !0);
495
+ break;
496
+ case "tr":
497
+ n = parseFloat(l), this.options && this.options.invertTrProperty && (n = 1 - n), n > 0 && (t.opacity = 1 - n, t.transparent = !0);
498
+ break;
499
+ }
500
+ }
501
+ return this.materials[e] = new se(t), this.materials[e];
502
+ }
503
+ getTextureParams(e, s) {
504
+ const i = {
505
+ scale: new K(1, 1),
506
+ offset: new K(0, 0)
507
+ }, t = e.split(/\s+/);
508
+ let r;
509
+ return r = t.indexOf("-bm"), r >= 0 && (s.bumpScale = parseFloat(t[r + 1]), t.splice(r, 2)), r = t.indexOf("-s"), r >= 0 && (i.scale.set(parseFloat(t[r + 1]), parseFloat(t[r + 2])), t.splice(r, 4)), r = t.indexOf("-o"), r >= 0 && (i.offset.set(parseFloat(t[r + 1]), parseFloat(t[r + 2])), t.splice(r, 4)), i.url = t.join(" ").trim(), i;
510
+ }
511
+ loadTexture(e, s, i, t, r) {
512
+ const h = this.manager !== void 0 ? this.manager : ae;
513
+ let c = h.getHandler(e);
514
+ c === null && (c = new le(h)), c.setCrossOrigin && c.setCrossOrigin(this.crossOrigin);
515
+ const l = c.load(e, i, t, r);
516
+ return s !== void 0 && (l.mapping = s), l;
517
+ }
518
+ }
519
+ class we extends J {
520
+ constructor(e) {
521
+ super(e);
522
+ }
523
+ load(e, s, i, t) {
524
+ const r = this, h = new W(this.manager);
525
+ h.setPath(this.path), h.setResponseType("arraybuffer"), h.setRequestHeader(this.requestHeader), h.setWithCredentials(this.withCredentials), h.load(e, function(c) {
526
+ try {
527
+ s(r.parse(c));
528
+ } catch (l) {
529
+ t ? t(l) : console.error(l), r.manager.itemError(e);
530
+ }
531
+ }, i, t);
532
+ }
533
+ parse(e) {
534
+ function s(n) {
535
+ const o = new DataView(n), a = 32 / 8 * 3 + 32 / 8 * 3 * 3 + 16 / 8, u = o.getUint32(80, !0);
536
+ if (80 + 32 / 8 + u * a === o.byteLength)
537
+ return !0;
538
+ const m = [115, 111, 108, 105, 100];
539
+ for (let p = 0; p < 5; p++)
540
+ if (i(m, o, p)) return !1;
541
+ return !0;
542
+ }
543
+ function i(n, o, a) {
544
+ for (let u = 0, d = n.length; u < d; u++)
545
+ if (n[u] !== o.getUint8(a + u)) return !1;
546
+ return !0;
547
+ }
548
+ function t(n) {
549
+ const o = new DataView(n), a = o.getUint32(80, !0);
550
+ let u, d, m, p = !1, g, b, x, C, v;
551
+ for (let y = 0; y < 70; y++)
552
+ 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);
553
+ const j = 84, f = 12 * 4 + 2, w = new T(), V = new Float32Array(a * 3 * 3), A = new Float32Array(a * 3 * 3), k = new P();
554
+ for (let y = 0; y < a; y++) {
555
+ const U = j + y * f, D = o.getFloat32(U, !0), O = o.getFloat32(U + 4, !0), z = o.getFloat32(U + 8, !0);
556
+ if (p) {
557
+ const L = o.getUint16(U + 48, !0);
558
+ (L & 32768) === 0 ? (u = (L & 31) / 31, d = (L >> 5 & 31) / 31, m = (L >> 10 & 31) / 31) : (u = b, d = x, m = C);
559
+ }
560
+ for (let L = 1; L <= 3; L++) {
561
+ const G = U + L * 12, _ = y * 3 * 3 + (L - 1) * 3;
562
+ V[_] = o.getFloat32(G, !0), V[_ + 1] = o.getFloat32(G + 4, !0), V[_ + 2] = o.getFloat32(G + 8, !0), A[_] = D, A[_ + 1] = O, A[_ + 2] = z, p && (k.set(u, d, m).convertSRGBToLinear(), g[_] = k.r, g[_ + 1] = k.g, g[_ + 2] = k.b);
563
+ }
564
+ }
565
+ return w.setAttribute("position", new N(V, 3)), w.setAttribute("normal", new N(A, 3)), p && (w.setAttribute("color", new N(g, 3)), w.hasColors = !0, w.alpha = v), w;
566
+ }
567
+ function r(n) {
568
+ const o = new T(), a = /solid([\s\S]*?)endsolid/g, u = /facet([\s\S]*?)endfacet/g, d = /solid\s(.+)/;
569
+ let m = 0;
570
+ 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 I();
571
+ let f, w = 0, V = 0, A = 0;
572
+ for (; (f = a.exec(n)) !== null; ) {
573
+ V = A;
574
+ const k = f[0], y = (f = d.exec(k)) !== null ? f[1] : "";
575
+ for (v.push(y); (f = u.exec(k)) !== null; ) {
576
+ let O = 0, z = 0;
577
+ const L = f[0];
578
+ for (; (f = b.exec(L)) !== null; )
579
+ j.x = parseFloat(f[1]), j.y = parseFloat(f[2]), j.z = parseFloat(f[3]), z++;
580
+ for (; (f = g.exec(L)) !== null; )
581
+ x.push(parseFloat(f[1]), parseFloat(f[2]), parseFloat(f[3])), C.push(j.x, j.y, j.z), O++, A++;
582
+ z !== 1 && console.error("THREE.STLLoader: Something isn't right with the normal of face number " + m), O !== 3 && console.error("THREE.STLLoader: Something isn't right with the vertices of face number " + m), m++;
583
+ }
584
+ const U = V, D = A - V;
585
+ o.userData.groupNames = v, o.addGroup(U, D, w), w++;
586
+ }
587
+ return o.setAttribute("position", new M(x, 3)), o.setAttribute("normal", new M(C, 3)), o;
588
+ }
589
+ function h(n) {
590
+ return typeof n != "string" ? new TextDecoder().decode(n) : n;
591
+ }
592
+ function c(n) {
593
+ if (typeof n == "string") {
594
+ const o = new Uint8Array(n.length);
595
+ for (let a = 0; a < n.length; a++)
596
+ o[a] = n.charCodeAt(a) & 255;
597
+ return o.buffer || o;
598
+ } else
599
+ return n;
600
+ }
601
+ const l = c(e);
602
+ return s(l) ? t(l) : r(h(e));
603
+ }
604
+ }
605
+ export {
606
+ xe as M,
607
+ be as O,
608
+ we as S
609
+ };