1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[45155],{45155:(e,t,r)=>{r.d(t,{STLExporter:()=>o});var n=r(85339);class o{parse(e,t={}){let r,o=(t=Object.assign({binary:!1},t)).binary,l=[],a=0;e.traverse(function(e){if(e.isMesh){let t=e.geometry,r=t.index,n=t.getAttribute("position");a+=null!==r?r.count/3:n.count/3,l.push({object3d:e,geometry:t})}});let s=80;!0===o?((r=new DataView(new ArrayBuffer(2*a+3*a*16+80+4))).setUint32(s,a,!0),s+=4):r="solid exported\n";let i=new n.Pq0,u=new n.Pq0,f=new n.Pq0,p=new n.Pq0,c=new n.Pq0,y=new n.Pq0;for(let e=0,t=l.length;e<t;e++){let t=l[e].object3d,r=l[e].geometry,n=r.index,o=r.getAttribute("position");if(null!==n)for(let e=0;e<n.count;e+=3){let r=n.getX(e+0);d(r,n.getX(e+1),n.getX(e+2),o,t)}else for(let e=0;e<o.count;e+=3)d(e+0,e+1,e+2,o,t)}return!1===o&&(r+="endsolid exported\n"),r;function d(e,t,n,l,a){var d,m,b;i.fromBufferAttribute(l,e),u.fromBufferAttribute(l,t),f.fromBufferAttribute(l,n),!0===a.isSkinnedMesh&&(a.applyBoneTransform(e,i),a.applyBoneTransform(t,u),a.applyBoneTransform(n,f)),i.applyMatrix4(a.matrixWorld),u.applyMatrix4(a.matrixWorld),f.applyMatrix4(a.matrixWorld),d=i,m=u,b=f,p.subVectors(b,m),c.subVectors(d,m),p.cross(c).normalize(),y.copy(p).normalize(),!0===o?(r.setFloat32(s,y.x,!0),s+=4,r.setFloat32(s,y.y,!0),s+=4,r.setFloat32(s,y.z,!0),s+=4):(r+=" facet normal "+y.x+" "+y.y+" "+y.z+"\n",r+=" outer loop\n"),x(i),x(u),x(f),!0===o?(r.setUint16(s,0,!0),s+=2):(r+=" endloop\n",r+=" endfacet\n")}function x(e){!0===o?(r.setFloat32(s,e.x,!0),s+=4,r.setFloat32(s,e.y,!0),s+=4,r.setFloat32(s,e.z,!0),s+=4):r+=" vertex "+e.x+" "+e.y+" "+e.z+"\n"}}}}}]);
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.