1 |
- !function(z,o,p){"use strict";var C="ht",c=z[C],i=null,A=Math,B=A.PI,w=A.cos,j=A.sin,H=A.abs,O=A.max,T=A.sqrt,h=1e-5,b=c.Default,E=b.def,f=b.startAnim,q=b.createMatrix,N=b.transformVec,L=b.getInternal(),K=L.addMethod,W=L.superCall,G=L.toPointsArray,x=L.createNormals,U=L.toFloatArray,X=L.glMV,v=L.batchShape,$=L.createNodeMatrix,d=L.getFaceInfo,t=L.transformAppend,V=L.drawFaceInfo,P=L.createAnim,Y=L.cube(),Z=Y.is,l=Y.vs,R=Y.uv,g=L.ui(),I=c.Node,u=c.Shape,M="h",J="v",s="front",F="back",m="left",n="right",r="top",D="bottom",e="dw.expanded",k=".expanded",S="dw.angle",Q=".angle",a=function(X,S,Z){E(C+"."+X,S,Z)},_=function(h,n,O){O?h.push(n.x,n.y):h.push(n.x,n.y,n.z)},y=[1,0,0],Vg=function(O,H,K,t){var l,b,$,f,h=0,u=[];if(t)for(l=t.length;l>h;h+=3)b=t[h],$=t[h+1],f=t[h+2],u.push(new Np([new bi([H[3*b],H[3*b+1],H[3*b+2]],y,K?[K[2*b],K[2*b+1],0]:i),new bi([H[3*$],H[3*$+1],H[3*$+2]],y,K?[K[2*$],K[2*$+1],0]:i),new bi([H[3*f],H[3*f+1],H[3*f+2]],y,K?[K[2*f],K[2*f+1],0]:i)],O));else for(l=H.length;l>h;h+=3)b=h,$=h+1,f=h+2,u.push(new Np([new bi([H[3*b],H[3*b+1],H[3*b+2]],y,K?[K[2*b],K[2*b+1],0]:i),new bi([H[3*$],H[3*$+1],H[3*$+2]],y,K?[K[2*$],K[2*$+1],0]:i),new bi([H[3*f],H[3*f+1],H[3*f+2]],y,K?[K[2*f],K[2*f+1],0]:i)],O));return u},Nl=[m,s,n,F,r,D],Te=Nl.concat("csg"),Er=[0,6,12,18,24,30],df=function(r,b,w){for(var Q=$(r),Y=[],P=0;6>P;P++)for(var x=Nl[P],C=Er[P],s=w?b.getFaceUv(r,x):i,D=w?b.getFaceUvScale(r,x):i,G=w?b.getFaceUvOffset(r,x):i,A=0;2>A;A++){var J,p,W,S=Z[C+3*A],d=Z[C+3*A+1],M=Z[C+3*A+2];if(w){if(s){var k=8*P;J=[s[2*S-k],s[2*S+1-k],0],p=[s[2*d-k],s[2*d+1-k],0],W=[s[2*M-k],s[2*M+1-k],0]}else J=[R[2*S],R[2*S+1],0],p=[R[2*d],R[2*d+1],0],W=[R[2*M],R[2*M+1],0];D&&(J[0]*=D[0],J[1]*=D[1],p[0]*=D[0],p[1]*=D[1],W[0]*=D[0],W[1]*=D[1]),G&&(J[0]+=G[0],J[1]+=G[1],p[0]+=G[0],p[1]+=G[1],W[0]+=G[0],W[1]+=G[1])}Y.push(new Np([new bi(N([l[3*S],l[3*S+1],l[3*S+2]],Q),y,J),new bi(N([l[3*d],l[3*d+1],l[3*d+2]],Q),y,p),new bi(N([l[3*M],l[3*M+1],l[3*M+2]],Q),y,W)],r))}return Jj.$15n(Y)},jn=function(k,l){var L,j=k.data.getAttaches();if(j&&j.each(function(K){K instanceof ym&&K.s("attach.operation")&&(L||(L=[]),L.push(K))}),L){var J;Nl.forEach(function(A){var m=Vg(A,k[A].vs,k[A].tuv);J=J?J.concat(m):m}),J=Jj.$15n(J),L.forEach(function(Y){var h=Y.s("attach.operation");J[h]&&(J=J[h](df(Y,k.gv,k.csg.tuv)))}),Nl.forEach(function(R){R=k[R],R.vs=[],R.tuv&&(R.tuv=[])}),J.$19n().forEach(function(c){var q=c.$10n;if(q instanceof ym){if(q.s("attach.cull"))return;q="csg"}for(var C=k[q],o=C.vs,u=C.tuv,g=c.$9n,T=2;T<g.length;T++)_(o,g[0].$24n),_(o,g[T-1].$24n),_(o,g[T].$24n),u&&(_(u,g[0].uv,!0),_(u,g[T-1].uv,!0),_(u,g[T].uv,!0))})}Te.forEach(function(g){var K=k[g];K.visible&&K.vs.length?(K.ns=x(K.vs),U(K,"vs"),U(K,"tuv")):delete k[g]}),l&&(v(k,i,l),k.clear())};K(b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5-m,-.5+l,-.5,.5-m,.5-l,-.5,.5,-.5+l,-.5,.5,.5-l,-.5,-.5+m,-.5+l,-.5,-.5,.5-l,-.5,-.5,-.5+l,-.5,-.5,.5-l,-.5,-.5+m,-.5+l,-.5,-.5+m),H.push(1,0,1-l,1,1,1,1-l,1,1,0,1-l,0,l,0,0,1,l,1,0,1,l,0,0,0,1-l,0,l,m,1-l,m,l,m,1-l,0,l,0,1-l,1-m,l,1,1-l,1,l,1,1-l,1-m,l,1-m)),{vs:b,uv:H}}}),K(c.Style,{"dw.flip":!1,"dw.s3":[.999,.999,.5],"dw.t3":p,"dw.expanded":!1,"dw.toggleable":!0,"dw.axis":"left","dw.start":0,"dw.end":B/2,"dw.angle":0,"attach.cull":!1,"attach.operation":"subtract"},!0),Nl.forEach(function(J){var L={};L[J+k]=!1,L[J+".toggleable"]=!1,L[J+".axis"]=m,L[J+".start"]=0,L[J+".end"]=B/2,L[J+Q]=0,K(c.Style,L,!0)});var Jj=function(){this.$4n=[]};Jj.$15n=function(U){var S=new Jj;return S.$4n=U,S},Jj.prototype={clone:function(){var r=new Jj;return r.$4n=this.$4n.map(function(T){return T.clone()}),r},$19n:function(){return this.$4n},union:function(p){var F=new zm(this.clone().$4n),R=new zm(p.clone().$4n);return F.$3n(R),R.$3n(F),R.$6n(),R.$3n(F),R.$6n(),F.$7n(R.$2n()),Jj.$15n(F.$2n())},subtract:function(j){var o=new zm(this.clone().$4n),X=new zm(j.clone().$4n);return o.$6n(),o.$3n(X),X.$3n(o),X.$6n(),X.$3n(o),X.$6n(),o.$7n(X.$2n()),o.$6n(),Jj.$15n(o.$2n())},intersect:function(W){var c=new zm(this.clone().$4n),H=new zm(W.clone().$4n);return c.$6n(),H.$3n(c),H.$6n(),c.$3n(H),H.$3n(c),c.$7n(H.$2n()),c.$6n(),Jj.$15n(c.$2n())},inverse:function(){var p=this.clone();return p.$4n.map(function(Y){Y.flip()}),p}},Jj.cube=function(J){J=J||{};var x=new Fn(J.center||[0,0,0]),T=J.radius?J.radius.length?J.radius:[J.radius,J.radius,J.radius]:[1,1,1];return Jj.$15n([[[0,4,6,2],[-1,0,0]],[[1,3,7,5],[1,0,0]],[[0,1,5,4],[0,-1,0]],[[2,6,7,3],[0,1,0]],[[0,2,3,1],[0,0,-1]],[[4,5,7,6],[0,0,1]]].map(function(F){return new Np(F[0].map(function(t){var Q=new Fn(x.x+T[0]*(2*!!(1&t)-1),x.y+T[1]*(2*!!(2&t)-1),x.z+T[2]*(2*!!(4&t)-1));return new bi(Q,new Fn(F[1]))}))}))},Jj.sphere=function(f){function M(F,K){F*=2*B,K*=B;var t=new Fn(w(F)*j(K),w(K),j(F)*j(K));D.push(new bi(Q.$20n(t.$21n(I)),t))}f=f||{};for(var D,Q=new Fn(f.center||[0,0,0]),I=f.radius||1,X=f.slices||16,U=f.stacks||8,A=[],$=0;X>$;$++)for(var z=0;U>z;z++)D=[],M($/X,z/U),z>0&&M(($+1)/X,z/U),U-1>z&&M(($+1)/X,(z+1)/U),M($/X,(z+1)/U),A.push(new Np(D));return Jj.$15n(A)},Jj.cylinder=function(s){function b(e,X,x){var P=2*X*B,f=i.$21n(w(P)).$20n(n.$21n(j(P))),l=Y.$20n(D.$21n(e)).$20n(f.$21n(c)),y=f.$21n(1-H(x)).$20n(m.$21n(x));return new bi(l,y)}s=s||{};for(var Y=new Fn(s.start||[0,-1,0]),X=new Fn(s.end||[0,1,0]),D=X.$13n(Y),c=s.radius||1,A=s.slices||16,m=D.$14n(),L=H(m.y)>.5,i=new Fn(L,!L,0).$12n(m).$14n(),n=i.$12n(m).$14n(),Z=new bi(Y,m.$11n()),d=new bi(X,m.$14n()),a=[],p=0;A>p;p++){var l=p/A,P=(p+1)/A;a.push(new Np([Z,b(0,l,-1),b(0,P,-1)])),a.push(new Np([b(0,P,0),b(0,l,0),b(1,l,0),b(1,P,0)])),a.push(new Np([d,b(1,P,1),b(1,l,1)]))}return Jj.$15n(a)};var Fn=function(S,M,Y){var P=this;3==arguments.length?(P.x=S,P.y=M,P.z=Y):"x"in S?(P.x=S.x,P.y=S.y,P.z=S.z):(P.x=S[0],P.y=S[1],P.z=S[2])};Fn.prototype={clone:function(){return new Fn(this.x,this.y,this.z)},$11n:function(){return new Fn(-this.x,-this.y,-this.z)},$20n:function(n){return new Fn(this.x+n.x,this.y+n.y,this.z+n.z)},$13n:function(G){return new Fn(this.x-G.x,this.y-G.y,this.z-G.z)},$21n:function(k){return new Fn(this.x*k,this.y*k,this.z*k)},$16n:function(G){return new Fn(this.x/G,this.y/G,this.z/G)},$23n:function(X){return this.x*X.x+this.y*X.y+this.z*X.z},lerp:function(l,J){return this.$20n(l.$13n(this).$21n(J))},length:function(){return T(this.$23n(this))},$14n:function(){return this.$16n(this.length())},$12n:function(U){var M=this;return new Fn(M.y*U.z-M.z*U.y,M.z*U.x-M.x*U.z,M.x*U.y-M.y*U.x)}};var bi=function(Q,s,V){var F=this;F.$24n=new Fn(Q),F.$22n=new Fn(s),F.uv=V?new Fn(V):null};bi.prototype={clone:function(){var D=this;return new bi(D.$24n.clone(),D.$22n.clone(),D.uv?D.uv.clone():null)},flip:function(){this.$22n=this.$22n.$11n()},$18n:function(C,x){var D=this;return new bi(D.$24n.lerp(C.$24n,x),D.$22n.lerp(C.$22n,x),D.uv?D.uv.lerp(C.uv,x):null)}};var Fd=function(j,y){this.$22n=j,this.w=y};Fd.$17n=function(K,e,E){var T=e.$13n(K).$12n(E.$13n(K)).$14n();return new Fd(T,T.$23n(K))},Fd.prototype={clone:function(){return new Fd(this.$22n.clone(),this.w)},flip:function(){var R=this;R.$22n=R.$22n.$11n(),R.w=-R.w},$5n:function(c,x,s,u,r){for(var f=this,Z=0,y=1,W=2,d=3,R=0,E=[],q=0;q<c.$9n.length;q++){var k=f.$22n.$23n(c.$9n[q].$24n)-f.w,O=-h>k?W:k>h?y:Z;R|=O,E.push(O)}switch(R){case Z:(f.$22n.$23n(c.$8n.$22n)>0?x:s).push(c);break;case y:u.push(c);break;case W:r.push(c);break;case d:for(var C=[],H=[],q=0;q<c.$9n.length;q++){var i=(q+1)%c.$9n.length,w=E[q],Y=E[i],G=c.$9n[q],P=c.$9n[i];if(w!=W&&C.push(G),w!=y&&H.push(w!=W?G.clone():G),(w|Y)==d){var k=(f.w-this.$22n.$23n(G.$24n))/f.$22n.$23n(P.$24n.$13n(G.$24n)),v=G.$18n(P,k);C.push(v),H.push(v.clone())}}C.length>=3&&u.push(new Np(C,c.$10n)),H.length>=3&&r.push(new Np(H,c.$10n))}}};var Np=function(i,w){var C=this;C.$9n=i,C.$10n=w,C.$8n=Fd.$17n(i[0].$24n,i[1].$24n,i[2].$24n)};Np.prototype={clone:function(){var z=this.$9n.map(function(n){return n.clone()});return new Np(z,this.$10n)},flip:function(){this.$9n.reverse().map(function(X){X.flip()}),this.$8n.flip()}};var zm=function(l){var O=this;O.$8n=null,O.front=null,O.back=null,O.$4n=[],l&&O.$7n(l)};zm.prototype={clone:function(){var L=this,K=new zm;return K.$8n=L.$8n&&L.$8n.clone(),K.front=L.front&&L.front.clone(),K.back=L.back&&L.back.clone(),K.$4n=L.$4n.map(function(i){return i.clone()}),K},$6n:function(){for(var b=this,Z=0;Z<b.$4n.length;Z++)b.$4n[Z].flip();b.$8n.flip(),b.front&&b.front.$6n(),b.back&&b.back.$6n();var h=b.front;b.front=b.back,b.back=h},$1n:function(v){var s=this;if(!s.$8n)return v.slice();for(var Z=[],r=[],m=0;m<v.length;m++)s.$8n.$5n(v[m],Z,r,Z,r);return s.front&&(Z=s.front.$1n(Z)),r=s.back?s.back.$1n(r):[],Z.concat(r)},$3n:function(r){var I=this;I.$4n=r.$1n(I.$4n),I.front&&I.front.$3n(r),I.back&&I.back.$3n(r)},$2n:function(){var L=this,s=L.$4n.slice();return L.front&&(s=s.concat(L.front.$2n())),L.back&&(s=s.concat(L.back.$2n())),s},$7n:function(P){var A=this;if(P.length){A.$8n||(A.$8n=P[0].$8n.clone());for(var f=[],k=[],K=0;K<P.length;K++)this.$8n.$5n(P[K],A.$4n,A.$4n,f,k);f.length&&(A.front||(A.front=new zm),this.front.$7n(f)),k.length&&(A.back||(A.back=new zm),A.back.$7n(k))}}};var rp="symbol",us=c.Symbol=function(J,w,l){var H=this;W(us,H),H.s3(20,20,20),H.s({"all.visible":!1,shape:"rect"}),H.setIcon(J,w,l)};a("Symbol",I,{setIcon:function(Z,U,V){var x,G=this;return us.superClass.setIcon.call(G,Z),Z?(x={for3d:!0,face:"center",position:44,names:[Z]},V&&(x.transaprent=!0),U&&(x.autorotate=U),G.addStyleIcon(rp,x)):G.removeStyleIcon(rp),G.setWidth(L.getImageWidth(b.getImage(Z),G)||20),x}});var ym=c.CSGNode=function(){W(ym,this),this.s({shape:"rect","attach.thickness":1.001})},fl={position:1,width:1,height:1,rotation:1,rotationX:1,rotationZ:1,rotationMode:1,tall:1,elevation:1,"s:attach.cull":1,"s:attach.operation":1};a("CSGNode",I,{_22Q:function(){return Vj},onPropertyChanged:function(_){var s=this,S=s.getHost();ym.superClass.onPropertyChanged.call(s,_),fl[_.property]&&(S instanceof vm||S instanceof ym)&&S.fp("csgNodeChange",!0,!1)}});var Vj=function(l,f){W(Vj,this,[l,f])};E(Vj,g.Node3dUI,{_80o:function(N,l,p){var G=this;G._shape3d?Vj.superClass._80o.call(G,N,l,p):(X(G.gv),Te.forEach(function(C){V(G,N,l,G[C],p)}))},validate:function(P,z){var p=this,k=p.gv,Q=p.data;if(Q.s("shape3d"))return Vj.superClass.validate.call(p,P,z),p._shape3d=!0,void 0;p._shape3d=!1;var c=$(Q,k.getMat(Q)),i=P&&P.uv;p.vf2("csg",i);for(var F=0;6>F;F++)for(var q=Nl[F],d=Er[F],B=p.vf2(q,i,z),o=B.mat||c,e=B.vs,D=B.uv,r=B.tuv,M=0;2>M;M++){var g=Z[d+3*M],u=Z[d+3*M+1],V=Z[d+3*M+2];if(t(e,o,[l[3*g],l[3*g+1],l[3*g+2]]),t(e,o,[l[3*u],l[3*u+1],l[3*u+2]]),t(e,o,[l[3*V],l[3*V+1],l[3*V+2]]),r)if(D){var N=8*F;r.push(D[2*g-N],D[2*g+1-N],D[2*u-N],D[2*u+1-N],D[2*V-N],D[2*V+1-N])}else r.push(R[2*g],R[2*g+1],R[2*u],R[2*u+1],R[2*V],R[2*V+1])}jn(p,P,z)},vf2:function(P,o,s){var X,n=this,G=n.gv.getFaceVisible(n.data,P);return X=d(n,P,s),X.vs=[],X.tuv=G&&(X.texture||o)?[]:i,X.visible=G,X}});var vm=c.CSGShape=function(){var r=this;W(vm,r),r.s({"shape.background":i,"shape.border.width":8}),r.setTall(240),r.setElevation(120),r.setThickness(14)};a("CSGShape",u,{IRotatable:!1,_22Q:function(){return Am},setRotationX:function(){},setRotation:function(){},setRotationZ:function(){},setSegments:function(){}});var Am=function(Z,h){W(Am,this,[Z,h])};E(Am,g.Shape3dUI,{_80o:function(h,T,m){var e=this;e.undrawable||(X(e.gv),Te.forEach(function(u){V(e,h,T,e[u],m)}))},validate:function(A,w){var a=this,I=a.data,D=I.getPoints();if(a.undrawable=D.size()<2)return a.clear(),void 0;var k=I.isClosePath(),z=O(I._thickness/2,h),j=G(D,i,i,k);Te.forEach(function(D){a.vf(D,A&&A.uv,!0,w)}),k&&(a.left.visible=!1,a.right.visible=!1),a._12O(j,z),a._20Q(j),jn(a,A,w)}});var tb=c.DoorWindow=function(){var _=this;W(tb,_),_.setElevation(100),_.s3(100,200,14)};a("DoorWindow",ym,{IDoorWindow:!0,toggle:function(P){this.setExpanded(!this.s(e),P)},isExpanded:function(){return this.s(e)},setExpanded:function(J,j){var T,z=this,C=z.$25n,D=z.getDataModel(),r=z.s(e);if(D&&(T=D.getHistoryManager()),C&&(C.stop(!0),delete z.$25n),r!==J){T&&T.beginInteraction();var N=J?z.s("dw.end"):z.s("dw.start");z.s(e,J),j=P(j),j?(r=z.s(S),j.action=function(h){z.s(S,r+(N-r)*h)},j.finishFunc=function(){T&&T.endInteraction()},z.$25n=f(j)):(z.s(S,N),T&&T.endInteraction())}},getMat:function(){var f=this,s=f.s("dw.s3"),b=f.s("dw.t3"),L=f.s("dw.flip"),z=f.s(S);if(s||z||b||L){var t=[];if(L&&t.push({r3:[0,B,0]}),s&&t.push({s3:s}),z){s=f.s3();var P=f.s("dw.axis"),T=s[0]/2,h=s[1]/2;s[2]/2,P===m?t.push({t3:[T,0,0]},{r3:[0,-z,0]},{t3:[-T,0,0]}):P===n?t.push({t3:[-T,0,0]},{r3:[0,z,0]},{t3:[T,0,0]}):P===r?t.push({t3:[0,-h,0]},{r3:[-z,0,0]},{t3:[0,h,0]}):P===D?t.push({t3:[0,h,0]},{r3:[z,0,0]},{t3:[0,-h,0]}):P===J?t.push({r3:[0,z,0]}):P===M&&t.push({r3:[z,0,0]})}return b&&t.push({t3:b}),q(t)}return i}});var _k=c.CSGBox=function(){var f=this;W(_k,f),f.setElevation(100),f.s3(100,200,100)};a("CSGBox",ym,{ICSGBox:!0,toggleFace:function(l,Y){this.setFaceExpanded(l,!this.s(l+k),Y)},isFaceExpanded:function(N){return this.s(N+k)},setFaceExpanded:function(Z,j,B){var X=this,y=X.$25n,p=X.s(Z+k);if(y&&(y.stop(!0),delete X.$25n),p!==j){var C=j?X.s(Z+".end"):X.s(Z+".start");X.s(Z+k,j),B=P(B),B?(p=X.s(Z+Q),B.action=function(z){X.s(Z+Q,p+(C-p)*z)},X.$25n=f(B)):X.s(Z+Q,C)}},getFaceMat:function(k){var V=this,u=V.s(k+Q);if(!u)return i;var X=V.s(k+".axis"),H=V.s3(),K=H[0]/2,p=H[1]/2,v=H[2]/2,g=[];return k===s&&(X===m?g.push({t3:[K,0,-v]},{r3:[0,-u,0]},{t3:[-K,0,v]}):X===n?g.push({t3:[-K,0,-v]},{r3:[0,u,0]},{t3:[K,0,v]}):X===r?g.push({t3:[0,-p,-v]},{r3:[-u,0,0]},{t3:[0,p,v]}):X===D?g.push({t3:[0,p,-v]},{r3:[u,0,0]},{t3:[0,-p,v]}):X===J?g.push({t3:[0,0,-v]},{r3:[0,u,0]},{t3:[0,0,v]}):X===M&&g.push({t3:[0,0,-v]},{r3:[u,0,0]},{t3:[0,0,v]})),k===F&&(X===m?g.push({t3:[-K,0,v]},{r3:[0,-u,0]},{t3:[K,0,-v]}):X===n?g.push({t3:[K,0,v]},{r3:[0,u,0]},{t3:[-K,0,-v]}):X===r?g.push({t3:[0,-p,v]},{r3:[u,0,0]},{t3:[0,p,-v]}):X===D?g.push({t3:[0,p,v]},{r3:[-u,0,0]},{t3:[0,-p,-v]}):X===J?g.push({t3:[0,0,v]},{r3:[0,u,0]},{t3:[0,0,-v]}):X===M&&g.push({t3:[0,0,v]},{r3:[u,0,0]},{t3:[0,0,-v]})),k===m&&(X===m?g.push({t3:[K,0,v]},{r3:[0,-u,0]},{t3:[-K,0,-v]}):X===n?g.push({t3:[K,0,-v]},{r3:[0,u,0]},{t3:[-K,0,v]}):X===r?g.push({t3:[K,-p,0]},{r3:[0,0,-u]},{t3:[-K,p,0]}):X===D?g.push({t3:[K,p,0]},{r3:[0,0,u]},{t3:[-K,-p,0]}):X===J?g.push({t3:[K,0,0]},{r3:[0,u,0]},{t3:[-K,0,0]}):X===M&&g.push({t3:[K,0,0]},{r3:[0,0,u]},{t3:[-K,0,0]})),k===n&&(X===m?g.push({t3:[-K,0,-v]},{r3:[0,-u,0]},{t3:[K,0,v]}):X===n?g.push({t3:[-K,0,v]},{r3:[0,u,0]},{t3:[K,0,-v]}):X===r?g.push({t3:[-K,-p,0]},{r3:[0,0,u]},{t3:[K,p,0]}):X===D?g.push({t3:[-K,p,0]},{r3:[0,0,-u]},{t3:[K,-p,0]}):X===J?g.push({t3:[-K,0,0]},{r3:[0,u,0]},{t3:[K,0,0]}):X===M&&g.push({t3:[-K,0,0]},{r3:[0,0,u]},{t3:[K,0,0]})),k===r&&(X===m?g.push({t3:[K,-p,0]},{r3:[0,0,u]},{t3:[-K,p,0]}):X===n?g.push({t3:[-K,-p,0]},{r3:[0,0,-u]},{t3:[K,p,0]}):X===r?g.push({t3:[0,-p,v]},{r3:[-u,0,0]},{t3:[0,p,-v]}):X===D?g.push({t3:[0,-p,-v]},{r3:[u,0,0]},{t3:[0,p,v]}):X===J?g.push({t3:[0,-p,0]},{r3:[0,0,u]},{t3:[0,p,0]}):X===M&&g.push({t3:[0,-p,0]},{r3:[u,0,0]},{t3:[0,p,0]})),k===D&&(X===m?g.push({t3:[K,p,0]},{r3:[0,0,-u]},{t3:[-K,-p,0]}):X===n?g.push({t3:[-K,p,0]},{r3:[0,0,u]},{t3:[K,-p,0]}):X===r?g.push({t3:[0,p,-v]},{r3:[-u,0,0]},{t3:[0,-p,v]}):X===D?g.push({t3:[0,p,v]},{r3:[u,0,0]},{t3:[0,-p,-v]}):X===J?g.push({t3:[0,p,0]},{r3:[0,0,u]},{t3:[0,-p,0]}):X===M&&g.push({t3:[0,p,0]},{r3:[u,0,0]},{t3:[0,-p,0]})),q(g)}})}("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:this,Object);
|