ss-component-new 1.2.23 → 1.2.25

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 (143) hide show
  1. package/dist/MTLLoader-AqmsmIp6.cjs +6 -0
  2. package/dist/MTLLoader-DJNdEDx2.js +609 -0
  3. package/dist/OrbitControls-Bj5caXhQ.js +419 -0
  4. package/dist/OrbitControls-rTIa-2s-.cjs +1 -0
  5. package/dist/{animationData-Bwh55Xw6.cjs → animationData-Bc9LlHz0.cjs} +1 -1
  6. package/dist/{animationData-D0TJ-9dd.js → animationData-Ca4l4roD.js} +4 -4
  7. package/dist/array-Baxi4C30.cjs +11 -0
  8. package/dist/array-Ca6KqnNx.js +1142 -0
  9. package/dist/{dataUtil-i5X2xhin.cjs → dataUtil-Cg2dZbrV.cjs} +1 -1
  10. package/dist/{dataUtil-gEKo7CEq.js → dataUtil-DUI9Vz64.js} +2 -2
  11. package/dist/{fileUtil-GIRXMs25.cjs → fileUtil-CTTbs0aJ.cjs} +1 -1
  12. package/dist/{fileUtil-CN00xr9W.js → fileUtil-CWt--rV-.js} +1 -1
  13. package/dist/{iconfont-C9-pGpAJ.cjs → iconfont-BaUxcJrk.cjs} +1 -1
  14. package/dist/{iconfont-DTSZW2AU.js → iconfont-D886hAXy.js} +2 -2
  15. package/dist/icons/svg//345/215/225/345/205/203/345/272/223.svg +1 -0
  16. package/dist/icons/svg//346/250/241/345/236/213/347/256/241/347/220/206.svg +1 -0
  17. package/dist/icons/svg//346/265/201/347/250/213/345/272/223.svg +1 -0
  18. package/dist/icons/svg//347/225/214/351/235/242/344/277/256/346/224/271.svg +1 -0
  19. package/dist/{index-BOJUyAaV.cjs → index-1z9RrjZc.cjs} +1 -1
  20. package/dist/{index-DSlPg3dk.cjs → index-9wWF5fgR.cjs} +1 -1
  21. package/dist/index-B-I7BsZI.js +2570 -0
  22. package/dist/{index-CqYUVCh5.js → index-B-p8m73c.js} +12 -12
  23. package/dist/{index-CK54pscx.cjs → index-B1qlTlfX.cjs} +1 -1
  24. package/dist/{index-BD5yZDAq.js → index-B5iT5NR0.js} +2 -2
  25. package/dist/{index-BkIFY0hK.cjs → index-B8MyAHnT.cjs} +1 -1
  26. package/dist/{index-7oJ8Ile4.js → index-BLW6fsom.js} +1 -1
  27. package/dist/{index-DbCNaQ87.cjs → index-BMK703KG.cjs} +1 -1
  28. package/dist/{index-eH9RMVXv.cjs → index-BNYCmfv9.cjs} +1 -1
  29. package/dist/{index-ThNNBX7h.js → index-BQkk6yoU.js} +1 -1
  30. package/dist/index-BQq7Cw_K.cjs +1 -0
  31. package/dist/{index-pmcRbjPd.cjs → index-BZENxsjL.cjs} +1 -1
  32. package/dist/{index-BNYeBPmi.cjs → index-BZoOaP9C.cjs} +1 -1
  33. package/dist/{index-G_cKl_J4.js → index-B_jnPuBE.js} +275 -270
  34. package/dist/{index-XXKsLOYd.js → index-Bke5IOmW.js} +2 -2
  35. package/dist/{index-DrWIUUZK.cjs → index-BtfS9ULE.cjs} +1 -1
  36. package/dist/{index-CvC2498b.js → index-BuLPXgWU.js} +5 -5
  37. package/dist/index-BxXOWAHT.cjs +1 -0
  38. package/dist/{index-2fqHNrPg.js → index-C8OFJprL.js} +4 -4
  39. package/dist/{index-CtXpoEg0.cjs → index-C9OPT3q5.cjs} +1 -1
  40. package/dist/{index-D8Y3imz9.cjs → index-CEV2ULrI.cjs} +1 -1
  41. package/dist/{index-BTTpV9o2.js → index-CTRrKUtw.js} +14 -14
  42. package/dist/{index-CptCatmL.js → index-CYmHP5Ky.js} +48 -32
  43. package/dist/{index-Dfwm0xPp.cjs → index-Cb0d2cT8.cjs} +1 -1
  44. package/dist/{index-Cl6HMOao.js → index-CeeMzEXY.js} +1 -1
  45. package/dist/{index-tttYIzsn.cjs → index-CjI5pDiU.cjs} +1 -1
  46. package/dist/{index-DEs8s152.js → index-CmUjrEkz.js} +6 -6
  47. package/dist/index-CtE7IIJq.js +7297 -0
  48. package/dist/{index-DSchKIyh.cjs → index-CxnH4vfV.cjs} +1 -1
  49. package/dist/index-CyY9deE5.cjs +1 -0
  50. package/dist/{index-DlIkbsRf.js → index-Cyk3pWtk.js} +6 -6
  51. package/dist/index-D-eD7QhS.js +654 -0
  52. package/dist/{index-NlkdTb--.js → index-D0odjY-X.js} +4 -4
  53. package/dist/{index-B0dydZDW.js → index-D1cjMjid.js} +1 -1
  54. package/dist/index-D5gT6DCZ.cjs +1 -0
  55. package/dist/{index-CvrBt7bU.js → index-D7GiDyDn.js} +6 -6
  56. package/dist/index-D88kGgy-.cjs +1 -0
  57. package/dist/{index-DMbCaqEC.cjs → index-DEExEFRs.cjs} +13 -13
  58. package/dist/{index-DllJulGH.cjs → index-DFMKBytS.cjs} +1 -1
  59. package/dist/{index-Dm_WlV6R.js → index-DNe_JGg0.js} +1 -1
  60. package/dist/{index-Bvk4OpkL.js → index-DTCPY-4V.js} +2 -2
  61. package/dist/{index-BTfg83yY.cjs → index-DTuCopl-.cjs} +1 -1
  62. package/dist/{index-BwEfrokO.js → index-DVSVJAdn.js} +2 -2
  63. package/dist/{index-7Ru3e632.cjs → index-DYr8VySV.cjs} +1 -1
  64. package/dist/{index-BQBxzTyE.js → index-DkA_gjlb.js} +2 -2
  65. package/dist/{index-7gU0r1We.cjs → index-Dkoh6zZr.cjs} +1 -1
  66. package/dist/{index-DNs9XPOG.js → index-DpE6q48b.js} +2 -2
  67. package/dist/{index-BVFL7Z_0.js → index-DqAAn-WP.js} +5 -5
  68. package/dist/{index-DHp714Ep.cjs → index-DrgssxCP.cjs} +1 -1
  69. package/dist/{index-Bt2MaT2G.js → index-J98IKvqx.js} +6 -6
  70. package/dist/{index-C6C5VWbs.cjs → index-PNi4RMPc.cjs} +1 -1
  71. package/dist/index-XXEzSATd.js +158 -0
  72. package/dist/{index-CADH_aSQ.cjs → index-clFmHtGU.cjs} +1 -1
  73. package/dist/{index-Be1LJMUR.js → index-pFuDv6dx.js} +2 -2
  74. package/dist/{index-BuSsSHAY.js → index-sk7jYyaG.js} +2301 -2282
  75. package/dist/{index-DQ3y1xkr.cjs → index-vmURlfDn.cjs} +1 -1
  76. package/dist/{index-BXEOQo2c.cjs → index-yyc7_nsV.cjs} +1 -1
  77. package/dist/index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BCjeeJqj.cjs +5675 -0
  78. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CtycIAIT.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-aFJhRTyx.js} +41519 -48931
  79. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-De0avjy5.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-Dv39W1q4.js} +6 -6
  80. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DhMDLOg8.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-OXHjy9ED.cjs} +1 -1
  81. package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-C4gG2WxT.cjs +56 -0
  82. package/dist/{index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-CEcxaThh.js → index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-CEIVtyL9.js} +10702 -10654
  83. package/dist/index.vue_vue_type_style_index_1_lang-D0ileuYo.cjs +32 -0
  84. package/dist/index.vue_vue_type_style_index_1_lang-DOP0uVOd.cjs +5 -0
  85. package/dist/index.vue_vue_type_style_index_1_lang-DSKzPKLD.js +8262 -0
  86. package/dist/{index.vue_vue_type_style_index_1_lang-DzZEPkuk.js → index.vue_vue_type_style_index_1_lang-DkkdpQbZ.js} +1368 -1456
  87. package/dist/{isString-CELwppr9.cjs → isString-BmAegMGI.cjs} +1 -1
  88. package/dist/{isString-DvY0kl3S.js → isString-CohCsKzS.js} +1 -1
  89. package/dist/{main-DQXqHTYg.js → main-B4gwcsBp.js} +5 -5
  90. package/dist/{main-yiUkyrA7.cjs → main-HIDJ5ncj.cjs} +1 -1
  91. package/dist/ss-component.cjs +1 -1
  92. package/dist/ss-component.css +2 -2
  93. package/dist/ss-component.js +11 -11
  94. package/dist/ss-component2.cjs +1 -1
  95. package/dist/ss-component2.js +12 -12
  96. package/dist/{threeModel-BiWZCOOI.js → threeModel-LJMbJaUb.js} +5 -5
  97. package/dist/{threeModel-Cva5i9Dy.cjs → threeModel-tRhkTPHD.cjs} +1 -1
  98. package/dist/threePreview-CeCm5KTT.cjs +1 -0
  99. package/dist/{threePreview-CjFKHY3_.js → threePreview-CqWnM1XW.js} +442 -541
  100. package/dist/{threeSceneView-DM8uof_D.cjs → threeSceneView-CTChIfwR.cjs} +1 -1
  101. package/dist/{threeSceneView-DPTQ_xR-.js → threeSceneView-D2mX_5N9.js} +11 -11
  102. package/dist/{threeSceneViewForCPMPIP-D5jl1r-h.cjs → threeSceneViewForCPMPIP-C_MBwi1O.cjs} +1 -1
  103. package/dist/{threeSceneViewForCPMPIP-Bqb44i-c.js → threeSceneViewForCPMPIP-CpVcogbP.js} +10 -10
  104. package/dist/{threeTrackPathView-BvxoafSz.js → threeTrackPathView-DMTpRQTP.js} +172 -354
  105. package/dist/threeTrackPathView-Deim_dX7.cjs +371 -0
  106. package/dist/threeViewerHost-BMrWNnGK.cjs +1 -0
  107. package/dist/{threeViewerHost-CKmZPGir.js → threeViewerHost-WXqI_L3g.js} +91 -78
  108. package/dist/{urdfTree-BxuavyNQ.js → urdfTree-BX92weHU.js} +1 -1
  109. package/dist/{urdfTree-wR2vnG4s.cjs → urdfTree-CbDb_7PZ.cjs} +1 -1
  110. package/dist/{workpieceTreePanel-C2BXrv3k.cjs → workpieceTreePanel-CbTolK6t.cjs} +1 -1
  111. package/dist/{workpieceTreePanel-CSKzSdIt.js → workpieceTreePanel-Q4S9btz3.js} +18 -18
  112. package/package.json +1 -1
  113. package/public/icons/svg//345/215/225/345/205/203/345/272/223.svg +1 -0
  114. package/public/icons/svg//346/250/241/345/236/213/347/256/241/347/220/206.svg +1 -0
  115. package/public/icons/svg//346/265/201/347/250/213/345/272/223.svg +1 -0
  116. package/public/icons/svg//347/225/214/351/235/242/344/277/256/346/224/271.svg +1 -0
  117. package/dist/MTLLoader-B8MnfNfT.cjs +0 -6
  118. package/dist/MTLLoader-BD3cbBAW.js +0 -657
  119. package/dist/OrbitControls-2UHRU9Fu.cjs +0 -1
  120. package/dist/OrbitControls-D1pz0uFI.js +0 -458
  121. package/dist/array-DMPAgNcb.cjs +0 -11
  122. package/dist/array-DTXrs6ZK.js +0 -1207
  123. package/dist/index-BLwwxnzs.cjs +0 -1
  124. package/dist/index-BVdolwlx.js +0 -7293
  125. package/dist/index-Bm3FE_ss.js +0 -504
  126. package/dist/index-BpTrDbkf.js +0 -22
  127. package/dist/index-C54wX50t.cjs +0 -1
  128. package/dist/index-CFriKZ-T.cjs +0 -1
  129. package/dist/index-CsOz5vsv.cjs +0 -1
  130. package/dist/index-D4pN9YmB.js +0 -144
  131. package/dist/index-DOhvzke2.js +0 -24
  132. package/dist/index-DPX3w6cO.js +0 -2643
  133. package/dist/index-DR9beXhk.cjs +0 -1
  134. package/dist/index-Do8zI4DM.cjs +0 -1
  135. package/dist/index-dwX_BHyo.cjs +0 -1
  136. package/dist/index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-D6X3fCNs.cjs +0 -5677
  137. package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-DLuOs1IZ.cjs +0 -56
  138. package/dist/index.vue_vue_type_style_index_1_lang-B0l6QIWy.js +0 -7806
  139. package/dist/index.vue_vue_type_style_index_1_lang-CC1o5rIu.cjs +0 -32
  140. package/dist/index.vue_vue_type_style_index_1_lang-Chzrrthw.cjs +0 -6
  141. package/dist/threePreview-BNvDY6xx.cjs +0 -1
  142. package/dist/threeTrackPathView-DgnuPrBe.cjs +0 -370
  143. package/dist/threeViewerHost-D80V4Cfh.cjs +0 -1
@@ -0,0 +1,6 @@
1
+ "use strict";const c=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BCjeeJqj.cjs");class H extends c.Loader{constructor(e){super(e)}load(e,s,i,t){const r=this,h=new c.FileLoader(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(e,function(u){try{s(r.parse(u))}catch(l){t?t(l):console.error(l),r.manager.itemError(e)}},i,t)}parse(e){function s(n){const o=new DataView(n),a=32/8*3+32/8*3*3+16/8,f=o.getUint32(80,!0);if(80+32/8+f*a===o.byteLength)return!0;const g=[115,111,108,105,100];for(let p=0;p<5;p++)if(i(g,o,p))return!1;return!0}function i(n,o,a){for(let f=0,m=n.length;f<m;f++)if(n[f]!==o.getUint8(a+f))return!1;return!0}function t(n){const o=new DataView(n),a=o.getUint32(80,!0);let f,m,g,p=!1,b,x,w,A,L;for(let v=0;v<70;v++)o.getUint32(v,!1)==1129270351&&o.getUint8(v+4)==82&&o.getUint8(v+5)==61&&(p=!0,b=new Float32Array(a*3*3),x=o.getUint8(v+6)/255,w=o.getUint8(v+7)/255,A=o.getUint8(v+8)/255,L=o.getUint8(v+9)/255);const _=84,d=12*4+2,y=new c.BufferGeometry,C=new Float32Array(a*3*3),V=new Float32Array(a*3*3),B=new c.Color;for(let v=0;v<a;v++){const k=_+v*d,O=o.getFloat32(k,!0),U=o.getFloat32(k+4,!0),S=o.getFloat32(k+8,!0);if(p){const F=o.getUint16(k+48,!0);(F&32768)===0?(f=(F&31)/31,m=(F>>5&31)/31,g=(F>>10&31)/31):(f=x,m=w,g=A)}for(let F=1;F<=3;F++){const T=k+F*12,M=v*3*3+(F-1)*3;C[M]=o.getFloat32(T,!0),C[M+1]=o.getFloat32(T+4,!0),C[M+2]=o.getFloat32(T+8,!0),V[M]=O,V[M+1]=U,V[M+2]=S,p&&(B.set(f,m,g).convertSRGBToLinear(),b[M]=B.r,b[M+1]=B.g,b[M+2]=B.b)}}return y.setAttribute("position",new c.BufferAttribute(C,3)),y.setAttribute("normal",new c.BufferAttribute(V,3)),p&&(y.setAttribute("color",new c.BufferAttribute(b,3)),y.hasColors=!0,y.alpha=L),y}function r(n){const o=new c.BufferGeometry,a=/solid([\s\S]*?)endsolid/g,f=/facet([\s\S]*?)endfacet/g,m=/solid\s(.+)/;let g=0;const p=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,b=new RegExp("vertex"+p+p+p,"g"),x=new RegExp("normal"+p+p+p,"g"),w=[],A=[],L=[],_=new c.Vector3;let d,y=0,C=0,V=0;for(;(d=a.exec(n))!==null;){C=V;const B=d[0],v=(d=m.exec(B))!==null?d[1]:"";for(L.push(v);(d=f.exec(B))!==null;){let U=0,S=0;const F=d[0];for(;(d=x.exec(F))!==null;)_.x=parseFloat(d[1]),_.y=parseFloat(d[2]),_.z=parseFloat(d[3]),S++;for(;(d=b.exec(F))!==null;)w.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])),A.push(_.x,_.y,_.z),U++,V++;S!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+g),U!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+g),g++}const k=C,O=V-C;o.userData.groupNames=L,o.addGroup(k,O,y),y++}return o.setAttribute("position",new c.Float32BufferAttribute(w,3)),o.setAttribute("normal",new c.Float32BufferAttribute(A,3)),o}function h(n){return typeof n!="string"?new TextDecoder().decode(n):n}function u(n){if(typeof n=="string"){const o=new Uint8Array(n.length);for(let a=0;a<n.length;a++)o[a]=n.charCodeAt(a)&255;return o.buffer||o}else return n}const l=u(e);return s(l)?t(l):r(h(e))}}const N=/^[og]\s*(.+)?/,q=/^mtllib /,J=/^usemtl /,W=/^usemap /,z=/\s+/,G=new c.Vector3,R=new c.Vector3,D=new c.Vector3,E=new c.Vector3,j=new c.Vector3,I=new c.Color;function Z(){const P={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,s){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=s!==!1;return}const i=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:s!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(t,r){const h=this._finalize(!1);h&&(h.inherited||h.groupCount<=0)&&this.materials.splice(h.index,1);const u={index:this.materials.length,name:t||"",mtllib:Array.isArray(r)&&r.length>0?r[r.length-1]:"",smooth:h!==void 0?h.smooth:this.smooth,groupStart:h!==void 0?h.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){const n={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return n.clone=this.clone.bind(n),n}};return this.materials.push(u),u},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){const r=this.currentMaterial();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)for(let h=this.materials.length-1;h>=0;h--)this.materials[h].groupCount<=0&&this.materials.splice(h,1);return t&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),r}},i&&i.name&&typeof i.clone=="function"){const t=i.clone(0);t.inherited=!0,this.object.materials.push(t)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,s){const i=parseInt(e,10);return(i>=0?i-1:i+s/3)*3},parseNormalIndex:function(e,s){const i=parseInt(e,10);return(i>=0?i-1:i+s/3)*3},parseUVIndex:function(e,s){const i=parseInt(e,10);return(i>=0?i-1:i+s/2)*2},addVertex:function(e,s,i){const t=this.vertices,r=this.object.geometry.vertices;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])},addVertexPoint:function(e){const s=this.vertices;this.object.geometry.vertices.push(s[e+0],s[e+1],s[e+2])},addVertexLine:function(e){const s=this.vertices;this.object.geometry.vertices.push(s[e+0],s[e+1],s[e+2])},addNormal:function(e,s,i){const t=this.normals,r=this.object.geometry.normals;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])},addFaceNormal:function(e,s,i){const t=this.vertices,r=this.object.geometry.normals;G.fromArray(t,e),R.fromArray(t,s),D.fromArray(t,i),j.subVectors(D,R),E.subVectors(G,R),j.cross(E),j.normalize(),r.push(j.x,j.y,j.z),r.push(j.x,j.y,j.z),r.push(j.x,j.y,j.z)},addColor:function(e,s,i){const t=this.colors,r=this.object.geometry.colors;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])},addUV:function(e,s,i){const t=this.uvs,r=this.object.geometry.uvs;r.push(t[e+0],t[e+1]),r.push(t[s+0],t[s+1]),r.push(t[i+0],t[i+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const s=this.uvs;this.object.geometry.uvs.push(s[e+0],s[e+1])},addFace:function(e,s,i,t,r,h,u,l,n){const o=this.vertices.length;let a=this.parseVertexIndex(e,o),f=this.parseVertexIndex(s,o),m=this.parseVertexIndex(i,o);if(this.addVertex(a,f,m),this.addColor(a,f,m),u!==void 0&&u!==""){const g=this.normals.length;a=this.parseNormalIndex(u,g),f=this.parseNormalIndex(l,g),m=this.parseNormalIndex(n,g),this.addNormal(a,f,m)}else this.addFaceNormal(a,f,m);if(t!==void 0&&t!==""){const g=this.uvs.length;a=this.parseUVIndex(t,g),f=this.parseUVIndex(r,g),m=this.parseUVIndex(h,g),this.addUV(a,f,m),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const s=this.vertices.length;for(let i=0,t=e.length;i<t;i++){const r=this.parseVertexIndex(e[i],s);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,s){this.object.geometry.type="Line";const i=this.vertices.length,t=this.uvs.length;for(let r=0,h=e.length;r<h;r++)this.addVertexLine(this.parseVertexIndex(e[r],i));for(let r=0,h=s.length;r<h;r++)this.addUVLine(this.parseUVIndex(s[r],t))}};return P.startObject("",!1),P}class X extends c.Loader{constructor(e){super(e),this.materials=null}load(e,s,i,t){const r=this,h=new c.FileLoader(this.manager);h.setPath(this.path),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(e,function(u){try{s(r.parse(u))}catch(l){t?t(l):console.error(l),r.manager.itemError(e)}},i,t)}setMaterials(e){return this.materials=e,this}parse(e){const s=new Z;e.indexOf(`\r
2
+ `)!==-1&&(e=e.replace(/\r\n/g,`
3
+ `)),e.indexOf(`\\
4
+ `)!==-1&&(e=e.replace(/\\\n/g,""));const i=e.split(`
5
+ `);let t=[];for(let u=0,l=i.length;u<l;u++){const n=i[u].trimStart();if(n.length===0)continue;const o=n.charAt(0);if(o!=="#")if(o==="v"){const a=n.split(z);switch(a[0]){case"v":s.vertices.push(parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3])),a.length>=7?(I.setRGB(parseFloat(a[4]),parseFloat(a[5]),parseFloat(a[6])).convertSRGBToLinear(),s.colors.push(I.r,I.g,I.b)):s.colors.push(void 0,void 0,void 0);break;case"vn":s.normals.push(parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]));break;case"vt":s.uvs.push(parseFloat(a[1]),parseFloat(a[2]));break}}else if(o==="f"){const f=n.slice(1).trim().split(z),m=[];for(let p=0,b=f.length;p<b;p++){const x=f[p];if(x.length>0){const w=x.split("/");m.push(w)}}const g=m[0];for(let p=1,b=m.length-1;p<b;p++){const x=m[p],w=m[p+1];s.addFace(g[0],x[0],w[0],g[1],x[1],w[1],g[2],x[2],w[2])}}else if(o==="l"){const a=n.substring(1).trim().split(" ");let f=[];const m=[];if(n.indexOf("/")===-1)f=a;else for(let g=0,p=a.length;g<p;g++){const b=a[g].split("/");b[0]!==""&&f.push(b[0]),b[1]!==""&&m.push(b[1])}s.addLineGeometry(f,m)}else if(o==="p"){const f=n.slice(1).trim().split(" ");s.addPointGeometry(f)}else if((t=N.exec(n))!==null){const a=(" "+t[0].slice(1).trim()).slice(1);s.startObject(a)}else if(J.test(n))s.object.startMaterial(n.substring(7).trim(),s.materialLibraries);else if(q.test(n))s.materialLibraries.push(n.substring(7).trim());else if(W.test(n))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(o==="s"){if(t=n.split(" "),t.length>1){const f=t[1].trim().toLowerCase();s.object.smooth=f!=="0"&&f!=="off"}else s.object.smooth=!0;const a=s.object.currentMaterial();a&&(a.smooth=s.object.smooth)}else{if(n==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+n+'"')}}s.finalize();const r=new c.Group;if(r.materialLibraries=[].concat(s.materialLibraries),!(s.objects.length===1&&s.objects[0].geometry.vertices.length===0)===!0)for(let u=0,l=s.objects.length;u<l;u++){const n=s.objects[u],o=n.geometry,a=n.materials,f=o.type==="Line",m=o.type==="Points";let g=!1;if(o.vertices.length===0)continue;const p=new c.BufferGeometry;p.setAttribute("position",new c.Float32BufferAttribute(o.vertices,3)),o.normals.length>0&&p.setAttribute("normal",new c.Float32BufferAttribute(o.normals,3)),o.colors.length>0&&(g=!0,p.setAttribute("color",new c.Float32BufferAttribute(o.colors,3))),o.hasUVIndices===!0&&p.setAttribute("uv",new c.Float32BufferAttribute(o.uvs,2));const b=[];for(let w=0,A=a.length;w<A;w++){const L=a[w],_=L.name+"_"+L.smooth+"_"+g;let d=s.materials[_];if(this.materials!==null){if(d=this.materials.create(L.name),f&&d&&!(d instanceof c.LineBasicMaterial)){const y=new c.LineBasicMaterial;c.Material.prototype.copy.call(y,d),y.color.copy(d.color),d=y}else if(m&&d&&!(d instanceof c.PointsMaterial)){const y=new c.PointsMaterial({size:10,sizeAttenuation:!1});c.Material.prototype.copy.call(y,d),y.color.copy(d.color),y.map=d.map,d=y}}d===void 0&&(f?d=new c.LineBasicMaterial:m?d=new c.PointsMaterial({size:1,sizeAttenuation:!1}):d=new c.MeshPhongMaterial,d.name=L.name,d.flatShading=!L.smooth,d.vertexColors=g,s.materials[_]=d),b.push(d)}let x;if(b.length>1){for(let w=0,A=a.length;w<A;w++){const L=a[w];p.addGroup(L.groupStart,L.groupCount,w)}f?x=new c.LineSegments(p,b):m?x=new c.Points(p,b):x=new c.Mesh(p,b)}else f?x=new c.LineSegments(p,b[0]):m?x=new c.Points(p,b[0]):x=new c.Mesh(p,b[0]);x.name=n.name,r.add(x)}else if(s.vertices.length>0){const u=new c.PointsMaterial({size:1,sizeAttenuation:!1}),l=new c.BufferGeometry;l.setAttribute("position",new c.Float32BufferAttribute(s.vertices,3)),s.colors.length>0&&s.colors[0]!==void 0&&(l.setAttribute("color",new c.Float32BufferAttribute(s.colors,3)),u.vertexColors=!0);const n=new c.Points(l,u);r.add(n)}return r}}class Y extends c.Loader{constructor(e){super(e)}load(e,s,i,t){const r=this,h=this.path===""?c.LoaderUtils.extractUrlBase(e):this.path,u=new c.FileLoader(this.manager);u.setPath(this.path),u.setRequestHeader(this.requestHeader),u.setWithCredentials(this.withCredentials),u.load(e,function(l){try{s(r.parse(l,h))}catch(n){t?t(n):console.error(n),r.manager.itemError(e)}},i,t)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,s){const i=e.split(`
6
+ `);let t={};const r=/\s+/,h={};for(let l=0;l<i.length;l++){let n=i[l];if(n=n.trim(),n.length===0||n.charAt(0)==="#")continue;const o=n.indexOf(" ");let a=o>=0?n.substring(0,o):n;a=a.toLowerCase();let f=o>=0?n.substring(o+1):"";if(f=f.trim(),a==="newmtl")t={name:f},h[f]=t;else if(a==="ka"||a==="kd"||a==="ks"||a==="ke"){const m=f.split(r,3);t[a]=[parseFloat(m[0]),parseFloat(m[1]),parseFloat(m[2])]}else t[a]=f}const u=new K(this.resourcePath||s,this.materialOptions);return u.setCrossOrigin(this.crossOrigin),u.setManager(this.manager),u.setMaterials(h),u}}class K{constructor(e="",s={}){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:c.FrontSide,this.wrap=this.options.wrap!==void 0?this.options.wrap:c.RepeatWrapping}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const s={};for(const i in e){const t=e[i],r={};s[i]=r;for(const h in t){let u=!0,l=t[h];const n=h.toLowerCase();switch(n){case"kd":case"ka":case"ks":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&&(u=!1);break}u&&(r[n]=l)}}return s}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const s in this.materialsInfo)this.materialsArray[e]=this.create(s),this.nameLookup[s]=e,e++;return this.materialsArray}create(e){return this.materials[e]===void 0&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const s=this,i=this.materialsInfo[e],t={name:e,side:this.side};function r(u,l){return typeof l!="string"||l===""?"":/^https?:\/\//i.test(l)?l:u+l}function h(u,l){if(t[u])return;const n=s.getTextureParams(l,t),o=s.loadTexture(r(s.baseUrl,n.url));o.repeat.copy(n.scale),o.offset.copy(n.offset),o.wrapS=s.wrap,o.wrapT=s.wrap,(u==="map"||u==="emissiveMap")&&(o.colorSpace=c.SRGBColorSpace),t[u]=o}for(const u in i){const l=i[u];let n;if(l!=="")switch(u.toLowerCase()){case"kd":t.color=new c.Color().fromArray(l).convertSRGBToLinear();break;case"ks":t.specular=new c.Color().fromArray(l).convertSRGBToLinear();break;case"ke":t.emissive=new c.Color().fromArray(l).convertSRGBToLinear();break;case"map_kd":h("map",l);break;case"map_ks":h("specularMap",l);break;case"map_ke":h("emissiveMap",l);break;case"norm":h("normalMap",l);break;case"map_bump":case"bump":h("bumpMap",l);break;case"map_d":h("alphaMap",l),t.transparent=!0;break;case"ns":t.shininess=parseFloat(l);break;case"d":n=parseFloat(l),n<1&&(t.opacity=n,t.transparent=!0);break;case"tr":n=parseFloat(l),this.options&&this.options.invertTrProperty&&(n=1-n),n>0&&(t.opacity=1-n,t.transparent=!0);break}}return this.materials[e]=new c.MeshPhongMaterial(t),this.materials[e]}getTextureParams(e,s){const i={scale:new c.Vector2(1,1),offset:new c.Vector2(0,0)},t=e.split(/\s+/);let r;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}loadTexture(e,s,i,t,r){const h=this.manager!==void 0?this.manager:c.DefaultLoadingManager;let u=h.getHandler(e);u===null&&(u=new c.TextureLoader(h)),u.setCrossOrigin&&u.setCrossOrigin(this.crossOrigin);const l=u.load(e,i,t,r);return s!==void 0&&(l.mapping=s),l}}exports.MTLLoader=Y;exports.OBJLoader=X;exports.STLLoader=H;
@@ -0,0 +1,609 @@
1
+ import { O as W, R as J, w as T, C as O, a5 as E, V as I, aF as M, u as re, ai as H, ah as Y, ag as B, o as se, am as Z, ao as N, k as Q, Q as ne, aB as ie, ad as oe, Y as X, b1 as ae, a3 as le, f as ce } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-aFJhRTyx.js";
2
+ class be extends W {
3
+ constructor(e) {
4
+ super(e);
5
+ }
6
+ load(e, s, i, t) {
7
+ const r = this, h = new J(this.manager);
8
+ h.setPath(this.path), h.setResponseType("arraybuffer"), h.setRequestHeader(this.requestHeader), h.setWithCredentials(this.withCredentials), h.load(e, function(c) {
9
+ try {
10
+ s(r.parse(c));
11
+ } catch (l) {
12
+ t ? t(l) : console.error(l), r.manager.itemError(e);
13
+ }
14
+ }, i, t);
15
+ }
16
+ parse(e) {
17
+ function s(n) {
18
+ const o = new DataView(n), a = 32 / 8 * 3 + 32 / 8 * 3 * 3 + 16 / 8, u = o.getUint32(80, !0);
19
+ if (80 + 32 / 8 + u * a === o.byteLength)
20
+ return !0;
21
+ const m = [115, 111, 108, 105, 100];
22
+ for (let p = 0; p < 5; p++)
23
+ if (i(m, o, p)) return !1;
24
+ return !0;
25
+ }
26
+ function i(n, o, a) {
27
+ for (let u = 0, d = n.length; u < d; u++)
28
+ if (n[u] !== o.getUint8(a + u)) return !1;
29
+ return !0;
30
+ }
31
+ function t(n) {
32
+ const o = new DataView(n), a = o.getUint32(80, !0);
33
+ let u, d, m, p = !1, g, b, x, C, y;
34
+ for (let v = 0; v < 70; v++)
35
+ o.getUint32(v, !1) == 1129270351 && o.getUint8(v + 4) == 82 && o.getUint8(v + 5) == 61 && (p = !0, g = new Float32Array(a * 3 * 3), b = o.getUint8(v + 6) / 255, x = o.getUint8(v + 7) / 255, C = o.getUint8(v + 8) / 255, y = o.getUint8(v + 9) / 255);
36
+ const j = 84, f = 12 * 4 + 2, w = new T(), _ = new Float32Array(a * 3 * 3), A = new Float32Array(a * 3 * 3), k = new O();
37
+ for (let v = 0; v < a; v++) {
38
+ const U = j + v * f, D = o.getFloat32(U, !0), P = o.getFloat32(U + 4, !0), R = o.getFloat32(U + 8, !0);
39
+ if (p) {
40
+ const L = o.getUint16(U + 48, !0);
41
+ (L & 32768) === 0 ? (u = (L & 31) / 31, d = (L >> 5 & 31) / 31, m = (L >> 10 & 31) / 31) : (u = b, d = x, m = C);
42
+ }
43
+ for (let L = 1; L <= 3; L++) {
44
+ const G = U + L * 12, V = v * 3 * 3 + (L - 1) * 3;
45
+ _[V] = o.getFloat32(G, !0), _[V + 1] = o.getFloat32(G + 4, !0), _[V + 2] = o.getFloat32(G + 8, !0), A[V] = D, A[V + 1] = P, A[V + 2] = R, p && (k.set(u, d, m).convertSRGBToLinear(), g[V] = k.r, g[V + 1] = k.g, g[V + 2] = k.b);
46
+ }
47
+ }
48
+ return w.setAttribute("position", new E(_, 3)), w.setAttribute("normal", new E(A, 3)), p && (w.setAttribute("color", new E(g, 3)), w.hasColors = !0, w.alpha = y), w;
49
+ }
50
+ function r(n) {
51
+ const o = new T(), a = /solid([\s\S]*?)endsolid/g, u = /facet([\s\S]*?)endfacet/g, d = /solid\s(.+)/;
52
+ let m = 0;
53
+ 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 = [], y = [], j = new I();
54
+ let f, w = 0, _ = 0, A = 0;
55
+ for (; (f = a.exec(n)) !== null; ) {
56
+ _ = A;
57
+ const k = f[0], v = (f = d.exec(k)) !== null ? f[1] : "";
58
+ for (y.push(v); (f = u.exec(k)) !== null; ) {
59
+ let P = 0, R = 0;
60
+ const L = f[0];
61
+ for (; (f = b.exec(L)) !== null; )
62
+ j.x = parseFloat(f[1]), j.y = parseFloat(f[2]), j.z = parseFloat(f[3]), R++;
63
+ for (; (f = g.exec(L)) !== null; )
64
+ x.push(parseFloat(f[1]), parseFloat(f[2]), parseFloat(f[3])), C.push(j.x, j.y, j.z), P++, A++;
65
+ R !== 1 && console.error("THREE.STLLoader: Something isn't right with the normal of face number " + m), P !== 3 && console.error("THREE.STLLoader: Something isn't right with the vertices of face number " + m), m++;
66
+ }
67
+ const U = _, D = A - _;
68
+ o.userData.groupNames = y, o.addGroup(U, D, w), w++;
69
+ }
70
+ return o.setAttribute("position", new M(x, 3)), o.setAttribute("normal", new M(C, 3)), o;
71
+ }
72
+ function h(n) {
73
+ return typeof n != "string" ? new TextDecoder().decode(n) : n;
74
+ }
75
+ function c(n) {
76
+ if (typeof n == "string") {
77
+ const o = new Uint8Array(n.length);
78
+ for (let a = 0; a < n.length; a++)
79
+ o[a] = n.charCodeAt(a) & 255;
80
+ return o.buffer || o;
81
+ } else
82
+ return n;
83
+ }
84
+ const l = c(e);
85
+ return s(l) ? t(l) : r(h(e));
86
+ }
87
+ }
88
+ const he = /^[og]\s*(.+)?/, ue = /^mtllib /, pe = /^usemtl /, fe = /^usemap /, K = /\s+/, $ = new I(), q = new I(), ee = new I(), te = new I(), F = new I(), z = new O();
89
+ function de() {
90
+ const S = {
91
+ objects: [],
92
+ object: {},
93
+ vertices: [],
94
+ normals: [],
95
+ colors: [],
96
+ uvs: [],
97
+ materials: {},
98
+ materialLibraries: [],
99
+ startObject: function(e, s) {
100
+ if (this.object && this.object.fromDeclaration === !1) {
101
+ this.object.name = e, this.object.fromDeclaration = s !== !1;
102
+ return;
103
+ }
104
+ const i = this.object && typeof this.object.currentMaterial == "function" ? this.object.currentMaterial() : void 0;
105
+ if (this.object && typeof this.object._finalize == "function" && this.object._finalize(!0), this.object = {
106
+ name: e || "",
107
+ fromDeclaration: s !== !1,
108
+ geometry: {
109
+ vertices: [],
110
+ normals: [],
111
+ colors: [],
112
+ uvs: [],
113
+ hasUVIndices: !1
114
+ },
115
+ materials: [],
116
+ smooth: !0,
117
+ startMaterial: function(t, r) {
118
+ const h = this._finalize(!1);
119
+ h && (h.inherited || h.groupCount <= 0) && this.materials.splice(h.index, 1);
120
+ const c = {
121
+ index: this.materials.length,
122
+ name: t || "",
123
+ mtllib: Array.isArray(r) && r.length > 0 ? r[r.length - 1] : "",
124
+ smooth: h !== void 0 ? h.smooth : this.smooth,
125
+ groupStart: h !== void 0 ? h.groupEnd : 0,
126
+ groupEnd: -1,
127
+ groupCount: -1,
128
+ inherited: !1,
129
+ clone: function(l) {
130
+ const n = {
131
+ index: typeof l == "number" ? l : this.index,
132
+ name: this.name,
133
+ mtllib: this.mtllib,
134
+ smooth: this.smooth,
135
+ groupStart: 0,
136
+ groupEnd: -1,
137
+ groupCount: -1,
138
+ inherited: !1
139
+ };
140
+ return n.clone = this.clone.bind(n), n;
141
+ }
142
+ };
143
+ return this.materials.push(c), c;
144
+ },
145
+ currentMaterial: function() {
146
+ if (this.materials.length > 0)
147
+ return this.materials[this.materials.length - 1];
148
+ },
149
+ _finalize: function(t) {
150
+ const r = this.currentMaterial();
151
+ 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)
152
+ for (let h = this.materials.length - 1; h >= 0; h--)
153
+ this.materials[h].groupCount <= 0 && this.materials.splice(h, 1);
154
+ return t && this.materials.length === 0 && this.materials.push({
155
+ name: "",
156
+ smooth: this.smooth
157
+ }), r;
158
+ }
159
+ }, i && i.name && typeof i.clone == "function") {
160
+ const t = i.clone(0);
161
+ t.inherited = !0, this.object.materials.push(t);
162
+ }
163
+ this.objects.push(this.object);
164
+ },
165
+ finalize: function() {
166
+ this.object && typeof this.object._finalize == "function" && this.object._finalize(!0);
167
+ },
168
+ parseVertexIndex: function(e, s) {
169
+ const i = parseInt(e, 10);
170
+ return (i >= 0 ? i - 1 : i + s / 3) * 3;
171
+ },
172
+ parseNormalIndex: function(e, s) {
173
+ const i = parseInt(e, 10);
174
+ return (i >= 0 ? i - 1 : i + s / 3) * 3;
175
+ },
176
+ parseUVIndex: function(e, s) {
177
+ const i = parseInt(e, 10);
178
+ return (i >= 0 ? i - 1 : i + s / 2) * 2;
179
+ },
180
+ addVertex: function(e, s, i) {
181
+ const t = this.vertices, r = this.object.geometry.vertices;
182
+ 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]);
183
+ },
184
+ addVertexPoint: function(e) {
185
+ const s = this.vertices;
186
+ this.object.geometry.vertices.push(s[e + 0], s[e + 1], s[e + 2]);
187
+ },
188
+ addVertexLine: function(e) {
189
+ const s = this.vertices;
190
+ this.object.geometry.vertices.push(s[e + 0], s[e + 1], s[e + 2]);
191
+ },
192
+ addNormal: function(e, s, i) {
193
+ const t = this.normals, r = this.object.geometry.normals;
194
+ 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]);
195
+ },
196
+ addFaceNormal: function(e, s, i) {
197
+ const t = this.vertices, r = this.object.geometry.normals;
198
+ $.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);
199
+ },
200
+ addColor: function(e, s, i) {
201
+ const t = this.colors, r = this.object.geometry.colors;
202
+ 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]);
203
+ },
204
+ addUV: function(e, s, i) {
205
+ const t = this.uvs, r = this.object.geometry.uvs;
206
+ r.push(t[e + 0], t[e + 1]), r.push(t[s + 0], t[s + 1]), r.push(t[i + 0], t[i + 1]);
207
+ },
208
+ addDefaultUV: function() {
209
+ const e = this.object.geometry.uvs;
210
+ e.push(0, 0), e.push(0, 0), e.push(0, 0);
211
+ },
212
+ addUVLine: function(e) {
213
+ const s = this.uvs;
214
+ this.object.geometry.uvs.push(s[e + 0], s[e + 1]);
215
+ },
216
+ addFace: function(e, s, i, t, r, h, c, l, n) {
217
+ const o = this.vertices.length;
218
+ let a = this.parseVertexIndex(e, o), u = this.parseVertexIndex(s, o), d = this.parseVertexIndex(i, o);
219
+ if (this.addVertex(a, u, d), this.addColor(a, u, d), c !== void 0 && c !== "") {
220
+ const m = this.normals.length;
221
+ a = this.parseNormalIndex(c, m), u = this.parseNormalIndex(l, m), d = this.parseNormalIndex(n, m), this.addNormal(a, u, d);
222
+ } else
223
+ this.addFaceNormal(a, u, d);
224
+ if (t !== void 0 && t !== "") {
225
+ const m = this.uvs.length;
226
+ 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;
227
+ } else
228
+ this.addDefaultUV();
229
+ },
230
+ addPointGeometry: function(e) {
231
+ this.object.geometry.type = "Points";
232
+ const s = this.vertices.length;
233
+ for (let i = 0, t = e.length; i < t; i++) {
234
+ const r = this.parseVertexIndex(e[i], s);
235
+ this.addVertexPoint(r), this.addColor(r);
236
+ }
237
+ },
238
+ addLineGeometry: function(e, s) {
239
+ this.object.geometry.type = "Line";
240
+ const i = this.vertices.length, t = this.uvs.length;
241
+ for (let r = 0, h = e.length; r < h; r++)
242
+ this.addVertexLine(this.parseVertexIndex(e[r], i));
243
+ for (let r = 0, h = s.length; r < h; r++)
244
+ this.addUVLine(this.parseUVIndex(s[r], t));
245
+ }
246
+ };
247
+ return S.startObject("", !1), S;
248
+ }
249
+ class xe extends W {
250
+ constructor(e) {
251
+ super(e), this.materials = null;
252
+ }
253
+ load(e, s, i, t) {
254
+ const r = this, h = new J(this.manager);
255
+ h.setPath(this.path), h.setRequestHeader(this.requestHeader), h.setWithCredentials(this.withCredentials), h.load(e, function(c) {
256
+ try {
257
+ s(r.parse(c));
258
+ } catch (l) {
259
+ t ? t(l) : console.error(l), r.manager.itemError(e);
260
+ }
261
+ }, i, t);
262
+ }
263
+ setMaterials(e) {
264
+ return this.materials = e, this;
265
+ }
266
+ parse(e) {
267
+ const s = new de();
268
+ e.indexOf(`\r
269
+ `) !== -1 && (e = e.replace(/\r\n/g, `
270
+ `)), e.indexOf(`\\
271
+ `) !== -1 && (e = e.replace(/\\\n/g, ""));
272
+ const i = e.split(`
273
+ `);
274
+ let t = [];
275
+ for (let c = 0, l = i.length; c < l; c++) {
276
+ const n = i[c].trimStart();
277
+ if (n.length === 0) continue;
278
+ const o = n.charAt(0);
279
+ if (o !== "#")
280
+ if (o === "v") {
281
+ const a = n.split(K);
282
+ switch (a[0]) {
283
+ case "v":
284
+ s.vertices.push(
285
+ parseFloat(a[1]),
286
+ parseFloat(a[2]),
287
+ parseFloat(a[3])
288
+ ), a.length >= 7 ? (z.setRGB(
289
+ parseFloat(a[4]),
290
+ parseFloat(a[5]),
291
+ parseFloat(a[6])
292
+ ).convertSRGBToLinear(), s.colors.push(z.r, z.g, z.b)) : s.colors.push(void 0, void 0, void 0);
293
+ break;
294
+ case "vn":
295
+ s.normals.push(
296
+ parseFloat(a[1]),
297
+ parseFloat(a[2]),
298
+ parseFloat(a[3])
299
+ );
300
+ break;
301
+ case "vt":
302
+ s.uvs.push(
303
+ parseFloat(a[1]),
304
+ parseFloat(a[2])
305
+ );
306
+ break;
307
+ }
308
+ } else if (o === "f") {
309
+ const u = n.slice(1).trim().split(K), d = [];
310
+ for (let p = 0, g = u.length; p < g; p++) {
311
+ const b = u[p];
312
+ if (b.length > 0) {
313
+ const x = b.split("/");
314
+ d.push(x);
315
+ }
316
+ }
317
+ const m = d[0];
318
+ for (let p = 1, g = d.length - 1; p < g; p++) {
319
+ const b = d[p], x = d[p + 1];
320
+ s.addFace(
321
+ m[0],
322
+ b[0],
323
+ x[0],
324
+ m[1],
325
+ b[1],
326
+ x[1],
327
+ m[2],
328
+ b[2],
329
+ x[2]
330
+ );
331
+ }
332
+ } else if (o === "l") {
333
+ const a = n.substring(1).trim().split(" ");
334
+ let u = [];
335
+ const d = [];
336
+ if (n.indexOf("/") === -1)
337
+ u = a;
338
+ else
339
+ for (let m = 0, p = a.length; m < p; m++) {
340
+ const g = a[m].split("/");
341
+ g[0] !== "" && u.push(g[0]), g[1] !== "" && d.push(g[1]);
342
+ }
343
+ s.addLineGeometry(u, d);
344
+ } else if (o === "p") {
345
+ const u = n.slice(1).trim().split(" ");
346
+ s.addPointGeometry(u);
347
+ } else if ((t = he.exec(n)) !== null) {
348
+ const a = (" " + t[0].slice(1).trim()).slice(1);
349
+ s.startObject(a);
350
+ } else if (pe.test(n))
351
+ s.object.startMaterial(n.substring(7).trim(), s.materialLibraries);
352
+ else if (ue.test(n))
353
+ s.materialLibraries.push(n.substring(7).trim());
354
+ else if (fe.test(n))
355
+ console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');
356
+ else if (o === "s") {
357
+ if (t = n.split(" "), t.length > 1) {
358
+ const u = t[1].trim().toLowerCase();
359
+ s.object.smooth = u !== "0" && u !== "off";
360
+ } else
361
+ s.object.smooth = !0;
362
+ const a = s.object.currentMaterial();
363
+ a && (a.smooth = s.object.smooth);
364
+ } else {
365
+ if (n === "\0") continue;
366
+ console.warn('THREE.OBJLoader: Unexpected line: "' + n + '"');
367
+ }
368
+ }
369
+ s.finalize();
370
+ const r = new re();
371
+ if (r.materialLibraries = [].concat(s.materialLibraries), !(s.objects.length === 1 && s.objects[0].geometry.vertices.length === 0) === !0)
372
+ for (let c = 0, l = s.objects.length; c < l; c++) {
373
+ const n = s.objects[c], o = n.geometry, a = n.materials, u = o.type === "Line", d = o.type === "Points";
374
+ let m = !1;
375
+ if (o.vertices.length === 0) continue;
376
+ const p = new T();
377
+ 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));
378
+ const g = [];
379
+ for (let x = 0, C = a.length; x < C; x++) {
380
+ const y = a[x], j = y.name + "_" + y.smooth + "_" + m;
381
+ let f = s.materials[j];
382
+ if (this.materials !== null) {
383
+ if (f = this.materials.create(y.name), u && f && !(f instanceof H)) {
384
+ const w = new H();
385
+ Y.prototype.copy.call(w, f), w.color.copy(f.color), f = w;
386
+ } else if (d && f && !(f instanceof B)) {
387
+ const w = new B({ size: 10, sizeAttenuation: !1 });
388
+ Y.prototype.copy.call(w, f), w.color.copy(f.color), w.map = f.map, f = w;
389
+ }
390
+ }
391
+ f === void 0 && (u ? f = new H() : d ? f = new B({ size: 1, sizeAttenuation: !1 }) : f = new se(), f.name = y.name, f.flatShading = !y.smooth, f.vertexColors = m, s.materials[j] = f), g.push(f);
392
+ }
393
+ let b;
394
+ if (g.length > 1) {
395
+ for (let x = 0, C = a.length; x < C; x++) {
396
+ const y = a[x];
397
+ p.addGroup(y.groupStart, y.groupCount, x);
398
+ }
399
+ u ? b = new Z(p, g) : d ? b = new N(p, g) : b = new Q(p, g);
400
+ } else
401
+ u ? b = new Z(p, g[0]) : d ? b = new N(p, g[0]) : b = new Q(p, g[0]);
402
+ b.name = n.name, r.add(b);
403
+ }
404
+ else if (s.vertices.length > 0) {
405
+ const c = new B({ size: 1, sizeAttenuation: !1 }), l = new T();
406
+ 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);
407
+ const n = new N(l, c);
408
+ r.add(n);
409
+ }
410
+ return r;
411
+ }
412
+ }
413
+ class we extends W {
414
+ constructor(e) {
415
+ super(e);
416
+ }
417
+ /**
418
+ * Loads and parses a MTL asset from a URL.
419
+ *
420
+ * @param {String} url - URL to the MTL file.
421
+ * @param {Function} [onLoad] - Callback invoked with the loaded object.
422
+ * @param {Function} [onProgress] - Callback for download progress.
423
+ * @param {Function} [onError] - Callback for download errors.
424
+ *
425
+ * @see setPath setResourcePath
426
+ *
427
+ * @note In order for relative texture references to resolve correctly
428
+ * you must call setResourcePath() explicitly prior to load.
429
+ */
430
+ load(e, s, i, t) {
431
+ const r = this, h = this.path === "" ? ne.extractUrlBase(e) : this.path, c = new J(this.manager);
432
+ c.setPath(this.path), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(e, function(l) {
433
+ try {
434
+ s(r.parse(l, h));
435
+ } catch (n) {
436
+ t ? t(n) : console.error(n), r.manager.itemError(e);
437
+ }
438
+ }, i, t);
439
+ }
440
+ setMaterialOptions(e) {
441
+ return this.materialOptions = e, this;
442
+ }
443
+ /**
444
+ * Parses a MTL file.
445
+ *
446
+ * @param {String} text - Content of MTL file
447
+ * @return {MaterialCreator}
448
+ *
449
+ * @see setPath setResourcePath
450
+ *
451
+ * @note In order for relative texture references to resolve correctly
452
+ * you must call setResourcePath() explicitly prior to parse.
453
+ */
454
+ parse(e, s) {
455
+ const i = e.split(`
456
+ `);
457
+ let t = {};
458
+ const r = /\s+/, h = {};
459
+ for (let l = 0; l < i.length; l++) {
460
+ let n = i[l];
461
+ if (n = n.trim(), n.length === 0 || n.charAt(0) === "#")
462
+ continue;
463
+ const o = n.indexOf(" ");
464
+ let a = o >= 0 ? n.substring(0, o) : n;
465
+ a = a.toLowerCase();
466
+ let u = o >= 0 ? n.substring(o + 1) : "";
467
+ if (u = u.trim(), a === "newmtl")
468
+ t = { name: u }, h[u] = t;
469
+ else if (a === "ka" || a === "kd" || a === "ks" || a === "ke") {
470
+ const d = u.split(r, 3);
471
+ t[a] = [parseFloat(d[0]), parseFloat(d[1]), parseFloat(d[2])];
472
+ } else
473
+ t[a] = u;
474
+ }
475
+ const c = new me(this.resourcePath || s, this.materialOptions);
476
+ return c.setCrossOrigin(this.crossOrigin), c.setManager(this.manager), c.setMaterials(h), c;
477
+ }
478
+ }
479
+ class me {
480
+ constructor(e = "", s = {}) {
481
+ 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;
482
+ }
483
+ setCrossOrigin(e) {
484
+ return this.crossOrigin = e, this;
485
+ }
486
+ setManager(e) {
487
+ this.manager = e;
488
+ }
489
+ setMaterials(e) {
490
+ this.materialsInfo = this.convert(e), this.materials = {}, this.materialsArray = [], this.nameLookup = {};
491
+ }
492
+ convert(e) {
493
+ if (!this.options) return e;
494
+ const s = {};
495
+ for (const i in e) {
496
+ const t = e[i], r = {};
497
+ s[i] = r;
498
+ for (const h in t) {
499
+ let c = !0, l = t[h];
500
+ const n = h.toLowerCase();
501
+ switch (n) {
502
+ case "kd":
503
+ case "ka":
504
+ case "ks":
505
+ 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);
506
+ break;
507
+ }
508
+ c && (r[n] = l);
509
+ }
510
+ }
511
+ return s;
512
+ }
513
+ preload() {
514
+ for (const e in this.materialsInfo)
515
+ this.create(e);
516
+ }
517
+ getIndex(e) {
518
+ return this.nameLookup[e];
519
+ }
520
+ getAsArray() {
521
+ let e = 0;
522
+ for (const s in this.materialsInfo)
523
+ this.materialsArray[e] = this.create(s), this.nameLookup[s] = e, e++;
524
+ return this.materialsArray;
525
+ }
526
+ create(e) {
527
+ return this.materials[e] === void 0 && this.createMaterial_(e), this.materials[e];
528
+ }
529
+ createMaterial_(e) {
530
+ const s = this, i = this.materialsInfo[e], t = {
531
+ name: e,
532
+ side: this.side
533
+ };
534
+ function r(c, l) {
535
+ return typeof l != "string" || l === "" ? "" : /^https?:\/\//i.test(l) ? l : c + l;
536
+ }
537
+ function h(c, l) {
538
+ if (t[c]) return;
539
+ const n = s.getTextureParams(l, t), o = s.loadTexture(r(s.baseUrl, n.url));
540
+ 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;
541
+ }
542
+ for (const c in i) {
543
+ const l = i[c];
544
+ let n;
545
+ if (l !== "")
546
+ switch (c.toLowerCase()) {
547
+ // Ns is material specular exponent
548
+ case "kd":
549
+ t.color = new O().fromArray(l).convertSRGBToLinear();
550
+ break;
551
+ case "ks":
552
+ t.specular = new O().fromArray(l).convertSRGBToLinear();
553
+ break;
554
+ case "ke":
555
+ t.emissive = new O().fromArray(l).convertSRGBToLinear();
556
+ break;
557
+ case "map_kd":
558
+ h("map", l);
559
+ break;
560
+ case "map_ks":
561
+ h("specularMap", l);
562
+ break;
563
+ case "map_ke":
564
+ h("emissiveMap", l);
565
+ break;
566
+ case "norm":
567
+ h("normalMap", l);
568
+ break;
569
+ case "map_bump":
570
+ case "bump":
571
+ h("bumpMap", l);
572
+ break;
573
+ case "map_d":
574
+ h("alphaMap", l), t.transparent = !0;
575
+ break;
576
+ case "ns":
577
+ t.shininess = parseFloat(l);
578
+ break;
579
+ case "d":
580
+ n = parseFloat(l), n < 1 && (t.opacity = n, t.transparent = !0);
581
+ break;
582
+ case "tr":
583
+ n = parseFloat(l), this.options && this.options.invertTrProperty && (n = 1 - n), n > 0 && (t.opacity = 1 - n, t.transparent = !0);
584
+ break;
585
+ }
586
+ }
587
+ return this.materials[e] = new se(t), this.materials[e];
588
+ }
589
+ getTextureParams(e, s) {
590
+ const i = {
591
+ scale: new X(1, 1),
592
+ offset: new X(0, 0)
593
+ }, t = e.split(/\s+/);
594
+ let r;
595
+ 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;
596
+ }
597
+ loadTexture(e, s, i, t, r) {
598
+ const h = this.manager !== void 0 ? this.manager : ae;
599
+ let c = h.getHandler(e);
600
+ c === null && (c = new le(h)), c.setCrossOrigin && c.setCrossOrigin(this.crossOrigin);
601
+ const l = c.load(e, i, t, r);
602
+ return s !== void 0 && (l.mapping = s), l;
603
+ }
604
+ }
605
+ export {
606
+ we as M,
607
+ xe as O,
608
+ be as S
609
+ };