PageSourceSearch

https://abidlabs-trackio-mnist-a.hf.space/assets/objFileLoader-B1XkUBup.js

js abidlabs-trackio-mnist-a.hf.space collected 2026-10-04 16:37:59 UTC 21,231 bytes, 3 lines download raw bytes

vendor: 2,380 bytes, lines 1-2
1import{V as M,a as E}from"./math.vector-C1xyPDEl.js";import{T as B}from"./tools-D01N7ptR.js";import{RegisterSceneLoaderPlugin as j}from"./sceneLoader-CutT-qCn.js";import{A as L}from"./assetContainer-41lbZEXn.js";import{O as w}from"./dynamic-Byj-ExMi.js";import{Color3 as b,Color4 as C}from"./math.color-CzLaKyb6.js";import{T as v}from"./texture-BEqhDl5Y.js";import{StandardMaterial as T}from"./standardMaterial-BX8HF7fn.js";import{V as x}from"./buffer-DqKlo1ts.js";import{G as P,M as D}from"./mesh-BczlZ8bV.js";import{V}from"./mesh.vertexData-Cr3zcPIw.js";import{L as A}from"./bufferUtils-DTRdUD8L.js";import"./math.scalar.functions-DkeaWAWz.js";import"./decorators.serialization-C7d7ykGG.js";import"./scene-gn_hoGMy.js";import"./smartArray-CO6iJ0u5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./renderingManager-CiY2OUrf.js";import"./deviceInputEvents-BTza-zoR.js";import"./perfCounter-DusmGz8t.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./dataBuffer-CgoqiUzT.js";import"./instancedMesh-B9hLhKZd.js";import"./light-DT53MGnW.js";import"./node-C-Iu0ALa.js";import"./index-Bc7OztLw.js";import"./baseTexture-CgAggsey.js";import"./imageProcessing-2WziWti-.js";import"./material-CrEsrP1R.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./pushMaterial-B8MG1fVH.js";import"./material.detailMapConfiguration-D1Pl6X8T.js";import"./math.viewport-CgkTt1RS.js";import"./math.axis-Ck7JfPPj.js";class g{constructor(){this.materials=[]}parseMTL(t,o,e,r){if(o instanceof ArrayBuffer)return;const l=o.split(`
2`),h=/\s+/;let p,a=null;for(let d=0;d<l.length;d++){const u=l[d].trim();if(u.length===0||u.charAt(0)==="#")continue;const n=u.indexOf(" ");let s=n>=0?u.substring(0,n):u;s=s.toLowerCase();const i=n>=0?u.substring(n+1).trim():"";if(s==="newmtl")a&&this.materials.push(a),t._blockEntityCollection=!!r,a=new T(i,t),a._parentContainer=r,t._blockEntityCollection=!1;else if(s==="kd"&&a)p=i.split(h,3).map(parseFloat),a.diffuseColor=b.FromArray(p);else if(s==="ka"&&a)p=i.split(h,3).map(parseFloat),a.ambientColor=b.FromArray(p);else if(s==="ks"&&a)p=i.split(h,3).map(parseFloat),a.specularColor=b.FromArray(p);else if(s==="ke"&&a)p=i.split(h,3).map(parseFloat),a.emissiveColor=b.FromArray(p);else if(s==="ns"&&a)a.specularPower=parseFloat(i);
2else if(s==="d"&&a)a.alpha=parseFloat(i);else if(s==="map_ka"&&a)a.ambientTexture=g._GetTexture(e,i,t);else if(s==="map_kd"&&a)a.diffuseTexture=g._GetTexture(e,i,t);else if(s==="map_ks"&&a)a.specularTexture=g._GetTexture(e,i,t);else if(s!=="map_ns")if(s==="map_bump"&&a){const m=i.split(h),f=m.indexOf("-bm");let F=null;f>=0&&(F=m[f+1],m.splice(f,2)),a.bumpTexture=g._GetTexture(e,m.join(" "),t),a.bumpTexture&&F!==null&&(a.bumpTexture.level=parseFloat(F))}else s==="map_d"&&a&&(a.opacityTexture=g._GetTexture(e,i,t))}a&&this.materials.push(a)}static _GetTexture(t,o,e){if(!o)return null;let r=t;if(t==="file:"){let l=o.lastIndexOf("\\");l===-1&&(l=o.lastIndexOf("/")),l>-1?r+=o.substring(l+1):r+=o}else r+=o;return new v(r,e,!1,g.INVERT_TEXTURE_Y)}}g.INVERT_TEXTURE_Y=!0;class _{constructor(t,o,e){this._positions=[],this._normals=[],this._uvs=[],this._colors=[],this._extColors=[],this._meshesFromObj=[],this._indicesForBabylon=[],this._wrappedPositionForBabylon=[],this._wrappedUvsForBabylon=[],this._wrappedColorsForBabylon=[],this._wrappedNormalsForBabylon=[],this._tuplePosNorm=[],this._curPositionInIndices=0,this._hasMeshes=!1,this._unwrappedPositionsForBabylon=[],this._unwrappedColorsForBabylon=[],this._unwrappedNormalsForBabylon=[],this._unwrappedUVForBabylon=[],this._triangles=[],this._materialNameFromObj="",this._objMeshName="",this._increment=1,this._isFirstMaterial=!0,this._grayColor=new C(.5,.5,.5,1),this._hasLineData=!1,this._materialToUse=t,this._babylonMeshesArray=o,this._loadingOptions=e}_isInArray(t,o){t[o[0]]||(t[o[0]]={normals:[],idx:[]});const e=t[o[0]].normals.indexOf(o[1]);return e===-1?-1:t[o[0]].idx[e]}_isInArrayUV(t,o){t[o[0]]||(t[o[0]]={normals:[],idx:[],uv:[]});const e=t[o[0]].normals.indexOf(o[1]);return e!=1&&o[2]===t[o[0]].uv[e]?t[o[0]].idx[e]:-1}_setData(t){t.indiceUvsFromObj??(t.indiceUvsFromObj=-1),t.indiceNormalFromObj??(t.indiceNormalFromObj=-1);let o;this._loadingOptions.optimizeWithUV?o=this._isInArrayUV(this._tuplePosNorm,[t.indicePositionFromObj,t.indiceNormalFromObj,t.indiceUvsFromObj]):o=this._isInArray(this._tuplePosNorm,[t.indicePositionFromObj,t.indiceNormalFromObj]),o===-1?(this._indicesForBabylon.push(this._wrappedPositionForBabylon.length),this._wrappedPositionForBabylon.push(t.positionVectorFromOBJ),t.textureVectorFromOBJ!==void 0&&this._wrappedUvsForBabylon.push(t.textureVectorFromOBJ),t.normalsVectorFromOBJ!==void 0&&this._wrappedNormalsForBabylon.push(t.normalsVectorFromOBJ),t.positionColorsFromOBJ!==void 0&&this._wrappedColorsForBabylon.push(t.positionColorsFromOBJ),this._tuplePosNorm[t.indicePositionFromObj].normals.push(t.indiceNormalFromObj),this._tuplePosNorm[t.indicePositionFromObj].idx.push(this._curPositionInIndices++),this._loadingOptions.optimizeWithUV&&this._tuplePosNorm[t.indicePositionFromObj].uv.push(t.indiceUvsFromObj)):this._indicesForBabylon.push(o)}_unwrapData(){try{for(let t=0;t<this._wrappedPositionForBabylon.length;t++)this._unwrappedPositionsForBabylon.push(this._wrappedPositionForBabylon[t].x*this._handednessSign,this._wrappedPositionForBabylon[t].y,this._wrappedPositionForBabylon[t].z),this._wrappedNormalsForBabylon.length&&this._unwrappedNormalsForBabylon.push(this._wrappedNormalsForBabylon[t].x*this._handednessSign,this._wrappedNormalsForBabylon[t].y,this._wrappedNormalsForBabylon[t].z),this._wrappedUvsForBabylon.length&&this._unwrappedUVForBabylon.push(this._wrappedUvsForBabylon[t].x,this._wrappedUvsForBabylon[t].y),this._unwrappedColorsForBabylon.length&&this._unwrappedColorsForBabylon.push(this._wrappedColorsForBabylon[t].r,this._wrappedColorsForBabylon[t].g,this._wrappedColorsForBabylon[t].b,this._wrappedColorsForBabylon[t].a);this._wrappedPositionForBabylon.length=0,this._wrappedNormalsForBabylon.length=0,this._wrappedUvsForBabylon.length=0,this._wrappedColorsForBabylon.length=0,this._tuplePosNorm.length=0,this._curPositionInIndices=0}catch(t){throw new Error("Unable to unwrap data while parsing OBJ data.",{cause:t})}}_getTriangles(t,o){for(let e=o;e<t.length-1;e++)this._pushTriangle(t,e)}_getColor(t){if(this._loadingOptions.importVertexColors)return this._extColors[t]??this._colors[t]}_setDataForCurrentFaceWithPattern1(t,o){this._getTriangles(t,o);for(let e=0;e<this._triangles.length;e++){const r=parseInt(this._triangles[e])-1;this._setData({indicePositionFromObj:r,positionVectorFromOBJ:this._positions[r],positionColorsFromOBJ:this._getColor(r)})}this._triangles.length=0}_setDataForCurrentFaceWithPattern2(t,o){this._getTriangles(t,o);for(let e=0;e<this._triangles.length;e++){const r=this._triangles[e].split("/"),l=parseInt(r[0])-1,h=parseInt(r[1])-1;this._setData({indicePositionFromObj:l,indiceUvsFromObj:h,positionVectorFromOBJ:this._positions[l],textureVectorFromOBJ:this._uvs[h],positionColorsFromOBJ:this._getColor(l)})}this._triangles.length=0}_setDataForCurrentFaceWithPattern3(t,o){this._getTriangles(t,o);for(let e=0;e<this._triangles.length;e++){const r=this._triangles[e].split("/"),l=parseInt(r[0])-1,h=parseInt(r[1])-1,p=parseInt(r[2])-1;this._setData({indicePositionFromObj:l,indiceUvsFromObj:h,indiceNormalFromObj:p,positionVectorFromOBJ:this._positions[l],textureVectorFromOBJ:this._uvs[h],normalsVectorFromOBJ:this._normals[p]})}this._triangles.length=0}_setDataForCurrentFaceWithPattern4(t,o){this._getTriangles(t,o);for(let e=0;e<this._triangles.length;e++){const r=this._triangles[e].split("//"),l=parseInt(r[0])-1,h=parseInt(r[1])-1;this._setData({indicePositionFromObj:l,indiceNormalFromObj:h,positionVectorFromOBJ:this._positions[l],normalsVectorFromOBJ:this._normals[h],positionColorsFromOBJ:this._getColor(l)})}this._triangles.length=0}_setDataForCurrentFaceWithPattern5(t,o){this._getTriangles(t,o);for(let e=0;e<this._triangles.length;e++){const r=this._triangles[e].split("/"),l=this._positions.length+parseInt(r[0]),h=this._uvs.length+parseInt(r[1]),p=this._normals.length+parseInt(r[2]);this._setData({indicePositionFromObj:l,indiceUvsFromObj:h,indiceNormalFromObj:p,positionVectorFromOBJ:this._positions[l],textureVectorFromOBJ:this._uvs[h],normalsVectorFromOBJ:this._normals[p],positionColorsFromOBJ:this._getColor(l)})}this._triangles.length=0}_addPreviousObjMesh(){this._meshesFromObj.length>0&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._unwrapData(),this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._handledMesh.indices=this._indicesForBabylon.slice(),this._handledMesh.positions=this._unwrappedPositionsForBabylon.slice(),this._unwrappedNormalsForBabylon.length&&(this._handledMesh.normals=this._unwrappedNormalsForBabylon.slice()),this._unwrappedUVForBabylon.length&&(this._handledMesh.uvs=this._unwrappedUVForBabylon.slice()),this._unwrappedColorsForBabylon.length&&(this._handledMesh.colors=this._unwrappedColorsForBabylon.slice()),this._handledMesh.hasLines=this._hasLineData,this._indicesForBabylon.length=0,this._unwrappedPositionsForBabylon.length=0,this._unwrappedColorsForBabylon.length=0,this._unwrappedNormalsForBabylon.length=0,this._unwrappedUVForBabylon.length=0,this._hasLineData=!1)}_optimizeNormals(t){const o=t.getVerticesData(x.PositionKind),e=t.getVerticesData(x.NormalKind),r={};if(!o||!e)return;for(let h=0;h<o.length/3;h++){const p=o[h*3+0],a=o[h*3+1],d=o[h*3+2],u=p+"_"+a+"_"+d;let n=r[u];n||(n=[],r[u]=n),n.push(h)}const l=new M;for(const h in r){const p=r[h];if(p.length<2)continue;const a=p[0];for(let d=1;d<p.length;++d){const u=p[d];e[a*3+0]+=e[u*3+0],e[a*3+1]+=e[u*3+1],e[a*3+2]+=e[u*3+2]}l.copyFromFloats(e[a*3+0],e[a*3+1],e[a*3+2]),l.normalize();for(let d=0;d<p.length;++d){const u=p[d];
vendor: 11,282 bytes, lines 2-3
2e[u*3+0]=l.x,e[u*3+1]=l.y,e[u*3+2]=l.z}}t.setVerticesData(x.NormalKind,e)}static _IsLineElement(t){return t.startsWith("l")}static _IsObjectElement(t){return t.startsWith("o")}static _IsGroupElement(t){return t.startsWith("g")}static _GetZbrushMRGB(t,o){if(!t.startsWith("mrgb"))return null;if(t=t.replace("mrgb","").trim(),o)return[];const e=/[a-z0-9]/g,r=t.match(e);if(!r||r.length%8!==0)return[];const l=[];for(let h=0;h<r.length/8;h++){const p=r[h*8+2]+r[h*8+3],a=r[h*8+4]+r[h*8+5],d=r[h*8+6]+r[h*8+7];l.push(new C(parseInt(p,16)/255,parseInt(a,16)/255,parseInt(d,16)/255,1))}return l}parse(t,o,e,r,l){var u;o=o.replace(/#MRGB/g,"mrgb"),o=o.replace(/#.*$/gm,"").trim(),this._loadingOptions.useLegacyBehavior?(this._pushTriangle=(n,s)=>this._triangles.push(n[0],n[s],n[s+1]),this._handednessSign=1):e.useRightHandedSystem?(this._pushTriangle=(n,s)=>this._triangles.push(n[0],n[s+1],n[s]),this._handednessSign=1):(this._pushTriangle=(n,s)=>this._triangles.push(n[0],n[s],n[s+1]),this._handednessSign=-1);const h=o.split(`
3`),p=[];let a=[];p.push(a);for(let n=0;n<h.length;n++){const s=h[n].trim().replace(/\s\s/g," ");if(!(s.length===0||s.charAt(0)==="#"))if((_._IsGroupElement(s)||_._IsObjectElement(s))&&(a=[],p.push(a)),_._IsLineElement(s)){const i=s.split(" ");for(let m=1;m<i.length-1;m++)a.push(`l ${i[m]} ${i[m+1]}`)}else a.push(s)}const d=p.flat();for(let n=0;n<d.length;n++){const s=d[n].trim().replace(/\s\s/g," ");let i;if(!(s.length===0||s.charAt(0)==="#"))if(_.VertexPattern.test(s)){if(i=s.match(/[^ ]+/g),this._positions.push(new M(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3]))),this._loadingOptions.importVertexColors)if(i.length>=7){const m=parseFloat(i[4]),f=parseFloat(i[5]),F=parseFloat(i[6]);this._colors.push(new C(m>1?m/255:m,f>1?f/255:f,F>1?F/255:F,i.length===7||i[7]===void 0?1:parseFloat(i[7])))}else this._colors.push(this._grayColor)}else if((i=_.NormalPattern.exec(s))!==null)this._normals.push(new M(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3])));else if((i=_.UVPattern.exec(s))!==null)this._uvs.push(new E(parseFloat(i[1])*this._loadingOptions.UVScaling.x,parseFloat(i[2])*this._loadingOptions.UVScaling.y));else if((i=_.FacePattern3.exec(s))!==null)this._setDataForCurrentFaceWithPattern3(i[1].trim().split(" "),1);else if((i=_.FacePattern4.exec(s))!==null)this._setDataForCurrentFaceWithPattern4(i[1].trim().split(" "),1);else if((i=_.FacePattern5.exec(s))!==null)this._setDataForCurrentFaceWithPattern5(i[1].trim().split(" "),1);else if((i=_.FacePattern2.exec(s))!==null)this._setDataForCurrentFaceWithPattern2(i[1].trim().split(" "),1);else if((i=_.FacePattern1.exec(s))!==null)this._setDataForCurrentFaceWithPattern1(i[1].trim().split(" "),1);else if((i=_.LinePattern1.exec(s))!==null)this._setDataForCurrentFaceWithPattern1(i[1].trim().split(" "),0),this._hasLineData=!0;else if((i=_.LinePattern2.exec(s))!==null)this._setDataForCurrentFaceWithPattern2(i[1].trim().split(" "),0),this._hasLineData=!0;else if(i=_._GetZbrushMRGB(s,!this._loadingOptions.importVertexColors))for(const m of i)this._extColors.push(m);else if((i=_.LinePattern3.exec(s))!==null)this._setDataForCurrentFaceWithPattern3(i[1].trim().split(" "),0),this._hasLineData=!0;else if(_.GroupDescriptor.test(s)||_.ObjectDescriptor.test(s)){const m={name:s.substring(2).trim(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:_.ObjectDescriptor.test(s)};this._addPreviousObjMesh(),this._meshesFromObj.push(m),this._hasMeshes=!0,this._isFirstMaterial=!0,this._increment=1}else if(_.UseMtlDescriptor.test(s)){if(this._materialNameFromObj=s.substring(7).trim(),!this._isFirstMaterial||!this._hasMeshes){this._addPreviousObjMesh();const m={name:(this._objMeshName||"mesh")+"_mm"+this._increment.toString(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:!1};this._increment++,this._meshesFromObj.push(m),this._hasMeshes=!0}this._hasMeshes&&this._isFirstMaterial&&(this._meshesFromObj[this._meshesFromObj.length-1].materialName=this._materialNameFromObj,this._isFirstMaterial=!1)}else _.MtlLibGroupDescriptor.test(s)?l(s.substring(7).trim()):_.SmoothDescriptor.test(s)||A.Log("Unhandled expression at line : "+s)}if(this._hasMeshes&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData(),this._handledMesh.indices=this._indicesForBabylon,this._handledMesh.positions=this._unwrappedPositionsForBabylon,this._unwrappedNormalsForBabylon.length&&(this._handledMesh.normals=this._unwrappedNormalsForBabylon),this._unwrappedUVForBabylon.length&&(this._handledMesh.uvs=this._unwrappedUVForBabylon),this._unwrappedColorsForBabylon.length&&(this._handledMesh.colors=this._unwrappedColorsForBabylon),this._handledMesh.hasLines=this._hasLineData),!this._hasMeshes){let n=null;if(this._indicesForBabylon.length)this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData();else{for(const s of this._positions)this._unwrappedPositionsForBabylon.push(s.x,s.y,s.z);if(this._normals.length)for(const s of this._normals)this._unwrappedNormalsForBabylon.push(s.x,s.y,s.z);if(this._uvs.length)for(const s of this._uvs)this._unwrappedUVForBabylon.push(s.x,s.y);if(this._extColors.length)for(const s of this._extColors)this._unwrappedColorsForBabylon.push(s.r,s.g,s.b,s.a);else if(this._colors.length)for(const s of this._colors)this._unwrappedColorsForBabylon.push(s.r,s.g,s.b,s.a);this._materialNameFromObj||(n=new T(P.RandomId(),e),n.pointsCloud=!0,this._materialNameFromObj=n.name,this._normals.length||(n.disableLighting=!0,n.emissiveColor=b.White()))}this._meshesFromObj.push({name:P.RandomId(),indices:this._indicesForBabylon,positions:this._unwrappedPositionsForBabylon,colors:this._unwrappedColorsForBabylon,normals:this._unwrappedNormalsForBabylon,uvs:this._unwrappedUVForBabylon,materialName:this._materialNameFromObj,directMaterial:n,isObject:!0,hasLines:this._hasLineData})}for(let n=0;n<this._meshesFromObj.length;n++){if(t&&this._meshesFromObj[n].name){if(t instanceof Array){if(t.indexOf(this._meshesFromObj[n].name)===-1)continue}else if(this._meshesFromObj[n].name!==t)continue}this._handledMesh=this._meshesFromObj[n],e._blockEntityCollection=!!r;const s=new D(this._meshesFromObj[n].name,e);if(s._parentContainer=r,e._blockEntityCollection=!1,this._handledMesh._babylonMesh=s,!this._handledMesh.isObject){for(let m=n-1;m>=0;--m)if(this._meshesFromObj[m].isObject&&this._meshesFromObj[m]._babylonMesh){s.parent=this._meshesFromObj[m]._babylonMesh;break}}if(this._materialToUse.push(this._meshesFromObj[n].materialName),this._handledMesh.hasLines&&(s._internalMetadata??(s._internalMetadata={}),s._internalMetadata._isLine=!0),((u=this._handledMesh.positions)==null?void 0:u.length)===0){this._babylonMeshesArray.push(s);continue}const i=new V;if(i.indices=this._handledMesh.indices,i.positions=this._handledMesh.positions,this._loadingOptions.computeNormals||!this._handledMesh.normals){const m=new Array;V.ComputeNormals(this._handledMesh.positions,this._handledMesh.indices,m),i.normals=m}else i.normals=this._handledMesh.normals;this._handledMesh.uvs&&(i.uvs=this._handledMesh.uvs),this._handledMesh.colors&&(i.colors=this._handledMesh.colors),i.applyToMesh(s),this._loadingOptions.invertY&&(s.scaling.y*=-1),this._loadingOptions.optimizeNormals&&this._optimizeNormals(s),this._babylonMeshesArray.push(s),this._handledMesh.directMaterial&&(s.material=this._handledMesh.directMaterial)}}}_.ObjectDescriptor=/^o/;_.GroupDescriptor=/^g/;_.MtlLibGroupDescriptor=/^mtllib /;_.UseMtlDescriptor=/^usemtl /;_.SmoothDescriptor=/^s /;_.VertexPattern=/^v(\s+[\d|.|+|\-|e|E]+){3,7}/;_.NormalPattern=/^vn(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/;_.UVPattern=/^vt(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/;_.FacePattern1=/^f\s+(([\d]{1,}[\s]?){3,})+/;_.FacePattern2=/^f\s+((([\d]{1,}\/[\d]{1,}[\s]?){3,})+)/;_.FacePattern3=/^f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/;_.FacePattern4=/^f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/;_.FacePattern5=/^f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/;_.LinePattern1=/^l\s+(([\d]{1,}[\s]?){2,})+/;_.LinePattern2=/^l\s+((([\d]{1,}\/[\d]{1,}[\s]?){2,})+)/;_.LinePattern3=/^l\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){2,})+)/;class c{static get INVERT_TEXTURE_Y(){return g.INVERT_TEXTURE_Y}static set INVERT_TEXTURE_Y(t){g.INVERT_TEXTURE_Y=t}constructor(t){this.name=w.name,this.extensions=w.extensions,this._assetContainer=null,this._loadingOptions={...c._DefaultLoadingOptions,...t??{}}}static get _DefaultLoadingOptions(){return{computeNormals:c.COMPUTE_NORMALS,optimizeNormals:c.OPTIMIZE_NORMALS,importVertexColors:c.IMPORT_VERTEX_COLORS,invertY:c.INVERT_Y,invertTextureY:c.INVERT_TEXTURE_Y,UVScaling:c.UV_SCALING,materialLoadingFailsSilently:c.MATERIAL_LOADING_FAILS_SILENTLY,optimizeWithUV:c.OPTIMIZE_WITH_UV,skipMaterials:c.SKIP_MATERIALS,useLegacyBehavior:c.USE_LEGACY_BEHAVIOR}}_loadMTL(t,o,e,r){const l=o+t;B.LoadFile(l,e,void 0,void 0,!1,(h,p)=>{r(l,p)})}createPlugin(t){return new c(t[w.name])}canDirectLoad(){return!1}importMeshAsync(t,o,e,r){return this._parseSolidAsync(t,o,e,r).then(l=>({meshes:l,particleSystems:[],skeletons:[],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]}))}loadAsync(t,o,e){return this.importMeshAsync(null,t,o,e).then(()=>{})}loadAssetContainerAsync(t,o,e){const r=new L(t);return this._assetContainer=r,this.importMeshAsync(null,t,o,e).then(l=>(l.meshes.forEach(h=>r.meshes.push(h)),l.meshes.forEach(h=>{const p=h.material;p&&r.materials.indexOf(p)==-1&&(r.materials.push(p),p.getActiveTextures().forEach(d=>{r.textures.indexOf(d)==-1&&r.textures.push(d)}))}),this._assetContainer=null,r)).catch(l=>{throw this._assetContainer=null,l})}_parseSolidAsync(t,o,e,r){let l="";const h=new g,p=[],a=[];e=e.replace(/#.*$/gm,"").trim(),new _(p,a,this._loadingOptions).parse(t,e,o,this._assetContainer,n=>{l=n});const u=[];return l!==""&&!this._loadingOptions.skipMaterials&&u.push(new Promise((n,s)=>{this._loadMTL(l,r,i=>{try{h.parseMTL(o,i,r,this._assetContainer);for(let m=0;m<h.materials.length;m++){let f=0;const F=[];let y;for(;(y=p.indexOf(h.materials[m].name,f))>-1;)F.push(y),f=y+1;if(y===-1&&F.length===0)h.materials[m].dispose();else for(let O=0;O<F.length;O++){const I=a[F[O]],N=h.materials[m];I.material=N,I.getTotalIndices()||(N.pointsCloud=!0)}}n()}catch(m){B.Warn(`Error processing MTL file: '${l}'`),this._loadingOptions.materialLoadingFailsSilently?n():s(m)}},(i,m)=>{B.Warn(`Error downloading MTL file: '${l}'`),this._loadingOptions.materialLoadingFailsSilently?n():s(m)})})),Promise.all(u).then(()=>{const n=s=>{var i;return!!(((i=s._internalMetadata)==null?void 0:i._isLine)??!1)};return a.forEach(s=>{if(n(s)){let i=s.material??new T(s.name+"_line",o);i.getBindedMeshes().filter(f=>!n(f)).length>0&&(i=i.clone(i.name+"_line")??i),i.wireframe=!0,s.material=i,s._internalMetadata&&(s._internalMetadata._isLine=void 0)}}),a})}}c.OPTIMIZE_WITH_UV=!0;c.INVERT_Y=!1;c.IMPORT_VERTEX_COLORS=!1;c.COMPUTE_NORMALS=!1;c.OPTIMIZE_NORMALS=!1;c.UV_SCALING=new E(1,1);c.SKIP_MATERIALS=!1;c.MATERIAL_LOADING_FAILS_SILENTLY=!0;c.USE_LEGACY_BEHAVIOR=!1;j(new c);export{c as OBJFileLoader};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.