desi77 0.1.23 → 0.1.24

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/index.js CHANGED
@@ -8055,28 +8055,766 @@ var tunnelDef = {
8055
8055
  pGeom: pGeom22
8056
8056
  };
8057
8057
 
8058
- // src/sysmix/square.ts
8058
+ // src/capsule/bridge.ts
8059
8059
  import {
8060
8060
  contour as contour23,
8061
- contourCircle as contourCircle20,
8062
8061
  ctrRectangle as ctrRectangle12,
8063
8062
  figure as figure20,
8064
8063
  ffix as ffix24,
8065
8064
  pNumber as pNumber23,
8065
+ pDropdown as pDropdown10,
8066
8066
  pSectionSeparator as pSectionSeparator23,
8067
8067
  EExtrude as EExtrude19,
8068
8068
  EBVolume as EBVolume19,
8069
8069
  initGeom as initGeom23
8070
8070
  } from "geometrix";
8071
8071
  var pDef23 = {
8072
+ partName: "bridge",
8073
+ params: [
8074
+ //pNumber(name, unit, init, min, max, step)
8075
+ pNumber23("N1", "arc", 9, 1, 100, 1),
8076
+ pNumber23("W1", "m", 20, 1, 100, 0.1),
8077
+ pNumber23("W2", "m", 2, 1, 100, 0.1),
8078
+ pNumber23("H1", "m", 2, 1, 100, 0.1),
8079
+ pNumber23("H2", "m", 30, 1, 100, 0.1),
8080
+ pDropdown10("arcStyle", ["gothic", "half-circle", "rectangular"]),
8081
+ pNumber23("Ea", "m", 10, 1, 100, 0.1),
8082
+ pSectionSeparator23("Transversal"),
8083
+ pNumber23("W3", "m", 10, 1, 100, 1),
8084
+ pNumber23("W4", "m", 18, 1, 100, 1),
8085
+ pNumber23("H3", "m", 5, 1, 500, 1),
8086
+ pNumber23("H4", "m", 20, 1, 500, 1),
8087
+ pDropdown10("sideStyle", ["straight", "arc"]),
8088
+ pSectionSeparator23("Valley extremity"),
8089
+ pNumber23("Ix1", "m", 5, 0, 50, 0.1),
8090
+ pNumber23("Ih11", "m", 2, 1, 50, 1),
8091
+ pNumber23("Ih12", "m", 2, 1, 50, 1),
8092
+ pNumber23("Ix2", "m", 5, 0, 50, 0.1),
8093
+ pNumber23("Ih21", "m", 2, 1, 50, 1),
8094
+ pNumber23("Ih22", "m", 2, 1, 50, 1),
8095
+ pSectionSeparator23("Valley"),
8096
+ pNumber23("p1x", "%", 20, 1, 99, 1),
8097
+ pNumber23("p1y", "m", -24, -300, 10, 1),
8098
+ pNumber23("p2x", "%", 40, 1, 99, 1),
8099
+ pNumber23("p2y", "m", -18, -300, 10, 1),
8100
+ pNumber23("p3x", "%", 60, 1, 99, 1),
8101
+ pNumber23("p3y", "m", -31, -300, 10, 1),
8102
+ pNumber23("p4x", "%", 80, 1, 99, 1),
8103
+ pNumber23("p4y", "m", -25, -300, 10, 1)
8104
+ ],
8105
+ paramSvg: {
8106
+ N1: "bridge_panorama.svg",
8107
+ W1: "bridge_panorama.svg",
8108
+ W2: "bridge_panorama.svg",
8109
+ H1: "bridge_panorama.svg",
8110
+ H2: "bridge_panorama.svg",
8111
+ arcStyle: "bridge_arc.svg",
8112
+ Ea: "bridge_column.svg",
8113
+ W3: "bridge_column.svg",
8114
+ W4: "bridge_column.svg",
8115
+ H3: "bridge_column.svg",
8116
+ H4: "bridge_column.svg",
8117
+ sideStyle: "bridge_column.svg",
8118
+ Ix1: "bridge_panorama.svg",
8119
+ Ih11: "bridge_panorama.svg",
8120
+ Ih12: "bridge_panorama.svg",
8121
+ Ix2: "bridge_panorama.svg",
8122
+ Ih21: "bridge_panorama.svg",
8123
+ Ih22: "bridge_panorama.svg",
8124
+ p1x: "bridge_panorama.svg",
8125
+ p1y: "bridge_panorama.svg",
8126
+ p2x: "bridge_panorama.svg",
8127
+ p2y: "bridge_panorama.svg",
8128
+ p3x: "bridge_panorama.svg",
8129
+ p3y: "bridge_panorama.svg",
8130
+ p4x: "bridge_panorama.svg",
8131
+ p4y: "bridge_panorama.svg"
8132
+ },
8133
+ sim: {
8134
+ tMax: 180,
8135
+ tStep: 0.5,
8136
+ tUpdate: 500
8137
+ // every 0.5 second
8138
+ }
8139
+ };
8140
+ function pGeom23(t, param, suffix = "") {
8141
+ const rGeome = initGeom23(pDef23.partName + suffix);
8142
+ const figArcade = figure20();
8143
+ const figColumn = figure20();
8144
+ const figValley = figure20();
8145
+ rGeome.logstr += `${rGeome.partName} simTime: ${t}
8146
+ `;
8147
+ try {
8148
+ const pi2 = Math.PI / 2;
8149
+ const W12 = param.W1 / 2;
8150
+ const W22 = param.W2 / 2;
8151
+ const W32 = param.W3 / 2;
8152
+ const W42 = param.W4 / 2;
8153
+ const Hg = W12 + param.Ea;
8154
+ const H12 = param.H1 + param.H2;
8155
+ const La = param.W2 + param.N1 * (param.W1 + param.W2);
8156
+ const Lb = La - param.Ix1 - param.Ix2;
8157
+ const H34 = H12 - param.H3 - param.H4;
8158
+ const vxp = [param.p1x, param.p2x, param.p3x, param.p4x];
8159
+ const vx = vxp.map((xp) => param.Ix1 + Lb * xp / 100);
8160
+ const vy = [param.p1y, param.p2y, param.p3y, param.p4y];
8161
+ if (param.H2 < W12 && param.arcStyle === 1) {
8162
+ throw `err116: H2 ${param.H2} is too small compare to W1 ${param.W1} m`;
8163
+ }
8164
+ if (param.H2 < Hg && param.arcStyle === 0) {
8165
+ throw `err125: H2 ${param.H2} is too small compare to W1 ${param.W1} and Ea ${param.Ea} m`;
8166
+ }
8167
+ if (param.W4 < param.W3) {
8168
+ throw `err129: W4 ${param.W4} is too small compare to W3 ${param.W3} m`;
8169
+ }
8170
+ if (H34 < 0) {
8171
+ throw `err133: H2 ${param.H2} is too small compare to H3 ${param.H3} or H4 ${param.H4} m`;
8172
+ }
8173
+ if (Lb < 0) {
8174
+ throw `err139: N1 ${param.N1} is too small compare to Ix1 ${param.Ix1} or Ix2 ${param.Ix2} m`;
8175
+ }
8176
+ for (let ii = 0; ii < vx.length - 1; ii++) {
8177
+ if (vx[ii + 1] < vx[ii]) {
8178
+ throw `err145: vx${ii + 1} ${vx[ii + 1]} is smaller than vx${ii} ${vx[ii]} m`;
8179
+ }
8180
+ }
8181
+ rGeome.logstr += `Bridge length: ${ffix24(Lb)} m
8182
+ `;
8183
+ const ctrArcade = contour23(0, 0).addSegStrokeR(0, -H12).addSegStrokeR(param.W2, 0);
8184
+ for (let ii = 0; ii < param.N1; ii++) {
8185
+ switch (param.arcStyle) {
8186
+ case 1:
8187
+ ctrArcade.addSegStrokeR(0, param.H2 - W12).addPointR(W12, W12).addPointR(2 * W12, 0).addSegArc2().addSegStrokeR(0, -param.H2 + W12).addSegStrokeR(param.W2, 0);
8188
+ figColumn.addSecond(ctrRectangle12(-W32, -param.H1 - W12, 2 * W32, W12));
8189
+ break;
8190
+ case 0:
8191
+ ctrArcade.addSegStrokeR(0, param.H2 - Hg).addPointR(W12, Hg).addSegArc3(pi2, true).addPointR(W12, -Hg).addSegArc3(pi2, false).addSegStrokeR(0, -param.H2 + Hg).addSegStrokeR(param.W2, 0);
8192
+ figColumn.addSecond(ctrRectangle12(-W32, -param.H1 - Hg, 2 * W32, Hg));
8193
+ break;
8194
+ default:
8195
+ ctrArcade.addSegStrokeR(0, param.H2).addSegStrokeR(param.W1, 0).addSegStrokeR(0, -param.H2).addSegStrokeR(param.W2, 0);
8196
+ figColumn.addSecond(ctrRectangle12(-W32, -param.H1, 2 * W32, param.H1));
8197
+ }
8198
+ }
8199
+ ctrArcade.addSegStrokeR(0, H12).closeSegStroke();
8200
+ figArcade.addMainO(ctrArcade);
8201
+ for (let ii = 0; ii < param.N1 + 1; ii++) {
8202
+ const px = ii * (param.W2 + param.W1);
8203
+ figArcade.addSecond(ctrRectangle12(px, -param.H3 - H34, param.W2, H34));
8204
+ figArcade.addSecond(ctrRectangle12(px, -H12, param.W2, param.H4));
8205
+ }
8206
+ const ctrColumn = contour23(-W42, -H12).addSegStrokeR(2 * W42, 0).addSegStrokeR(0, param.H4);
8207
+ if (param.sideStyle === 1) {
8208
+ ctrColumn.addPointR(-W42 + W32, H34).addSegArc3(-pi2, false);
8209
+ } else {
8210
+ ctrColumn.addSegStrokeR(-W42 + W32, H34);
8211
+ }
8212
+ ctrColumn.addSegStrokeR(0, param.H3).addSegStrokeR(-param.W3, 0).addSegStrokeR(0, -param.H3);
8213
+ if (param.sideStyle === 1) {
8214
+ ctrColumn.addPointR(W32 - W42, -H34).addSegArc3(-pi2, true);
8215
+ } else {
8216
+ ctrColumn.addSegStrokeR(W32 - W42, -H34);
8217
+ }
8218
+ ctrColumn.closeSegStroke();
8219
+ figColumn.addMainO(ctrColumn);
8220
+ const ctrValley = contour23(-2 * W22, param.Ih11).addSegStrokeR(2 * W22 + param.Ix1, 0).addSegStrokeR(0, -param.Ih11 - param.Ih12);
8221
+ for (let ii = 0; ii < vx.length; ii++) {
8222
+ ctrValley.addSegStrokeA(vx[ii], vy[ii]);
8223
+ }
8224
+ ctrValley.addSegStrokeA(La - param.Ix2, -param.Ih22).addSegStrokeR(0, param.Ih21 + param.Ih22).addSegStrokeR(2 * W22 + param.Ix2, 0).addSegStrokeR(0, -param.Ih21 - H12 - param.H1).addSegStrokeR(-La - 4 * W22, 0).closeSegStroke();
8225
+ figValley.addMainO(ctrValley);
8226
+ figValley.addSecond(ctrArcade);
8227
+ figArcade.addSecond(ctrValley);
8228
+ rGeome.fig = {
8229
+ faceArcade: figArcade,
8230
+ faceColumn: figColumn,
8231
+ faceValley: figValley
8232
+ };
8233
+ const designName = rGeome.partName;
8234
+ const volColumn = [];
8235
+ const volColumnN = [];
8236
+ for (let ii = 0; ii < param.N1 + 1; ii++) {
8237
+ const px = ii * (param.W2 + param.W1);
8238
+ const iVolN = `subpax_${designName}_col${String(ii).padStart(3, "0")}`;
8239
+ const iVol = {
8240
+ outName: iVolN,
8241
+ face: `${designName}_faceColumn`,
8242
+ extrudeMethod: EExtrude19.eLinearOrtho,
8243
+ length: 2 * W22,
8244
+ rotate: [0, pi2, 0],
8245
+ translate: [px, 0, 0]
8246
+ };
8247
+ volColumn.push(iVol);
8248
+ volColumnN.push(iVolN);
8249
+ }
8250
+ rGeome.vol = {
8251
+ extrudes: [
8252
+ {
8253
+ outName: `subpax_${designName}_arcade`,
8254
+ face: `${designName}_faceArcade`,
8255
+ extrudeMethod: EExtrude19.eLinearOrtho,
8256
+ length: 2 * W32,
8257
+ rotate: [0, 0, 0],
8258
+ translate: [0, 0, -W32]
8259
+ },
8260
+ ...volColumn,
8261
+ {
8262
+ outName: `subpax_${designName}_valley`,
8263
+ face: `${designName}_faceValley`,
8264
+ extrudeMethod: EExtrude19.eLinearOrtho,
8265
+ length: 4 * W42,
8266
+ rotate: [0, 0, 0],
8267
+ translate: [0, 0, -2 * W42]
8268
+ }
8269
+ ],
8270
+ volumes: [
8271
+ {
8272
+ outName: `pax_${designName}`,
8273
+ boolMethod: EBVolume19.eUnion,
8274
+ inList: [
8275
+ `subpax_${designName}_arcade`,
8276
+ ...volColumnN,
8277
+ `subpax_${designName}_valley`
8278
+ ]
8279
+ }
8280
+ ]
8281
+ };
8282
+ rGeome.sub = {};
8283
+ rGeome.logstr += "bridge drawn successfully!\n";
8284
+ rGeome.calcErr = false;
8285
+ } catch (emsg) {
8286
+ rGeome.logstr += emsg;
8287
+ console.log(emsg);
8288
+ }
8289
+ return rGeome;
8290
+ }
8291
+ var bridgeDef = {
8292
+ pTitle: "bridge",
8293
+ pDescription: "bridge for the train-capsule",
8294
+ pDef: pDef23,
8295
+ pGeom: pGeom23
8296
+ };
8297
+
8298
+ // src/capsule/trackXY.ts
8299
+ import {
8300
+ ShapePoint as ShapePoint3,
8301
+ point as point13,
8302
+ contour as contour24,
8303
+ ctrRectangle as ctrRectangle13,
8304
+ figure as figure21,
8305
+ degToRad as degToRad11,
8306
+ radToDeg as radToDeg12,
8307
+ ffix as ffix25,
8308
+ pNumber as pNumber24,
8309
+ pSectionSeparator as pSectionSeparator24,
8310
+ EExtrude as EExtrude20,
8311
+ EBVolume as EBVolume20,
8312
+ initGeom as initGeom24
8313
+ } from "geometrix";
8314
+ import { triLALrL as triLALrL3 } from "triangule";
8315
+ var pDef24 = {
8316
+ partName: "trackXY",
8317
+ params: [
8318
+ //pNumber(name, unit, init, min, max, step)
8319
+ pNumber24("W1", "mm", 1e3, 10, 2e3, 1),
8320
+ pNumber24("T1", "mm", 80, 1, 200, 1),
8321
+ pNumber24("S1", "mm", 200, 1, 500, 1),
8322
+ pNumber24("B1", "mm", 200, 2, 500, 1),
8323
+ pNumber24("B2", "mm", 300, 2, 1e3, 1),
8324
+ pNumber24("H1", "mm", 100, 1, 500, 1),
8325
+ pNumber24("H2", "mm", 200, 1, 500, 1),
8326
+ pSectionSeparator24("Track"),
8327
+ pNumber24("a0", "degree", 30, -180, 180, 1),
8328
+ pNumber24("a1", "degree", -120, -180, 180, 1),
8329
+ pNumber24("a2", "degree", 70, -180, 180, 1),
8330
+ pNumber24("L1", "m", 30, 0.01, 200, 0.01),
8331
+ pNumber24("L2", "m", 1, 0.01, 200, 0.01),
8332
+ pNumber24("L3", "m", 20, 0.01, 200, 0.01),
8333
+ pNumber24("r1", "m", 10, 0.01, 200, 0.01),
8334
+ pNumber24("r2", "m", 20, 0.01, 200, 0.01)
8335
+ ],
8336
+ paramSvg: {
8337
+ W1: "trackXY_section.svg",
8338
+ T1: "trackXY_section.svg",
8339
+ S1: "trackXY_top.svg",
8340
+ B1: "trackXY_top.svg",
8341
+ B2: "trackXY_top.svg",
8342
+ H1: "trackXY_side.svg",
8343
+ H2: "trackXY_side.svg",
8344
+ a0: "trackXY_midLine.svg",
8345
+ a1: "trackXY_midLine.svg",
8346
+ a2: "trackXY_midLine.svg",
8347
+ L1: "trackXY_midLine.svg",
8348
+ L2: "trackXY_midLine.svg",
8349
+ L3: "trackXY_midLine.svg",
8350
+ r1: "trackXY_midLine.svg",
8351
+ r2: "trackXY_midLine.svg"
8352
+ },
8353
+ sim: {
8354
+ tMax: 180,
8355
+ tStep: 0.5,
8356
+ tUpdate: 500
8357
+ // every 0.5 second
8358
+ }
8359
+ };
8360
+ function pGeom24(t, param, suffix = "") {
8361
+ const rGeome = initGeom24(pDef24.partName + suffix);
8362
+ const figTop1 = figure21();
8363
+ const figTop2 = figure21();
8364
+ const figSection = figure21();
8365
+ const figSide = figure21();
8366
+ rGeome.logstr += `${rGeome.partName} simTime: ${t}
8367
+ `;
8368
+ try {
8369
+ let ctrBeam2 = function(iX, iY, iA) {
8370
+ const ctr1 = ctrRectangle13(iX - Wbeam2, iY - Lbeam2, 2 * Wbeam2, 2 * Lbeam2);
8371
+ const rCtr = ctr1.rotate(iX, iY, iA);
8372
+ return rCtr;
8373
+ }, ctrRail2 = function(iW12, iT1, iSign) {
8374
+ const aR0 = A0 + iSign * pi2;
8375
+ const aR10 = A0 - Math.sign(A1) * pi2;
8376
+ const aR11 = A0 - Math.sign(A1) * pi2 + A1 / 2;
8377
+ const aR12 = A0 - Math.sign(A1) * pi2 + A1;
8378
+ const aR20 = A1b - Math.sign(A2) * pi2;
8379
+ const aR21 = A1b - Math.sign(A2) * pi2 + A2 / 2;
8380
+ const aR22 = A1b - Math.sign(A2) * pi2 + A2;
8381
+ const sR11 = iSign * Math.sign(A1) * iW12;
8382
+ const sR12 = iSign * Math.sign(A1) * (iW12 + iT1);
8383
+ const sR21 = iSign * Math.sign(A2) * iW12;
8384
+ const sR22 = iSign * Math.sign(A2) * (iW12 + iT1);
8385
+ const pR11 = point13(0, 0).translatePolar(aR0, iW12);
8386
+ const pR12 = pt1c.translatePolar(aR11, param.r1 - sR12);
8387
+ const pR13 = pt1c.translatePolar(aR12, param.r1 - sR12);
8388
+ const pR14 = pt2c.translatePolar(aR21, param.r2 - sR22);
8389
+ const pR15 = pt2c.translatePolar(aR22, param.r2 - sR22);
8390
+ const pR16 = pt2c.translatePolar(aR21, param.r2 - sR21);
8391
+ const pR17 = pt2c.translatePolar(aR20, param.r2 - sR21);
8392
+ const pR18 = pt1c.translatePolar(aR11, param.r1 - sR11);
8393
+ const pR19 = pt1c.translatePolar(aR10, param.r1 - sR11);
8394
+ const rCtr = contour24(pR11.cx, pR11.cy).addSegStrokeRP(aR0, iT1).addSegStrokeRP(A0, param.L1).addPointA(pR12.cx, pR12.cy).addPointA(pR13.cx, pR13.cy).addSegArc2().addSegStrokeRP(A1b, param.L2).addPointA(pR14.cx, pR14.cy).addPointA(pR15.cx, pR15.cy).addSegArc2().addSegStrokeRP(A2b, param.L3).addSegStrokeRP(A2b + pi2, iT1).addSegStrokeRP(A2b + Math.PI, param.L3).addPointA(pR16.cx, pR16.cy).addPointA(pR17.cx, pR17.cy).addSegArc2().addSegStrokeRP(A1b + Math.PI, param.L2).addPointA(pR18.cx, pR18.cy).addPointA(pR19.cx, pR18.cy).addSegArc2().closeSegStroke();
8395
+ return rCtr;
8396
+ };
8397
+ var ctrBeam = ctrBeam2, ctrRail = ctrRail2;
8398
+ const pi2 = Math.PI / 2;
8399
+ const A0 = degToRad11(param.a0);
8400
+ const A1 = degToRad11(param.a1);
8401
+ const A2 = degToRad11(param.a2);
8402
+ const Lr1 = Math.abs(A1) * param.r1;
8403
+ const Lr2 = Math.abs(A2) * param.r2;
8404
+ const Ltot = param.L1 + Lr1 + param.L2 + Lr2 + param.L3;
8405
+ const A1b = A0 + A1;
8406
+ const A2b = A1b + A2;
8407
+ const [Lr1c, logTri1] = triLALrL3(param.r1, A1, param.r1);
8408
+ const [Lr2c, logTri2] = triLALrL3(param.r2, A2, param.r2);
8409
+ rGeome.logstr += logTri1 + logTri2;
8410
+ const aLr1c = A1 / 2;
8411
+ const aLr2c = A2 / 2;
8412
+ const H1 = param.H1 / 1e3;
8413
+ const H2 = param.H2 / 1e3;
8414
+ const W12 = param.W1 / 2e3;
8415
+ const T1 = param.T1 / 1e3;
8416
+ const S1 = param.S1 / 1e3;
8417
+ const Wbeam2 = param.B1 / 2e3;
8418
+ const Lbeam2 = W12 + T1 + S1;
8419
+ const Bstep = (param.B1 + param.B2) / 1e3;
8420
+ const Nb1 = Math.floor(param.L1 / Bstep);
8421
+ const Rb1 = param.L1 - Nb1 * Bstep;
8422
+ const Nb1c = Math.floor((Rb1 + Lr1) / Bstep);
8423
+ const Rb1c = Rb1 + Lr1 - Nb1c * Bstep;
8424
+ const a1c = Math.sign(A1) * Bstep / param.r1;
8425
+ const a1ci = Math.sign(A1) * Rb1 / param.r1;
8426
+ const Nb2 = Math.floor((Rb1c + param.L2) / Bstep);
8427
+ const Rb2 = Rb1c + param.L2 - Nb2 * Bstep;
8428
+ const Nb2c = Math.floor((Rb2 + Lr2) / Bstep);
8429
+ const Rb2c = Rb2 + Lr2 - Nb2c * Bstep;
8430
+ const a2c = Math.sign(A2) * Bstep / param.r2;
8431
+ const a2ci = Math.sign(A2) * Rb2 / param.r2;
8432
+ const Nb3 = Math.floor((Rb2c + param.L3) / Bstep);
8433
+ const Nbeam1 = 1 + Math.floor(Ltot / Bstep);
8434
+ const Nbeam2 = 1 + Nb1 + Nb1c + Nb2 + Nb2c + Nb3;
8435
+ if (Math.abs(param.a1) < 0.5) {
8436
+ throw `err102: a1 ${param.a1} degree is too closed to zero`;
8437
+ }
8438
+ if (Math.abs(param.a2) < 0.5) {
8439
+ throw `err112: a2 ${param.a2} degree is too closed to zero`;
8440
+ }
8441
+ rGeome.logstr += `Track-XY length: ${ffix25(Ltot)} m
8442
+ `;
8443
+ rGeome.logstr += `Beam number: ${Nbeam1} ${Nbeam2}, size: ${ffix25(2 * Lbeam2)} x ${ffix25(2 * Wbeam2)} m
8444
+ `;
8445
+ rGeome.logstr += `Final orientation: ${ffix25(radToDeg12(A2b))} degree
8446
+ `;
8447
+ const ctrMidLine = contour24(0, 0).addSegStrokeRP(A0, param.L1).addPointRP(A0 + aLr1c, Lr1c).addSegArc3(A0, true).addSegStrokeRP(A1b, param.L2).addPointRP(A1b + aLr2c, Lr2c).addSegArc3(A1b, true).addSegStrokeRP(A2b, param.L3);
8448
+ figTop1.addSecond(ctrMidLine);
8449
+ const pt0 = point13(0, 0);
8450
+ figTop1.addMainO(ctrBeam2(pt0.cx, pt0.cy, A0));
8451
+ for (let ii = 0; ii < Nb1; ii++) {
8452
+ const pt = pt0.translatePolar(A0, (ii + 1) * Bstep);
8453
+ figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, A0));
8454
+ }
8455
+ const pt1b = pt0.translatePolar(A0, param.L1);
8456
+ const pt1c = pt1b.translatePolar(A0 + Math.sign(A1) * pi2, param.r1);
8457
+ for (let ii = 0; ii < Nb1c; ii++) {
8458
+ const ia = A0 - Math.sign(A1) * pi2 - a1ci + (ii + 1) * a1c;
8459
+ const pt = pt1c.translatePolar(ia, param.r1);
8460
+ figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, ia - pi2));
8461
+ }
8462
+ const pt1e = pt1b.translatePolar(A0 + aLr1c, Lr1c);
8463
+ for (let ii = 0; ii < Nb2; ii++) {
8464
+ const pt = pt1e.translatePolar(A1b, (ii + 1) * Bstep - Rb1c);
8465
+ figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, A1b));
8466
+ }
8467
+ const pt2b = pt1e.translatePolar(A1b, param.L2);
8468
+ const pt2c = pt2b.translatePolar(A1b + Math.sign(A2) * pi2, param.r2);
8469
+ for (let ii = 0; ii < Nb2c; ii++) {
8470
+ const ia = A1b - Math.sign(A2) * pi2 - a2ci + (ii + 1) * a2c;
8471
+ const pt = pt2c.translatePolar(ia, param.r2);
8472
+ figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, ia - pi2));
8473
+ }
8474
+ const pt2e = pt2b.translatePolar(A1b + aLr2c, Lr2c);
8475
+ for (let ii = 0; ii < Nb3; ii++) {
8476
+ const pt = pt2e.translatePolar(A2b, (ii + 1) * Bstep - Rb2c);
8477
+ figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, A2b));
8478
+ }
8479
+ figTop1.addPoint(point13(pt1c.cx, pt1c.cy, ShapePoint3.eTri2));
8480
+ figTop1.addPoint(point13(pt2c.cx, pt2c.cy, ShapePoint3.eTri2));
8481
+ figTop2.mergeFigure(figTop1, true);
8482
+ const ctrRail1 = ctrRail2(W12, T1, -1);
8483
+ const ctrRail22 = ctrRail2(W12, T1, 1);
8484
+ figTop2.addMainO(ctrRail1);
8485
+ figTop2.addMainO(ctrRail22);
8486
+ figTop1.addSecond(ctrRail1);
8487
+ figTop1.addSecond(ctrRail22);
8488
+ figSection.addSecond(ctrRectangle13(-Lbeam2, 0, 2 * Lbeam2, H1));
8489
+ figSection.addMainO(ctrRectangle13(-Lbeam2 + S1, H1, T1, H2));
8490
+ figSection.addMainO(ctrRectangle13(W12, H1, T1, H2));
8491
+ for (let ii = 0; ii < 11; ii++) {
8492
+ figSide.addSecond(ctrRectangle13(ii * Bstep, 0, 2 * Wbeam2, H1));
8493
+ }
8494
+ figSide.addMainO(ctrRectangle13(0, H1, 2 * Wbeam2 + 10 * Bstep, H2));
8495
+ rGeome.fig = {
8496
+ faceTop1: figTop1,
8497
+ faceTop2: figTop2,
8498
+ faceSide: figSide,
8499
+ faceSection: figSection
8500
+ };
8501
+ const designName = rGeome.partName;
8502
+ rGeome.vol = {
8503
+ extrudes: [
8504
+ {
8505
+ outName: `subpax_${designName}_beam`,
8506
+ face: `${designName}_faceTop1`,
8507
+ extrudeMethod: EExtrude20.eLinearOrtho,
8508
+ length: H1,
8509
+ rotate: [0, 0, 0],
8510
+ translate: [0, 0, 0]
8511
+ },
8512
+ {
8513
+ outName: `subpax_${designName}_rail`,
8514
+ face: `${designName}_faceTop2`,
8515
+ extrudeMethod: EExtrude20.eLinearOrtho,
8516
+ length: H2,
8517
+ rotate: [0, 0, 0],
8518
+ translate: [0, 0, H1]
8519
+ }
8520
+ ],
8521
+ volumes: [
8522
+ {
8523
+ outName: `pax_${designName}`,
8524
+ boolMethod: EBVolume20.eUnion,
8525
+ inList: [`subpax_${designName}_beam`, `subpax_${designName}_rail`]
8526
+ }
8527
+ ]
8528
+ };
8529
+ rGeome.sub = {};
8530
+ rGeome.logstr += "trackXY drawn successfully!\n";
8531
+ rGeome.calcErr = false;
8532
+ } catch (emsg) {
8533
+ rGeome.logstr += emsg;
8534
+ console.log(emsg);
8535
+ }
8536
+ return rGeome;
8537
+ }
8538
+ var trackXYDef = {
8539
+ pTitle: "trackXY",
8540
+ pDescription: "simulation of train-capsule on XY-track",
8541
+ pDef: pDef24,
8542
+ pGeom: pGeom24
8543
+ };
8544
+
8545
+ // src/capsule/trackXZ.ts
8546
+ import {
8547
+ point as point14,
8548
+ contour as contour25,
8549
+ ctrRectangle as ctrRectangle14,
8550
+ figure as figure22,
8551
+ degToRad as degToRad12,
8552
+ radToDeg as radToDeg13,
8553
+ ffix as ffix26,
8554
+ pNumber as pNumber25,
8555
+ pSectionSeparator as pSectionSeparator25,
8556
+ EExtrude as EExtrude21,
8557
+ EBVolume as EBVolume21,
8558
+ initGeom as initGeom25
8559
+ } from "geometrix";
8560
+ var pDef25 = {
8561
+ partName: "trackXZ",
8562
+ params: [
8563
+ //pNumber(name, unit, init, min, max, step)
8564
+ pNumber25("W1", "mm", 1e3, 10, 2e3, 1),
8565
+ pNumber25("T1", "mm", 80, 1, 200, 1),
8566
+ pNumber25("S1", "mm", 200, 1, 500, 1),
8567
+ pNumber25("B1", "mm", 200, 2, 500, 1),
8568
+ pNumber25("B2", "mm", 300, 2, 1e3, 1),
8569
+ pNumber25("H1", "mm", 100, 1, 500, 1),
8570
+ pNumber25("H2", "mm", 200, 1, 500, 1),
8571
+ pSectionSeparator25("Slope"),
8572
+ pNumber25("a1", "%", 5, -90, 90, 1),
8573
+ pNumber25("a3", "%", 20, -90, 90, 1),
8574
+ pNumber25("a5", "%", 2, -90, 90, 1),
8575
+ pNumber25("L1", "m", 30, 0.01, 200, 0.01),
8576
+ pNumber25("L2", "m", 5, 0.01, 200, 0.01),
8577
+ pNumber25("L3", "m", 20, 0.01, 200, 0.01),
8578
+ pNumber25("L4", "m", 3, 0.01, 200, 0.01),
8579
+ pNumber25("L5", "m", 20, 0.01, 200, 0.01)
8580
+ ],
8581
+ paramSvg: {
8582
+ W1: "trackXZ_section.svg",
8583
+ T1: "trackXZ_section.svg",
8584
+ S1: "trackXZ_top.svg",
8585
+ B1: "trackXZ_top.svg",
8586
+ B2: "trackXZ_top.svg",
8587
+ H1: "trackXZ_side.svg",
8588
+ H2: "trackXZ_side.svg",
8589
+ a1: "trackXZ_slope.svg",
8590
+ a3: "trackXZ_slope.svg",
8591
+ a5: "trackXZ_slope.svg",
8592
+ L1: "trackXZ_slope.svg",
8593
+ L2: "trackXZ_slope.svg",
8594
+ L3: "trackXZ_slope.svg",
8595
+ L4: "trackXZ_slope.svg",
8596
+ L5: "trackXZ_slope.svg"
8597
+ },
8598
+ sim: {
8599
+ tMax: 180,
8600
+ tStep: 0.5,
8601
+ tUpdate: 500
8602
+ // every 0.5 second
8603
+ }
8604
+ };
8605
+ function pGeom25(t, param, suffix = "") {
8606
+ const rGeome = initGeom25(pDef25.partName + suffix);
8607
+ const figBeam = figure22();
8608
+ const figRail = figure22();
8609
+ const figTop = figure22();
8610
+ const figSection = figure22();
8611
+ rGeome.logstr += `${rGeome.partName} simTime: ${t}
8612
+ `;
8613
+ try {
8614
+ let ctrBeam2 = function(ix, iy, ia) {
8615
+ const pt = point14(ix, iy).translatePolar(ia + 2 * pi2, Wbeam2);
8616
+ const rCtr = contour25(pt.cx, pt.cy).addSegStrokeRP(ia, 2 * Wbeam2).addSegStrokeRP(ia + pi2, H1).addSegStrokeRP(ia + 2 * pi2, 2 * Wbeam2).addSegStrokeRP(ia - pi2, H1).closeSegStroke();
8617
+ return rCtr;
8618
+ };
8619
+ var ctrBeam = ctrBeam2;
8620
+ const pi2 = Math.PI / 2;
8621
+ const Ltot = param.L1 + param.L2 + param.L3 + param.L4 + param.L5;
8622
+ const H1 = param.H1 / 1e3;
8623
+ const H2 = param.H2 / 1e3;
8624
+ const W12 = param.W1 / 2e3;
8625
+ const T1 = param.T1 / 1e3;
8626
+ const S1 = param.S1 / 1e3;
8627
+ const Wbeam2 = param.B1 / 2e3;
8628
+ const Lbeam2 = W12 + T1 + S1;
8629
+ const Bstep = (param.B1 + param.B2) / 1e3;
8630
+ const a1 = Math.asin(param.a1 / 100);
8631
+ const a3 = Math.asin(param.a3 / 100);
8632
+ const a5 = Math.asin(param.a5 / 100);
8633
+ const aMin = degToRad12(0.1);
8634
+ const aDiff13 = Math.abs(a3 - a1);
8635
+ const aDiff35 = Math.abs(a5 - a3);
8636
+ const aDiffMax = Math.max(aDiff13, aDiff35);
8637
+ const a2 = a3 - a1;
8638
+ const a4 = a5 - a3;
8639
+ const r2 = Math.abs(param.L2 / a2);
8640
+ const r4 = Math.abs(param.L4 / a4);
8641
+ const pt0 = point14(0, 0);
8642
+ const pt1 = pt0.translatePolar(a1, param.L1);
8643
+ const pt2c = pt1.translatePolar(a1 + Math.sign(a2) * pi2, r2);
8644
+ const pt2m = pt2c.translatePolar(a1 - Math.sign(a2) * pi2 + a2 / 2, r2);
8645
+ const pt2 = pt2c.translatePolar(a1 - Math.sign(a2) * pi2 + a2, r2);
8646
+ const pt3 = pt2.translatePolar(a3, param.L3);
8647
+ const pt4c = pt3.translatePolar(a3 + Math.sign(a4) * pi2, r4);
8648
+ const pt4m = pt4c.translatePolar(a3 - Math.sign(a4) * pi2 + a4 / 2, r4);
8649
+ const pt4 = pt4c.translatePolar(a3 - Math.sign(a4) * pi2 + a4, r4);
8650
+ const pt5 = pt4.translatePolar(a5, param.L5);
8651
+ const ava = Math.atan2(pt5.cy, pt5.cx);
8652
+ const avp = 100 * Math.sin(ava);
8653
+ const N0r = Bstep - Wbeam2;
8654
+ const N1 = Math.floor(N0r + param.L1 / Bstep);
8655
+ const N1r = N0r + param.L1 - N1 * Bstep;
8656
+ const N1ra = N1r / r2;
8657
+ const a2s = Bstep / r2;
8658
+ const N2 = Math.floor((N1r + param.L2) / Bstep);
8659
+ const N2r = N1r + param.L2 - N2 * Bstep;
8660
+ const N3 = Math.floor((N2r + param.L3) / Bstep);
8661
+ const N3r = N2r + param.L3 - N3 * Bstep;
8662
+ const N3ra = N3r / r4;
8663
+ const a4s = Bstep / r4;
8664
+ const N4 = Math.floor((N3r + param.L4) / Bstep);
8665
+ const N4r = N3r + param.L4 - N4 * Bstep;
8666
+ const N5 = Math.floor((N4r + param.L5) / Bstep);
8667
+ const beamNb = N1 + N2 + N3 + N4 + N5;
8668
+ const beamNb2 = Math.floor((N0r + Ltot) / Bstep);
8669
+ const H12 = H1 + H2;
8670
+ if (aDiff13 < aMin) {
8671
+ throw `err107: a1 ${ffix26(param.a1)} and a3 ${ffix26(param.a3)} (degree) are too closed`;
8672
+ }
8673
+ if (aDiff35 < aMin) {
8674
+ throw `err107: a3 ${ffix26(param.a3)} and a5 ${ffix26(param.a5)} (degree) are too closed`;
8675
+ }
8676
+ rGeome.logstr += `Slope length: ${ffix26(Ltot)}, X ${ffix26(pt5.cx)} Y ${ffix26(pt5.cy)} m, average ${ffix26(avp)} % ${ffix26(radToDeg13(ava))} degree
8677
+ `;
8678
+ rGeome.logstr += `Slope max transition: aDiffMax ${ffix26(radToDeg13(aDiffMax))} degree
8679
+ `;
8680
+ rGeome.logstr += `Beam number: ${beamNb} ${beamNb2}, size: ${ffix26(2 * Lbeam2)} x ${ffix26(2 * Wbeam2)} m
8681
+ `;
8682
+ figSection.addSecond(ctrRectangle14(-Lbeam2, 0, 2 * Lbeam2, H1));
8683
+ figSection.addMainO(ctrRectangle14(-Lbeam2 + S1, H1, T1, H2));
8684
+ figSection.addMainO(ctrRectangle14(W12, H1, T1, H2));
8685
+ for (let ii = 0; ii < 11; ii++) {
8686
+ figTop.addSecond(ctrRectangle14(ii * Bstep, -Lbeam2, 2 * Wbeam2, 2 * Lbeam2));
8687
+ }
8688
+ figTop.addMainO(ctrRectangle14(0, W12, 2 * Wbeam2 + 10 * Bstep, T1));
8689
+ figTop.addMainO(ctrRectangle14(0, -W12 - T1, 2 * Wbeam2 + 10 * Bstep, T1));
8690
+ const ctrGround = contour25(pt0.cx, pt0.cy).addSegStrokeA(pt1.cx, pt1.cy).addPointA(pt2m.cx, pt2m.cy).addPointA(pt2.cx, pt2.cy).addSegArc2().addSegStrokeA(pt3.cx, pt3.cy).addPointA(pt4m.cx, pt4m.cy).addPointA(pt4.cx, pt4.cy).addSegArc2().addSegStrokeA(pt5.cx, pt5.cy);
8691
+ figBeam.addSecond(ctrGround);
8692
+ for (let ii = 0; ii < N1; ii++) {
8693
+ const pp = pt0.translatePolar(a1, (ii + 1) * Bstep - N0r);
8694
+ figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, a1));
8695
+ }
8696
+ for (let ii = 0; ii < N2; ii++) {
8697
+ const ai = a1 + Math.sign(a2) * (-pi2 + (ii + 1) * a2s - N1ra);
8698
+ const pp = pt2c.translatePolar(ai, r2);
8699
+ figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, ai + Math.sign(a2) * pi2));
8700
+ }
8701
+ for (let ii = 0; ii < N3; ii++) {
8702
+ const pp = pt2.translatePolar(a3, (ii + 1) * Bstep - N2r);
8703
+ figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, a3));
8704
+ }
8705
+ for (let ii = 0; ii < N4; ii++) {
8706
+ const ai = a3 + Math.sign(a4) * (-pi2 + (ii + 1) * a4s - N3ra);
8707
+ const pp = pt4c.translatePolar(ai, r4);
8708
+ figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, ai + Math.sign(a4) * pi2));
8709
+ }
8710
+ for (let ii = 0; ii < N5; ii++) {
8711
+ const pp = pt4.translatePolar(a5, (ii + 1) * Bstep - N4r);
8712
+ figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, a5));
8713
+ }
8714
+ figRail.mergeFigure(figBeam, true);
8715
+ const pr0 = pt0.translatePolar(a1 + pi2, H1);
8716
+ const pr0b = pt0.translatePolar(a1 + pi2, H12);
8717
+ const pr1 = pt1.translatePolar(a1 + pi2, H1);
8718
+ const pr1b = pt1.translatePolar(a1 + pi2, H12);
8719
+ const pr2m = pt2m.translatePolar((a1 + a3) / 2 + pi2, H1);
8720
+ const pr2mb = pt2m.translatePolar((a1 + a3) / 2 + pi2, H12);
8721
+ const pr2 = pt2.translatePolar(a3 + pi2, H1);
8722
+ const pr2b = pt2.translatePolar(a3 + pi2, H12);
8723
+ const pr3 = pt3.translatePolar(a3 + pi2, H1);
8724
+ const pr3b = pt3.translatePolar(a3 + pi2, H12);
8725
+ const pr4m = pt4m.translatePolar((a3 + a5) / 2 + pi2, H1);
8726
+ const pr4mb = pt4m.translatePolar((a3 + a5) / 2 + pi2, H12);
8727
+ const pr4 = pt4.translatePolar(a5 + pi2, H1);
8728
+ const pr4b = pt4.translatePolar(a5 + pi2, H12);
8729
+ const pr5 = pt5.translatePolar(a5 + pi2, H1);
8730
+ const pr5b = pt5.translatePolar(a5 + pi2, H12);
8731
+ const ctrRail = contour25(pr0.cx, pr0.cy).addSegStrokeA(pr1.cx, pr1.cy).addPointA(pr2m.cx, pr2m.cy).addPointA(pr2.cx, pr2.cy).addSegArc2().addSegStrokeA(pr3.cx, pr3.cy).addPointA(pr4m.cx, pr4m.cy).addPointA(pr4.cx, pr4.cy).addSegArc2().addSegStrokeA(pr5.cx, pr5.cy).addSegStrokeA(pr5b.cx, pr5b.cy).addSegStrokeA(pr4b.cx, pr4b.cy).addPointA(pr4mb.cx, pr4mb.cy).addPointA(pr3b.cx, pr3b.cy).addSegArc2().addSegStrokeA(pr2b.cx, pr2b.cy).addPointA(pr2mb.cx, pr2mb.cy).addPointA(pr1b.cx, pr1b.cy).addSegArc2().addSegStrokeA(pr0b.cx, pr0b.cy).closeSegStroke();
8732
+ figRail.addMainO(ctrRail);
8733
+ figBeam.addSecond(ctrRail);
8734
+ rGeome.fig = {
8735
+ faceBeam: figBeam,
8736
+ faceRail: figRail,
8737
+ faceTop: figTop,
8738
+ faceSection: figSection
8739
+ };
8740
+ const designName = rGeome.partName;
8741
+ rGeome.vol = {
8742
+ extrudes: [
8743
+ {
8744
+ outName: `subpax_${designName}_beam`,
8745
+ face: `${designName}_faceBeam`,
8746
+ extrudeMethod: EExtrude21.eLinearOrtho,
8747
+ length: 2 * Lbeam2,
8748
+ rotate: [0, 0, 0],
8749
+ translate: [0, 0, 0]
8750
+ },
8751
+ {
8752
+ outName: `subpax_${designName}_rail1`,
8753
+ face: `${designName}_faceRail`,
8754
+ extrudeMethod: EExtrude21.eLinearOrtho,
8755
+ length: T1,
8756
+ rotate: [0, 0, 0],
8757
+ translate: [0, 0, S1]
8758
+ },
8759
+ {
8760
+ outName: `subpax_${designName}_rail2`,
8761
+ face: `${designName}_faceRail`,
8762
+ extrudeMethod: EExtrude21.eLinearOrtho,
8763
+ length: T1,
8764
+ rotate: [0, 0, 0],
8765
+ translate: [0, 0, Lbeam2 + W12]
8766
+ }
8767
+ ],
8768
+ volumes: [
8769
+ {
8770
+ outName: `pax_${designName}`,
8771
+ boolMethod: EBVolume21.eUnion,
8772
+ inList: [
8773
+ `subpax_${designName}_beam`,
8774
+ `subpax_${designName}_rail1`,
8775
+ `subpax_${designName}_rail2`
8776
+ ]
8777
+ }
8778
+ ]
8779
+ };
8780
+ rGeome.sub = {};
8781
+ rGeome.logstr += "trackXZ drawn successfully!\n";
8782
+ rGeome.calcErr = false;
8783
+ } catch (emsg) {
8784
+ rGeome.logstr += emsg;
8785
+ console.log(emsg);
8786
+ }
8787
+ return rGeome;
8788
+ }
8789
+ var trackXZDef = {
8790
+ pTitle: "trackXZ",
8791
+ pDescription: "simulation of train-capsule on XZ-track",
8792
+ pDef: pDef25,
8793
+ pGeom: pGeom25
8794
+ };
8795
+
8796
+ // src/sysmix/square.ts
8797
+ import {
8798
+ contour as contour26,
8799
+ contourCircle as contourCircle20,
8800
+ ctrRectangle as ctrRectangle15,
8801
+ figure as figure23,
8802
+ ffix as ffix27,
8803
+ pNumber as pNumber26,
8804
+ pSectionSeparator as pSectionSeparator26,
8805
+ EExtrude as EExtrude22,
8806
+ EBVolume as EBVolume22,
8807
+ initGeom as initGeom26
8808
+ } from "geometrix";
8809
+ var pDef26 = {
8072
8810
  partName: "square",
8073
8811
  params: [
8074
8812
  //pNumber(name, unit, init, min, max, step)
8075
- pNumber23("W1", "mm", 100, 5, 500, 1),
8076
- pNumber23("Di", "mm", 50, 2, 500, 1),
8077
- pSectionSeparator23("Details and thickness"),
8078
- pNumber23("R1", "mm", 0, 0, 50, 1),
8079
- pNumber23("T1", "mm", 30, 1, 500, 1)
8813
+ pNumber26("W1", "mm", 100, 5, 500, 1),
8814
+ pNumber26("Di", "mm", 50, 2, 500, 1),
8815
+ pSectionSeparator26("Details and thickness"),
8816
+ pNumber26("R1", "mm", 0, 0, 50, 1),
8817
+ pNumber26("T1", "mm", 30, 1, 500, 1)
8080
8818
  ],
8081
8819
  paramSvg: {
8082
8820
  W1: "square_top.svg",
@@ -8091,10 +8829,10 @@ var pDef23 = {
8091
8829
  // every 0.5 second
8092
8830
  }
8093
8831
  };
8094
- function pGeom23(t, param, suffix = "") {
8095
- const rGeome = initGeom23(pDef23.partName + suffix);
8096
- const figSquare = figure20();
8097
- const figHeight = figure20();
8832
+ function pGeom26(t, param, suffix = "") {
8833
+ const rGeome = initGeom26(pDef26.partName + suffix);
8834
+ const figSquare = figure23();
8835
+ const figHeight = figure23();
8098
8836
  rGeome.logstr += `${rGeome.partName} simTime: ${t}
8099
8837
  `;
8100
8838
  try {
@@ -8105,13 +8843,13 @@ function pGeom23(t, param, suffix = "") {
8105
8843
  if (param.W1 < param.Di) {
8106
8844
  throw `err069: W1 ${param.W1} is too small compare to Di ${param.Di}`;
8107
8845
  }
8108
- rGeome.logstr += `Surface ${ffix24(surface)} mm2, volume ${ffix24(volume)} mm3
8846
+ rGeome.logstr += `Surface ${ffix27(surface)} mm2, volume ${ffix27(volume)} mm3
8109
8847
  `;
8110
- const ctrSquare = contour23(-W12, -W12).addCornerRounded(param.R1).addSegStrokeR(param.W1, 0).addCornerRounded(param.R1).addSegStrokeR(0, param.W1).addCornerRounded(param.R1).addSegStrokeR(-param.W1, 0).addCornerRounded(param.R1).closeSegStroke();
8848
+ const ctrSquare = contour26(-W12, -W12).addCornerRounded(param.R1).addSegStrokeR(param.W1, 0).addCornerRounded(param.R1).addSegStrokeR(0, param.W1).addCornerRounded(param.R1).addSegStrokeR(-param.W1, 0).addCornerRounded(param.R1).closeSegStroke();
8111
8849
  const ctrHole = contourCircle20(0, 0, Ri);
8112
8850
  figSquare.addMainOI([ctrSquare, ctrHole]);
8113
- figHeight.addMainO(ctrRectangle12(-W12, 0, 2 * W12, param.T1));
8114
- figHeight.addSecond(ctrRectangle12(-Ri, 0, 2 * Ri, param.T1));
8851
+ figHeight.addMainO(ctrRectangle15(-W12, 0, 2 * W12, param.T1));
8852
+ figHeight.addSecond(ctrRectangle15(-Ri, 0, 2 * Ri, param.T1));
8115
8853
  rGeome.fig = {
8116
8854
  faceSquare: figSquare,
8117
8855
  faceHeight: figHeight
@@ -8122,7 +8860,7 @@ function pGeom23(t, param, suffix = "") {
8122
8860
  {
8123
8861
  outName: `subpax_${designName}_square`,
8124
8862
  face: `${designName}_faceSquare`,
8125
- extrudeMethod: EExtrude19.eLinearOrtho,
8863
+ extrudeMethod: EExtrude22.eLinearOrtho,
8126
8864
  length: param.T1,
8127
8865
  rotate: [0, 0, 0],
8128
8866
  translate: [0, 0, 0]
@@ -8131,7 +8869,7 @@ function pGeom23(t, param, suffix = "") {
8131
8869
  volumes: [
8132
8870
  {
8133
8871
  outName: `pax_${designName}`,
8134
- boolMethod: EBVolume19.eUnion,
8872
+ boolMethod: EBVolume22.eUnion,
8135
8873
  inList: [`subpax_${designName}_square`]
8136
8874
  }
8137
8875
  ]
@@ -8148,34 +8886,34 @@ function pGeom23(t, param, suffix = "") {
8148
8886
  var squareDef = {
8149
8887
  pTitle: "square",
8150
8888
  pDescription: "simple square shape for experimenting systemix",
8151
- pDef: pDef23,
8152
- pGeom: pGeom23
8889
+ pDef: pDef26,
8890
+ pGeom: pGeom26
8153
8891
  };
8154
8892
 
8155
8893
  // src/sysmix/triangle.ts
8156
8894
  import {
8157
- contour as contour24,
8895
+ contour as contour27,
8158
8896
  contourCircle as contourCircle21,
8159
- ctrRectangle as ctrRectangle13,
8160
- figure as figure21,
8161
- ffix as ffix25,
8162
- pNumber as pNumber24,
8163
- pSectionSeparator as pSectionSeparator24,
8164
- EExtrude as EExtrude20,
8165
- EBVolume as EBVolume20,
8166
- initGeom as initGeom24
8897
+ ctrRectangle as ctrRectangle16,
8898
+ figure as figure24,
8899
+ ffix as ffix28,
8900
+ pNumber as pNumber27,
8901
+ pSectionSeparator as pSectionSeparator27,
8902
+ EExtrude as EExtrude23,
8903
+ EBVolume as EBVolume23,
8904
+ initGeom as initGeom27
8167
8905
  } from "geometrix";
8168
- var pDef24 = {
8906
+ var pDef27 = {
8169
8907
  partName: "triangle",
8170
8908
  params: [
8171
8909
  //pNumber(name, unit, init, min, max, step)
8172
- pNumber24("W1", "mm", 100, 5, 500, 1),
8173
- pNumber24("T1", "mm", 20, 1, 500, 1),
8174
- pNumber24("E1", "mm", 10, 1, 500, 1),
8175
- pNumber24("N1", "triangles", 3, 1, 20, 1),
8176
- pSectionSeparator24("Details and hole"),
8177
- pNumber24("R1", "mm", 0, 0, 50, 1),
8178
- pNumber24("Di", "mm", 50, 2, 500, 1)
8910
+ pNumber27("W1", "mm", 100, 5, 500, 1),
8911
+ pNumber27("T1", "mm", 20, 1, 500, 1),
8912
+ pNumber27("E1", "mm", 10, 1, 500, 1),
8913
+ pNumber27("N1", "triangles", 3, 1, 20, 1),
8914
+ pSectionSeparator27("Details and hole"),
8915
+ pNumber27("R1", "mm", 0, 0, 50, 1),
8916
+ pNumber27("Di", "mm", 50, 2, 500, 1)
8179
8917
  ],
8180
8918
  paramSvg: {
8181
8919
  W1: "triangle_top.svg",
@@ -8192,10 +8930,10 @@ var pDef24 = {
8192
8930
  // every 0.5 second
8193
8931
  }
8194
8932
  };
8195
- function pGeom24(t, param, suffix = "") {
8196
- const rGeome = initGeom24(pDef24.partName + suffix);
8197
- const figTriangle = figure21();
8198
- const figHeight = figure21();
8933
+ function pGeom27(t, param, suffix = "") {
8934
+ const rGeome = initGeom27(pDef27.partName + suffix);
8935
+ const figTriangle = figure24();
8936
+ const figHeight = figure24();
8199
8937
  rGeome.logstr += `${rGeome.partName} simTime: ${t}
8200
8938
  `;
8201
8939
  try {
@@ -8209,15 +8947,15 @@ function pGeom24(t, param, suffix = "") {
8209
8947
  if (W12h < Ri) {
8210
8948
  throw `err077: W1 ${param.W1} is too small compare to Di ${param.Di}`;
8211
8949
  }
8212
- rGeome.logstr += `Surface ${ffix25(surface)} mm2, volume ${ffix25(volume)} mm3
8950
+ rGeome.logstr += `Surface ${ffix28(surface)} mm2, volume ${ffix28(volume)} mm3
8213
8951
  `;
8214
- const ctrTriangle = contour24(-W12, -W12h).addCornerRounded(param.R1).addSegStrokeR(param.W1, 0).addCornerRounded(param.R1).addSegStrokeRP(2 * Math.PI / 3, param.W1).addCornerRounded(param.R1).closeSegStroke();
8952
+ const ctrTriangle = contour27(-W12, -W12h).addCornerRounded(param.R1).addSegStrokeR(param.W1, 0).addCornerRounded(param.R1).addSegStrokeRP(2 * Math.PI / 3, param.W1).addCornerRounded(param.R1).closeSegStroke();
8215
8953
  const ctrHole = contourCircle21(0, 0, Ri);
8216
8954
  figTriangle.addMainOI([ctrTriangle, ctrHole]);
8217
8955
  for (let ii = 0; ii < param.N1; ii++) {
8218
8956
  const Zpos = ii * Zoffset;
8219
- figHeight.addMainO(ctrRectangle13(-W12h, Zpos, W1h, param.T1));
8220
- figHeight.addSecond(ctrRectangle13(-Ri, Zpos, 2 * Ri, param.T1));
8957
+ figHeight.addMainO(ctrRectangle16(-W12h, Zpos, W1h, param.T1));
8958
+ figHeight.addSecond(ctrRectangle16(-Ri, Zpos, 2 * Ri, param.T1));
8221
8959
  }
8222
8960
  rGeome.fig = {
8223
8961
  faceTriangle: figTriangle,
@@ -8229,7 +8967,7 @@ function pGeom24(t, param, suffix = "") {
8229
8967
  extrudes: Vidx.map((ii) => ({
8230
8968
  outName: `subpax_${designName}_tri${ii}`,
8231
8969
  face: `${designName}_faceTriangle`,
8232
- extrudeMethod: EExtrude20.eLinearOrtho,
8970
+ extrudeMethod: EExtrude23.eLinearOrtho,
8233
8971
  length: param.T1,
8234
8972
  rotate: [0, 0, 0],
8235
8973
  translate: [0, 0, ii * Zoffset]
@@ -8237,7 +8975,7 @@ function pGeom24(t, param, suffix = "") {
8237
8975
  volumes: [
8238
8976
  {
8239
8977
  outName: `pax_${designName}`,
8240
- boolMethod: EBVolume20.eUnion,
8978
+ boolMethod: EBVolume23.eUnion,
8241
8979
  inList: Vidx.map((ii) => `subpax_${designName}_tri${ii}`)
8242
8980
  }
8243
8981
  ]
@@ -8254,30 +8992,30 @@ function pGeom24(t, param, suffix = "") {
8254
8992
  var triangleDef = {
8255
8993
  pTitle: "triangle",
8256
8994
  pDescription: "triangle sandwich shape for experimenting systemix",
8257
- pDef: pDef24,
8258
- pGeom: pGeom24
8995
+ pDef: pDef27,
8996
+ pGeom: pGeom27
8259
8997
  };
8260
8998
 
8261
8999
  // src/sysmix/cylinder.ts
8262
9000
  import {
8263
9001
  contourCircle as contourCircle22,
8264
- ctrRectangle as ctrRectangle14,
8265
- figure as figure22,
8266
- ffix as ffix26,
8267
- pNumber as pNumber25,
8268
- pSectionSeparator as pSectionSeparator25,
8269
- EExtrude as EExtrude21,
8270
- EBVolume as EBVolume21,
8271
- initGeom as initGeom25
9002
+ ctrRectangle as ctrRectangle17,
9003
+ figure as figure25,
9004
+ ffix as ffix29,
9005
+ pNumber as pNumber28,
9006
+ pSectionSeparator as pSectionSeparator28,
9007
+ EExtrude as EExtrude24,
9008
+ EBVolume as EBVolume24,
9009
+ initGeom as initGeom28
8272
9010
  } from "geometrix";
8273
- var pDef25 = {
9011
+ var pDef28 = {
8274
9012
  partName: "cylinder",
8275
9013
  params: [
8276
9014
  //pNumber(name, unit, init, min, max, step)
8277
- pNumber25("D1", "mm", 100, 5, 500, 1),
8278
- pNumber25("Di", "mm", 50, 2, 500, 1),
8279
- pSectionSeparator25("Thickness"),
8280
- pNumber25("T1", "mm", 30, 1, 500, 1)
9015
+ pNumber28("D1", "mm", 100, 5, 500, 1),
9016
+ pNumber28("Di", "mm", 50, 2, 500, 1),
9017
+ pSectionSeparator28("Thickness"),
9018
+ pNumber28("T1", "mm", 30, 1, 500, 1)
8281
9019
  ],
8282
9020
  paramSvg: {
8283
9021
  D1: "cylinder_top.svg",
@@ -8291,10 +9029,10 @@ var pDef25 = {
8291
9029
  // every 0.5 second
8292
9030
  }
8293
9031
  };
8294
- function pGeom25(t, param, suffix = "") {
8295
- const rGeome = initGeom25(pDef25.partName + suffix);
8296
- const figCylinder = figure22();
8297
- const figHeight = figure22();
9032
+ function pGeom28(t, param, suffix = "") {
9033
+ const rGeome = initGeom28(pDef28.partName + suffix);
9034
+ const figCylinder = figure25();
9035
+ const figHeight = figure25();
8298
9036
  rGeome.logstr += `${rGeome.partName} simTime: ${t}
8299
9037
  `;
8300
9038
  try {
@@ -8305,13 +9043,13 @@ function pGeom25(t, param, suffix = "") {
8305
9043
  if (R1 < Ri) {
8306
9044
  throw `err071: D1 ${param.D1} is too small compare to Di ${param.Di}`;
8307
9045
  }
8308
- rGeome.logstr += `Surface ${ffix26(surface)} mm2, volume ${ffix26(volume)} mm3
9046
+ rGeome.logstr += `Surface ${ffix29(surface)} mm2, volume ${ffix29(volume)} mm3
8309
9047
  `;
8310
9048
  const ctrCylinder = contourCircle22(0, 0, R1);
8311
9049
  const ctrHole = contourCircle22(0, 0, Ri);
8312
9050
  figCylinder.addMainOI([ctrCylinder, ctrHole]);
8313
- figHeight.addMainO(ctrRectangle14(-R1, 0, 2 * R1, param.T1));
8314
- figHeight.addSecond(ctrRectangle14(-Ri, 0, 2 * Ri, param.T1));
9051
+ figHeight.addMainO(ctrRectangle17(-R1, 0, 2 * R1, param.T1));
9052
+ figHeight.addSecond(ctrRectangle17(-Ri, 0, 2 * Ri, param.T1));
8315
9053
  rGeome.fig = {
8316
9054
  faceCylinder: figCylinder,
8317
9055
  faceHeight: figHeight
@@ -8322,7 +9060,7 @@ function pGeom25(t, param, suffix = "") {
8322
9060
  {
8323
9061
  outName: `subpax_${designName}_cyl`,
8324
9062
  face: `${designName}_faceCylinder`,
8325
- extrudeMethod: EExtrude21.eLinearOrtho,
9063
+ extrudeMethod: EExtrude24.eLinearOrtho,
8326
9064
  length: param.T1,
8327
9065
  rotate: [0, 0, 0],
8328
9066
  translate: [0, 0, 0]
@@ -8331,7 +9069,7 @@ function pGeom25(t, param, suffix = "") {
8331
9069
  volumes: [
8332
9070
  {
8333
9071
  outName: `pax_${designName}`,
8334
- boolMethod: EBVolume21.eIdentity,
9072
+ boolMethod: EBVolume24.eIdentity,
8335
9073
  inList: [`subpax_${designName}_cyl`]
8336
9074
  }
8337
9075
  ]
@@ -8348,10 +9086,11 @@ function pGeom25(t, param, suffix = "") {
8348
9086
  var cylinderDef = {
8349
9087
  pTitle: "cylinder",
8350
9088
  pDescription: "simple cylinder shape for experimenting systemix",
8351
- pDef: pDef25,
8352
- pGeom: pGeom25
9089
+ pDef: pDef28,
9090
+ pGeom: pGeom28
8353
9091
  };
8354
9092
  export {
9093
+ bridgeDef,
8355
9094
  capsuleDef,
8356
9095
  cylinderDef,
8357
9096
  door1arcDef,
@@ -8375,6 +9114,8 @@ export {
8375
9114
  springWormDef,
8376
9115
  squareDef,
8377
9116
  stoneTowerDef,
9117
+ trackXYDef,
9118
+ trackXZDef,
8378
9119
  triangleDef,
8379
9120
  tunnelDef
8380
9121
  };