robust-predicates 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/esm/insphere.js +26 -35
- package/esm/orient2d.js +0 -2
- package/esm/orient3d.js +102 -105
- package/esm/util.js +1 -1
- package/package.json +11 -43
- package/umd/incircle.js +3 -5
- package/umd/incircle.min.js +1 -1
- package/umd/insphere.js +29 -40
- package/umd/insphere.min.js +1 -1
- package/umd/orient2d.js +3 -7
- package/umd/orient2d.min.js +1 -1
- package/umd/orient3d.js +105 -110
- package/umd/orient3d.min.js +1 -1
- package/umd/predicates.js +131 -147
- package/umd/predicates.min.js +1 -1
package/umd/insphere.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!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=134217729;function e(t,n,e,r,o){let a,s,f,u,i=n[0],c=r[0],h=0,b=0;c>i==c>-i?(a=i,i=n[++h]):(a=c,c=r[++b]);let l=0;if(h<t&&b<e)for(c>i==c>-i?(s=i+a,f=a-(s-i),i=n[++h]):(s=c+a,f=a-(s-c),c=r[++b]),a=s,0!==f&&(o[l++]=f);h<t&&b<e;)c>i==c>-i?(s=a+i,u=s-a,f=a-(s-u)+(i-u),i=n[++h]):(s=a+c,u=s-a,f=a-(s-u)+(c-u),c=r[++b]),a=s,0!==f&&(o[l++]=f);for(;h<t;)s=a+i,u=s-a,f=a-(s-u)+(i-u),i=n[++h],a=s,0!==f&&(o[l++]=f);for(;b<e;)s=a+c,u=s-a,f=a-(s-u)+(c-u),c=r[++b],a=s,0!==f&&(o[l++]=f);return 0===a&&0!==l||(o[l++]=a),l}function r(t,n,r,o,a,s,f,u){return e(e(t,n,r,o,f),f,a,s,u)}function o(t,e,r,o){let a,s,f,u,i,c,h,b,l,M,d;h=n*r,M=h-(h-r),d=r-M;let p=e[0];a=p*r,h=n*p,b=h-(h-p),l=p-b,f=l*d-(a-b*M-l*M-b*d);let y=0;0!==f&&(o[y++]=f);for(let x=1;x<t;x++)p=e[x],u=p*r,h=n*p,b=h-(h-p),l=p-b,i=l*d-(u-b*M-l*M-b*d),s=a+i,c=s-a,f=a-(s-c)+(i-c),0!==f&&(o[y++]=f),a=u+s,f=s-(a-u),0!==f&&(o[y++]=f);return 0===a&&0!==y||(o[y++]=a),y}function a(t,n){for(let e=0;e<t;e++)n[e]=-n[e];return t}function s(t){return new Float64Array(t)}const f=s(4),u=s(4),i=s(4),c=s(4),h=s(4),b=s(4),l=s(4),M=s(4),d=s(4),p=s(4),y=s(24),x=s(24),g=s(24),j=s(24),m=s(24),T=s(24),_=s(24),v=s(24),w=s(24),A=s(24),F=s(1152),O=s(1152),P=s(1152),k=s(1152),q=s(1152),z=s(2304),B=s(2304),C=s(3456),D=s(5760),E=s(8),G=s(8),H=s(8),I=s(16),J=s(24),K=s(48),L=s(48),N=s(96),Q=s(192),R=s(384),S=s(384),U=s(384),V=s(768);function W(t,n,e,a,s,f,u){return r(o(4,t,a,E),E,o(4,n,s,G),G,o(4,e,f,H),H,I,u)}function X(t,n,s,f,u,i,c,h,b,l,M,d){const p=e(e(t,n,s,f,K),K,a(e(u,i,c,h,L),L),L,N);return r(o(o(p,N,b,Q),Q,b,R),R,o(o(p,N,l,Q),Q,l,S),S,o(o(p,N,M,Q),Q,M,U),U,V,d)}const Y=s(96),Z=s(96),$=s(96),tt=s(1152);function nt(t,n,e,a,s,f,u,i,c,h){const b=W(t,n,e,a,s,f,J);return r(o(o(b,J,u,K),K,u,Y),Y,o(o(b,J,i,K),K,i,Z),Z,o(o(b,J,c,K),K,c,$),$,Q,h)}function et(t,o,s,E,G,H,I,J,K,L,N,Q,R,S,U,V){let Y,Z,$,et,rt,ot,at,st,ft,ut,it,ct,ht,bt,lt,Mt,dt,pt,yt,xt,gt,jt,mt,T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ct,g,a,s,E,O),O,r(X(bt,m,pt,w,lt,T,ht,j,G,H,I,P),P,X(ut,y,yt,A,Mt,_,bt,m,J,K,L,k),k,X(it,x,lt,T,dt,v,ut,y,N,Q,R,q),q,B,C),C,z,D);return D[xt-1]}(t,o,s,E,G,H,I,J,K,L,N,Q,R,S,U)}t.insphere=function(t,n,e,r,o,a,s,f,u,i,c,h,b,l,M){const d=t-b,p=r-b,y=s-b,x=i-b,g=n-l,j=o-l,m=f-l,T=c-l,_=e-M,v=a-M,w=u-M,A=h-M,F=d*j,O=p*g,P=F-O,k=p*m,q=y*j,z=k-q,B=y*T,C=x*m,D=B-C,E=x*g,G=d*T,H=E-G,I=d*m,J=y*g,K=I-J,L=p*T,N=x*j,Q=L-N,R=d*d+g*g+_*_,S=p*p+j*j+v*v,U=y*y+m*m+w*w,V=x*x+T*T+A*A,W=U*(A*P+_*Q+v*H)-V*(_*z-v*K+w*P)+(R*(v*D-w*Q+A*z)-S*(w*H+A*K+_*D)),X=Math.abs(_),Y=Math.abs(v),Z=Math.abs(w),$=Math.abs(A),tt=Math.abs(F),nt=Math.abs(O),rt=Math.abs(k),ot=Math.abs(q),at=Math.abs(B),st=Math.abs(C),ft=Math.abs(E),ut=Math.abs(G),it=Math.abs(I),ct=Math.abs(J),ht=Math.abs(L),bt=Math.abs(N),lt=((at+st)*Y+(bt+ht)*Z+(rt+ot)*$)*R+((ft+ut)*Z+(it+ct)*$+(at+st)*X)*S+((tt+nt)*$+(ht+bt)*X+(ft+ut)*Y)*U+((rt+ot)*X+(ct+it)*Y+(tt+nt)*Z)*V,Mt=17763568394002532e-31*lt;return W>Mt||-W>Mt?W:-et(t,n,e,r,o,a,s,f,u,i,c,h,b,l,M,lt)},t.inspherefast=function(t,n,e,r,o,a,s,f,u,i,c,h,b,l,M){const d=t-b,p=r-b,y=s-b,x=i-b,g=n-l,j=o-l,m=f-l,T=c-l,_=e-M,v=a-M,w=u-M,A=h-M,F=d*j-p*g,O=p*m-y*j,P=y*T-x*m,k=x*g-d*T,q=d*m-y*g,z=p*T-x*j;return(y*y+m*m+w*w)*(A*F+_*z+v*k)-(x*x+T*T+A*A)*(_*O-v*q+w*F)+((d*d+g*g+_*_)*(v*P-w*z+A*O)-(p*p+j*j+v*v)*(w*k+A*q+_*P))},Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!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,r=(3+8*n)*n;function o(t,n,e,r,o){let a,s,f,u,i=n[0],c=r[0],h=0,b=0;c>i==c>-i?(a=i,i=n[++h]):(a=c,c=r[++b]);let l=0;if(h<t&&b<e)for(c>i==c>-i?(s=i+a,f=a-(s-i),i=n[++h]):(s=c+a,f=a-(s-c),c=r[++b]),a=s,0!==f&&(o[l++]=f);h<t&&b<e;)c>i==c>-i?(s=a+i,u=s-a,f=a-(s-u)+(i-u),i=n[++h]):(s=a+c,u=s-a,f=a-(s-u)+(c-u),c=r[++b]),a=s,0!==f&&(o[l++]=f);for(;h<t;)s=a+i,u=s-a,f=a-(s-u)+(i-u),i=n[++h],a=s,0!==f&&(o[l++]=f);for(;b<e;)s=a+c,u=s-a,f=a-(s-u)+(c-u),c=r[++b],a=s,0!==f&&(o[l++]=f);return 0===a&&0!==l||(o[l++]=a),l}function a(t,n,e,r,a,s,f,u){return o(o(t,n,e,r,f),f,a,s,u)}function s(t,n,r,o){let a,s,f,u,i,c,h,b,l,M,d;h=e*r,M=h-(h-r),d=r-M;let p=n[0];a=p*r,h=e*p,b=h-(h-p),l=p-b,f=l*d-(a-b*M-l*M-b*d);let y=0;0!==f&&(o[y++]=f);for(let x=1;x<t;x++)p=n[x],u=p*r,h=e*p,b=h-(h-p),l=p-b,i=l*d-(u-b*M-l*M-b*d),s=a+i,c=s-a,f=a-(s-c)+(i-c),0!==f&&(o[y++]=f),a=u+s,f=s-(a-u),0!==f&&(o[y++]=f);return 0===a&&0!==y||(o[y++]=a),y}function f(t,n){for(let e=0;e<t;e++)n[e]=-n[e];return t}function u(t){return new Float64Array(t)}const i=u(4),c=u(4),h=u(4),b=u(4),l=u(4),M=u(4),d=u(4),p=u(4),y=u(4),x=u(4),g=u(24),m=u(24),T=u(24),j=u(24),w=u(24),A=u(24),F=u(24),k=u(24),q=u(24),v=u(24),z=u(1152),B=u(1152),C=u(1152),D=u(1152),E=u(1152),G=u(2304),H=u(2304),I=u(3456),J=u(5760),K=u(8),L=u(8),N=u(8),O=u(16),P=u(24),Q=u(48),R=u(48),S=u(96),U=u(192),V=u(384),W=u(384),X=u(384),Y=u(768);function Z(t,n,e,r,o,f,u){return a(s(4,t,r,K),K,s(4,n,o,L),L,s(4,e,f,N),N,O,u)}function $(t,n,e,r,u,i,c,h,b,l,M,d){const p=o(o(t,n,e,r,Q),Q,f(o(u,i,c,h,R),R),R,S);return a(s(s(p,S,b,U),U,b,V),V,s(s(p,S,l,U),U,l,W),W,s(s(p,S,M,U),U,M,X),X,Y,d)}const _=u(96),tt=u(96),nt=u(96),et=u(1152);function rt(t,n,e,r,o,f,u,i,c,h){const b=Z(t,n,e,r,o,f,P);return a(s(s(b,P,u,Q),Q,u,_),_,s(s(b,P,i,Q),Q,i,tt),tt,s(s(b,P,c,Q),Q,c,nt),nt,U,h)}function ot(t,n,s,u,K,L,N,O,P,Q,R,S,U,V,W,X){let Y,_,tt,nt,ot,at,st,ft,ut,it,ct,ht,bt,lt,Mt,dt,pt,yt,xt,gt,mt,Tt,jt,wt,At,Ft,kt,qt,vt,zt,Bt;const Ct=t-U,Dt=u-U,Et=N-U,Gt=Q-U,Ht=n-V,It=K-V,Jt=O-V,Kt=R-V,Lt=s-W,Nt=L-W,Ot=P-W,Pt=S-W;qt=Ct*It,gt=e*Ct,mt=gt-(gt-Ct),Tt=Ct-mt,gt=e*It,jt=gt-(gt-It),wt=It-jt,vt=Tt*wt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-l,j=c-l,w=e-M,A=a-M,F=u-M,k=h-M,q=d*m,v=p*g,z=q-v,B=p*T,C=y*m,D=B-C,E=y*j,G=x*T,H=E-G,I=x*g,J=d*j,K=I-J,L=d*T,N=y*g,O=L-N,P=p*j,Q=x*m,R=P-Q,S=d*d+g*g+w*w,U=p*p+m*m+A*A,V=y*y+T*T+F*F,W=x*x+j*j+k*k,X=V*(k*z+w*R+A*K)-W*(w*D-A*O+F*z)+(S*(A*H-F*R+k*D)-U*(F*K+k*O+w*H)),Y=Math.abs(w),Z=Math.abs(A),$=Math.abs(F),_=Math.abs(k),tt=Math.abs(q)+Math.abs(v),nt=Math.abs(B)+Math.abs(C),et=Math.abs(E)+Math.abs(G),rt=Math.abs(I)+Math.abs(J),at=Math.abs(L)+Math.abs(N),st=Math.abs(P)+Math.abs(Q),ft=(et*Z+st*$+nt*_)*S+(rt*$+at*_+et*Y)*U+(tt*_+st*Y+rt*Z)*V+(nt*Y+at*Z+tt*$)*W,ut=17763568394002532e-31*ft;return X>ut||-X>ut?X:-ot(t,n,e,r,o,a,s,f,u,i,c,h,b,l,M,ft)},t.inspherefast=function(t,n,e,r,o,a,s,f,u,i,c,h,b,l,M){const d=t-b,p=r-b,y=s-b,x=i-b,g=n-l,m=o-l,T=f-l,j=c-l,w=e-M,A=a-M,F=u-M,k=h-M,q=d*m-p*g,v=p*T-y*m,z=y*j-x*T,B=x*g-d*j,C=d*T-y*g,D=p*j-x*m;return(y*y+T*T+F*F)*(k*q+w*D+A*B)-(x*x+j*j+k*k)*(w*v-A*C+F*q)+((d*d+g*g+w*w)*(A*z-F*D+k*v)-(p*p+m*m+A*A)*(F*B+k*C+w*z))}});
|
package/umd/orient2d.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.predicates = {}));
|
|
5
|
-
}(this, (function (exports) { 'use strict';
|
|
5
|
+
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
7
|
const epsilon = 1.1102230246251565e-16;
|
|
8
8
|
const splitter = 134217729;
|
|
9
9
|
const resulterrbound = (3 + 8 * epsilon) * epsilon;
|
|
10
10
|
|
|
11
|
-
// fast_expansion_sum_zeroelim routine from
|
|
11
|
+
// fast_expansion_sum_zeroelim routine from original code
|
|
12
12
|
function sum(elen, e, flen, f, h) {
|
|
13
13
|
let Q, Qnew, hh, bvirt;
|
|
14
14
|
let enow = e[0];
|
|
@@ -264,8 +264,6 @@ function orient2d(ax, ay, bx, by, cx, cy) {
|
|
|
264
264
|
const detright = (ax - cx) * (by - cy);
|
|
265
265
|
const det = detleft - detright;
|
|
266
266
|
|
|
267
|
-
if (detleft === 0 || detright === 0 || (detleft > 0) !== (detright > 0)) return det;
|
|
268
|
-
|
|
269
267
|
const detsum = Math.abs(detleft + detright);
|
|
270
268
|
if (Math.abs(det) >= ccwerrboundA * detsum) return det;
|
|
271
269
|
|
|
@@ -279,6 +277,4 @@ function orient2dfast(ax, ay, bx, by, cx, cy) {
|
|
|
279
277
|
exports.orient2d = orient2d;
|
|
280
278
|
exports.orient2dfast = orient2dfast;
|
|
281
279
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
})));
|
|
280
|
+
}));
|
package/umd/orient2d.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).predicates={})}(this,
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).predicates={})}(this,function(t){"use strict";const e=11102230246251565e-32,n=134217729,o=(3+8*e)*e;function r(t,e,n,o,r){let f,i,u,s,c=e[0],a=o[0],l=0,d=0;a>c==a>-c?(f=c,c=e[++l]):(f=a,a=o[++d]);let p=0;if(l<t&&d<n)for(a>c==a>-c?(i=c+f,u=f-(i-c),c=e[++l]):(i=a+f,u=f-(i-a),a=o[++d]),f=i,0!==u&&(r[p++]=u);l<t&&d<n;)a>c==a>-c?(i=f+c,s=i-f,u=f-(i-s)+(c-s),c=e[++l]):(i=f+a,s=i-f,u=f-(i-s)+(a-s),a=o[++d]),f=i,0!==u&&(r[p++]=u);for(;l<t;)i=f+c,s=i-f,u=f-(i-s)+(c-s),c=e[++l],f=i,0!==u&&(r[p++]=u);for(;d<n;)i=f+a,s=i-f,u=f-(i-s)+(a-s),a=o[++d],f=i,0!==u&&(r[p++]=u);return 0===f&&0!==p||(r[p++]=f),p}function f(t){return new Float64Array(t)}const i=f(4),u=f(8),s=f(12),c=f(16),a=f(4);t.orient2d=function(t,e,f,l,d,p){const b=(e-p)*(f-d),h=(t-d)*(l-p),y=b-h,x=Math.abs(b+h);return Math.abs(y)>=33306690738754716e-32*x?y:-function(t,e,f,l,d,p,b){let h,y,x,M,g,m,T,j,w,A,F,k,q,v,z,B,C,D;const E=t-d,G=f-d,H=e-p,I=l-p;v=E*I,m=n*E,T=m-(m-E),j=E-T,m=n*I,w=m-(m-I),A=I-w,z=j*A-(v-T*w-j*w-T*A),B=H*G,m=n*H,T=m-(m-H),j=H-T,m=n*G,w=m-(m-G),A=G-w,C=j*A-(B-T*w-j*w-T*A),F=z-C,g=z-F,i[0]=z-(F+g)+(g-C),k=v+F,g=k-v,q=v-(k-g)+(F-g),F=q-B,g=q-F,i[1]=q-(F+g)+(g-B),D=k+F,g=D-k,i[2]=k-(D-g)+(F-g),i[3]=D;let J=function(t,e){let n=e[0];for(let o=1;o<t;o++)n+=e[o];return n}(4,i),K=22204460492503146e-32*b;if(J>=K||-J>=K)return J;if(g=t-E,h=t-(E+g)+(g-d),g=f-G,x=f-(G+g)+(g-d),g=e-H,y=e-(H+g)+(g-p),g=l-I,M=l-(I+g)+(g-p),0===h&&0===y&&0===x&&0===M)return J;if(K=11093356479670487e-47*b+o*Math.abs(J),J+=E*M+I*h-(H*x+G*y),J>=K||-J>=K)return J;v=h*I,m=n*h,T=m-(m-h),j=h-T,m=n*I,w=m-(m-I),A=I-w,z=j*A-(v-T*w-j*w-T*A),B=y*G,m=n*y,T=m-(m-y),j=y-T,m=n*G,w=m-(m-G),A=G-w,C=j*A-(B-T*w-j*w-T*A),F=z-C,g=z-F,a[0]=z-(F+g)+(g-C),k=v+F,g=k-v,q=v-(k-g)+(F-g),F=q-B,g=q-F,a[1]=q-(F+g)+(g-B),D=k+F,g=D-k,a[2]=k-(D-g)+(F-g),a[3]=D;const L=r(4,i,4,a,u);v=E*M,m=n*E,T=m-(m-E),j=E-T,m=n*M,w=m-(m-M),A=M-w,z=j*A-(v-T*w-j*w-T*A),B=H*x,m=n*H,T=m-(m-H),j=H-T,m=n*x,w=m-(m-x),A=x-w,C=j*A-(B-T*w-j*w-T*A),F=z-C,g=z-F,a[0]=z-(F+g)+(g-C),k=v+F,g=k-v,q=v-(k-g)+(F-g),F=q-B,g=q-F,a[1]=q-(F+g)+(g-B),D=k+F,g=D-k,a[2]=k-(D-g)+(F-g),a[3]=D;const N=r(L,u,4,a,s);v=h*M,m=n*h,T=m-(m-h),j=h-T,m=n*M,w=m-(m-M),A=M-w,z=j*A-(v-T*w-j*w-T*A),B=y*x,m=n*y,T=m-(m-y),j=y-T,m=n*x,w=m-(m-x),A=x-w,C=j*A-(B-T*w-j*w-T*A),F=z-C,g=z-F,a[0]=z-(F+g)+(g-C),k=v+F,g=k-v,q=v-(k-g)+(F-g),F=q-B,g=q-F,a[1]=q-(F+g)+(g-B),D=k+F,g=D-k,a[2]=k-(D-g)+(F-g),a[3]=D;const O=r(N,s,4,a,c);return c[O-1]}(t,e,f,l,d,p,x)},t.orient2dfast=function(t,e,n,o,r,f){return(e-f)*(n-r)-(t-r)*(o-f)}});
|
package/umd/orient3d.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.predicates = {}));
|
|
5
|
-
}(this, (function (exports) { 'use strict';
|
|
5
|
+
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
7
|
const epsilon = 1.1102230246251565e-16;
|
|
8
8
|
const splitter = 134217729;
|
|
9
9
|
const resulterrbound = (3 + 8 * epsilon) * epsilon;
|
|
10
10
|
|
|
11
|
-
// fast_expansion_sum_zeroelim routine from
|
|
11
|
+
// fast_expansion_sum_zeroelim routine from original code
|
|
12
12
|
function sum(elen, e, flen, f, h) {
|
|
13
13
|
let Q, Qnew, hh, bvirt;
|
|
14
14
|
let enow = e[0];
|
|
@@ -154,7 +154,7 @@ const u = vec(4);
|
|
|
154
154
|
|
|
155
155
|
const _8 = vec(8);
|
|
156
156
|
const _8b = vec(8);
|
|
157
|
-
const _16 = vec(
|
|
157
|
+
const _16 = vec(16);
|
|
158
158
|
const _12 = vec(12);
|
|
159
159
|
|
|
160
160
|
let fin = vec(192);
|
|
@@ -173,112 +173,109 @@ function tailinit(xtail, ytail, ax, ay, bx, by, a, b) {
|
|
|
173
173
|
a[0] = 0;
|
|
174
174
|
b[0] = 0;
|
|
175
175
|
return 1;
|
|
176
|
-
} else {
|
|
177
|
-
negate = -ytail;
|
|
178
|
-
s1 = negate * ax;
|
|
179
|
-
c = splitter * negate;
|
|
180
|
-
ahi = c - (c - negate);
|
|
181
|
-
alo = negate - ahi;
|
|
182
|
-
c = splitter * ax;
|
|
183
|
-
bhi = c - (c - ax);
|
|
184
|
-
blo = ax - bhi;
|
|
185
|
-
a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
186
|
-
a[1] = s1;
|
|
187
|
-
s1 = ytail * bx;
|
|
188
|
-
c = splitter * ytail;
|
|
189
|
-
ahi = c - (c - ytail);
|
|
190
|
-
alo = ytail - ahi;
|
|
191
|
-
c = splitter * bx;
|
|
192
|
-
bhi = c - (c - bx);
|
|
193
|
-
blo = bx - bhi;
|
|
194
|
-
b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
195
|
-
b[1] = s1;
|
|
196
|
-
return 2;
|
|
197
|
-
}
|
|
198
|
-
} else {
|
|
199
|
-
if (ytail === 0) {
|
|
200
|
-
s1 = xtail * ay;
|
|
201
|
-
c = splitter * xtail;
|
|
202
|
-
ahi = c - (c - xtail);
|
|
203
|
-
alo = xtail - ahi;
|
|
204
|
-
c = splitter * ay;
|
|
205
|
-
bhi = c - (c - ay);
|
|
206
|
-
blo = ay - bhi;
|
|
207
|
-
a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
208
|
-
a[1] = s1;
|
|
209
|
-
negate = -xtail;
|
|
210
|
-
s1 = negate * by;
|
|
211
|
-
c = splitter * negate;
|
|
212
|
-
ahi = c - (c - negate);
|
|
213
|
-
alo = negate - ahi;
|
|
214
|
-
c = splitter * by;
|
|
215
|
-
bhi = c - (c - by);
|
|
216
|
-
blo = by - bhi;
|
|
217
|
-
b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
218
|
-
b[1] = s1;
|
|
219
|
-
return 2;
|
|
220
|
-
} else {
|
|
221
|
-
s1 = xtail * ay;
|
|
222
|
-
c = splitter * xtail;
|
|
223
|
-
ahi = c - (c - xtail);
|
|
224
|
-
alo = xtail - ahi;
|
|
225
|
-
c = splitter * ay;
|
|
226
|
-
bhi = c - (c - ay);
|
|
227
|
-
blo = ay - bhi;
|
|
228
|
-
s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
229
|
-
t1 = ytail * ax;
|
|
230
|
-
c = splitter * ytail;
|
|
231
|
-
ahi = c - (c - ytail);
|
|
232
|
-
alo = ytail - ahi;
|
|
233
|
-
c = splitter * ax;
|
|
234
|
-
bhi = c - (c - ax);
|
|
235
|
-
blo = ax - bhi;
|
|
236
|
-
t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
237
|
-
_i = s0 - t0;
|
|
238
|
-
bvirt = s0 - _i;
|
|
239
|
-
a[0] = s0 - (_i + bvirt) + (bvirt - t0);
|
|
240
|
-
_j = s1 + _i;
|
|
241
|
-
bvirt = _j - s1;
|
|
242
|
-
_0 = s1 - (_j - bvirt) + (_i - bvirt);
|
|
243
|
-
_i = _0 - t1;
|
|
244
|
-
bvirt = _0 - _i;
|
|
245
|
-
a[1] = _0 - (_i + bvirt) + (bvirt - t1);
|
|
246
|
-
u3 = _j + _i;
|
|
247
|
-
bvirt = u3 - _j;
|
|
248
|
-
a[2] = _j - (u3 - bvirt) + (_i - bvirt);
|
|
249
|
-
a[3] = u3;
|
|
250
|
-
s1 = ytail * bx;
|
|
251
|
-
c = splitter * ytail;
|
|
252
|
-
ahi = c - (c - ytail);
|
|
253
|
-
alo = ytail - ahi;
|
|
254
|
-
c = splitter * bx;
|
|
255
|
-
bhi = c - (c - bx);
|
|
256
|
-
blo = bx - bhi;
|
|
257
|
-
s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
258
|
-
t1 = xtail * by;
|
|
259
|
-
c = splitter * xtail;
|
|
260
|
-
ahi = c - (c - xtail);
|
|
261
|
-
alo = xtail - ahi;
|
|
262
|
-
c = splitter * by;
|
|
263
|
-
bhi = c - (c - by);
|
|
264
|
-
blo = by - bhi;
|
|
265
|
-
t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
266
|
-
_i = s0 - t0;
|
|
267
|
-
bvirt = s0 - _i;
|
|
268
|
-
b[0] = s0 - (_i + bvirt) + (bvirt - t0);
|
|
269
|
-
_j = s1 + _i;
|
|
270
|
-
bvirt = _j - s1;
|
|
271
|
-
_0 = s1 - (_j - bvirt) + (_i - bvirt);
|
|
272
|
-
_i = _0 - t1;
|
|
273
|
-
bvirt = _0 - _i;
|
|
274
|
-
b[1] = _0 - (_i + bvirt) + (bvirt - t1);
|
|
275
|
-
u3 = _j + _i;
|
|
276
|
-
bvirt = u3 - _j;
|
|
277
|
-
b[2] = _j - (u3 - bvirt) + (_i - bvirt);
|
|
278
|
-
b[3] = u3;
|
|
279
|
-
return 4;
|
|
280
176
|
}
|
|
177
|
+
negate = -ytail;
|
|
178
|
+
s1 = negate * ax;
|
|
179
|
+
c = splitter * negate;
|
|
180
|
+
ahi = c - (c - negate);
|
|
181
|
+
alo = negate - ahi;
|
|
182
|
+
c = splitter * ax;
|
|
183
|
+
bhi = c - (c - ax);
|
|
184
|
+
blo = ax - bhi;
|
|
185
|
+
a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
186
|
+
a[1] = s1;
|
|
187
|
+
s1 = ytail * bx;
|
|
188
|
+
c = splitter * ytail;
|
|
189
|
+
ahi = c - (c - ytail);
|
|
190
|
+
alo = ytail - ahi;
|
|
191
|
+
c = splitter * bx;
|
|
192
|
+
bhi = c - (c - bx);
|
|
193
|
+
blo = bx - bhi;
|
|
194
|
+
b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
195
|
+
b[1] = s1;
|
|
196
|
+
return 2;
|
|
197
|
+
}
|
|
198
|
+
if (ytail === 0) {
|
|
199
|
+
s1 = xtail * ay;
|
|
200
|
+
c = splitter * xtail;
|
|
201
|
+
ahi = c - (c - xtail);
|
|
202
|
+
alo = xtail - ahi;
|
|
203
|
+
c = splitter * ay;
|
|
204
|
+
bhi = c - (c - ay);
|
|
205
|
+
blo = ay - bhi;
|
|
206
|
+
a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
207
|
+
a[1] = s1;
|
|
208
|
+
negate = -xtail;
|
|
209
|
+
s1 = negate * by;
|
|
210
|
+
c = splitter * negate;
|
|
211
|
+
ahi = c - (c - negate);
|
|
212
|
+
alo = negate - ahi;
|
|
213
|
+
c = splitter * by;
|
|
214
|
+
bhi = c - (c - by);
|
|
215
|
+
blo = by - bhi;
|
|
216
|
+
b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
217
|
+
b[1] = s1;
|
|
218
|
+
return 2;
|
|
281
219
|
}
|
|
220
|
+
s1 = xtail * ay;
|
|
221
|
+
c = splitter * xtail;
|
|
222
|
+
ahi = c - (c - xtail);
|
|
223
|
+
alo = xtail - ahi;
|
|
224
|
+
c = splitter * ay;
|
|
225
|
+
bhi = c - (c - ay);
|
|
226
|
+
blo = ay - bhi;
|
|
227
|
+
s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
228
|
+
t1 = ytail * ax;
|
|
229
|
+
c = splitter * ytail;
|
|
230
|
+
ahi = c - (c - ytail);
|
|
231
|
+
alo = ytail - ahi;
|
|
232
|
+
c = splitter * ax;
|
|
233
|
+
bhi = c - (c - ax);
|
|
234
|
+
blo = ax - bhi;
|
|
235
|
+
t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
236
|
+
_i = s0 - t0;
|
|
237
|
+
bvirt = s0 - _i;
|
|
238
|
+
a[0] = s0 - (_i + bvirt) + (bvirt - t0);
|
|
239
|
+
_j = s1 + _i;
|
|
240
|
+
bvirt = _j - s1;
|
|
241
|
+
_0 = s1 - (_j - bvirt) + (_i - bvirt);
|
|
242
|
+
_i = _0 - t1;
|
|
243
|
+
bvirt = _0 - _i;
|
|
244
|
+
a[1] = _0 - (_i + bvirt) + (bvirt - t1);
|
|
245
|
+
u3 = _j + _i;
|
|
246
|
+
bvirt = u3 - _j;
|
|
247
|
+
a[2] = _j - (u3 - bvirt) + (_i - bvirt);
|
|
248
|
+
a[3] = u3;
|
|
249
|
+
s1 = ytail * bx;
|
|
250
|
+
c = splitter * ytail;
|
|
251
|
+
ahi = c - (c - ytail);
|
|
252
|
+
alo = ytail - ahi;
|
|
253
|
+
c = splitter * bx;
|
|
254
|
+
bhi = c - (c - bx);
|
|
255
|
+
blo = bx - bhi;
|
|
256
|
+
s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
257
|
+
t1 = xtail * by;
|
|
258
|
+
c = splitter * xtail;
|
|
259
|
+
ahi = c - (c - xtail);
|
|
260
|
+
alo = xtail - ahi;
|
|
261
|
+
c = splitter * by;
|
|
262
|
+
bhi = c - (c - by);
|
|
263
|
+
blo = by - bhi;
|
|
264
|
+
t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
265
|
+
_i = s0 - t0;
|
|
266
|
+
bvirt = s0 - _i;
|
|
267
|
+
b[0] = s0 - (_i + bvirt) + (bvirt - t0);
|
|
268
|
+
_j = s1 + _i;
|
|
269
|
+
bvirt = _j - s1;
|
|
270
|
+
_0 = s1 - (_j - bvirt) + (_i - bvirt);
|
|
271
|
+
_i = _0 - t1;
|
|
272
|
+
bvirt = _0 - _i;
|
|
273
|
+
b[1] = _0 - (_i + bvirt) + (bvirt - t1);
|
|
274
|
+
u3 = _j + _i;
|
|
275
|
+
bvirt = u3 - _j;
|
|
276
|
+
b[2] = _j - (u3 - bvirt) + (_i - bvirt);
|
|
277
|
+
b[3] = u3;
|
|
278
|
+
return 4;
|
|
282
279
|
}
|
|
283
280
|
|
|
284
281
|
function tailadd(finlen, a, b, k, z) {
|
|
@@ -598,6 +595,4 @@ function orient3dfast(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz) {
|
|
|
598
595
|
exports.orient3d = orient3d;
|
|
599
596
|
exports.orient3dfast = orient3dfast;
|
|
600
597
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
})));
|
|
598
|
+
}));
|
package/umd/orient3d.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,
|
|
1
|
+
!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 A=s(192),F=s(192);function k(t,n,e){t=r(t,A,n,e,F);const o=A;return A=F,F=o,t}function q(t,n,o,r,f,s,u,i){let a,c,l,b,h,d,M,p,y,x,g,m,T,j,w;return 0===t?0===n?(u[0]=0,i[0]=0,1):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&0===S&&0===U)return pt;if(yt=32047474274603644e-47*I+o*Math.abs(pt),pt+=ht*(it*Q+bt*L-(lt*N+at*P))+R*(it*bt-lt*at)+dt*(at*O+ct*N-(bt*K+ut*Q))+S*(at*ct-bt*ut)+Mt*(ut*P+lt*K-(ct*L+it*O))+U*(ut*lt-ct*it),pt>=yt||-pt>=yt)return pt;const xt=q(K,O,it,lt,at,bt,c,l),gt=q(L,P,at,bt,ut,ct,b,h),mt=q(N,Q,ut,ct,it,lt,d,M),Tt=r(gt,b,mt,M,p);J=k(J,f(Tt,p,ht,j),j);const jt=r(mt,d,xt,l,y);J=k(J,f(jt,y,dt,j),j);const wt=r(xt,c,gt,h,x);return J=k(J,f(wt,x,Mt,j),j),0!==R&&(J=k(J,f(4,u,R,w),w),J=k(J,f(Tt,p,R,j),j)),0!==S&&(J=k(J,f(4,i,S,w),w),J=k(J,f(jt,y,S,j),j)),0!==U&&(J=k(J,f(4,a,U,w),w),J=k(J,f(wt,x,U,j),j)),0!==K&&(0!==P&&(J=v(J,K,P,Mt,U)),0!==Q&&(J=v(J,-K,Q,dt,S))),0!==L&&(0!==Q&&(J=v(J,L,Q,ht,R)),0!==O&&(J=v(J,-L,O,Mt,U))),0!==N&&(0!==O&&(J=v(J,N,O,dt,S)),0!==P&&(J=v(J,-N,P,ht,R))),A[J-1]}(t,n,s,g,F,z,B,C,D,E,G,H,$)},t.orient3dfast=function(t,n,e,o,r,f,s,u,i,a,c,l){const b=n-c,h=r-c,d=u-c,M=e-l,p=f-l,y=i-l;return(t-a)*(h*y-p*d)+(o-a)*(d*M-y*b)+(s-a)*(b*p-M*h)}});
|