import{l as h,m as c}from"./index-CDrXokXW.js";import"./index-DWyDLubb.js";function x(e){const t=[],a=[],n=[],s=[],o=e.radius||.5,u=e.tessellation||64,l=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,p=e.sideOrientation===0?0:e.sideOrientation||c.DEFAULTSIDE;t.push(0,0,0),s.push(.5,.5);const D=Math.PI*2*l,v=l===1?D/u:D/(u-1);let d=0;for(let r=0;r<u;r++){const m=Math.cos(d),f=Math.sin(d),M=(m+1)/2,S=(1-f)/2;t.push(o*m,o*f,0),s.push(M,S),d+=v}l===1&&(t.push(t[3],t[4],t[5]),s.push(s[2],s[3]));const C=t.length/3;for(let r=1;r<C-1;r++)a.push(r+1,0,r);c.ComputeNormals(t,a,n),c._ComputeSides(p,t,a,n,s,e.frontUVs,e.backUVs);const i=new c;return i.indices=a,i.positions=t,i.normals=n,i.uvs=s,i}function O(e,t={},a=null){const n=new h(e,a);return t.sideOrientation=h._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,x(t).applyToMesh(n,t.updatable),n}const U={CreateDisc:O};c.CreateDisc=x;h.CreateDisc=(e,t,a,n=null,s,o)=>O(e,{radius:t,tessellation:a,sideOrientation:o,updatable:s},n);export{O as CreateDisc,x as CreateDiscVertexData,U as DiscBuilder};
