Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libtess

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libtess - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

63

libtess.min.js
/*
Copyright 2000, Silicon Graphics, Inc. All Rights Reserved.
Copyright 2014, Google Inc. All Rights Reserved.
Copyright 2015, Google Inc. All Rights Reserved.

@@ -30,32 +30,31 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

*/
'use strict';var k;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=b.b-a.b,f=c.b-b.b;return 0<d+f?d<f?b.a-a.a+d/(d+f)*(a.a-c.a):b.a-c.a+f/(d+f)*(c.a-a.a):0}function v(a,b,c){var d=b.b-a.b,f=c.b-b.b;return 0<d+f?(b.a-c.a)*d+(b.a-a.a)*f: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=b.a-a.a,f=c.a-b.a;return 0<d+f?d<f?b.b-a.b+d/(d+f)*(a.b-c.b):b.b-c.b+f/(d+f)*(c.b-a.b):0}
function ba(a,b,c){var d=b.a-a.a,f=c.a-b.a;return 0<d+f?(b.b-c.b)*d+(b.b-a.b)*f: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=B(a.b);C(b,a.c);C(b.b,a.c);D(b,a.a);return b}function E(a,b){var c=!1,d=!1;a!==b&&(b.a!==a.a&&(d=!0,F(b.a,a.a)),b.d!==a.d&&(c=!0,G(b.d,a.d)),H(b,a),d||(C(b,a.a),a.a.c=a),c||(D(b,a.d),a.d.a=a))}function I(a){var b=a.b,c=!1;a.d!==a.b.d&&(c=!0,G(a.d,a.b.d));a.c===a?F(a.a,null):(a.b.d.a=J(a),a.a.c=a.c,H(a,J(a)),c||D(a,a.d));b.c===b?(F(b.a,null),G(b.d,null)):(a.d.a=J(b),b.a.c=b.c,H(b,J(b)));fa(a)}
function K(a){var b=B(a),c=b.b;H(b,a.e);b.a=z(a);C(c,b.a);b.d=c.d=a.d;b=b.b;H(a.b,J(a.b));H(a.b,b);a.b.a=b.a;z(b).c=b.b;b.b.d=a.b.d;b.f=a.f;b.b.f=a.b.f;return b}function L(a,b){var c=!1,d=B(a),f=d.b;b.d!==a.d&&(c=!0,G(b.d,a.d));H(d,a.e);H(f,b);d.a=z(a);f.a=b.a;d.d=f.d=a.d;a.d.a=f;c||D(d,a.d);return d}function B(a){var b=new M,c=new M,d=a.b.h;c.h=d;d.b.h=b;b.h=a;a.b.h=c;b.b=c;b.c=b;b.e=c;c.b=b;c.c=c;return c.e=b}function H(a,b){var c=a.c,d=b.c;c.b.e=b;d.b.e=a;a.c=d;b.c=c}
function C(a,b){var c=b.f,d=new N(b,c);c.e=d;b.f=d;c=d.c=a;do c.a=d,c=c.c;while(c!==a)}function D(a,b){var c=b.d,d=new ga(b,c);c.b=d;b.d=d;d.a=a;d.c=b.c;c=a;do c.d=d,c=c.e;while(c!==a)}function fa(a){var b=a.h;a=a.b.h;b.b.h=a;a.b.h=b}function F(a,b){var c=a.c,d=c;do d.a=b,d=d.c;while(d!==c);c=a.f;d=a.e;d.f=c;c.e=d}function G(a,b){var c=a.a,d=c;do d.d=b,d=d.e;while(d!==c);c=a.d;d=a.b;d.d=c;c.b=d};function ha(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function ia(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};var O=4*1E150;function P(a,b){a.f+=b.f;a.b.f+=b.b.f}function ja(a,b,c){a=a.a;b=b.a;c=c.a;if(z(b)===a)return z(c)===a?t(b.a,c.a)?0>=v(z(c),b.a,c.a):0<=v(z(b),c.a,b.a):0>=v(z(c),a,c.a);if(z(c)===a)return 0<=v(z(b),a,b.a);b=u(z(b),a,b.a);a=u(z(c),a,c.a);return b>=a}function Q(a){a.a.i=null;var b=a.e;b.a.c=b.c;b.c.a=b.a;a.e=null}function R(a,b){I(a.a);a.c=!1;a.a=b;b.i=a}function S(a){var b=a.a.a;do a=T(a);while(a.a.a===b);a.c&&(b=L(U(a).a.b,a.a.e),R(a,b),a=T(a));return a}
function ka(a,b,c){var d=new V;d.a=c;d.e=la(a.h,b.e,d);return c.i=d}function ma(a,b){switch(a.x){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 na(a){var b=a.a,c=b.d;c.c=a.d;c.a=b;Q(a)}function W(a,b){for(var c=a,d=a.a;c!==b;){c.c=!1;var f=U(c),g=f.a;if(g.a!==d.a){if(!f.c){na(c);break}g=L(d.c.b,g.b);R(f,g)}d.c!==g&&(E(J(g),g),E(d,g));na(c);d=f.a;c=f}return d}
function X(a,b,c,d,f,g){var e=!0;do ka(a,b,c.b),c=c.c;while(c!==d);for(null===f&&(f=U(b).a.b.c);;){d=U(b);c=d.a.b;if(c.a!==f.a)break;c.c!==f&&(E(J(c),c),E(J(f),c));d.f=b.f-c.f;d.d=ma(a,d.f);b.b=!0;!e&&oa(a,b)&&(P(c,f),Q(b),I(f));e=!1;b=d;f=c}b.b=!0;g&&pa(a,b)}function qa(a,b,c,d,f){var g=[b.g[0],b.g[1],b.g[2]];b.d=null;var e;a.z?e=a.z(g,c,d,a.c):a.A&&(e=a.A(g,c,d));void 0===e&&(e=null);b.d=e;null===b.d&&(f?a.v||(Y(a,100156),a.v=!0):b.d=c[0])}
function ra(a,b,c){var d=[null,null,null,null];d[0]=b.a.d;d[1]=c.a.d;qa(a,b.a,d,[.5,.5,0,0],!1);E(b,c)}function sa(a,b,c,d,f){var g=Math.abs(b.b-a.b)+Math.abs(b.a-a.a),e=Math.abs(c.b-a.b)+Math.abs(c.a-a.a),h=f+1;d[f]=.5*e/(g+e);d[h]=.5*g/(g+e);a.g[0]+=d[f]*b.g[0]+d[h]*c.g[0];a.g[1]+=d[f]*b.g[1]+d[h]*c.g[1];a.g[2]+=d[f]*b.g[2]+d[h]*c.g[2]}
function oa(a,b){var c=U(b),d=b.a,f=c.a;if(t(d.a,f.a)){if(0<v(z(f),d.a,f.a))return!1;if(!s(d.a,f.a))K(f.b),E(d,J(f)),b.b=c.b=!0;else if(d.a!==f.a){var c=a.e,g=d.a.h;if(0<=g){var c=c.b,e=c.c,h=c.a,l=h[g].b;e[l].a=e[c.b].a;h[e[l].a].b=l;l<=--c.b&&(1>=l||c.f(h[e[l>>1].a].a,h[e[l].a].a)?ta(c,l):ua(c,l));h[g].a=null;h[g].b=c.d;c.d=g}else for(c.c[-(g+1)]=null;0<c.a&&null===c.c[c.d[c.a-1]];)--c.a;ra(a,J(f),d)}}else{if(0>v(z(d),f.a,d.a))return!1;T(b).b=b.b=!0;K(d.b);E(J(f),d)}return!0}
function va(a,b){var c=U(b),d=b.a,f=c.a,g=d.a,e=f.a,h=z(d),l=z(f),n=new N;v(h,a.a,g);v(l,a.a,e);if(g===e||Math.min(g.a,h.a)>Math.max(e.a,l.a))return!1;if(t(g,e)){if(0<v(l,g,e))return!1}else if(0>v(h,e,g))return!1;var r=h,p=g,q=l,y=e,m,w;t(r,p)||(m=r,r=p,p=m);t(q,y)||(m=q,q=y,y=m);t(r,q)||(m=r,r=q,q=m,m=p,p=y,y=m);t(q,p)?t(p,y)?(m=u(r,q,p),w=u(q,p,y),0>m+w&&(m=-m,w=-w),n.b=A(m,q.b,w,p.b)):(m=v(r,q,p),w=-v(r,y,p),0>m+w&&(m=-m,w=-w),n.b=A(m,q.b,w,y.b)):n.b=(q.b+p.b)/2;x(r,p)||(m=r,r=p,p=m);x(q,y)||(m=
q,q=y,y=m);x(r,q)||(m=r,r=q,q=m,m=p,p=y,y=m);x(q,p)?x(p,y)?(m=aa(r,q,p),w=aa(q,p,y),0>m+w&&(m=-m,w=-w),n.a=A(m,q.a,w,p.a)):(m=ba(r,q,p),w=-ba(r,y,p),0>m+w&&(m=-m,w=-w),n.a=A(m,q.a,w,y.a)):n.a=(q.a+p.a)/2;t(n,a.a)&&(n.b=a.a.b,n.a=a.a.a);r=t(g,e)?g:e;t(r,n)&&(n.b=r.b,n.a=r.a);if(s(n,g)||s(n,e))return oa(a,b),!1;if(!s(h,a.a)&&0<=v(h,a.a,n)||!s(l,a.a)&&0>=v(l,a.a,n)){if(l===a.a)return K(d.b),E(f.b,d),b=S(b),d=U(b).a,W(U(b),c),X(a,b,J(d),d,d,!0),!0;if(h===a.a){K(f.b);E(d.e,J(f));g=c=b;e=z(g.a);do g=T(g);
while(z(g.a)===e);b=g;g=U(b).a.b.c;c.a=J(f);f=W(c,null);X(a,b,f.c,d.b.c,g,!0);return!0}0<=v(h,a.a,n)&&(T(b).b=b.b=!0,K(d.b),d.a.b=a.a.b,d.a.a=a.a.a);0>=v(l,a.a,n)&&(b.b=c.b=!0,K(f.b),f.a.b=a.a.b,f.a.a=a.a.a);return!1}K(d.b);K(f.b);E(J(f),d);d.a.b=n.b;d.a.a=n.a;d.a.h=wa(a.e,d.a);d=d.a;f=[0,0,0,0];n=[g.d,h.d,e.d,l.d];d.g[0]=d.g[1]=d.g[2]=0;sa(d,g,h,f,0);sa(d,e,l,f,2);qa(a,d,n,f,!0);T(b).b=b.b=c.b=!0;return!1}
function pa(a,b){for(var c=U(b);;){for(;c.b;)b=c,c=U(c);if(!b.b&&(c=b,b=T(b),null===b||!b.b))break;b.b=!1;var d=b.a,f=c.a,g;if(g=z(d)!==z(f))a:{g=b;var e=U(g),h=g.a,l=e.a,n=void 0;if(t(z(h),z(l))){if(0>v(z(h),z(l),h.a)){g=!1;break a}T(g).b=g.b=!0;n=K(h);E(l.b,n);n.d.c=g.d}else{if(0<v(z(l),z(h),l.a)){g=!1;break a}g.b=e.b=!0;n=K(l);E(h.e,l.b);n.b.d.c=g.d}g=!0}g&&(c.c?(Q(c),I(f),c=U(b),f=c.a):b.c&&(Q(b),I(d),b=T(c),d=b.a));if(d.a!==f.a)if(z(d)===z(f)||b.c||c.c||z(d)!==a.a&&z(f)!==a.a)oa(a,b);else if(va(a,
b))break;d.a===f.a&&z(d)===z(f)&&(P(f,d),Q(b),I(d),b=T(c))}}
function xa(a,b){a.a=b;for(var c=b.c;null===c.i;)if(c=c.c,c===b.c){var c=a,d=b,f=new V;f.a=d.c.b;var g=c.h,e=g.a;do e=e.a;while(null!==e.b&&!g.c(g.b,f,e.b));var g=e.b,h=U(g),f=g.a,e=h.a;if(0===v(z(f),d,f.a))f=g.a,s(f.a,d)||s(z(f),d)||(K(f.b),g.c&&(I(f.c),g.c=!1),E(d.c,f),xa(c,d));else{var l=t(z(e),z(f))?g:h,h=void 0;g.d||l.c?(l===g?h=L(d.c.b,f.e):h=L(e.b.c.b,d.c).b,l.c?R(l,h):(f=c,g=ka(c,g,h),g.f=T(g).f+g.a.f,g.d=ma(f,g.f)),xa(c,d)):X(c,g,d.c,d.c,null,!0)}return}c=S(c.i);f=U(c);g=f.a;f=W(f,null);
if(f.c===g){var g=f,f=g.c,e=U(c),h=c.a,l=e.a,n=!1;z(h)!==z(l)&&va(a,c);s(h.a,a.a)&&(E(J(f),h),c=S(c),f=U(c).a,W(U(c),e),n=!0);s(l.a,a.a)&&(E(g,J(l)),g=W(e,null),n=!0);n?X(a,c,g.c,f,f,!0):(t(l.a,h.a)?d=J(l):d=h,d=L(g.c.b,d),X(a,c,d,d.c,d.c,!1),d.b.i.c=!0,pa(a,c))}else X(a,c,f.c,g,g,!0)}function ya(a,b){var c=new V,d=ea(a.b);d.a.b=O;d.a.a=b;z(d).b=-O;z(d).a=b;a.a=z(d);c.a=d;c.f=0;c.d=!1;c.c=!1;c.h=!0;c.b=!1;d=a.h;d=la(d,d.a,c);c.e=d};function za(a){this.a=new Aa;this.b=a;this.c=ja}function la(a,b,c){do b=b.c;while(null!==b.b&&!a.c(a.b,b.b,c));a=new Aa(c,b.a,b);b.a.c=a;return b.a=a};function Aa(a,b,c){this.b=a||null;this.a=b||this;this.c=c||this};function Ba(){this.g=[0,0,0];this.a=null};function Z(){this.d=0;this.C=this.b=this.q=null;this.n=[0,0,0];this.I=[0,0,0];this.i=[0,0,0];this.D=0;this.x=100130;this.v=!1;this.A=this.a=this.e=this.h=null;this.r=!1;this.c=this.z=this.B=this.s=this.l=this.o=this.j=this.w=this.t=this.m=this.p=this.k=null;this.u=!1;this.f=0;this.y=Array(100);for(var a=0;100>a;a++)this.y[a]=new Ba}k=Z.prototype;k.J=function(){$(this,0)};
k.O=function(a,b){switch(a){case 100142:if(0>b||1<b)break;this.D=b;return;case 100140:switch(b){case 100130:case 100131:case 100132:case 100133:case 100134:this.x=b;return}break;case 100141:this.r=!!b;return;default:Y(this,100900);return}Y(this,100901)};k.K=function(a){switch(a){case 100142:return this.D;case 100140:return this.x;case 100141:return this.r;default:Y(this,100900)}return!1};k.N=function(a,b,c){this.n[0]=a;this.n[1]=b;this.n[2]=c};
k.L=function(a,b){var c=b?b:null;switch(a){case 100100:this.k=c;break;case 100106:this.j=c;break;case 100104:this.p=c;break;case 100110:this.o=c;break;case 100101:this.m=c;break;case 100107:this.l=c;break;case 100102:this.t=c;break;case 100108:this.s=c;break;case 100103:this.C=c;break;case 100109:this.B=c;break;case 100105:this.A=c;break;case 100111:this.z=c;break;case 100112:this.w=c;break;default:Y(this,100900)}};
k.P=function(a,b){var c=!1,d=[0,0,0];$(this,2);this.u&&(Ca(this),this.q=null);for(var f=0;3>f;++f){var g=a[f];-1E150>g&&(g=-1E150,c=!0);1E150<g&&(g=1E150,c=!0);d[f]=g}c&&Y(this,100155);if(null===this.b){if(100>this.f){c=this.y[this.f];c.a=b;c.g[0]=d[0];c.g[1]=d[1];c.g[2]=d[2];++this.f;return}Ca(this)}Da(this,d,b)};k.G=function(a){$(this,0);this.d=1;this.f=0;this.u=!1;this.b=null;this.c=a};k.F=function(){$(this,1);this.d=2;this.q=null;0<this.f&&(this.u=!0)};k.H=function(){$(this,2);this.d=1};
k.M=function(){$(this,1);this.d=0;null===this.b&&Ca(this);var a=!1,b=[this.n[0],this.n[1],this.n[2]];if(0===b[0]&&0===b[1]&&0===b[2]){var c=[-2*1E150,-2*1E150,-2*1E150],d=[2*1E150,2*1E150,2*1E150],f=[],g=[],e,a=this.b.c;for(e=a.e;e!==a;e=e.e)for(var h=0;3>h;++h){var l=e.g[h];l<d[h]&&(d[h]=l,g[h]=e);l>c[h]&&(c[h]=l,f[h]=e)}e=0;c[1]-d[1]>c[0]-d[0]&&(e=1);c[2]-d[2]>c[e]-d[e]&&(e=2);if(d[e]>=c[e])b[0]=0,b[1]=0,b[2]=1;else{c=0;d=g[e];f=f[e];g=[0,0,0];d=[d.g[0]-f.g[0],d.g[1]-f.g[1],d.g[2]-f.g[2]];h=[0,
0,0];for(e=a.e;e!==a;e=e.e)h[0]=e.g[0]-f.g[0],h[1]=e.g[1]-f.g[1],h[2]=e.g[2]-f.g[2],g[0]=d[1]*h[2]-d[2]*h[1],g[1]=d[2]*h[0]-d[0]*h[2],g[2]=d[0]*h[1]-d[1]*h[0],l=g[0]*g[0]+g[1]*g[1]+g[2]*g[2],l>c&&(c=l,b[0]=g[0],b[1]=g[1],b[2]=g[2]);0>=c&&(b[0]=b[1]=b[2]=0,b[ia(d)]=1)}a=!0}e=this.I;c=this.i;f=ia(b);e[f]=0;e[(f+1)%3]=1;e[(f+2)%3]=0;c[f]=0;c[(f+1)%3]=0<b[f]?-0:0;c[(f+2)%3]=0<b[f]?1:-1;b=this.b.c;for(f=b.e;f!==b;f=f.e)f.b=ha(f.g,e),f.a=ha(f.g,c);if(a){b=0;a=this.b.a;for(e=a.b;e!==a;e=e.b)if(c=e.a,!(0>=
c.f)){do b+=(c.a.b-z(c).b)*(c.a.a+z(c).a),c=c.e;while(c!==e.a)}if(0>b){b=this.b.c;for(a=b.e;a!==b;a=a.e)a.a=-a.a;this.i[0]=-this.i[0];this.i[1]=-this.i[1];this.i[2]=-this.i[2]}}this.v=!1;b=this.b.b;for(e=b.h;e!==b;e=a)if(a=e.h,c=e.e,s(e.a,z(e))&&e.e.e!==e&&(ra(this,c,e),I(e),e=c,c=e.e),c.e===e){if(c!==e){if(c===a||c===a.b)a=a.h;I(c)}if(e===a||e===a.b)a=a.h;I(e)}this.e=b=new Ea;a=this.b.c;for(e=a.e;e!==a;e=e.e)e.h=wa(b,e);Fa(b);this.h=new za(this);ya(this,-O);for(ya(this,O);null!==(b=Ga(this.e));){for(;;){a:if(a=
this.e,0===a.a)a=Ha(a.b);else{e=a.c[a.d[a.a-1]];if(0!==a.b.b&&(c=Ha(a.b),a.f(c,e))){a=c;break a}a=e}if(null===a||!s(a,b))break;a=Ga(this.e);ra(this,b.c,a.c)}xa(this,b)}this.a=this.h.a.a.b.a.a;for(b=0;null!==(a=this.h.a.a.b);)a.h||++b,Q(a);this.h=null;b=this.e;a=b.b;a.a=null;a.c=null;b.b=null;b.d=null;this.e=b.c=null;b=this.b;for(e=b.a.b;e!==b.a;e=a)a=e.b,e=e.a,e.e.e===e&&(P(e.c,e),I(e));if(!this.v){b=this.b;if(this.r)for(e=b.b.h;e!==b.b;e=a)a=e.h,e.b.d.c!==e.d.c?e.f=e.d.c?1:-1:I(e);else for(e=b.a.b;e!==
b.a;e=a)if(a=e.b,e.c){for(e=e.a;t(z(e),e.a);e=e.c.b);for(;t(e.a,z(e));e=e.e);c=e.c.b;for(f=void 0;e.e!==c;)if(t(z(e),c.a)){for(;c.e!==e&&(ca(c.e)||0>=v(c.a,z(c),z(c.e)));)f=L(c.e,c),c=f.b;c=c.c.b}else{for(;c.e!==e&&(da(e.c.b)||0<=v(z(e),e.a,e.c.b.a));)f=L(e,e.c.b),e=f.b;e=e.e}for(;c.e.e!==e;)f=L(c.e,c),c=f.b}if(this.k||this.t||this.m||this.p||this.j||this.s||this.l||this.o)if(this.r)for(b=this.b,a=b.a.b;a!==b.a;a=a.b){if(a.c){this.j?this.j(2,this.c):this.k&&this.k(2);e=a.a;do c=e.a.d,this.l?this.l(c,
this.c):this.m&&this.m(c),e=e.e;while(e!==a.a);Ia(this)}}else{b=this.b;a=!(!this.p&&!this.o);e=!1;c=-1;for(f=b.a.d;f!==b.a;f=f.d)if(f.c){e||(this.j?this.j(4,this.c):this.k&&this.k(4),e=!0);g=f.a;do a&&(d=g.b.d.c?0:1,c!==d&&(c=d,d=!!c,this.o?this.o(d,this.c):this.p&&this.p(d))),d=g.a.d,this.l?this.l(d,this.c):this.m&&this.m(d),g=g.e;while(g!==f.a)}e&&Ia(this)}if(this.w){b=this.b;for(e=b.a.b;e!==b.a;e=a)if(a=e.b,!e.c){c=e.a;f=c.e;g=void 0;do g=f,f=g.e,g.d=null,null===g.b.d&&(g.c===g?F(g.a,null):(g.a.c=
g.c,H(g,J(g))),d=g.b,d.c===d?F(d.a,null):(d.a.c=d.c,H(d,J(d))),fa(g));while(g!==c);c=e.d;e=e.b;e.d=c;c.b=e}this.w(this.b);this.c=this.b=null;return}}this.b=this.c=null};function $(a,b){if(a.d!==b)for(;a.d!==b;)if(a.d<b)switch(a.d){case 0:Y(a,100151);a.G(null);break;case 1:Y(a,100152),a.F()}else switch(a.d){case 2:Y(a,100154);a.H();break;case 1:Y(a,100153);var c=a;c.d=0;c.q=null;c.b=null}}
function Da(a,b,c){var d=a.q;null===d?(d=ea(a.b),E(d,d.b)):(K(d),d=d.e);d.a.d=c;d.a.g[0]=b[0];d.a.g[1]=b[1];d.a.g[2]=b[2];d.f=1;d.b.f=-1;a.q=d}function Ca(a){a.b=new Ja;for(var b=0;b<a.f;b++){var c=a.y[b];Da(a,c.g,c.a)}a.f=0;a.u=!1}function Ia(a){a.s?a.s(a.c):a.t&&a.t()}function Y(a,b){a.B?a.B(b,a.c):a.C&&a.C(b)};function ga(a,b){this.b=a||this;this.d=b||this;this.a=null;this.c=!1};function M(){this.h=this;this.i=this.d=this.a=this.e=this.c=this.b=null;this.f=0}function z(a){return a.b.a}function J(a){return a.b.e};function Ja(){this.c=new N;this.a=new ga;this.b=new M;this.d=new M;this.b.b=this.d;this.d.b=this.b};function N(a,b){this.e=a||this;this.f=b||this;this.d=this.c=null;this.g=[0,0,0];this.a=this.b=0;this.h=null};function Ka(){this.a=null;this.b=0}function La(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 Ka;return c};function Ma(){this.a=0}function Na(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 Ma;return c};function Ea(){this.c=Oa(null,32);this.d=null;this.a=0;this.e=32;this.h=!1;this.f=t;this.b=new Pa(this.f)}function Fa(a){a.d=[];for(var b=0;b<a.a;b++)a.d[b]=b;a.d.sort(function(a,b){return function(f,g){return b(a[f],a[g])?1:-1}}(a.c,a.f));a.e=a.a;a.h=!0;Qa(a.b)}
function wa(a,b){if(a.h){var c=a.b,d=++c.b;2*d>c.e&&(c.e*=2,c.c=Na(c.c,c.e+1),c.a=La(c.a,c.e+1));var f;0===c.d?f=d:(f=c.d,c.d=c.a[f].b);c.c[d].a=f;c.a[f].b=d;c.a[f].a=b;c.h&&ua(c,d);return f}c=a.a;++a.a>=a.e&&(a.e*=2,a.c=Oa(a.c,a.e));a.c[c]=b;return-(c+1)}function Oa(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 Ga(a){if(0===a.a)return Ra(a.b);var b=a.c[a.d[a.a-1]];if(0!==a.b.b&&a.f(Ha(a.b),b))return Ra(a.b);do--a.a;while(0<a.a&&null===a.c[a.d[a.a-1]]);return b};function Pa(a){this.c=Na(null,33);this.a=La(null,33);this.b=0;this.e=32;this.d=0;this.h=!1;this.f=a;this.c[1].a=1}function Qa(a){for(var b=a.b;1<=b;--b)ta(a,b);a.h=!0}function Ha(a){return a.a[a.c[1].a].a}function Ra(a){var b=a.c,c=a.a,d=b[1].a,f=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&&ta(a,1));return f}
function ta(a,b){for(var c=a.c,d=a.a,f=c[b].a;;){var g=b<<1;g<a.b&&a.f(d[c[g+1].a].a,d[c[g].a].a)&&++g;var e=c[g].a;if(g>a.b||a.f(d[f].a,d[e].a)){c[b].a=f;d[f].b=b;break}c[b].a=e;d[e].b=b;b=g}}function ua(a,b){for(var c=a.c,d=a.a,f=c[b].a;;){var g=b>>1,e=c[g].a;if(0===g||a.f(d[e].a,d[f].a)){c[b].a=f;d[f].b=b;break}c[b].a=e;d[e].b=b;b=g}};function V(){this.e=this.a=null;this.f=0;this.c=this.b=this.h=this.d=!1}function U(a){return a.e.c.b}function T(a){return a.e.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.J;
Z.prototype.gluTessProperty=Z.prototype.O;Z.prototype.gluGetTessProperty=Z.prototype.K;Z.prototype.gluTessNormal=Z.prototype.N;Z.prototype.gluTessCallback=Z.prototype.L;Z.prototype.gluTessVertex=Z.prototype.P;Z.prototype.gluTessBeginPolygon=Z.prototype.G;Z.prototype.gluTessBeginContour=Z.prototype.F;Z.prototype.gluTessEndContour=Z.prototype.H;Z.prototype.gluTessEndPolygon=Z.prototype.M; if (typeof module !== 'undefined') { module.exports = this.libtess; }
'use strict';var k;function t(a,b){return a.b===b.b&&a.a===b.a}function u(a,b){return a.b<b.b||a.b===b.b&&a.a<=b.a}function v(a,b,c){var d=b.b-a.b,f=c.b-b.b;return 0<d+f?d<f?b.a-a.a+d/(d+f)*(a.a-c.a):b.a-c.a+f/(d+f)*(c.a-a.a):0}function w(a,b,c){var d=b.b-a.b,f=c.b-b.b;return 0<d+f?(b.a-c.a)*d+(b.a-a.a)*f:0}function y(a,b){return a.a<b.a||a.a===b.a&&a.b<=b.b}function aa(a,b,c){var d=b.a-a.a,f=c.a-b.a;return 0<d+f?d<f?b.b-a.b+d/(d+f)*(a.b-c.b):b.b-c.b+f/(d+f)*(c.b-a.b):0}
function ba(a,b,c){var d=b.a-a.a,f=c.a-b.a;return 0<d+f?(b.b-c.b)*d+(b.b-a.b)*f:0}function ca(a){return u(A(a),a.a)}function da(a){return u(a.a,A(a))}function B(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=C(a.b);D(b,a.c);D(b.b,a.c);E(b,a.a);return b}function F(a,b){var c=!1,d=!1;a!==b&&(b.a!==a.a&&(d=!0,G(b.a,a.a)),b.d!==a.d&&(c=!0,H(b.d,a.d)),I(b,a),d||(D(b,a.a),a.a.c=a),c||(E(b,a.d),a.d.a=a))}function J(a){var b=a.b,c=!1;a.d!==a.b.d&&(c=!0,H(a.d,a.b.d));a.c===a?G(a.a,null):(a.b.d.a=K(a),a.a.c=a.c,I(a,K(a)),c||E(a,a.d));b.c===b?(G(b.a,null),H(b.d,null)):(a.d.a=K(b),b.a.c=b.c,I(b,K(b)));fa(a)}
function L(a){var b=C(a),c=b.b;I(b,a.e);b.a=A(a);D(c,b.a);b.d=c.d=a.d;b=b.b;I(a.b,K(a.b));I(a.b,b);a.b.a=b.a;A(b).c=b.b;b.b.d=a.b.d;b.f=a.f;b.b.f=a.b.f;return b}function M(a,b){var c=!1,d=C(a),f=d.b;b.d!==a.d&&(c=!0,H(b.d,a.d));I(d,a.e);I(f,b);d.a=A(a);f.a=b.a;d.d=f.d=a.d;a.d.a=f;c||E(d,a.d);return d}function C(a){var b=new N,c=new N,d=a.b.h;c.h=d;d.b.h=b;b.h=a;a.b.h=c;b.b=c;b.c=b;b.e=c;c.b=b;c.c=c;return c.e=b}function I(a,b){var c=a.c,d=b.c;c.b.e=b;d.b.e=a;a.c=d;b.c=c}
function D(a,b){var c=b.f,d=new O(b,c);c.e=d;b.f=d;c=d.c=a;do c.a=d,c=c.c;while(c!==a)}function E(a,b){var c=b.d,d=new ga(b,c);c.b=d;b.d=d;d.a=a;d.c=b.c;c=a;do c.d=d,c=c.e;while(c!==a)}function fa(a){var b=a.h;a=a.b.h;b.b.h=a;a.b.h=b}function G(a,b){var c=a.c,d=c;do d.a=b,d=d.c;while(d!==c);c=a.f;d=a.e;d.f=c;c.e=d}function H(a,b){var c=a.a,d=c;do d.d=b,d=d.e;while(d!==c);c=a.d;d=a.b;d.d=c;c.b=d};function ha(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function ia(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};var P=4*1E150;function Q(a,b){a.f+=b.f;a.b.f+=b.b.f}function ja(a,b,c){a=a.a;b=b.a;c=c.a;if(A(b)===a)return A(c)===a?u(b.a,c.a)?0>=w(A(c),b.a,c.a):0<=w(A(b),c.a,b.a):0>=w(A(c),a,c.a);if(A(c)===a)return 0<=w(A(b),a,b.a);b=v(A(b),a,b.a);a=v(A(c),a,c.a);return b>=a}function R(a){a.a.i=null;var b=a.e;b.a.c=b.c;b.c.a=b.a;a.e=null}function ka(a,b){J(a.a);a.c=!1;a.a=b;b.i=a}function la(a){var b=a.a.a;do a=S(a);while(a.a.a===b);a.c&&(b=M(T(a).a.b,a.a.e),ka(a,b),a=S(a));return a}
function ma(a,b,c){var d=new na;d.a=c;d.e=oa(a.f,b.e,d);return c.i=d}function pa(a,b){switch(a.z){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 qa(a){var b=a.a,c=b.d;c.c=a.d;c.a=b;R(a)}function U(a,b){for(var c=a,d=a.a;c!==b;){c.c=!1;var f=T(c),g=f.a;if(g.a!==d.a){if(!f.c){qa(c);break}g=M(d.c.b,g.b);ka(f,g)}d.c!==g&&(F(K(g),g),F(d,g));qa(c);d=f.a;c=f}return d}
function V(a,b,c,d,f,g){var e=!0;do ma(a,b,c.b),c=c.c;while(c!==d);for(null===f&&(f=T(b).a.b.c);;){d=T(b);c=d.a.b;if(c.a!==f.a)break;c.c!==f&&(F(K(c),c),F(K(f),c));d.f=b.f-c.f;d.d=pa(a,d.f);b.b=!0;!e&&ra(a,b)&&(Q(c,f),R(b),J(f));e=!1;b=d;f=c}b.b=!0;g&&sa(a,b)}function ta(a,b,c,d,f){var g=[b.g[0],b.g[1],b.g[2]];b.d=null;var e;a.u?e=a.u(g,c,d,a.c):a.v&&(e=a.v(g,c,d));void 0===e&&(e=null);b.d=e;null===b.d&&(f?a.s||(W(a,100156),a.s=!0):b.d=c[0])}
function ua(a,b,c){var d=[null,null,null,null];d[0]=b.a.d;d[1]=c.a.d;ta(a,b.a,d,[.5,.5,0,0],!1);F(b,c)}function va(a,b,c,d,f){var g=Math.abs(b.b-a.b)+Math.abs(b.a-a.a),e=Math.abs(c.b-a.b)+Math.abs(c.a-a.a),h=f+1;d[f]=.5*e/(g+e);d[h]=.5*g/(g+e);a.g[0]+=d[f]*b.g[0]+d[h]*c.g[0];a.g[1]+=d[f]*b.g[1]+d[h]*c.g[1];a.g[2]+=d[f]*b.g[2]+d[h]*c.g[2]}
function ra(a,b){var c=T(b),d=b.a,f=c.a;if(u(d.a,f.a)){if(0<w(A(f),d.a,f.a))return!1;if(!t(d.a,f.a))L(f.b),F(d,K(f)),b.b=c.b=!0;else if(d.a!==f.a){var c=a.e,g=d.a.h;if(0<=g){var c=c.b,e=c.c,h=c.a,l=h[g].b;e[l].a=e[c.b].a;h[e[l].a].b=l;l<=--c.b&&(1>=l||c.f(h[e[l>>1].a].a,h[e[l].a].a)?wa(c,l):xa(c,l));h[g].a=null;h[g].b=c.d;c.d=g}else for(c.c[-(g+1)]=null;0<c.a&&null===c.c[c.d[c.a-1]];)--c.a;ua(a,K(f),d)}}else{if(0>w(A(d),f.a,d.a))return!1;S(b).b=b.b=!0;L(d.b);F(K(f),d)}return!0}
function ya(a,b){var c=T(b),d=b.a,f=c.a,g=d.a,e=f.a,h=A(d),l=A(f),n=new O;w(h,a.a,g);w(l,a.a,e);if(g===e||Math.min(g.a,h.a)>Math.max(e.a,l.a))return!1;if(u(g,e)){if(0<w(l,g,e))return!1}else if(0>w(h,e,g))return!1;var r=h,p=g,q=l,z=e,m,x;u(r,p)||(m=r,r=p,p=m);u(q,z)||(m=q,q=z,z=m);u(r,q)||(m=r,r=q,q=m,m=p,p=z,z=m);u(q,p)?u(p,z)?(m=v(r,q,p),x=v(q,p,z),0>m+x&&(m=-m,x=-x),n.b=B(m,q.b,x,p.b)):(m=w(r,q,p),x=-w(r,z,p),0>m+x&&(m=-m,x=-x),n.b=B(m,q.b,x,z.b)):n.b=(q.b+p.b)/2;y(r,p)||(m=r,r=p,p=m);y(q,z)||(m=
q,q=z,z=m);y(r,q)||(m=r,r=q,q=m,m=p,p=z,z=m);y(q,p)?y(p,z)?(m=aa(r,q,p),x=aa(q,p,z),0>m+x&&(m=-m,x=-x),n.a=B(m,q.a,x,p.a)):(m=ba(r,q,p),x=-ba(r,z,p),0>m+x&&(m=-m,x=-x),n.a=B(m,q.a,x,z.a)):n.a=(q.a+p.a)/2;u(n,a.a)&&(n.b=a.a.b,n.a=a.a.a);r=u(g,e)?g:e;u(r,n)&&(n.b=r.b,n.a=r.a);if(t(n,g)||t(n,e))return ra(a,b),!1;if(!t(h,a.a)&&0<=w(h,a.a,n)||!t(l,a.a)&&0>=w(l,a.a,n)){if(l===a.a)return L(d.b),F(f.b,d),b=la(b),d=T(b).a,U(T(b),c),V(a,b,K(d),d,d,!0),!0;if(h===a.a){L(f.b);F(d.e,K(f));g=c=b;e=A(g.a);do g=S(g);
while(A(g.a)===e);b=g;g=T(b).a.b.c;c.a=K(f);f=U(c,null);V(a,b,f.c,d.b.c,g,!0);return!0}0<=w(h,a.a,n)&&(S(b).b=b.b=!0,L(d.b),d.a.b=a.a.b,d.a.a=a.a.a);0>=w(l,a.a,n)&&(b.b=c.b=!0,L(f.b),f.a.b=a.a.b,f.a.a=a.a.a);return!1}L(d.b);L(f.b);F(K(f),d);d.a.b=n.b;d.a.a=n.a;d.a.h=za(a.e,d.a);d=d.a;f=[0,0,0,0];n=[g.d,h.d,e.d,l.d];d.g[0]=d.g[1]=d.g[2]=0;va(d,g,h,f,0);va(d,e,l,f,2);ta(a,d,n,f,!0);S(b).b=b.b=c.b=!0;return!1}
function sa(a,b){for(var c=T(b);;){for(;c.b;)b=c,c=T(c);if(!b.b&&(c=b,b=S(b),null===b||!b.b))break;b.b=!1;var d=b.a,f=c.a,g;if(g=A(d)!==A(f))a:{g=b;var e=T(g),h=g.a,l=e.a,n=void 0;if(u(A(h),A(l))){if(0>w(A(h),A(l),h.a)){g=!1;break a}S(g).b=g.b=!0;n=L(h);F(l.b,n);n.d.c=g.d}else{if(0<w(A(l),A(h),l.a)){g=!1;break a}g.b=e.b=!0;n=L(l);F(h.e,l.b);n.b.d.c=g.d}g=!0}g&&(c.c?(R(c),J(f),c=T(b),f=c.a):b.c&&(R(b),J(d),b=S(c),d=b.a));if(d.a!==f.a)if(A(d)===A(f)||b.c||c.c||A(d)!==a.a&&A(f)!==a.a)ra(a,b);else if(ya(a,
b))break;d.a===f.a&&A(d)===A(f)&&(Q(f,d),R(b),J(d),b=S(c))}}
function Aa(a,b){a.a=b;for(var c=b.c;null===c.i;)if(c=c.c,c===b.c){var c=a,d=b,f=new na;f.a=d.c.b;var g=c.f,e=g.a;do e=e.a;while(null!==e.b&&!g.c(g.b,f,e.b));var g=e.b,h=T(g),f=g.a,e=h.a;if(0===w(A(f),d,f.a))f=g.a,t(f.a,d)||t(A(f),d)||(L(f.b),g.c&&(J(f.c),g.c=!1),F(d.c,f),Aa(c,d));else{var l=u(A(e),A(f))?g:h,h=void 0;g.d||l.c?(l===g?h=M(d.c.b,f.e):h=M(e.b.c.b,d.c).b,l.c?ka(l,h):(f=c,g=ma(c,g,h),g.f=S(g).f+g.a.f,g.d=pa(f,g.f)),Aa(c,d)):V(c,g,d.c,d.c,null,!0)}return}c=la(c.i);f=T(c);g=f.a;f=U(f,null);
if(f.c===g){var g=f,f=g.c,e=T(c),h=c.a,l=e.a,n=!1;A(h)!==A(l)&&ya(a,c);t(h.a,a.a)&&(F(K(f),h),c=la(c),f=T(c).a,U(T(c),e),n=!0);t(l.a,a.a)&&(F(g,K(l)),g=U(e,null),n=!0);n?V(a,c,g.c,f,f,!0):(u(l.a,h.a)?d=K(l):d=h,d=M(g.c.b,d),V(a,c,d,d.c,d.c,!1),d.b.i.c=!0,sa(a,c))}else V(a,c,f.c,g,g,!0)}function Ba(a,b){var c=new na,d=ea(a.b);d.a.b=P;d.a.a=b;A(d).b=-P;A(d).a=b;a.a=A(d);c.a=d;c.f=0;c.d=!1;c.c=!1;c.h=!0;c.b=!1;d=a.f;d=oa(d,d.a,c);c.e=d};function Ca(a){this.a=new Da;this.b=a;this.c=ja}function oa(a,b,c){do b=b.c;while(null!==b.b&&!a.c(a.b,b.b,c));a=new Da(c,b.a,b);b.a.c=a;return b.a=a};function Da(a,b,c){this.b=a||null;this.a=b||this;this.c=c||this};function X(){this.d=Y;this.x=this.b=this.t=null;this.m=[0,0,0];this.F=[0,0,0];this.h=[0,0,0];this.D=0;this.z=100130;this.s=!1;this.v=this.a=this.e=this.f=null;this.p=!1;this.c=this.u=this.w=this.q=this.k=this.n=this.i=this.y=this.r=this.l=this.o=this.j=null}var Y=0;k=X.prototype;k.G=function(){Z(this,Y)};
k.L=function(a,b){switch(a){case 100142:if(0>b||1<b)break;this.D=b;return;case 100140:switch(b){case 100130:case 100131:case 100132:case 100133:case 100134:this.z=b;return}break;case 100141:this.p=!!b;return;default:W(this,100900);return}W(this,100901)};k.H=function(a){switch(a){case 100142:return this.D;case 100140:return this.z;case 100141:return this.p;default:W(this,100900)}return!1};k.K=function(a,b,c){this.m[0]=a;this.m[1]=b;this.m[2]=c};
k.I=function(a,b){var c=b?b:null;switch(a){case 100100:this.j=c;break;case 100106:this.i=c;break;case 100104:this.o=c;break;case 100110:this.n=c;break;case 100101:this.l=c;break;case 100107:this.k=c;break;case 100102:this.r=c;break;case 100108:this.q=c;break;case 100103:this.x=c;break;case 100109:this.w=c;break;case 100105:this.v=c;break;case 100111:this.u=c;break;case 100112:this.y=c;break;default:W(this,100900)}};
k.M=function(a,b){var c=!1,d=[0,0,0];Z(this,2);for(var f=0;3>f;++f){var g=a[f];-1E150>g&&(g=-1E150,c=!0);1E150<g&&(g=1E150,c=!0);d[f]=g}c&&W(this,100155);c=this.t;null===c?(c=ea(this.b),F(c,c.b)):(L(c),c=c.e);c.a.d=b;c.a.g[0]=d[0];c.a.g[1]=d[1];c.a.g[2]=d[2];c.f=1;c.b.f=-1;this.t=c};k.B=function(a){Z(this,Y);this.d=1;this.b=new Ea;this.c=a};k.A=function(){Z(this,1);this.d=2;this.t=null};k.C=function(){Z(this,2);this.d=1};
k.J=function(){Z(this,1);this.d=Y;var a=!1,b=[this.m[0],this.m[1],this.m[2]];if(0===b[0]&&0===b[1]&&0===b[2]){var c=[-2*1E150,-2*1E150,-2*1E150],d=[2*1E150,2*1E150,2*1E150],f=[],g=[],e,a=this.b.c;for(e=a.e;e!==a;e=e.e)for(var h=0;3>h;++h){var l=e.g[h];l<d[h]&&(d[h]=l,g[h]=e);l>c[h]&&(c[h]=l,f[h]=e)}e=0;c[1]-d[1]>c[0]-d[0]&&(e=1);c[2]-d[2]>c[e]-d[e]&&(e=2);if(d[e]>=c[e])b[0]=0,b[1]=0,b[2]=1;else{c=0;d=g[e];f=f[e];g=[0,0,0];d=[d.g[0]-f.g[0],d.g[1]-f.g[1],d.g[2]-f.g[2]];h=[0,0,0];for(e=a.e;e!==a;e=e.e)h[0]=
e.g[0]-f.g[0],h[1]=e.g[1]-f.g[1],h[2]=e.g[2]-f.g[2],g[0]=d[1]*h[2]-d[2]*h[1],g[1]=d[2]*h[0]-d[0]*h[2],g[2]=d[0]*h[1]-d[1]*h[0],l=g[0]*g[0]+g[1]*g[1]+g[2]*g[2],l>c&&(c=l,b[0]=g[0],b[1]=g[1],b[2]=g[2]);0>=c&&(b[0]=b[1]=b[2]=0,b[ia(d)]=1)}a=!0}e=this.F;c=this.h;f=ia(b);e[f]=0;e[(f+1)%3]=1;e[(f+2)%3]=0;c[f]=0;c[(f+1)%3]=0<b[f]?-0:0;c[(f+2)%3]=0<b[f]?1:-1;b=this.b.c;for(f=b.e;f!==b;f=f.e)f.b=ha(f.g,e),f.a=ha(f.g,c);if(a){b=0;a=this.b.a;for(e=a.b;e!==a;e=e.b)if(c=e.a,!(0>=c.f)){do b+=(c.a.b-A(c).b)*(c.a.a+
A(c).a),c=c.e;while(c!==e.a)}if(0>b){b=this.b.c;for(a=b.e;a!==b;a=a.e)a.a=-a.a;this.h[0]=-this.h[0];this.h[1]=-this.h[1];this.h[2]=-this.h[2]}}this.s=!1;b=this.b.b;for(e=b.h;e!==b;e=a)if(a=e.h,c=e.e,t(e.a,A(e))&&e.e.e!==e&&(ua(this,c,e),J(e),e=c,c=e.e),c.e===e){if(c!==e){if(c===a||c===a.b)a=a.h;J(c)}if(e===a||e===a.b)a=a.h;J(e)}this.e=b=new Fa;a=this.b.c;for(e=a.e;e!==a;e=e.e)e.h=za(b,e);Ga(b);this.f=new Ca(this);Ba(this,-P);for(Ba(this,P);null!==(b=Ha(this.e));){for(;;){a:if(a=this.e,0===a.a)a=Ia(a.b);
else{e=a.c[a.d[a.a-1]];if(0!==a.b.b&&(c=Ia(a.b),a.f(c,e))){a=c;break a}a=e}if(null===a||!t(a,b))break;a=Ha(this.e);ua(this,b.c,a.c)}Aa(this,b)}this.a=this.f.a.a.b.a.a;for(b=0;null!==(a=this.f.a.a.b);)a.h||++b,R(a);this.f=null;b=this.e;a=b.b;a.a=null;a.c=null;b.b=null;b.d=null;this.e=b.c=null;b=this.b;for(e=b.a.b;e!==b.a;e=a)a=e.b,e=e.a,e.e.e===e&&(Q(e.c,e),J(e));if(!this.s){b=this.b;if(this.p)for(e=b.b.h;e!==b.b;e=a)a=e.h,e.b.d.c!==e.d.c?e.f=e.d.c?1:-1:J(e);else for(e=b.a.b;e!==b.a;e=a)if(a=e.b,e.c){for(e=
e.a;u(A(e),e.a);e=e.c.b);for(;u(e.a,A(e));e=e.e);c=e.c.b;for(f=void 0;e.e!==c;)if(u(A(e),c.a)){for(;c.e!==e&&(ca(c.e)||0>=w(c.a,A(c),A(c.e)));)f=M(c.e,c),c=f.b;c=c.c.b}else{for(;c.e!==e&&(da(e.c.b)||0<=w(A(e),e.a,e.c.b.a));)f=M(e,e.c.b),e=f.b;e=e.e}for(;c.e.e!==e;)f=M(c.e,c),c=f.b}if(this.j||this.r||this.l||this.o||this.i||this.q||this.k||this.n)if(this.p)for(b=this.b,a=b.a.b;a!==b.a;a=a.b){if(a.c){this.i?this.i(2,this.c):this.j&&this.j(2);e=a.a;do c=e.a.d,this.k?this.k(c,this.c):this.l&&this.l(c),
e=e.e;while(e!==a.a);Ja(this)}}else{b=this.b;a=!(!this.o&&!this.n);e=!1;c=-1;for(f=b.a.d;f!==b.a;f=f.d)if(f.c){e||(this.i?this.i(4,this.c):this.j&&this.j(4),e=!0);g=f.a;do a&&(d=g.b.d.c?0:1,c!==d&&(c=d,d=!!c,this.n?this.n(d,this.c):this.o&&this.o(d))),d=g.a.d,this.k?this.k(d,this.c):this.l&&this.l(d),g=g.e;while(g!==f.a)}e&&Ja(this)}if(this.y){b=this.b;for(e=b.a.b;e!==b.a;e=a)if(a=e.b,!e.c){c=e.a;f=c.e;g=void 0;do g=f,f=g.e,g.d=null,null===g.b.d&&(g.c===g?G(g.a,null):(g.a.c=g.c,I(g,K(g))),d=g.b,d.c===
d?G(d.a,null):(d.a.c=d.c,I(d,K(d))),fa(g));while(g!==c);c=e.d;e=e.b;e.d=c;c.b=e}this.y(this.b);this.c=this.b=null;return}}this.b=this.c=null};function Z(a,b){if(a.d!==b)for(;a.d!==b;)if(a.d<b)switch(a.d){case Y:W(a,100151);a.B(null);break;case 1:W(a,100152),a.A()}else switch(a.d){case 2:W(a,100154);a.C();break;case 1:W(a,100153);var c=a;c.d=Y;c.t=null;c.b=null}}function Ja(a){a.q?a.q(a.c):a.r&&a.r()}function W(a,b){a.w?a.w(b,a.c):a.x&&a.x(b)};function ga(a,b){this.b=a||this;this.d=b||this;this.a=null;this.c=!1};function N(){this.h=this;this.i=this.d=this.a=this.e=this.c=this.b=null;this.f=0}function A(a){return a.b.a}function K(a){return a.b.e};function Ea(){this.c=new O;this.a=new ga;this.b=new N;this.d=new N;this.b.b=this.d;this.d.b=this.b};function O(a,b){this.e=a||this;this.f=b||this;this.d=this.c=null;this.g=[0,0,0];this.a=this.b=0;this.h=null};function Ka(){this.a=null;this.b=0}function La(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 Ka;return c};function Ma(){this.a=0}function Na(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 Ma;return c};function Fa(){this.c=Oa(null,32);this.d=null;this.a=0;this.e=32;this.h=!1;this.f=u;this.b=new Pa(this.f)}function Ga(a){a.d=[];for(var b=0;b<a.a;b++)a.d[b]=b;a.d.sort(function(a,b){return function(f,g){return b(a[f],a[g])?1:-1}}(a.c,a.f));a.e=a.a;a.h=!0;Qa(a.b)}
function za(a,b){if(a.h){var c=a.b,d=++c.b;2*d>c.e&&(c.e*=2,c.c=Na(c.c,c.e+1),c.a=La(c.a,c.e+1));var f;0===c.d?f=d:(f=c.d,c.d=c.a[f].b);c.c[d].a=f;c.a[f].b=d;c.a[f].a=b;c.h&&xa(c,d);return f}c=a.a;++a.a>=a.e&&(a.e*=2,a.c=Oa(a.c,a.e));a.c[c]=b;return-(c+1)}function Oa(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 Ha(a){if(0===a.a)return Ra(a.b);var b=a.c[a.d[a.a-1]];if(0!==a.b.b&&a.f(Ia(a.b),b))return Ra(a.b);do--a.a;while(0<a.a&&null===a.c[a.d[a.a-1]]);return b};function Pa(a){this.c=Na(null,33);this.a=La(null,33);this.b=0;this.e=32;this.d=0;this.h=!1;this.f=a;this.c[1].a=1}function Qa(a){for(var b=a.b;1<=b;--b)wa(a,b);a.h=!0}function Ia(a){return a.a[a.c[1].a].a}function Ra(a){var b=a.c,c=a.a,d=b[1].a,f=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&&wa(a,1));return f}
function wa(a,b){for(var c=a.c,d=a.a,f=c[b].a;;){var g=b<<1;g<a.b&&a.f(d[c[g+1].a].a,d[c[g].a].a)&&++g;var e=c[g].a;if(g>a.b||a.f(d[f].a,d[e].a)){c[b].a=f;d[f].b=b;break}c[b].a=e;d[e].b=b;b=g}}function xa(a,b){for(var c=a.c,d=a.a,f=c[b].a;;){var g=b>>1,e=c[g].a;if(0===g||a.f(d[e].a,d[f].a)){c[b].a=f;d[f].b=b;break}c[b].a=e;d[e].b=b;b=g}};function na(){this.e=this.a=null;this.f=0;this.c=this.b=this.h=this.d=!1}function T(a){return a.e.c.b}function S(a){return a.e.a.b};this.libtess={GluTesselator:X,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}};X.prototype.gluDeleteTess=X.prototype.G;
X.prototype.gluTessProperty=X.prototype.L;X.prototype.gluGetTessProperty=X.prototype.H;X.prototype.gluTessNormal=X.prototype.K;X.prototype.gluTessCallback=X.prototype.I;X.prototype.gluTessVertex=X.prototype.M;X.prototype.gluTessBeginPolygon=X.prototype.B;X.prototype.gluTessBeginContour=X.prototype.A;X.prototype.gluTessEndContour=X.prototype.C;X.prototype.gluTessEndPolygon=X.prototype.J; if (typeof module !== 'undefined') { module.exports = this.libtess; }
{
"name": "libtess",
"version": "1.2.0",
"version": "1.2.1",
"description": "Polygon tesselation library, ported from SGI's GLU implementation.",

@@ -26,8 +26,3 @@ "homepage": "https://github.com/brendankenny/libtess.js/",

],
"licenses": [
{
"type": "SGI-B-2.0",
"url": "https://github.com/brendankenny/libtess.js/blob/gh-pages/LICENSE"
}
],
"license": "SGI-B-2.0",
"bugs": "https://github.com/brendankenny/libtess.js/issues",

@@ -42,22 +37,22 @@ "keywords": [

"devDependencies": {
"browserify": "^6.1.0",
"chai": "^1.9.2",
"browserify": "^11.2.0",
"chai": "^3.3.0",
"closurecompiler": "^1.3.2",
"coveralls": "^2.11.2",
"envify": "^3.2.0",
"glob": "^4.2.1",
"glob": "^5.0.15",
"gulp": "^3.8.8",
"gulp-closure-compiler": "^0.2.7",
"gulp-closure-compiler": "^0.3.1",
"gulp-concat": "^2.4.2",
"gulp-filter": "^1.0.2",
"gulp-istanbul": "^0.3.1",
"gulp-jscs": "^1.2.0",
"gulp-coveralls": "^0.1.4",
"gulp-filter": "^3.0.1",
"gulp-istanbul": "^0.10.1",
"gulp-jscs": "^3.0.1",
"gulp-jshint": "^1.8.5",
"gulp-mocha": "^1.1.2",
"gulp-mocha": "^2.1.3",
"gulp-newer": "^0.5.1",
"gulp-rename": "^1.2.0",
"gulp-replace": "^0.4.0",
"jshint-stylish": "^1.0.0",
"mocha": "^1.21.5",
"gulp-replace": "^0.5.4",
"jshint-stylish": "^2.0.1",
"mocha": "^2.3.3",
"rfolderify": "^1.3.0",
"rocambole": "^0.3.6",
"rocambole": "^0.7.0",
"rocambole-token": "^1.2.1",

@@ -64,0 +59,0 @@ "vinyl-map": "^1.0.1",

@@ -10,2 +10,8 @@ # libtess.js

## Installation
```
npm install libtess
```
## Example

@@ -12,0 +18,0 @@ See the [example page](https://brendankenny.github.io/libtess.js/examples/simple_triangulation/index.html)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc