Comparing version 1.0.2 to 1.0.3
@@ -1,44 +0,67 @@ | ||
var i=void 0,l=!0,m=null,o=!1,s;function aa(){this.e=[0,0,0];this.l=m}function t(){this.J=0;this.wa=this.s=this.ea=m;this.L=[0,0,0];this.Pa=[0,0,0];this.T=[0,0,0];this.Fa=0;this.sa=100130;this.qa=o;this.ua=this.n=this.P=this.Q=m;this.$=this.ca=o;this.I=this.ta=this.va=this.ka=this.na=this.ia=this.ga=this.ma=this.la=this.oa=this.ja=this.ha=this.Y=m;this.pa=o;this.B=0;this.K=Array(100);for(var a=0;100>a;a++)this.K[a]=new aa}s=t.prototype;s.Ha=function(){u(this,0)}; | ||
s.Ma=function(a,b){switch(a){case 100142:if(0>b||1<b)break;this.Fa=b;return;case 100140:switch(b){case 100130:case 100131:case 100132:case 100133:case 100134:this.sa=b;return}break;case 100141:this.$=!!b;return;default:v(this,100900);return}v(this,100901)};s.Ia=function(a){switch(a){case 100142:return this.Fa;case 100140:return this.sa;case 100141:return this.$;default:v(this,100900)}return o};s.La=function(a,b,c){this.L[0]=a;this.L[1]=b;this.L[2]=c}; | ||
s.Ja=function(a,b){var c=!b?m:b;switch(a){case 100100:this.ha=c;break;case 100106:this.ga=c;break;case 100104:this.ja=c;this.ca=!!c;break;case 100110:this.ia=c;this.ca=!!c;break;case 100101:this.oa=c;break;case 100107:this.na=c;break;case 100102:this.la=c;break;case 100108:this.ka=c;break;case 100103:this.wa=c;break;case 100109:this.va=c;break;case 100105:this.ua=c;break;case 100111:this.ta=c;break;case 100112:this.ma=c;break;default:v(this,100900)}}; | ||
s.Na=function(a,b){var c=o,e=[0,0,0];u(this,2);this.pa&&(ba(this),this.ea=m);for(var d=0;3>d;++d){var f=a[d];-1E150>f&&(f=-1E150,c=l);1E150<f&&(f=1E150,c=l);e[d]=f}c&&v(this,100155);if(this.s===m){if(100>this.B){c=this.K[this.B];c.l=b;c.e[0]=e[0];c.e[1]=e[1];c.e[2]=e[2];++this.B;return}ba(this)}ca(this,e,b)};s.Da=function(a){u(this,0);this.J=1;this.B=0;this.pa=o;this.s=m;this.I=a};s.Ca=function(){u(this,1);this.J=2;this.ea=m;0<this.B&&(this.pa=l)};s.Ea=function(){u(this,2);this.J=1}; | ||
s.Ka=function(){u(this,1);this.J=0;if(this.s===m){if(!this.ca&&!this.ma&&da(this)){this.I=m;return}ba(this)}var a=o,b=[0,0,0];b[0]=this.L[0];b[1]=this.L[1];b[2]=this.L[2];if(0===b[0]&&0===b[1]&&0===b[2]){var c=[0,0,0],e=[0,0,0],a=[0,0,0],d=[0,0,0],f=[0,0,0];c[0]=c[1]=c[2]=-2*1E150;e[0]=e[1]=e[2]=2*1E150;var g=Array(3),n=Array(3),k,j,h=this.s.Z;for(j=h.c;j!==h;j=j.c)for(k=0;3>k;++k){var p=j.e[k];p<e[k]&&(e[k]=p,n[k]=j);p>c[k]&&(c[k]=p,g[k]=j)}k=0;c[1]-e[1]>c[0]-e[0]&&(k=1);c[2]-e[2]>c[k]-e[k]&&(k= | ||
2);if(e[k]>=c[k])b[0]=0,b[1]=0,b[2]=1;else{c=0;j=n[k];g=g[k];a[0]=j.e[0]-g.e[0];a[1]=j.e[1]-g.e[1];a[2]=j.e[2]-g.e[2];for(j=h.c;j!==h;j=j.c)d[0]=j.e[0]-g.e[0],d[1]=j.e[1]-g.e[1],d[2]=j.e[2]-g.e[2],f[0]=a[1]*d[2]-a[2]*d[1],f[1]=a[2]*d[0]-a[0]*d[2],f[2]=a[0]*d[1]-a[1]*d[0],k=f[0]*f[0]+f[1]*f[1]+f[2]*f[2],k>c&&(c=k,b[0]=f[0],b[1]=f[1],b[2]=f[2]);0>=c&&(b[0]=b[1]=b[2]=0,b[ea(a)]=1)}a=l}d=this.Pa;f=this.T;h=ea(b);d[h]=0;d[(h+1)%3]=1;d[(h+2)%3]=0;f[h]=0;f[(h+1)%3]=0<b[h]?-0:0;f[(h+2)%3]=0<b[h]?1:-1;b=this.s.Z; | ||
for(h=b.c;h!==b;h=h.c)h.f=h.e[0]*d[0]+h.e[1]*d[1]+h.e[2]*d[2],h.d=h.e[0]*f[0]+h.e[1]*f[1]+h.e[2]*f[2];if(a){b=0;a=this.s.x;for(d=a.c;d!==a;d=d.c)if(f=d.k,!(0>=f.v)){do b+=(f.a.f-w(f).f)*(f.a.d+w(f).d),f=f.j;while(f!==d.k)}if(0>b){b=this.s.Z;for(a=b.c;a!==b;a=a.c)a.d=-a.d;this.T[0]=-this.T[0];this.T[1]=-this.T[1];this.T[2]=-this.T[2]}}this.qa=o;b=this.s.W;for(d=b.c;d!==b;d=a)if(a=d.c,f=d.j,y(d.a,w(d))&&d.j.j!==d&&(A(this,f,d),B(d),d=f,f=d.j),f.j===d){if(f!==d){if(f===a||f===a.b)a=a.c;B(f)}if(d===a|| | ||
d===a.b)a=a.c;B(d)}this.P=b=new fa(C);a=this.s.Z;for(d=a.c;d!==a;d=d.c)d.ya=b.X(d);b.xa();this.Q=new ga(this,ha);ia(this,-D);for(ia(this,D);(b=this.P.ba())!==m;){for(;;){a=this.P.fa();if(a===m||!y(a,b))break;a=this.P.ba();A(this,b.k,a.k)}ja(this,b)}this.n=this.Q.N.c.o.i.a;for(b=0;(a=this.Q.N.c.o)!==m;)a.Ga||++b,E(a);this.Q=m;b=this.P;a=b.z;a.C=m;a.H=m;b.z=m;b.O=m;this.P=b.G=m;b=this.s;for(d=b.x.c;d!==b.x;d=a)a=d.c,d=d.k,d.j.j===d&&(ka(d.h,d),B(d));if(!this.qa){if(this.$){b=this.s;for(d=b.W.c;d!== | ||
b.W;d=a)a=d.c,F(d).r!==d.g.r?d.v=d.g.r?1:-1:B(d)}else{b=this.s;for(d=b.x.c;d!==b.x;d=a)if(a=d.c,d.r){for(d=d.k;C(w(d),d.a);d=d.h.b);for(;C(d.a,w(d));d=d.j);f=d.h.b;for(h=i;d.j!==f;)if(C(w(d),f.a)){for(;f.j!==d&&(C(w(f.j),f.j.a)||0>=G(f.a,w(f),w(f.j)));)h=H(f.j,f),f=h.b;f=f.h.b}else{for(;f.j!==d&&(C(d.h.b.a,w(d.h.b))||0<=G(w(d),d.a,d.h.b.a));)h=H(d,d.h.b),d=h.b;d=d.j}for(;f.j.j!==d;)h=H(f.j,f),f=h.b}}if(this.ha||this.la||this.oa||this.ja||this.ga||this.ka||this.na||this.ia)if(this.$){b=this.s;for(a= | ||
b.x.c;a!==b.x;a=a.c)if(a.r){I(this,2);d=a.k;do J(this,d.a.l),d=d.j;while(d!==a.k);K(this)}}else{b=this.s;this.Y=m;for(a=b.x.c;a!==b.x;a=a.c)a.y=o;for(a=b.x.c;a!==b.x;a=a.c)a.r&&!a.y&&(d=a.k,f=new la(1,d,ma),h=i,this.ca||(h=na(d),h.u>f.u&&(f=h),h=na(d.j),h.u>f.u&&(f=h),h=na(d.h.b),h.u>f.u&&(f=h),h=oa(d),h.u>f.u&&(f=h),h=oa(d.j),h.u>f.u&&(f=h),h=oa(d.h.b),h.u>f.u&&(f=h)),f.Oa(this,f.aa,f.u));if(this.Y!==m){b=-1;a=this.Y;for(I(this,4);a!==m;a=a.M){d=a.k;do this.ca&&(f=!F(d).r?1:0,b!==f&&(b=f,f=!!b,this.ia? | ||
this.ia(f,this.I):this.ja&&this.ja(f))),J(this,d.a.l),d=d.j;while(d!==a.k)}K(this);this.Y=m}}if(this.ma){b=this.s;for(d=b.x.c;d!==b.x;d=a)if(a=d.c,!d.r){f=d.k;h=f.j;j=i;do j=h,h=j.j,j.g=m,F(j)===m&&(j.h===j?L(j.a,m):(j.a.k=j.h,M(j,N(j))),g=j.b,g.h===g?L(g.a,m):(g.a.k=g.h,M(g,N(g))),pa(j));while(j!==f);f=d.t;d=d.c;d.t=f;f.c=d}this.ma(this.s);this.I=this.s=m;return}}this.s=this.I=m}; | ||
function u(a,b){if(a.J!==b)for(;a.J!==b;)if(a.J<b)switch(a.J){case 0:v(a,100151);a.Da(m);break;case 1:v(a,100152),a.Ca()}else switch(a.J){case 2:v(a,100154);a.Ea();break;case 1:v(a,100153);var c=a;c.J=0;c.ea=m;c.s=m}}function ca(a,b,c){var e=a.ea;e===m?(e=qa(a.s),O(e,e.b)):(P(e),e=e.j);e.a.l=c;e.a.e[0]=b[0];e.a.e[1]=b[1];e.a.e[2]=b[2];e.v=1;e.b.v=-1;a.ea=e}function ba(a){a.s=new ra;for(var b=0;b<a.B;b++){var c=a.K[b];ca(a,c.e,c.l)}a.B=0;a.pa=o}function I(a,b){a.ga?a.ga(b,a.I):a.ha&&a.ha(b)} | ||
function J(a,b){a.na?a.na(b,a.I):a.oa&&a.oa(b)}function K(a){a.ka?a.ka(a.I):a.la&&a.la()}function v(a,b){a.va?a.va(b,a.I):a.wa&&a.wa(b)}function sa(){this.t=this.c=this.o=m}function ga(a,b){this.N=new sa;this.N.c=this.N;this.N.t=this.N;this.Ba=a;this.A=b}function ta(a,b,c){do b=b.t;while(b.o!==m&&!a.A(a.Ba,b.o,c));a=new sa;a.o=c;a.c=b.c;b.c.t=a;a.t=b;return b.c=a}ga.prototype.X=function(a){return ta(this,this.N,a)}; | ||
ga.prototype.search=function(a){var b=this.N;do b=b.c;while(b.o!==m&&!this.A(this.Ba,a,b.o));return b};function ua(){this.q=0}function va(a,b){var c=Array(b),e=0;if(a!==m)for(;e<a.length;e++)c[e]=a[e];for(;e<b;e++)c[e]=new ua;return c}function wa(){this.o=m;this.F=0}function xa(a,b){var c=Array(b),e=0;if(a!==m)for(;e<a.length;e++)c[e]=a[e];for(;e<b;e++)c[e]=new wa;return c}function ya(a){this.H=va(m,33);this.C=xa(m,33);this.m=0;this.D=32;this.R=0;this.da=o;this.A=a;this.H[1].q=1}s=ya.prototype; | ||
s.xa=function(){for(var a=this.m;1<=a;--a)za(this,a);this.da=l};s.X=function(a){var b=++this.m;2*b>this.D&&(this.D*=2,this.H=va(this.H,this.D+1),this.C=xa(this.C,this.D+1));var c;0===this.R?c=b:(c=this.R,this.R=this.C[c].F);this.H[b].q=c;this.C[c].F=b;this.C[c].o=a;this.da&&Aa(this,b);return c};s.ra=function(){return 0===this.m};s.fa=function(){return this.C[this.H[1].q].o}; | ||
s.ba=function(){var a=this.H,b=this.C,c=a[1].q,e=b[c].o;0<this.m&&(a[1].q=a[this.m].q,b[a[1].q].F=1,b[c].o=m,b[c].F=this.R,this.R=c,0<--this.m&&za(this,1));return e};s.za=function(a){var b=this.H,c=this.C,e=c[a].F;b[e].q=b[this.m].q;c[b[e].q].F=e;e<=--this.m&&(1>=e||this.A(c[b[e>>1].q].o,c[b[e].q].o)?za(this,e):Aa(this,e));c[a].o=m;c[a].F=this.R;this.R=a}; | ||
function za(a,b){for(var c=a.H,e=a.C,d=c[b].q;;){var f=b<<1;f<a.m&&a.A(e[c[f+1].q].o,e[c[f].q].o)&&++f;var g=c[f].q;if(f>a.m||a.A(e[d].o,e[g].o)){c[b].q=d;e[d].F=b;break}c[b].q=g;e[g].F=b;b=f}}function Aa(a,b){for(var c=a.H,e=a.C,d=c[b].q;;){var f=b>>1,g=c[f].q;if(0===f||a.A(e[g].o,e[d].o)){c[b].q=d;e[d].F=b;break}c[b].q=g;e[g].F=b;b=f}}function fa(a){this.G=Ba(m,32);this.O=m;this.m=0;this.D=32;this.da=o;this.A=a;this.z=new ya(this.A)}s=fa.prototype; | ||
s.xa=function(){this.O=[];for(var a=0;a<this.m;a++)this.O[a]=a;var b=this.G,c=this.A;this.O.sort(function(a,d){return c(b[a],b[d])?1:-1});this.D=this.m;this.da=l;this.z.xa()};s.X=function(a){if(this.da)return this.z.X(a);var b=this.m;++this.m>=this.D&&(this.D*=2,this.G=Ba(this.G,this.D));this.G[b]=a;return-(b+1)};function Ba(a,b){var c=Array(b),e=0;if(a!==m)for(;e<a.length;e++)c[e]=a[e];for(;e<b;e++)c[e]=m;return c} | ||
s.ba=function(){if(0===this.m)return this.z.ba();var a=this.G[this.O[this.m-1]];if(!this.z.ra()){var b=this.z.fa();if(this.A(b,a))return this.z.ba()}do--this.m;while(0<this.m&&this.G[this.O[this.m-1]]===m);return a};s.fa=function(){if(0===this.m)return this.z.fa();var a=this.G[this.O[this.m-1]];if(!this.z.ra()){var b=this.z.fa();if(this.A(b,a))return b}return a};s.ra=function(){return 0===this.m&&this.z.ra()}; | ||
s.za=function(a){if(0<=a)this.z.za(a);else for(this.G[-(a+1)]=m;0<this.m&&this.G[this.O[this.m-1]]===m;)--this.m};function qa(a){var b=Ca(a.W);Q(b,a.Z);Q(b.b,a.Z);R(b,a.x);return b}function O(a,b){var c=o,e=o;a!==b&&(b.a!==a.a&&(e=l,L(b.a,a.a)),b.g!==a.g&&(c=l,S(b.g,a.g)),M(b,a),e||(Q(b,a.a),a.a.k=a),c||(R(b,a.g),a.g.k=a))} | ||
function B(a){var b=a.b,c=o;a.g!==F(a)&&(c=l,S(a.g,F(a)));a.h===a?L(a.a,m):(F(a).k=N(a),a.a.k=a.h,M(a,N(a)),c||R(a,a.g));b.h===b?(L(b.a,m),S(b.g,m)):(a.g.k=N(b),b.a.k=b.h,M(b,N(b)));pa(a)}function P(a){var b=Ca(a),c=b.b;M(b,a.j);b.a=w(a);Q(c,b.a);b.g=c.g=a.g;b=b.b;M(a.b,N(a.b));M(a.b,b);a.b.a=b.a;w(b).k=b.b;b.b.g=F(a);b.v=a.v;b.b.v=a.b.v;return b}function H(a,b){var c=o,e=Ca(a),d=e.b;b.g!==a.g&&(c=l,S(b.g,a.g));M(e,a.j);M(d,b);e.a=w(a);d.a=b.a;e.g=d.g=a.g;a.g.k=d;c||R(e,a.g);return e} | ||
function Ca(a){var b=new T,c=new T,e=a.b.c;c.c=e;e.b.c=b;b.c=a;a.b.c=c;b.b=c;b.h=b;b.j=c;c.b=b;c.h=c;return c.j=b}function M(a,b){var c=a.h,e=b.h;c.b.j=b;e.b.j=a;a.h=e;b.h=c}function Q(a,b){var c=b.t,e=new Da(b,c);c.c=e;b.t=e;c=e.k=a;do c.a=e,c=c.h;while(c!==a)}function R(a,b){var c=b.t,e=new Ea(b,c);c.c=e;b.t=e;e.k=a;e.r=b.r;c=a;do c.g=e,c=c.j;while(c!==a)}function pa(a){var b=a.c;a=a.b.c;b.b.c=a;a.b.c=b}function L(a,b){var c=a.k,e=c;do e.a=b,e=e.h;while(e!==c);c=a.t;e=a.c;e.t=c;c.c=e} | ||
function S(a,b){var c=a.k,e=c;do e.g=b,e=e.j;while(e!==c);c=a.t;e=a.c;e.t=c;c.c=e}function Ea(a,b){this.c=a||this;this.t=b||this;this.M=this.l=this.k=m;this.r=this.y=o}function T(){this.c=this;this.V=this.g=this.a=this.j=this.h=this.b=m;this.v=0}function F(a){return a.b.g}function w(a){return a.b.a}function N(a){return a.b.j}function Da(a,b){this.c=a||this;this.t=b||this;this.l=this.k=m;this.e=[0,0,0];this.d=this.f=0;this.ya=m} | ||
function ra(){this.Z=new Da;this.x=new Ea;this.W=new T;this.Aa=new T;this.W.b=this.Aa;this.Aa.b=this.W}var D=4*1E150;function ka(a,b){a.v+=b.v;a.b.v+=b.b.v}function ha(a,b,c){a=a.n;b=b.i;c=c.i;if(w(b)===a)return w(c)===a?C(b.a,c.a)?0>=G(w(c),b.a,c.a):0<=G(w(b),c.a,b.a):0>=G(w(c),a,c.a);if(w(c)===a)return 0<=G(w(b),a,b.a);b=U(w(b),a,b.a);a=U(w(c),a,c.a);return b>=a}function E(a){a.i.V=m;var b=a.S;b.c.t=b.t;b.t.c=b.c;a.S=m}function Fa(a,b){B(a.i);a.w=o;a.i=b;b.V=a} | ||
function Ga(a){var b=a.i.a;do a=V(a);while(a.i.a===b);a.w&&(b=H(W(a).i.b,a.i.j),Fa(a,b),a=V(a));return a}function Ha(a){var b=w(a.i);do a=V(a);while(w(a.i)===b);return a}function Ia(a,b,c){var e=new Ja;e.i=c;e.S=ta(a.Q,b.S,e);return c.V=e}function Ka(a,b){switch(a.sa){case 100130:return 0!==(b&1);case 100131:return 0!==b;case 100132:return 0<b;case 100133:return 0>b;case 100134:return 2<=b||-2>=b}return o}function La(a){var b=a.i,c=b.g;c.r=a.r;c.k=b;E(a)} | ||
function X(a,b){for(var c=a,e=a.i;c!==b;){c.w=o;var d=W(c),f=d.i;if(f.a!==e.a){if(!d.w){La(c);break}f=H(e.h.b,f.b);Fa(d,f)}e.h!==f&&(O(N(f),f),O(e,f));La(c);e=d.i;c=d}return e}function Y(a,b,c,e,d,f){var g=l;do Ia(a,b,c.b),c=c.h;while(c!==e);for(d===m&&(d=W(b).i.b.h);;){e=W(b);c=e.i.b;if(c.a!==d.a)break;c.h!==d&&(O(N(c),c),O(N(d),c));e.U=b.U-c.v;e.r=Ka(a,e.U);b.p=l;!g&&Ma(a,b)&&(ka(c,d),E(b),B(d));g=o;b=e;d=c}b.p=l;f&&Na(a,b)} | ||
function Oa(a,b,c,e,d){var f=[b.e[0],b.e[1],b.e[2]];b.l=m;var g;a.ta?g=a.ta(f,c,e,a.I):a.ua&&(g=a.ua(f,c,e));g===i&&(g=m);b.l=g;b.l===m&&(d?a.qa||(v(a,100156),a.qa=l):b.l=c[0])}function A(a,b,c){var e=[m,m,m,m];e[0]=b.a.l;e[1]=c.a.l;Oa(a,b.a,e,[0.5,0.5,0,0],o);O(b,c)} | ||
function Pa(a,b,c,e,d){var f=Math.abs(b.f-a.f)+Math.abs(b.d-a.d),g=Math.abs(c.f-a.f)+Math.abs(c.d-a.d),n=d+1;e[d]=0.5*g/(f+g);e[n]=0.5*f/(f+g);a.e[0]+=e[d]*b.e[0]+e[n]*c.e[0];a.e[1]+=e[d]*b.e[1]+e[n]*c.e[1];a.e[2]+=e[d]*b.e[2]+e[n]*c.e[2]}function Ma(a,b){var c=W(b),e=b.i,d=c.i;if(C(e.a,d.a)){if(0<G(w(d),e.a,d.a))return o;y(e.a,d.a)?e.a!==d.a&&(a.P.za(e.a.ya),A(a,N(d),e)):(P(d.b),O(e,N(d)),b.p=c.p=l)}else{if(0>G(w(e),d.a,e.a))return o;V(b).p=b.p=l;P(e.b);O(N(d),e)}return l} | ||
function Qa(a,b){var c=W(b),e=b.i,d=c.i,f=e.a,g=d.a,n=w(e),k=w(d),j=new Da;G(n,a.n,f);G(k,a.n,g);if(f===g||Math.min(f.d,n.d)>Math.max(g.d,k.d))return o;if(C(f,g)){if(0<G(k,f,g))return o}else if(0>G(n,g,f))return o;var h=n,p=f,r=k,x=g,q,z;C(h,p)||(q=h,h=p,p=q);C(r,x)||(q=r,r=x,x=q);C(h,r)||(q=h,h=r,r=q,q=p,p=x,x=q);C(r,p)?C(p,x)?(q=U(h,r,p),z=U(r,p,x),0>q+z&&(q=-q,z=-z),j.f=Ra(q,r.f,z,p.f)):(q=G(h,r,p),z=-G(h,x,p),0>q+z&&(q=-q,z=-z),j.f=Ra(q,r.f,z,x.f)):j.f=(r.f+p.f)/2;Z(h,p)||(q=h,h=p,p=q);Z(r,x)|| | ||
(q=r,r=x,x=q);Z(h,r)||(q=h,h=r,r=q,q=p,p=x,x=q);Z(r,p)?Z(p,x)?(q=Sa(h,r,p),z=Sa(r,p,x),0>q+z&&(q=-q,z=-z),j.d=Ra(q,r.d,z,p.d)):(q=Ta(h,r,p),z=-Ta(h,x,p),0>q+z&&(q=-q,z=-z),j.d=Ra(q,r.d,z,x.d)):j.d=(r.d+p.d)/2;C(j,a.n)&&(j.f=a.n.f,j.d=a.n.d);h=C(f,g)?f:g;C(h,j)&&(j.f=h.f,j.d=h.d);if(y(j,f)||y(j,g))return Ma(a,b),o;if(!y(n,a.n)&&0<=G(n,a.n,j)||!y(k,a.n)&&0>=G(k,a.n,j)){if(k===a.n)return P(e.b),O(d.b,e),b=Ga(b),e=W(b).i,X(W(b),c),Y(a,b,N(e),e,e,l),l;if(n===a.n)return P(d.b),O(e.j,N(d)),c=b,b=Ha(b),f= | ||
W(b).i.b.h,c.i=N(d),d=X(c,m),Y(a,b,d.h,e.b.h,f,l),l;0<=G(n,a.n,j)&&(V(b).p=b.p=l,P(e.b),e.a.f=a.n.f,e.a.d=a.n.d);0>=G(k,a.n,j)&&(b.p=c.p=l,P(d.b),d.a.f=a.n.f,d.a.d=a.n.d);return o}P(e.b);P(d.b);O(N(d),e);e.a.f=j.f;e.a.d=j.d;e.a.ya=a.P.X(e.a);e=e.a;d=[0,0,0,0];j=[f.l,n.l,g.l,k.l];e.e[0]=e.e[1]=e.e[2]=0;Pa(e,f,n,d,0);Pa(e,g,k,d,2);Oa(a,e,j,d,l);V(b).p=b.p=c.p=l;return o} | ||
function Na(a,b){for(var c=W(b);;){for(;c.p;)b=c,c=W(c);if(!b.p&&(c=b,b=V(b),b===m||!b.p))break;b.p=o;var e=b.i,d=c.i,f;if(f=w(e)!==w(d))a:{f=b;var g=W(f),n=f.i,k=g.i,j=i;if(C(w(n),w(k))){if(0>G(w(n),w(k),n.a)){f=o;break a}V(f).p=f.p=l;j=P(n);O(k.b,j);j.g.r=f.r}else{if(0<G(w(k),w(n),k.a)){f=o;break a}f.p=g.p=l;j=P(k);O(n.j,k.b);F(j).r=f.r}f=l}f&&(c.w?(E(c),B(d),c=W(b),d=c.i):b.w&&(E(b),B(e),b=V(c),e=b.i));if(e.a!==d.a)if(w(e)!==w(d)&&!b.w&&!c.w&&(w(e)===a.n||w(d)===a.n)){if(Qa(a,b))break}else Ma(a, | ||
b);e.a===d.a&&w(e)===w(d)&&(ka(d,e),E(b),B(e),b=V(c))}} | ||
function ja(a,b){a.n=b;for(var c=b.k;c.V===m;)if(c=c.h,c===b.k){var e=a,c=b,d=new Ja;d.i=c.k.b;var d=e.Q.search(d).o,f=W(d),g=d.i,n=f.i;if(0===G(w(g),c,g.a))if(g=d.i,y(g.a,c))A(e,g,c.k);else if(y(w(g),c)){var d=Ha(d),g=W(d),n=g.i.b,k=f=n.h;g.w&&(E(g),B(n),n=N(f));O(c.k,n);C(w(f),f.a)||(f=m);Y(e,d,n.h,k,f,l)}else P(g.b),d.w&&(B(g.h),d.w=o),O(c.k,g),ja(e,c);else k=C(w(n),w(g))?d:f,f=i,d.r||k.w?(f=k===d?H(c.k.b,g.j):H(n.b.h.b,c.k).b,k.w?Fa(k,f):(g=e,d=Ia(e,d,f),d.U=V(d).U+d.i.v,d.r=Ka(g,d.U)),ja(e,c)): | ||
Y(e,d,c.k,c.k,m,l);return}c=Ga(c.V);d=W(c);e=d.i;d=X(d,m);d.h===e?(e=d,d=e.h,g=W(c),n=c.i,f=g.i,k=o,w(n)!==w(f)&&Qa(a,c),y(n.a,a.n)&&(O(N(d),n),c=Ga(c),d=W(c).i,X(W(c),g),k=l),y(f.a,a.n)&&(O(e,N(f)),e=X(g,m),k=l),k?Y(a,c,e.h,d,d,l):(d=C(f.a,n.a)?N(f):n,d=H(e.h.b,d),Y(a,c,d,d.h,d.h,o),d.b.V.w=l,Na(a,c))):Y(a,c,d.h,e,e,l)}function ia(a,b){var c=new Ja,e=qa(a.s);e.a.f=D;e.a.d=b;w(e).f=-D;w(e).d=b;a.n=w(e);c.i=e;c.U=0;c.r=o;c.w=o;c.Ga=l;c.p=o;c.S=a.Q.X(c)} | ||
function Ja(){this.S=this.i=m;this.U=0;this.w=this.p=this.Ga=this.r=o}function W(a){return a.S.t.o}function V(a){return a.S.c.o} | ||
function da(a){if(3>a.B)return l;var b=[0,0,0];b[0]=a.L[0];b[1]=a.L[1];b[2]=a.L[2];0===b[0]&&(0===b[1]&&0===b[2])&&Ua(a,b,o);var c=Ua(a,b,l);if(2===c)return o;if(0===c)return l;switch(a.sa){case 100132:if(0>c)return l;break;case 100133:if(0<c)return l;break;case 100134:return l}I(a,a.$?2:3<a.B?6:4);b=0+a.B;J(a,a.K[0].l);if(0<c)for(c=1;c<b;++c)J(a,a.K[c].l);else for(c=b-1;0<c;--c)J(a,a.K[c].l);K(a);return l}function $(a){return!a.r||a.y}function Va(a){for(;a!==m;)a.y=o,a=a.M} | ||
function na(a){var b=new la(0,m,Wa),c=m,e;for(e=a;!$(e.g);e=e.h)e.g.M=c,c=e.g,e.g.y=l,++b.u;for(e=a;!$(F(e));e=N(e))F(e).M=c,c=F(e),F(e).y=l,++b.u;b.aa=e;Va(c);return b} | ||
function oa(a){var b=new la(0,m,Xa),c=0,e=0,d=m,f,g;for(f=a;!$(f.g);++e,f=f.h){f.g.M=d;d=f.g;f.g.y=l;++e;f=f.j.b;if($(f.g))break;f.g.M=d;d=f.g;f.g.y=l}g=f;for(f=a;!$(F(f));++c,f=f.b.h.b){F(f).M=d;d=F(f);F(f).y=l;++c;f=N(f);if($(F(f)))break;F(f).M=d;d=F(f);F(f).y=l}a=f;b.u=e+c;0===(e&1)?b.aa=g.b:0===(c&1)?b.aa=a:(--b.u,b.aa=a.h);Va(d);return b}function Wa(a,b,c){I(a,6);J(a,b.a.l);for(J(a,w(b).l);!$(b.g);)b.g.y=l,--c,b=b.h,J(a,w(b).l);K(a)} | ||
function Xa(a,b,c){I(a,5);J(a,b.a.l);for(J(a,w(b).l);!$(b.g);){b.g.y=l;--c;b=b.j.b;J(a,b.a.l);if($(b.g))break;b.g.y=l;--c;b=b.h;J(a,w(b).l)}K(a)}function ma(a,b){b.g.M=a.Y;a.Y=b.g;b.g.y=l} | ||
function Ua(a,b,c){c||(b[0]=b[1]=b[2]=0);for(var e=0+a.B,d=1,f=a.K[0],g=a.K[d],n=g.e[0]-f.e[0],k=g.e[1]-f.e[1],j=g.e[2]-f.e[2],h=0;++d<e;){var g=a.K[d],p=n,r=k,x=j,n=g.e[0]-f.e[0],k=g.e[1]-f.e[1],j=g.e[2]-f.e[2],g=[0,0,0];g[0]=r*j-x*k;g[1]=x*n-p*j;g[2]=p*k-r*n;p=g[0]*b[0]+g[1]*b[1]+g[2]*b[2];if(c){if(0!==p)if(0<p){if(0>h)return 2;h=1}else{if(0<h)return 2;h=-1}}else 0<=p?(b[0]+=g[0],b[1]+=g[1],b[2]+=g[2]):(b[0]-=g[0],b[1]-=g[1],b[2]-=g[2])}return h}function la(a,b,c){this.u=a;this.aa=b;this.Oa=c} | ||
function y(a,b){return a.f===b.f&&a.d===b.d}function C(a,b){return a.f<b.f||a.f===b.f&&a.d<=b.d}function U(a,b,c){var e,d;e=b.f-a.f;d=c.f-b.f;return 0<e+d?e<d?b.d-a.d+(a.d-c.d)*(e/(e+d)):b.d-c.d+(c.d-a.d)*(d/(e+d)):0}function G(a,b,c){var e,d;e=b.f-a.f;d=c.f-b.f;return 0<e+d?(b.d-c.d)*e+(b.d-a.d)*d:0}function Z(a,b){return a.d<b.d||a.d===b.d&&a.f<=b.f}function Sa(a,b,c){var e,d;e=b.d-a.d;d=c.d-b.d;return 0<e+d?e<d?b.f-a.f+(a.f-c.f)*(e/(e+d)):b.f-c.f+(c.f-a.f)*(d/(e+d)):0} | ||
function Ta(a,b,c){var e,d;e=b.d-a.d;d=c.d-b.d;return 0<e+d?(b.f-c.f)*e+(b.f-a.f)*d:0}function Ra(a,b,c,e){a=0>a?0:a;c=0>c?0:c;return a<=c?0===c?(b+e)/2:b+(e-b)*(a/(a+c)):e+(b-e)*(c/(a+c))}function ea(a){var b=0;Math.abs(a[1])>Math.abs(a[0])&&(b=1);Math.abs(a[2])>Math.abs(a[b])&&(b=2);return b};self.libtess={};self.libtess.GluTesselator=t;t.prototype.gluDeleteTess=t.prototype.Ha;t.prototype.gluTessProperty=t.prototype.Ma;t.prototype.gluGetTessProperty=t.prototype.Ia;t.prototype.gluTessNormal=t.prototype.La;t.prototype.gluTessCallback=t.prototype.Ja;t.prototype.gluTessVertex=t.prototype.Na;t.prototype.gluTessBeginPolygon=t.prototype.Da;t.prototype.gluTessBeginContour=t.prototype.Ca;t.prototype.gluTessEndContour=t.prototype.Ea;t.prototype.gluTessEndPolygon=t.prototype.Ka; | ||
/* | ||
Copyright 2000, Silicon Graphics, Inc. All Rights Reserved. | ||
Copyright 2014, Google Inc. All Rights Reserved. | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to | ||
deal in the Software without restriction, including without limitation the | ||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
sell copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice including the dates of first publication and | ||
either this permission notice or a reference to http://oss.sgi.com/projects/FreeB/ | ||
shall be included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR | ||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
Original Code. The Original Code is: OpenGL Sample Implementation, | ||
Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, | ||
Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. | ||
Copyright in any portions created by third parties is as indicated | ||
elsewhere herein. All Rights Reserved. | ||
*/ | ||
'use strict';var m;function s(a,b){return a.b===b.b&&a.a===b.a}function t(a,b){return a.b<b.b||a.b===b.b&&a.a<=b.a}function u(a,b,c){var d,e;d=b.b-a.b;e=c.b-b.b;return 0<d+e?d<e?b.a-a.a+d/(d+e)*(a.a-c.a):b.a-c.a+e/(d+e)*(c.a-a.a):0}function w(a,b,c){var d,e;d=b.b-a.b;e=c.b-b.b;return 0<d+e?(b.a-c.a)*d+(b.a-a.a)*e:0}function x(a,b){return a.a<b.a||a.a===b.a&&a.b<=b.b}function aa(a,b,c){var d,e;d=b.a-a.a;e=c.a-b.a;return 0<d+e?d<e?b.b-a.b+d/(d+e)*(a.b-c.b):b.b-c.b+e/(d+e)*(c.b-a.b):0} | ||
function ba(a,b,c){var d,e;d=b.a-a.a;e=c.a-b.a;return 0<d+e?(b.b-c.b)*d+(b.b-a.b)*e:0}function ca(a){return t(z(a),a.a)}function da(a){return t(a.a,z(a))}function A(a,b,c,d){a=0>a?0:a;c=0>c?0:c;return a<=c?0===c?(b+d)/2:b+a/(a+c)*(d-b):d+c/(a+c)*(b-d)};function ea(a){var b=fa(a.b);B(b,a.c);B(b.b,a.c);C(b,a.a);return b}function D(a,b){var c=!1,d=!1;a!==b&&(b.a!==a.a&&(d=!0,E(b.a,a.a)),b.c!==a.c&&(c=!0,F(b.c,a.c)),G(b,a),d||(B(b,a.a),a.a.c=a),c||(C(b,a.c),a.c.b=a))}function H(a){var b=a.b,c=!1;a.c!==I(a)&&(c=!0,F(a.c,I(a)));a.d===a?E(a.a,null):(I(a).b=J(a),a.a.c=a.d,G(a,J(a)),c||C(a,a.c));b.d===b?(E(b.a,null),F(b.c,null)):(a.c.b=J(b),b.a.c=b.d,G(b,J(b)));ga(a)} | ||
function K(a){var b=fa(a),c=b.b;G(b,a.e);b.a=z(a);B(c,b.a);b.c=c.c=a.c;b=b.b;G(a.b,J(a.b));G(a.b,b);a.b.a=b.a;z(b).c=b.b;b.b.c=I(a);b.g=a.g;b.b.g=a.b.g;return b}function L(a,b){var c=!1,d=fa(a),e=d.b;b.c!==a.c&&(c=!0,F(b.c,a.c));G(d,a.e);G(e,b);d.a=z(a);e.a=b.a;d.c=e.c=a.c;a.c.b=e;c||C(d,a.c);return d}function fa(a){var b=new M,c=new M,d=a.b.i;c.i=d;d.b.i=b;b.i=a;a.b.i=c;b.b=c;b.d=b;b.e=c;c.b=b;c.d=c;return c.e=b}function G(a,b){var c=a.d,d=b.d;c.b.e=b;d.b.e=a;a.d=d;b.d=c} | ||
function B(a,b){var c=b.g,d=new ha(b,c);c.e=d;b.g=d;c=d.c=a;do c.a=d,c=c.d;while(c!==a)}function C(a,b){var c=b.g,d=new ia(b,c);c.a=d;b.g=d;d.b=a;d.c=b.c;c=a;do c.c=d,c=c.e;while(c!==a)}function ga(a){var b=a.i;a=a.b.i;b.b.i=a;a.b.i=b}function E(a,b){var c=a.c,d=c;do d.a=b,d=d.d;while(d!==c);c=a.g;d=a.e;d.g=c;c.e=d}function F(a,b){var c=a.b,d=c;do d.c=b,d=d.e;while(d!==c);c=a.g;d=a.a;d.g=c;c.a=d};function ja(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function ka(a){var b=0;Math.abs(a[1])>Math.abs(a[0])&&(b=1);Math.abs(a[2])>Math.abs(a[b])&&(b=2);return b};function la(a){if(3>a.c)return!0;var b=[0,0,0];b[0]=a.i[0];b[1]=a.i[1];b[2]=a.i[2];0===b[0]&&0===b[1]&&0===b[2]&&ma(a,b,!1);var c=ma(a,b,!0);if(2===c)return!1;if(0===c)return!0;switch(a.B){case 100132:if(0>c)return!0;break;case 100133:if(0<c)return!0;break;case 100134:return!0}N(a,a.n?2:3<a.c?6:4);b=0+a.c;O(a,a.g[0].a);if(0<c)for(c=1;c<b;++c)O(a,a.g[c].a);else for(c=b-1;0<c;--c)O(a,a.g[c].a);P(a);return!0}function Q(a){return!a.c||a.d}function na(a){for(;null!==a;)a.d=!1,a=a.e} | ||
function oa(a){var b=new pa(0,null,qa),c=null,d;for(d=a;!Q(d.c);d=d.d)d.c.e=c,c=d.c,d.c.d=!0,++b.a;for(d=a;!Q(I(d));d=J(d))I(d).e=c,c=I(d),I(d).d=!0,++b.a;b.b=d;na(c);return b} | ||
function ra(a){var b=new pa(0,null,sa),c=0,d=0,e=null,f,g;for(f=a;!Q(f.c);++d,f=f.d){f.c.e=e;e=f.c;f.c.d=!0;++d;f=f.e.b;if(Q(f.c))break;f.c.e=e;e=f.c;f.c.d=!0}g=f;for(f=a;!Q(I(f));++c,f=f.b.d.b){I(f).e=e;e=I(f);I(f).d=!0;++c;f=J(f);if(Q(I(f)))break;I(f).e=e;e=I(f);I(f).d=!0}a=f;b.a=d+c;0===(d&1)?b.b=g.b:0===(c&1)?b.b=a:(--b.a,b.b=a.d);na(e);return b}function qa(a,b,c){N(a,6);O(a,b.a.d);for(O(a,z(b).d);!Q(b.c);)b.c.d=!0,--c,b=b.d,O(a,z(b).d);P(a)} | ||
function sa(a,b,c){N(a,5);O(a,b.a.d);for(O(a,z(b).d);!Q(b.c);){b.c.d=!0;--c;b=b.e.b;O(a,b.a.d);if(Q(b.c))break;b.c.d=!0;--c;b=b.d;O(a,z(b).d)}P(a)}function ta(a,b){b.c.e=a.m;a.m=b.c;b.c.d=!0} | ||
function ma(a,b,c){c||(b[0]=b[1]=b[2]=0);for(var d=0+a.c,e=1,f=a.g[0],g=a.g[e],n=g.f[0]-f.f[0],l=g.f[1]-f.f[1],k=g.f[2]-f.f[2],h=0;++e<d;){var g=a.g[e],p=n,r=l,v=k,n=g.f[0]-f.f[0],l=g.f[1]-f.f[1],k=g.f[2]-f.f[2],g=[0,0,0];g[0]=r*k-v*l;g[1]=v*n-p*k;g[2]=p*l-r*n;p=g[0]*b[0]+g[1]*b[1]+g[2]*b[2];if(!c)0<=p?(b[0]+=g[0],b[1]+=g[1],b[2]+=g[2]):(b[0]-=g[0],b[1]-=g[1],b[2]-=g[2]);else if(0!==p)if(0<p){if(0>h)return 2;h=1}else{if(0<h)return 2;h=-1}}return h};var R=4*1E150;function ua(a,b){a.g+=b.g;a.b.g+=b.b.g}function va(a,b,c){a=a.a;b=b.h;c=c.h;if(z(b)===a)return z(c)===a?t(b.a,c.a)?0>=w(z(c),b.a,c.a):0<=w(z(b),c.a,b.a):0>=w(z(c),a,c.a);if(z(c)===a)return 0<=w(z(b),a,b.a);b=u(z(b),a,b.a);a=u(z(c),a,c.a);return b>=a}function S(a){a.h.j=null;var b=a.d;b.a.c=b.c;b.c.a=b.a;a.d=null}function wa(a,b){H(a.h);a.b=!1;a.h=b;b.j=a}function xa(a){var b=a.h.a;do a=T(a);while(a.h.a===b);a.b&&(b=L(U(a).h.b,a.h.e),wa(a,b),a=T(a));return a} | ||
function ya(a){var b=z(a.h);do a=T(a);while(z(a.h)===b);return a}function za(a,b,c){var d=new Aa;d.h=c;d.d=Ba(a.k,b.d,d);return c.j=d}function Ca(a,b){switch(a.B){case 100130:return 0!==(b&1);case 100131:return 0!==b;case 100132:return 0<b;case 100133:return 0>b;case 100134:return 2<=b||-2>=b}return!1}function Da(a){var b=a.h,c=b.c;c.c=a.c;c.b=b;S(a)} | ||
function V(a,b){for(var c=a,d=a.h;c!==b;){c.b=!1;var e=U(c),f=e.h;if(f.a!==d.a){if(!e.b){Da(c);break}f=L(d.d.b,f.b);wa(e,f)}d.d!==f&&(D(J(f),f),D(d,f));Da(c);d=e.h;c=e}return d}function W(a,b,c,d,e,f){var g=!0;do za(a,b,c.b),c=c.d;while(c!==d);for(null===e&&(e=U(b).h.b.d);;){d=U(b);c=d.h.b;if(c.a!==e.a)break;c.d!==e&&(D(J(c),c),D(J(e),c));d.e=b.e-c.g;d.c=Ca(a,d.e);b.a=!0;!g&&Ea(a,b)&&(ua(c,e),S(b),H(e));g=!1;b=d;e=c}b.a=!0;f&&Fa(a,b)} | ||
function Ga(a,b,c,d,e){var f=[b.f[0],b.f[1],b.f[2]];b.d=null;var g;a.C?g=a.C(f,c,d,a.d):a.D&&(g=a.D(f,c,d));void 0===g&&(g=null);b.d=g;null===b.d&&(e?a.A||(X(a,100156),a.A=!0):b.d=c[0])}function Y(a,b,c){var d=[null,null,null,null];d[0]=b.a.d;d[1]=c.a.d;Ga(a,b.a,d,[.5,.5,0,0],!1);D(b,c)} | ||
function Ha(a,b,c,d,e){var f=Math.abs(b.b-a.b)+Math.abs(b.a-a.a),g=Math.abs(c.b-a.b)+Math.abs(c.a-a.a),n=e+1;d[e]=.5*g/(f+g);d[n]=.5*f/(f+g);a.f[0]+=d[e]*b.f[0]+d[n]*c.f[0];a.f[1]+=d[e]*b.f[1]+d[n]*c.f[1];a.f[2]+=d[e]*b.f[2]+d[n]*c.f[2]} | ||
function Ea(a,b){var c=U(b),d=b.h,e=c.h;if(t(d.a,e.a)){if(0<w(z(e),d.a,e.a))return!1;if(!s(d.a,e.a))K(e.b),D(d,J(e)),b.a=c.a=!0;else if(d.a!==e.a){var c=a.j,f=d.a.i;if(0<=f){var c=c.b,g=c.c,n=c.a,l=n[f].b;g[l].a=g[c.b].a;n[g[l].a].b=l;l<=--c.b&&(1>=l||c.g(n[g[l>>1].a].a,n[g[l].a].a)?Ia(c,l):Ja(c,l));n[f].a=null;n[f].b=c.d;c.d=f}else for(c.c[-(f+1)]=null;0<c.a&&null===c.c[c.d[c.a-1]];)--c.a;Y(a,J(e),d)}}else{if(0>w(z(d),e.a,d.a))return!1;T(b).a=b.a=!0;K(d.b);D(J(e),d)}return!0} | ||
function Ka(a,b){var c=U(b),d=b.h,e=c.h,f=d.a,g=e.a,n=z(d),l=z(e),k=new ha;w(n,a.a,f);w(l,a.a,g);if(f===g||Math.min(f.a,n.a)>Math.max(g.a,l.a))return!1;if(t(f,g)){if(0<w(l,f,g))return!1}else if(0>w(n,g,f))return!1;var h=n,p=f,r=l,v=g,q,y;t(h,p)||(q=h,h=p,p=q);t(r,v)||(q=r,r=v,v=q);t(h,r)||(q=h,h=r,r=q,q=p,p=v,v=q);t(r,p)?t(p,v)?(q=u(h,r,p),y=u(r,p,v),0>q+y&&(q=-q,y=-y),k.b=A(q,r.b,y,p.b)):(q=w(h,r,p),y=-w(h,v,p),0>q+y&&(q=-q,y=-y),k.b=A(q,r.b,y,v.b)):k.b=(r.b+p.b)/2;x(h,p)||(q=h,h=p,p=q);x(r,v)|| | ||
(q=r,r=v,v=q);x(h,r)||(q=h,h=r,r=q,q=p,p=v,v=q);x(r,p)?x(p,v)?(q=aa(h,r,p),y=aa(r,p,v),0>q+y&&(q=-q,y=-y),k.a=A(q,r.a,y,p.a)):(q=ba(h,r,p),y=-ba(h,v,p),0>q+y&&(q=-q,y=-y),k.a=A(q,r.a,y,v.a)):k.a=(r.a+p.a)/2;t(k,a.a)&&(k.b=a.a.b,k.a=a.a.a);h=t(f,g)?f:g;t(h,k)&&(k.b=h.b,k.a=h.a);if(s(k,f)||s(k,g))return Ea(a,b),!1;if(!s(n,a.a)&&0<=w(n,a.a,k)||!s(l,a.a)&&0>=w(l,a.a,k)){if(l===a.a)return K(d.b),D(e.b,d),b=xa(b),d=U(b).h,V(U(b),c),W(a,b,J(d),d,d,!0),!0;if(n===a.a)return K(e.b),D(d.e,J(e)),c=b,b=ya(b), | ||
f=U(b).h.b.d,c.h=J(e),e=V(c,null),W(a,b,e.d,d.b.d,f,!0),!0;0<=w(n,a.a,k)&&(T(b).a=b.a=!0,K(d.b),d.a.b=a.a.b,d.a.a=a.a.a);0>=w(l,a.a,k)&&(b.a=c.a=!0,K(e.b),e.a.b=a.a.b,e.a.a=a.a.a);return!1}K(d.b);K(e.b);D(J(e),d);d.a.b=k.b;d.a.a=k.a;d.a.i=La(a.j,d.a);d=d.a;e=[0,0,0,0];k=[f.d,n.d,g.d,l.d];d.f[0]=d.f[1]=d.f[2]=0;Ha(d,f,n,e,0);Ha(d,g,l,e,2);Ga(a,d,k,e,!0);T(b).a=b.a=c.a=!0;return!1} | ||
function Fa(a,b){for(var c=U(b);;){for(;c.a;)b=c,c=U(c);if(!b.a&&(c=b,b=T(b),null===b||!b.a))break;b.a=!1;var d=b.h,e=c.h,f;if(f=z(d)!==z(e))a:{f=b;var g=U(f),n=f.h,l=g.h,k=void 0;if(t(z(n),z(l))){if(0>w(z(n),z(l),n.a)){f=!1;break a}T(f).a=f.a=!0;k=K(n);D(l.b,k);k.c.c=f.c}else{if(0<w(z(l),z(n),l.a)){f=!1;break a}f.a=g.a=!0;k=K(l);D(n.e,l.b);I(k).c=f.c}f=!0}f&&(c.b?(S(c),H(e),c=U(b),e=c.h):b.b&&(S(b),H(d),b=T(c),d=b.h));if(d.a!==e.a)if(z(d)===z(e)||b.b||c.b||z(d)!==a.a&&z(e)!==a.a)Ea(a,b);else if(Ka(a, | ||
b))break;d.a===e.a&&z(d)===z(e)&&(ua(e,d),S(b),H(d),b=T(c))}} | ||
function Ma(a,b){a.a=b;for(var c=b.c;null===c.j;)if(c=c.d,c===b.c){var c=a,d=b,e=new Aa;e.h=d.c.b;var f=c.k,g=f.a;do g=g.a;while(null!==g.b&&!f.c(f.b,e,g.b));var f=g.b,n=U(f),e=f.h,g=n.h;if(0===w(z(e),d,e.a))if(e=f.h,s(e.a,d))Y(c,e,d.c);else if(s(z(e),d)){var f=ya(f),e=U(f),g=e.h.b,l=n=g.d;e.b&&(S(e),H(g),g=J(n));D(d.c,g);ca(n)||(n=null);W(c,f,g.d,l,n,!0)}else K(e.b),f.b&&(H(e.d),f.b=!1),D(d.c,e),Ma(c,d);else l=t(z(g),z(e))?f:n,n=void 0,f.c||l.b?(l===f?n=L(d.c.b,e.e):n=L(g.b.d.b,d.c).b,l.b?wa(l,n): | ||
(e=c,f=za(c,f,n),f.e=T(f).e+f.h.g,f.c=Ca(e,f.e)),Ma(c,d)):W(c,f,d.c,d.c,null,!0);return}c=xa(c.j);e=U(c);f=e.h;e=V(e,null);if(e.d===f){var f=e,e=f.d,g=U(c),n=c.h,l=g.h,k=!1;z(n)!==z(l)&&Ka(a,c);s(n.a,a.a)&&(D(J(e),n),c=xa(c),e=U(c).h,V(U(c),g),k=!0);s(l.a,a.a)&&(D(f,J(l)),f=V(g,null),k=!0);k?W(a,c,f.d,e,e,!0):(t(l.a,n.a)?d=J(l):d=n,d=L(f.d.b,d),W(a,c,d,d.d,d.d,!1),d.b.j.b=!0,Fa(a,c))}else W(a,c,e.d,f,f,!0)} | ||
function Na(a,b){var c=new Aa,d=ea(a.b);d.a.b=R;d.a.a=b;z(d).b=-R;z(d).a=b;a.a=z(d);c.h=d;c.e=0;c.c=!1;c.b=!1;c.g=!0;c.a=!1;d=a.k;d=Ba(d,d.a,c);c.d=d};function Oa(a){this.a=new Pa;this.a.a=this.a;this.a.c=this.a;this.b=a;this.c=va}function Ba(a,b,c){do b=b.c;while(null!==b.b&&!a.c(a.b,b.b,c));a=new Pa;a.b=c;a.a=b.a;b.a.c=a;a.c=b;return b.a=a};function Pa(){this.c=this.a=this.b=null};function Qa(){this.f=[0,0,0];this.a=null};function Z(){this.e=0;this.G=this.b=this.p=null;this.i=[0,0,0];this.L=[0,0,0];this.l=[0,0,0];this.H=0;this.B=100130;this.A=!1;this.D=this.a=this.j=this.k=null;this.n=this.o=!1;this.d=this.C=this.F=this.u=this.x=this.s=this.q=this.w=this.v=this.y=this.t=this.r=this.m=null;this.z=!1;this.c=0;this.g=Array(100);for(var a=0;100>a;a++)this.g[a]=new Qa}m=Z.prototype;m.M=function(){$(this,0)}; | ||
m.R=function(a,b){switch(a){case 100142:if(0>b||1<b)break;this.H=b;return;case 100140:switch(b){case 100130:case 100131:case 100132:case 100133:case 100134:this.B=b;return}break;case 100141:this.n=!!b;return;default:X(this,100900);return}X(this,100901)};m.N=function(a){switch(a){case 100142:return this.H;case 100140:return this.B;case 100141:return this.n;default:X(this,100900)}return!1};m.Q=function(a,b,c){this.i[0]=a;this.i[1]=b;this.i[2]=c}; | ||
m.O=function(a,b){var c=b?b:null;switch(a){case 100100:this.r=c;break;case 100106:this.q=c;break;case 100104:this.t=c;this.o=!!c;break;case 100110:this.s=c;this.o=!!c;break;case 100101:this.y=c;break;case 100107:this.x=c;break;case 100102:this.v=c;break;case 100108:this.u=c;break;case 100103:this.G=c;break;case 100109:this.F=c;break;case 100105:this.D=c;break;case 100111:this.C=c;break;case 100112:this.w=c;break;default:X(this,100900)}}; | ||
m.S=function(a,b){var c=!1,d=[0,0,0];$(this,2);this.z&&(Ra(this),this.p=null);for(var e=0;3>e;++e){var f=a[e];-1E150>f&&(f=-1E150,c=!0);1E150<f&&(f=1E150,c=!0);d[e]=f}c&&X(this,100155);if(null===this.b){if(100>this.c){c=this.g[this.c];c.a=b;c.f[0]=d[0];c.f[1]=d[1];c.f[2]=d[2];++this.c;return}Ra(this)}Sa(this,d,b)};m.J=function(a){$(this,0);this.e=1;this.c=0;this.z=!1;this.b=null;this.d=a};m.I=function(){$(this,1);this.e=2;this.p=null;0<this.c&&(this.z=!0)};m.K=function(){$(this,2);this.e=1}; | ||
m.P=function(){$(this,1);this.e=0;if(null===this.b){if(!this.o&&!this.w&&la(this)){this.d=null;return}Ra(this)}var a=!1,b=[0,0,0];b[0]=this.i[0];b[1]=this.i[1];b[2]=this.i[2];if(0===b[0]&&0===b[1]&&0===b[2]){var c=[0,0,0],d=[0,0,0],a=[0,0,0],e=[0,0,0],f=[0,0,0];c[0]=c[1]=c[2]=-2*1E150;d[0]=d[1]=d[2]=2*1E150;var g=Array(3),n=Array(3),l,k,h=this.b.c;for(k=h.e;k!==h;k=k.e)for(l=0;3>l;++l){var p=k.f[l];p<d[l]&&(d[l]=p,n[l]=k);p>c[l]&&(c[l]=p,g[l]=k)}l=0;c[1]-d[1]>c[0]-d[0]&&(l=1);c[2]-d[2]>c[l]-d[l]&& | ||
(l=2);if(d[l]>=c[l])b[0]=0,b[1]=0,b[2]=1;else{c=0;k=n[l];g=g[l];a[0]=k.f[0]-g.f[0];a[1]=k.f[1]-g.f[1];a[2]=k.f[2]-g.f[2];for(k=h.e;k!==h;k=k.e)e[0]=k.f[0]-g.f[0],e[1]=k.f[1]-g.f[1],e[2]=k.f[2]-g.f[2],f[0]=a[1]*e[2]-a[2]*e[1],f[1]=a[2]*e[0]-a[0]*e[2],f[2]=a[0]*e[1]-a[1]*e[0],l=f[0]*f[0]+f[1]*f[1]+f[2]*f[2],l>c&&(c=l,b[0]=f[0],b[1]=f[1],b[2]=f[2]);0>=c&&(b[0]=b[1]=b[2]=0,b[ka(a)]=1)}a=!0}e=this.L;f=this.l;h=ka(b);e[h]=0;e[(h+1)%3]=1;e[(h+2)%3]=0;f[h]=0;f[(h+1)%3]=0<b[h]?-0:0;f[(h+2)%3]=0<b[h]?1:-1; | ||
b=this.b.c;for(h=b.e;h!==b;h=h.e)h.b=ja(h.f,e),h.a=ja(h.f,f);if(a){b=0;a=this.b.a;for(e=a.a;e!==a;e=e.a)if(f=e.b,!(0>=f.g)){do b+=(f.a.b-z(f).b)*(f.a.a+z(f).a),f=f.e;while(f!==e.b)}if(0>b){b=this.b.c;for(a=b.e;a!==b;a=a.e)a.a=-a.a;this.l[0]=-this.l[0];this.l[1]=-this.l[1];this.l[2]=-this.l[2]}}this.A=!1;b=this.b.b;for(e=b.i;e!==b;e=a)if(a=e.i,f=e.e,s(e.a,z(e))&&e.e.e!==e&&(Y(this,f,e),H(e),e=f,f=e.e),f.e===e){if(f!==e){if(f===a||f===a.b)a=a.i;H(f)}if(e===a||e===a.b)a=a.i;H(e)}this.j=b=new Ta;a=this.b.c; | ||
for(e=a.e;e!==a;e=e.e)e.i=La(b,e);Ua(b);this.k=new Oa(this);Na(this,-R);for(Na(this,R);null!==(b=Va(this.j));){for(;;){a:if(a=this.j,0===a.a)a=Wa(a.b);else{e=a.c[a.d[a.a-1]];if(0!==a.b.b&&(f=Wa(a.b),a.g(f,e))){a=f;break a}a=e}if(null===a||!s(a,b))break;a=Va(this.j);Y(this,b.c,a.c)}Ma(this,b)}this.a=this.k.a.a.b.h.a;for(b=0;null!==(a=this.k.a.a.b);)a.g||++b,S(a);this.k=null;b=this.j;a=b.b;a.a=null;a.c=null;b.b=null;b.d=null;this.j=b.c=null;b=this.b;for(e=b.a.a;e!==b.a;e=a)a=e.a,e=e.b,e.e.e===e&&(ua(e.d, | ||
e),H(e));if(!this.A){if(this.n)for(b=this.b,e=b.b.i;e!==b.b;e=a)a=e.i,I(e).c!==e.c.c?e.g=e.c.c?1:-1:H(e);else for(b=this.b,e=b.a.a;e!==b.a;e=a)if(a=e.a,e.c){for(e=e.b;t(z(e),e.a);e=e.d.b);for(;t(e.a,z(e));e=e.e);f=e.d.b;for(h=void 0;e.e!==f;)if(t(z(e),f.a)){for(;f.e!==e&&(ca(f.e)||0>=w(f.a,z(f),z(f.e)));)h=L(f.e,f),f=h.b;f=f.d.b}else{for(;f.e!==e&&(da(e.d.b)||0<=w(z(e),e.a,e.d.b.a));)h=L(e,e.d.b),e=h.b;e=e.e}for(;f.e.e!==e;)h=L(f.e,f),f=h.b}if(this.r||this.v||this.y||this.t||this.q||this.u||this.x|| | ||
this.s)if(this.n)for(b=this.b,a=b.a.a;a!==b.a;a=a.a){if(a.c){N(this,2);e=a.b;do O(this,e.a.d),e=e.e;while(e!==a.b);P(this)}}else{b=this.b;this.m=null;for(a=b.a.a;a!==b.a;a=a.a)a.d=!1;for(a=b.a.a;a!==b.a;a=a.a)a.c&&!a.d&&(e=a.b,f=new pa(1,e,ta),h=void 0,this.o||(h=oa(e),h.a>f.a&&(f=h),h=oa(e.e),h.a>f.a&&(f=h),h=oa(e.d.b),h.a>f.a&&(f=h),h=ra(e),h.a>f.a&&(f=h),h=ra(e.e),h.a>f.a&&(f=h),h=ra(e.d.b),h.a>f.a&&(f=h)),f.c(this,f.b,f.a));if(null!==this.m){b=-1;a=this.m;for(N(this,4);null!==a;a=a.e){e=a.b;do this.o&& | ||
(f=I(e).c?0:1,b!==f&&(b=f,f=!!b,this.s?this.s(f,this.d):this.t&&this.t(f))),O(this,e.a.d),e=e.e;while(e!==a.b)}P(this);this.m=null}}if(this.w){b=this.b;for(e=b.a.a;e!==b.a;e=a)if(a=e.a,!e.c){f=e.b;h=f.e;k=void 0;do k=h,h=k.e,k.c=null,null===I(k)&&(k.d===k?E(k.a,null):(k.a.c=k.d,G(k,J(k))),g=k.b,g.d===g?E(g.a,null):(g.a.c=g.d,G(g,J(g))),ga(k));while(k!==f);f=e.g;e=e.a;e.g=f;f.a=e}this.w(this.b);this.d=this.b=null;return}}this.b=this.d=null}; | ||
function $(a,b){if(a.e!==b)for(;a.e!==b;)if(a.e<b)switch(a.e){case 0:X(a,100151);a.J(null);break;case 1:X(a,100152),a.I()}else switch(a.e){case 2:X(a,100154);a.K();break;case 1:X(a,100153);var c=a;c.e=0;c.p=null;c.b=null}}function Sa(a,b,c){var d=a.p;null===d?(d=ea(a.b),D(d,d.b)):(K(d),d=d.e);d.a.d=c;d.a.f[0]=b[0];d.a.f[1]=b[1];d.a.f[2]=b[2];d.g=1;d.b.g=-1;a.p=d}function Ra(a){a.b=new Xa;for(var b=0;b<a.c;b++){var c=a.g[b];Sa(a,c.f,c.a)}a.c=0;a.z=!1}function N(a,b){a.q?a.q(b,a.d):a.r&&a.r(b)} | ||
function O(a,b){a.x?a.x(b,a.d):a.y&&a.y(b)}function P(a){a.u?a.u(a.d):a.v&&a.v()}function X(a,b){a.F?a.F(b,a.d):a.G&&a.G(b)};function ia(a,b){this.a=a||this;this.g=b||this;this.e=this.b=null;this.c=this.d=!1};function M(){this.i=this;this.j=this.c=this.a=this.e=this.d=this.b=null;this.g=0}function I(a){return a.b.c}function z(a){return a.b.a}function J(a){return a.b.e};function Xa(){this.c=new ha;this.a=new ia;this.b=new M;this.d=new M;this.b.b=this.d;this.d.b=this.b};function ha(a,b){this.e=a||this;this.g=b||this;this.d=this.c=null;this.f=[0,0,0];this.a=this.b=0;this.i=null};function Ya(){this.a=null;this.b=0}function Za(a,b){var c=Array(b),d=0;if(null!==a)for(;d<a.length;d++)c[d]=a[d];for(;d<b;d++)c[d]=new Ya;return c};function $a(){this.a=0}function ab(a,b){var c=Array(b),d=0;if(null!==a)for(;d<a.length;d++)c[d]=a[d];for(;d<b;d++)c[d]=new $a;return c};function Ta(){this.c=bb(null,32);this.d=null;this.a=0;this.e=32;this.i=!1;this.g=t;this.b=new cb(this.g)}function Ua(a){a.d=[];for(var b=0;b<a.a;b++)a.d[b]=b;a.d.sort(function(a,b){return function(e,f){return b(a[e],a[f])?1:-1}}(a.c,a.g));a.e=a.a;a.i=!0;db(a.b)} | ||
function La(a,b){if(a.i){var c=a.b,d=++c.b;2*d>c.e&&(c.e*=2,c.c=ab(c.c,c.e+1),c.a=Za(c.a,c.e+1));var e;0===c.d?e=d:(e=c.d,c.d=c.a[e].b);c.c[d].a=e;c.a[e].b=d;c.a[e].a=b;c.i&&Ja(c,d);return e}c=a.a;++a.a>=a.e&&(a.e*=2,a.c=bb(a.c,a.e));a.c[c]=b;return-(c+1)}function bb(a,b){var c=Array(b),d=0;if(null!==a)for(;d<a.length;d++)c[d]=a[d];for(;d<b;d++)c[d]=null;return c} | ||
function Va(a){if(0===a.a)return eb(a.b);var b=a.c[a.d[a.a-1]];if(0!==a.b.b&&a.g(Wa(a.b),b))return eb(a.b);do--a.a;while(0<a.a&&null===a.c[a.d[a.a-1]]);return b};function cb(a){this.c=ab(null,33);this.a=Za(null,33);this.b=0;this.e=32;this.d=0;this.i=!1;this.g=a;this.c[1].a=1}function db(a){for(var b=a.b;1<=b;--b)Ia(a,b);a.i=!0}function Wa(a){return a.a[a.c[1].a].a}function eb(a){var b=a.c,c=a.a,d=b[1].a,e=c[d].a;0<a.b&&(b[1].a=b[a.b].a,c[b[1].a].b=1,c[d].a=null,c[d].b=a.d,a.d=d,0<--a.b&&Ia(a,1));return e} | ||
function Ia(a,b){for(var c=a.c,d=a.a,e=c[b].a;;){var f=b<<1;f<a.b&&a.g(d[c[f+1].a].a,d[c[f].a].a)&&++f;var g=c[f].a;if(f>a.b||a.g(d[e].a,d[g].a)){c[b].a=e;d[e].b=b;break}c[b].a=g;d[g].b=b;b=f}}function Ja(a,b){for(var c=a.c,d=a.a,e=c[b].a;;){var f=b>>1,g=c[f].a;if(0===f||a.g(d[g].a,d[e].a)){c[b].a=e;d[e].b=b;break}c[b].a=g;d[g].b=b;b=f}};function pa(a,b,c){this.a=a;this.b=b;this.c=c};function Aa(){this.d=this.h=null;this.e=0;this.b=this.a=this.g=this.c=!1}function U(a){return a.d.c.b}function T(a){return a.d.a.b};this.libtess={GluTesselator:Z,windingRule:{GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131,GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},primitiveType:{GL_LINE_LOOP:2,GL_TRIANGLES:4,GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},errorType:{GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156}, | ||
gluEnum:{GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901,GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111}};Z.prototype.gluDeleteTess=Z.prototype.M; | ||
Z.prototype.gluTessProperty=Z.prototype.R;Z.prototype.gluGetTessProperty=Z.prototype.N;Z.prototype.gluTessNormal=Z.prototype.Q;Z.prototype.gluTessCallback=Z.prototype.O;Z.prototype.gluTessVertex=Z.prototype.S;Z.prototype.gluTessBeginPolygon=Z.prototype.J;Z.prototype.gluTessBeginContour=Z.prototype.I;Z.prototype.gluTessEndContour=Z.prototype.K;Z.prototype.gluTessEndPolygon=Z.prototype.P; if (typeof module !== 'undefined') { module.exports = this.libtess; } |
{ | ||
"version": "1.0.2", | ||
"name": "libtess", | ||
"description": "Polygon tesselation library, ported from OpenGL Utility Library (GLU).", | ||
"author": "Brendan Kenny", | ||
"main": "./libtess.cat.js", | ||
"license": "SGI Free Sofware License B 2.0", | ||
"engines": { | ||
"node": ">=0.8.14" | ||
"version": "1.0.3", | ||
"description": "Polygon tesselation library, ported from SGI's GLU implementation.", | ||
"homepage": "https://github.com/brendankenny/libtess.js/", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/brendankenny/libtess.js.git" | ||
}, | ||
"main": "libtess.min.js", | ||
"scripts": { | ||
"prepublish": "gulp prepublish" | ||
}, | ||
"author": "Brendan Kenny <bckenny@google.com>", | ||
"contributors": [ | ||
"Tom Payne <twpayne@gmail.com>" | ||
], | ||
"license": "SGI-B-2.0", | ||
"bugs": "https://github.com/brendankenny/libtess.js/issues", | ||
"keywords": [ | ||
"polygon", | ||
"tesselation", | ||
"tessellation", | ||
"triangulation", | ||
"GLUtesselator" | ||
], | ||
"devDependencies": { | ||
"closurecompiler": "^1.3.2", | ||
"gulp": "^3.8.8", | ||
"gulp-closure-compiler": "^0.2.5", | ||
"gulp-concat": "^2.4.1", | ||
"gulp-replace": "^0.4.0" | ||
} | ||
} |
# libtess.js | ||
## License Information | ||
Polygon tesselation library, ported from the tesselator in Silicon Graphics's | ||
[reference implementation](http://oss.sgi.com/projects/ogl-sample/index.html) of | ||
the OpenGL Utility Library (GLU), written primarily by | ||
[Eric Veach](https://www.youtube.com/watch?v=e3ss_Ozb9Yg) while at SGI. | ||
The below SGI license is somewhat unusual, but the | ||
[FSF has helped](http://www.fsf.org/blogs/licensing/2008-09-sgi-announcement) | ||
bring it into compliance with modern free software licenses, with terms | ||
identical to that of the X11 License. More guidance [here](http://www.gnu.org/licenses/license-list.html#SGIFreeB). | ||
## Example | ||
See the [example page](https://brendankenny.github.io/libtess.js/examples/simple_triangulation/index.html) | ||
for a simple example of setting up a polygon with a hole made of two contours, | ||
triangulating it, and then drawing it with WebGL. | ||
## License | ||
[SGI Free Sofware License B 2.0](http://oss.sgi.com/projects/FreeB/) | ||
Copyright 2000, Silicon Graphics, Inc. All Rights Reserved. | ||
Copyright 2012, Google Inc. All Rights Reserved. | ||
## Tesselator or Tessellator? | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to | ||
deal in the Software without restriction, including without limitation the | ||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
sell copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
Probably tessellator, but `GLUtesselator`, etc is in the original GLU API handed | ||
down from Ancient Times and "tesselator" is already all over the original source | ||
code, so that's what we're going with. | ||
The above copyright notice including the dates of first publication and | ||
either this permission notice or a reference to http://oss.sgi.com/projects/FreeB/ | ||
shall be included in all copies or substantial portions of the Software. | ||
## License | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR | ||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
Licensed under the [SGI Free Software License B v2.0](LICENSE). | ||
Original Code. The Original Code is: OpenGL Sample Implementation, | ||
Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, | ||
Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. | ||
Copyright in any portions created by third parties is as indicated | ||
elsewhere herein. All Rights Reserved. | ||
@author Eric Veach, July 1994 | ||
@author Brendan Kenny | ||
This SGI license is not a common one, but the | ||
[FSF has helped](https://www.fsf.org/blogs/licensing/2008-09-sgi-announcement) | ||
bring it into equivalence with modern free software licenses, with terms | ||
identical to that of the X11 License (MIT + "no-endorsement" clause). More | ||
guidance [here](https://www.gnu.org/licenses/license-list.html#SGIFreeB). |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -47,3 +42,2 @@ /*global libtess */ | ||
/** | ||
@@ -50,0 +44,0 @@ * [Dict description] |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -42,4 +37,2 @@ // require libtess.Dict | ||
/** | ||
@@ -46,0 +39,0 @@ * [DictNode description] |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// TODO(bckenny): get rid of this: | ||
@@ -37,0 +32,0 @@ // NOTE(bckenny): using NO_BRANCH_CONDITIONS = false |
/** | ||
* @license | ||
* Copyright 2000, Silicon Graphics, Inc. All Rights Reserved. | ||
* Copyright 2012, Google Inc. All Rights Reserved. | ||
* Copyright 2014, Google Inc. All Rights Reserved. | ||
* | ||
@@ -35,3 +36,2 @@ * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
/** | ||
@@ -44,9 +44,2 @@ * Base namespace. | ||
/** | ||
* node.js export | ||
*/ | ||
if (typeof module !== 'undefined') | ||
module.exports = libtess; | ||
/** | ||
* @define {boolean} [DEBUG description]. | ||
@@ -152,3 +145,2 @@ */ | ||
// NOTE(bckenny): values from enumglu.spec | ||
// TODO(bckenny): need to export when compiled | ||
GLU_TESS_WINDING_ODD: 100130, | ||
@@ -171,3 +163,2 @@ GLU_TESS_WINDING_NONZERO: 100131, | ||
// TODO(bckenny): doc types | ||
// TODO(bckenny): need to export when compiled, but can just use webgl constants when available | ||
GL_LINE_LOOP: 2, | ||
@@ -174,0 +165,0 @@ GL_TRIANGLES: 4, |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -37,0 +32,0 @@ /*global libtess */ |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -37,0 +32,0 @@ // require libtess.mesh |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -37,0 +32,0 @@ // require libtess.GluFace |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -37,0 +32,0 @@ // requre libtess.GluHalfEdge |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -37,0 +32,0 @@ // require libtess.GluFace |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess.GluFace | ||
@@ -37,0 +32,0 @@ // require libtess.GluHalfEdge |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// requre libtess.GluHalfEdge | ||
@@ -37,0 +32,0 @@ /*global libtess */ |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -37,0 +32,0 @@ // require libtess.GluTesselator |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -37,0 +32,0 @@ /*global libtess */ |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -37,0 +32,0 @@ /*global libtess */ |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -37,0 +32,0 @@ // require libtess.PriorityQHeap |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -37,0 +32,0 @@ // require libtess.PQNode |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -37,0 +32,0 @@ // require libtess.CachedVertex |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -37,0 +32,0 @@ // require libtess.GluHalfEdge |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess.mesh | ||
@@ -37,0 +32,0 @@ // require libtess.geom |
@@ -30,8 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -38,0 +32,0 @@ // require libtess.DictNode |
@@ -30,7 +30,2 @@ /** | ||
/** | ||
* @author ericv@cs.stanford.edu (Eric Veach) | ||
* @author bckenny@google.com (Brendan Kenny) | ||
*/ | ||
// require libtess | ||
@@ -37,0 +32,0 @@ // require libtess.geom |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
485605
35
0
13172
0
0
5
1
28
1