import{C as o,D as l}from"./index-6jOCfdig.js";import"./index-Ds2meNS5.js";import"./svelte/svelte_svelte.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_client.js";import"./svelte/svelte_internal_flags_async.js";import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_store.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";function f(e){const t=[],s=[],i=[],r=[],c=e.radius||.5,m=e.tessellation||64,u=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,O=e.sideOrientation===0?0:e.sideOrientation||o.DEFAULTSIDE;t.push(0,0,0),r.push(.5,.5);const d=Math.PI*2*u,v=u===1?d/m:d/(m-1);let p=0;for(let n=0;n<m;n++){const h=Math.cos(p),D=Math.sin(p),M=(h+1)/2,S=(1-D)/2;t.push(c*h,c*D,0),r.push(M,S),p+=v}u===1&&(t.push(t[3],t[4],t[5]),r.push(r[2],r[3]));const C=t.length/3;for(let n=1;n<C-1;n++)s.push(n+1,0,n);o.ComputeNormals(t,s,i),o._ComputeSides(O,t,s,i,r,e.frontUVs,e.backUVs);const a=new o;return a.indices=s,a.positions=t,a.normals=i,a.uvs=r,a}function x(e,t={},s=null){const i=new l(e,s);return t.sideOrientation=l._GetDefaultSideOrientation(t.sideOrientation),i._originalBuilderSideOrientation=t.sideOrientation,f(t).applyToMesh(i,t.updatable),i}const q={CreateDisc:x};o.CreateDisc=f;l.CreateDisc=(e,t,s,i=null,r,c)=>x(e,{radius:t,tessellation:s,sideOrientation:c,updatable:r},i);export{x as CreateDisc,f as CreateDiscVertexData,q as DiscBuilder};
