1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./D8qP8cRM.js","./jK16zlKs.js"])))=>i.map(i=>d[i]); 2import{d as b,n as B,G as z,b1 as g,aL as P,e as R,o as H,aH as T}from"./Cq-430NU.js";const V=b({__name:"StlViewer",props:{src:{default:"/models/robot.stl"},wireColor:{default:"#CC0033"},bgColor:{default:"#0a0a0a"},height:{default:"420px"}},setup(y){const i=y,l=B(null);let d=null;return z(async()=>{if(!l.value)return;const e=await g(()=>import("./jK16zlKs.js"),[],import.meta.url),{STLLoader:w}=await g(async()=>{const{STLLoader:t}=await import("./D8qP8cRM.js");return{STLLoader:t}},__vite__mapDeps([0,1]),import.meta.url),a=l.value,u=a.clientWidth,p=a.clientHeight,s=new e.Scene;s.background=new e.Color(i.bgColor);const c=new e.PerspectiveCamera(30,u/p,.1,1e3);c.position.set(0,0,5);const n=new e.WebGLRenderer({antialias:!0,alpha:!0});n.setSize(u,p),n.setPixelRatio(Math.min(window.devicePixelRatio,2)),a.appendChild(n.domElement);const h=new e.GridHelper(10,20,new e.Color("#1a1a1a"),new e.Color("#1a1a1a"));h.position.y=-1.5,s.add(h);const M=new w;let r=null;try{const t=await new Promise((L,S)=>{M.load(i.src,L,void 0,S)});t.computeBoundingBox(),t.center();const o=t.boundingBox,m=3.5/Math.max(o.max.x-o.min.x,o.max.y-o.min.y,o.max.z-o.min.z);t.scale(m,m,m);const v=new e.MeshBasicMaterial({color:new e.Color(i.wireColor),wireframe:!0,transparent:!0,opacity:.8});r=new e.Mesh(t,v),s.add(r);const E=new e.MeshBasicMaterial({color:new e.Color(i.wireColor),wireframe:!0,transparent:!0,opacity:.15}),C=new e.Mesh(t.clone(),E);C.scale.setScalar(1.002),s.add(C)}catch{const t=new e.IcosahedronGeometry(1.2,1),o=new e.MeshBasicMaterial({color:new e.Color(i.wireColor),wireframe:!0,transparent:!0,opacity:.7});r=new e.Mesh(t,o),s.add(r)}let f;function _(){f=requestAnimationFrame(_),r&&(r.rotation.y+=.016,r.rotation.x+=.012),n.render(s,c)}_();function x(){const t=a.clientWidth,o=a.clientHeight;c.aspect=t/o,c.updateProjectionMatrix(),n.setSize(t,o)}window.addEventListener("resize",x),d=()=>{cancelAnimationFrame(f),window.removeEventListener("resize",x),n.dispose(),a.contains(n.domElement)&&a.removeChild(n.domElement)}}),P(()=>{d&&d()}),(e,w)=>(H(),R("div",{ref_key:"container",ref:l,class:"stl-viewer",style:T({height:i.height})},null,4))}}),D=Object.assign(V,{__name:"StlViewer"});export{D as default};
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.