2023-05-31 11:02:15 +08:00
|
|
|
import{L as N,a as gt,G as ue,b as pe,d as de,M as he,P as ye,T as Ct,V as _,S as me,e as oe,B as $,f as bt,F as Ot,O as xe,g as we,h as at,i as Ae,D as ge}from"./model.vue.8f6f7b03.js";var be=Object.defineProperty,Pe=Object.defineProperties,Te=Object.getOwnPropertyDescriptors,qt=Object.getOwnPropertySymbols,Be=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,Nt=(n,t,e)=>t in n?be(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Bt=(n,t)=>{for(var e in t||(t={}))Be.call(t,e)&&Nt(n,e,t[e]);if(qt)for(var e of qt(t))Me.call(t,e)&&Nt(n,e,t[e]);return n},Se=(n,t)=>Pe(n,Te(t));const re=0,ve=1,Ie=2,Ht=2,Mt=1.25,jt=1,wt=6*4+4+4,Vt=65535,_e=Math.pow(2,-24);class ft{constructor(){}}function U(n,t,e){return e.min.x=t[n],e.min.y=t[n+1],e.min.z=t[n+2],e.max.x=t[n+3],e.max.y=t[n+4],e.max.z=t[n+5],e}function kt(n){let t=-1,e=-1/0;for(let i=0;i<3;i++){const s=n[i+3]-n[i];s>e&&(e=s,t=i)}return t}function Xt(n,t){t.set(n)}function Wt(n,t,e){let i,s;for(let r=0;r<3;r++){const o=r+3;i=n[r],s=t[r],e[r]=i<s?i:s,i=n[o],s=t[o],e[o]=i>s?i:s}}function ut(n,t,e){for(let i=0;i<3;i++){const s=t[n+2*i],r=t[n+2*i+1],o=s-r,l=s+r;o<e[i]&&(e[i]=o),l>e[i+3]&&(e[i+3]=l)}}function et(n){const t=n[3]-n[0],e=n[4]-n[1],i=n[5]-n[2];return 2*(t*e+e*i+i*t)}function Ce(n,t){if(!n.index){const e=n.attributes.position.count,i=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;let s;e>65535?s=new Uint32Array(new i(4*e)):s=new Uint16Array(new i(2*e)),n.setIndex(new bt(s,1));for(let r=0;r<e;r++)s[r]=r}}function Ve(n){if(!n.groups||!n.groups.length)return[{offset:0,count:n.index.count/3}];const t=[],e=new Set;for(const s of n.groups)e.add(s.start),e.add(s.start+s.count);const i=Array.from(e.values()).sort((s,r)=>s-r);for(let s=0;s<i.length-1;s++){const r=i[s],o=i[s+1];t.push({offset:r/3,count:(o-r)/3})}return t}function St(n,t,e,i,s=null){let r=1/0,o=1/0,l=1/0,c=-1/0,f=-1/0,a=-1/0,u=1/0,p=1/0,d=1/0,g=-1/0,w=-1/0,A=-1/0;const y=s!==null;for(let m=t*6,h=(t+e)*6;m<h;m+=6){const x=n[m+0],b=n[m+1],P=x-b,M=x+b;P<r&&(r=P),M>c&&(c=M),y&&x<u&&(u=x),y&&x>g&&(g=x);const B=n[m+2],T=n[m+3],S=B-T,v=B+T;S<o&&(o=S),v>f&&(f=v),y&&B<p&&(p=B),y&&B>w&&(w=B);const I=n[m+4],C=n[m+5],F=I-C,V=I+C;F<l&&(l=F),V>a&&(a=V),y&&I<d&&(d=I),y&&I>A&&(A=I)}i[0]=r,i[1]=o,i[2]=l,i[3]=c,i[4]=f,i[5]=a,y&&(s[0]=u,s[1]=p,s[2]=d,s[3]=g,s[4]=w,s[5]=A)}function ze(n,t,e,i){let s=1/0,r=1/0,o=1/0,l=-1/0,c=-1/0,f=-1/0;for(let a=t*6,u=(t+e)*6;a<u;a+=6){const p=n[a+0];p<s&&(s=p),p>l&&(l=p);const d=n[a+2];d<r&&(r=d),d>c&&(c=d);const g=n[a+4];g<o&&(o=g),g>f&&(f=g)}i[0]=s,i[1]=r,i[2]=o,i[3]=l,i[4]=c,i[5]=f}function Fe(n,t,e,i,s){let r=e,o=e+i-1;const l=s.pos,c=s.axis*2;for(;;){for(;r<=o&&t[r*6+c]<l;)r++;for(;r<=o&&t[o*6+c]>=l;)o--;if(r<o){for(let f=0;f<3;f++){let a=n[r*3+f];n[r*3+f]=n[o*3+f],n[o*3+f]=a;let u=t[r*6+f*2+0];t[r*6+f*2+0]=t[o*6+f*2+0],t[o*6+f*2+0]=u;let p=t[r*6+f*2+1];t[r*6+f*2+1]=t[o*6+f*2+1],t[o*6+f*2+1]=p}r++,o--}else return r}}const q=32,Ee=(n,t)=>n.candidate-t.candidate,k=new Array(q).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),pt=new Float32Array(6);function Le(n,t,e,i,s,r){let o=-1,l=0;if(r===re)o=kt(t),o!==-1&&(l=(t[o]+t[o+3])/2);else if(r===ve)o=kt(n),o!==-1&&(l=Ue(e,i,s,o));else if(r===Ie){const c=et(n);let f=Mt*s;const a=i*6,u=(i+s)*6;for(let p=0;p<3;p++){const d=t[p],A=(t[p+3]-d)/q;if(s<q/4){const y=[...k];y.length=s;let m=0;for(let x=a;x<u;x+=6,m++){const b=y[m];b.candidate=e[x+2*p],b.count=0;const{bounds:P,leftCacheBounds:M,rightCacheBounds:B}=b;for(let T=0;T<3;T++)B[T]=1/0,B[T+3]=-1/0,M[T]=1/0,M[T+3]=-1/0,P[T]=1/0,P[T+3]=-1/0;ut(x,e,P)}y.sort(Ee);let h=s;for(let x=0;x<h;x++){const b=y[x];for(;x+1<h&&y[x+1].candidate===b.candidate;)y.splice(x+1,1),h--}for(let x=a;x<u;x+=6){const b=e[x+2*p];for(let P=0;P<h;P++){const M=y[P];b>=M.candidate?ut(x,e,M.rightCacheBounds):(ut(x,e,M.leftCacheBounds),M.count++)}}for(let x=0;x<h;x++){const b=y[x],P=b.count,M=s-b.count,B=b.leftCacheBounds,T=b.rightCacheBounds;let S=0;P!==0&&(S=et(B)/c);let v=0;M!==0&&(v=et(T)/c);const I=j
|