2 lines
5.6 KiB
JavaScript
Raw Permalink Normal View History

2026-05-31 13:21:13 +02:00
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).predicates={})}(this,function(t){"use strict";const n=11102230246251565e-32,e=134217729,o=(3+8*n)*n;function r(t,n,e,o,r){let f,s,u,i,a=n[0],c=o[0],l=0,b=0;c>a==c>-a?(f=a,a=n[++l]):(f=c,c=o[++b]);let h=0;if(l<t&&b<e)for(c>a==c>-a?(s=a+f,u=f-(s-a),a=n[++l]):(s=c+f,u=f-(s-c),c=o[++b]),f=s,0!==u&&(r[h++]=u);l<t&&b<e;)c>a==c>-a?(s=f+a,i=s-f,u=f-(s-i)+(a-i),a=n[++l]):(s=f+c,i=s-f,u=f-(s-i)+(c-i),c=o[++b]),f=s,0!==u&&(r[h++]=u);for(;l<t;)s=f+a,i=s-f,u=f-(s-i)+(a-i),a=n[++l],f=s,0!==u&&(r[h++]=u);for(;b<e;)s=f+c,i=s-f,u=f-(s-i)+(c-i),c=o[++b],f=s,0!==u&&(r[h++]=u);return 0===f&&0!==h||(r[h++]=f),h}function f(t,n,o,r){let f,s,u,i,a,c,l,b,h,d,M;l=e*o,d=l-(l-o),M=o-d;let p=n[0];f=p*o,l=e*p,b=l-(l-p),h=p-b,u=h*M-(f-b*d-h*d-b*M);let y=0;0!==u&&(r[y++]=u);for(let x=1;x<t;x++)p=n[x],i=p*o,l=e*p,b=l-(l-p),h=p-b,a=h*M-(i-b*d-h*d-b*M),s=f+a,c=s-f,u=f-(s-c)+(a-c),0!==u&&(r[y++]=u),f=i+s,u=s-(f-i),0!==u&&(r[y++]=u);return 0===f&&0!==y||(r[y++]=f),y}function s(t){return new Float64Array(t)}const u=s(4),i=s(4),a=s(4),c=s(4),l=s(4),b=s(4),h=s(4),d=s(4),M=s(4),p=s(8),y=s(8),x=s(8),g=s(4),m=s(8),T=s(8),j=s(16),w=s(12);let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M,p,y,x;return p=n*o,u=e*n,i=u-(u-n),a=n-i,u=e*o,c=u-(u-o),l=o-c,y=a*l-(p-i*c-a*c-i*l),u=e*r,c=u-(u-r),l=r-c,b=y*r,u=e*y,i=u-(u-y),a=y-i,g[0]=a*l-(b-i*c-a*c-i*l),h=p*r,u=e*p,i=u-(u-p),a=p-i,M=a*l-(h-i*c-a*c-i*l),d=b+M,s=d-b,g[1]=b-(d-s)+(M-s),x=h+d,g[2]=d-(x-h),g[3]=x,t=k(t,4,g),0!==f&&(u=e*f,c=u-(u-f),l=f-c,b=y*f,u=e*y,i=u-(u-y),a=y-i,g[0]=a*l-(b-i*c-a*c-i*l),h=p*f,u=e*p,i=u-(u-p),a=p-i,M=a*l-(h-i*c-a*c-i*l),d=b+M,s=d-b,g[1]=b-(d-s)+(M-s),x=h+d,g[2]=d-(x-h),g[3]=x,t=k(t,4,g)),t}t.orient3d=function(t,n,s,g,F,z,B,C,D,E,G,H){const I=t-E,J=g-E,K=B-E,L=n-G,N=F-G,O=C-G,P=s-H,Q=z-H,R=D-H,S=J*O,U=K*N,V=K*L,W=I*O,X=I*N,Y=J*L,Z=P*(S-U)+Q*(V-W)+R*(X-Y),$=(Math.abs(S)+Math.abs(U))*Math.abs(P)+(Math.abs(V)+Math.abs(W))*Math.abs(Q)+(Math.abs(X)+Math.abs(Y))*Math.abs(R),_=7771561172376103e-31*$;return Z>_||-Z>_?Z:function(t,n,s,g,F,z,B,C,D,E,G,H,I){let J,K,L,N,O,P,Q,R,S,U,V,W,X,Y,Z,$,_,tt,nt,et,ot,rt,ft,st;const ut=t-E,it=g-E,at=B-E,ct=n-G,lt=F-G,bt=C-G,ht=s-H,dt=z-H,Mt=D-H;et=it*bt,W=e*it,X=W-(W-it),Y=it-X,W=e*bt,Z=W-(W-bt),$=bt-Z,ot=Y*$-(et-X*Z-Y*Z-X*$),rt=at*lt,W=e*at,X=W-(W-at),Y=at-X,W=e*lt,Z=W-(W-lt),$=lt-Z,ft=Y*$-(rt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