/*
 * Copyright CADMAI Software GmbH.
 * All rights reserved.
 *
 * Redistribution (includes making available on a web location) is permitted 
 * provided that the following conditions are met:
 *
 * The redistributor must hold one of these licenses:
 * a valid CADMAI WebGl-Publisher license (SingleWebGlPubLic)
 * a valid CADMAI WebGl-Publisher Revit export license (SingleWebGlRevitExportLic)
 * a valid CADMAI WebGl-Publisher Inventor export license (SingleWebGlInventorExportLic)
 * or a written permission of CADMAI Software GmbH 
 *
 * The redistributor / user does not have the right to change, translate,
 * back-develop, decompile or disassemble the software.
 * 
 * Redistributions must retain the above copyright notice, 
 * this list of conditions and the following disclaimer.
 *   
 * Neither the name of CADMAI Software GmbH nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 var pP=function(){this.XR=0;this.Wt=0;this.H2=0;this.EC=null;this.lX=null;this.dI=null;this.aR=null;this.ig=false;};var Bn=new function(){this.Uq=function(Kd,F){var G=0,FM=0;var Dd=this.Ra(F);var KH=null;if((Dd==false&&Kd==true)||(Dd==true&&Kd==false)){KH=this.gs(F,0,true);}else{KH=F;}var U7=this.z3(KH);var CQ=this.gs(KH,U7,false);var G=0,FM=CQ.length;for(G=0;G<FM;G++){CQ[G].Yz=G;}return(CQ);};this.Eo=function(yZ,Qh){var G=0;h7(Qh,As);for(G=0;G<Qh.length;G++){if(Qh[G]==yZ){return G;};}return(-1);};this.Qe=function(Ox,N2){var P8=new RJ();var wU=0.0;var ratio=0.0;P8.x=N2.x-Ox.x;P8.y=N2.y-Ox.y;if((CmiHelpers.AY(P8.x))&&(CmiHelpers.AY(P8.y)))return(0.0);var pa=4;if(CmiHelpers.ld(P8.x,0.0)&&CmiHelpers.ld(P8.y,0.0))pa=1;if(CmiHelpers.x4(P8.x,0.0)&&CmiHelpers.ld(P8.y,0.0))pa=2;if(CmiHelpers.x4(P8.x,0.0)&&CmiHelpers.x4(P8.y,0.0))pa=3;switch(pa){case 1:{if(CmiHelpers.AX(P8.x,0.0)){ratio=P8.y/P8.x;if(ratio==0.0)wU=0.0;else wU=(((Math.sqrt(1.0+((ratio)*(ratio))))-1.0)/ratio);}else wU=1.0;}break;case 2:{if(CmiHelpers.AX(P8.y,0.0)){ratio=-P8.x/P8.y;if(CmiHelpers.AY(ratio))wU=1.0;else wU=1.0+(((Math.sqrt(1.0+((ratio)*(ratio)))-1.0)/ratio));}else wU=2.0;}break;case 3:{if(CmiHelpers.x4(P8.x,0.0)){ratio=P8.y/P8.x;if(CmiHelpers.AY(ratio))wU=2.0;else wU=2.0+(((Math.sqrt(1.0+((ratio)*(ratio)))-1.0)/ratio));}else wU=3.0;}break;case 4:{if(CmiHelpers.x4(P8.y,0.0)){ratio=-P8.x/P8.y;if(ratio==0.0)wU=3.0;else wU=3.0+(((Math.sqrt(1.0+((ratio)*(ratio)))-1.0)/ratio));}else wU=0.0;}break;};return this.Ft(wU);};this.Ft=function(wU){var angle=0.0;var a6=0.0;var Kg=0.0;if(CmiHelpers.eb(wU,0.0)){if(CmiHelpers.isEqual(wU,0.0))return(0.0);else return(0.0);}else{if(CmiHelpers.isEqual(wU,1.0))return(90.0);else if(CmiHelpers.isEqual(wU,2.0))return(180.0);else if(CmiHelpers.isEqual(wU,3.0))return(270.0);while(CmiHelpers.ld(wU,4.0))wU=wU-4.0;a6=wU-parseInt(wU);Kg=Math.atan(a6)*2;if(a6==0.0){if(CmiHelpers.isEqual(wU,1.0))return(90.0);if(CmiHelpers.isEqual(wU,2.0))return(180.0);if(CmiHelpers.isEqual(wU,3.0))return(270.0);return(0.0);}else{angle=CmiHelpers.fA(Kg);if(CmiHelpers.eb(wU,1.0))return(angle);if((CmiHelpers.AX(wU,1.0))&&(CmiHelpers.x4(wU,2.0)))return(90.0+angle);if((CmiHelpers.ld(wU,2.0))&&(CmiHelpers.x4(wU,3.0)))return(180.0+angle);if((CmiHelpers.ld(wU,3.0))&&(CmiHelpers.x4(wU,4.0)))return(270.0+angle);return(0.0);};}};this.Ra=function(F){var V3=0.0,yq=0.0;var Wm=F[F.length-1];var Dy=F[0];var Pt=F[1];V3=this.Qe(Dy,Wm);yq=this.Qe(Dy,Pt);if(CmiHelpers.x4(yq,V3))return(false);else return(true);};this.Tf=function(F,yF,G,Ep){var result=0.0;if(CmiHelpers.AY(F[yF].x))F[yF].x=0.0;if(CmiHelpers.AY(F[yF].y))F[yF].y=0.0;if(CmiHelpers.AY(F[G].x))F[G].x=0.0;if(CmiHelpers.AY(F[G].y))F[G].y=0.0;if(CmiHelpers.AY(F[Ep].x))F[Ep].x=0.0;if(CmiHelpers.AY(F[Ep].y))F[Ep].y=0.0;result=F[yF].x*F[G].y+F[yF].y*F[Ep].x+F[Ep].y*F[G].x-F[yF].y*F[G].x-F[G].y*F[Ep].x-F[yF].x*F[Ep].y;return((CmiHelpers.qe(result)));};this.Xi=function(rect,_){if(CmiHelpers.AY(rect.Ym-rect.cw)&&CmiHelpers.AY(rect.w6-rect.gk)){if(CmiHelpers.AY(_.x-rect.Ym)&&CmiHelpers.AY(_.y-rect.w6))return(true);else return(false);}else{var line=new X8();line.Ym=CmiHelpers.x4(rect.Ym,rect.cw)?rect.Ym:rect.cw;line.w6=CmiHelpers.x4(rect.w6,rect.gk)?rect.w6:rect.gk;line.cw=CmiHelpers.AX(rect.Ym,rect.cw)?rect.Ym:rect.cw;line.gk=CmiHelpers.AX(rect.w6,rect.gk)?rect.w6:rect.gk;if(CmiHelpers.ld(_.x,line.Ym)&&CmiHelpers.eb(_.x,line.cw)&&CmiHelpers.ld(_.y,line.w6)&&CmiHelpers.eb(_.y,line.gk))return true;else return false;}};this.S5=function(F,yF,G,Ep,o4){var AN=0;var rect=new X8();var O8=0.0,gJ=0.0,hP=0.0,QC=0.0;rect.cw=CmiHelpers.AX(F[yF].x,F[G].x)?F[yF].x:F[G].x;rect.cw=CmiHelpers.AX(F[Ep].x,rect.cw)?F[Ep].x:rect.cw;rect.gk=CmiHelpers.AX(F[yF].y,F[G].y)?F[yF].y:F[G].y;rect.gk=CmiHelpers.AX(F[Ep].y,rect.gk)?F[Ep].y:rect.gk;rect.Ym=CmiHelpers.x4(F[yF].x,F[G].x)?F[yF].x:F[G].x;rect.Ym=CmiHelpers.x4(F[Ep].x,rect.Ym)?F[Ep].x:rect.Ym;rect.w6=CmiHelpers.x4(F[yF].y,F[G].y)?F[yF].y:F[G].y;rect.w6=CmiHelpers.x4(F[Ep].y,rect.w6)?F[Ep].y:rect.w6;AN=0;while(AN<=o4){if((((AN!=yF)&&(AN!=G))&&(AN!=Ep))){if(this.Xi(rect,F[AN])){O8=F[AN].x;gJ=F[AN].y;hP=F[yF].x;QC=F[yF].y;if(!(CmiHelpers.AY(O8-hP)&&CmiHelpers.AY(gJ-QC))){hP=F[G].x;QC=F[G].y;if(!(CmiHelpers.AY(O8-hP)&&CmiHelpers.AY(gJ-QC))){hP=F[Ep].x;QC=F[Ep].y;if(!(CmiHelpers.AY(O8-hP)&&CmiHelpers.AY(gJ-QC)))return(true);};};};}AN++;}return(false);};this.wV=function(TP,ui){var dx=0.0,dy=0.0,JK=0.0,Sy=0.0,bF=0.0,Ac=0.0,Yk=0.0;dx=TP.cw-TP.Ym;dy=TP.gk-TP.w6;JK=ui.Ym-TP.Ym;Sy=ui.w6-TP.w6;bF=ui.cw-TP.cw;Ac=ui.gk-TP.gk;Yk=((dx*Sy-dy*JK)*(dx*Ac-dy*bF));if(CmiHelpers.fm(Yk)){dx=ui.cw-ui.Ym;dy=ui.gk-ui.w6;JK=TP.Ym-ui.Ym;Sy=TP.w6-ui.w6;bF=TP.cw-ui.cw;Ac=TP.gk-ui.gk;Yk=((dx*Sy-dy*JK)*(dx*Ac-dy*bF));if(CmiHelpers.fm(Yk))return(true);}return(false);};this.SA=function(HX,F,Hy,hL){var J1=0,G=0,Ep=0,KN=0;var Dy=null,p2=null;var lB=0.0;var VU=new X8();var NH=new X8();var TP=new X8();var ui=new X8();var nc=new RJ();if((Hy)<3)return(false);if(hL.yR==0){lB=-1.7E+200;for(G=0;G<(Hy);++G){if(CmiHelpers.AX(F[G].x,lB)){hL.yR=G;lB=F[G].x;};};}lB=F[hL.yR].x+1000.0;J1=0;KN=0;Dy=F[Hy-1];VU.X5(HX.x,HX.y,lB,HX.y);TP.X5(HX.x,HX.y,lB,HX.y);for(G=1;G<=Hy;G++){Ep=(G-1);ui.Ym=F[Ep].x;ui.w6=F[Ep].y;ui.cw=F[Ep].x;ui.gk=F[Ep].y;if(!(this.wV(ui,TP))){if(KN==0)p2=Dy;else p2=F[KN-1];ui.cw=p2.x;ui.gk=p2.y;if((G-KN)>1){NH.X5(ui.Ym,ui.w6,ui.cw,ui.gk);if(nc.xx(VU,NH)==0)J1++;}else{if(this.wV(ui,TP))J1++;}KN=G;}}if((J1%2)==1)return(true);else return(false);};this.Ww=function(F,yF,G,Ep,o4){var a=new Array(4);var pw=0,AN=0,gt=0;var pw=new Dl();a[0]=F[yF];a[1]=F[G];a[2]=F[Ep];a[3]=a[0];AN=0;pw.yR=0;gt=3;while(AN<=o4){if(((AN!=yF)&&(AN!=G))&&(AN!=Ep))if(this.SA(F[AN],a,gt,pw))return(false);AN++;}return(true);};this.zB=function(qZ){var gW=new Array();var Nn=null;var Rk=qZ.length/2;var G;for(G=0;G<Rk;G++){Nn=new mx();Nn.x=qZ[G*2+0];Nn.y=qZ[G*2+1];gW.push(Nn);}return(gW);};this.yr=function(gW){var qZ=new Array();var Nn=null;var Rk=gW.length;var G;for(G=0;G<Rk;G++){Nn=gW[G];qZ.push(Nn.x);qZ.push(Nn.y);}return(qZ);};this._h=function(yZ,Qh){var G=0;var FM=0;var FZ=new X8();var xu=null;var lh=null;FM=Qh.length;for(G=0;G<FM;G++){if(G==FM-1){xu=Qh[FM-1];lh=Qh[0];}else{xu=Qh[G];lh=Qh[G+1];}FZ.X5(xu.x,xu.y,lh.x,lh.y);if(CmiHelpers.wE(FZ,yZ)){if(G==FM-1)Qh.push(yZ);else Qh.splice(G,0,yZ);return(0);};}return(-1);};this._B=function(yY,di){var G=0,dU=0,FM=0,RT=0;var y5=yY.length-1;var cH=yY[0];var oV=new Array();var rect=this.Lu(yY[0]);var Pd=new Array();var D_=rect[1]-1;var pt=rect[3]+1;var bl=0.0;var XB=0.0;var yZ=null;var j_=null;var wy=new Array();var Bq=new Array();var Bo=new X8();var Iu=new Array();var BK=null;var ia=null;for(G=0;G<y5;G++){Pd.push(false);oV.push(yY[G+1]);}for(G=0;G<y5;G++){if(Pd[G]==false){j_=oV[G];rect=this.Lu(j_);bl=rect[0]+(rect[2]-rect[0])*0.5;XB=bl;Pb:do{while(wy.length>0){wy.pop()};Bo.X5(bl,D_,XB,pt);Bq=this.ja(Bo,cH);if(Bq!=null){if(Bq.length%2==1){while(Bq.length>0){Bq.pop()};bl=bl+0.05;XB=bl;continue Pb;}else if(Bq.length>0){Bq.sort(this.fN);while(Bq.length>0){yZ=Bq.pop();yZ.Qh=cH;wy.push(yZ);};};}for(dU=0;dU<y5;dU++){j_=oV[dU];while(Bq.length>0){Bq.pop()};Bq=this.ja(Bo,j_);if(Bq!=null){if(Bq.length%2==1){while(Bq.length>0){Bq.pop()};bl=bl+0.05;XB=bl;continue Pb;}else if(Bq.length>0){Bq.sort(this.fN);yZ=Bq[0];yZ.Qh=j_;wy.push(yZ);yZ=Bq[Bq.length-1];yZ.Qh=j_;wy.push(yZ);while(Bq.length>0){Bq.pop()};Pd[dU]=true;}}}break Pb;}while(0);wy.sort(this.fN);BK=new Array();Iu.push(BK);dU=1;RT=parseInt((wy.length*0.5));while(wy.length>0){ia=new pP();yZ=wy.pop();Br.XR=G+1;Br.Wt=dU;Br.H2=RT;Br.EC=yZ.Qh;Br.lX=yZ;yZ=wy.pop();Br.dI=yZ.Qh;Br.aR=yZ;BK.push(ia);dU++;};}}for(G=0;G<Iu.length;G++){Iu[G].sort(this.yn);}for(G=0;G<cH.length;G++){cH[G].Yz=-1;}for(G=0;G<oV.length;G++){j_=oV[G];for(dU=0;dU<j_.length;dU++){j_[G].Yz=-1;};}var H2=1;for(G=0;G<Iu.length;G++){BK=Iu[G];for(dU=0;dU<BK.length;dU++){ia=BK[dU];ia.ig=false;this._h(ia->lX,ia->EC);this._h(ia->aR,ia->dI);ia->lX->Yz=H2;ia->aR->Yz=H2;H2++;}}var xV=new Array();var WD=null;var ou=null;var fM=false;var Rk=0;var M7=0;var tV=null;var mt=null;var C2=10000;var Rk=0;BK=mB[0];do{fM=false;for(G=0;G<BK.length;G++){ia=BK[G];if(ia.ig==false){fM=true;G=BK.length;}}if(fM==true){WD=new Array();xV.push(WD);Rk=0;mt=ia.lX;tV=ia.aR;ia.ig=true;ou=ia.dI;WD.push(mt);WD.push(tV);M7=this.Eo(tV,ou);if(M7==-1){return-1;}if(M7==ou.length-1){M7=0;else M7++;}cb=false;do{tV=ou[M7];Rk++;if(Rk>C2){cb=true;while(WD.length>0){WD.pop()};}else if(tV==mt){cb=true;WD.push(tV);}else if(tV.Yz==-1){WD.push(tV);}else if(tV.Yz>0){WD.push(tV);if((BK.length<=tV.Yz)||(tV.Yz<0)){return-1;}ia=BK[tV.Yz];tV=ia.aR;WD.push(tV);ia.ig=true;if(tV==mt){cb=true;}else{ou=ia.dI;M7=this.Eo(tV,ou);if(M7==-1){return-1;}}}if(M7==ou.length-1){M7=0;else M7++;}}while(cb==false);}}while(fM==true);for(G=0;G<mB.length;G++){BK=mB[G];for(dU=0;dU<BK.length;dU++){BK[dU].ig=false;}do{fM=false;for(dU=0;dU<BK.length;dU++){ia=BK[G];if(ia.ig==false){fM=true;dU=BK.length;}}if(fM==true){WD=new Array();xV.push(WD);Rk=0;mt=ia.lX;ou=ia.EC;WD.push(mt);M7=this.Eo(mt,ou);if(M7==-1){return-1;}if(M7==ou.length-1){M7=0;else M7++;}cb=false;do{tV=ou[M7];Rk++;if(Rk>C2){cb=true;while(WD.length>0){WD.pop()};}else if(tV==mt){cb=true;WD.push(tV);}else if(tV.Yz==-1){WD.push(tV);}else if(tV.Yz>0){WD.push(tV);if((mB.length<=tV.Yz)||(tV.Yz<0)){return-1;}ia=mB[tV.Yz];if(tV==ia->lX)tV=ia->aR;else tV=ia->lX;WD.push(tV);ia.ig=true;if(tV==mt){cb=true;}else{if(tV==ia->lX)ou=ia->EC;else ou=ia->dI;M7=this.Eo(tV,ou);if(M7==-1){return-1;}}}if(M7==ou.length-1){M7=0;else M7++;}}while(cb==false);}}while(fM==true);}var vF=new Array();for(G=0;G<xV.length;G++){WD=xV[G];this.EE(WD);if(WD->count>2){WD.push(WD[0]);this.Zc(WD,999999999.0);}}while(cH.length>0){cH.pop()};while(oV.length>0){j_=oV.pop();while(j_.length>0){j_.pop()};}while(mB.length>0){BK=mB.pop();while(BK.length>0){BK.pop()};}while(xV.length>0){WD=xV.pop();while(WD.length>0){WD.pop()};}return(vF);};this.Zc=function(E3,di){var v2=0,G=0,dU=0,Ix=0,RT=0,Nd=0,yF=0,hf=0,Ep=0,Yn=0;var jC=0.0,UF=0.0;var vF=new Array();var F=null;v2=E3.length;if(v2<3)return(vF);F=new Array(v2);for(G=0;G<v2;++G){F[G]=E3[G];}Yn=0;Ix=v2;RT=v2;Nd=v2-1;while(Ix>3){jC=di;for(G=0;G<=Nd;++G){Ep=((G==Nd)?(0):(G+1));yF=((G==0)?(Ix-1):(G-1));UF=((F[yF].x-F[Ep].x)*(F[yF].x-F[Ep].x))+((F[yF].y-F[Ep].y)*(F[yF].y-F[Ep].y));if((this.Tf(F,yF,G,Ep)&&CmiHelpers.x4(UF,jC))){if(this.S5(F,yF,G,Ep,Nd)){if(this.Ww(F,yF,G,Ep,Nd)){jC=UF;Yn=G;}}else{jC=UF;Yn=G;}}}G=Yn;yF=((G==0)?(Nd):(G-1));Ep=((G==Nd)?(0):(G+1));if(CmiHelpers.isEqual(jC,di)){return(vF);}else{vF.push(F[yF].Yz);vF.push(F[G].Yz);vF.push(F[Ep].Yz);Ix--;Nd=(Ix-1);for(hf=G;hf<=(RT-1);++hf)F[hf]=F[hf+1];}}if(Ix==3){if(this.Tf(F,2,0,1)){vF.push(F[2].Yz);vF.push(F[0].Yz);vF.push(F[1].Yz);}else{vF.push(F[1].Yz);vF.push(F[0].Yz);vF.push(F[2].Yz);}}return(vF);};this.V0=function(Ox,NW,qi,EU,Ow){var FM=0;var G;var Nn=null;if(EU<qi)EU=EU+360;var Ph=parseInt((EU-qi)*Ow);if(Ph<3)Ph=3;var T5=Math.PI*qi/180;var angle=(EU-qi)/Ph;var EM=0.0;var gW=new Array();var wj=Math.PI*angle/180;for(G=0;G<=Ph;G++){Nn=new mx();Nn.x=Math.cos(T5)*NW+Ox[0];Nn.y=Math.sin(T5)*NW+Ox[1];Nn.Yz=G;gW.push(Nn);T5=T5+wj;}return(gW);};this.fN=function(a,b){if(a.y==b.y)return 0;else if(a.y<b.y)return-1;else return 1;};this.yn=function(a,b){if(a.lX.x==b.lX.x)return 0;else if(a.lX.x<b.lX.x)return-1;else return 1;};this.EE=function(F){};this.z3=function(F){var O5=1.7E+200,VR=1.7E+200;var Nn=null;;var Hy=F.length;var U7=0;var G=0;for(G=0;G<(Hy);++G){if(CmiHelpers.eb(F[G].y,VR)){if(CmiHelpers.isEqual(F[G].y,VR)){if(CmiHelpers.eb(F[G].x,O5)){U7=G;O5=F[G].x;}}else{U7=G;O5=F[G].x;VR=F[G].y;}}}return(U7);};this.gs=function(F,startIndex,by){var Hy=F.length;var _R=new Array(Hy);var pY=startIndex;var G=0;if(by==true){for(G=0;G<(Hy);++G){_R[Hy-G-1]=F[pY];if(pY==Hy-1)pY=0;else pY++;}}else{for(G=0;G<(Hy);++G){_R[G]=F[pY];if(pY==Hy-1)pY=0;else pY++;}}return _R;};this.ja=function(line,Si){var G=0,FM=0,FG=0;var Dk=0.0,bY=0.0,PO=0.0,My=0.0,ph=0.0,bT=0.0,fe=0.0,am=0.0,i_=0.0;var mF=new RJ(),tV=new RJ(),uD=new RJ(),at=new RJ();var Nn=new mx();var zG=new Array();var WA=null;if((line==null)||(Si==null))return null;if(Si.length==0)return(null);Dk=line.cw-line.Ym;PO=line.gk-line.w6;FM=Si.length;mF.x=Si[0].x;mF.y=Si[0].y;tV.x=mF.x;tV.y=mF.y;for(G=1;G<=FM;G++){if(G==FM){uD.x=mF.x;uD.y=mF.y;}else{uD.x=Si[G].x;uD.y=Si[G].y;}bY=tV.x-uD.x;My=tV.y-uD.y;ph=uD.x-line.Ym;bT=uD.x-line.w6;fe=bY*PO-My*Dk;if(fe!=0.0){fe=1.0/fe;am=((bY*bT)-(My*ph))*fe;i_=((Dk*bT)-(PO*ph))*fe;if((am<0.0)||(am>1.0)||(i_<0.0)||(i_>1.0)){}else{Nn.x=line.Ym+Dk*am;Nn.y=line.w6+PO*am;Nn.Yz=FG;if(Nn.Yz==0){WA=new mx();WA.x=Nn.x;WA.y=Nn.y;WA.Yz=FG;zG.push(WA);at.x=Nn.x;at.y=Nn.y;FG++;}else if(((at.x-Nn.x)!=0.0)||((at.y-Nn.y)!=0.0)){WA=new mx();WA.x=Nn.x;WA.y=Nn.y;WA.Yz=FG;zG.push(WA);at.x=Nn.x;at.y=Nn.y;FG++;}}}tV.x=uD.x;tV.y=uD.y;}return(zG);};this.DG=function(qZ){var lB=-10000000.0;var cG=-10000000.0;var O5=10000000.0;var VR=10000000.0;var Rk=qZ.length/2;var G;for(G=0;G<Rk;G++){if(lB<qZ[G*2+0])lB=qZ[G*2+0];if(O5>=qZ[G*2+0])O5=qZ[G*2+0];if(cG<qZ[G*2+1])cG=qZ[G*2+1];if(VR>=qZ[G*2+1])VR=qZ[G*2+1];}return new Array(O5,VR,lB,cG);};this.Lu=function(Si){var lB=-10000000.0;var cG=-10000000.0;var O5=10000000.0;var VR=10000000.0;var Rk=Si.length;var G;for(G=0;G<Rk;G++){if(lB<Si[G].x)lB=Si[G].x;if(O5>=Si[G.x])O5=Si[G].x;if(cG<Si[G].y)cG=Si[G].y;if(VR>=Si[G].y)VR=Si[G].y;}return new Array(O5,VR,lB,cG);};};
