@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
3 lines (2 loc) • 1.13 kB
JavaScript
import{f as t,g as e}from"./index-Bw2N6w1y.esm.min.js";function i(e){const i=[],s=[],n=[],a=[],o=e.radius||.5,r=e.tessellation||64,u=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,l=0===e.sideOrientation?0:e.sideOrientation||t.DEFAULTSIDE;i.push(0,0,0),a.push(.5,.5);const c=2*Math.PI*u,d=1===u?c/r:c/(r-1);let p=0;for(let t=0;t<r;t++){const t=Math.cos(p),e=Math.sin(p),s=(t+1)/2,n=(1-e)/2;i.push(o*t,o*e,0),a.push(s,n),p+=d}1===u&&(i.push(i[3],i[4],i[5]),a.push(a[2],a[3]));const h=i.length/3;for(let t=1;t<h-1;t++)s.push(t+1,0,t);t.ComputeNormals(i,s,n),t._ComputeSides(l,i,s,n,a,e.frontUVs,e.backUVs);const f=new t;return f.indices=s,f.positions=i,f.normals=n,f.uvs=a,f}function s(t,s={},n=null){const a=new e(t,n);s.sideOrientation=e._GetDefaultSideOrientation(s.sideOrientation),a._originalBuilderSideOrientation=s.sideOrientation;return i(s).applyToMesh(a,s.updatable),a}const n={CreateDisc:s};t.CreateDisc=i,e.CreateDisc=(t,e,i,n=null,a,o)=>s(t,{radius:e,tessellation:i,sideOrientation:o,updatable:a},n);export{s as CreateDisc,i as CreateDiscVertexData,n as DiscBuilder};
//# sourceMappingURL=discBuilder-DyqSVS12.esm.min.js.map