designix-uis 0.5.4 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/designix-uis.js +7 -7
- package/dist/public/_app/immutable/assets/3.Bup7ghXO.css +1 -0
- package/dist/public/_app/immutable/assets/_page.Bup7ghXO.css +1 -0
- package/dist/public/_app/immutable/chunks/{entry.C3zjkdvH.js → entry.CsF6fnqO.js} +1 -1
- package/dist/public/_app/immutable/chunks/index.Cm-3kLLR.js +114 -0
- package/dist/public/_app/immutable/chunks/makeList.BiFeMQLr.js +88 -0
- package/dist/public/_app/immutable/chunks/paths.ClSAQomf.js +1 -0
- package/dist/public/_app/immutable/chunks/{stores.Huum2hKK.js → stores.DVTgRUTa.js} +1 -1
- package/dist/public/_app/immutable/entry/app.C-LiF7Ib.js +7 -0
- package/dist/public/_app/immutable/entry/start.DwZ0Xc6p.js +1 -0
- package/dist/public/_app/immutable/nodes/{0.nCmV09r4.js → 0.CZsUlPuR.js} +1 -1
- package/dist/public/_app/immutable/nodes/{1.Cl2Wb2Sv.js → 1.BqYeci0V.js} +1 -1
- package/dist/public/_app/immutable/nodes/{2.D3m9DKE0.js → 2.C-L5mEiC.js} +1 -1
- package/dist/public/_app/immutable/nodes/3.fFlQHaXT.js +18 -0
- package/dist/public/_app/version.json +1 -1
- package/dist/public/gear/gear_wheel_wheel.html +20 -20
- package/dist/public/gear/simplified_gear_wheel.html +37 -37
- package/dist/public/heliostat/base.html +20 -20
- package/dist/public/heliostat/heliostat.html +20 -20
- package/dist/public/heliostat/heliostat_2.html +20 -20
- package/dist/public/heliostat/pole_rotor.html +20 -20
- package/dist/public/heliostat/pole_static.html +20 -20
- package/dist/public/heliostat/rake.html +20 -20
- package/dist/public/heliostat/rake_stopper.html +20 -20
- package/dist/public/heliostat/rod.html +20 -20
- package/dist/public/heliostat/spider.html +20 -20
- package/dist/public/heliostat/surface.html +20 -20
- package/dist/public/heliostat/swing.html +20 -20
- package/dist/public/heliostat/trapeze.html +20 -20
- package/dist/public/index.html +19 -19
- package/package.json +7 -7
- package/dist/public/_app/immutable/assets/3.wWOitVXS.css +0 -1
- package/dist/public/_app/immutable/assets/_page.wWOitVXS.css +0 -1
- package/dist/public/_app/immutable/chunks/index.BROvJSft.js +0 -114
- package/dist/public/_app/immutable/chunks/makeList.BtRSVN7R.js +0 -88
- package/dist/public/_app/immutable/chunks/paths.CQQiRxnm.js +0 -1
- package/dist/public/_app/immutable/entry/app.BpxPkBw3.js +0 -7
- package/dist/public/_app/immutable/entry/start.Bz7pahS0.js +0 -1
- package/dist/public/_app/immutable/nodes/3.DPcZI3eM.js +0 -17
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
var le=Object.defineProperty;var re=(l,t,s)=>t in l?le(l,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[t]=s;var V=(l,t,s)=>(re(l,typeof t!="symbol"?t+"":t,s),s);import{p as e,a as rt,b as wt,i as nt,d as Et,f as L,c as z,E as O,g as Z,h as dt,j as ct,k as ht,r as st,l as v,m as C,n as et,o as tt,q as xt,s as kt,w as Nt,S as St,t as de}from"./index.BROvJSft.js";var ce=class{constructor(l,t,s,n,o){V(this,"base_center_x");V(this,"base_center_y");V(this,"base_radius");V(this,"initial_angle");V(this,"right_nleft");this.base_center_x=l,this.base_center_y=t,this.base_radius=s,this.initial_angle=n,this.right_nleft=o}angleSign(){return this.right_nleft?1:-1}lFromU(l){return this.base_radius*Math.sqrt(1+l**2)}wFromU(l){if(l<0)throw`err729: involute parameter au ${l} is negative`;if(Math.abs(l)>Math.PI/2)throw`err730: involute parameter au ${l} is larger than PI/2`;return this.angleSign()*(l-Math.atan(l))}w2FromU(l){return this.initial_angle+this.wFromU(l)}ptc(l){const t=this.lFromU(l),s=this.w2FromU(l),n=this.base_center_x+Math.cos(s)*t,o=this.base_center_y+Math.sin(s)*t;return[n,o]}ptcta(l){return this.initial_angle+this.angleSign()*l}uFromL(l){return Math.sqrt(l**2/this.base_radius**2-1)}uFromWslow(l){let s=Math.PI/3,n=s/2,o=this.wFromU(s),i=0;for(;Math.abs(o-l)>1e-4;)o<l?s+=n:s-=n,o=this.wFromU(s),n=n/2,i+=1;return console.log(`dbg072: uFromWslow itcnt ${i}`),s}laptc(l,t,s,n){if(Math.sign(t)*this.angleSign()<0)throw`err904: Invole.laptc angle-of-pressure ${t} not compatible with right_nleft ${this.right_nleft}`;const o=l+t,i=this.base_center_x+Math.cos(o)*this.base_radius,d=this.base_center_y+Math.sin(o)*this.base_radius,w=o-this.angleSign()*Math.PI/2,_=s*this.base_radius,a=i+Math.cos(w)*_,h=d+Math.sin(w)*_,r=this.lFromU(s)*n,c=s,f=Math.cos(c)*r,N=Math.sin(c)*r;return[a,h,f,N]}};function gt(l,t,s,n,o){return new ce(l,t,s,n,o)}var he=class{constructor(){V(this,"mod",1);V(this,"TN",23);V(this,"as",1);V(this,"cx",0);V(this,"cy",0);V(this,"brr",50);V(this,"blr",50);V(this,"ar",54);V(this,"pr",53);V(this,"dr",52);V(this,"br",51);V(this,"bRound",1);V(this,"adt",.5);V(this,"initAngle",0);V(this,"axisAngle",0);V(this,"involArcPairs",1);V(this,"skinThickness",0);V(this,"involuteR",gt(0,0,50,0,!0));V(this,"involuteL",gt(0,0,50,0,!1));V(this,"rud",0);V(this,"rup",0);V(this,"rua",0);V(this,"rwd",0);V(this,"rwp",0);V(this,"rwa",0);V(this,"lud",0);V(this,"lup",0);V(this,"lua",0);V(this,"lwd",0);V(this,"lwp",0);V(this,"lwa",0);V(this,"msg");V(this,"initStep",0);this.mod=1,this.msg="",this.initStep=0}incInitStep(l){if(this.initStep+1!==l)throw`err834: incInitStep initStep ${this.initStep} and target ${l} are not compatible`;this.initStep=l}checkInitStep(l,t){if(this.initStep<l)throw`err835: checkInitStep for ${t} initStep ${this.initStep} is too small compare to targetMin ${l}`}set1ModuleToothNumber(l,t){this.incInitStep(1),this.mod=l,this.TN=t,this.pr=this.mod*this.TN/2,this.as=2*Math.PI/this.TN}set2CenterPosition(l,t){this.incInitStep(2),this.cx=l,this.cy=t}set3CircleRadius(l,t,s,n){this.incInitStep(3),this.ar=this.pr+this.mod*l,this.dr=this.pr-this.mod*t,this.br=this.dr-this.mod*s,this.bRound=n}set4BaseCircles(l,t){this.incInitStep(4),this.brr=l,this.blr=t}set5AddendumThickness(l){this.incInitStep(5),this.adt=l/100}set6Angles(l,t){this.incInitStep(6),this.initAngle=l,this.axisAngle=t}set7InvoluteDetails(l,t){this.incInitStep(7),this.involArcPairs=l,this.skinThickness=t}getRefCircles(){return this.checkInitStep(4,"getRefCircles"),[v(this.cx,this.cy,this.ar,"Azure"),v(this.cx,this.cy,this.pr,"Azure"),v(this.cx,this.cy,this.dr,"Azure"),v(this.cx,this.cy,this.br,"Azure"),v(this.cx,this.cy,this.brr,"CornFlowerBlue"),v(this.cx,this.cy,this.blr,"Crimson")]}calcInvoluteAngles(){this.checkInitStep(4,"calcInvoluteAngles"),this.involuteR=gt(this.cx,this.cy,this.brr,0,!0),this.dr>this.brr?this.rud=this.involuteR.uFromL(this.dr):this.rud=0,this.rup=this.involuteR.uFromL(this.pr),this.rua=this.involuteR.uFromL(this.ar),this.rwd=this.involuteR.wFromU(this.rud),this.rwp=this.involuteR.wFromU(this.rup),this.rwa=this.involuteR.wFromU(this.rua),this.involuteL=gt(this.cx,this.cy,this.blr,0,!1),this.dr>this.blr?this.lud=this.involuteL.uFromL(this.dr):this.rud=0,this.lup=this.involuteL.uFromL(this.pr),this.lua=this.involuteL.uFromL(this.ar),this.lwd=this.involuteL.wFromU(this.lud),this.lwp=this.involuteL.wFromU(this.lup),this.lwa=this.involuteL.wFromU(this.lua)}checkProfileConditions(){const l=this.as*this.adt,t=this.rwa-this.rwp,s=Math.abs(this.lwa-this.lwp),n=l-t-s;if(n<0)throw`err554: No remaining Addendum reserve ${L(n)}
|
|
2
|
-
`;const o=this.as*(1-this.adt),i=this.rwp-this.rwd,d=Math.abs(this.lwp-this.lwd),w=o-i-d;if(w<2*Math.atan2(this.bRound,this.br))throw`err555: No remaining Dedendum reserve ${L(w)} compare to bRound ${L(this.bRound)}
|
|
3
|
-
`}getToothRef(){const l=6*this.involArcPairs,t=0;this.checkInitStep(7,"getProfile"),this.calcInvoluteAngles();const s=(this.rua-this.rud)/l,n=(this.lua-this.lud)/l,o=this.initAngle+t*this.as,i=gt(this.cx,this.cy,this.brr,o-this.rwp,!0),[d,w]=i.ptc(this.rud+0*s),_=z(d,w,"Gold");for(let g=0;g<l;g++){const[r,c]=i.ptc(this.rud+(g+1)*s);_.addSegStrokeA(r,c)}const a=o+this.as*this.adt,h=gt(this.cx,this.cy,this.blr,a-this.lwp,!1);for(let g=0;g<l+1;g++){const[r,c]=h.ptc(this.lud+(l-g)*n);_.addSegStrokeA(r,c)}return _.closeSegStroke(),_}getProfile(){this.checkInitStep(7,"getProfile"),this.calcInvoluteAngles(),this.checkProfileConditions();const l=this.rwd-this.rwp,t=this.lwd-this.lwp,s=this.dr>this.brr?this.dr:this.brr,n=this.dr>this.blr?this.dr:this.blr;if(this.bRound>s-this.br)throw`err409: getProfile bRound ${L(this.bRound)} too large for erdr ${L(s)} and br ${L(this.br)}`;if(this.bRound>n-this.br)throw`err408: getProfile bRound ${L(this.bRound)} too large for eldr ${L(n)} and br ${L(this.br)}`;const o=(this.rua-this.rud)/this.involArcPairs,i=(this.lua-this.lud)/this.involArcPairs,d=et(this.cx,this.cy),w=d.translatePolar(this.initAngle+l,this.br),_=z(w.cx,w.cy);for(let a=0;a<this.TN;a++){const h=this.initAngle+a*this.as,g=d.translatePolar(h+l,this.br);_.addSegStrokeA(g.cx,g.cy).addCornerRounded(this.bRound);const r=gt(this.cx,this.cy,this.brr,h-this.rwp,!0),[c,f]=r.ptc(this.rud),N=r.ptcta(this.rud),y=et(c,f).translatePolar(N-Math.PI/2,this.skinThickness);_.addSegStrokeA(y.cx,y.cy);for(let u=0;u<this.involArcPairs;u++){const H=this.rud+u*o,[I,M]=r.ptc(H+o),B=r.ptcta(H),T=r.ptcta(H+o)+Math.PI,F=et(I,M).translatePolar(B-Math.PI/2,this.skinThickness);_.addPointA(F.cx,F.cy).addSeg2Arcs(B,T)}const x=h+this.as*this.adt,A=gt(this.cx,this.cy,this.blr,x-this.lwp,!1),S=this.lud+this.involArcPairs*i,[R,D]=A.ptc(S),k=A.ptcta(S)+Math.PI,$=et(R,D).translatePolar(k-Math.PI/2,this.skinThickness);_.addSegStrokeA($.cx,$.cy);for(let u=0;u<this.involArcPairs;u++){const H=this.lud+(this.involArcPairs-u)*i,[I,M]=A.ptc(H-i),B=A.ptcta(H)+Math.PI,T=A.ptcta(H-i),F=et(I,M).translatePolar(B-Math.PI/2,this.skinThickness);_.addPointA(F.cx,F.cy).addSeg2Arcs(B,T)}const b=d.translatePolar(x+t,this.br);_.addSegStrokeA(b.cx,b.cy).addCornerRounded(this.bRound)}return _.closeSegStroke(),_}getMsg(){return this.msg}};function Wt(){return new he}function ae(l,t,s,n){l.checkInitStep(1,"helper.gw2center-1"),t.checkInitStep(1,"helper.gw2center-2");const o=l.pr+t.pr+n,i=l.cx+o*Math.cos(s),d=l.cy+o*Math.sin(s);return[i,d,o]}function ge(l,t,s,n,o,i,d,w,_){l.checkInitStep(3,"helper.baseCircles-1"),t.checkInitStep(3,"helper.baseCircles-2");let a=s,h=o,g=n,r=i;const c=w,f=_;return c===0&&(t.TN>l.TN?(a=l.dr,h=a*t.TN/l.TN):(h=t.dr,a=h*l.TN/t.TN)),f===0&&(t.TN>l.TN?(g=l.dr,r=g*t.TN/l.TN):(r=t.dr,g=r*l.TN/t.TN)),d===1&&(g=a,r=h),[a,g,h,r]}var ue=class{constructor(l,t,s,n,o,i){V(this,"gw1");V(this,"gw2");V(this,"initAngle1");V(this,"angleCenterCenter");V(this,"interAxis");V(this,"rightLeftCenter2");V(this,"msg");V(this,"apr");V(this,"apl");V(this,"lBDr",0);V(this,"lBDl",0);V(this,"laStartRr1",0);V(this,"laStartRr2",0);V(this,"laStartRl1",0);V(this,"laStartRl2",0);V(this,"aFODr1",0);V(this,"aFODr2",0);V(this,"aFODl1",0);V(this,"aFODl2",0);V(this,"lasr1",0);V(this,"lasr2",0);V(this,"lasl1",0);V(this,"lasl2",0);V(this,"firstToothUr1",0);V(this,"firstToothUl1",0);V(this,"ftdr1",0);V(this,"ftdl1",0);this.gw1=l,this.gw2=t,this.initAngle1=s,this.angleCenterCenter=n,this.interAxis=o,this.rightLeftCenter2=i,this.msg="",this.apr=0,this.apl=0}check1(){this.gw1.checkInitStep(4,"ActionLine.check1-1"),this.gw2.checkInitStep(4,"ActionLine.check1-2"),this.interAxis>this.gw1.ar+this.gw2.ar&&(this.msg+=`warn333: initAngle2 interAxis ${L(this.interAxis)} is too large compare to gw1.ar ${L(this.gw1.ar)} and gw2.ar ${L(this.gw2.ar)}
|
|
4
|
-
`),tt(this.gw1.brr*this.gw2.TN-this.gw2.brr*this.gw1.TN)!==0&&(this.msg+=`warn407: right ratios differ N1/N2 = ${this.gw1.TN} / ${this.gw2.TN} = ${L(this.gw1.TN/this.gw2.TN)} and brr1/brr2 = ${L(this.gw1.brr)}/${L(this.gw2.brr)} = ${L(this.gw1.brr/this.gw2.brr)}
|
|
5
|
-
`),tt(this.gw1.blr*this.gw2.TN-this.gw2.blr*this.gw1.TN)!==0&&(this.msg+=`warn408: left ratios differ N1/N2 = ${this.gw1.TN} / ${this.gw2.TN} = ${L(this.gw1.TN/this.gw2.TN)} and blr1/blr2 = ${L(this.gw1.blr)}/${L(this.gw2.blr)} = ${L(this.gw1.blr/this.gw2.blr)}
|
|
6
|
-
`)}check2(){this.gw1.checkInitStep(5,"ActionLine.check2-1"),this.gw2.checkInitStep(5,"ActionLine.check2-2"),tt(this.gw1.adt+this.gw2.adt-1)>0&&(this.msg+=`warn281: addendum thickness too large: adt1 ${L(this.gw1.adt)} adt2 ${L(this.gw2.adt)}
|
|
7
|
-
`);const l=this.gw1.ar-this.gw1.pr,t=this.gw1.pr-this.gw1.dr,s=this.gw2.ar-this.gw2.pr,n=this.gw2.pr-this.gw2.dr;tt(n-l)<0&&(this.msg+=`warn282: addendum-1 ${L(l)} larger than dedendum-2 ${L(n)}
|
|
8
|
-
`),tt(t-s)<0&&(this.msg+=`warn283: addendum-2 ${L(s)} larger than dedendum-1 ${L(t)}
|
|
9
|
-
`)}calcActionLine(){this.gw1.checkInitStep(4,"ActionLine.calcActionLine-1"),this.gw2.checkInitStep(4,"ActionLine.calcActionLine-2"),this.gw1.calcInvoluteAngles(),this.gw2.calcInvoluteAngles();const l=this.interAxis*this.gw1.brr/(this.gw1.brr+this.gw2.brr),t=this.interAxis*this.gw1.blr/(this.gw1.blr+this.gw2.blr),s=this.interAxis-l,n=this.interAxis-t;this.apr=Math.acos((this.gw1.brr+this.gw2.brr)/this.interAxis),this.apl=Math.acos((this.gw1.blr+this.gw2.blr)/this.interAxis),this.msg+=`Pressure angular: right: ${L(st(this.apr))} left: ${L(st(this.apl))} degree
|
|
10
|
-
`,this.lBDr=this.interAxis*Math.sin(this.apr),this.lBDl=this.interAxis*Math.sin(this.apl),this.msg+=`Line of Action Maximum length: right: ${L(this.lBDr)} left: ${L(this.lBDl)} mm
|
|
11
|
-
`;const o=Math.PI/2+this.apr,i=xt(this.gw1.ar,l,o);this.aFODr1=Math.PI-o-i;const d=this.gw1.rua-this.apr-this.gw1.rwa;if(tt(this.aFODr1-d)!==0)throw`dbg378: aFODr1 ${this.aFODr1} and aFODr1Alt ${d} differ`;const w=kt(l,this.gw1.ar,this.aFODr1),_=o,a=xt(this.gw2.ar,s,_);this.aFODr2=Math.PI-_-a;const h=this.gw2.rua-this.apr-this.gw2.rwa;if(tt(this.aFODr2-h)!==0)throw`dbg379: aFODr2 ${this.aFODr2} and aFODr2Alt ${h} differ`;const g=kt(s,this.gw2.ar,this.aFODr2),r=w+g,c=r/this.gw1.brr,f=r/this.gw2.brr,N=this.gw1.rua-c,y=this.gw2.rua-f;this.laStartRr1=this.gw1.involuteR.lFromU(N),this.laStartRr2=this.gw2.involuteR.lFromU(y);const x=Math.PI/2+this.apl,A=xt(this.gw1.ar,t,x);this.aFODl1=Math.PI-x-A;const S=this.gw1.lua-this.apl+this.gw1.lwa;if(tt(this.aFODl1-S)!==0)throw`dbg388: aFODl1 ${this.aFODl1} and aFODl1Alt ${S} differ`;const R=kt(t,this.gw1.ar,this.aFODl1),D=o,k=xt(this.gw2.ar,n,D);this.aFODl2=Math.PI-D-k;const $=this.gw2.lua-this.apl+this.gw2.lwa;if(tt(this.aFODl2-$)!==0)throw`dbg389: aFODl2 ${this.aFODl2} and aFODl2Alt ${$} differ`;const b=kt(n,this.gw2.ar,this.aFODl2),u=R+b,H=u/this.gw1.blr,I=u/this.gw2.blr,M=this.gw1.lua-H,B=this.gw2.lua-I;this.laStartRl1=this.gw1.involuteL.lFromU(M),this.laStartRl2=this.gw2.involuteL.lFromU(B),this.msg+=`Line of Action Effective length: right: ${L(r)} left: ${L(u)} mm
|
|
12
|
-
`,this.msg+=`Line of Action Effective rotation angle: right-1: ${L(st(c))} right-2: ${L(st(f))} left-1: ${L(st(H))} left-2: ${L(st(I))} degree
|
|
13
|
-
`,this.msg+=`Line of Action Effective height: right-1: ${L(this.gw1.ar-this.laStartRr1)} right-2: ${L(this.gw2.ar-this.laStartRr2)} left-1: ${L(this.gw1.ar-this.laStartRl1)} left-2: ${L(this.gw2.ar-this.laStartRl2)} mm
|
|
14
|
-
`,this.lasr1=2*Math.PI/this.gw1.TN*this.gw1.brr,this.lasr2=2*Math.PI/this.gw2.TN*this.gw2.brr,this.msg+=`Line of Action right: step length: 1: ${L(this.lasr1)} 2: ${L(this.lasr2)} mm
|
|
15
|
-
`,this.msg+=`Line of Action right: nb of contact point: 1: ${L(r/this.lasr1)} 2: ${L(r/this.lasr2)}
|
|
16
|
-
`,this.lasl1=2*Math.PI/this.gw1.TN*this.gw1.blr,this.lasl2=2*Math.PI/this.gw2.TN*this.gw2.blr,this.msg+=`Line of Action left: step length: 1: ${L(this.lasl1)} 2: ${L(this.lasl2)} mm
|
|
17
|
-
`,this.msg+=`Line of Action left: nb of contact point: 1: ${L(u/this.lasl1)} 2: ${L(u/this.lasl2)}
|
|
18
|
-
`}calcContactPoint1(){for(this.gw1.checkInitStep(5,"ActionLine.calcContactPoint1"),this.firstToothUr1=Nt(this.apr-(this.initAngle1-this.angleCenterCenter)+this.gw1.rwp);tt(this.firstToothUr1-this.gw1.as)>=0;)this.firstToothUr1=tt(this.firstToothUr1-this.gw1.as);for(this.firstToothUl1=Nt(this.apl+(this.initAngle1-this.angleCenterCenter)+this.gw1.as*this.gw1.adt-this.gw1.lwp);tt(this.firstToothUl1-this.gw1.as)>=0;)this.firstToothUl1=tt(this.firstToothUl1-this.gw1.as);this.ftdr1=this.gw1.brr*this.firstToothUr1,this.ftdl1=this.gw1.blr*this.firstToothUl1}prepare(){this.check1(),this.check2(),this.calcActionLine(),this.calcContactPoint1()}oneContactSpeed(l,t,s,n,o,i,d,w,_,a){const g=Math.floor(t/(2*s)),r=(n+g*s)/o,c=l?1:-1,[f,N,y,x]=i.laptc(d,c*w,r,.4);this.msg+=`speed ${_}: vx ${L(y)} vy: ${L(x)} m/s
|
|
19
|
-
`;const A=et(f,N),S=d+c*w,R=z(f,N,a),D=A.translatePolar(S,-x);R.addSegStrokeA(D.cx,D.cy);const k=D.translatePolar(S-c*Math.PI/2,y);return R.addSegStrokeA(k.cx,k.cy),R.closeSegStroke(),R}getContactSpeed(){const l=this.oneContactSpeed(!0,this.lBDr,this.lasr1,this.ftdr1,this.gw1.brr,this.gw1.involuteR,this.angleCenterCenter,this.apr,"R1","Black"),t=this.oneContactSpeed(!1,this.lBDl,this.lasl1,this.ftdl1,this.gw1.blr,this.gw1.involuteL,this.angleCenterCenter,this.apl,"L1","Black"),s=[];return s.push(l),s.push(t),s}getContours(){const l=[];l.push(v(this.gw1.cx,this.gw1.cy,this.laStartRr1,"SkyBlue")),l.push(v(this.gw1.cx,this.gw1.cy,this.laStartRl1,"SlateBlue")),l.push(v(this.gw2.cx,this.gw2.cy,this.laStartRr2,"SkyBlue")),l.push(v(this.gw2.cx,this.gw2.cy,this.laStartRl2,"SlateBlue"));const t=et(this.gw1.cx,this.gw1.cy),s=et(this.gw2.cx,this.gw2.cy),n=t.translatePolar(this.angleCenterCenter+this.apr,this.gw1.brr),o=s.translatePolar(this.angleCenterCenter+Math.PI+this.apr,this.gw2.brr),i=z(n.cx,n.cy,"YellowGreen");i.addSegStrokeA(o.cx,o.cy),i.closeSegStroke(),l.push(i);const d=t.translatePolar(this.angleCenterCenter-this.aFODr1,this.gw1.ar),w=s.translatePolar(this.angleCenterCenter+Math.PI-this.aFODr2,this.gw2.ar),_=z(d.cx,d.cy,"Yellow");_.addSegStrokeA(w.cx,w.cy),_.closeSegStroke(),l.push(_);const a=t.translatePolar(this.angleCenterCenter-this.apl,this.gw1.blr),h=s.translatePolar(this.angleCenterCenter+Math.PI-this.apl,this.gw2.blr),g=z(a.cx,a.cy,"YellowGreen");g.addSegStrokeA(h.cx,h.cy),g.closeSegStroke(),l.push(g);const r=t.translatePolar(this.angleCenterCenter+this.aFODl1,this.gw1.ar),c=s.translatePolar(this.angleCenterCenter+Math.PI+this.aFODl2,this.gw2.ar),f=z(r.cx,r.cy,"Yellow");return f.addSegStrokeA(c.cx,c.cy),f.closeSegStroke(),l.push(f),l.push(...this.getContactSpeed()),l}getContactPoint(){const l=[],t=et(this.gw1.cx,this.gw1.cy),s=t.translatePolar(this.angleCenterCenter+this.apr,this.gw1.brr),n=t.translatePolar(this.angleCenterCenter-this.apl,this.gw1.blr);l.push(et(s.cx,s.cy,St.eBigSquare)),l.push(et(n.cx,n.cy,St.eBigSquare));const o=this.angleCenterCenter+this.apr-Math.PI/2,i=this.angleCenterCenter-this.apl+Math.PI/2,d=s.translatePolar(o,this.ftdr1),w=n.translatePolar(i,this.ftdl1);l.push(et(d.cx,d.cy,St.eBigSquare)),l.push(et(w.cx,w.cy,St.eBigSquare));let _=this.ftdr1;for(;_+this.lasr1<this.lBDr;){_+=this.lasr1;const h=s.translatePolar(o,_);l.push(et(h.cx,h.cy,St.eBigSquare))}let a=this.ftdl1;for(;a+this.lasl1<this.lBDl;){a+=this.lasl1;const h=n.translatePolar(i,a);l.push(et(h.cx,h.cy,St.eBigSquare))}return l}getMsg(){return this.msg}getInitAngle2(){let l=this.lBDr-this.ftdr1;for(;tt(l-this.lasr2)>=0;)l=tt(l-this.lasr2);let t=this.lBDl-this.ftdl1;for(;tt(t-this.lasl2)>=0;)t=tt(t-this.lasl2);const s=l/this.gw2.brr,n=t/this.gw2.blr,o=this.angleCenterCenter+Math.PI+this.apr-s+this.gw2.rwp,d=this.angleCenterCenter+Math.PI-this.apl+n+this.gw2.lwp-this.gw2.as*this.gw2.adt;let w=2*Math.PI+Nt(d);for(;tt(w-this.gw2.as-o)>=0;)w=tt(w-this.gw2.as);const _=w-o,a=_*this.gw2.brr/this.gw1.brr,h=_*this.gw2.brr,g=_*this.gw2.blr;this.msg+=`slack angle: 1: ${L(st(a))} 2: ${L(st(_))} degree
|
|
20
|
-
`,this.msg+=`slack on action line: right-2: ${L(h)} left-2: ${L(g)} mm
|
|
21
|
-
`;let r=0;if(this.rightLeftCenter2===0)r=o;else if(this.rightLeftCenter2===1)r=d;else if(this.rightLeftCenter2===2)r=o+_/2;else throw`err221: initAngle2 rightLeftCenter2 ${this.rightLeftCenter2} has an unkown value`;return de(r)}};function _e(l,t,s,n,o,i){return new ue(l,t,s,n,o,i)}function fe(l,t,s,n,o,i,d,w,_){let a=v(l,t,s);if(n>0){if(o>2*s)throw`err383: axisTorque ribWidth ${L(o)} larger than 2x axisRadius ${L(s)}`;const h=Math.asin(o/(2*s)),g=2*Math.PI/n;if(g-2.5*h<0)throw`err384: axisTorque ribWidth ${L(o)} or ribNb ${n} are too large`;if(d>o/2)throw`err385: axisTorque ribRound1 ${L(d)} too large compare to ribWidth ${L(o)}`;if(d+w>i)throw`err386: axisTorque ribRound12 ${L(d)} ${L(w)} too large compare to ribHeight ${L(o)}`;const r=g-2*h>Math.PI,c=et(l,t),N=c.translatePolar(_,s+i).translatePolar(_+Math.PI/2,o/2);a=z(N.cx,N.cy);for(let y=0;y<n;y++){const x=_+y*g,A=x+g,S=c.translatePolar(x+h,s),R=c.translatePolar(A-h,s),k=c.translatePolar(x,s+i).translatePolar(x+Math.PI/2,o/2),b=c.translatePolar(A,s+i).translatePolar(A-Math.PI/2,o/2);a.addSegStrokeA(k.cx,k.cy).addCornerRounded(d),a.addSegStrokeA(S.cx,S.cy).addCornerRounded(w),a.addPointA(R.cx,R.cy).addSegArc(s,r,!0).addCornerRounded(w),a.addSegStrokeA(b.cx,b.cy).addCornerRounded(d)}a.closeSegStroke()}return a}function Le(l,t,s,n,o,i,d,w){const _=2*Math.PI/o,a=Math.asin(i/(2*n)),h=Math.asin(i/(2*s));if(i>2*n)throw`err905: hollowStraight spokeWidth ${L(i)} too large for hollowInt ${L(n)}`;if(s-n<2.1*d)throw`err906: hollowStraight hollowExt ${L(s)}, hollowInt ${L(n)} and spokeRound ${L(d)} do not fit`;if(_-2*h<2.5*Math.asin(d/s))throw`err907: hollowStraight spokeNb ${o}, spokeWidth ${L(i)} or spokeRound ${L(d)} are too large`;const g=i/(2*Math.sin(_/2)),r=_-2*a<2.1*Math.asin(d/n),c=_-2*h>Math.PI,f=et(l,t),N=[];for(let y=0;y<o;y++){const x=w+y*_,A=x+_,S=x+_/2,R=f.translatePolar(x+h,s),D=f.translatePolar(A-h,s),k=f.translatePolar(A-a,n),$=f.translatePolar(x+a,n),b=f.translatePolar(S,g),u=z(R.cx,R.cy);u.addCornerRounded(d),u.addPointA(D.cx,D.cy).addSegArc(s,c,!0).addCornerRounded(d),r?u.addSegStrokeA(b.cx,b.cy).addCornerRounded(d):(u.addSegStrokeA(k.cx,k.cy).addCornerRounded(d),u.addPointA($.cx,$.cy).addSegArc(n,c,!1).addCornerRounded(d)),u.closeSegStroke(),N.push(u)}return N}function qt(l,t,s,n,o,i,d,w,_,a){const h=a?1:-1,g=l/2,r=g+t,c=r+s,f=z(0,-c);return f.addSegStrokeA(h*n,-c).addCornerRounded(d).addSegStrokeA(h*n,-r).addCornerRounded(w).addSegStrokeA(h*o,-r).addSegStrokeA(h*i,-g).addCornerRounded(_).addSegStrokeA(h*i,g).addCornerRounded(_).addSegStrokeA(h*o,r).addSegStrokeA(h*n,r).addCornerRounded(w).addSegStrokeA(h*n,c).addCornerRounded(d).addSegStrokeA(0,c).closeSegStroke(),f}var Yt={partName:"gear_wheel_wheel",params:[e("module","mm",10,.1,100,.1),e("N1","scalar",23,3,1e3,1),e("N2","scalar",19,3,1e3,1),e("angleCenterCenter","degree",0,-180,180,1),e("addInterAxis","mm",0,0,100,.05),e("c1x","mm",0,-200,200,1),e("c1y","mm",0,-200,200,1),e("ah1","scalar",1,.1,2,.05),e("dh1","scalar",1,.1,2,.05),e("bh1","scalar",.25,.1,2,.05),e("bRound1","mm",2,0,50,.1),e("ah2","scalar",1,.1,2,.05),e("dh2","scalar",1,.1,2,.05),e("bh2","scalar",.25,.1,2,.05),e("bRound2","mm",2,0,50,.1),e("at1","%",50,10,90,.5),e("at2","%",50,10,90,.5),rt("involSym",!0),wt("involROpt",["Optimum","Base-1","Base-2","PressureAngle","FreeBase-12"]),wt("involLOpt",["Optimum","Base-1","Base-2","PressureAngle","FreeBase-12"]),e("brr1","mm",50,10,2e3,.05),e("brr2","mm",50,10,2e3,.05),e("blr1","mm",50,10,2e3,.05),e("blr2","mm",50,10,2e3,.05),e("involArcPairs1","scalar",2,1,40,1),e("involArcPairs2","scalar",2,1,40,1),e("skinThickness1","mm",0,-3,3,.01),e("skinThickness2","mm",0,-3,3,.01),e("initAngle1","degree",0,-180,180,1),wt("gw2Position",["right","left","center"]),rt("centralAxis",!0),e("axisRadius","mm",10,.1,200,.1),e("ribNb","scalar",5,0,32,1),e("ribWidth","mm",8,1,100,.1),e("ribHeight","mm",8,1,100,.1),e("ribRound1","mm",2,0,20,.1),e("ribRound2","mm",2,0,20,.1),rt("hollow",!0),e("materialHeightExt","mm",20,1,200,.5),e("materialHeightInt","mm",15,1,200,.5),e("spokeNb","scalar",5,1,18,1),e("spokeWidth","mm",15,1,200,.1),e("spokeRound","mm",10,0,20,.1),rt("wheelAxis",!0),e("wheelHeight","mm",40,.1,400,.1),e("wheelMidExtra","mm",6,0,10,.1),e("wheelAxisLength","mm",40,0,400,.1),e("wheelAxisRadius","mm",20,0,200,.1),e("wheelMidRadius","mm",60,0,200,.1),e("wheelRadiusExtra","mm",1,0,20,.1),e("wheelAxisExtRound","mm",4,0,20,.1),e("wheelAxisIntRound","mm",0,0,20,.1),e("wheelExtraRound","mm",4,0,20,.1)],paramSvg:{module:"default_param_blank.svg",N1:"default_param_blank.svg",N2:"default_param_blank.svg",angleCenterCenter:"default_param_blank.svg",addInterAxis:"default_param_blank.svg",c1x:"default_param_blank.svg",c1y:"default_param_blank.svg",ah1:"default_param_blank.svg",dh1:"default_param_blank.svg",bh1:"default_param_blank.svg",bRound1:"default_param_blank.svg",ah2:"default_param_blank.svg",dh2:"default_param_blank.svg",bh2:"default_param_blank.svg",bRound2:"default_param_blank.svg",at1:"default_param_blank.svg",at2:"default_param_blank.svg",involSym:"default_param_blank.svg",involROpt:"default_param_blank.svg",involLOpt:"default_param_blank.svg",brr1:"default_param_blank.svg",brr2:"default_param_blank.svg",blr1:"default_param_blank.svg",blr2:"default_param_blank.svg",involArcPairs1:"default_param_blank.svg",skinThickness1:"default_param_blank.svg",involArcPairs2:"default_param_blank.svg",skinThickness2:"default_param_blank.svg",initAngle1:"default_param_blank.svg",gw2Position:"default_param_blank.svg",centralAxis:"default_param_blank.svg",axisRadius:"default_param_blank.svg",ribNb:"default_param_blank.svg",ribWidth:"default_param_blank.svg",ribHeight:"default_param_blank.svg",ribRound1:"default_param_blank.svg",ribRound2:"default_param_blank.svg",hollow:"default_param_blank.svg",materialHeightExt:"default_param_blank.svg",materialHeightInt:"default_param_blank.svg",spokeNb:"default_param_blank.svg",spokeWidth:"default_param_blank.svg",spokeRound:"default_param_blank.svg",wheelAxis:"default_param_blank.svg",wheelHeight:"default_param_blank.svg",wheelMidExtra:"default_param_blank.svg",wheelAxisLength:"default_param_blank.svg",wheelAxisRadius:"default_param_blank.svg",wheelMidRadius:"default_param_blank.svg",wheelRadiusExtra:"default_param_blank.svg",wheelAxisExtRound:"default_param_blank.svg",wheelAxisIntRound:"default_param_blank.svg",wheelExtraRound:"default_param_blank.svg"},sim:{tMax:100,tStep:.5,tUpdate:500}};function Se(l,t){const s=nt(Yt.partName),n=C(),o=C();s.logstr+=`${s.partName} simTime: ${l}
|
|
22
|
-
`;try{const i=Wt(),d=Wt();i.set1ModuleToothNumber(t.module,t.N1),d.set1ModuleToothNumber(t.module,t.N2),i.set2CenterPosition(t.c1x,t.c1y);const w=Et(t.angleCenterCenter),[_,a,h]=ae(i,d,w,t.addInterAxis);d.set2CenterPosition(_,a),i.set3CircleRadius(t.ah1,t.dh1,t.bh1,t.bRound1),d.set3CircleRadius(t.ah2,t.dh2,t.bh2,t.bRound2);const[g,r,c,f]=ge(i,d,t.brr1,t.blr1,t.brr2,t.blr2,t.involSym,t.involROpt,t.involROpt);i.set4BaseCircles(g,r),d.set4BaseCircles(c,f),i.set5AddendumThickness(t.at1),d.set5AddendumThickness(t.at2);const N=Et(t.initAngle1)+l*3*i.as/100;i.set6Angles(N,w);const y=_e(i,d,N,w,h,t.gw2Position);y.prepare();for(const k of y.getContours())n.addDynamics(k);n.addPoints(y.getContactPoint()),d.set6Angles(y.getInitAngle2(),w+Math.PI),s.logstr+=y.getMsg(),i.set7InvoluteDetails(t.involArcPairs1,t.skinThickness1),d.set7InvoluteDetails(t.involArcPairs2,t.skinThickness2);for(const k of i.getRefCircles())n.addDynamics(k);for(const k of d.getRefCircles())n.addDynamics(k);n.addDynamics(i.getToothRef()),n.addDynamics(d.getToothRef());const x=i.getProfile();if(s.logstr+=i.getMsg(),s.logstr+=x.check(),n.addMain(x),t.centralAxis===1){const k=fe(i.cx,i.cy,t.axisRadius,t.ribNb,t.ribWidth,t.ribHeight,t.ribRound1,t.ribRound2,N);s.logstr+=k.check(),n.addMain(k)}if(t.hollow===1){const k=i.br,$=t.axisRadius+t.ribHeight,b=k-t.materialHeightExt,u=$+t.materialHeightInt;if(u>b)throw`err902: hollowMaterialInt ${L(u)} bigger than hollowMaterialExt ${L(b)}`;const H=Le(i.cx,i.cy,b,u,t.spokeNb,t.spokeWidth,t.spokeRound,N);for(const I of H)s.logstr+=I.check(),n.addMain(I)}const A=d.getProfile();s.logstr+=A.check(),n.addSecond(A);const S=i.ar+t.wheelRadiusExtra;if(t.wheelAxis===1){const k=qt(t.wheelHeight,t.wheelMidExtra,t.wheelAxisLength,t.wheelAxisRadius,t.wheelMidRadius,S,t.wheelAxisExtRound,t.wheelAxisIntRound,t.wheelExtraRound,!0),$=qt(t.wheelHeight,t.wheelMidExtra,t.wheelAxisLength,t.wheelAxisRadius,t.wheelMidRadius,S,t.wheelAxisExtRound,t.wheelAxisIntRound,t.wheelExtraRound,!1);o.addMain(k),o.addSecond($)}else{const k=z(0,-t.wheelHeight/2).addSegStrokeR(0,t.wheelHeight).addSegStrokeR(S,0).addSegStrokeR(0,-t.wheelHeight).closeSegStroke(),$=z(0,-t.wheelHeight/2).addSegStrokeR(0,t.wheelHeight).addSegStrokeR(-S,0).addSegStrokeR(0,-t.wheelHeight).closeSegStroke();o.addMain(k),o.addSecond($)}s.fig={teethProfile:n,axisProfile:o};const R=s.partName,D=t.wheelHeight/2+t.wheelMidExtra+t.wheelAxisLength+10;s.vol={extrudes:[{outName:`subpax_${R}_teethProfile`,face:`${R}_teethProfile`,extrudeMethod:O.eLinearOrtho,length:2*D,rotate:[0,0,0],translate:[0,0,-D]},{outName:`subpax_${R}_axisProfile`,face:`${R}_axisProfile`,extrudeMethod:O.eRotate,rotate:[0,0,0],translate:[0,0,0]}],volumes:[{outName:`pax_${R}`,boolMethod:Z.eIntersection,inList:[`subpax_${R}_teethProfile`,`subpax_${R}_axisProfile`]}]},s.logstr+=`gear_wheel_wheel drawn successfully!
|
|
23
|
-
`,s.calcErr=!1}catch(i){s.logstr+=i,console.log(i)}return s}var Vt={pTitle:"Gearwheel-gearwheel",pDescription:"Gear-system with two wheels",pDef:Yt,pGeom:Se},Xt={partName:"simplified_gear_wheel",params:[e("module","mm",10,.1,100,.1),e("N1","scalar",23,3,1e3,1),e("c1x","mm",0,-200,200,1),e("c1y","mm",0,-200,200,1),rt("centralAxis",!0),e("axisRadius","mm",10,.1,200,.1),e("ribNb","scalar",5,0,32,1),e("ribWidth","mm",8,1,100,.1),e("ribHeight","mm",8,1,100,.1),e("ribRound1","mm",2,0,20,.1),e("ribRound2","mm",2,0,20,.1),rt("hollow",!0),e("materialHeightExt","mm",20,1,200,.5),e("materialHeightInt","mm",15,1,200,.5),e("spokeNb","scalar",5,1,18,1),e("spokeWidth","mm",15,1,200,.1),e("spokeRound","mm",10,0,20,.1),rt("wheelAxis",!0),e("wheelHeight","mm",40,.1,400,.1),e("wheelMidExtra","mm",6,0,10,.1),e("wheelAxisLength","mm",40,0,400,.1),e("wheelAxisRadius","mm",20,0,200,.1),e("wheelMidRadius","mm",60,0,200,.1),e("wheelRadiusExtra","mm",1,0,20,.1),e("wheelAxisExtRound","mm",4,0,20,.1),e("wheelAxisIntRound","mm",0,0,20,.1),e("wheelExtraRound","mm",4,0,20,.1)],paramSvg:{module:"default_param_blank.svg",N1:"default_param_blank.svg",c1x:"default_param_blank.svg",c1y:"default_param_blank.svg",centralAxis:"default_param_blank.svg",axisRadius:"default_param_blank.svg",ribNb:"default_param_blank.svg",ribWidth:"default_param_blank.svg",ribHeight:"default_param_blank.svg",ribRound1:"default_param_blank.svg",ribRound2:"default_param_blank.svg",hollow:"default_param_blank.svg",materialHeightExt:"default_param_blank.svg",materialHeightInt:"default_param_blank.svg",spokeNb:"default_param_blank.svg",spokeWidth:"default_param_blank.svg",spokeRound:"default_param_blank.svg",wheelAxis:"default_param_blank.svg",wheelHeight:"default_param_blank.svg",wheelMidExtra:"default_param_blank.svg",wheelAxisLength:"default_param_blank.svg",wheelAxisRadius:"default_param_blank.svg",wheelMidRadius:"default_param_blank.svg",wheelRadiusExtra:"default_param_blank.svg",wheelAxisExtRound:"default_param_blank.svg",wheelAxisIntRound:"default_param_blank.svg",wheelExtraRound:"default_param_blank.svg"},sim:{tMax:100,tStep:.5,tUpdate:500}};function we(l,t){const s=nt(Xt.partName),n=C(),o=C();s.logstr+=`${s.partName} simTime: ${l}
|
|
24
|
-
`;try{const i=dt(Vt.pDef);i.setVal("module",t.module),i.setVal("N1",t.N1),i.setVal("c1x",t.c1x),i.setVal("c1y",t.c1y),i.setVal("centralAxis",t.centralAxis),i.setVal("axisRadius",t.axisRadius),i.setVal("ribNb",t.ribNb),i.setVal("ribWidth",t.ribWidth),i.setVal("ribHeight",t.ribHeight),i.setVal("ribRound1",t.ribRound1),i.setVal("ribRound2",t.ribRound2),i.setVal("hollow",t.hollow),i.setVal("materialHeightExt",t.materialHeightExt),i.setVal("materialHeightInt",t.materialHeightInt),i.setVal("spokeNb",t.spokeNb),i.setVal("spokeWidth",t.spokeWidth),i.setVal("spokeRound",t.spokeRound),i.setVal("wheelAxis",t.wheelAxis),i.setVal("wheelHeight",t.wheelHeight),i.setVal("wheelMidExtra",t.wheelMidExtra),i.setVal("wheelAxisLength",t.wheelAxisLength),i.setVal("wheelAxisRadius",t.wheelAxisRadius),i.setVal("wheelMidRadius",t.wheelMidRadius),i.setVal("wheelRadiusExtra",t.wheelRadiusExtra),i.setVal("wheelAxisExtRound",t.wheelAxisExtRound),i.setVal("wheelAxisIntRound",t.wheelAxisIntRound),i.setVal("wheelExtraRound",t.wheelExtraRound);const d=Vt.pGeom(l,i.getParamVal());ct(d),s.logstr+=ht(d.logstr,i.partName),n.mergeFigure(d.fig.teethProfile),o.mergeFigure(d.fig.axisProfile),s.fig={teethProfile:n,axisProfile:o};const w=s.partName;s.vol={inherits:[{outName:`inpax_${w}_gearWW`,subdesign:"pax_gear_wheel_wheel",subgeom:d,rotate:[0,0,0],translate:[0,0,0]}],extrudes:[],volumes:[{outName:`pax_${w}`,boolMethod:Z.eIdentity,inList:[`inpax_${w}_gearWW`]}]};const _={partName:i.getPartName(),dparam:i.getDesignParamList(),orientation:[0,0,0],position:[0,0,0]};s.sub={gear_wheel_wheel_1:_},s.logstr+=`simplified_gear_wheel drawn successfully!
|
|
25
|
-
`,s.calcErr=!1}catch(i){s.logstr+=i,console.log(i)}return s}var He={pTitle:"Simplified gearwheel",pDescription:"One simplified gearwheel without details on teeth-profile",pDef:Xt,pGeom:we},jt={partName:"pole_static",params:[e("D1","mm",1e3,20,4e3,1),e("D2","mm",700,10,4e3,1),e("D3","mm",800,10,4e3,1),e("H1","mm",3e3,10,4e4,10),e("H2","mm",7e3,50,4e4,10),e("E1","mm",30,1,80,1),e("E2","mm",5,1,80,1),e("N1","",32,3,100,1),e("D5","mm",40,1,100,1),e("L1","mm",45,1,300,1),e("D4","mm",600,1,1200,1),e("H3","mm",300,5,1200,1),e("H4","mm",1800,10,2500,1),e("L2","mm",30,1,100,1),e("E3","mm",40,1,100,1)],paramSvg:{D1:"pole_stator_cut.svg",D2:"pole_stator_cut.svg",D3:"pole_stator_cut.svg",H1:"pole_stator_cut.svg",H2:"pole_stator_cut.svg",E1:"pole_stator_cut.svg",E2:"pole_stator_E2.svg",N1:"pole_stator_bottom.svg",D5:"pole_stator_bottom.svg",L1:"pole_stator_bottom.svg",D4:"pole_stator_face.svg",H3:"pole_stator_face.svg",H4:"pole_stator_face.svg",L2:"pole_stator_face.svg",E3:"pole_stator_right.svg"},sim:{tMax:180,tStep:.5,tUpdate:500}};function De(l,t){let s,n;const o=nt(jt.partName),i=C(),d=C(),w=C(),_=C(),a=C();o.logstr+=`${o.partName} simTime: ${l}
|
|
26
|
-
`;try{const h=t.D1/2,g=t.D2/2,r=t.D3/2;if(g>h)throw`err091: D2 ${t.D2} is larger than D1 ${t.D1}`;if(r+t.E2>h)throw`err095: D3 ${t.D3} and E2 ${t.E2} are too large compare to D1 ${t.D1}`;const c=t.H1+t.H2;o.logstr+=`pole-height: ${L(c)} mm
|
|
27
|
-
`;const f=Math.atan2(h-g,t.H2);o.logstr+=`cone-half-angle: ${L(st(f))} degree
|
|
28
|
-
`;const N=t.E2*Math.tan(f/2),y=t.H1-N;s=function(b,u){const H=z(b*h,0).addSegStrokeA(b*h,t.H1).addSegStrokeA(b*g,c).addSegStrokeR(-b*t.E2*Math.cos(f),-t.E2*Math.sin(f)).addSegStrokeA(b*(h-t.E2),y);return u?H.addSegStrokeA(b*(h-t.E2),t.E1).addSegStrokeA(b*r,t.E1).addSegStrokeA(b*r,0):H.addSegStrokeA(b*(h-t.E2),0),H.closeSegStroke(),H},i.addMain(s(1,!1)),i.addSecond(s(1,!0)),i.addSecond(s(-1,!0));const x=t.D4/2,A=t.H4-2*x;if(A<0)throw`err121: H4 ${t.H4} is too small compare to D4 ${t.D4}`;if(x-t.L2<0)throw`err121: D4 ${t.D4} is too small compare to L2 ${t.L2}`;n=function(b){const u=x-b,H=t.H3+x;return z(u,H+A).addPointR(-u,u).addSegArc(u,!1,!0).addPointR(-u,-u).addSegArc(u,!1,!0).addSegStrokeR(0,-A).addPointR(u,-u).addSegArc(u,!1,!0).addPointR(u,u).addSegArc(u,!1,!0).closeSegStroke()},d.addMain(n(0)),d.addMain(n(t.L2));const S=z(h,0).addSegStrokeA(h,t.H1).addSegStrokeA(g,c).addSegStrokeA(-g,c).addSegStrokeA(-h,t.H1).addSegStrokeA(-h,0).closeSegStroke();d.addSecond(S);const R=z(-h,t.H3).addSegStrokeR(0,t.H4).addSegStrokeR(-t.E3,0).addSegStrokeR(0,-t.H4).closeSegStroke();d.addSecond(R),w.addMain(v(0,0,h)),w.addMain(v(0,0,r));const D=r+t.L1,k=2*Math.PI/t.N1;for(let b=0;b<t.N1;b++){const u=D*Math.cos(b*k),H=D*Math.sin(b*k);w.addMain(v(u,H,t.D5/2))}w.addSecond(v(0,0,g)),w.addSecond(v(0,0,h-t.E2)),_.addMain(v(0,0,h+t.E3)),_.addMain(v(0,0,h-t.E2)),a.addMain(n(t.L2)),o.fig={poleCut:i,poleFace:d,poleBottom:w,emptyPole:_,emptyDoor:a};const $=o.partName;o.vol={extrudes:[{outName:`subpax_${$}_pole`,face:`${$}_poleCut`,extrudeMethod:O.eRotate,rotate:[0,0,0],translate:[0,0,0]},{outName:`subpax_${$}_bottom`,face:`${$}_poleBottom`,extrudeMethod:O.eLinearOrtho,length:t.E1,rotate:[0,0,0],translate:[0,0,0]},{outName:`subpax_${$}_door`,face:`${$}_poleFace`,extrudeMethod:O.eLinearOrtho,length:h+t.E3,rotate:[Math.PI/2,0,0],translate:[0,0,0]},{outName:`subpax_${$}_emptyPole`,face:`${$}_emptyPole`,extrudeMethod:O.eLinearOrtho,length:t.H1,rotate:[0,0,0],translate:[0,0,0]},{outName:`subpax_${$}_emptyDoor`,face:`${$}_emptyDoor`,extrudeMethod:O.eLinearOrtho,length:h+t.E3+10,rotate:[Math.PI/2,0,0],translate:[0,0,0]}],volumes:[{outName:`ipax_${$}_door`,boolMethod:Z.eIntersection,inList:[`subpax_${$}_door`,`subpax_${$}_emptyPole`]},{outName:`ipax_${$}_pole`,boolMethod:Z.eSubstraction,inList:[`subpax_${$}_pole`,`subpax_${$}_emptyDoor`]},{outName:`pax_${$}`,boolMethod:Z.eUnion,inList:[`ipax_${$}_pole`,`subpax_${$}_bottom`,`ipax_${$}_door`]}]},o.sub={},o.logstr+=`pole_static drawn successfully!
|
|
29
|
-
`,o.calcErr=!1}catch(h){o.logstr+=h,console.log(h)}return o}var Dt={pTitle:"Heliostat pole static",pDescription:"The vertical pole of an heliostat",pDef:jt,pGeom:De},Zt={partName:"rake",params:[e("D1","mm",600,10,4e3,10),e("D2","mm",400,10,4e3,10),e("D3","mm",400,10,4e3,10),e("H1","mm",800,1,4e3,10),e("H2","mm",3e3,20,6e3,10),e("H3","mm",400,0,4e3,10),e("E1","mm",20,1,80,1),e("E3","mm",30,1,80,1),e("H4","mm",400,10,1e3,10),e("D4","mm",300,10,1e3,10),e("E4","mm",20,1,80,1),e("H5","mm",1e3,10,2e3,10),e("D5","mm",200,1,1e3,10),e("L4","mm",300,1,1e3,10),e("L5","mm",2e3,10,4e3,10),e("L6","mm",2e3,1,4e3,10),e("D6","mm",100,1,600,10),e("E6","mm",10,1,80,1),e("L7","mm",100,1,1e3,1),e("L8","mm",200,1,1e3,1),e("N1","",24,3,100,1),e("D7","mm",40,1,100,1),e("L1","mm",30,1,300,1),e("D8","mm",400,1,1e3,10),e("H6","mm",100,1,1e3,10),e("H7","mm",600,10,2e3,10),e("L9","mm",300,1,1e3,10),e("R9","mm",50,0,300,1)],paramSvg:{D1:"rake_face.svg",D2:"rake_face.svg",D3:"rake_face.svg",H1:"rake_face.svg",H2:"rake_face.svg",H3:"rake_face.svg",E1:"rake_face.svg",E3:"rake_face.svg",H4:"rake_side.svg",D4:"rake_side.svg",E4:"rake_side.svg",H5:"rake_side.svg",D5:"rake_side.svg",L4:"rake_face.svg",L5:"rake_face.svg",L6:"rake_face.svg",D6:"rake_face.svg",E6:"rake_face.svg",L7:"rake_face.svg",L8:"rake_face.svg",N1:"rake_top.svg",D7:"rake_top.svg",L1:"rake_top.svg",D8:"rake_side.svg",H6:"rake_door.svg",H7:"rake_door.svg",L9:"rake_door.svg",R9:"rake_door.svg"},sim:{tMax:180,tStep:.5,tUpdate:500}};function be(l,t){let s,n,o;const i=nt(Zt.partName),d=C(),w=C(),_=C(),a=C(),h=C(),g=C(),r=C(),c=C();i.logstr+=`${i.partName} simTime: ${l}
|
|
30
|
-
`;try{const f=t.D1/2,N=t.D2/2,y=t.D3/2,x=t.D4/2,A=t.D5/2,S=t.D6/2,R=t.D7/2,D=t.D8/2,k=t.H1+t.H2,$=k-t.H4+t.H5;if(i.logstr+=`cone-height: ${L(k)} mm
|
|
31
|
-
`,i.logstr+=`cone-height total: ${L($)} mm
|
|
32
|
-
`,t.D2>t.D1)throw`err110: D2 ${t.D2} is larger than D1 ${t.D1}`;if(t.D3+t.E1>t.D1)throw`err113: D3 ${t.D3} is too large compare to D1 ${t.D1} and E1 ${t.E1}`;if(t.H3+t.E3>t.H1)throw`err116: H3 ${t.H3} is too large compare to H1 ${t.H1} and E3 ${t.E3}`;if(t.H4+x>t.H2)throw`err119: H4 ${t.H4} is too large compare to H2 ${t.H2} and D4 ${t.D4}`;if(t.E4>x)throw`err122: E4 ${t.E4} is too large compare to D4 ${t.D4}`;if(t.D8<=t.D5)throw`err146: D8 ${t.D8} is too small compare to D5 ${t.D5}`;const b=4*t.L4+t.L5+2*t.L6,u=t.H1+t.H2-t.H4,H=x*Math.cos(Math.PI/6),I=x*Math.sin(Math.PI/6),M=A*Math.cos(Math.PI/6),B=A*Math.sin(Math.PI/6),T=D*Math.cos(Math.PI/6),F=D*Math.sin(Math.PI/6),p=[-b/2,-t.L5/2-t.L4,t.L5/2,b/2-t.L4],W=t.H2-t.L8-t.H4-x;if(W<0)throw`err140: H2 ${t.H2} too small compare to L8 ${t.L8}, H4 ${t.H4} and D4 ${t.D4}`;const X=Math.atan2(f-N,t.H2);i.logstr+=`cone-angle: ${L(st(X))} degree
|
|
33
|
-
`;const K=b/2-t.L7-f+t.L8*Math.tan(X),it=Math.sqrt(K**2+W**2),q=Math.atan2(K,W);i.logstr+=`wing-angle: ${L(st(q))} degree
|
|
34
|
-
`;const Q=t.E1/Math.sin(q+X),m=it+t.E4/Math.cos(q)+Q,E=f-t.L8*Math.tan(X)-Q*Math.sin(q),P=t.H1+t.L8-Q*Math.cos(q),j=E-S*Math.cos(q),G=P+S*Math.sin(q),J=S-t.E6,ot=E-t.E6*Math.cos(q),lt=P+t.E6*Math.sin(q),ut=Math.PI/2-q,Lt=t.L9/2,_t=Lt-t.H7*Math.tan(X);if(_t<t.R9)throw`err177: R9 ${t.R9} too large compare to doorHighX ${_t} and L9 ${t.L9}`;if(t.L9>t.D1)throw`err180: L9 ${t.L9} too large compare to D1 ${t.D1}`;const Ht=t.E1*Math.cos(X),Pt=t.E1*Math.sin(X),mt=t.E1*Math.tan(X/2);s=function(Y){return z(Y*f,0).addSegStrokeA(Y*f,t.H1).addSegStrokeA(Y*N,k).addSegStrokeA(Y*(N-Ht),k-Pt).addSegStrokeA(Y*(f-t.E1),t.H1-mt).addSegStrokeA(Y*(f-t.E1),0).closeSegStroke()},n=function(Y){return z(Y*f,0).addSegStrokeA(Y*f,t.H1).addSegStrokeA(Y*N,k).addSegStrokeA(Y*(N-Ht),k-Pt).addSegStrokeA(Y*(f-t.E1),t.H1-mt).addSegStrokeA(Y*(f-t.E1),t.H1-t.H3).addSegStrokeA(Y*y,t.H1-t.H3).addSegStrokeA(Y*y,t.H1-t.H3-t.E3).addSegStrokeA(Y*(f-t.E1),t.H1-t.H3-t.E3).addSegStrokeA(Y*(f-t.E1),0).closeSegStroke()},o=function(Y,at,ft,vt,Mt){const Bt=Y*Math.cos(Mt),Ut=Y*Math.sin(Mt),Gt=-at*Math.sin(Mt),pt=at*Math.cos(Mt);return z(ft,vt).addSegStrokeA(ft+Bt,vt+Ut).addSegStrokeA(ft+Bt+Gt,vt+Ut+pt).addSegStrokeA(ft+Gt,vt+pt).closeSegStroke()};const At=z(Lt,t.H1+t.H6).addCornerRounded(t.R9).addSegStrokeA(_t,t.H1+t.H6+t.H7).addCornerRounded(t.R9).addSegStrokeA(-_t,t.H1+t.H6+t.H7).addCornerRounded(t.R9).addSegStrokeA(-Lt,t.H1+t.H6).addCornerRounded(t.R9).closeSegStroke();d.addMain(s(1)),d.addSecond(n(1)),d.addSecond(n(-1)),d.addSecond(o(b,t.D4,-b/2,u-x,0)),d.addSecond(o(b,t.D4-2*t.E4,-b/2,u-x+t.E4,0));for(const Y of p)d.addSecond(o(t.L4,t.H5-I-B,Y,u+I,0));d.addSecond(o(m,2*S,E,P,ut)),d.addSecond(o(m,2*J,ot,lt,ut)),d.addSecond(o(2*S,m,-E,P,q)),d.addSecond(o(2*J,m,-ot,lt,q)),d.addSecond(At);const Rt=z(H,u+I).addSegStrokeA(T,u+t.H5-F).addSegStrokeA(M,u+t.H5-B).addPointA(-M,u+t.H5-B).addSegArc(A,!1,!1).addSegStrokeA(-T,u+t.H5-F).addSegStrokeA(-H,u+I).closeSegArc(x,!1,!1);w.addMain(v(0,u,x)),w.addMain(v(0,u,x-t.E4)),w.addSecond(n(1)),w.addSecond(n(-1)),w.addSecond(Rt),w.addSecond(v(0,u+t.H5,A)),w.addSecond(o(2*S,W,-S,t.H1+t.L8,0)),w.addSecond(o(2*J,W,-J,t.H1+t.L8,0)),w.addSecond(At),_.addMain(v(0,u,x-t.E4)),_.addSecond(v(0,u,x)),_.addSecond(Rt),a.addMain(v(0,0,f)),a.addMain(v(0,0,y));const Ot=y+t.L1,zt=2*Math.PI/t.N1;for(let Y=0;Y<t.N1;Y++){const at=Ot*Math.cos(Y*zt),ft=Ot*Math.sin(Y*zt);a.addMain(v(at,ft,R))}a.addSecond(v(0,0,f-t.E1)),a.addSecond(v(0,0,N)),a.addSecond(o(t.D4,b,-x,-b/2,0)),a.addSecond(o(t.D4-2*t.E4,b,-x+t.E4,-b/2,0));for(const Y of p)a.addSecond(o(2*H,t.L4,-H,Y,0)),a.addSecond(o(2*M,t.L4,-M,Y,0)),a.addSecond(o(2*T,t.L4,-T,Y,0));a.addSecond(o(2*S,K,-S,f-t.L8*Math.tan(X),0)),a.addSecond(o(2*J,K,-J,f-t.L8*Math.tan(X),0)),a.addSecond(o(2*S,K,-S,-f+t.L8*Math.tan(X)-K,0)),a.addSecond(o(2*J,K,-J,-f+t.L8*Math.tan(X)-K,0)),h.addMain(Rt),h.addSecond(v(0,u,x)),h.addSecond(v(0,u,x-t.E4)),h.addSecond(v(0,u+t.H5,A)),g.addMain(v(0,0,S)),g.addMain(v(0,0,J)),r.addSecond(v(0,0,S)),r.addMain(v(0,0,J)),c.addMain(At),c.addSecond(n(1)),c.addSecond(n(-1)),c.addSecond(o(b,t.D4,-b/2,u-x,0)),c.addSecond(o(b,t.D4-2*t.E4,-b/2,u-x+t.E4,0));for(const Y of p)c.addSecond(o(t.L4,t.H5-I-B,Y,u+I,0));c.addSecond(o(m,2*S,E,P,ut)),c.addSecond(o(m,2*J,ot,lt,ut)),c.addSecond(o(2*S,m,-E,P,q)),c.addSecond(o(2*J,m,-ot,lt,q)),i.fig={faceCone:d,faceBeam:w,faceBeamHollow:_,faceDisc:a,faceHand:h,faceWing:g,faceWingHollow:r,faceDoor:c};const U=i.partName,ne=p.map((Y,at)=>({outName:`subpax_${U}_hand_${at}`,face:`${U}_faceHand`,extrudeMethod:O.eLinearOrtho,length:t.L4,rotate:[Math.PI/2,0,0],translate:[0,-Y,0]}));i.vol={extrudes:[{outName:`subpax_${U}_cone`,face:`${U}_faceCone`,extrudeMethod:O.eRotate,rotate:[0,0,0],translate:[0,0,0]},{outName:`subpax_${U}_beam`,face:`${U}_faceBeam`,extrudeMethod:O.eLinearOrtho,length:b,rotate:[Math.PI/2,0,0],translate:[0,b/2,0]},{outName:`subpax_${U}_beamHollow`,face:`${U}_faceBeamHollow`,extrudeMethod:O.eLinearOrtho,length:b,rotate:[Math.PI/2,0,0],translate:[0,b/2,0]},{outName:`subpax_${U}_disc`,face:`${U}_faceDisc`,extrudeMethod:O.eLinearOrtho,length:t.E3,rotate:[0,0,0],translate:[0,0,t.H1-t.H3-t.E3]},{outName:`subpax_${U}_wing_right`,face:`${U}_faceWing`,extrudeMethod:O.eLinearOrtho,length:m,rotate:[-q,0,0],translate:[0,j,G]},{outName:`subpax_${U}_wing_left`,face:`${U}_faceWing`,extrudeMethod:O.eLinearOrtho,length:m,rotate:[q,0,0],translate:[0,-j,G]},{outName:`subpax_${U}_wing_hollow_right`,face:`${U}_faceWingHollow`,extrudeMethod:O.eLinearOrtho,length:m,rotate:[-q,0,0],translate:[0,j,G]},{outName:`subpax_${U}_wing_hollow_left`,face:`${U}_faceWingHollow`,extrudeMethod:O.eLinearOrtho,length:m,rotate:[q,0,0],translate:[0,-j,G]},{outName:`subpax_${U}_door`,face:`${U}_faceDoor`,extrudeMethod:O.eLinearOrtho,length:t.D1,rotate:[Math.PI/2,0,Math.PI/2],translate:[0,0,0]},...ne],volumes:[{outName:`ipax_${U}_plus`,boolMethod:Z.eUnion,inList:[`subpax_${U}_cone`,`subpax_${U}_beam`,`subpax_${U}_disc`,`subpax_${U}_hand_0`,`subpax_${U}_hand_1`,`subpax_${U}_hand_2`,`subpax_${U}_hand_3`,`subpax_${U}_wing_right`,`subpax_${U}_wing_left`]},{outName:`ipax_${U}_hollow`,boolMethod:Z.eUnion,inList:[`subpax_${U}_beamHollow`,`subpax_${U}_wing_hollow_right`,`subpax_${U}_wing_hollow_left`,`subpax_${U}_door`]},{outName:`pax_${U}`,boolMethod:Z.eSubstraction,inList:[`ipax_${U}_plus`,`ipax_${U}_hollow`]}]},i.sub={},i.logstr+=`heliostat-rake drawn successfully!
|
|
35
|
-
`,i.calcErr=!1}catch(f){i.logstr+=f,console.log(f)}return i}var bt={pTitle:"Heliostat rake",pDescription:"The rake on top of the pole-rotor of the heliostat",pDef:Zt,pGeom:be},Ct={partName:"spider",params:[e("D1","mm",100,1,400,1),e("L1","mm",400,1,1e3,1),e("L2","mm",400,1,1e3,1),e("L3","mm",100,1,400,1),e("L4","mm",3e3,10,8e3,10),e("L5","mm",2e3,1,8e3,1),e("L6","mm",30,1,100,1),e("E1","mm",3,1,80,1),e("E2","mm",50,1,200,1),e("E3","mm",3,1,80,1),e("R2","mm",100,0,400,10),e("N1","",6,1,20,1)],paramSvg:{D1:"spider_profile.svg",L1:"spider_profile.svg",L2:"spider_profile.svg",L3:"spider_profile.svg",L4:"spider_profile.svg",L5:"spider_lateral.svg",L6:"spider_lateral.svg",E1:"spider_profile.svg",E2:"spider_profile.svg",E3:"spider_profile.svg",R2:"spider_profile.svg",N1:"spider_lateral.svg"},sim:{tMax:360,tStep:.5,tUpdate:500}};function $e(l,t){let s,n;const o=nt(Ct.partName),i=C(),d=C(),w=C();o.logstr+=`${o.partName} simTime: ${l}
|
|
36
|
-
`;try{const _=t.D1/2;if(t.D1<t.E2)throw`err476: D1 ${t.D1} smaller then E2 ${t.E2}`;const a=t.E2/2,h=Math.sqrt(_**2-a**2),g=t.L1+t.L2*Math.sqrt(2),r=t.L2+t.L1*Math.sqrt(2),c=t.L4-r;if(c<t.R2)throw`err984: L4 ${t.L4} too small compare to R2 ${t.R2}`;const f=c*Math.cos(Math.PI/4),N=c*Math.sin(Math.PI/4),y=t.E2*Math.cos(Math.PI/4),x=t.E2*Math.sin(Math.PI/4),A=t.E2*Math.tan(Math.PI/8);if(_<t.E1)throw`err092: D1 ${t.D1} too small compare to E1 ${t.E1}`;if(t.L3<t.E2)throw`err994: L3 ${t.L3} smaller than E2 ${t.E2}`;if(t.L3<2*t.E3)throw`err997: L3 ${t.L3} too small compare to E3 ${t.E3}`;const S=(t.L3-t.E2)/2*Math.cos(Math.PI/4),R=g+f+S,D=-t.L1-N+S,k=D-t.E3*Math.sqrt(2);if(t.L5<t.N1*t.L6)throw`err110: L5 ${t.L5} too small compare to N1 ${t.N1} and L6 ${t.L6}`;let $=1;t.N1>1&&($=(t.L5-t.L6)/(t.N1-1));const b=[...Array(t.N1).keys()].map(T=>T*$);s=function(T,F,p){return z(T,F).addSegStrokeA(T+p*Math.cos(Math.PI/4),F-p*Math.sin(Math.PI/4)).addSegStrokeA(T,F-2*p*Math.sin(Math.PI/4)).addSegStrokeA(T-p*Math.cos(Math.PI/4),F-p*Math.sin(Math.PI/4)).closeSegStroke()},n=function(T,F,p,W){return z(p,W).addSegStrokeA(p+T,W).addSegStrokeA(p+T,W+F).addSegStrokeA(p,W+F).closeSegStroke()};const u=Math.sin(2*Math.PI*l/Ct.sim.tMax)*Math.PI/2;o.logstr+=`spide leg number: ${t.N1}
|
|
37
|
-
`,o.logstr+=`spide position angle: ${L(st(u))} degree
|
|
38
|
-
`;const H=z(a,-h).addCornerRounded(t.R2).addSegStrokeA(a,-t.L1).addCornerRounded(t.R2).addSegStrokeA(g,-t.L1).addCornerRounded(t.R2+t.E2).addSegStrokeA(g+f,-t.L1-N).addSegStrokeA(g+f-y,-t.L1-N-x).addSegStrokeA(g-A,-t.L1-t.E2).addCornerRounded(t.R2).addSegStrokeA(-g+A,-t.L1-t.E2).addCornerRounded(t.R2).addSegStrokeA(-g-f+y,-t.L1-N-x).addSegStrokeA(-g-f,-t.L1-N).addSegStrokeA(-g,-t.L1).addCornerRounded(t.R2+t.E2).addSegStrokeA(-a,-t.L1).addCornerRounded(t.R2).addSegStrokeA(-a,-h).addCornerRounded(t.R2).closeSegArc(_,!0,!1);i.addMain(H),i.addMain(v(0,0,_-t.E1)),i.addSecond(s(R,D,t.L3)),i.addSecond(s(R,k,t.L3-2*t.E3)),i.addSecond(s(-R,D,t.L3)),i.addSecond(s(-R,k,t.L3-2*t.E3)),d.addMain(v(0,0,_)),d.addMain(v(0,0,_-t.E1)),d.addMain(s(R,D,t.L3)),d.addMain(s(R,k,t.L3-2*t.E3)),d.addMain(s(-R,D,t.L3)),d.addMain(s(-R,k,t.L3-2*t.E3)),d.addSecond(H),w.addSecond(n(t.L5,t.D1,0,-t.D1/2)),w.addSecond(n(t.L5,t.L3,0,-t.L4-t.L3));for(const T of b)w.addSecond(n(t.L6,t.L4,T,-t.L4));o.fig={faceLegs:i.rotate(0,0,u),faceTube:d.rotate(0,0,u),faceBody:w};const I=o.partName,M=b.map((T,F)=>({outName:`subpax_${I}_leg_${F}`,face:`${I}_faceLegs`,extrudeMethod:O.eLinearOrtho,length:t.L6,rotate:[0,0,0],translate:[0,0,T]})),B=b.map((T,F)=>`subpax_${I}_leg_${F}`);o.vol={extrudes:[{outName:`subpax_${I}_tube`,face:`${I}_faceTube`,extrudeMethod:O.eLinearOrtho,length:t.L5,rotate:[0,0,0],translate:[0,0,0]},...M],volumes:[{outName:`pax_${I}`,boolMethod:Z.eUnion,inList:[`subpax_${I}_tube`,...B]}]},o.sub={},o.logstr+=`heliostat-spider drawn successfully!
|
|
39
|
-
`,o.calcErr=!1}catch(_){o.logstr+=_,console.log(_)}return o}var It={pTitle:"Heliostat spider",pDescription:"The spider part for the control of the inclination of the heliostat",pDef:Ct,pGeom:$e},Jt={partName:"swing",params:[e("L1","mm",12500,100,4e4,10),e("L2","mm",6e3,100,4e4,10),e("L3","mm",500,1,4e3,1),e("L4","mm",600,1,4e3,1),e("L5","mm",2e3,1,1e4,1),e("L6","mm",2e3,1,1e4,1),e("D1","mm",400,1,1e3,1),e("H1","mm",100,1,400,1),e("H2","mm",100,1,400,1),e("H3","mm",100,1,400,1),e("H4","mm",100,1,400,1),e("E1","mm",5,1,80,1),e("E2","mm",3,1,80,1),e("E3","mm",3,1,80,1),e("rod1","",10,1,40,1),e("rod2","mm",1300,10,4e3,10),e("rod3","mm",400,10,1e3,10),e("rod4","mm",100,1,400,1)],paramSvg:{L1:"swing_top.svg",L2:"swing_top.svg",L3:"swing_top.svg",L4:"swing_top.svg",L5:"swing_top.svg",L6:"swing_top.svg",D1:"swing_top.svg",H1:"swing_top.svg",H2:"swing_top.svg",H3:"swing_side.svg",H4:"swing_side.svg",E1:"swing_side.svg",E2:"swing_side.svg",E3:"swing_face.svg",rod1:"swing_with_rod.svg",rod2:"swing_with_rod.svg",rod3:"swing_with_rod.svg",rod4:"swing_with_rod.svg"},sim:{tMax:180,tStep:.5,tUpdate:500}};function ve(l,t){let s,n;const o=nt(Jt.partName),i=C(),d=C(),w=C(),_=C();o.logstr+=`${o.partName} simTime: ${l}
|
|
40
|
-
`;try{const a=t.D1/2;o.logstr+=`swing size: L1 ${L(t.L1)} x L2 ${L(t.L2)} mm
|
|
41
|
-
`,s=function(S,R,D,k){return z(S,R).addSegStrokeA(S+D,R).addSegStrokeA(S+D,R+k).addSegStrokeA(S,R+k).closeSegStroke()},n=function(S,R,D,k,$){return z(S,R).addCornerRounded($).addSegStrokeA(S+D,R).addCornerRounded($).addSegStrokeA(S+D,R+k).addCornerRounded($).addSegStrokeA(S,R+k).addCornerRounded($).closeSegStroke()},i.addMain(v(0,0,a)),i.addMain(v(0,0,a-t.E1));const h=[-t.L2/2,-t.L3-t.H2,t.L3,t.L2/2-t.H2];for(const S of h)i.addMain(s(S,a-t.H4,t.H2,t.H4)),i.addMain(s(S+t.E2,a-t.H4+t.E2,t.H2-2*t.E2,t.H4-2*t.E2));i.addSecond(s(-t.L2/2,a,t.L2,t.H3));const g=[];g.push(-t.L1/2),g.push(t.L1/2-t.H1);for(const S of[-t.L5/2-2*t.L4-t.L6,-t.L5/2-t.L4,t.L5/2,t.L5/2+t.L4+t.L6])for(const R of[0,t.L4-t.H1])g.push(S+R);for(const S of g)d.addMain(s(S,a,t.H1,t.H3)),d.addMain(s(S+t.E3,a+t.E3,t.H1-2*t.E3,t.H3-2*t.E3));d.addSecond(s(-t.L1/2,-a,t.L1,t.D1)),d.addSecond(s(-t.L1/2,a-t.H4,t.L1,t.H4));for(const S of g)w.addSecond(s(S,-t.L2/2,t.H1,t.L2));for(const S of h)w.addSecond(s(-t.L1/2,S,t.L1,t.H2));w.addSecond(s(-t.L1/2,-a,t.L1,t.D1));for(const S of g)_.addMain(s(S,-t.L2/2,t.H1,t.L2));for(const S of h)_.addMain(s(-t.L1/2,S,t.L1,t.H2));_.addMain(s(-t.L1/2,-a,t.L1,t.D1));const r=-((t.rod1-1)*t.rod2+t.rod3)/2,c=(t.rod3-t.rod4)/2,f=t.rod3/2,N=1.2*t.L2,y=(N-f)/3,x=-N/2;for(let S=0;S<t.rod1;S++){const R=r+S*t.rod2;_.addSecond(s(R+c,x,t.rod4,N));for(let D=0;D<4;D++)_.addSecond(n(R,x+D*y,t.rod3,f,f/4))}o.fig={faceSide:i,faceFace:d,faceTop:w,faceTopWithRods:_};const A=o.partName;o.vol={extrudes:[{outName:`subpax_${A}_side`,face:`${A}_faceSide`,extrudeMethod:O.eLinearOrtho,length:t.L1,rotate:[0,0,0],translate:[0,0,-t.L1/2]},{outName:`subpax_${A}_face`,face:`${A}_faceFace`,extrudeMethod:O.eLinearOrtho,length:t.L2,rotate:[0,Math.PI/2,0],translate:[-t.L2/2,0,0]}],volumes:[{outName:`pax_${A}`,boolMethod:Z.eUnion,inList:[`subpax_${A}_side`,`subpax_${A}_face`]}]},o.sub={},o.logstr+=`heliostat-swing drawn successfully!
|
|
42
|
-
`,o.calcErr=!1}catch(a){o.logstr+=a,console.log(a)}return o}var $t={pTitle:"Heliostat swing",pDescription:"The swing for the heliostat inclination",pDef:Jt,pGeom:ve},Ft={partName:"heliostat",params:[e("H1","mm",3e3,10,4e4,10),e("H2","mm",2500,50,4e4,10),e("H3","mm",200,1,500,1),e("H4","mm",800,1,4e3,1),e("H5","mm",3e3,50,6e3,10),e("H6","mm",200,1,4e3,1),e("H7","mm",800,1,4e3,1),e("H8","mm",200,1,4e3,1),e("H9","mm",100,1,400,1),e("D1","mm",1e3,20,4e3,10),e("D2","mm",700,20,4e3,10),e("D3","mm",900,20,4e3,10),e("D4","mm",400,20,4e3,10),e("D5","mm",300,20,1e3,10),e("D6","mm",200,10,1e3,10),e("D7","mm",400,10,1e3,10),e("D8","mm",100,1,1e3,1),e("D9","mm",100,1,1e3,1),e("S1","mm",250,1,800,1),e("S2","mm",200,1,800,1),e("E1","mm",30,1,80,1),e("E2","mm",50,1,80,1),e("L1","mm",12500,100,4e4,10),e("L2","mm",6e3,100,4e4,10),e("L3","mm",100,1,500,1),e("L4","mm",600,1,4e3,1),e("L5","mm",2e3,10,6e3,1),e("L6","mm",2e3,1,6e3,1),e("L7","mm",100,1,1e3,1),e("L8","mm",200,1,1e3,1),e("al","degree",80,0,95,1),e("ar","degree",80,0,95,1)],paramSvg:{H1:"heliostat_overview.svg",H2:"heliostat_side.svg",H3:"heliostat_side_sizing.svg",H4:"heliostat_side_sizing.svg",H5:"heliostat_side_sizing.svg",H6:"heliostat_side_sizing.svg",H7:"heliostat_side_sizing.svg",H8:"heliostat_side_sizing.svg",H9:"heliostat_side_sizing.svg",D1:"heliostat_side_sizing.svg",D2:"heliostat_side_sizing.svg",D3:"heliostat_side_sizing.svg",D4:"heliostat_side_sizing.svg",D5:"heliostat_side_sizing.svg",D6:"heliostat_side_sizing.svg",D7:"heliostat_side_sizing.svg",D8:"heliostat_side_sizing.svg",D9:"heliostat_face_sizing.svg",S1:"heliostat_side_sizing.svg",S2:"heliostat_side_sizing.svg",E1:"heliostat_side_sizing.svg",E2:"heliostat_side_sizing.svg",L1:"heliostat_face_sizing.svg",L2:"heliostat_side_sizing.svg",L3:"heliostat_face_sizing.svg",L4:"heliostat_face_sizing.svg",L5:"heliostat_face_sizing.svg",L6:"heliostat_face_sizing.svg",L7:"heliostat_face_sizing.svg",L8:"heliostat_face_sizing.svg",al:"heliostat_side_sizing.svg",ar:"heliostat_side_sizing.svg"},sim:{tMax:100,tStep:.5,tUpdate:500}};function Me(l,t){const s=nt(Ft.partName),n=C(),o=C();s.logstr+=`${s.partName} simTime: ${l}
|
|
43
|
-
`;try{const i=t.H1+t.H2-t.H3+t.H4+t.H5-t.H6+t.H7;s.logstr+=`heliostat-height: ${L(i)}, diameter ${L(t.D1)} m
|
|
44
|
-
`,s.logstr+=`heliostat-swing-length: ${L(t.L1)}, width ${L(t.L2)} m
|
|
45
|
-
`;const w=(t.al-t.ar)/2-Math.sin(2*Math.PI*l/Ft.sim.tMax)*(t.al+t.ar)/2,_=Et(w);s.logstr+=`swing position angle: ${L(st(_))} degree
|
|
46
|
-
`;const a=t.H1+t.H2-t.H3,h=a+t.H4+t.H5-t.H6+t.H7,g=h+t.H8,r=dt(Dt.pDef),c=dt(bt.pDef),f=dt(It.pDef),N=dt($t.pDef);r.setVal("H1",t.H1),r.setVal("H2",t.H2),r.setVal("D1",t.D1),r.setVal("D2",t.D2),r.setVal("D3",t.D1-6*t.E1),r.setVal("E1",t.E1),r.setVal("E2",t.E1);const y=32,x=(t.D1-6*t.E1)/(y*4);r.setVal("N1",y),r.setVal("D5",x),r.setVal("L1",t.E1+x/2),r.setVal("H3",t.H1/4),r.setVal("H4",t.H1/2),r.setVal("D4",t.H1/4),r.setVal("L2",t.H1/80),r.setVal("E3",t.H1/80),c.setVal("H1",t.H4),c.setVal("H2",t.H5),c.setVal("H3",t.H4-2*t.E1),c.setVal("D1",t.D3),c.setVal("D2",t.D4),c.setVal("L9",t.D3/2),c.setVal("H7",t.D3/2*1.6),c.setVal("H6",t.D3/20),c.setVal("R9",t.D3/20),c.setVal("E1",t.E1),c.setVal("E3",t.E1),c.setVal("E4",t.E1);const A=t.D2*.6,S=24,R=A/(S*4);if(c.setVal("D3",A),t.D2>t.D3-2*t.E1)throw`err153: D2 ${t.D2} too large compare to D3 ${t.D3} and E1 ${t.E1}`;if(c.setVal("N1",S),c.setVal("D7",R),c.setVal("L1",R),c.setVal("H4",t.H6),c.setVal("D4",t.D5),c.setVal("L7",t.L7),c.setVal("L8",t.L8),c.setVal("D6",t.D9),c.setVal("H5",t.H7+t.H8),c.setVal("D5",t.D6),c.setVal("D8",t.D7),t.D6>=t.D7)throw`err164: D6 ${t.D6} too large compare to D7 ${t.D7}`;const D=t.L4-2*t.L3;if(c.setVal("L4",D),D<=0)throw`err169: L3 ${t.L3} too large compare to L4 ${t.L4}`;c.setVal("L5",t.L5+2*t.L3),c.setVal("L6",t.L6+2*t.L3);const k=t.L5*.96,$=6;if(f.setVal("L5",k),f.setVal("D1",t.D8),f.setVal("L1",t.S1),f.setVal("L2",t.S2),f.setVal("L3",t.E2*2),f.setVal("E1",t.E1),f.setVal("E2",t.E2),f.setVal("E3",t.E1),f.setVal("L4",t.L2/2-t.H8),f.setVal("R2",0),f.setVal("N1",$),f.setVal("L6",k/($*10)),N.setVal("L2",t.L2),N.setVal("D1",t.D6),N.setVal("H3",t.H9),N.setVal("H4",t.H9),N.setVal("L1",t.L1),t.L1<4*t.L4+2*t.L6+t.L5+2*t.L3)throw`err185: L1 ${t.L1} too small compare to L4 ${t.L4}, L5 ${t.L5}, L6 ${t.L6}`;N.setVal("H1",t.L3),N.setVal("H2",t.L3),N.setVal("L4",t.L4),N.setVal("L5",t.L5),N.setVal("L6",t.L6),N.setVal("L3",t.D7);const b=Dt.pGeom(0,r.getParamVal());ct(b),s.logstr+=ht(b.logstr,r.partName);const u=bt.pGeom(0,c.getParamVal());ct(u),s.logstr+=ht(u.logstr,c.partName);const H=It.pGeom(0,f.getParamVal());ct(H),s.logstr+=ht(H.logstr,f.partName);const I=$t.pGeom(0,N.getParamVal());ct(I),s.logstr+=ht(I.logstr,N.partName),n.mergeFigure(b.fig.poleCut),n.mergeFigure(u.fig.faceBeam.translate(0,a)),n.mergeFigure(H.fig.faceLegs.translate(0,h).rotate(0,h,_/2)),n.mergeFigure(I.fig.faceSide.translate(0,g).rotate(0,g,_)),o.mergeFigure(b.fig.poleCut),o.mergeFigure(u.fig.faceCone.translate(0,a)),o.mergeFigure(H.fig.faceBody.translate(-k/2,h)),o.mergeFigure(I.fig.faceFace.translate(0,g)),s.fig={faceSide:n,faceFace:o};const M=s.partName;s.vol={inherits:[{outName:`inpax_${M}_poleStatic`,subdesign:"pax_pole_static",subgeom:b,rotate:[0,0,0],translate:[0,0,0]},{outName:`inpax_${M}_rake`,subdesign:"pax_rake",subgeom:u,rotate:[0,0,0],translate:[0,0,a]},{outName:`inpax_${M}_swing`,subdesign:"pax_swing",subgeom:I,rotate:[Math.PI/2,0,0],translate:[0,0,g]},{outName:`inpax_${M}_spider`,subdesign:"pax_spider",subgeom:H,rotate:[Math.PI/2,0,0],translate:[0,k/2,h]}],extrudes:[],volumes:[{outName:`pax_${M}`,boolMethod:Z.eUnion,inList:[`inpax_${M}_poleStatic`,`inpax_${M}_rake`,`inpax_${M}_swing`,`inpax_${M}_spider`]}]};const B={partName:r.getPartName(),dparam:r.getDesignParamList(),orientation:[0,0,0],position:[0,0,0]},T={partName:c.getPartName(),dparam:c.getDesignParamList(),orientation:[0,0,0],position:[0,0,a]},F={partName:f.getPartName(),dparam:f.getDesignParamList(),orientation:[Math.PI/2,0,0],position:[0,k/2,h]},p={partName:N.getPartName(),dparam:N.getDesignParamList(),orientation:[Math.PI/2,0,0],position:[0,0,g]};s.sub={pole_static_1:B,rake_1:T,spider_1:F,swing_1:p},s.logstr+=`heliostat-overview drawn successfully!
|
|
47
|
-
`,s.calcErr=!1}catch(i){s.logstr+=i,console.log(i)}return s}var xe={pTitle:"Heliostat overview",pDescription:"The heliostat inclination mechanism",pDef:Ft,pGeom:Me},Kt={partName:"rake_stopper",params:[e("D1","mm",600,10,4e3,10),e("D2","mm",400,10,4e3,10),e("D3","mm",400,1,4e3,1),e("H1","mm",800,1,4e3,1),e("H2","mm",3e3,20,6e3,10),e("H3","mm",400,0,4e3,1),e("E1","mm",20,1,80,1),e("E3","mm",30,1,80,1),e("H4","mm",200,1,1e3,1),e("D4","mm",300,1,1e3,1),e("E4","mm",20,1,80,1),e("H5","mm",400,1,2e3,1),e("D5","mm",200,1,1e3,1),e("L4","mm",300,1,1e3,1),e("L5","mm",2e3,1,4e3,1),e("L6","mm",2e3,1,4e3,1),e("D6","mm",100,1,600,1),e("E6","mm",10,1,80,1),e("L7","mm",100,1,1e3,1),e("L8","mm",200,1,1e3,1),e("N1","",24,3,100,1),e("D7","mm",40,1,100,1),e("L1","mm",30,1,300,1),e("D8","mm",400,1,1e3,1),e("H6","mm",100,1,1e3,1),e("H7","mm",600,1,2e3,1),e("L9","mm",300,1,1e3,1),e("R9","mm",50,0,300,1),e("S1","mm",100,1,300,1),e("S2","mm",2e3,1,8e3,1),e("E7","mm",5,1,80,1)],paramSvg:{D1:"rake_face.svg",D2:"rake_face.svg",D3:"rake_face.svg",H1:"rake_face.svg",H2:"rake_face.svg",H3:"rake_face.svg",E1:"rake_face.svg",E3:"rake_face.svg",H4:"rake_side.svg",D4:"rake_side.svg",E4:"rake_side.svg",H5:"rake_side.svg",D5:"rake_side.svg",L4:"rake_face.svg",L5:"rake_face.svg",L6:"rake_face.svg",D6:"rake_face.svg",E6:"rake_face.svg",L7:"rake_face.svg",L8:"rake_face.svg",N1:"rake_top.svg",D7:"rake_top.svg",L1:"rake_top.svg",D8:"rake_side.svg",H6:"rake_door.svg",H7:"rake_door.svg",L9:"rake_door.svg",R9:"rake_door.svg",S1:"rake_side_stopper.svg",S2:"rake_top_stopper.svg",E7:"rake_side_stopper.svg"},sim:{tMax:180,tStep:.5,tUpdate:500}};function ke(l,t){let s;const n=nt(Kt.partName),o=C(),i=C(),d=C(),w=C(),_=C(),a=C(),h=C(),g=C(),r=C(),c=C(),f=C(),N=C(),y=C(),x=C(),A=C();n.logstr+=`${n.partName} simTime: ${l}
|
|
48
|
-
`;try{const S=t.D1/2,R=t.H1+t.H2,D=R-t.H4+t.H5;if(n.logstr+=`cone-height: ${L(R)} mm
|
|
49
|
-
`,n.logstr+=`cone-height total: ${L(D)} mm
|
|
50
|
-
`,2*t.E7>=t.S1)throw`err135: E7 ${t.E7} too large compare to S1 ${t.S1}`;if(t.L5<t.D2)throw`err138: L5 ${t.L5} too small compare to D2 ${t.D2}`;const k=D-t.S2;if(k<0)throw`err143: S2 ${t.S2} too large compare to H1H5 ${L(D)}`;const $=t.H1+t.H2-t.H4+t.D4/2,b=t.H1+t.L8-t.S1;s=function(j,G,J,ot,lt){const ut=j*Math.cos(lt),Lt=j*Math.sin(lt),_t=-G*Math.sin(lt),Ht=G*Math.cos(lt);return z(J,ot).addSegStrokeA(J+ut,ot+Lt).addSegStrokeA(J+ut+_t,ot+Lt+Ht).addSegStrokeA(J+_t,ot+Ht).closeSegStroke()};const u=dt(bt.pDef);u.setVal("D1",t.D1),u.setVal("D2",t.D2),u.setVal("D3",t.D3),u.setVal("H1",t.H1),u.setVal("H2",t.H2),u.setVal("H3",t.H3),u.setVal("E1",t.E1),u.setVal("E3",t.E3),u.setVal("H4",t.H4),u.setVal("D4",t.D4),u.setVal("E4",t.E4),u.setVal("H5",t.H5),u.setVal("D5",t.D5),u.setVal("L4",t.L4),u.setVal("L5",t.L5),u.setVal("L6",t.L6),u.setVal("D6",t.D6),u.setVal("E6",t.E6),u.setVal("L7",t.L7),u.setVal("L8",t.L8),u.setVal("N1",t.N1),u.setVal("D7",t.D7),u.setVal("L1",t.L1),u.setVal("D8",t.D8),u.setVal("H6",t.H6),u.setVal("H7",t.H7),u.setVal("L9",t.L9),u.setVal("R9",t.R9);const H=bt.pGeom(0,u.getParamVal());ct(H),n.logstr+=ht(H.logstr,u.partName),o.mergeFigure(H.fig.faceCone),i.mergeFigure(H.fig.faceBeam),d.mergeFigure(H.fig.faceBeamHollow),w.mergeFigure(H.fig.faceDisc),_.mergeFigure(H.fig.faceHand),a.mergeFigure(H.fig.faceWing),h.mergeFigure(H.fig.faceWingHollow),g.mergeFigure(H.fig.faceDoor),r.mergeFigure(H.fig.faceDisc,!0);const I=t.L5/2,M=t.S1/2,B=t.S1-2*t.E7,T=B/2;r.addMain(s(t.S1,t.L5,-S-t.S1,-I,0)),r.addMain(s(B,t.L5,-S-t.E7-B,-I,0)),r.addMain(s(t.S1,t.L5,t.S2-t.S1,-I,0)),r.addMain(s(B,t.L5,t.S2-t.E7-B,-I,0));const F=t.S2-t.S1/2;r.addMain(s(F,t.S1,0,-I,0)),r.addMain(s(F,B,0,-I+t.E7,0)),r.addMain(s(F,t.S1,0,I-t.S1,0)),r.addMain(s(F,B,0,I-t.S1+t.E7,0)),r.addMain(s(F,t.S1,0,-S-t.S1,0)),r.addMain(s(F,B,0,-S-t.S1+t.E7,0)),r.addMain(s(F,t.S1,0,S,0)),r.addMain(s(F,B,0,S+t.E7,0)),c.mergeFigure(H.fig.faceBeam,!0),c.addMain(v(-S-M,k+M,M)),c.addMain(v(-S-M,k+M,T)),c.addMain(v(t.S2-M,$+M,M)),c.addMain(v(t.S2-M,$+M,T)),c.addSecond(s(F,t.S1,0,$,0)),c.addSecond(s(F,B,0,$+t.E7,0));const p=$+t.S1/2-b,W=Math.sqrt(F**2+p**2),X=Math.atan2(p,F);n.logstr+=`stopper-rod: L ${L(W)} mm, A ${L(st(X))} degree
|
|
51
|
-
`;const K=M*Math.sin(X),it=M*Math.cos(X),q=b-it;c.addSecond(s(W,t.S1,K,q,X));const Q=T*Math.sin(X),m=T*Math.cos(X),E=b-m;c.addSecond(s(W,B,Q,E,X)),f.mergeFigure(H.fig.faceBeam,!0),f.addSecond(v(-S-M,k+M,M)),f.addMain(v(-S-M,k+M,T)),f.addSecond(v(t.S2-M,$+M,M)),f.addMain(v(t.S2-M,$+M,T)),N.mergeFigure(H.fig.faceCone,!0),N.addMain(v(-t.L5/2+M,$+M,M)),N.addMain(v(-t.L5/2+M,$+M,T)),N.addMain(v(t.L5/2-M,$+M,M)),N.addMain(v(t.L5/2-M,$+M,T)),y.mergeFigure(H.fig.faceCone,!0),y.addSecond(v(-t.L5/2+M,$+M,M)),y.addMain(v(-t.L5/2+M,$+M,T)),y.addSecond(v(t.L5/2-M,$+M,M)),y.addMain(v(t.L5/2-M,$+M,T)),x.mergeFigure(H.fig.faceCone,!0),x.addMain(v(-S-M,0,M)),x.addMain(v(-S-M,0,T)),x.addMain(v(S+M,0,M)),x.addMain(v(S+M,0,T)),A.mergeFigure(H.fig.faceCone,!0),A.addSecond(v(-S-M,0,M)),A.addMain(v(-S-M,0,T)),A.addSecond(v(S+M,0,M)),A.addMain(v(S+M,0,T)),n.fig={faceCone:o,faceBeam:i,faceBeamHollow:d,faceDisc:w,faceHand:_,faceWing:a,faceWingHollow:h,faceDoor:g,faceStopperTop:r,faceStopperSide:c,faceStopperSideH:f,faceStopperFaceT:N,faceStopperFaceTH:y,faceStopperFaceB:x,faceStopperFaceBH:A};const P=n.partName;n.vol={inherits:[{outName:`inpax_${P}_rake`,subdesign:"pax_rake",subgeom:H,rotate:[0,0,0],translate:[0,0,0]}],extrudes:[{outName:`subpax_${P}_stpSide`,face:`${P}_faceStopperSide`,extrudeMethod:O.eLinearOrtho,length:t.L5,rotate:[Math.PI/2,0,0],translate:[0,t.L5/2,0]},{outName:`subpax_${P}_stpSideH`,face:`${P}_faceStopperSideH`,extrudeMethod:O.eLinearOrtho,length:t.L5,rotate:[Math.PI/2,0,0],translate:[0,t.L5/2,0]},{outName:`subpax_${P}_stpFaceT`,face:`${P}_faceStopperFaceT`,extrudeMethod:O.eLinearOrtho,length:F,rotate:[Math.PI/2,0,Math.PI/2],translate:[0,0,0]},{outName:`subpax_${P}_stpFaceTH`,face:`${P}_faceStopperFaceTH`,extrudeMethod:O.eLinearOrtho,length:F,rotate:[Math.PI/2,0,Math.PI/2],translate:[0,0,0]},{outName:`subpax_${P}_stpFaceB`,face:`${P}_faceStopperFaceB`,extrudeMethod:O.eLinearOrtho,length:W,rotate:[Math.PI/2-X,0,Math.PI/2],translate:[0,0,b]},{outName:`subpax_${P}_stpFaceBH`,face:`${P}_faceStopperFaceBH`,extrudeMethod:O.eLinearOrtho,length:W,rotate:[Math.PI/2-X,0,Math.PI/2],translate:[0,0,b]}],volumes:[{outName:`ipax_${P}_plus`,boolMethod:Z.eUnion,inList:[`subpax_${P}_stpSide`,`subpax_${P}_stpFaceT`,`subpax_${P}_stpFaceB`]},{outName:`ipax_${P}_hollow`,boolMethod:Z.eUnion,inList:[`subpax_${P}_stpSideH`,`subpax_${P}_stpFaceTH`,`subpax_${P}_stpFaceBH`]},{outName:`ipax_${P}_stopper`,boolMethod:Z.eSubstraction,inList:[`ipax_${P}_plus`,`ipax_${P}_hollow`]},{outName:`pax_${P}`,boolMethod:Z.eUnion,inList:[`inpax_${P}_rake`,`ipax_${P}_stopper`]}]},n.sub={},n.logstr+=`heliostat-rake drawn successfully!
|
|
52
|
-
`,n.calcErr=!1}catch(S){n.logstr+=S,console.log(S)}return n}var yt={pTitle:"Heliostat rake with stopper",pDescription:"The rake-stopper on top of the pole-rotor of the heliostat",pDef:Kt,pGeom:ke},Tt={partName:"heliostat_2",params:[e("H1","mm",3e3,10,4e4,10),e("H2","mm",2500,50,4e4,10),e("H3","mm",200,1,500,1),e("H4","mm",800,1,4e3,1),e("H5","mm",3e3,50,6e3,10),e("H6","mm",200,1,4e3,1),e("H7","mm",400,1,4e3,1),e("H9","mm",100,1,400,1),e("D1","mm",1e3,20,4e3,10),e("D2","mm",700,20,4e3,10),e("D3","mm",900,20,4e3,10),e("D4","mm",400,20,4e3,10),e("D5","mm",300,20,1e3,10),e("D6","mm",200,10,1e3,10),e("D7","mm",400,10,1e3,10),e("D9","mm",100,1,1e3,1),e("E1","mm",30,1,80,1),e("L1","mm",12500,100,4e4,10),e("L2","mm",6e3,100,4e4,10),e("L3","mm",100,1,500,1),e("L4","mm",600,1,4e3,1),e("L5","mm",2e3,10,6e3,10),e("L6","mm",2e3,1,6e3,1),e("L7","mm",100,1,1e3,1),e("L8","mm",200,1,1e3,1),e("al","degree",80,0,95,1),e("S1","mm",100,1,800,1)],paramSvg:{H1:"heliostat_overview.svg",H2:"heliostat_side.svg",H3:"heliostat2_side_sizing.svg",H4:"heliostat2_side_sizing.svg",H5:"heliostat2_side_sizing.svg",H6:"heliostat2_side_sizing.svg",H7:"heliostat2_side_sizing.svg",H9:"heliostat2_side_sizing.svg",D1:"heliostat2_side_sizing.svg",D2:"heliostat2_side_sizing.svg",D3:"heliostat2_side_sizing.svg",D4:"heliostat2_side_sizing.svg",D5:"heliostat2_side_sizing.svg",D6:"heliostat2_side_sizing.svg",D7:"heliostat2_side_sizing.svg",D9:"heliostat2_face_sizing.svg",E1:"heliostat2_side_sizing.svg",L1:"heliostat2_face_sizing.svg",L2:"heliostat2_side_sizing.svg",L3:"heliostat2_face_sizing.svg",L4:"heliostat2_face_sizing.svg",L5:"heliostat2_face_sizing.svg",L6:"heliostat2_face_sizing.svg",L7:"heliostat2_face_sizing.svg",L8:"heliostat2_face_sizing.svg",al:"heliostat2_side_sizing.svg",S1:"heliostat2_side_sizing.svg"},sim:{tMax:100,tStep:.5,tUpdate:500}};function Ee(l,t){const s=nt(Tt.partName),n=C(),o=C(),i=C();s.logstr+=`${s.partName} simTime: ${l}
|
|
53
|
-
`;try{const d=t.H1+t.H2-t.H3+t.H4+t.H5-t.H6+t.H7;s.logstr+=`heliostat-height: ${L(d)}, diameter ${L(t.D1)} m
|
|
54
|
-
`,s.logstr+=`heliostat-swing-length: ${L(t.L1)}, width ${L(t.L2)} m
|
|
55
|
-
`;const w=t.al*l/Tt.sim.tMax,_=Et(w);s.logstr+=`swing position angle: ${L(st(_))} degree
|
|
56
|
-
`;const a=t.H1+t.H2-t.H3,h=a+t.H4+t.H5-t.H6+t.H7,g=dt(Dt.pDef),r=dt(yt.pDef),c=dt($t.pDef);g.setVal("H1",t.H1),g.setVal("H2",t.H2),g.setVal("D1",t.D1),g.setVal("D2",t.D2),g.setVal("D3",t.D1-6*t.E1),g.setVal("E1",t.E1),g.setVal("E2",t.E1);const f=32,N=(t.D1-6*t.E1)/(f*4);g.setVal("N1",f),g.setVal("D5",N),g.setVal("L1",t.E1+N/2),g.setVal("H3",t.H1/4),g.setVal("H4",t.H1/2),g.setVal("D4",t.H1/4),g.setVal("L2",t.H1/80),g.setVal("E3",t.H1/80),r.setVal("H1",t.H4),r.setVal("H2",t.H5),r.setVal("H3",t.H4-2*t.E1),r.setVal("D1",t.D3),r.setVal("D2",t.D4),r.setVal("L9",t.D3/2),r.setVal("H7",t.D3/2*1.6),r.setVal("H6",t.D3/20),r.setVal("R9",t.D3/20),r.setVal("E1",t.E1),r.setVal("E3",t.E1),r.setVal("E4",t.E1),r.setVal("E6",t.E1),r.setVal("E7",t.E1);const y=t.D2*.6,x=24,A=y/(x*4);if(r.setVal("D3",y),t.D2>t.D3-2*t.E1)throw`err153: D2 ${t.D2} too large compare to D3 ${t.D3} and E1 ${t.E1}`;if(r.setVal("N1",x),r.setVal("D7",A),r.setVal("L1",A),r.setVal("H4",t.H6),r.setVal("D4",t.D5),r.setVal("L7",t.L7),r.setVal("L8",t.L8),r.setVal("D6",t.D9),r.setVal("H5",t.H7),r.setVal("D5",t.D6),r.setVal("D8",t.D7),t.D6>=t.D7)throw`err164: D6 ${t.D6} too large compare to D7 ${t.D7}`;const S=t.L4-2*t.L3;if(r.setVal("L4",S),S<=0)throw`err169: L3 ${t.L3} too large compare to L4 ${t.L4}`;if(r.setVal("L5",t.L5+2*t.L3),r.setVal("L6",t.L6+2*t.L3),r.setVal("S1",t.S1),r.setVal("S2",t.L2/2),c.setVal("L2",t.L2),c.setVal("D1",t.D6),c.setVal("H3",t.H9),c.setVal("H4",t.H9),c.setVal("L1",t.L1),t.L1<4*t.L4+2*t.L6+t.L5+2*t.L3)throw`err185: L1 ${t.L1} too small compare to L4 ${t.L4}, L5 ${t.L5}, L6 ${t.L6}`;c.setVal("H1",t.L3),c.setVal("H2",t.L3),c.setVal("L4",t.L4),c.setVal("L5",t.L5),c.setVal("L6",t.L6),c.setVal("L3",t.D7);const R=Dt.pGeom(0,g.getParamVal());ct(R),s.logstr+=ht(R.logstr,g.partName);const D=yt.pGeom(0,r.getParamVal());ct(D),s.logstr+=ht(D.logstr,r.partName);const k=$t.pGeom(0,c.getParamVal());ct(k),s.logstr+=ht(k.logstr,c.partName),n.mergeFigure(R.fig.poleCut),n.mergeFigure(D.fig.faceStopperSide.translate(0,a)),n.mergeFigure(k.fig.faceSide.translate(0,h).rotate(0,h,_)),o.mergeFigure(R.fig.poleCut),o.mergeFigure(D.fig.faceStopperFaceT.translate(0,a)),o.mergeFigure(k.fig.faceFace.translate(0,h)),i.mergeFigure(R.fig.poleBottom.translate(0,0)),i.mergeFigure(D.fig.faceStopperTop.translate(0,0)),i.mergeFigure(k.fig.faceTop.rotate(0,0,Math.PI/2)),s.fig={faceSide:n,faceFace:o,faceTop:i};const $=s.partName;s.vol={inherits:[{outName:`inpax_${$}_poleStatic`,subdesign:"pax_pole_static",subgeom:R,rotate:[0,0,0],translate:[0,0,0]},{outName:`inpax_${$}_rake`,subdesign:"pax_rake_stopper",subgeom:D,rotate:[0,0,0],translate:[0,0,a]},{outName:`inpax_${$}_swing`,subdesign:"pax_swing",subgeom:k,rotate:[Math.PI/2,0,0],translate:[0,0,h]}],extrudes:[],volumes:[{outName:`pax_${$}`,boolMethod:Z.eUnion,inList:[`inpax_${$}_poleStatic`,`inpax_${$}_rake`,`inpax_${$}_swing`]}]};const b=g.getDesignParamList(),u={partName:g.getPartName(),dparam:b,orientation:[0,0,0],position:[0,0,0]},H={partName:r.getPartName(),dparam:r.getDesignParamList(),orientation:[0,0,0],position:[0,0,a]},I={partName:c.getPartName(),dparam:c.getDesignParamList(),orientation:[0,0,0],position:[0,0,h]};s.sub={pole_static_1:u,rake_1:H,swing_1:I},s.logstr+=`heliostat-2-overview drawn successfully!
|
|
57
|
-
`,s.calcErr=!1}catch(d){s.logstr+=d,console.log(d)}return s}var Pe={pTitle:"Heliostat-2 overview",pDescription:"The heliostat-2 inclination mechanism",pDef:Tt,pGeom:Ee},Qt={partName:"base",params:[e("D1","mm",600,10,4e3,10),e("D2","mm",700,10,4e3,10),e("D3","mm",400,10,4e3,10),e("D4","mm",500,10,4e3,10),e("E1","mm",30,1,80,1),e("E2","mm",30,1,80,1),e("E3","mm",30,1,80,1),e("H1","mm",800,10,4e3,10),e("H2","mm",50,1,4e3,1),e("H3","mm",400,10,4e3,10),e("N2","",12,1,100,1),e("L2","mm",100,1,400,1),e("N1","",24,3,100,1),e("D5","mm",40,1,100,1),e("L1","mm",34,1,300,1)],paramSvg:{D1:"base_cut.svg",D2:"base_cut.svg",D3:"base_cut.svg",D4:"base_cut.svg",E1:"base_cut.svg",E2:"base_cut.svg",E3:"base_cut.svg",H1:"base_cut.svg",H2:"base_hollow.svg",H3:"base_hollow.svg",N2:"base_hollow.svg",L2:"base_hollow.svg",N1:"base_top.svg",D5:"base_top.svg",L1:"base_top.svg"},sim:{tMax:180,tStep:.5,tUpdate:500}};function Ae(l,t){let s,n,o;const i=nt(Qt.partName),d=C(),w=C(),_=C();i.logstr+=`${i.partName} simTime: ${l}
|
|
58
|
-
`;try{const a=t.D1/2,h=t.D2/2,g=t.D3/2,r=t.D4/2,c=t.D5/2,f=t.L2/2;if(h<a)throw`err089: D2 ${t.D2} too small compare to D1 ${t.D1}`;if(r>a-t.E2)throw`err189: D4 ${t.D4} too large compare to D1 ${t.D1} and E2 ${t.E2}`;i.logstr+=`base-height: ${L(t.H1)} mm
|
|
59
|
-
`,i.logstr+=`base-external-diameter: ${L(t.D2)} mm
|
|
60
|
-
`;const N=t.D1*Math.PI/t.N2-t.L2;if(i.logstr+=`inter-hollow: ${L(N)} mm
|
|
61
|
-
`,s=function(H){return z(H*h,0).addSegStrokeA(H*h,t.E3).addSegStrokeA(H*a,t.E3).addSegStrokeA(H*a,t.H1).addSegStrokeA(H*(a-t.E2),t.H1).addSegStrokeA(H*(a-t.E2),t.E3).addSegStrokeA(H*r,t.E3).addSegStrokeA(H*r,0).closeSegStroke()},n=function(H){return z(H*h,0).addSegStrokeA(H*h,t.E3).addSegStrokeA(H*a,t.E3).addSegStrokeA(H*a,t.H1).addSegStrokeA(H*g,t.H1).addSegStrokeA(H*g,t.H1-t.E1).addSegStrokeA(H*(a-t.E2),t.H1-t.E1).addSegStrokeA(H*(a-t.E2),t.E3).addSegStrokeA(H*r,t.E3).addSegStrokeA(H*r,0).closeSegStroke()},t.H1<t.E3+t.H2+t.H3+t.E1)throw`err125: H1 ${t.H1} too small compare to E3 ${t.H3}, H2 ${t.H2}, H3 ${t.H3}, E1 ${t.E1}`;if(t.D5>t.H3)throw`err128: D5 ${t.D5} too large compare to H3 ${t.H3}`;const y=2*Math.asin(f/(a-t.E2));if(t.N2*y>2*Math.PI)throw`err132: N2 ${t.N2} too large compare to L2 ${t.L2}, D1 ${t.D1}, E2 ${t.E2}`;const x=t.E3+t.H2+f;if(o=function(H){return z(H*f,x).addSegStrokeA(H*f,x+t.H3-t.L2).addPointA(-H*f,x+t.H3-t.L2).addSegArc(f,!1,!0).addSegStrokeA(-H*f,x).closeSegArc(f,!1,!0)},d.addMain(s(1)),d.addSecond(n(1)),d.addSecond(n(-1)),d.addSecond(o(1)),g+t.L1+c>a-t.E2)throw`err127: D3 ${t.D3} too large compare to D1 ${t.D1}, E2 ${t.E2}, L1 ${t.L1}, R5 ${t.D5}`;if(c>t.L1)throw`err130: D5 ${t.D5} too large compare to L1 ${t.L1}`;const A=2*Math.asin(c/(h+t.L1));if(t.N1*A>2*Math.PI)throw`err134: N1 ${t.N1} too large compare to D5 ${t.D5}, L1 ${t.L1}, D2 ${t.D2}`;w.addMain(v(0,0,a)),w.addMain(v(0,0,g));const S=g+t.L1,R=2*Math.PI/t.N1;for(let H=0;H<t.N1;H++){const I=S*Math.cos(H*R),M=S*Math.sin(H*R);w.addMain(v(I,M,c))}w.addSecond(v(0,0,a-t.E1)),w.addSecond(v(0,0,h)),w.addSecond(v(0,0,r)),_.addMain(o(1)),_.addSecond(n(1)),_.addSecond(n(-1)),i.fig={faceCut:d,faceTop:w,faceHollow:_};const D=i.partName,k=2*Math.PI/t.N2,$=[...Array(t.N2).keys()],b=$.map(H=>({outName:`subpax_${D}_hollow_${H}`,face:`${D}_faceHollow`,extrudeMethod:O.eLinearOrtho,length:h+t.E2,rotate:[Math.PI/2,0,H*k],translate:[0,0,0]})),u=$.map(H=>`subpax_${D}_hollow_${H}`);i.vol={extrudes:[{outName:`subpax_${D}_cut`,face:`${D}_faceCut`,extrudeMethod:O.eRotate,rotate:[0,0,0],translate:[Math.PI/2,0,0]},{outName:`subpax_${D}_top`,face:`${D}_faceTop`,extrudeMethod:O.eLinearOrtho,length:t.E1,rotate:[0,0,0],translate:[0,0,t.H1-t.E1]},...b],volumes:[{outName:`ipax_${D}_hollows`,boolMethod:Z.eUnion,inList:[...u]},{outName:`ipax_${D}_cylinder`,boolMethod:Z.eSubstraction,inList:[`subpax_${D}_cut`,`ipax_${D}_hollows`]},{outName:`pax_${D}`,boolMethod:Z.eUnion,inList:[`ipax_${D}_cylinder`,`subpax_${D}_top`]}]},i.sub={},i.logstr+=`heliostat-base drawn successfully!
|
|
62
|
-
`,i.calcErr=!1}catch(a){i.logstr+=a,console.log(a)}return i}var Re={pTitle:"Heliostat base",pDescription:"The base for the static-pole of the heliostat",pDef:Qt,pGeom:Ae},te={partName:"pole_rotor",params:[e("D1","mm",600,1,4e3,1),e("D2","mm",400,1,4e3,1),e("H1","mm",8e3,10,4e4,10),e("E1","mm",5,1,80,1),e("E2","mm",30,1,80,1),e("N1","",24,3,100,1),e("D3","mm",40,1,100,1),e("L1","mm",45,1,300,1)],paramSvg:{D1:"pole_rotor_cut.svg",D2:"pole_rotor_cut.svg",H1:"pole_rotor_cut.svg",E1:"pole_rotor_cut.svg",E2:"pole_rotor_cut.svg",N1:"pole_rotor_ends.svg",D3:"pole_rotor_ends.svg",L1:"pole_rotor_ends.svg"},sim:{tMax:180,tStep:.5,tUpdate:500}};function Ne(l,t){let s;const n=nt(te.partName),o=C(),i=C();n.logstr+=`${n.partName} simTime: ${l}
|
|
63
|
-
`;try{const d=t.D1/2,w=t.D2/2,_=t.D3/2;n.logstr+=`pole-height: ${L(t.H1)} mm
|
|
64
|
-
`;const a=z(d,0).addSegStrokeA(d,t.H1).addSegStrokeA(d-t.E1,t.H1).addSegStrokeA(d-t.E1,0).closeSegStroke();o.addMain(a),s=function(c){return z(c*d,0).addSegStrokeA(c*d,t.H1).addSegStrokeA(c*w,t.H1).addSegStrokeA(c*w,t.H1-t.E2).addSegStrokeA(c*(d-t.E1),t.H1-t.E2).addSegStrokeA(c*(d-t.E1),t.E2).addSegStrokeA(c*w,t.E2).addSegStrokeA(c*w,0).closeSegStroke()},o.addSecond(s(1)),o.addSecond(s(-1)),i.addMain(v(0,0,d)),i.addMain(v(0,0,w));const h=w+t.L1,g=2*Math.PI/t.N1;for(let c=0;c<t.N1;c++){const f=h*Math.cos(c*g),N=h*Math.sin(c*g);i.addMain(v(f,N,_))}i.addSecond(v(0,0,d-t.E1)),n.fig={faceCut:o,faceBottom:i};const r=n.partName;n.vol={extrudes:[{outName:`subpax_${r}_pole`,face:`${r}_faceCut`,extrudeMethod:O.eRotate,rotate:[0,0,0],translate:[0,0,0]},{outName:`subpax_${r}_bottom`,face:`${r}_faceBottom`,extrudeMethod:O.eLinearOrtho,length:t.E2,rotate:[0,0,0],translate:[0,0,0]},{outName:`subpax_${r}_top`,face:`${r}_faceBottom`,extrudeMethod:O.eLinearOrtho,length:t.E2,rotate:[0,0,0],translate:[0,0,t.H1-t.E2]}],volumes:[{outName:`pax_${r}`,boolMethod:Z.eUnion,inList:[`subpax_${r}_pole`,`subpax_${r}_bottom`,`subpax_${r}_top`]}]},n.sub={},n.logstr+=`pole_rotor drawn successfully!
|
|
65
|
-
`,n.calcErr=!1}catch(d){n.logstr+=d,console.log(d)}return n}var Ve={pTitle:"Heliostat pole rotor",pDescription:"The vertical axis inside the pole of an heliostat",pDef:te,pGeom:Ne},ee={partName:"rod",params:[e("L1","mm",1e4,100,4e4,10),e("L2","mm",100,2,400,1),e("L3","mm",400,10,1e3,1),e("L4","mm",600,10,1e3,1),e("H1","mm",200,5,4e3,1),e("E1","mm",2,1,80,1),e("E2","mm",10,1,80,1),e("N1","",10,2,50,1),e("N3","",2,1,20,1),e("N4","",4,1,20,1),e("R3","mm",100,1,500,1),e("D2","mm",10,1,100,1),e("L7","mm",10,1,300,1)],paramSvg:{L1:"rod_top.svg",L2:"rod_top.svg",L3:"rod_top.svg",L4:"rod_top.svg",H1:"rod_cut.svg",E1:"rod_cut.svg",E2:"rod_cut.svg",N1:"rod_top.svg",N3:"rod_top.svg",N4:"rod_top.svg",R3:"rod_top.svg",D2:"rod_plate.svg",L7:"rod_plate.svg"},sim:{tMax:180,tStep:.5,tUpdate:500}};function Ce(l,t){let s,n;const o=nt(ee.partName),i=C(),d=C(),w=C();o.logstr+=`${o.partName} simTime: ${l}
|
|
66
|
-
`;try{const _=t.D2/2,a=t.L3/(t.N3+1),h=t.L4/(t.N4+1);o.logstr+=`rod-length: ${L(t.L1)} mm
|
|
67
|
-
`;const g=(t.L1-t.L3)/(t.N1-1);o.logstr+=`space-length: ${L(g)} mm
|
|
68
|
-
`,s=function(D){const k=[],$=z(t.L4/2,D).addCornerRounded(t.R3).addSegStrokeA(t.L4/2,D+t.L3).addCornerRounded(t.R3).addSegStrokeA(-t.L4/2,D+t.L3).addCornerRounded(t.R3).addSegStrokeA(-t.L4/2,D).addCornerRounded(t.R3).closeSegStroke();k.push($);for(let b=1;b<t.N3+1;b++)k.push(v(t.L4/2-t.L7,D+b*a,_)),k.push(v(-t.L4/2+t.L7,D+b*a,_));for(let b=1;b<t.N4+1;b++)k.push(v(-t.L4/2+b*h,D+t.L7,_)),k.push(v(-t.L4/2+b*h,D+t.L3-t.L7,_));return k},n=function(D,k){return z(t.L2/2,D).addSegStrokeA(t.L2/2,D+k).addSegStrokeA(-t.L2/2,D+k).addSegStrokeA(-t.L2/2,D).closeSegStroke()};const r=t.L2/2,c=t.L4/2,f=(t.L2-2*t.E1)/2,N=t.H1-t.E1,y=z(r,0).addSegStrokeA(r,t.H1).addSegStrokeA(-r,t.H1).addSegStrokeA(-r,0).closeSegStroke(),x=z(f,t.E1).addSegStrokeA(f,N).addSegStrokeA(-f,N).addSegStrokeA(-f,t.E1).closeSegStroke(),A=z(c,t.H1).addSegStrokeA(c,t.H1+t.E2).addSegStrokeA(-c,t.H1+t.E2).addSegStrokeA(-c,t.H1).closeSegStroke();i.addMain(y),i.addMain(x),i.addSecond(A),s(0).forEach(D=>d.addMain(D)),d.addSecond(n(-t.L3/2,2*t.L3));const S=(t.L1-t.L3)/(t.N1-1);for(let D=0;D<t.N1;D++)s(D*S).forEach(k=>w.addMain(k));w.addSecond(n(0,t.L1)),o.fig={faceCut:i,facePlate:d,faceTop:w};const R=o.partName;o.vol={extrudes:[{outName:`subpax_${R}_rod`,face:`${R}_faceCut`,extrudeMethod:O.eLinearOrtho,length:t.L1,rotate:[0,0,0],translate:[0,0,0]},{outName:`subpax_${R}_plates`,face:`${R}_faceTop`,extrudeMethod:O.eLinearOrtho,length:t.E2,rotate:[Math.PI/2,0,0],translate:[0,t.E2+t.H1,0]}],volumes:[{outName:`pax_${R}`,boolMethod:Z.eUnion,inList:[`subpax_${R}_rod`,`subpax_${R}_plates`]}]},o.sub={},o.logstr+=`heliostat-rod drawn successfully!
|
|
69
|
-
`,o.calcErr=!1}catch(_){o.logstr+=_,console.log(_)}return o}var Ie={pTitle:"Heliostat rod",pDescription:"The rod of an heliostat-surface",pDef:ee,pGeom:Ce},se={partName:"trapeze",params:[e("L1","mm",1600,10,4e3,1),e("L2","mm",1e3,10,4e3,1),e("L3","mm",400,5,800,1),e("L4","mm",300,5,800,1),e("N1","",7,1,20,1),e("N2","",4,1,20,1),e("N3","",2,1,20,1),e("N4","",2,1,20,1),e("L5","mm",100,1,400,1),e("L6","mm",20,1,400,1),e("L7","mm",20,1,400,1),e("D1","mm",10,1,40,1),e("D2","mm",10,1,40,1),e("D3","mm",30,1,100,1),e("D4","mm",26,1,100,1),e("R1","mm",60,1,400,1),e("R2","mm",20,1,400,1),e("R3","mm",20,1,400,1),e("H1","mm",300,.5,800,.5),e("H2","mm",2,.5,800,.5),e("H3","mm",5,.5,800,.5)],paramSvg:{L1:"trapeze_top.svg",L2:"trapeze_top.svg",L3:"trapeze_top.svg",L4:"trapeze_top.svg",N1:"trapeze_top.svg",N2:"trapeze_top.svg",N3:"trapeze_top.svg",N4:"trapeze_top.svg",L5:"trapeze_top.svg",L6:"trapeze_top.svg",L7:"trapeze_top.svg",D1:"trapeze_top.svg",D2:"trapeze_top.svg",D3:"trapeze_rod.svg",D4:"trapeze_rod.svg",R1:"trapeze_top.svg",R2:"trapeze_top.svg",R3:"trapeze_top.svg",H1:"trapeze_side.svg",H2:"trapeze_side.svg",H3:"trapeze_side.svg"},sim:{tMax:180,tStep:.5,tUpdate:500}};function Fe(l,t){let s,n;const o=nt(se.partName),i=C(),d=C(),w=C(),_=C(),a=C();o.logstr+=`${o.partName} simTime: ${l}
|
|
70
|
-
`;try{if(t.L3>t.L1-t.L5)throw`err595: L3 ${t.L3} too large compare to L1 ${t.L1} and L5 ${t.L5}`;if(t.L4>t.L2-t.L5)throw`err596: L4 ${t.L4} too large compare to L2 ${t.L2} and L5 ${t.L5}`;if(t.H1-t.H2-t.H3<4*t.D3)throw`err597: H1 ${t.H1} too small compare to H2 ${t.H2}, H3 ${t.H3} and D3 ${t.D3}`;const h=t.R1*(1-1/Math.sqrt(2)),g=t.R3*(1-1/Math.sqrt(2)),r=t.L2/2-h-(t.L4/2-g),c=t.L1/2-h-(t.L3/2-g),f=Math.sqrt(r**2+c**2),N=t.H1-t.H2-t.H3,y=Math.sqrt(f**2+N**2),x=Math.atan2(N,f),A=Math.atan2(c,r);o.logstr+=`rod-slope: length: ${L(y)} mm, angle: ${L(st(x))} degree
|
|
71
|
-
`,o.logstr+=`rod-xy-angle: ${L(st(A))} degree
|
|
72
|
-
`;const S=t.D3/Math.cos(Math.PI/2-x);o.logstr+=`rod-footprint-length: ${L(S)} mm
|
|
73
|
-
`;const R=Math.sqrt((S/2)**2+(t.D3/2)**2),D=Math.atan2(t.D3,S);if(s=function(P,j,G){return z(P,j).addPointRP(G+Math.PI-D,R).addSeg2Arcs(G+Math.PI/2,G).addPointRP(G+Math.PI+D,R).addSeg2Arcs(G+Math.PI,G+Math.PI/2).addPointRP(G-D,R).addSeg2Arcs(G+3*Math.PI/2,G+Math.PI).addPointRP(G+D,R).addSeg2Arcs(G,G-Math.PI/2)},n=function(P,j,G){const J=P+R*Math.cos(G+Math.PI-D),ot=j+R*Math.sin(G+Math.PI-D);return z(J,ot).addSegStrokeRP(G+Math.PI,f).addSegStrokeRP(G-Math.PI/2,t.D3).addSegStrokeRP(G,f).closeSegStroke()},t.R1>t.L1/4||t.R1>t.L2/4)throw`err614: R1 ${t.R1} too large compare to L1 ${t.L1} or L2 ${t.L2}`;const k=z(t.L2/2,t.L1/2).addSegStrokeA(-t.L2/2,t.L1/2).addCornerRounded(t.R1).addSegStrokeA(-t.L2/2,-t.L1/2).addCornerRounded(t.R1).addSegStrokeA(t.L2/2,-t.L1/2).addCornerRounded(t.R1).closeSegStroke().addCornerRounded(t.R1);if(t.R2>(t.L1-2*t.L5)/4||t.R2>(t.L2-2*t.L5)/4)throw`err627: R2 ${t.R2} too large compare to L1 ${t.L1}, L2 ${t.L2} and L5 ${t.L5}`;const $=z(t.L2/2-t.L5,t.L1/2-t.L5).addSegStrokeA(-t.L2/2+t.L5,t.L1/2-t.L5).addCornerRounded(t.R2).addSegStrokeA(-t.L2/2+t.L5,-t.L1/2+t.L5).addCornerRounded(t.R2).addSegStrokeA(t.L2/2-t.L5,-t.L1/2+t.L5).addCornerRounded(t.R2).closeSegStroke().addCornerRounded(t.R2);if(t.R3>t.L3/4||t.R3>t.L4/4)throw`err639: R3 ${t.R3} too large compare to L3 ${t.L3} or L4 ${t.L4}`;const b=z(t.L4/2,t.L3/2).addSegStrokeA(-t.L4/2,t.L3/2).addCornerRounded(t.R3).addSegStrokeA(-t.L4/2,-t.L3/2).addCornerRounded(t.R3).addSegStrokeA(t.L4/2,-t.L3/2).addCornerRounded(t.R3).closeSegStroke().addCornerRounded(t.R3);i.addMain(k),i.addMain($),i.addSecond(b);const u=t.L1/(t.N1+1),H=t.L2/(t.N2+1),I=t.L3/(t.N3+1),M=t.L4/(t.N4+1);if(t.L5<t.D1/2+t.L6)throw`err658: L5 ${t.L5} too small compare to D1 ${t.D1} or L6 ${t.L6}`;if(I<t.D2/2+t.L7)throw`err661: D2 ${t.D2} or L7 ${t.L7} too large compare to L3 ${t.l3}`;if(M<t.D2/2+t.L7)throw`err664: D2 ${t.D2} or L7 ${t.L7} too large compare to L4 ${t.l4}`;const B=[];for(let P=1;P<t.N1+1;P++)B.push(v(t.L2/2-t.L6,-t.L1/2+P*u,t.D1/2)),B.push(v(-t.L2/2+t.L6,-t.L1/2+P*u,t.D1/2));for(let P=1;P<t.N2+1;P++)B.push(v(-t.L2/2+P*H,t.L1/2-t.L6,t.D1/2)),B.push(v(-t.L2/2+P*H,-t.L1/2+t.L6,t.D1/2));const T=[];for(let P=1;P<t.N3+1;P++)T.push(v(t.L4/2-t.L7,-t.L3/2+P*I,t.D2/2)),T.push(v(-t.L4/2+t.L7,-t.L3/2+P*I,t.D2/2));for(let P=1;P<t.N4+1;P++)T.push(v(-t.L4/2+P*M,t.L3/2-t.L7,t.D2/2)),T.push(v(-t.L4/2+P*M,-t.L3/2+t.L7,t.D2/2));B.forEach(P=>{i.addMain(P)}),T.forEach(P=>{i.addSecond(P)});const F=[];F.push(s(t.L2/2-h,t.L1/2-h,A)),F.push(s(t.L4/2-g,t.L3/2-g,A)),F.push(s(-t.L2/2+h,t.L1/2-h,Math.PI-A)),F.push(s(-t.L4/2+g,t.L3/2-g,Math.PI-A)),F.push(s(-t.L2/2+h,-t.L1/2+h,Math.PI+A)),F.push(s(-t.L4/2+g,-t.L3/2+g,Math.PI+A)),F.push(s(t.L2/2-h,-t.L1/2+h,-A)),F.push(s(t.L4/2-g,-t.L3/2+g,-A));const p=[];if(p.push(n(t.L2/2-h,t.L1/2-h,A)),p.push(n(-t.L2/2+h,t.L1/2-h,Math.PI-A)),p.push(n(-t.L2/2+h,-t.L1/2+h,Math.PI+A)),p.push(n(t.L2/2-h,-t.L1/2+h,-A)),F.forEach(P=>{i.addSecond(P)}),p.forEach(P=>{i.addSecond(P)}),d.addMain(b),T.forEach(P=>{d.addMain(P)}),d.addSecond(k),d.addSecond($),B.forEach(P=>{d.addSecond(P)}),F.forEach(P=>{d.addSecond(P)}),p.forEach(P=>{d.addSecond(P)}),t.D4>=t.D3)throw`err218: D4 ${t.D4} larger than D3 ${t.D3}`;w.addMain(v(0,0,t.D3/2)),w.addSecond(v(0,0,t.D4/2)),_.addMain(v(0,0,t.D4/2)),_.addSecond(v(0,0,t.D3/2));const W=t.D3*Math.cos(x),X=W/Math.tan(x),K=g+(S/2+X)*Math.cos(A),it=g+(S/2+X)*Math.sin(A),q=y+2*(S+X+W),Q=q+t.L3+t.L4+W,m=z(Q,Q).addSegStrokeA(-Q,Q).addSegStrokeA(-Q,-Q).addSegStrokeA(Q,-Q).closeSegStroke();a.addMain(m),o.fig={faceFrame:i,facePlate:d,faceRod:w,faceRodHollow:_,faceCutRod:a};const E=o.partName;o.vol={extrudes:[{outName:`subpax_${E}_frame`,face:`${E}_faceFrame`,extrudeMethod:O.eLinearOrtho,length:t.H2,rotate:[0,0,0],translate:[0,0,t.H1-t.H2]},{outName:`subpax_${E}_plate`,face:`${E}_facePlate`,extrudeMethod:O.eLinearOrtho,length:t.H3,rotate:[0,0,0],translate:[0,0,0]},{outName:`subpax_${E}_rod1`,face:`${E}_faceRod`,extrudeMethod:O.eLinearOrtho,length:q,rotate:[0,Math.PI/2-x,A],translate:[t.L4/2-K,t.L3/2-it,t.H3-W]},{outName:`subpax_${E}_rod2`,face:`${E}_faceRod`,extrudeMethod:O.eLinearOrtho,length:q,rotate:[0,Math.PI/2-x,Math.PI-A],translate:[-t.L4/2+K,t.L3/2-it,t.H3-W]},{outName:`subpax_${E}_rod3`,face:`${E}_faceRod`,extrudeMethod:O.eLinearOrtho,length:q,rotate:[0,Math.PI/2-x,Math.PI+A],translate:[-t.L4/2+K,-t.L3/2+it,t.H3-W]},{outName:`subpax_${E}_rod4`,face:`${E}_faceRod`,extrudeMethod:O.eLinearOrtho,length:q,rotate:[0,Math.PI/2-x,-A],translate:[t.L4/2-K,-t.L3/2+it,t.H3-W]},{outName:`subpax_${E}_rodH1`,face:`${E}_faceRodHollow`,extrudeMethod:O.eLinearOrtho,length:q,rotate:[0,Math.PI/2-x,A],translate:[t.L4/2-K,t.L3/2-it,t.H3-W]},{outName:`subpax_${E}_rodH2`,face:`${E}_faceRodHollow`,extrudeMethod:O.eLinearOrtho,length:q,rotate:[0,Math.PI/2-x,Math.PI-A],translate:[-t.L4/2+K,t.L3/2-it,t.H3-W]},{outName:`subpax_${E}_rodH3`,face:`${E}_faceRodHollow`,extrudeMethod:O.eLinearOrtho,length:q,rotate:[0,Math.PI/2-x,Math.PI+A],translate:[-t.L4/2+K,-t.L3/2+it,t.H3-W]},{outName:`subpax_${E}_rodH4`,face:`${E}_faceRodHollow`,extrudeMethod:O.eLinearOrtho,length:q,rotate:[0,Math.PI/2-x,-A],translate:[t.L4/2-K,-t.L3/2+it,t.H3-W]},{outName:`subpax_${E}_cut1`,face:`${E}_faceCutRod`,extrudeMethod:O.eLinearOrtho,length:Q,rotate:[0,0,0],translate:[0,0,-Q]},{outName:`subpax_${E}_cut2`,face:`${E}_faceCutRod`,extrudeMethod:O.eLinearOrtho,length:Q,rotate:[0,0,0],translate:[0,0,t.H1]}],volumes:[{outName:`ipax_${E}_rawRod`,boolMethod:Z.eUnion,inList:[`subpax_${E}_rod1`,`subpax_${E}_rod2`,`subpax_${E}_rod3`,`subpax_${E}_rod4`]},{outName:`ipax_${E}_rodHollow`,boolMethod:Z.eUnion,inList:[`subpax_${E}_rodH1`,`subpax_${E}_rodH2`,`subpax_${E}_rodH3`,`subpax_${E}_rodH4`]},{outName:`ipax_${E}_halfRods`,boolMethod:Z.eSubstraction,inList:[`ipax_${E}_rawRod`,`subpax_${E}_cut1`]},{outName:`ipax_${E}_rods`,boolMethod:Z.eSubstraction,inList:[`ipax_${E}_halfRods`,`subpax_${E}_cut2`]},{outName:`ipax_${E}_plus`,boolMethod:Z.eUnion,inList:[`subpax_${E}_frame`,`subpax_${E}_plate`,`ipax_${E}_rods`]},{outName:`pax_${E}`,boolMethod:Z.eSubstraction,inList:[`ipax_${E}_plus`,`ipax_${E}_rodHollow`]}]},o.sub={},o.logstr+=`trapeze drawn successfully!
|
|
74
|
-
`,o.calcErr=!1}catch(h){o.logstr+=h,console.log(h)}return o}var ye={pTitle:"Heliostat trapeze",pDescription:"The support of one solar panel. Made out of aluminium for lightness and cooling",pDef:se,pGeom:Fe},oe={partName:"surface",params:[e("LH","mm",1600,10,4e3,1),e("LV","mm",1e3,10,4e3,1),e("LZ","mm",40,0,100,1),e("nx","",9,1,40,1),e("ny","",9,1,40,1),wt("main_direction",["horizontal","vertical"]),rt("crenel",!1),e("first_row","",9,1,40,1),e("second_row","",9,1,40,1),e("EH","mm",10,0,1e3,1),rt("EH_gradient",!1),e("EH_sup","mm",500,0,1e3,1),e("EH_cycle","",1,0,3,.05),e("EH_start","",0,0,1,.05),wt("EH_shape",["sinusoid","triangle","sawUp","sawDown"]),e("EV","mm",10,0,1e3,1),rt("EV_gradient",!1),e("EV_sup","mm",500,0,1e3,1),e("EV_cycle","",1,0,3,.05),e("EV_start","",0,0,1,.05),wt("EV_shape",["sinusoid","triangle","sawUp","sawDown"]),e("power_efficiency","%",16,0,100,.1),e("solar_power","W/m2",816,100,2e3,1)],paramSvg:{LH:"surface_main.svg",LV:"surface_main.svg",LZ:"surface_lz.svg",nx:"surface_main.svg",ny:"surface_main.svg",main_direction:"surface_crenel.svg",crenel:"surface_crenel.svg",first_row:"surface_extremities.svg",second_row:"surface_extremities.svg",EH:"surface_main.svg",EH_gradient:"surface_space_evolution.svg",EH_sup:"surface_space_evolution.svg",EH_cycle:"surface_space_evolution.svg",EH_start:"surface_space_evolution.svg",EH_shape:"surface_space_shape.svg",EV:"surface_main.svg",EV_gradient:"surface_space_evolution.svg",EV_sup:"surface_space_evolution.svg",EV_cycle:"surface_space_evolution.svg",EV_start:"surface_space_evolution.svg",EV_shape:"surface_space_shape.svg",power_efficiency:"surface_power.svg",solar_power:"surface_power.svg"},sim:{tMax:180,tStep:.5,tUpdate:500}};function Te(l,t){let s;const n=nt(oe.partName),o=C(),i=C();n.logstr+=`${n.partName} simTime: ${l}
|
|
75
|
-
`;try{const d=t.LH*t.LV/1e6,w=t.solar_power*d*t.power_efficiency/100;n.logstr+=`panel surface: ${L(d)} m2
|
|
76
|
-
`,n.logstr+=`panel power: ${L(w)} W
|
|
77
|
-
`;const _=t.nx*t.ny;n.logstr+=`max panel number: ${_}
|
|
78
|
-
`,n.logstr+=`max panel surface: ${L(_*d)} m2
|
|
79
|
-
`,n.logstr+=`max panel power: ${L(_*w)} W
|
|
80
|
-
`;const a=t.main_direction===1?t.ny:t.nx,h=t.main_direction===1?t.nx:t.ny,g=t.main_direction===1?t.EV:t.EH,r=t.main_direction===1?t.EV_gradient:t.EH_gradient,c=t.main_direction===1?t.EV_sup:t.EH_sup,f=t.main_direction===1?t.EV_cycle:t.EH_cycle,N=t.main_direction===1?t.EV_start:t.EH_start,y=t.main_direction===1?t.EV_shape:t.EH_shape,x=t.main_direction===0?t.EV:t.EH,A=t.main_direction===0?t.EV_gradient:t.EH_gradient,S=t.main_direction===0?t.EV_sup:t.EH_sup,R=t.main_direction===0?t.EV_cycle:t.EH_cycle,D=t.main_direction===0?t.EV_start:t.EH_start,k=t.main_direction===0?t.EV_shape:t.EH_shape,$=Math.max(h,t.first_row,t.second_row),b=[];for(let m=0;m<a;m++){const E=(m+1)%2,P=t.crenel?h-E:h;b.push(P)}b[0]=t.first_row,b[b.length-1]=t.first_row,a>2&&(b[1]=t.second_row,b[b.length-2]=t.second_row);let u=0;b.forEach(m=>{u+=m}),n.logstr+=`actual panel number: ${u} (${L(100*u/_)} %)
|
|
81
|
-
`,n.logstr+=`actual panel surface: ${L(u*d)} m2
|
|
82
|
-
`,n.logstr+=`actual panel power: ${L(u*w)} W
|
|
83
|
-
`;const H=[];for(let m=0;m<a-1;m++){let E=g;if(r===1){const P=a>2?a-2:1,j=(N+m*f/P)%1;switch(y){case 0:E+=c*(1-Math.cos(j*2*Math.PI))/2;break;case 1:E+=c*(1-2*Math.abs(j-.5));break;case 2:E+=c*j;break;case 3:E+=c*(1-j);break;default:E+=c}}H.push(E)}let I=0;const M=[];M.push(0),H.forEach(m=>{I+=m,M.push(I)});const B=[];for(let m=0;m<$-1;m++){let E=x;if(A===1){const P=$>2?$-2:1,j=(D+m*R/P)%1;switch(k){case 0:E+=S*(1-Math.cos(j*2*Math.PI))/2;break;case 1:E+=S*(1-2*Math.abs(j-.5));break;case 2:E+=S*j;break;case 3:E+=S*(1-j);break;default:E+=S}}B.push(E)}let T=0;const F=[];F.push(0),B.forEach(m=>{T+=m,F.push(T)});let p=0,W=0;t.main_direction===0?(p=a*t.LH+I,W=$*t.LV+T):(p=$*t.LH+T,W=a*t.LV+I);const X=p*W/10**6;n.logstr+=`global horizontal width: ${L(p/1e3)} m
|
|
84
|
-
`,n.logstr+=`global vertical height: ${L(W/1e3)} m
|
|
85
|
-
`,n.logstr+=`global area: ${L(X)} m2
|
|
86
|
-
`,n.logstr+=`area efficiency: ${L(100*u*d/X)} %
|
|
87
|
-
`;const K=-p/2,it=-W/2;s=function(m,E){return z(m,E).addSegStrokeA(m+t.LH,E).addSegStrokeA(m+t.LH,E+t.LV).addSegStrokeA(m,E+t.LV).closeSegStroke()};const q=[];b.forEach((m,E)=>{const P=($-m)%2,j=Math.floor(($-m)/2);for(let G=0;G<m;G++){let J=0,ot=0;t.main_direction===0?(J=K+E*t.LH+M[E],ot=it+(j+G)*t.LV+F[j+G],P===1&&(ot+=(t.LV+F[j+G+1]-F[j+G])/2)):(ot=it+E*t.LV+M[E],J=K+(j+G)*t.LH+F[j+G],P===1&&(J+=(t.LH+F[j+G+1]-F[j+G])/2)),q.push([J,ot])}});for(const m of q)o.addMain(s(m[0],m[1]));i.addMain(s(0,0)),n.fig={faceSurface:o,faceOnePanel:i};const Q=n.partName;n.vol={extrudes:q.map((m,E)=>({outName:`subpax_${Q}_panel_${E}`,face:`${Q}_faceOnePanel`,extrudeMethod:O.eLinearOrtho,length:t.LZ,rotate:[0,0,0],translate:[m[0],m[1],0]})),volumes:[{outName:`pax_${Q}`,boolMethod:Z.eUnion,inList:q.map((m,E)=>`subpax_${Q}_panel_${E}`)}]},n.sub={},n.logstr+=`panel-surface drawn successfully!
|
|
88
|
-
`,n.calcErr=!1}catch(d){n.logstr+=d,console.log(d)}return n}var me={pTitle:"Heliostat panel-surface",pDescription:"The surface collecting the solar power",pDef:oe,pGeom:Te};const ie={"gear/gear_wheel_wheel":Vt,"gear/simplified_gear_wheel":He,"heliostat/heliostat":xe,"heliostat/heliostat_2":Pe,"heliostat/base":Re,"heliostat/pole_static":Dt,"heliostat/pole_rotor":Ve,"heliostat/rake":bt,"heliostat/rake_stopper":yt,"heliostat/spider":It,"heliostat/swing":$t,"heliostat/rod":Ie,"heliostat/trapeze":ye,"heliostat/surface":me};function Oe(l){const t=/^.*\//g;return l.replace(t,"")}function ze(l){const t={};for(const s of Object.keys(l)){const n=Oe(s);t[n]=`/${s}`}return t}function Be(l){const t=[];for(const s of Object.keys(l))t.push(s);return t}const We=ze(ie),qe=Be(ie);export{ie as a,We as b,qe as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s;const e=((s=globalThis.__sveltekit_1r7wx22)==null?void 0:s.base)??"";var a;const t=((a=globalThis.__sveltekit_1r7wx22)==null?void 0:a.assets)??e;export{t as a,e as b};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{s as q,a as B,p as h,g as U,i as b,f as p,q as j,r as M,e as W,c as z,b as F,m as N,u as d,t as G,d as H,j as J,v as S,w as k,x as K}from"../chunks/scheduler.pWaib8rK.js";import{S as Q,i as X,t as g,c as P,a as w,g as L,b as v,d as D,m as E,e as y}from"../chunks/index.DzDRugVt.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},I={},R=function(e,n,i){let s=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link");s=Promise.all(n.map(t=>{if(t=Z(t,i),t in I)return;I[t]=!0;const r=t.endsWith(".css"),l=r?'[rel="stylesheet"]':"";if(!!i)for(let _=c.length-1;_>=0;_--){const m=c[_];if(m.href===t&&(!r||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${l}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":Y,r||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),r)return new Promise((_,m)=>{o.addEventListener("load",_),o.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${t}`)))})}))}return s.then(()=>e()).catch(c=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=c,window.dispatchEvent(t),!t.defaultPrevented)throw c})},re={};function $(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,c(a)),a[12](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&D(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){L();const l=e;g(l.$$.fragment,1,0,()=>{y(l,1)}),P()}s?(e=k(s,c(t)),t[12](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&g(e.$$.fragment,t),i=!1},d(t){t&&p(n),a[12](null),e&&y(e,t)}}}function x(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return s&&(e=k(s,c(a)),a[11](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&D(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){L();const l=e;g(l.$$.fragment,1,0,()=>{y(l,1)}),P()}s?(e=k(s,c(t)),t[11](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&8215&&(l.$$scope={dirty:r,ctx:t}),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&g(e.$$.fragment,t),i=!1},d(t){t&&p(n),a[11](null),e&&y(e,t)}}}function ee(a){let e,n,i;var s=a[1][1];function c(t,r){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,c(a)),a[10](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&D(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][1])){if(e){L();const l=e;g(l.$$.fragment,1,0,()=>{y(l,1)}),P()}s?(e=k(s,c(t)),t[10](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&16&&(l.data=t[4]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&g(e.$$.fragment,t),i=!1},d(t){t&&p(n),a[10](null),e&&y(e,t)}}}function O(a){let e,n=a[6]&&T(a);return{c(){e=W("div"),n&&n.c(),this.h()},l(i){e=z(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=F(e);n&&n.l(s),s.forEach(p),this.h()},h(){N(e,"id","svelte-announcer"),N(e,"aria-live","assertive"),N(e,"aria-atomic","true"),d(e,"position","absolute"),d(e,"left","0"),d(e,"top","0"),d(e,"clip","rect(0 0 0 0)"),d(e,"clip-path","inset(50%)"),d(e,"overflow","hidden"),d(e,"white-space","nowrap"),d(e,"width","1px"),d(e,"height","1px")},m(i,s){b(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=T(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&p(e),n&&n.d()}}}function T(a){let e;return{c(){e=G(a[7])},l(n){e=H(n,a[7])},m(n,i){b(n,e,i)},p(n,i){i&128&&J(e,n[7])},d(n){n&&p(e)}}}function te(a){let e,n,i,s,c;const t=[x,$],r=[];function l(o,_){return o[1][1]?0:1}e=l(a),n=r[e]=t[e](a);let u=a[5]&&O(a);return{c(){n.c(),i=B(),u&&u.c(),s=h()},l(o){n.l(o),i=U(o),u&&u.l(o),s=h()},m(o,_){r[e].m(o,_),b(o,i,_),u&&u.m(o,_),b(o,s,_),c=!0},p(o,[_]){let m=e;e=l(o),e===m?r[e].p(o,_):(L(),g(r[m],1,1,()=>{r[m]=null}),P(),n=r[e],n?n.p(o,_):(n=r[e]=t[e](o),n.c()),w(n,1),n.m(i.parentNode,i)),o[5]?u?u.p(o,_):(u=O(o),u.c(),u.m(s.parentNode,s)):u&&(u.d(1),u=null)},i(o){c||(w(n),c=!0)},o(o){g(n),c=!1},d(o){o&&(p(i),p(s)),r[e].d(o),u&&u.d(o)}}}function ne(a,e,n){let{stores:i}=e,{page:s}=e,{constructors:c}=e,{components:t=[]}=e,{form:r}=e,{data_0:l=null}=e,{data_1:u=null}=e;j(i.page.notify);let o=!1,_=!1,m=null;M(()=>{const f=i.page.subscribe(()=>{o&&(n(6,_=!0),K().then(()=>{n(7,m=document.title||"untitled page")}))});return n(5,o=!0),f});function V(f){S[f?"unshift":"push"](()=>{t[1]=f,n(0,t)})}function A(f){S[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}function C(f){S[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}return a.$$set=f=>{"stores"in f&&n(8,i=f.stores),"page"in f&&n(9,s=f.page),"constructors"in f&&n(1,c=f.constructors),"components"in f&&n(0,t=f.components),"form"in f&&n(2,r=f.form),"data_0"in f&&n(3,l=f.data_0),"data_1"in f&&n(4,u=f.data_1)},a.$$.update=()=>{a.$$.dirty&768&&i.page.set(s)},[t,c,r,l,u,o,_,m,i,s,V,A,C]}class oe extends Q{constructor(e){super(),X(this,e,ne,te,q,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>R(()=>import("../nodes/0.nCmV09r4.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),()=>R(()=>import("../nodes/1.Cl2Wb2Sv.js"),__vite__mapDeps([6,1,2,7,8,4]),import.meta.url),()=>R(()=>import("../nodes/2.D3m9DKE0.js"),__vite__mapDeps([9,1,3,2,10,4,11]),import.meta.url),()=>R(()=>import("../nodes/3.DPcZI3eM.js"),__vite__mapDeps([12,10,3,8,1,4,2,7,13]),import.meta.url)],le=[],fe={"/":[2],"/[...design]":[3]},ce={handleError:({error:a})=>{console.error(a)},reroute:()=>{}};export{fe as dictionary,ce as hooks,re as matchers,ae as nodes,oe as root,le as server_loads};
|
|
2
|
-
function __vite__mapDeps(indexes) {
|
|
3
|
-
if (!__vite__mapDeps.viteFileDeps) {
|
|
4
|
-
__vite__mapDeps.viteFileDeps = ["../nodes/0.nCmV09r4.js","../chunks/scheduler.pWaib8rK.js","../chunks/index.DzDRugVt.js","../chunks/index.BROvJSft.js","../chunks/paths.CQQiRxnm.js","../assets/0.CEJMiobA.css","../nodes/1.Cl2Wb2Sv.js","../chunks/stores.Huum2hKK.js","../chunks/entry.C3zjkdvH.js","../nodes/2.D3m9DKE0.js","../chunks/makeList.BtRSVN7R.js","../assets/2.CTp7BhB8.css","../nodes/3.DPcZI3eM.js","../assets/3.wWOitVXS.css"]
|
|
5
|
-
}
|
|
6
|
-
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as t}from"../chunks/entry.C3zjkdvH.js";export{t as start};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{a as Ct,b as pl}from"../chunks/makeList.BtRSVN7R.js";import{H as gl,w as ll,g as vl}from"../chunks/entry.C3zjkdvH.js";import{Q as bl,s as Ue,p as $e,i as te,n as Ae,f as b,e as g,c as v,b as S,R as rt,m as u,h as r,S as X,v as De,a as I,g as P,T as Pe,o as Ke,y as kl,t as J,l as ue,d as Q,U as Re,z as Nl,A as Tl,B as wl,j as de,C as He,V as _e,k as xe,r as vt,W as nl,X as it,Y as _t,Z as Ol,H as ut,_ as et,$ as Cl,a0 as El}from"../chunks/scheduler.pWaib8rK.js";import{S as ye,i as Me,f as je,b as Ne,d as Te,m as we,a as ge,t as ve,e as Oe,g as Ll,c as Dl}from"../chunks/index.DzDRugVt.js";import{e as Ce,u as Sl,x as sl,y as Il,z as al,P as Et,A as Pl,B as ht,C as tt,D as jl,F as Ul,G as pt,H as yl,I as Lt,f as ot,r as gt,J as Ge,K as Ml,L as Fl,M as Al,N as zl,O as Bl}from"../chunks/index.BROvJSft.js";import{b as ft}from"../chunks/paths.CQQiRxnm.js";import{p as ql}from"../chunks/stores.Huum2hKK.js";function Rl(t,e){throw new gl(t,e)}new TextEncoder;function Hl({params:t}){const e=t.design;if(Object.keys(Ct).includes(e))return{pageDef:Ct[e],allLink:pl};Rl(404,"Design undefined!")}const fs=Object.freeze(Object.defineProperty({__proto__:null,load:Hl},Symbol.toStringTag,{value:"Module"})),Ve=ll({});function ol(t,e,l){const n=bl(Ve);if(Object.keys(n).includes(t)){const s=n[t],a=Object.keys(s);for(const c of Object.keys(e))a.includes(c)?l&&(s[c]=e[c]):s[c]=e[c];n[t]=s}else n[t]=e;Ve.set(n)}function Vl(t){const e=t.pDef.partName,l={};for(const n of t.pDef.params)l[n.name]=n.init;ol(e,l,!1)}function Dt(t){let e,l,n,o,s,a,c;return{c(){e=g("aside"),l=g("div"),n=g("button"),o=g("img"),this.h()},l(f){e=v(f,"ASIDE",{class:!0});var i=S(e);l=v(i,"DIV",{class:!0});var d=S(l);n=v(d,"BUTTON",{class:!0});var p=S(n);o=v(p,"IMG",{src:!0,alt:!0}),p.forEach(b),d.forEach(b),i.forEach(b),this.h()},h(){rt(o.src,s=t[1])||u(o,"src",s),u(o,"alt",t[1]),u(n,"class","svelte-sjxf1e"),u(l,"class","dialog svelte-sjxf1e"),u(e,"class","backdrop svelte-sjxf1e")},m(f,i){te(f,e,i),r(e,l),r(l,n),r(n,o),a||(c=X(n,"click",t[2]),a=!0)},p(f,i){i&2&&!rt(o.src,s=f[1])&&u(o,"src",s),i&2&&u(o,"alt",f[1])},d(f){f&&b(e),a=!1,c()}}}function Kl(t){let e,l=t[0]&&Dt(t);return{c(){l&&l.c(),e=$e()},l(n){l&&l.l(n),e=$e()},m(n,o){l&&l.m(n,o),te(n,e,o)},p(n,[o]){n[0]?l?l.p(n,o):(l=Dt(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Ae,o:Ae,d(n){n&&b(e),l&&l.d(n)}}}function Xl(t,e,l){let{svgPath:n}=e,{modalOpen:o}=e;function s(){l(0,o=!1)}return t.$$set=a=>{"svgPath"in a&&l(1,n=a.svgPath),"modalOpen"in a&&l(0,o=a.modalOpen)},[o,n,s]}class rl extends ye{constructor(e){super(),Me(this,e,Xl,Kl,Ue,{svgPath:1,modalOpen:0})}}function St(t,e,l){const n=t.slice();return n[8]=e[l],n}function It(t){let e,l,n,o,s,a,c;function f(){return t[6](t[8])}return{c(){e=g("button"),l=g("img"),s=I(),this.h()},l(i){e=v(i,"BUTTON",{class:!0});var d=S(e);l=v(d,"IMG",{src:!0,alt:!0,class:!0}),s=P(d),d.forEach(b),this.h()},h(){rt(l.src,n=t[8])||u(l,"src",n),u(l,"alt",o=t[8]),u(l,"class","svelte-fxmnfh"),u(e,"class","svelte-fxmnfh")},m(i,d){te(i,e,d),r(e,l),r(e,s),a||(c=X(e,"click",f),a=!0)},p(i,d){t=i,d&1&&!rt(l.src,n=t[8])&&u(l,"src",n),d&1&&o!==(o=t[8])&&u(l,"alt",o)},d(i){i&&b(e),a=!1,c()}}}function Yl(t){let e,l,n,o,s;function a(d){t[5](d)}let c={svgPath:t[2]};t[1]!==void 0&&(c.modalOpen=t[1]),l=new rl({props:c}),De.push(()=>je(l,"modalOpen",a));let f=Ce(t[0]),i=[];for(let d=0;d<f.length;d+=1)i[d]=It(St(t,f,d));return{c(){e=g("section"),Ne(l.$$.fragment),o=I();for(let d=0;d<i.length;d+=1)i[d].c();this.h()},l(d){e=v(d,"SECTION",{class:!0});var p=S(e);Te(l.$$.fragment,p),o=P(p);for(let N=0;N<i.length;N+=1)i[N].l(p);p.forEach(b),this.h()},h(){u(e,"class","svelte-fxmnfh")},m(d,p){te(d,e,p),we(l,e,null),r(e,o);for(let N=0;N<i.length;N+=1)i[N]&&i[N].m(e,null);s=!0},p(d,[p]){const N={};if(p&4&&(N.svgPath=d[2]),!n&&p&2&&(n=!0,N.modalOpen=d[1],Pe(()=>n=!1)),l.$set(N),p&9){f=Ce(d[0]);let m;for(m=0;m<f.length;m+=1){const h=St(d,f,m);i[m]?i[m].p(h,p):(i[m]=It(h),i[m].c(),i[m].m(e,null))}for(;m<i.length;m+=1)i[m].d(1);i.length=f.length}},i(d){s||(ge(l.$$.fragment,d),s=!0)},o(d){ve(l.$$.fragment,d),s=!1},d(d){d&&b(e),Oe(l),Ke(i,d)}}}function Wl(t){const e=[];for(const l of Object.values(t.paramSvg))e.includes(l)||e.push(l);return e}function Gl(t,e,l){let{pDef:n}=e;function o(p){const N=Wl(n),m=[];for(const h of N)m.push(`${ft}/pgdsvg/${h}`);return m}let s=[],a=!1,c;function f(p){l(2,c=p),l(1,a=!0)}function i(p){a=p,l(1,a)}const d=p=>f(p);return t.$$set=p=>{"pDef"in p&&l(4,n=p.pDef)},t.$$.update=()=>{t.$$.dirty&16&&l(0,s=o(n.partName))},[s,a,c,f,n,i,d]}class Zl extends ye{constructor(e){super(),Me(this,e,Gl,Yl,Ue,{pDef:4})}}function Pt(t){let e,l,n,o,s,a,c="Cancel",f,i,d,p,N,m;const h=t[7].default,_=kl(h,t,t[6],null);return{c(){e=g("aside"),l=g("div"),n=g("article"),_&&_.c(),o=I(),s=g("footer"),a=g("button"),a.textContent=c,f=I(),i=g("button"),d=J(t[1]),this.h()},l(C){e=v(C,"ASIDE",{class:!0});var k=S(e);l=v(k,"DIV",{class:!0});var w=S(l);n=v(w,"ARTICLE",{class:!0});var D=S(n);_&&_.l(D),D.forEach(b),o=P(w),s=v(w,"FOOTER",{class:!0});var T=S(s);a=v(T,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(a)!=="svelte-hcvk9s"&&(a.textContent=c),f=P(T),i=v(T,"BUTTON",{class:!0});var y=S(i);d=Q(y,t[1]),y.forEach(b),T.forEach(b),w.forEach(b),k.forEach(b),this.h()},h(){u(n,"class","question svelte-weruk7"),u(a,"class","cancel svelte-weruk7"),u(i,"class","ok svelte-weruk7"),u(s,"class","svelte-weruk7"),u(l,"class","dialog svelte-weruk7"),Re(l,"sizeLarge",t[2]),u(e,"class","backdrop svelte-weruk7")},m(C,k){te(C,e,k),r(e,l),r(l,n),_&&_.m(n,null),r(l,o),r(l,s),r(s,a),r(s,f),r(s,i),r(i,d),p=!0,N||(m=[X(a,"click",t[3]),X(i,"click",t[4])],N=!0)},p(C,k){_&&_.p&&(!p||k&64)&&Nl(_,h,C,C[6],p?wl(h,C[6],k,null):Tl(C[6]),null),(!p||k&2)&&de(d,C[1]),(!p||k&4)&&Re(l,"sizeLarge",C[2])},i(C){p||(ge(_,C),p=!0)},o(C){ve(_,C),p=!1},d(C){C&&b(e),_&&_.d(C),N=!1,He(m)}}}function Jl(t){let e,l,n=t[0]&&Pt(t);return{c(){n&&n.c(),e=$e()},l(o){n&&n.l(o),e=$e()},m(o,s){n&&n.m(o,s),te(o,e,s),l=!0},p(o,[s]){o[0]?n?(n.p(o,s),s&1&&ge(n,1)):(n=Pt(o),n.c(),ge(n,1),n.m(e.parentNode,e)):n&&(Ll(),ve(n,1,1,()=>{n=null}),Dl())},i(o){l||(ge(n),l=!0)},o(o){ve(n),l=!1},d(o){o&&b(e),n&&n.d(o)}}}function Ql(t,e,l){let{$$slots:n={},$$scope:o}=e,{okName:s="Ok"}=e,{okFunc:a}=e,{modalOpen:c}=e,{sizeLarge:f=!1}=e;function i(){l(0,c=!1)}function d(){a(),l(0,c=!1)}return t.$$set=p=>{"okName"in p&&l(1,s=p.okName),"okFunc"in p&&l(5,a=p.okFunc),"modalOpen"in p&&l(0,c=p.modalOpen),"sizeLarge"in p&&l(2,f=p.sizeLarge),"$$scope"in p&&l(6,o=p.$$scope)},[c,s,f,i,d,a,o,n]}class ct extends ye{constructor(e){super(),Me(this,e,Ql,Jl,Ue,{okName:1,okFunc:5,modalOpen:0,sizeLarge:2})}}function jt(t,e,l){const n=t.slice();return n[17]=e[l],n[18]=e,n[19]=l,n}function Ut(t,e,l){const n=t.slice();return n[17]=e[l],n}function yt(t){let e,l=t[17]+"",n;return{c(){e=g("p"),n=J(l),this.h()},l(o){e=v(o,"P",{class:!0});var s=S(e);n=Q(s,l),s.forEach(b),this.h()},h(){u(e,"class","diagItem svelte-12dj9tj")},m(o,s){te(o,e,s),r(e,n)},p(o,s){s&1&&l!==(l=o[17]+"")&&de(n,l)},d(o){o&&b(e)}}}function Mt(t){let e,l=t[3][t[17]]&&yt(t);return{c(){l&&l.c(),e=$e()},l(n){l&&l.l(n),e=$e()},m(n,o){l&&l.m(n,o),te(n,e,o)},p(n,o){n[3][n[17]]?l?l.p(n,o):(l=yt(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){n&&b(e),l&&l.d(n)}}}function $l(t){let e,l="Do you really want to delete the following localStorage keys?",n,o,s=Ce(t[0]),a=[];for(let c=0;c<s.length;c+=1)a[c]=Mt(Ut(t,s,c));return{c(){e=g("p"),e.textContent=l,n=I();for(let c=0;c<a.length;c+=1)a[c].c();o=$e(),this.h()},l(c){e=v(c,"P",{class:!0,"data-svelte-h":!0}),ue(e)!=="svelte-12r0p0q"&&(e.textContent=l),n=P(c);for(let f=0;f<a.length;f+=1)a[f].l(c);o=$e(),this.h()},h(){u(e,"class","diagTitle svelte-12dj9tj")},m(c,f){te(c,e,f),te(c,n,f);for(let i=0;i<a.length;i+=1)a[i]&&a[i].m(c,f);te(c,o,f)},p(c,f){if(f&9){s=Ce(c[0]);let i;for(i=0;i<s.length;i+=1){const d=Ut(c,s,i);a[i]?a[i].p(d,f):(a[i]=Mt(d),a[i].c(),a[i].m(o.parentNode,o))}for(;i<a.length;i+=1)a[i].d(1);a.length=s.length}},d(c){c&&(b(e),b(n),b(o)),Ke(a,c)}}}function Ft(t){let e,l,n,o,s,a,c=t[17]+"",f,i,d,p=t[2][t[17]]+"",N,m,h,_;function C(){t[12].call(n,t[17])}function k(){return t[13](t[17])}return{c(){e=g("tr"),l=g("td"),n=g("input"),o=I(),s=g("td"),a=g("button"),f=J(c),i=I(),d=g("td"),N=J(p),m=I(),this.h()},l(w){e=v(w,"TR",{class:!0});var D=S(e);l=v(D,"TD",{});var T=S(l);n=v(T,"INPUT",{type:!0}),T.forEach(b),o=P(D),s=v(D,"TD",{class:!0});var y=S(s);a=v(y,"BUTTON",{class:!0});var O=S(a);f=Q(O,c),O.forEach(b),y.forEach(b),i=P(D),d=v(D,"TD",{});var A=S(d);N=Q(A,p),A.forEach(b),m=P(D),D.forEach(b),this.h()},h(){u(n,"type","checkbox"),u(a,"class","svelte-12dj9tj"),u(s,"class","svelte-12dj9tj"),u(e,"class","svelte-12dj9tj")},m(w,D){te(w,e,D),r(e,l),r(l,n),n.checked=t[3][t[17]],r(e,o),r(e,s),r(s,a),r(a,f),r(e,i),r(e,d),r(d,N),r(e,m),h||(_=[X(n,"change",C),X(a,"click",k)],h=!0)},p(w,D){t=w,D&9&&(n.checked=t[3][t[17]]),D&1&&c!==(c=t[17]+"")&&de(f,c),D&5&&p!==(p=t[2][t[17]]+"")&&de(N,p)},d(w){w&&b(e),h=!1,He(_)}}}function xl(t){let e,l,n="Delete",o,s,a,c,f,i,d,p="<td>Delete</td> <td>Key name</td> <td>Last modification</td>",N,m,h,_,C,k,w="delete all",D,T,y,O,A,E,L;function M(F){t[10](F)}let q={okName:"Confirm",okFunc:t[6],$$slots:{default:[$l]},$$scope:{ctx:t}};t[4]!==void 0&&(q.modalOpen=t[4]),s=new ct({props:q}),De.push(()=>je(s,"modalOpen",M));let H=Ce(t[0]),R=[];for(let F=0;F<H.length;F+=1)R[F]=Ft(jt(t,H,F));return{c(){e=g("div"),l=g("button"),l.textContent=n,o=I(),Ne(s.$$.fragment),c=I(),f=g("table"),i=g("thead"),d=g("tr"),d.innerHTML=p,N=I(),m=g("tr"),h=g("td"),_=g("input"),C=I(),k=g("td"),k.textContent=w,D=I(),T=g("td"),y=I(),O=g("tbody");for(let F=0;F<R.length;F+=1)R[F].c();this.h()},l(F){e=v(F,"DIV",{class:!0});var K=S(e);l=v(K,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(l)!=="svelte-1tbm4xl"&&(l.textContent=n),o=P(K),Te(s.$$.fragment,K),c=P(K),f=v(K,"TABLE",{class:!0});var ne=S(f);i=v(ne,"THEAD",{class:!0});var se=S(i);d=v(se,"TR",{"data-svelte-h":!0}),ue(d)!=="svelte-xt53kn"&&(d.innerHTML=p),N=P(se),m=v(se,"TR",{});var $=S(m);h=v($,"TD",{});var le=S(h);_=v(le,"INPUT",{type:!0}),le.forEach(b),C=P($),k=v($,"TD",{class:!0,"data-svelte-h":!0}),ue(k)!=="svelte-1s4wssd"&&(k.textContent=w),D=P($),T=v($,"TD",{}),S(T).forEach(b),$.forEach(b),se.forEach(b),y=P(ne),O=v(ne,"TBODY",{class:!0});var W=S(O);for(let he=0;he<R.length;he+=1)R[he].l(W);W.forEach(b),ne.forEach(b),K.forEach(b),this.h()},h(){u(l,"class","svelte-12dj9tj"),u(_,"type","checkbox"),u(k,"class","instruction"),u(i,"class","svelte-12dj9tj"),u(O,"class","svelte-12dj9tj"),u(f,"class","svelte-12dj9tj"),u(e,"class","deleteKeys svelte-12dj9tj")},m(F,K){te(F,e,K),r(e,l),r(e,o),we(s,e,null),r(e,c),r(e,f),r(f,i),r(i,d),r(i,N),r(i,m),r(m,h),r(h,_),_.checked=t[1],r(m,C),r(m,k),r(m,D),r(m,T),r(f,y),r(f,O);for(let ne=0;ne<R.length;ne+=1)R[ne]&&R[ne].m(O,null);A=!0,E||(L=[X(l,"click",t[9]),X(_,"change",t[11])],E=!0)},p(F,[K]){const ne={};if(K&4194313&&(ne.$$scope={dirty:K,ctx:F}),!a&&K&16&&(a=!0,ne.modalOpen=F[4],Pe(()=>a=!1)),s.$set(ne),K&2&&(_.checked=F[1]),K&45){H=Ce(F[0]);let se;for(se=0;se<H.length;se+=1){const $=jt(F,H,se);R[se]?R[se].p($,K):(R[se]=Ft($),R[se].c(),R[se].m(O,null))}for(;se<R.length;se+=1)R[se].d(1);R.length=H.length}},i(F){A||(ge(s.$$.fragment,F),A=!0)},o(F){ve(s.$$.fragment,F),A=!1},d(F){F&&b(e),Oe(s),Ke(R,F),E=!1,He(L)}}}function en(t){let e={};for(const l of t)e[l]=!1;return e}function tn(t,e,l){let{pageName:n}=e,{storeName:o}=e,{localKeys:s}=e;function a(){let T=[];const y=new RegExp(`^${n}_`);return T=Object.keys(window.localStorage).filter(A=>y.test(A)).map(A=>A.replace(y,"")),T}s=a();function c(T){l(7,o=T)}let f={};function i(T){let y={};for(const O of T){let A="";const E=`${n}_${O}`,L=window.localStorage.getItem(E);L!==null&&(A=JSON.parse(L).lastModif),y[O]=A}return y}f=i(s);let d={};d=en(s);let p=!1;function N(T){for(const y of s)l(3,d[y]=T,d)}function m(){for(const T of s)if(d[T]){const y=`${n}_${T}`;window.localStorage.removeItem(y)}l(0,s=a())}let h=!1;const _=()=>{l(4,h=!0)};function C(T){h=T,l(4,h)}function k(){p=this.checked,l(1,p)}function w(T){d[T]=this.checked,l(3,d)}const D=T=>c(T);return t.$$set=T=>{"pageName"in T&&l(8,n=T.pageName),"storeName"in T&&l(7,o=T.storeName),"localKeys"in T&&l(0,s=T.localKeys)},t.$$.update=()=>{t.$$.dirty&2&&N(p)},[s,p,f,d,h,c,m,o,n,_,C,k,w,D]}class il extends ye{constructor(e){super(),Me(this,e,tn,xl,Ue,{pageName:8,storeName:7,localKeys:0})}}function At(t){let e,l,n,o;return{c(){e=g("p"),l=J("Warning: name "),n=J(t[0]),o=J(" already used"),this.h()},l(s){e=v(s,"P",{class:!0});var a=S(e);l=Q(a,"Warning: name "),n=Q(a,t[0]),o=Q(a," already used"),a.forEach(b),this.h()},h(){u(e,"class","warnMsg svelte-1rkdwo")},m(s,a){te(s,e,a),r(e,l),r(e,n),r(e,o)},p(s,a){a&1&&de(n,s[0])},d(s){s&&b(e)}}}function ln(t){let e,l,n,o,s,a,c="Give a name to your parameter-set:",f,i,d,p,N,m;function h(w){t[5](w)}function _(w){t[6](w)}let C={pageName:t[1]};t[0]!==void 0&&(C.storeName=t[0]),t[2]!==void 0&&(C.localKeys=t[2]),e=new il({props:C}),De.push(()=>je(e,"storeName",h)),De.push(()=>je(e,"localKeys",_));let k=t[3]&&At(t);return{c(){Ne(e.$$.fragment),o=I(),s=g("div"),a=g("label"),a.textContent=c,f=I(),i=g("input"),d=I(),k&&k.c(),this.h()},l(w){Te(e.$$.fragment,w),o=P(w),s=v(w,"DIV",{class:!0});var D=S(s);a=v(D,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),ue(a)!=="svelte-1vdq35w"&&(a.textContent=c),f=P(D),i=v(D,"INPUT",{type:!0,id:!0,minlength:!0,maxlength:!0,size:!0,class:!0}),d=P(D),k&&k.l(D),D.forEach(b),this.h()},h(){u(a,"for","storName"),u(a,"class","svelte-1rkdwo"),u(i,"type","text"),u(i,"id","storName"),i.required=!0,u(i,"minlength","4"),u(i,"maxlength","30"),u(i,"size","32"),u(i,"class","svelte-1rkdwo"),u(s,"class","svelte-1rkdwo")},m(w,D){we(e,w,D),te(w,o,D),te(w,s,D),r(s,a),r(s,f),r(s,i),_e(i,t[0]),r(s,d),k&&k.m(s,null),p=!0,N||(m=[X(i,"input",t[7]),X(i,"input",t[4])],N=!0)},p(w,[D]){const T={};D&2&&(T.pageName=w[1]),!l&&D&1&&(l=!0,T.storeName=w[0],Pe(()=>l=!1)),!n&&D&4&&(n=!0,T.localKeys=w[2],Pe(()=>n=!1)),e.$set(T),D&1&&i.value!==w[0]&&_e(i,w[0]),w[3]?k?k.p(w,D):(k=At(w),k.c(),k.m(s,null)):k&&(k.d(1),k=null)},i(w){p||(ge(e.$$.fragment,w),p=!0)},o(w){ve(e.$$.fragment,w),p=!1},d(w){w&&(b(o),b(s)),Oe(e,w),k&&k.d(),N=!1,He(m)}}}function nn(t){const e=/[-:]/g,l=/\..*$/;return`${t}_${new Date().toISOString().replace(e,"").replace(l,"").replace("T","_")}`}function sn(t,e,l){let{pageName:n}=e,{storeName:o}=e,s=[];o=nn(n);let a=!1;function c(N){l(3,a=s.includes(N))}function f(N){const m=N.target.value;c(m)}function i(N){o=N,l(0,o)}function d(N){s=N,l(2,s)}function p(){o=this.value,l(0,o)}return t.$$set=N=>{"pageName"in N&&l(1,n=N.pageName),"storeName"in N&&l(0,o=N.storeName)},t.$$.update=()=>{t.$$.dirty&1&&c(o)},[o,n,s,a,f,i,d,p]}class an extends ye{constructor(e){super(),Me(this,e,sn,ln,Ue,{pageName:1,storeName:0})}}function on(t){let e,l,n,o,s,a,c="Select a parameter-set:",f,i,d;function p(h){t[3](h)}function N(h){t[4](h)}let m={pageName:t[1]};return t[0]!==void 0&&(m.storeName=t[0]),t[2]!==void 0&&(m.localKeys=t[2]),e=new il({props:m}),De.push(()=>je(e,"storeName",p)),De.push(()=>je(e,"localKeys",N)),{c(){Ne(e.$$.fragment),o=I(),s=g("div"),a=g("label"),a.textContent=c,f=I(),i=g("input"),this.h()},l(h){Te(e.$$.fragment,h),o=P(h),s=v(h,"DIV",{class:!0});var _=S(s);a=v(_,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),ue(a)!=="svelte-rajgc0"&&(a.textContent=c),f=P(_),i=v(_,"INPUT",{type:!0,id:!0,minlength:!0,maxlength:!0,size:!0,class:!0}),_.forEach(b),this.h()},h(){u(a,"for","storName"),u(a,"class","svelte-1ozd0ey"),u(i,"type","text"),u(i,"id","storName"),i.value=t[0],i.readOnly=!0,u(i,"minlength","4"),u(i,"maxlength","30"),u(i,"size","32"),u(i,"class","svelte-1ozd0ey"),u(s,"class","svelte-1ozd0ey")},m(h,_){we(e,h,_),te(h,o,_),te(h,s,_),r(s,a),r(s,f),r(s,i),d=!0},p(h,[_]){const C={};_&2&&(C.pageName=h[1]),!l&&_&1&&(l=!0,C.storeName=h[0],Pe(()=>l=!1)),!n&&_&4&&(n=!0,C.localKeys=h[2],Pe(()=>n=!1)),e.$set(C),(!d||_&1&&i.value!==h[0])&&(i.value=h[0])},i(h){d||(ge(e.$$.fragment,h),d=!0)},o(h){ve(e.$$.fragment,h),d=!1},d(h){h&&(b(o),b(s)),Oe(e,h)}}}function rn(t,e,l){let{pageName:n}=e,{storeName:o}=e,s=[];function a(i){let d=o;return!i.includes(d)&&(i.length>0?d=i[0]:d=""),d}function c(i){o=i,l(0,o),l(2,s)}function f(i){s=i,l(2,s)}return t.$$set=i=>{"pageName"in i&&l(1,n=i.pageName),"storeName"in i&&l(0,o=i.storeName)},t.$$.update=()=>{t.$$.dirty&4&&l(0,o=a(s))},[o,n,s,c,f]}class cn extends ye{constructor(e){super(),Me(this,e,rn,on,Ue,{pageName:1,storeName:0})}}const Be=ll(Sl());function fn(t){let e;return{c(){e=g("canvas"),this.h()},l(l){e=v(l,"CANVAS",{class:!0,width:!0,height:!0}),S(e).forEach(b),this.h()},h(){u(e,"class","mini svelte-z8e4tz"),u(e,"width",zt),u(e,"height",zt)},m(l,n){te(l,e,n),t[8](e)},p:Ae,i:Ae,o:Ae,d(l){l&&b(e),t[8](null)}}}const zt=200;function un(t,e,l){let n,o;xe(t,Be,_=>l(6,n=_)),xe(t,Ve,_=>l(7,o=_));let{pageName:s}=e,{fgeom:a}=e,{selFace:c}=e,{simTime:f=0}=e,i,d;function p(_,C){const k=Il(C);k.ruler=!1;const w=i.getContext("2d");w.clearRect(0,0,w.canvas.width,w.canvas.height);try{d=_.getAdjustFull(w.canvas.width,w.canvas.height),_.draw(w,d,k)}catch(D){console.log(D)}}let N=0;function m(_,C,k,w){const D=a(_,C).fig;if(Object.keys(D).includes(k)){const T=D[k];p(T,w)}else{const T=sl(D);p(T,w)}}vt(()=>{m(f,o[s],c,n),l(5,N=1)});function h(_){De[_?"unshift":"push"](()=>{i=_,l(0,i)})}return t.$$set=_=>{"pageName"in _&&l(1,s=_.pageName),"fgeom"in _&&l(2,a=_.fgeom),"selFace"in _&&l(3,c=_.selFace),"simTime"in _&&l(4,f=_.simTime)},t.$$.update=()=>{t.$$.dirty&250&&N===1&&m(f,o[s],c,n)},[i,s,a,c,f,N,n,o,h]}class mn extends ye{constructor(e){super(),Me(this,e,un,fn,Ue,{pageName:1,fgeom:2,selFace:3,simTime:4})}}function hn(t,e){const l=document.createElement("a");l.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e)),l.setAttribute("download",t),l.click(),l.remove()}function cl(t,e,l){const n=/[-:]/g,o=/\..*$/,s=new Date().toISOString().replace(n,"").replace(o,"").replace("T","_"),a=`px_${t}_${s}.json`,c=al(s,e,l);hn(a,c)}function dn(t,e,l){const n=new URL(t),o=2e3;let s=n.toString().length;for(const a of Object.keys(e)){const c=e[a].toString(),f=2+a.length+c.length;(!l||s+f<o)&&n.searchParams.append(encodeURIComponent(a),encodeURIComponent(c)),s+=f}return s>=o&&console.log(`warn547: generateUrl: strLength ${s} larger than strLengthLimit ${o}`),n.toString()}function Bt(t,e,l){const n=t.slice();return n[51]=e[l],n[52]=e,n[53]=l,n}function qt(t,e,l){const n=t.slice();return n[54]=e[l],n[56]=l,n}function _n(t,e,l){const n=t.slice();return n[54]=e[l],n[56]=l,n}function pn(t){let e;return{c(){e=J("Load the default parameters ?")},l(l){e=Q(l,"Load the default parameters ?")},m(l,n){te(l,e,n)},d(l){l&&b(e)}}}function gn(t){let e,l,n;function o(a){t[29](a)}let s={pageName:t[0].partName};return t[11]!==void 0&&(s.storeName=t[11]),e=new cn({props:s}),De.push(()=>je(e,"storeName",o)),{c(){Ne(e.$$.fragment)},l(a){Te(e.$$.fragment,a)},m(a,c){we(e,a,c),n=!0},p(a,c){const f={};c[0]&1&&(f.pageName=a[0].partName),!l&&c[0]&2048&&(l=!0,f.storeName=a[11],Pe(()=>l=!1)),e.$set(f)},i(a){n||(ge(e.$$.fragment,a),n=!0)},o(a){ve(e.$$.fragment,a),n=!1},d(a){Oe(e,a)}}}function vn(t){let e,l,n,o=Ce(t[51].dropdown),s=[];for(let c=0;c<o.length;c+=1)s[c]=Rt(qt(t,o,c));function a(){t[35].call(e,t[51])}return{c(){e=g("select");for(let c=0;c<s.length;c+=1)s[c].c();this.h()},l(c){e=v(c,"SELECT",{});var f=S(e);for(let i=0;i<s.length;i+=1)s[i].l(f);f.forEach(b),this.h()},h(){t[16][t[0].partName][t[51].name]===void 0&&ut(a)},m(c,f){te(c,e,f);for(let i=0;i<s.length;i+=1)s[i]&&s[i].m(e,null);et(e,t[16][t[0].partName][t[51].name],!0),l||(n=X(e,"change",a),l=!0)},p(c,f){if(t=c,f[0]&1){o=Ce(t[51].dropdown);let i;for(i=0;i<o.length;i+=1){const d=qt(t,o,i);s[i]?s[i].p(d,f):(s[i]=Rt(d),s[i].c(),s[i].m(e,null))}for(;i<s.length;i+=1)s[i].d(1);s.length=o.length}f[0]&65537&&et(e,t[16][t[0].partName][t[51].name])},d(c){c&&b(e),Ke(s,c),l=!1,n()}}}function bn(t){let e,l,n,o=Ce(["Off","On"]),s=[];for(let c=0;c<2;c+=1)s[c]=Nn(_n(t,o,c));function a(){t[34].call(e,t[51])}return{c(){e=g("select");for(let c=0;c<2;c+=1)s[c].c();this.h()},l(c){e=v(c,"SELECT",{});var f=S(e);for(let i=0;i<2;i+=1)s[i].l(f);f.forEach(b),this.h()},h(){t[16][t[0].partName][t[51].name]===void 0&&ut(a)},m(c,f){te(c,e,f);for(let i=0;i<2;i+=1)s[i]&&s[i].m(e,null);et(e,t[16][t[0].partName][t[51].name],!0),l||(n=X(e,"change",a),l=!0)},p(c,f){t=c,f[0]&65537&&et(e,t[16][t[0].partName][t[51].name])},d(c){c&&b(e),Ke(s,c),l=!1,n()}}}function kn(t){let e,l,n,o,s,a,c,f,i,d,p;function N(){t[32].call(e,t[51])}function m(){t[33].call(a,t[51])}return{c(){e=g("input"),s=I(),a=g("input"),this.h()},l(h){e=v(h,"INPUT",{type:!0,min:!0,max:!0,step:!0,class:!0}),s=P(h),a=v(h,"INPUT",{type:!0,min:!0,max:!0,step:!0,class:!0}),this.h()},h(){u(e,"type","number"),u(e,"min",l=t[51].min),u(e,"max",n=t[51].max),u(e,"step",o=t[51].step),u(e,"class","input-number svelte-mfuhqm"),u(a,"type","range"),u(a,"min",c=t[51].min),u(a,"max",f=t[51].max),u(a,"step",i=t[51].step),u(a,"class","svelte-mfuhqm")},m(h,_){te(h,e,_),_e(e,t[16][t[0].partName][t[51].name]),te(h,s,_),te(h,a,_),_e(a,t[16][t[0].partName][t[51].name]),d||(p=[X(e,"input",N),X(e,"change",t[17]),X(a,"change",m),X(a,"input",m),X(a,"change",t[17])],d=!0)},p(h,_){t=h,_[0]&1&&l!==(l=t[51].min)&&u(e,"min",l),_[0]&1&&n!==(n=t[51].max)&&u(e,"max",n),_[0]&1&&o!==(o=t[51].step)&&u(e,"step",o),_[0]&65537&&it(e.value)!==t[16][t[0].partName][t[51].name]&&_e(e,t[16][t[0].partName][t[51].name]),_[0]&1&&c!==(c=t[51].min)&&u(a,"min",c),_[0]&1&&f!==(f=t[51].max)&&u(a,"max",f),_[0]&1&&i!==(i=t[51].step)&&u(a,"step",i),_[0]&65537&&_e(a,t[16][t[0].partName][t[51].name])},d(h){h&&(b(e),b(s),b(a)),d=!1,He(p)}}}function Rt(t){let e,l=t[54]+"",n;return{c(){e=g("option"),n=J(l),this.h()},l(o){e=v(o,"OPTION",{});var s=S(e);n=Q(s,l),s.forEach(b),this.h()},h(){e.__value=t[56],_e(e,e.__value)},m(o,s){te(o,e,s),r(e,n)},p(o,s){s[0]&1&&l!==(l=o[54]+"")&&de(n,l)},d(o){o&&b(e)}}}function Nn(t){let e,l;return{c(){e=g("option"),l=J(t[54]),this.h()},l(n){e=v(n,"OPTION",{});var o=S(e);l=Q(o,t[54]),o.forEach(b),this.h()},h(){e.__value=t[56],_e(e,e.__value)},m(n,o){te(n,e,o),r(e,l)},p:Ae,d(n){n&&b(e)}}}function Ht(t){let e,l,n,o=t[51].name+"",s,a,c,f,i,d=t[51].unit+"",p,N,m,h=t[51].init+"",_,C,k,w=t[51].min+"",D,T,y,O=t[51].max+"",A,E,L,M=t[51].step+"",q,H,R,F;function K(){return t[31](t[51])}function ne(le,W){return le[51].pType===Et.eNumber?kn:le[51].pType===Et.eCheckbox?bn:vn}let se=ne(t),$=se(t);return{c(){e=g("tr"),l=g("td"),n=g("button"),s=J(o),a=I(),c=g("td"),$.c(),f=I(),i=g("td"),p=J(d),N=I(),m=g("td"),_=J(h),C=I(),k=g("td"),D=J(w),T=I(),y=g("td"),A=J(O),E=I(),L=g("td"),q=J(M),H=I(),this.h()},l(le){e=v(le,"TR",{class:!0});var W=S(e);l=v(W,"TD",{class:!0});var he=S(l);n=v(he,"BUTTON",{class:!0});var be=S(n);s=Q(be,o),be.forEach(b),he.forEach(b),a=P(W),c=v(W,"TD",{class:!0});var j=S(c);$.l(j),j.forEach(b),f=P(W),i=v(W,"TD",{class:!0});var B=S(i);p=Q(B,d),B.forEach(b),N=P(W),m=v(W,"TD",{class:!0});var ce=S(m);_=Q(ce,h),ce.forEach(b),C=P(W),k=v(W,"TD",{class:!0});var oe=S(k);D=Q(oe,w),oe.forEach(b),T=P(W),y=v(W,"TD",{class:!0});var ae=S(y);A=Q(ae,O),ae.forEach(b),E=P(W),L=v(W,"TD",{class:!0});var V=S(L);q=Q(V,M),V.forEach(b),H=P(W),W.forEach(b),this.h()},h(){u(n,"class","svelte-mfuhqm"),u(l,"class","svelte-mfuhqm"),u(c,"class","svelte-mfuhqm"),u(i,"class","svelte-mfuhqm"),u(m,"class","svelte-mfuhqm"),u(k,"class","svelte-mfuhqm"),u(y,"class","svelte-mfuhqm"),u(L,"class","svelte-mfuhqm"),u(e,"class","svelte-mfuhqm"),Re(e,"changed",t[16][t[0].partName][t[51].name]!==t[51].init)},m(le,W){te(le,e,W),r(e,l),r(l,n),r(n,s),r(e,a),r(e,c),$.m(c,null),r(e,f),r(e,i),r(i,p),r(e,N),r(e,m),r(m,_),r(e,C),r(e,k),r(k,D),r(e,T),r(e,y),r(y,A),r(e,E),r(e,L),r(L,q),r(e,H),R||(F=X(n,"click",K),R=!0)},p(le,W){t=le,W[0]&1&&o!==(o=t[51].name+"")&&de(s,o),se===(se=ne(t))&&$?$.p(t,W):($.d(1),$=se(t),$&&($.c(),$.m(c,null))),W[0]&1&&d!==(d=t[51].unit+"")&&de(p,d),W[0]&1&&h!==(h=t[51].init+"")&&de(_,h),W[0]&1&&w!==(w=t[51].min+"")&&de(D,w),W[0]&1&&O!==(O=t[51].max+"")&&de(A,O),W[0]&1&&M!==(M=t[51].step+"")&&de(q,M),W[0]&65537&&Re(e,"changed",t[16][t[0].partName][t[51].name]!==t[51].init)},d(le){le&&b(e),$.d(),R=!1,F()}}}function Tn(t){let e,l="Copy this URL and send it to your friends!",n,o,s;return{c(){e=g("p"),e.textContent=l,n=I(),o=g("p"),s=J(t[13]),this.h()},l(a){e=v(a,"P",{"data-svelte-h":!0}),ue(e)!=="svelte-1kscrpk"&&(e.textContent=l),n=P(a),o=v(a,"P",{class:!0});var c=S(o);s=Q(c,t[13]),c.forEach(b),this.h()},h(){u(o,"class","cUrl svelte-mfuhqm")},m(a,c){te(a,e,c),te(a,n,c),te(a,o,c),r(o,s)},p(a,c){c[0]&8192&&de(s,a[13])},d(a){a&&(b(e),b(n),b(o))}}}function wn(t){let e,l,n;function o(a){t[39](a)}let s={pageName:t[0].partName};return t[12]!==void 0&&(s.storeName=t[12]),e=new an({props:s}),De.push(()=>je(e,"storeName",o)),{c(){Ne(e.$$.fragment)},l(a){Te(e.$$.fragment,a)},m(a,c){we(e,a,c),n=!0},p(a,c){const f={};c[0]&1&&(f.pageName=a[0].partName),!l&&c[0]&4096&&(l=!0,f.storeName=a[12],Pe(()=>l=!1)),e.$set(f)},i(a){n||(ge(e.$$.fragment,a),n=!0)},o(a){ve(e.$$.fragment,a),n=!1},d(a){Oe(e,a)}}}function On(t){let e,l,n="Parameters",o,s,a,c="Load Params from File",f,i,d,p,N="Set Params Default",m,h,_="Load Params from localStorage",C,k,w,D,T,y,O,A,E,L,M,q='<tr class="svelte-mfuhqm"><td class="svelte-mfuhqm">Parameter name</td> <td class="svelte-mfuhqm">Value</td> <td class="svelte-mfuhqm">Unit</td> <td class="svelte-mfuhqm">Default</td> <td class="svelte-mfuhqm">Min</td> <td class="svelte-mfuhqm">Max</td> <td class="svelte-mfuhqm">Step</td></tr>',H,R,F,K,ne,se="Comment:",$,le,W,he,be="Save Parameters to File",j,B,ce="Save Parameters as URL",oe,ae,V="Save Parameters to localStorage",U,G,x,ie,ee,Z,ke,Ee,Le,z,re,pe,Fe,Xe,We,ze,Ye,mt,qe;function ul(Y){t[28](Y)}let bt={okName:"Overwrite Parameters",okFunc:t[20],$$slots:{default:[pn]},$$scope:{ctx:t}};t[7]!==void 0&&(bt.modalOpen=t[7]),k=new ct({props:bt}),De.push(()=>je(k,"modalOpen",ul));function ml(Y){t[30](Y)}let kt={okName:"Load Parameters",okFunc:t[21],$$slots:{default:[gn]},$$scope:{ctx:t}};t[8]!==void 0&&(kt.modalOpen=t[8]),T=new ct({props:kt}),De.push(()=>je(T,"modalOpen",ml));let nt=Ce(t[0].params),Se=[];for(let Y=0;Y<nt.length;Y+=1)Se[Y]=Ht(Bt(t,nt,Y));function hl(Y){t[38](Y)}let Nt={okName:"Done",okFunc:Cn,sizeLarge:!0,$$slots:{default:[Tn]},$$scope:{ctx:t}};t[9]!==void 0&&(Nt.modalOpen=t[9]),G=new ct({props:Nt}),De.push(()=>je(G,"modalOpen",hl));function dl(Y){t[40](Y)}let Tt={okName:"Save into localStorage",okFunc:t[22],$$slots:{default:[wn]},$$scope:{ctx:t}};t[10]!==void 0&&(Tt.modalOpen=t[10]),ee=new ct({props:Tt}),De.push(()=>je(ee,"modalOpen",dl));function _l(Y){t[41](Y)}let wt={svgPath:t[14]};return t[15]!==void 0&&(wt.modalOpen=t[15]),Ee=new rl({props:wt}),De.push(()=>je(Ee,"modalOpen",_l)),ze=new mn({props:{pageName:t[0].partName,fgeom:t[1],selFace:t[2],simTime:t[3]}}),{c(){e=g("section"),l=g("h2"),l.textContent=n,o=I(),s=g("main"),a=g("label"),a.textContent=c,f=I(),i=g("input"),d=I(),p=g("button"),p.textContent=N,m=I(),h=g("button"),h.textContent=_,C=I(),Ne(k.$$.fragment),D=I(),Ne(T.$$.fragment),O=I(),A=g("textarea"),E=I(),L=g("table"),M=g("thead"),M.innerHTML=q,H=I(),R=g("tbody");for(let Y=0;Y<Se.length;Y+=1)Se[Y].c();F=I(),K=g("div"),ne=g("label"),ne.textContent=se,$=I(),le=g("input"),W=I(),he=g("button"),he.textContent=be,j=I(),B=g("button"),B.textContent=ce,oe=I(),ae=g("button"),ae.textContent=V,U=I(),Ne(G.$$.fragment),ie=I(),Ne(ee.$$.fragment),ke=I(),Ne(Ee.$$.fragment),z=I(),re=g("button"),pe=g("img"),Xe=I(),We=g("div"),Ne(ze.$$.fragment),this.h()},l(Y){e=v(Y,"SECTION",{class:!0});var fe=S(e);l=v(fe,"H2",{class:!0,"data-svelte-h":!0}),ue(l)!=="svelte-1mc497a"&&(l.textContent=n),o=P(fe),s=v(fe,"MAIN",{class:!0});var me=S(s);a=v(me,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),ue(a)!=="svelte-zt7rok"&&(a.textContent=c),f=P(me),i=v(me,"INPUT",{id:!0,type:!0,accept:!0,class:!0}),d=P(me),p=v(me,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(p)!=="svelte-1typ5"&&(p.textContent=N),m=P(me),h=v(me,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(h)!=="svelte-187bpo6"&&(h.textContent=_),C=P(me),Te(k.$$.fragment,me),D=P(me),Te(T.$$.fragment,me),O=P(me),A=v(me,"TEXTAREA",{rows:!0,cols:!0,wrap:!0,class:!0}),S(A).forEach(b),E=P(me),L=v(me,"TABLE",{class:!0});var Ze=S(L);M=v(Ze,"THEAD",{class:!0,"data-svelte-h":!0}),ue(M)!=="svelte-19j94z2"&&(M.innerHTML=q),H=P(Ze),R=v(Ze,"TBODY",{class:!0});var st=S(R);for(let Ie=0;Ie<Se.length;Ie+=1)Se[Ie].l(st);st.forEach(b),Ze.forEach(b),F=P(me),K=v(me,"DIV",{class:!0});var Je=S(K);ne=v(Je,"LABEL",{for:!0,"data-svelte-h":!0}),ue(ne)!=="svelte-gqskth"&&(ne.textContent=se),$=P(Je),le=v(Je,"INPUT",{type:!0,id:!0,maxlength:!0,size:!0}),Je.forEach(b),W=P(me),he=v(me,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(he)!=="svelte-1ny58g0"&&(he.textContent=be),j=P(me),B=v(me,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(B)!=="svelte-11or0m2"&&(B.textContent=ce),oe=P(me),ae=v(me,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(ae)!=="svelte-5zdtrl"&&(ae.textContent=V),U=P(me),Te(G.$$.fragment,me),ie=P(me),Te(ee.$$.fragment,me),me.forEach(b),ke=P(fe),Te(Ee.$$.fragment,fe),z=P(fe),re=v(fe,"BUTTON",{class:!0});var at=S(re);pe=v(at,"IMG",{src:!0,alt:!0,class:!0}),at.forEach(b),Xe=P(fe),We=v(fe,"DIV",{class:!0});var Qe=S(We);Te(ze.$$.fragment,Qe),Qe.forEach(b),fe.forEach(b),this.h()},h(){u(l,"class","svelte-mfuhqm"),u(a,"for","loadFParams"),u(a,"class","fileUpload svelte-mfuhqm"),u(i,"id","loadFParams"),u(i,"type","file"),u(i,"accept","text/plain, application/json"),u(i,"class","svelte-mfuhqm"),u(p,"class","svelte-mfuhqm"),u(h,"class","svelte-mfuhqm"),u(A,"rows","3"),u(A,"cols","80"),A.readOnly=!0,u(A,"wrap","off"),A.value=t[5],u(A,"class","svelte-mfuhqm"),Re(A,"colorWarn",t[6]),u(M,"class","svelte-mfuhqm"),u(R,"class","svelte-mfuhqm"),u(L,"class","svelte-mfuhqm"),u(ne,"for","inComment"),u(le,"type","text"),u(le,"id","inComment"),u(le,"maxlength","150"),u(le,"size","70"),u(K,"class","comment svelte-mfuhqm"),u(he,"class","svelte-mfuhqm"),u(B,"class","svelte-mfuhqm"),u(ae,"class","svelte-mfuhqm"),u(s,"class","svelte-mfuhqm"),rt(pe.src,Fe=t[14])||u(pe,"src",Fe),u(pe,"alt",t[14]),u(pe,"class","svelte-mfuhqm"),u(re,"class","side-img svelte-mfuhqm"),u(We,"class","mini-canvas svelte-mfuhqm"),u(e,"class","svelte-mfuhqm")},m(Y,fe){te(Y,e,fe),r(e,l),r(e,o),r(e,s),r(s,a),r(s,f),r(s,i),r(s,d),r(s,p),r(s,m),r(s,h),r(s,C),we(k,s,null),r(s,D),we(T,s,null),r(s,O),r(s,A),r(s,E),r(s,L),r(L,M),r(L,H),r(L,R);for(let me=0;me<Se.length;me+=1)Se[me]&&Se[me].m(R,null);r(s,F),r(s,K),r(K,ne),r(K,$),r(K,le),_e(le,t[4]),r(s,W),r(s,he),r(s,j),r(s,B),r(s,oe),r(s,ae),r(s,U),we(G,s,null),r(s,ie),we(ee,s,null),r(e,ke),we(Ee,e,null),r(e,z),r(e,re),r(re,pe),r(e,Xe),r(e,We),we(ze,We,null),Ye=!0,mt||(qe=[X(i,"change",t[18]),X(p,"click",t[26]),X(h,"click",t[27]),X(le,"input",t[36]),X(he,"click",t[19]),X(B,"click",t[23]),X(ae,"click",t[37]),X(re,"click",t[25])],mt=!0)},p(Y,fe){const me={};fe[1]&134217728&&(me.$$scope={dirty:fe,ctx:Y}),!w&&fe[0]&128&&(w=!0,me.modalOpen=Y[7],Pe(()=>w=!1)),k.$set(me);const Ze={};if(fe[0]&2049|fe[1]&134217728&&(Ze.$$scope={dirty:fe,ctx:Y}),!y&&fe[0]&256&&(y=!0,Ze.modalOpen=Y[8],Pe(()=>y=!1)),T.$set(Ze),(!Ye||fe[0]&32)&&(A.value=Y[5]),(!Ye||fe[0]&64)&&Re(A,"colorWarn",Y[6]),fe[0]&16973825){nt=Ce(Y[0].params);let Ie;for(Ie=0;Ie<nt.length;Ie+=1){const Ot=Bt(Y,nt,Ie);Se[Ie]?Se[Ie].p(Ot,fe):(Se[Ie]=Ht(Ot),Se[Ie].c(),Se[Ie].m(R,null))}for(;Ie<Se.length;Ie+=1)Se[Ie].d(1);Se.length=nt.length}fe[0]&16&&le.value!==Y[4]&&_e(le,Y[4]);const st={};fe[0]&8192|fe[1]&134217728&&(st.$$scope={dirty:fe,ctx:Y}),!x&&fe[0]&512&&(x=!0,st.modalOpen=Y[9],Pe(()=>x=!1)),G.$set(st);const Je={};fe[0]&4097|fe[1]&134217728&&(Je.$$scope={dirty:fe,ctx:Y}),!Z&&fe[0]&1024&&(Z=!0,Je.modalOpen=Y[10],Pe(()=>Z=!1)),ee.$set(Je);const at={};fe[0]&16384&&(at.svgPath=Y[14]),!Le&&fe[0]&32768&&(Le=!0,at.modalOpen=Y[15],Pe(()=>Le=!1)),Ee.$set(at),(!Ye||fe[0]&16384&&!rt(pe.src,Fe=Y[14]))&&u(pe,"src",Fe),(!Ye||fe[0]&16384)&&u(pe,"alt",Y[14]);const Qe={};fe[0]&1&&(Qe.pageName=Y[0].partName),fe[0]&2&&(Qe.fgeom=Y[1]),fe[0]&4&&(Qe.selFace=Y[2]),fe[0]&8&&(Qe.simTime=Y[3]),ze.$set(Qe)},i(Y){Ye||(ge(k.$$.fragment,Y),ge(T.$$.fragment,Y),ge(G.$$.fragment,Y),ge(ee.$$.fragment,Y),ge(Ee.$$.fragment,Y),ge(ze.$$.fragment,Y),Ye=!0)},o(Y){ve(k.$$.fragment,Y),ve(T.$$.fragment,Y),ve(G.$$.fragment,Y),ve(ee.$$.fragment,Y),ve(Ee.$$.fragment,Y),ve(ze.$$.fragment,Y),Ye=!1},d(Y){Y&&b(e),Oe(k),Oe(T),Ke(Se,Y),Oe(G),Oe(ee),Oe(Ee),Oe(ze),mt=!1,He(qe)}}}function Cn(){}function En(t,e,l){let n,o;xe(t,Ve,z=>l(16,n=z)),xe(t,ql,z=>l(42,o=z));const s=nl();let{pDef:a}=e,{fgeom:c}=e,{selFace:f}=e,{simTime:i=0}=e,d="";function p(){s("paramChg",{foo:"bla"})}function N(z){let re="",pe=0,Fe=0,Xe=0;const We=[];for(const qe of a.params)We.push(qe.name),Object.hasOwn(z,qe.name)?(pe+=1,n[a.partName][qe.name]===z[qe.name]?Xe+=1:Ol(Ve,n[a.partName][qe.name]=z[qe.name],n)):Fe+=1;let ze=0;for(const qe of Object.keys(z))We.includes(qe)||(ze+=1,re+=`warn363: parameter ${qe} not in the scope of the design (${ze})
|
|
2
|
-
`);const Ye=ze>0;return re+=`Params loaded at ${new Date().toLocaleTimeString()} :`,re+=` def-nb: ${Object.keys(a.params).length}`,re+=`, cover-nb: ${pe}, uncover-nb: ${Fe}
|
|
3
|
-
`,re+=` load-nb: ${Object.keys(z).length}`,re+=`, equal-nb: ${Xe}, changed-nb: ${pe-Xe}`,re+=`, out-of-scope: ${ze}`,[re,Ye]}let m="",h=!1;function _(){{const z=new URLSearchParams(o.url.search),re={};for(const[pe,Fe]of z){const Xe=Number(Fe);isNaN(Xe)||(re[pe]=Xe)}Object.keys(re).length>0&&l(5,[m,h]=N(re),m,l(6,h))}}function C(){_(),p()}vt(()=>{C()});function k(z){try{const[re]=Pl(z);l(5,[m,h]=N(re.pVal),m,l(6,h)),l(4,d=re.comment),p()}catch(re){let pe=`err723: error by parsing parameter file
|
|
4
|
-
`;pe+=re,l(5,m=pe),l(6,h=!0)}}async function w(z){const re=await z.text();k(re)}function D(z){if(z.target){const re=z.target.files;re&&w(re[0])}}function T(){cl(a.partName,n[a.partName],d)}let y=!1,O=!1,A=!1,E=!1;function L(){const z={};for(const re of a.params)z[re.name]=re.init;l(5,[m,h]=N(z),m,l(6,h))}let M;function q(){if(M!==void 0&&M!==""){const z=`${a.partName}_${M}`;{const re=window.localStorage.getItem(z);re===null?(l(5,m=`Warn157: localStorage key ${z} is null`),l(6,h=!0)):k(re)}}else l(5,m="Warn239: No valid name for loading from localStorage!"),l(6,h=!0)}let H;function R(){if(H!==void 0&&H!==""){const z=`${a.partName}_${H}`,re=/\..*$/,Fe=al(new Date().toISOString().replace(re,""),n[a.partName],d);window.localStorage.setItem(z,Fe)}else console.log("Warn639: No valid name for writing to localStorage!")}let F="";function K(){return dn(o.url.href,n[a.partName],!1).toString()}function ne(){l(13,F=K()),l(9,A=!0)}let se=`${ft}/pgdsvg/default_param_blank.svg`;function $(z){l(14,se=`${ft}/pgdsvg/default_param_blank.svg`),Object.keys(a.paramSvg).includes(z)&&l(14,se=`${ft}/pgdsvg/${a.paramSvg[z]}`)}function le(z,re){const pe=Object.keys(n[re]).length;z<pe&&$(Object.keys(n[re])[z])}let W=!1;function he(){l(15,W=!0)}const be=()=>{l(7,y=!0)},j=()=>{l(8,O=!0)};function B(z){y=z,l(7,y)}function ce(z){M=z,l(11,M)}function oe(z){O=z,l(8,O)}const ae=z=>$(z.name);function V(z){n[a.partName][z.name]=it(this.value),Ve.set(n)}function U(z){n[a.partName][z.name]=it(this.value),Ve.set(n)}function G(z){n[a.partName][z.name]=_t(this),Ve.set(n)}function x(z){n[a.partName][z.name]=_t(this),Ve.set(n)}function ie(){d=this.value,l(4,d)}const ee=()=>{l(10,E=!0)};function Z(z){A=z,l(9,A)}function ke(z){H=z,l(12,H)}function Ee(z){E=z,l(10,E)}function Le(z){W=z,l(15,W)}return t.$$set=z=>{"pDef"in z&&l(0,a=z.pDef),"fgeom"in z&&l(1,c=z.fgeom),"selFace"in z&&l(2,f=z.selFace),"simTime"in z&&l(3,i=z.simTime)},t.$$.update=()=>{t.$$.dirty[0]&1&&le(0,a.partName)},[a,c,f,i,d,m,h,y,O,A,E,M,H,F,se,W,n,p,D,T,L,q,R,ne,$,he,be,j,B,ce,oe,ae,V,U,G,x,ie,ee,Z,ke,Ee,Le]}class Ln extends ye{constructor(e){super(),Me(this,e,En,On,Ue,{pDef:0,fgeom:1,selFace:2,simTime:3},null,[-1,-1])}}function Dn(t){let e,l,n="0",o,s,a="<-",c,f,i="|<",d,p,N="||",m,h,_=">|",C,k,w="->",D,T,y,O,A,E;return{c(){e=g("nav"),l=g("button"),l.textContent=n,o=I(),s=g("button"),s.textContent=a,c=I(),f=g("button"),f.textContent=i,d=I(),p=g("button"),p.textContent=N,m=I(),h=g("button"),h.textContent=_,C=I(),k=g("button"),k.textContent=w,D=I(),T=g("input"),y=I(),O=g("input"),this.h()},l(L){e=v(L,"NAV",{class:!0});var M=S(e);l=v(M,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(l)!=="svelte-sw7vi1"&&(l.textContent=n),o=P(M),s=v(M,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(s)!=="svelte-gbiqvp"&&(s.textContent=a),c=P(M),f=v(M,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(f)!=="svelte-10nqggx"&&(f.textContent=i),d=P(M),p=v(M,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(p)!=="svelte-1xmh6xn"&&(p.textContent=N),m=P(M),h=v(M,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(h)!=="svelte-1wuqlom"&&(h.textContent=_),C=P(M),k=v(M,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(k)!=="svelte-1vey426"&&(k.textContent=w),D=P(M),T=v(M,"INPUT",{type:!0,min:!0,max:!0,step:!0,class:!0}),y=P(M),O=v(M,"INPUT",{type:!0,min:!0,max:!0,step:!0,class:!0}),M.forEach(b),this.h()},h(){u(l,"class","svelte-uw6ahn"),u(s,"class","svelte-uw6ahn"),u(f,"class","svelte-uw6ahn"),u(p,"class","svelte-uw6ahn"),u(h,"class","svelte-uw6ahn"),u(k,"class","svelte-uw6ahn"),u(T,"type","range"),u(T,"min","0"),u(T,"max",t[1]),u(T,"step",t[2]),u(T,"class","svelte-uw6ahn"),u(O,"type","number"),u(O,"min","0"),u(O,"max",t[1]),u(O,"step",t[2]),u(O,"class","svelte-uw6ahn"),u(e,"class","svelte-uw6ahn")},m(L,M){te(L,e,M),r(e,l),r(e,o),r(e,s),r(e,c),r(e,f),r(e,d),r(e,p),r(e,m),r(e,h),r(e,C),r(e,k),r(e,D),r(e,T),_e(T,t[0]),r(e,y),r(e,O),_e(O,t[0]),A||(E=[X(l,"click",t[3]),X(s,"click",t[6]),X(f,"click",t[4]),X(p,"click",t[8]),X(h,"click",t[5]),X(k,"click",t[7]),X(T,"change",t[10]),X(T,"input",t[10]),X(O,"input",t[11])],A=!0)},p(L,[M]){M&2&&u(T,"max",L[1]),M&4&&u(T,"step",L[2]),M&1&&_e(T,L[0]),M&2&&u(O,"max",L[1]),M&4&&u(O,"step",L[2]),M&1&&it(O.value)!==L[0]&&_e(O,L[0])},i:Ae,o:Ae,d(L){L&&b(e),A=!1,He(E)}}}const Vt=4;function Sn(t,e,l){let{tMax:n=10}=e,{tStep:o=.1}=e,{tUpdate:s=500}=e,{simTime:a=0}=e,c=null,f=0,i;function d(){c!==null&&(clearInterval(c),c=null)}function p(){i<0&&a<=0?l(0,a=n):i>0&&a>=n?l(0,a=0):l(0,a+=i)}function N(){const y=s/2**(Math.abs(f)-1);i=f<0?-o:o,c=setInterval(p,y)}function m(){d(),l(0,a=0),f=0}function h(){d(),f=0,i=-o,p()}function _(){d(),f=0,i=o,p()}function C(){d(),f=Math.max(f-1,-Vt),N()}function k(){d(),f=Math.min(f+1,Vt),N()}function w(){d(),f=0}Cl(()=>{});function D(){a=it(this.value),l(0,a)}function T(){a=it(this.value),l(0,a)}return t.$$set=y=>{"tMax"in y&&l(1,n=y.tMax),"tStep"in y&&l(2,o=y.tStep),"tUpdate"in y&&l(9,s=y.tUpdate),"simTime"in y&&l(0,a=y.simTime)},[a,n,o,m,h,_,C,k,w,s,D,T]}class In extends ye{constructor(e){super(),Me(this,e,Sn,Dn,Ue,{tMax:1,tStep:2,tUpdate:9,simTime:0})}}function Pn(t){let e,l,n='<div class="zero svelte-c549k7"></div>',o,s,a='<div class="zoomin svelte-c549k7"></div>',c,f,i='<div class="zoomout svelte-c549k7"></div>',d,p,N='<div class="arrowleft svelte-c549k7"></div>',m,h,_='<div class="arrowright svelte-c549k7"></div>',C,k,w='<div class="arrowup svelte-c549k7"></div>',D,T,y='<div class="arrowdown svelte-c549k7"></div>',O,A;return{c(){e=g("nav"),l=g("button"),l.innerHTML=n,o=I(),s=g("button"),s.innerHTML=a,c=I(),f=g("button"),f.innerHTML=i,d=I(),p=g("button"),p.innerHTML=N,m=I(),h=g("button"),h.innerHTML=_,C=I(),k=g("button"),k.innerHTML=w,D=I(),T=g("button"),T.innerHTML=y,this.h()},l(E){e=v(E,"NAV",{class:!0});var L=S(e);l=v(L,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(l)!=="svelte-nkdg6y"&&(l.innerHTML=n),o=P(L),s=v(L,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(s)!=="svelte-nbpwn1"&&(s.innerHTML=a),c=P(L),f=v(L,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(f)!=="svelte-toyuqt"&&(f.innerHTML=i),d=P(L),p=v(L,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(p)!=="svelte-vbdqb3"&&(p.innerHTML=N),m=P(L),h=v(L,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(h)!=="svelte-a55vyt"&&(h.innerHTML=_),C=P(L),k=v(L,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(k)!=="svelte-ky9277"&&(k.innerHTML=w),D=P(L),T=v(L,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(T)!=="svelte-1obyap9"&&(T.innerHTML=y),L.forEach(b),this.h()},h(){u(l,"class","svelte-c549k7"),u(s,"class","svelte-c549k7"),u(f,"class","svelte-c549k7"),u(p,"class","svelte-c549k7"),u(h,"class","svelte-c549k7"),u(k,"class","svelte-c549k7"),u(T,"class","svelte-c549k7"),u(e,"class","svelte-c549k7")},m(E,L){te(E,e,L),r(e,l),r(e,o),r(e,s),r(e,c),r(e,f),r(e,d),r(e,p),r(e,m),r(e,h),r(e,C),r(e,k),r(e,D),r(e,T),O||(A=[X(l,"click",t[1]),X(s,"click",t[2]),X(f,"click",t[3]),X(p,"click",t[4]),X(h,"click",t[5]),X(k,"click",t[6]),X(T,"click",t[7])],O=!0)},p:Ae,i:Ae,o:Ae,d(E){E&&b(e),O=!1,He(A)}}}function jn(t){const e=nl();function l(d){e("myevent",{action:d})}return[l,()=>l("zoomInit"),()=>l("zoomIn"),()=>l("zoomOut"),()=>l("moveLeft"),()=>l("moveRight"),()=>l("moveUp"),()=>l("moveDown")]}class Un extends ye{constructor(e){super(),Me(this,e,jn,Pn,Ue,{})}}function yn(t){let e,l,n,o,s,a,c,f,i,d,p,N,m,h,_,C,k,w,D,T,y,O,A,E,L,M,q,H,R,F,K,ne,se,$,le,W,he,be,j,B,ce,oe;return{c(){e=g("div"),l=g("label"),n=g("input"),o=J("main part"),s=I(),a=g("label"),c=g("input"),f=J("main skeleton"),i=I(),d=g("label"),p=g("input"),N=J("second parts"),m=I(),h=g("label"),_=g("input"),C=J("second skeletons"),k=I(),w=g("label"),D=g("input"),T=J("dynamics"),y=I(),O=g("label"),A=g("input"),E=J("ruler"),L=I(),M=g("label"),q=g("input"),H=J("frame of reference"),R=I(),F=g("label"),K=g("input"),ne=J("points"),se=I(),$=g("label"),le=g("input"),W=J("lines"),he=I(),be=g("label"),j=g("input"),B=J("vectors"),this.h()},l(ae){e=v(ae,"DIV",{class:!0});var V=S(e);l=v(V,"LABEL",{class:!0});var U=S(l);n=v(U,"INPUT",{type:!0,class:!0}),o=Q(U,"main part"),U.forEach(b),s=P(V),a=v(V,"LABEL",{class:!0});var G=S(a);c=v(G,"INPUT",{type:!0,class:!0}),f=Q(G,"main skeleton"),G.forEach(b),i=P(V),d=v(V,"LABEL",{class:!0});var x=S(d);p=v(x,"INPUT",{type:!0,class:!0}),N=Q(x,"second parts"),x.forEach(b),m=P(V),h=v(V,"LABEL",{class:!0});var ie=S(h);_=v(ie,"INPUT",{type:!0,class:!0}),C=Q(ie,"second skeletons"),ie.forEach(b),k=P(V),w=v(V,"LABEL",{class:!0});var ee=S(w);D=v(ee,"INPUT",{type:!0,class:!0}),T=Q(ee,"dynamics"),ee.forEach(b),y=P(V),O=v(V,"LABEL",{class:!0});var Z=S(O);A=v(Z,"INPUT",{type:!0,class:!0}),E=Q(Z,"ruler"),Z.forEach(b),L=P(V),M=v(V,"LABEL",{class:!0});var ke=S(M);q=v(ke,"INPUT",{type:!0,class:!0}),H=Q(ke,"frame of reference"),ke.forEach(b),R=P(V),F=v(V,"LABEL",{class:!0});var Ee=S(F);K=v(Ee,"INPUT",{type:!0,class:!0}),ne=Q(Ee,"points"),Ee.forEach(b),se=P(V),$=v(V,"LABEL",{class:!0});var Le=S($);le=v(Le,"INPUT",{type:!0,class:!0}),W=Q(Le,"lines"),Le.forEach(b),he=P(V),be=v(V,"LABEL",{class:!0});var z=S(be);j=v(z,"INPUT",{type:!0,class:!0}),B=Q(z,"vectors"),z.forEach(b),V.forEach(b),this.h()},h(){u(n,"type","checkbox"),u(n,"class","svelte-1rsbkj"),u(l,"class","svelte-1rsbkj"),u(c,"type","checkbox"),u(c,"class","svelte-1rsbkj"),u(a,"class","svelte-1rsbkj"),u(p,"type","checkbox"),u(p,"class","svelte-1rsbkj"),u(d,"class","svelte-1rsbkj"),u(_,"type","checkbox"),u(_,"class","svelte-1rsbkj"),u(h,"class","svelte-1rsbkj"),u(D,"type","checkbox"),u(D,"class","svelte-1rsbkj"),u(w,"class","svelte-1rsbkj"),u(A,"type","checkbox"),u(A,"class","svelte-1rsbkj"),u(O,"class","svelte-1rsbkj"),u(q,"type","checkbox"),u(q,"class","svelte-1rsbkj"),u(M,"class","svelte-1rsbkj"),u(K,"type","checkbox"),u(K,"class","svelte-1rsbkj"),u(F,"class","svelte-1rsbkj"),u(le,"type","checkbox"),u(le,"class","svelte-1rsbkj"),u($,"class","svelte-1rsbkj"),u(j,"type","checkbox"),u(j,"class","svelte-1rsbkj"),u(be,"class","svelte-1rsbkj"),u(e,"class","svelte-1rsbkj")},m(ae,V){te(ae,e,V),r(e,l),r(l,n),n.checked=t[0].main,r(l,o),r(e,s),r(e,a),r(a,c),c.checked=t[0].mainB,r(a,f),r(e,i),r(e,d),r(d,p),p.checked=t[0].second,r(d,N),r(e,m),r(e,h),r(h,_),_.checked=t[0].secondB,r(h,C),r(e,k),r(e,w),r(w,D),D.checked=t[0].dynamics,r(w,T),r(e,y),r(e,O),r(O,A),A.checked=t[0].ruler,r(O,E),r(e,L),r(e,M),r(M,q),q.checked=t[0].refframe,r(M,H),r(e,R),r(e,F),r(F,K),K.checked=t[0].points,r(F,ne),r(e,se),r(e,$),r($,le),le.checked=t[0].lines,r($,W),r(e,he),r(e,be),r(be,j),j.checked=t[0].vectors,r(be,B),ce||(oe=[X(n,"change",t[1]),X(c,"change",t[2]),X(p,"change",t[3]),X(_,"change",t[4]),X(D,"change",t[5]),X(A,"change",t[6]),X(q,"change",t[7]),X(K,"change",t[8]),X(le,"change",t[9]),X(j,"change",t[10])],ce=!0)},p(ae,[V]){V&1&&(n.checked=ae[0].main),V&1&&(c.checked=ae[0].mainB),V&1&&(p.checked=ae[0].second),V&1&&(_.checked=ae[0].secondB),V&1&&(D.checked=ae[0].dynamics),V&1&&(A.checked=ae[0].ruler),V&1&&(q.checked=ae[0].refframe),V&1&&(K.checked=ae[0].points),V&1&&(le.checked=ae[0].lines),V&1&&(j.checked=ae[0].vectors)},i:Ae,o:Ae,d(ae){ae&&b(e),ce=!1,He(oe)}}}function Mn(t,e,l){let n;xe(t,Be,h=>l(0,n=h));function o(){n.main=this.checked,Be.set(n)}function s(){n.mainB=this.checked,Be.set(n)}function a(){n.second=this.checked,Be.set(n)}function c(){n.secondB=this.checked,Be.set(n)}function f(){n.dynamics=this.checked,Be.set(n)}function i(){n.ruler=this.checked,Be.set(n)}function d(){n.refframe=this.checked,Be.set(n)}function p(){n.points=this.checked,Be.set(n)}function N(){n.lines=this.checked,Be.set(n)}function m(){n.vectors=this.checked,Be.set(n)}return[n,o,s,a,c,f,i,d,p,N,m]}class Fn extends ye{constructor(e){super(),Me(this,e,Mn,yn,Ue,{})}}function Kt(t,e,l){const n=t.slice();return n[36]=e[l],n}function Xt(t){let e,l=t[36]+"",n,o;return{c(){e=g("option"),n=J(l),this.h()},l(s){e=v(s,"OPTION",{});var a=S(e);n=Q(a,l),a.forEach(b),this.h()},h(){e.__value=o=t[36],_e(e,e.__value)},m(s,a){te(s,e,a),r(e,n)},p(s,a){a[0]&8&&l!==(l=s[36]+"")&&de(n,l),a[0]&8&&o!==(o=s[36])&&(e.__value=o,_e(e,e.__value))},d(s){s&&b(e)}}}function An(t){let e,l,n,o,s,a,c,f,i,d,p,N,m,h,_,C,k,w,D,T,y,O;ut(t[19]);let A=Ce(t[3]),E=[];for(let q=0;q<A.length;q+=1)E[q]=Xt(Kt(t,A,q));f=new Fn({});function L(q){t[22](q)}let M={tMax:t[2].sim.tMax,tStep:t[2].sim.tStep,tUpdate:t[2].sim.tUpdate};return t[1]!==void 0&&(M.simTime=t[1]),m=new In({props:M}),De.push(()=>je(m,"simTime",L)),D=new Un({}),D.$on("myevent",t[8]),{c(){e=g("section"),l=g("h2"),n=J(`Drawing
|
|
5
|
-
`),o=g("select");for(let q=0;q<E.length;q+=1)E[q].c();s=g("option"),a=J("All faces merged"),c=I(),Ne(f.$$.fragment),i=I(),d=g("div"),p=g("canvas"),N=I(),Ne(m.$$.fragment),_=I(),C=g("div"),k=g("canvas"),w=I(),Ne(D.$$.fragment),this.h()},l(q){e=v(q,"SECTION",{class:!0});var H=S(e);l=v(H,"H2",{class:!0});var R=S(l);n=Q(R,`Drawing
|
|
6
|
-
`),o=v(R,"SELECT",{class:!0});var F=S(o);for(let $=0;$<E.length;$+=1)E[$].l(F);s=v(F,"OPTION",{});var K=S(s);a=Q(K,"All faces merged"),K.forEach(b),F.forEach(b),R.forEach(b),c=P(H),Te(f.$$.fragment,H),i=P(H),d=v(H,"DIV",{class:!0});var ne=S(d);p=v(ne,"CANVAS",{class:!0,width:!0,height:!0}),S(p).forEach(b),N=P(ne),Te(m.$$.fragment,ne),ne.forEach(b),_=P(H),C=v(H,"DIV",{class:!0});var se=S(C);k=v(se,"CANVAS",{class:!0,width:!0,height:!0}),S(k).forEach(b),w=P(se),Te(D.$$.fragment,se),se.forEach(b),H.forEach(b),this.h()},h(){s.__value=fl,_e(s,s.__value),u(o,"class","svelte-s85el8"),t[0]===void 0&&ut(()=>t[20].call(o)),u(l,"class","svelte-s85el8"),u(p,"class","full svelte-s85el8"),u(p,"width",lt),u(p,"height",lt),u(d,"class","rack svelte-s85el8"),u(k,"class","zoom svelte-s85el8"),u(k,"width",lt),u(k,"height",lt),u(C,"class","rack svelte-s85el8"),u(e,"class","svelte-s85el8")},m(q,H){te(q,e,H),r(e,l),r(l,n),r(l,o);for(let R=0;R<E.length;R+=1)E[R]&&E[R].m(o,null);r(o,s),r(s,a),et(o,t[0],!0),r(e,c),we(f,e,null),r(e,i),r(e,d),r(d,p),t[21](p),r(d,N),we(m,d,null),r(e,_),r(e,C),r(C,k),t[23](k),r(C,w),we(D,C,null),T=!0,y||(O=[X(window,"resize",t[7]),X(window,"resize",t[19]),X(o,"change",t[20]),X(p,"mousedown",t[9]),X(p,"mouseup",t[10]),X(p,"mousemove",t[11]),X(k,"mousedown",t[12]),X(k,"mousemove",t[13]),X(k,"wheel",El(t[14]))],y=!0)},p(q,H){if(H[0]&8){A=Ce(q[3]);let F;for(F=0;F<A.length;F+=1){const K=Kt(q,A,F);E[F]?E[F].p(K,H):(E[F]=Xt(K),E[F].c(),E[F].m(o,s))}for(;F<E.length;F+=1)E[F].d(1);E.length=A.length}H[0]&9&&et(o,q[0]);const R={};H[0]&4&&(R.tMax=q[2].sim.tMax),H[0]&4&&(R.tStep=q[2].sim.tStep),H[0]&4&&(R.tUpdate=q[2].sim.tUpdate),!h&&H[0]&2&&(h=!0,R.simTime=q[1],Pe(()=>h=!1)),m.$set(R)},i(q){T||(ge(f.$$.fragment,q),ge(m.$$.fragment,q),ge(D.$$.fragment,q),T=!0)},o(q){ve(f.$$.fragment,q),ve(m.$$.fragment,q),ve(D.$$.fragment,q),T=!1},d(q){q&&b(e),Ke(E,q),Oe(f),t[21](null),Oe(m),t[23](null),Oe(D),y=!1,He(O)}}}const fl="ParametrixAll",lt=400,zn=3e3,dt=10,Yt=3;function Bn(t,e){let l=e;if(t.length===0)console.log("warn404: Drawing has an empty face list");else{const n=t.slice();n.push(fl),n.includes(l)||(l=t[0])}return l}function qn(t,e,l){let n,o;xe(t,Be,j=>l(17,n=j)),xe(t,Ve,j=>l(18,o=j));let{pDef:s}=e,{fgeom:a}=e,{optFaces:c}=e,{selFace:f}=e,{simTime:i=0}=e,d,p,N,m,h,_;function C(j){const B=p.getContext("2d");B.clearRect(0,0,B.canvas.width,B.canvas.height);try{h=m.getAdjustFull(B.canvas.width,B.canvas.height),m.draw(B,h,j)}catch(ce){console.log(ce)}}function k(j){const B=N.getContext("2d");B.clearRect(0,0,B.canvas.width,B.canvas.height);try{(_===void 0||_.init===0)&&(_=m.getAdjustZoom(B.canvas.width,B.canvas.height)),m.draw(B,_,j)}catch(ce){console.log(ce)}}function w(){const j=p.getContext("2d"),B=Math.max(.4*d,lt);j.canvas.width=B,j.canvas.height=B}function D(){w(),C(n),k(n)}let T=0;function y(j,B,ce,oe){const ae=a(j,B).fig,V=Object.keys(ae),U=Bn(V,ce);l(0,f=U),V.includes(U)?m=ae[U]:m=sl(ae),C(oe),k(oe)}function O(j,B){y(j,o[s.partName],B,n)}vt(()=>{w(),O(i,f),l(16,T=1)});function A(j){switch(j.detail.action){case"zoomInit":_.init=0;break;case"zoomIn":_=ht(.7,_);break;case"zoomOut":_=ht(1.3,_);break;case"moveLeft":_.xMin+=-.2*_.xyDiff;break;case"moveRight":_.xMin+=.2*_.xyDiff;break;case"moveUp":_.yMin+=.2*_.xyDiff;break;case"moveDown":_.yMin+=-.2*_.xyDiff;break;default:console.log(`ERR423: ${j.detail.action} has no case!`)}k(n)}let E={timestamp:0,offsetX:0,offsetY:0};function L(j){j.button===0&&(E.timestamp=Date.now(),E.offsetX=j.offsetX,E.offsetY=j.offsetY)}function M(j){if(j.button===0)if(Date.now()-E.timestamp<zn){const B=Math.abs(E.offsetX-j.offsetX),ce=Math.abs(E.offsetY-j.offsetY);if(B<dt&&ce<dt){const[oe,ae]=tt(j.offsetX,j.offsetY,h);_=jl(oe,ae,_),O(i,f)}if(B>dt&&ce>dt){const oe=B/ce,ae=1/oe;if(oe<Yt&&ae<Yt){const[V,U]=tt(j.offsetX,j.offsetY,h),[G,x]=tt(E.offsetX,E.offsetY,h);_=Ul(V,U,G,x,lt,lt),O(i,f)}}}else console.log(`Warn205: ignore ${j.offsetX} ${j.offsetY} because too slow`)}function q(j){const B=p.getContext("2d");if(j.buttons===1){const ce=j.offsetX-E.offsetX,oe=j.offsetY-E.offsetY;C(n),B.beginPath(),B.rect(E.offsetX,E.offsetY,ce,oe),B.strokeStyle=pt.mouse,B.stroke()}if(n.ruler){const[ce,oe]=tt(j.offsetX,j.offsetY,h);B.clearRect(5,5,200,25),B.font="15px Arial",B.fillStyle=pt.ruler,B.fillText(`x: ${ce.toFixed(4)} y: ${oe.toFixed(4)}`,5,20)}}let H,R,F;function K(j){if(j.button===0){const[B,ce]=tt(j.offsetX,j.offsetY,_);H=B,R=ce,F=structuredClone(_)}}function ne(j){if(j.buttons===1){const[B,ce]=tt(j.offsetX,j.offsetY,F);_=yl(H,R,B,ce,F),k(n)}else if(n.ruler){const B=N.getContext("2d"),[ce,oe]=tt(j.offsetX,j.offsetY,_);B.clearRect(5,5,200,25),B.font="15px Arial",B.fillStyle=pt.ruler,B.fillText(`x: ${ce.toFixed(4)} y: ${oe.toFixed(4)}`,5,20)}}function se(j){j.deltaY>0?_=ht(.7,_):_=ht(1.3,_),k(n)}function $(){l(4,d=window.innerWidth)}function le(){f=_t(this),l(0,f),l(3,c)}function W(j){De[j?"unshift":"push"](()=>{p=j,l(5,p)})}function he(j){i=j,l(1,i)}function be(j){De[j?"unshift":"push"](()=>{N=j,l(6,N)})}return t.$$set=j=>{"pDef"in j&&l(2,s=j.pDef),"fgeom"in j&&l(15,a=j.fgeom),"optFaces"in j&&l(3,c=j.optFaces),"selFace"in j&&l(0,f=j.selFace),"simTime"in j&&l(1,i=j.simTime)},t.$$.update=()=>{t.$$.dirty[0]&458759&&T===1&&y(i,o[s.partName],f,n)},[f,i,s,c,d,p,N,D,A,L,M,q,K,ne,se,a,T,n,o,$,le,W,he,be]}class Rn extends ye{constructor(e){super(),Me(this,e,qn,An,Ue,{pDef:2,fgeom:15,optFaces:3,selFace:0,simTime:1},null,[-1,-1])}}function Wt(t,e,l){const n=t.slice();return n[10]=e[l],n}function Gt(t,e,l){const n=t.slice();return n[13]=e[l],n[15]=l,n}function Zt(t){let e,l,n=t[15]+1+"",o,s,a,c=t[13]+"",f,i,d,p=t[0][t[10]].dparam[t[13]].val+"",N,m,h,_,C=t[0][t[10]].dparam[t[13]].init+"",k,w,D,T,y=Qt(t[0][t[10]].dparam[t[13]].chg)+"",O,A;return{c(){e=g("tr"),l=g("td"),o=J(n),s=I(),a=g("td"),f=J(c),i=I(),d=g("td"),N=J(p),m=I(),h=g("td"),_=g("i"),k=J(C),w=I(),D=g("td"),T=g("i"),O=J(y),A=I(),this.h()},l(E){e=v(E,"TR",{class:!0});var L=S(e);l=v(L,"TD",{});var M=S(l);o=Q(M,n),M.forEach(b),s=P(L),a=v(L,"TD",{});var q=S(a);f=Q(q,c),q.forEach(b),i=P(L),d=v(L,"TD",{});var H=S(d);N=Q(H,p),H.forEach(b),m=P(L),h=v(L,"TD",{});var R=S(h);_=v(R,"I",{});var F=S(_);k=Q(F,C),F.forEach(b),R.forEach(b),w=P(L),D=v(L,"TD",{});var K=S(D);T=v(K,"I",{});var ne=S(T);O=Q(ne,y),ne.forEach(b),K.forEach(b),A=P(L),L.forEach(b),this.h()},h(){u(e,"class","svelte-lzdpo0"),Re(e,"changed",t[0][t[10]].dparam[t[13]].chg)},m(E,L){te(E,e,L),r(e,l),r(l,o),r(e,s),r(e,a),r(a,f),r(e,i),r(e,d),r(d,N),r(e,m),r(e,h),r(h,_),r(_,k),r(e,w),r(e,D),r(D,T),r(T,O),r(e,A)},p(E,L){L&5&&c!==(c=E[13]+"")&&de(f,c),L&5&&p!==(p=E[0][E[10]].dparam[E[13]].val+"")&&de(N,p),L&5&&C!==(C=E[0][E[10]].dparam[E[13]].init+"")&&de(k,C),L&5&&y!==(y=Qt(E[0][E[10]].dparam[E[13]].chg)+"")&&de(O,y),L&5&&Re(e,"changed",E[0][E[10]].dparam[E[13]].chg)},d(E){E&&b(e)}}}function Jt(t){let e,l,n,o,s,a,c,f=t[10]+"",i,d,p,N,m,h=t[1][t[0][t[10]].partName]+"",_,C,k,w="Export parameters",D,T,y,O=Object.keys(t[0][t[10]].dparam).length+"",A,E,L,M=t[0][t[10]].partName+"",q,H,R=t[5](t[0][t[10]].orientation)+"",F,K,ne=t[6](t[0][t[10]].position)+"",se,$,le,W,he,be="<tr><td>Num</td> <td>Name</td> <td>Value</td> <td>Init</td> <td>Set?</td></tr>",j,B,ce,oe,ae;function V(){return t[8](t[10])}function U(){return t[9](t[10])}let G=Ce(Object.keys(t[0][t[10]].dparam)),x=[];for(let ie=0;ie<G.length;ie+=1)x[ie]=Zt(Gt(t,G,ie));return{c(){e=g("li"),l=g("input"),o=I(),s=g("label"),a=g("div"),c=I(),i=J(f),p=I(),N=g("button"),m=J("Go to "),_=J(h),C=I(),k=g("button"),k.textContent=w,D=I(),T=g("div"),y=g("article"),A=J(O),E=J(` parameters of
|
|
7
|
-
`),L=g("strong"),q=J(M),H=J(`
|
|
8
|
-
with orientation `),F=J(R),K=J(` (degree) at position
|
|
9
|
-
`),se=J(ne),$=J(" (mm)"),le=I(),W=g("table"),he=g("thead"),he.innerHTML=be,j=I(),B=g("tbody");for(let ie=0;ie<x.length;ie+=1)x[ie].c();ce=I(),this.h()},l(ie){e=v(ie,"LI",{class:!0});var ee=S(e);l=v(ee,"INPUT",{type:!0,id:!0,class:!0}),o=P(ee),s=v(ee,"LABEL",{for:!0,class:!0});var Z=S(s);a=v(Z,"DIV",{class:!0}),S(a).forEach(b),c=P(Z),i=Q(Z,f),Z.forEach(b),p=P(ee),N=v(ee,"BUTTON",{class:!0});var ke=S(N);m=Q(ke,"Go to "),_=Q(ke,h),ke.forEach(b),C=P(ee),k=v(ee,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(k)!=="svelte-circu6"&&(k.textContent=w),D=P(ee),T=v(ee,"DIV",{class:!0});var Ee=S(T);y=v(Ee,"ARTICLE",{class:!0});var Le=S(y);A=Q(Le,O),E=Q(Le,` parameters of
|
|
10
|
-
`),L=v(Le,"STRONG",{});var z=S(L);q=Q(z,M),z.forEach(b),H=Q(Le,`
|
|
11
|
-
with orientation `),F=Q(Le,R),K=Q(Le,` (degree) at position
|
|
12
|
-
`),se=Q(Le,ne),$=Q(Le," (mm)"),Le.forEach(b),le=P(Ee),W=v(Ee,"TABLE",{class:!0});var re=S(W);he=v(re,"THEAD",{class:!0,"data-svelte-h":!0}),ue(he)!=="svelte-nhorjb"&&(he.innerHTML=be),j=P(re),B=v(re,"TBODY",{class:!0});var pe=S(B);for(let Fe=0;Fe<x.length;Fe+=1)x[Fe].l(pe);pe.forEach(b),re.forEach(b),Ee.forEach(b),ce=P(ee),ee.forEach(b),this.h()},h(){u(l,"type","checkbox"),u(l,"id",n="cb_"+t[10]),u(l,"class","toggle svelte-lzdpo0"),l.checked=!1,u(a,"class","arrow svelte-lzdpo0"),u(s,"for",d="cb_"+t[10]),u(s,"class","label svelte-lzdpo0"),u(N,"class","svelte-lzdpo0"),u(k,"class","svelte-lzdpo0"),u(y,"class","svelte-lzdpo0"),u(he,"class","svelte-lzdpo0"),u(B,"class","svelte-lzdpo0"),u(W,"class","svelte-lzdpo0"),u(T,"class","nested svelte-lzdpo0"),u(e,"class","svelte-lzdpo0")},m(ie,ee){te(ie,e,ee),r(e,l),r(e,o),r(e,s),r(s,a),r(s,c),r(s,i),r(e,p),r(e,N),r(N,m),r(N,_),r(e,C),r(e,k),r(e,D),r(e,T),r(T,y),r(y,A),r(y,E),r(y,L),r(L,q),r(y,H),r(y,F),r(y,K),r(y,se),r(y,$),r(T,le),r(T,W),r(W,he),r(W,j),r(W,B);for(let Z=0;Z<x.length;Z+=1)x[Z]&&x[Z].m(B,null);r(e,ce),oe||(ae=[X(N,"click",V),X(k,"click",U)],oe=!0)},p(ie,ee){if(t=ie,ee&4&&n!==(n="cb_"+t[10])&&u(l,"id",n),ee&4&&f!==(f=t[10]+"")&&de(i,f),ee&4&&d!==(d="cb_"+t[10])&&u(s,"for",d),ee&7&&h!==(h=t[1][t[0][t[10]].partName]+"")&&de(_,h),ee&5&&O!==(O=Object.keys(t[0][t[10]].dparam).length+"")&&de(A,O),ee&5&&M!==(M=t[0][t[10]].partName+"")&&de(q,M),ee&5&&R!==(R=t[5](t[0][t[10]].orientation)+"")&&de(F,R),ee&5&&ne!==(ne=t[6](t[0][t[10]].position)+"")&&de(se,ne),ee&5){G=Ce(Object.keys(t[0][t[10]].dparam));let Z;for(Z=0;Z<G.length;Z+=1){const ke=Gt(t,G,Z);x[Z]?x[Z].p(ke,ee):(x[Z]=Zt(ke),x[Z].c(),x[Z].m(B,null))}for(;Z<x.length;Z+=1)x[Z].d(1);x.length=G.length}},d(ie){ie&&b(e),Ke(x,ie),oe=!1,He(ae)}}}function Hn(t){let e,l,n,o,s,a=t[2].length+"",c,f,i,d,p=Ce(t[2]),N=[];for(let m=0;m<p.length;m+=1)N[m]=Jt(Wt(t,p,m));return{c(){e=g("section"),l=g("h2"),n=J(`Sub-designs
|
|
13
|
-
`),o=g("span"),s=J("(Number of sub-instances: "),c=J(a),f=J(")"),i=I(),d=g("ol");for(let m=0;m<N.length;m+=1)N[m].c();this.h()},l(m){e=v(m,"SECTION",{class:!0});var h=S(e);l=v(h,"H2",{class:!0});var _=S(l);n=Q(_,`Sub-designs
|
|
14
|
-
`),o=v(_,"SPAN",{class:!0});var C=S(o);s=Q(C,"(Number of sub-instances: "),c=Q(C,a),f=Q(C,")"),C.forEach(b),_.forEach(b),i=P(h),d=v(h,"OL",{class:!0});var k=S(d);for(let w=0;w<N.length;w+=1)N[w].l(k);k.forEach(b),h.forEach(b),this.h()},h(){u(o,"class","svelte-lzdpo0"),u(l,"class","svelte-lzdpo0"),u(d,"class","svelte-lzdpo0"),u(e,"class","svelte-lzdpo0")},m(m,h){te(m,e,h),r(e,l),r(l,n),r(l,o),r(o,s),r(o,c),r(o,f),r(e,i),r(e,d);for(let _=0;_<N.length;_+=1)N[_]&&N[_].m(d,null)},p(m,[h]){if(h&4&&a!==(a=m[2].length+"")&&de(c,a),h&127){p=Ce(m[2]);let _;for(_=0;_<p.length;_+=1){const C=Wt(m,p,_);N[_]?N[_].p(C,h):(N[_]=Jt(C),N[_].c(),N[_].m(d,null))}for(;_<N.length;_+=1)N[_].d(1);N.length=p.length}},i:Ae,o:Ae,d(m){m&&b(e),Ke(N,m)}}}function Qt(t){return t?"Yes":""}function Vn(t,e,l){let{subD:n={}}=e,{origPartName:o=""}=e,{pLink:s}=e,a=[];async function c(m){const h=n[m];ol(h.partName,Lt(h.dparam),!0);const _=`${ft}${s[h.partName]}`;vl(_)}function f(m){const h=n[m].partName,_=n[m].dparam,C=`sub-design parameters of ${h} from ${o}`;cl(h,Lt(_),C)}function i(m){let h="[ ";return h+=`${ot(gt(m[0]))}, `,h+=`${ot(gt(m[1]))}, `,h+=`${ot(gt(m[2]))} ]`,h}function d(m){let h="[ ";return h+=`${ot(m[0])}, `,h+=`${ot(m[1])}, `,h+=`${ot(m[2])} ]`,h}const p=m=>c(m),N=m=>f(m);return t.$$set=m=>{"subD"in m&&l(0,n=m.subD),"origPartName"in m&&l(7,o=m.origPartName),"pLink"in m&&l(1,s=m.pLink)},t.$$.update=()=>{t.$$.dirty&1&&l(2,a=Object.keys(n))},[n,s,a,c,f,i,d,o,p,N]}class Kn extends ye{constructor(e){super(),Me(this,e,Vn,Hn,Ue,{subD:0,origPartName:7,pLink:1})}}function $t(t,e,l){const n=t.slice();return n[19]=e[l],n}function xt(t,e,l){const n=t.slice();return n[19]=e[l],n}function el(t){let e,l,n=t[19]+"",o,s,a;return{c(){e=g("option"),l=J("face "),o=J(n),s=J(" as svg"),this.h()},l(c){e=v(c,"OPTION",{});var f=S(e);l=Q(f,"face "),o=Q(f,n),s=Q(f," as svg"),f.forEach(b),this.h()},h(){e.__value=a="svg_"+t[19],_e(e,e.__value)},m(c,f){te(c,e,f),r(e,l),r(e,o),r(e,s)},p(c,f){f&8&&n!==(n=c[19]+"")&&de(o,n),f&8&&a!==(a="svg_"+c[19])&&(e.__value=a,_e(e,e.__value))},d(c){c&&b(e)}}}function tl(t){let e,l,n=t[19]+"",o,s,a;return{c(){e=g("option"),l=J("face "),o=J(n),s=J(" as dxf"),this.h()},l(c){e=v(c,"OPTION",{});var f=S(e);l=Q(f,"face "),o=Q(f,n),s=Q(f," as dxf"),f.forEach(b),this.h()},h(){e.__value=a="dxf_"+t[19],_e(e,e.__value)},m(c,f){te(c,e,f),r(e,l),r(e,o),r(e,s)},p(c,f){f&8&&n!==(n=c[19]+"")&&de(o,n),f&8&&a!==(a="dxf_"+c[19])&&(e.__value=a,_e(e,e.__value))},d(c){c&&b(e)}}}function Xn(t){let e,l,n,o,s="Log",a,c,f,i,d,p,N,m,h,_="Export",C,k,w,D="all faces merged as svg",T,y="all faces merged as dxf",O,A="all faces as pax.json",E,L="all faces as openscad.scad",M,q="all faces as OpenJScad.js",H,R="all faces and more as zip",F,K,ne="Save to File",se,$,le,W,he;e=new Ln({props:{pDef:t[0],fgeom:t[1],selFace:t[5],simTime:t[6]}}),e.$on("paramChg",t[11]);function be(U){t[13](U)}function j(U){t[14](U)}let B={pDef:t[0],fgeom:t[1],optFaces:t[3]};t[5]!==void 0&&(B.selFace=t[5]),t[6]!==void 0&&(B.simTime=t[6]),i=new Rn({props:B}),De.push(()=>je(i,"selFace",be)),De.push(()=>je(i,"simTime",j));let ce=Ce(t[3]),oe=[];for(let U=0;U<ce.length;U+=1)oe[U]=el(xt(t,ce,U));let ae=Ce(t[3]),V=[];for(let U=0;U<ae.length;U+=1)V[U]=tl($t(t,ae,U));return $=new Kn({props:{subD:t[10],origPartName:t[0].partName,pLink:t[2]}}),{c(){Ne(e.$$.fragment),l=I(),n=g("section"),o=g("h2"),o.textContent=s,a=I(),c=g("textarea"),f=I(),Ne(i.$$.fragment),N=I(),m=g("section"),h=g("h2"),h.textContent=_,C=I(),k=g("select");for(let U=0;U<oe.length;U+=1)oe[U].c();w=g("option"),w.textContent=D;for(let U=0;U<V.length;U+=1)V[U].c();T=g("option"),T.textContent=y,O=g("option"),O.textContent=A,E=g("option"),E.textContent=L,M=g("option"),M.textContent=q,H=g("option"),H.textContent=R,F=I(),K=g("button"),K.textContent=ne,se=I(),Ne($.$$.fragment),this.h()},l(U){Te(e.$$.fragment,U),l=P(U),n=v(U,"SECTION",{class:!0});var G=S(n);o=v(G,"H2",{class:!0,"data-svelte-h":!0}),ue(o)!=="svelte-4ty0ys"&&(o.textContent=s),a=P(G),c=v(G,"TEXTAREA",{rows:!0,cols:!0,wrap:!0,class:!0}),S(c).forEach(b),G.forEach(b),f=P(U),Te(i.$$.fragment,U),N=P(U),m=v(U,"SECTION",{class:!0});var x=S(m);h=v(x,"H2",{class:!0,"data-svelte-h":!0}),ue(h)!=="svelte-1kkpb88"&&(h.textContent=_),C=P(x),k=v(x,"SELECT",{class:!0});var ie=S(k);for(let ee=0;ee<oe.length;ee+=1)oe[ee].l(ie);w=v(ie,"OPTION",{"data-svelte-h":!0}),ue(w)!=="svelte-22of2y"&&(w.textContent=D);for(let ee=0;ee<V.length;ee+=1)V[ee].l(ie);T=v(ie,"OPTION",{"data-svelte-h":!0}),ue(T)!=="svelte-1utjrni"&&(T.textContent=y),O=v(ie,"OPTION",{"data-svelte-h":!0}),ue(O)!=="svelte-3g91m5"&&(O.textContent=A),E=v(ie,"OPTION",{"data-svelte-h":!0}),ue(E)!=="svelte-1tpsyal"&&(E.textContent=L),M=v(ie,"OPTION",{"data-svelte-h":!0}),ue(M)!=="svelte-1n2n9j5"&&(M.textContent=q),H=v(ie,"OPTION",{"data-svelte-h":!0}),ue(H)!=="svelte-168w9vd"&&(H.textContent=R),ie.forEach(b),F=P(x),K=v(x,"BUTTON",{class:!0,"data-svelte-h":!0}),ue(K)!=="svelte-kuqug6"&&(K.textContent=ne),se=P(x),Te($.$$.fragment,x),x.forEach(b),this.h()},h(){u(o,"class","svelte-19nn0vk"),u(c,"rows","5"),u(c,"cols","94"),c.readOnly=!0,u(c,"wrap","off"),c.value=t[7],u(c,"class","svelte-19nn0vk"),Re(c,"colorErr",t[8]),Re(c,"colorWarn",t[9]),u(n,"class","svelte-19nn0vk"),u(h,"class","svelte-19nn0vk"),w.__value="allsvg",_e(w,w.__value),T.__value="alldxf",_e(T,T.__value),O.__value="pax",_e(O,O.__value),E.__value="oscad",_e(E,E.__value),M.__value="ojscad",_e(M,M.__value),H.__value="zip",_e(H,H.__value),u(k,"class","svelte-19nn0vk"),t[4]===void 0&&ut(()=>t[15].call(k)),u(K,"class","svelte-19nn0vk"),u(m,"class","svelte-19nn0vk")},m(U,G){we(e,U,G),te(U,l,G),te(U,n,G),r(n,o),r(n,a),r(n,c),te(U,f,G),we(i,U,G),te(U,N,G),te(U,m,G),r(m,h),r(m,C),r(m,k);for(let x=0;x<oe.length;x+=1)oe[x]&&oe[x].m(k,null);r(k,w);for(let x=0;x<V.length;x+=1)V[x]&&V[x].m(k,null);r(k,T),r(k,O),r(k,E),r(k,M),r(k,H),et(k,t[4],!0),r(m,F),r(m,K),r(m,se),we($,m,null),le=!0,W||(he=[X(k,"change",t[15]),X(K,"click",t[12])],W=!0)},p(U,[G]){const x={};G&1&&(x.pDef=U[0]),G&2&&(x.fgeom=U[1]),G&32&&(x.selFace=U[5]),G&64&&(x.simTime=U[6]),e.$set(x),(!le||G&128)&&(c.value=U[7]),(!le||G&256)&&Re(c,"colorErr",U[8]),(!le||G&512)&&Re(c,"colorWarn",U[9]);const ie={};if(G&1&&(ie.pDef=U[0]),G&2&&(ie.fgeom=U[1]),G&8&&(ie.optFaces=U[3]),!d&&G&32&&(d=!0,ie.selFace=U[5],Pe(()=>d=!1)),!p&&G&64&&(p=!0,ie.simTime=U[6],Pe(()=>p=!1)),i.$set(ie),G&8){ce=Ce(U[3]);let Z;for(Z=0;Z<ce.length;Z+=1){const ke=xt(U,ce,Z);oe[Z]?oe[Z].p(ke,G):(oe[Z]=el(ke),oe[Z].c(),oe[Z].m(k,w))}for(;Z<oe.length;Z+=1)oe[Z].d(1);oe.length=ce.length}if(G&8){ae=Ce(U[3]);let Z;for(Z=0;Z<ae.length;Z+=1){const ke=$t(U,ae,Z);V[Z]?V[Z].p(ke,G):(V[Z]=tl(ke),V[Z].c(),V[Z].m(k,T))}for(;Z<V.length;Z+=1)V[Z].d(1);V.length=ae.length}G&24&&et(k,U[4]);const ee={};G&1024&&(ee.subD=U[10]),G&1&&(ee.origPartName=U[0].partName),G&4&&(ee.pLink=U[2]),$.$set(ee)},i(U){le||(ge(e.$$.fragment,U),ge(i.$$.fragment,U),ge($.$$.fragment,U),le=!0)},o(U){ve(e.$$.fragment,U),ve(i.$$.fragment,U),ve($.$$.fragment,U),le=!1},d(U){U&&(b(l),b(n),b(f),b(N),b(m)),Oe(e,U),Oe(i,U),Ke(oe,U),Ke(V,U),Oe($),W=!1,He(he)}}}function Yn(t){let e=!0;const l=/warn/i;return t.search(l)<0&&(e=!1),e}function Wn(t,e){const l=document.createElement("a"),n=URL.createObjectURL(e);l.setAttribute("href",n),l.setAttribute("download",t),l.click(),l.remove(),URL.revokeObjectURL(n)}function Gn(t,e,l){const n=document.createElement("a"),o="data:"+l+";utf-8,"+encodeURIComponent(e);n.setAttribute("href",o),n.setAttribute("download",t),n.click(),n.remove()}function Zn(){const t=/[-:]/g,e=/\..*$/;return new Date().toISOString().replace(t,"").replace(e,"").replace("T","_")}function Jn(t,e,l){let n;xe(t,Ve,O=>l(16,n=O));let{pDef:o}=e,{fgeom:s}=e,{pLink:a}=e,c=[],f,i,d=0,p=`Dummy initial
|
|
15
|
-
Will be replaced during onMount
|
|
16
|
-
`,N=!1,m=!1,h={};function _(O){l(7,p=`Geometry ${O} computed at ${new Date().toLocaleTimeString()}
|
|
17
|
-
`);const E=s(d,n[o.partName]);l(7,p+=E.logstr),l(8,N=E.calcErr),l(9,m=Yn(E.logstr)),l(3,c=Object.keys(E.fig)),l(4,f="zip"),l(10,h=E.sub)}function C(){_(o.partName)}async function k(O){const A=/^svg_/,E=/^dxf_/;let L=Ge.eSVG,M="all";O.match(A)?(L=Ge.eSVG,M=O.replace(A,"")):O.match(E)?(L=Ge.eDXF,M=O.replace(E,"")):O==="allsvg"?L=Ge.eSVGALL:O==="alldxf"?L=Ge.eDXFALL:O==="pax"?L=Ge.ePAX:O==="oscad"?L=Ge.eOPENSCAD:O==="ojscad"?L=Ge.eJSCAD:O==="zip"?L=Ge.eZIP:console.log(`err883: downloadExport iExportFace ${O} invalid`);const q=Al(L),H=Bl(L),R=zl(L),F=o.partName+"_"+M+"_"+Zn()+q;if(R){const K=await Ml(s,d,n[o.partName],L);Wn(F,K)}else{const K=Fl(s,n[o.partName],M,L);Gn(F,K,H)}}async function w(){await k(f)}function D(O){i=O,l(5,i)}function T(O){d=O,l(6,d)}function y(){f=_t(this),l(4,f),l(3,c)}return t.$$set=O=>{"pDef"in O&&l(0,o=O.pDef),"fgeom"in O&&l(1,s=O.fgeom),"pLink"in O&&l(2,a=O.pLink)},t.$$.update=()=>{t.$$.dirty&1&&_(o.partName)},[o,s,a,c,f,i,d,p,N,m,h,C,w,D,T,y]}class Qn extends ye{constructor(e){super(),Me(this,e,Jn,Xn,Ue,{pDef:0,fgeom:1,pLink:2})}}function $n(t){let e,l=t[0].pTitle+"",n,o,s,a=t[0].pDescription+"",c,f,i,d,p,N;return i=new Zl({props:{pDef:t[0].pDef}}),p=new Qn({props:{pDef:t[0].pDef,fgeom:t[0].pGeom,pLink:t[1]}}),{c(){e=g("h1"),n=J(l),o=I(),s=g("article"),c=J(a),f=I(),Ne(i.$$.fragment),d=I(),Ne(p.$$.fragment),this.h()},l(m){e=v(m,"H1",{class:!0});var h=S(e);n=Q(h,l),h.forEach(b),o=P(m),s=v(m,"ARTICLE",{class:!0});var _=S(s);c=Q(_,a),_.forEach(b),f=P(m),Te(i.$$.fragment,m),d=P(m),Te(p.$$.fragment,m),this.h()},h(){u(e,"class","svelte-1aya6oa"),u(s,"class","svelte-1aya6oa")},m(m,h){te(m,e,h),r(e,n),te(m,o,h),te(m,s,h),r(s,c),te(m,f,h),we(i,m,h),te(m,d,h),we(p,m,h),N=!0},p(m,[h]){(!N||h&1)&&l!==(l=m[0].pTitle+"")&&de(n,l),(!N||h&1)&&a!==(a=m[0].pDescription+"")&&de(c,a);const _={};h&1&&(_.pDef=m[0].pDef),i.$set(_);const C={};h&1&&(C.pDef=m[0].pDef),h&1&&(C.fgeom=m[0].pGeom),h&2&&(C.pLink=m[1]),p.$set(C)},i(m){N||(ge(i.$$.fragment,m),ge(p.$$.fragment,m),N=!0)},o(m){ve(i.$$.fragment,m),ve(p.$$.fragment,m),N=!1},d(m){m&&(b(e),b(o),b(s),b(f),b(d)),Oe(i,m),Oe(p,m)}}}function xn(t,e,l){let{pageDef:n}=e,{pLink:o}=e;return t.$$set=s=>{"pageDef"in s&&l(0,n=s.pageDef),"pLink"in s&&l(1,o=s.pLink)},t.$$.update=()=>{t.$$.dirty&1&&Vl(n)},[n,o]}class es extends ye{constructor(e){super(),Me(this,e,xn,$n,Ue,{pageDef:0,pLink:1})}}function ts(t){let e,l;return e=new es({props:{pageDef:t[0].pageDef,pLink:t[0].allLink}}),{c(){Ne(e.$$.fragment)},l(n){Te(e.$$.fragment,n)},m(n,o){we(e,n,o),l=!0},p(n,[o]){const s={};o&1&&(s.pageDef=n[0].pageDef),o&1&&(s.pLink=n[0].allLink),e.$set(s)},i(n){l||(ge(e.$$.fragment,n),l=!0)},o(n){ve(e.$$.fragment,n),l=!1},d(n){Oe(e,n)}}}function ls(t,e,l){let{data:n}=e;return t.$$set=o=>{"data"in o&&l(0,n=o.data)},[n]}class us extends ye{constructor(e){super(),Me(this,e,ls,ts,Ue,{data:0})}}export{us as component,fs as universal};
|