1import{B as S,V as f}from"./vgHTkGpo.js";const h=new f;function a(k,o,i,l,g,e){const y=2*Math.PI*g/4,m=Math.max(e-2*g,0),x=Math.PI/4;h.copy(o),h[l]=0,h.normalize();const t=.5*y/(y+m),z=1-h.angleTo(k)/x;return Math.sign(h[i])===1?z*t:m/(y+m)+t+t*(1-z)}class v extends S{constructor(o=1,i=1,l=1,g=2,e=.1){const y=g*2+1;if(e=Math.min(o/2,i/2,l/2,e),super(1,1,1,y,y,y),this.type="RoundedBoxGeometry",this.parameters={width:o,height:i,depth:l,segments:g,radius:e},y===1)return;const m=this.toNonIndexed();this.index=null,this.attributes.position=m.attributes.position,this.attributes.normal=m.attributes.normal,this.attributes.uv=m.attributes.uv;const x=new f,t=new f,z=new f(o,i,l).divideScalar(2).subScalar(e),b=this.attributes.position.array,M=this.attributes.normal.array,r=this.attributes.uv.array,u=b.length/6,n=new f,p=.5/y;for(let c=0,s=0;c<b.length;c+=3,s+=2)switch(x.fromArray(b,c),t.copy(x),t.x-=Math.sign(t.x)*p,t.y-=Math.sign(t.y)*p,t.z-=Math.sign(t.z)*p,t.normalize(),b[c+0]=z.x*Math.sign(x.x)+t.x*e,b[c+1]=z.y*Math.sign(x.y)+t.y*e,b[c+2]=z.z*Math.sign(x.z)+t.z*e,M[c+0]=t.x,M[c+1]=t.y,M[c+2]=t.z,Math.floor(c/u)){case 0:n.set(1,0,0),r[s+0]=a(n,t,"z","y",e,l),r[s+1]=1-a(n,t,"y","z",e,i);break;case 1:n.set(-1,0,0),r[s+0]=1-a(n,t,"z","y",e,l),r[s+1]=1-a(n,t,"y","z",e,i);break;case 2:n.set(0,1,0),r[s+0]=1-a(n,t,"x","z",e,o),r[s+1]=a(n,t,"z","x",e,l);break;case 3:n.set(0,-1,0),r[s+0]=1-a(n,t,"x","z",e,o),r[s+1]=1-a(n,t,"z","x",e,l);break;case 4:n.set(0,0,1),r[s+0]=1-a(n,t,"x","y",e,o),r[s+1]=1-a(n,t,"y","x",e,i);break;case 5:n.set(0,0,-1),r[s+0]=a(n,t,"x","y",e,o),r[s+1]=1-a(n,t,"y","x",e,i);break}}static fromJSON(o){return new v(o.width,o.height,o.depth,o.segments,o.radius)}}export{v as RoundedBoxGeometry};
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.