desi77 0.1.23 → 0.1.25

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
@@ -4966,6 +4966,7 @@ import {
4966
4966
  pNumber as pNumber15,
4967
4967
  pCheckbox as pCheckbox9,
4968
4968
  pSectionSeparator as pSectionSeparator15,
4969
+ transform3d,
4969
4970
  EExtrude as EExtrude12,
4970
4971
  EBVolume as EBVolume12,
4971
4972
  initGeom as initGeom15
@@ -4983,6 +4984,7 @@ var pDef15 = {
4983
4984
  pNumber15("H7", "mm", 10, 1, 2e3, 1),
4984
4985
  pNumber15("H8", "mm", 32, 1, 2e3, 1),
4985
4986
  pNumber15("D8", "mm", 3, 1, 50, 1),
4987
+ pNumber15("S1", "mm", 4, 1, 50, 1),
4986
4988
  pSectionSeparator15("Frame side"),
4987
4989
  pNumber15("T1", "mm", 1, 0.5, 10, 0.1),
4988
4990
  pNumber15("T2", "mm", 1, 0.5, 10, 0.1),
@@ -4995,9 +4997,11 @@ var pDef15 = {
4995
4997
  pNumber15("D1", "mm", 30, 5, 1e3, 1),
4996
4998
  pNumber15("D2", "mm", 40, 5, 1e3, 1),
4997
4999
  pNumber15("D3", "mm", 20, 5, 1e3, 1),
5000
+ pNumber15("D4", "mm", 10, 1, 1e3, 1),
4998
5001
  pNumber15("H1", "mm", 40, 5, 2e3, 1),
4999
5002
  pNumber15("H2", "mm", 40, 5, 2e3, 1),
5000
5003
  pNumber15("H3", "mm", 80, 5, 2e3, 1),
5004
+ pNumber15("N2", "buttress", 8, 0, 20, 1),
5001
5005
  pSectionSeparator15("Mirror"),
5002
5006
  pNumber15("Wm", "mm", 60, 5, 2e3, 1),
5003
5007
  pNumber15("Hm", "mm", 60, 5, 2e3, 1),
@@ -5028,6 +5032,7 @@ var pDef15 = {
5028
5032
  H7: "minihelio_front.svg",
5029
5033
  H8: "minihelio_front.svg",
5030
5034
  D8: "minihelio_front.svg",
5035
+ S1: "minihelio_front.svg",
5031
5036
  T1: "minihelio_side.svg",
5032
5037
  T2: "minihelio_side.svg",
5033
5038
  W3: "minihelio_side.svg",
@@ -5038,9 +5043,11 @@ var pDef15 = {
5038
5043
  D1: "minihelio_front.svg",
5039
5044
  D2: "minihelio_front.svg",
5040
5045
  D3: "minihelio_front.svg",
5046
+ D4: "minihelio_foot_top.svg",
5041
5047
  H1: "minihelio_front.svg",
5042
5048
  H2: "minihelio_front.svg",
5043
5049
  H3: "minihelio_front.svg",
5050
+ N2: "minihelio_foot_top.svg",
5044
5051
  Wm: "minihelio_mirror.svg",
5045
5052
  Hm: "minihelio_mirror.svg",
5046
5053
  Tm: "minihelio_mirror.svg",
@@ -5072,7 +5079,10 @@ function pGeom15(t, param, suffix = "") {
5072
5079
  const figFrameBottom = figure13();
5073
5080
  const figFrameTop = figure13();
5074
5081
  const figFrameSide = figure13();
5082
+ const figFrameSideHAxis = figure13();
5075
5083
  const figFrameMid = figure13();
5084
+ const figFootButtress = figure13();
5085
+ const figFrameBottomPlate = figure13();
5076
5086
  const figMirrorSide = figure13();
5077
5087
  const figMirrorAxis = figure13();
5078
5088
  const figOneMirror = figure13();
@@ -5080,7 +5090,14 @@ function pGeom15(t, param, suffix = "") {
5080
5090
  `;
5081
5091
  try {
5082
5092
  let ctrFoot2 = function(sign) {
5083
- const rCtr = contour16(sign * R1, 0).addSegStrokeR(0, param.H1).addSegStrokeR(sign * R12, 0).addSegStrokeR(0, param.H2).addSegStrokeR(-sign * R23, param.H3).addSegStrokeR(-sign * param.T1, 0).addSegStrokeR(sign * R23, -param.H3).addSegStrokeR(0, -param.H2 + param.T1).addSegStrokeR(-sign * R12, 0).addSegStrokeR(0, -param.H1 - param.T1).closeSegStroke();
5093
+ const rCtr = contour16(sign * R1, 0).addSegStrokeR(0, param.H1).addSegStrokeR(sign * R12, 0).addSegStrokeR(0, param.H2).addSegStrokeR(-sign * R23, param.H3).addSegStrokeR(-sign * R34, 0).addSegStrokeR(0, -param.T1).addSegStrokeR(sign * (R34 - param.T1 + R23b), 0).addSegStrokeR(sign * (R23 - R23b), -param.H3 + param.T1).addSegStrokeR(0, -param.H2 + param.T1).addSegStrokeR(-sign * R12, 0).addSegStrokeR(0, -param.H1 - param.T1).closeSegStroke();
5094
+ return rCtr;
5095
+ }, ctrFootButtress2 = function(sign) {
5096
+ const rCtr = contour16(sign * (R1 - param.T1), param.H1 + param.T1).addSegStrokeR(sign * R12, 0).addSegStrokeR(0, param.H2 - param.T1).addSegStrokeR(-sign * (R23 - R23b), param.H3 - param.T1).addSegStrokeR(-sign * (R34 - param.T1 + R23b), 0);
5097
+ if (R4 < R1 - param.T1) {
5098
+ rCtr.addSegStrokeR(sign * (R1 - param.T1 - R4), -H123 + param.T1);
5099
+ }
5100
+ rCtr.closeSegStroke();
5084
5101
  return rCtr;
5085
5102
  }, ctrOval2 = function(iDelta) {
5086
5103
  const r4 = param.H4 - iDelta;
@@ -5126,7 +5143,7 @@ function pGeom15(t, param, suffix = "") {
5126
5143
  }
5127
5144
  return [rA1, rCnt];
5128
5145
  };
5129
- var ctrFoot = ctrFoot2, ctrOval = ctrOval2, calcYray = calcYray2, ctrSunRay = ctrSunRay2, searchA1 = searchA12;
5146
+ var ctrFoot = ctrFoot2, ctrFootButtress = ctrFootButtress2, ctrOval = ctrOval2, calcYray = calcYray2, ctrSunRay = ctrSunRay2, searchA1 = searchA12;
5130
5147
  const pi2 = Math.PI / 2;
5131
5148
  const aSunMin = degToRad7(param.aSunMin);
5132
5149
  const aSunMax = degToRad7(param.aSunMax);
@@ -5134,11 +5151,16 @@ function pGeom15(t, param, suffix = "") {
5134
5151
  const R1 = param.D1 / 2;
5135
5152
  const R2 = param.D2 / 2;
5136
5153
  const R3 = param.D3 / 2;
5154
+ const R4 = param.D4 / 2;
5137
5155
  const R8 = param.D8 / 2;
5138
5156
  const Rm = param.Dm / 2;
5139
5157
  const RmE = Rm + param.Em;
5140
5158
  const R12 = R2 - R1;
5141
5159
  const R23 = R2 - R3;
5160
+ const R34 = R3 - R4;
5161
+ const R23b = param.T1 * R23 / param.H3;
5162
+ const D8T2 = param.D8 + 2 * param.T2;
5163
+ const R8T2 = D8T2 / 2;
5142
5164
  const Wbottom2 = param.W1 / 2 - param.H4;
5143
5165
  const H123 = param.H1 + param.H2 + param.H3;
5144
5166
  const H567 = param.H5 + param.T2 + param.N1 * (param.H6 + param.T2) + param.H7;
@@ -5149,6 +5171,7 @@ function pGeom15(t, param, suffix = "") {
5149
5171
  const H6b = param.H6 + param.T2;
5150
5172
  const H18pre = H15 + param.T2 + param.H8;
5151
5173
  const H18b = H18pre - Rm;
5174
+ const H18c = H18pre - R8T2;
5152
5175
  const H18 = H18pre - param.Hm / 2;
5153
5176
  const L8 = (param.W1 - param.Wm) / 2;
5154
5177
  const H17 = H15 + param.T2 + param.N1 * (param.H6 + param.T2) + param.H7;
@@ -5167,17 +5190,34 @@ function pGeom15(t, param, suffix = "") {
5167
5190
  const mirrorSurfaceN = param.N1 * mirrorSurface;
5168
5191
  const mh2 = param.Hm / 2;
5169
5192
  const aSSun2 = degToRad7(param.aSolidSun) / 2;
5193
+ const WS1 = param.W1 / 2 - param.S1;
5194
+ const W32 = param.W3 / 2;
5195
+ const H41 = param.H4 - param.T1;
5196
+ const W42 = param.W4 / 2;
5197
+ const T12 = param.T1 / 2;
5198
+ const R241 = R2 - R4 - param.T1;
5199
+ const aButtress = param.N2 > 0 ? 4 * pi2 / param.N2 : pi2;
5200
+ const idxFootButtress = [...Array(param.N2).keys()];
5170
5201
  if (R12 < 0.1) {
5171
5202
  throw `err134: D2 ${ffix16(param.D2)} is too small compare to D1 ${ffix16(param.D1)} mm`;
5172
5203
  }
5173
5204
  if (R23 < 0.1) {
5174
5205
  throw `err139: D2 ${ffix16(param.D2)} is too small compare to D3 ${ffix16(param.D3)} mm`;
5175
5206
  }
5207
+ if (R34 < 0.1) {
5208
+ throw `err203: D3 ${ffix16(param.D3)} is too small compare to D4 ${ffix16(param.D4)} mm`;
5209
+ }
5210
+ if (H41 < 0.1) {
5211
+ throw `err216: H4 ${ffix16(param.H4)} is too small compare to T1 ${ffix16(param.T1)} mm`;
5212
+ }
5213
+ if (R1 < param.T1) {
5214
+ throw `err213: D1 ${ffix16(param.D1)} is too small compare to T1 ${ffix16(param.T1)} mm`;
5215
+ }
5176
5216
  if (param.H2 < param.T1) {
5177
5217
  throw `err142: H2 ${ffix16(param.H2)} is too small compare to T1 ${ffix16(param.T1)} mm`;
5178
5218
  }
5179
5219
  if (Wbottom2 < R3) {
5180
- throw `err151: W1 ${ffix16(param.W1)} is too small compare to H4 ${ffix16(param.H4)} mm`;
5220
+ throw `err151: W1 ${ffix16(param.W1)} is too small compare to H4 ${ffix16(param.H4)} and D3 ${ffix16(param.D3)} mm`;
5181
5221
  }
5182
5222
  if (W1b < 0) {
5183
5223
  throw `err158: W1 ${ffix16(param.W1)} is too small compare to T2 ${ffix16(param.T2)} mm`;
@@ -5217,6 +5257,8 @@ function pGeom15(t, param, suffix = "") {
5217
5257
  figFoot.addSecond(ctrOval2(0));
5218
5258
  figFoot.addSecond(ctrOval2(param.T2));
5219
5259
  figFoot.addSecond(ctrOval2(param.T2 + param.W2));
5260
+ figFoot.addSecond(ctrRectangle7(-R4, H123, 2 * R4, param.T2));
5261
+ figFrameBand.addSecond(ctrRectangle7(-R4, H123, 2 * R4, param.T2));
5220
5262
  figFrameBand.addMainOI([ctrOval2(param.T2), ctrOval2(param.T2 + param.W2)]);
5221
5263
  figFrameBand.addSecond(ctrOval2(0));
5222
5264
  figFrameBand.addSecond(ctrFoot2(1));
@@ -5229,13 +5271,39 @@ function pGeom15(t, param, suffix = "") {
5229
5271
  figFrameMid.addSecond(ctrRectangle7(-param.Wm / 2, H18 + ii * H6b, param.Wm, param.Hm));
5230
5272
  figFrameMid.addSecond(ctrRectangle7(-param.W1 / 2, H18b + ii * H6b, L8, param.Dm));
5231
5273
  figFrameMid.addSecond(ctrRectangle7(param.Wm / 2, H18b + ii * H6b, L8, param.Dm));
5274
+ figFrameMid.addSecond(ctrRectangle7(-param.W1 / 2, H18c + ii * H6b, param.S1, D8T2));
5275
+ figFrameMid.addSecond(ctrRectangle7(WS1, H18c + ii * H6b, param.S1, D8T2));
5276
+ }
5277
+ figFootButtress.addSecond(ctrFoot2(1));
5278
+ figFootButtress.addSecond(ctrFoot2(-1));
5279
+ figFootButtress.addMainO(ctrFootButtress2(1));
5280
+ figFootButtress.addSecond(ctrFootButtress2(-1));
5281
+ const ctrFBPlateE = ctrRectangle7(-Wbottom2, -W32, 2 * Wbottom2, param.W3);
5282
+ const ctrFBPlateI = contourCircle12(0, 0, R4);
5283
+ figFrameBottomPlate.addMainOI([ctrFBPlateE, ctrFBPlateI]);
5284
+ figFrameBottomPlate.addSecond(ctrRectangle7(-W1b2, -W32, H41, param.W3));
5285
+ figFrameBottomPlate.addSecond(ctrRectangle7(-W12, -W32, param.T2, param.W3));
5286
+ figFrameBottomPlate.addSecond(ctrRectangle7(Wbottom2, -W32, H41, param.W3));
5287
+ figFrameBottomPlate.addSecond(ctrRectangle7(W1b2, -W32, param.T2, param.W3));
5288
+ figFrameBottomPlate.addSecond(ctrRectangle7(-W1b2, -W42 - param.T2, W1b, param.T2));
5289
+ figFrameBottomPlate.addSecond(ctrRectangle7(-W1b2, W42, W1b, param.T2));
5290
+ figFrameBottomPlate.addSecond(contourCircle12(0, 0, R3));
5291
+ figFrameBottomPlate.addSecond(contourCircle12(0, 0, R2));
5292
+ figFrameBottomPlate.addSecond(contourCircle12(0, 0, R2 - param.T1));
5293
+ figFrameBottomPlate.addSecond(contourCircle12(0, 0, R1));
5294
+ for (const idx of idxFootButtress) {
5295
+ const iCtr = ctrRectangle7(R4, -T12, R241, param.T1).rotate(0, 0, idx * aButtress);
5296
+ figFrameBottomPlate.addSecond(iCtr);
5232
5297
  }
5233
5298
  figFrameTop.mergeFigure(figFrameMid, true);
5234
5299
  const ctrFrameTop = contour16(-W1b2, H17).addPointR(W1b2, W1b2).addPointR(2 * W1b2, 0).addSegArc2().addSegStrokeR(param.T2, 0).addPointR(-W12, W12).addPointR(-2 * W12, 0).addSegArc2().closeSegStroke();
5235
5300
  figFrameTop.addMainO(ctrFrameTop);
5236
5301
  figFrameBottom.mergeFigure(figFrameMid, true);
5237
- const ctrFrameBottom = contour16(Wbottom2, H123).addPointR(param.H4, param.H4).addSegArc(param.H4, false, true).addSegStrokeR(-param.T2, 0).addPointR(-H42, -H42).addSegArc(H42, false, false).addSegStrokeR(-2 * Wbottom2, 0).addPointR(-H42, H42).addSegArc(H42, false, false).addSegStrokeR(-param.T2, 0).addPointR(param.H4, -param.H4).addSegArc(param.H4, false, true).closeSegStroke();
5238
- figFrameBottom.addMainO(ctrFrameBottom);
5302
+ const ctrFrameBottomR = contour16(Wbottom2, H123).addPointR(param.H4, param.H4).addSegArc(param.H4, false, true).addSegStrokeR(-param.T2, 0).addPointR(-H42, -H42).addSegArc(H42, false, false).closeSegStroke();
5303
+ const ctrFrameBottomL = contour16(-Wbottom2, H123 + param.T2).addPointR(-H42, H42).addSegArc(H42, false, false).addSegStrokeR(-param.T2, 0).addPointR(param.H4, -param.H4).addSegArc(param.H4, false, true).closeSegStroke();
5304
+ figFrameBottom.addMainO(ctrFrameBottomR);
5305
+ figFrameBottom.addMainO(ctrFrameBottomL);
5306
+ figFrameSide.addSecond(ctrRectangle7(-R4, H123, 2 * R4, param.T2));
5239
5307
  figFrameSide.addSecond(ctrFoot2(1));
5240
5308
  figFrameSide.addSecond(ctrFoot2(-1));
5241
5309
  figFrameSide.addSecond(ctrRectangle7(-param.W3 / 2, H123, param.W3, param.H4));
@@ -5259,6 +5327,12 @@ function pGeom15(t, param, suffix = "") {
5259
5327
  figFrameSide.addSecond(ctrRectangle7(Lt, Ht1, Ht2 * 0.05, Ht2));
5260
5328
  const ctrSide = contour16(param.W3 / 2, H123 + param.H4).addSegStrokeR(0, Hside1).addPointR(-W35, param.HW53).addSegArc3(-Math.PI / 2, false).addSegStrokeR(0, Hside2).addSegStrokeR(-param.W5, 0).addSegStrokeR(0, -Hside2).addPointR(-W35, -param.HW53).addSegArc3(-Math.PI / 2, true).addSegStrokeR(0, -Hside1).closeSegStroke();
5261
5329
  figFrameSide.addMainOI([ctrSide, ...ctrSideHoles]);
5330
+ figFrameSideHAxis.mergeFigure(figFrameSide, true);
5331
+ for (let ii = 0; ii < param.N1; ii++) {
5332
+ const ctrHAxisI = contourCircle12(0, H18pre + ii * H6b, R8);
5333
+ const ctrHAxisE = contourCircle12(0, H18pre + ii * H6b, R8T2);
5334
+ figFrameSideHAxis.addMainOI([ctrHAxisE, ctrHAxisI]);
5335
+ }
5262
5336
  const ctrMirrorSide = contour16(-RmE, 0).addPointR(RmE, -RmE).addPointR(2 * RmE, 0).addSegArc2().addSegStrokeR(0, param.Sm).addSegStrokeR(Hm2, 0).addSegStrokeR(0, param.Tm).addSegStrokeR(-param.Hm, 0).addSegStrokeR(0, -param.Tm).addSegStrokeR(Hm2, 0).closeSegStroke();
5263
5337
  const ctrMirrorAxis = contourCircle12(0, 0, Rm);
5264
5338
  figMirrorSide.mergeFigure(figFrameSide, true);
@@ -5320,27 +5394,47 @@ function pGeom15(t, param, suffix = "") {
5320
5394
  faceFrameTop: figFrameTop,
5321
5395
  faceFrameBottom: figFrameBottom,
5322
5396
  faceFrameSide: figFrameSide,
5397
+ faceFrameSideHAxis: figFrameSideHAxis,
5323
5398
  faceFrameMid: figFrameMid,
5399
+ faceFootButtress: figFootButtress,
5400
+ faceFrameBottomPlate: figFrameBottomPlate,
5324
5401
  faceMirrorSide: figMirrorSide,
5325
5402
  faceMirrorAxis: figMirrorAxis,
5326
5403
  faceOneMirror: figOneMirror
5327
5404
  };
5328
5405
  const designName = rGeome.partName;
5406
+ const listVol = [];
5329
5407
  const d3Foot = [];
5330
5408
  const d3Frame = [];
5331
5409
  const d3Mirror = [];
5332
5410
  const d3OneMirror = [];
5333
5411
  if (param.d3_foot === 1) {
5334
5412
  d3Foot.push(`subpax_${designName}_foot`);
5413
+ for (const idx of idxFootButtress) {
5414
+ const iOutName = `subpax_${designName}_fbutt${idx.toString().padStart(4, "0")}`;
5415
+ d3Foot.push(iOutName);
5416
+ const iT3d = transform3d().addRotation(pi2, 0, 0).addTranslation(0, T12, 0).addRotation(0, 0, idx * aButtress);
5417
+ listVol.push({
5418
+ outName: iOutName,
5419
+ face: `${designName}_faceFootButtress`,
5420
+ extrudeMethod: EExtrude12.eLinearOrtho,
5421
+ length: param.T1,
5422
+ rotate: iT3d.getRotation(),
5423
+ translate: iT3d.getTranslation()
5424
+ });
5425
+ }
5335
5426
  }
5336
5427
  if (param.d3_frame === 1) {
5337
5428
  d3Frame.push(`subpax_${designName}_frameBand1`);
5338
5429
  d3Frame.push(`subpax_${designName}_frameBand2`);
5339
5430
  d3Frame.push(`subpax_${designName}_frameTop`);
5340
5431
  d3Frame.push(`subpax_${designName}_frameBottom`);
5432
+ d3Frame.push(`subpax_${designName}_frameBottomPlate`);
5341
5433
  d3Frame.push(`subpax_${designName}_frameMid`);
5342
5434
  d3Frame.push(`subpax_${designName}_frameSide1`);
5343
5435
  d3Frame.push(`subpax_${designName}_frameSide2`);
5436
+ d3Frame.push(`subpax_${designName}_frameSideAxis1`);
5437
+ d3Frame.push(`subpax_${designName}_frameSideAxis2`);
5344
5438
  }
5345
5439
  if (param.d3_mirrors === 1) {
5346
5440
  d3Mirror.push(`subpax_${designName}_mirrorSide`);
@@ -5390,6 +5484,14 @@ function pGeom15(t, param, suffix = "") {
5390
5484
  rotate: [pi2, 0, 0],
5391
5485
  translate: [0, param.W3 / 2, 0]
5392
5486
  },
5487
+ {
5488
+ outName: `subpax_${designName}_frameBottomPlate`,
5489
+ face: `${designName}_faceFrameBottomPlate`,
5490
+ extrudeMethod: EExtrude12.eLinearOrtho,
5491
+ length: param.T2,
5492
+ rotate: [0, 0, 0],
5493
+ translate: [0, 0, H123]
5494
+ },
5393
5495
  {
5394
5496
  outName: `subpax_${designName}_frameMid`,
5395
5497
  face: `${designName}_faceFrameMid`,
@@ -5414,6 +5516,22 @@ function pGeom15(t, param, suffix = "") {
5414
5516
  rotate: [pi2, 0, pi2],
5415
5517
  translate: [-W1b2 - param.T2, 0, 0]
5416
5518
  },
5519
+ {
5520
+ outName: `subpax_${designName}_frameSideAxis1`,
5521
+ face: `${designName}_faceFrameSideHAxis`,
5522
+ extrudeMethod: EExtrude12.eLinearOrtho,
5523
+ length: param.S1,
5524
+ rotate: [pi2, 0, pi2],
5525
+ translate: [W12 - param.S1, 0, 0]
5526
+ },
5527
+ {
5528
+ outName: `subpax_${designName}_frameSideAxis2`,
5529
+ face: `${designName}_faceFrameSideHAxis`,
5530
+ extrudeMethod: EExtrude12.eLinearOrtho,
5531
+ length: param.S1,
5532
+ rotate: [pi2, 0, pi2],
5533
+ translate: [-W12, 0, 0]
5534
+ },
5417
5535
  {
5418
5536
  outName: `subpax_${designName}_mirrorSide`,
5419
5537
  face: `${designName}_faceMirrorSide`,
@@ -5437,7 +5555,8 @@ function pGeom15(t, param, suffix = "") {
5437
5555
  length: param.Wm,
5438
5556
  rotate: [0, 0, 0],
5439
5557
  translate: [0, 0, 0]
5440
- }
5558
+ },
5559
+ ...listVol
5441
5560
  ],
5442
5561
  volumes: [
5443
5562
  {
@@ -5748,7 +5867,7 @@ import {
5748
5867
  pCheckbox as pCheckbox11,
5749
5868
  pDropdown as pDropdown8,
5750
5869
  pSectionSeparator as pSectionSeparator17,
5751
- transform3d,
5870
+ transform3d as transform3d2,
5752
5871
  EExtrude as EExtrude14,
5753
5872
  EBVolume as EBVolume14,
5754
5873
  initGeom as initGeom17
@@ -5970,7 +6089,7 @@ function pGeom17(t, param, suffix = "") {
5970
6089
  const tL = param.Lmotor - mFootWidth;
5971
6090
  const tCos = tL * Math.cos(az);
5972
6091
  const tSin = tL * Math.sin(az);
5973
- const tm = transform3d().addRotation(0, pi2 - az, 0).addTranslation(posX + tCos, posY, posZ + tSin);
6092
+ const tm = transform3d2().addRotation(0, pi2 - az, 0).addTranslation(posX + tCos, posY, posZ + tSin);
5974
6093
  const rVol = {
5975
6094
  outName: `subpax_${designName}_mFoot${idx}`,
5976
6095
  face: `${designName}_faceMFoot`,
@@ -5984,7 +6103,7 @@ function pGeom17(t, param, suffix = "") {
5984
6103
  const tL = param.Lmotor - mFootWidth;
5985
6104
  const tCos = tL * Math.cos(az);
5986
6105
  const tSin = tL * Math.sin(az);
5987
- const tm = transform3d().addRotation(0, pi2 - az, 0).addTranslation(posX + tCos, posY, posZ + tSin);
6106
+ const tm = transform3d2().addRotation(0, pi2 - az, 0).addTranslation(posX + tCos, posY, posZ + tSin);
5988
6107
  const rVol = {
5989
6108
  outName: `subpax_${designName}_wheel${idx}`,
5990
6109
  face: `${designName}_faceWheel`,
@@ -8055,28 +8174,766 @@ var tunnelDef = {
8055
8174
  pGeom: pGeom22
8056
8175
  };
8057
8176
 
8058
- // src/sysmix/square.ts
8177
+ // src/capsule/bridge.ts
8059
8178
  import {
8060
8179
  contour as contour23,
8061
- contourCircle as contourCircle20,
8062
8180
  ctrRectangle as ctrRectangle12,
8063
8181
  figure as figure20,
8064
8182
  ffix as ffix24,
8065
8183
  pNumber as pNumber23,
8184
+ pDropdown as pDropdown10,
8066
8185
  pSectionSeparator as pSectionSeparator23,
8067
8186
  EExtrude as EExtrude19,
8068
8187
  EBVolume as EBVolume19,
8069
8188
  initGeom as initGeom23
8070
8189
  } from "geometrix";
8071
8190
  var pDef23 = {
8191
+ partName: "bridge",
8192
+ params: [
8193
+ //pNumber(name, unit, init, min, max, step)
8194
+ pNumber23("N1", "arc", 9, 1, 100, 1),
8195
+ pNumber23("W1", "m", 20, 1, 100, 0.1),
8196
+ pNumber23("W2", "m", 2, 1, 100, 0.1),
8197
+ pNumber23("H1", "m", 2, 1, 100, 0.1),
8198
+ pNumber23("H2", "m", 30, 1, 100, 0.1),
8199
+ pDropdown10("arcStyle", ["gothic", "half-circle", "rectangular"]),
8200
+ pNumber23("Ea", "m", 10, 1, 100, 0.1),
8201
+ pSectionSeparator23("Transversal"),
8202
+ pNumber23("W3", "m", 10, 1, 100, 1),
8203
+ pNumber23("W4", "m", 18, 1, 100, 1),
8204
+ pNumber23("H3", "m", 5, 1, 500, 1),
8205
+ pNumber23("H4", "m", 20, 1, 500, 1),
8206
+ pDropdown10("sideStyle", ["straight", "arc"]),
8207
+ pSectionSeparator23("Valley extremity"),
8208
+ pNumber23("Ix1", "m", 5, 0, 50, 0.1),
8209
+ pNumber23("Ih11", "m", 2, 1, 50, 1),
8210
+ pNumber23("Ih12", "m", 2, 1, 50, 1),
8211
+ pNumber23("Ix2", "m", 5, 0, 50, 0.1),
8212
+ pNumber23("Ih21", "m", 2, 1, 50, 1),
8213
+ pNumber23("Ih22", "m", 2, 1, 50, 1),
8214
+ pSectionSeparator23("Valley"),
8215
+ pNumber23("p1x", "%", 20, 1, 99, 1),
8216
+ pNumber23("p1y", "m", -24, -300, 10, 1),
8217
+ pNumber23("p2x", "%", 40, 1, 99, 1),
8218
+ pNumber23("p2y", "m", -18, -300, 10, 1),
8219
+ pNumber23("p3x", "%", 60, 1, 99, 1),
8220
+ pNumber23("p3y", "m", -31, -300, 10, 1),
8221
+ pNumber23("p4x", "%", 80, 1, 99, 1),
8222
+ pNumber23("p4y", "m", -25, -300, 10, 1)
8223
+ ],
8224
+ paramSvg: {
8225
+ N1: "bridge_panorama.svg",
8226
+ W1: "bridge_panorama.svg",
8227
+ W2: "bridge_panorama.svg",
8228
+ H1: "bridge_panorama.svg",
8229
+ H2: "bridge_panorama.svg",
8230
+ arcStyle: "bridge_arc.svg",
8231
+ Ea: "bridge_column.svg",
8232
+ W3: "bridge_column.svg",
8233
+ W4: "bridge_column.svg",
8234
+ H3: "bridge_column.svg",
8235
+ H4: "bridge_column.svg",
8236
+ sideStyle: "bridge_column.svg",
8237
+ Ix1: "bridge_panorama.svg",
8238
+ Ih11: "bridge_panorama.svg",
8239
+ Ih12: "bridge_panorama.svg",
8240
+ Ix2: "bridge_panorama.svg",
8241
+ Ih21: "bridge_panorama.svg",
8242
+ Ih22: "bridge_panorama.svg",
8243
+ p1x: "bridge_panorama.svg",
8244
+ p1y: "bridge_panorama.svg",
8245
+ p2x: "bridge_panorama.svg",
8246
+ p2y: "bridge_panorama.svg",
8247
+ p3x: "bridge_panorama.svg",
8248
+ p3y: "bridge_panorama.svg",
8249
+ p4x: "bridge_panorama.svg",
8250
+ p4y: "bridge_panorama.svg"
8251
+ },
8252
+ sim: {
8253
+ tMax: 180,
8254
+ tStep: 0.5,
8255
+ tUpdate: 500
8256
+ // every 0.5 second
8257
+ }
8258
+ };
8259
+ function pGeom23(t, param, suffix = "") {
8260
+ const rGeome = initGeom23(pDef23.partName + suffix);
8261
+ const figArcade = figure20();
8262
+ const figColumn = figure20();
8263
+ const figValley = figure20();
8264
+ rGeome.logstr += `${rGeome.partName} simTime: ${t}
8265
+ `;
8266
+ try {
8267
+ const pi2 = Math.PI / 2;
8268
+ const W12 = param.W1 / 2;
8269
+ const W22 = param.W2 / 2;
8270
+ const W32 = param.W3 / 2;
8271
+ const W42 = param.W4 / 2;
8272
+ const Hg = W12 + param.Ea;
8273
+ const H12 = param.H1 + param.H2;
8274
+ const La = param.W2 + param.N1 * (param.W1 + param.W2);
8275
+ const Lb = La - param.Ix1 - param.Ix2;
8276
+ const H34 = H12 - param.H3 - param.H4;
8277
+ const vxp = [param.p1x, param.p2x, param.p3x, param.p4x];
8278
+ const vx = vxp.map((xp) => param.Ix1 + Lb * xp / 100);
8279
+ const vy = [param.p1y, param.p2y, param.p3y, param.p4y];
8280
+ if (param.H2 < W12 && param.arcStyle === 1) {
8281
+ throw `err116: H2 ${param.H2} is too small compare to W1 ${param.W1} m`;
8282
+ }
8283
+ if (param.H2 < Hg && param.arcStyle === 0) {
8284
+ throw `err125: H2 ${param.H2} is too small compare to W1 ${param.W1} and Ea ${param.Ea} m`;
8285
+ }
8286
+ if (param.W4 < param.W3) {
8287
+ throw `err129: W4 ${param.W4} is too small compare to W3 ${param.W3} m`;
8288
+ }
8289
+ if (H34 < 0) {
8290
+ throw `err133: H2 ${param.H2} is too small compare to H3 ${param.H3} or H4 ${param.H4} m`;
8291
+ }
8292
+ if (Lb < 0) {
8293
+ throw `err139: N1 ${param.N1} is too small compare to Ix1 ${param.Ix1} or Ix2 ${param.Ix2} m`;
8294
+ }
8295
+ for (let ii = 0; ii < vx.length - 1; ii++) {
8296
+ if (vx[ii + 1] < vx[ii]) {
8297
+ throw `err145: vx${ii + 1} ${vx[ii + 1]} is smaller than vx${ii} ${vx[ii]} m`;
8298
+ }
8299
+ }
8300
+ rGeome.logstr += `Bridge length: ${ffix24(Lb)} m
8301
+ `;
8302
+ const ctrArcade = contour23(0, 0).addSegStrokeR(0, -H12).addSegStrokeR(param.W2, 0);
8303
+ for (let ii = 0; ii < param.N1; ii++) {
8304
+ switch (param.arcStyle) {
8305
+ case 1:
8306
+ ctrArcade.addSegStrokeR(0, param.H2 - W12).addPointR(W12, W12).addPointR(2 * W12, 0).addSegArc2().addSegStrokeR(0, -param.H2 + W12).addSegStrokeR(param.W2, 0);
8307
+ figColumn.addSecond(ctrRectangle12(-W32, -param.H1 - W12, 2 * W32, W12));
8308
+ break;
8309
+ case 0:
8310
+ 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);
8311
+ figColumn.addSecond(ctrRectangle12(-W32, -param.H1 - Hg, 2 * W32, Hg));
8312
+ break;
8313
+ default:
8314
+ ctrArcade.addSegStrokeR(0, param.H2).addSegStrokeR(param.W1, 0).addSegStrokeR(0, -param.H2).addSegStrokeR(param.W2, 0);
8315
+ figColumn.addSecond(ctrRectangle12(-W32, -param.H1, 2 * W32, param.H1));
8316
+ }
8317
+ }
8318
+ ctrArcade.addSegStrokeR(0, H12).closeSegStroke();
8319
+ figArcade.addMainO(ctrArcade);
8320
+ for (let ii = 0; ii < param.N1 + 1; ii++) {
8321
+ const px = ii * (param.W2 + param.W1);
8322
+ figArcade.addSecond(ctrRectangle12(px, -param.H3 - H34, param.W2, H34));
8323
+ figArcade.addSecond(ctrRectangle12(px, -H12, param.W2, param.H4));
8324
+ }
8325
+ const ctrColumn = contour23(-W42, -H12).addSegStrokeR(2 * W42, 0).addSegStrokeR(0, param.H4);
8326
+ if (param.sideStyle === 1) {
8327
+ ctrColumn.addPointR(-W42 + W32, H34).addSegArc3(-pi2, false);
8328
+ } else {
8329
+ ctrColumn.addSegStrokeR(-W42 + W32, H34);
8330
+ }
8331
+ ctrColumn.addSegStrokeR(0, param.H3).addSegStrokeR(-param.W3, 0).addSegStrokeR(0, -param.H3);
8332
+ if (param.sideStyle === 1) {
8333
+ ctrColumn.addPointR(W32 - W42, -H34).addSegArc3(-pi2, true);
8334
+ } else {
8335
+ ctrColumn.addSegStrokeR(W32 - W42, -H34);
8336
+ }
8337
+ ctrColumn.closeSegStroke();
8338
+ figColumn.addMainO(ctrColumn);
8339
+ const ctrValley = contour23(-2 * W22, param.Ih11).addSegStrokeR(2 * W22 + param.Ix1, 0).addSegStrokeR(0, -param.Ih11 - param.Ih12);
8340
+ for (let ii = 0; ii < vx.length; ii++) {
8341
+ ctrValley.addSegStrokeA(vx[ii], vy[ii]);
8342
+ }
8343
+ 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();
8344
+ figValley.addMainO(ctrValley);
8345
+ figValley.addSecond(ctrArcade);
8346
+ figArcade.addSecond(ctrValley);
8347
+ rGeome.fig = {
8348
+ faceArcade: figArcade,
8349
+ faceColumn: figColumn,
8350
+ faceValley: figValley
8351
+ };
8352
+ const designName = rGeome.partName;
8353
+ const volColumn = [];
8354
+ const volColumnN = [];
8355
+ for (let ii = 0; ii < param.N1 + 1; ii++) {
8356
+ const px = ii * (param.W2 + param.W1);
8357
+ const iVolN = `subpax_${designName}_col${String(ii).padStart(3, "0")}`;
8358
+ const iVol = {
8359
+ outName: iVolN,
8360
+ face: `${designName}_faceColumn`,
8361
+ extrudeMethod: EExtrude19.eLinearOrtho,
8362
+ length: 2 * W22,
8363
+ rotate: [0, pi2, 0],
8364
+ translate: [px, 0, 0]
8365
+ };
8366
+ volColumn.push(iVol);
8367
+ volColumnN.push(iVolN);
8368
+ }
8369
+ rGeome.vol = {
8370
+ extrudes: [
8371
+ {
8372
+ outName: `subpax_${designName}_arcade`,
8373
+ face: `${designName}_faceArcade`,
8374
+ extrudeMethod: EExtrude19.eLinearOrtho,
8375
+ length: 2 * W32,
8376
+ rotate: [0, 0, 0],
8377
+ translate: [0, 0, -W32]
8378
+ },
8379
+ ...volColumn,
8380
+ {
8381
+ outName: `subpax_${designName}_valley`,
8382
+ face: `${designName}_faceValley`,
8383
+ extrudeMethod: EExtrude19.eLinearOrtho,
8384
+ length: 4 * W42,
8385
+ rotate: [0, 0, 0],
8386
+ translate: [0, 0, -2 * W42]
8387
+ }
8388
+ ],
8389
+ volumes: [
8390
+ {
8391
+ outName: `pax_${designName}`,
8392
+ boolMethod: EBVolume19.eUnion,
8393
+ inList: [
8394
+ `subpax_${designName}_arcade`,
8395
+ ...volColumnN,
8396
+ `subpax_${designName}_valley`
8397
+ ]
8398
+ }
8399
+ ]
8400
+ };
8401
+ rGeome.sub = {};
8402
+ rGeome.logstr += "bridge drawn successfully!\n";
8403
+ rGeome.calcErr = false;
8404
+ } catch (emsg) {
8405
+ rGeome.logstr += emsg;
8406
+ console.log(emsg);
8407
+ }
8408
+ return rGeome;
8409
+ }
8410
+ var bridgeDef = {
8411
+ pTitle: "bridge",
8412
+ pDescription: "bridge for the train-capsule",
8413
+ pDef: pDef23,
8414
+ pGeom: pGeom23
8415
+ };
8416
+
8417
+ // src/capsule/trackXY.ts
8418
+ import {
8419
+ ShapePoint as ShapePoint3,
8420
+ point as point13,
8421
+ contour as contour24,
8422
+ ctrRectangle as ctrRectangle13,
8423
+ figure as figure21,
8424
+ degToRad as degToRad11,
8425
+ radToDeg as radToDeg12,
8426
+ ffix as ffix25,
8427
+ pNumber as pNumber24,
8428
+ pSectionSeparator as pSectionSeparator24,
8429
+ EExtrude as EExtrude20,
8430
+ EBVolume as EBVolume20,
8431
+ initGeom as initGeom24
8432
+ } from "geometrix";
8433
+ import { triLALrL as triLALrL3 } from "triangule";
8434
+ var pDef24 = {
8435
+ partName: "trackXY",
8436
+ params: [
8437
+ //pNumber(name, unit, init, min, max, step)
8438
+ pNumber24("W1", "mm", 1e3, 10, 2e3, 1),
8439
+ pNumber24("T1", "mm", 80, 1, 200, 1),
8440
+ pNumber24("S1", "mm", 200, 1, 500, 1),
8441
+ pNumber24("B1", "mm", 200, 2, 500, 1),
8442
+ pNumber24("B2", "mm", 300, 2, 1e3, 1),
8443
+ pNumber24("H1", "mm", 100, 1, 500, 1),
8444
+ pNumber24("H2", "mm", 200, 1, 500, 1),
8445
+ pSectionSeparator24("Track"),
8446
+ pNumber24("a0", "degree", 30, -180, 180, 1),
8447
+ pNumber24("a1", "degree", -120, -180, 180, 1),
8448
+ pNumber24("a2", "degree", 70, -180, 180, 1),
8449
+ pNumber24("L1", "m", 30, 0.01, 200, 0.01),
8450
+ pNumber24("L2", "m", 1, 0.01, 200, 0.01),
8451
+ pNumber24("L3", "m", 20, 0.01, 200, 0.01),
8452
+ pNumber24("r1", "m", 10, 0.01, 200, 0.01),
8453
+ pNumber24("r2", "m", 20, 0.01, 200, 0.01)
8454
+ ],
8455
+ paramSvg: {
8456
+ W1: "trackXY_section.svg",
8457
+ T1: "trackXY_section.svg",
8458
+ S1: "trackXY_top.svg",
8459
+ B1: "trackXY_top.svg",
8460
+ B2: "trackXY_top.svg",
8461
+ H1: "trackXY_side.svg",
8462
+ H2: "trackXY_side.svg",
8463
+ a0: "trackXY_midLine.svg",
8464
+ a1: "trackXY_midLine.svg",
8465
+ a2: "trackXY_midLine.svg",
8466
+ L1: "trackXY_midLine.svg",
8467
+ L2: "trackXY_midLine.svg",
8468
+ L3: "trackXY_midLine.svg",
8469
+ r1: "trackXY_midLine.svg",
8470
+ r2: "trackXY_midLine.svg"
8471
+ },
8472
+ sim: {
8473
+ tMax: 180,
8474
+ tStep: 0.5,
8475
+ tUpdate: 500
8476
+ // every 0.5 second
8477
+ }
8478
+ };
8479
+ function pGeom24(t, param, suffix = "") {
8480
+ const rGeome = initGeom24(pDef24.partName + suffix);
8481
+ const figTop1 = figure21();
8482
+ const figTop2 = figure21();
8483
+ const figSection = figure21();
8484
+ const figSide = figure21();
8485
+ rGeome.logstr += `${rGeome.partName} simTime: ${t}
8486
+ `;
8487
+ try {
8488
+ let ctrBeam2 = function(iX, iY, iA) {
8489
+ const ctr1 = ctrRectangle13(iX - Wbeam2, iY - Lbeam2, 2 * Wbeam2, 2 * Lbeam2);
8490
+ const rCtr = ctr1.rotate(iX, iY, iA);
8491
+ return rCtr;
8492
+ }, ctrRail2 = function(iW12, iT1, iSign) {
8493
+ const aR0 = A0 + iSign * pi2;
8494
+ const aR10 = A0 - Math.sign(A1) * pi2;
8495
+ const aR11 = A0 - Math.sign(A1) * pi2 + A1 / 2;
8496
+ const aR12 = A0 - Math.sign(A1) * pi2 + A1;
8497
+ const aR20 = A1b - Math.sign(A2) * pi2;
8498
+ const aR21 = A1b - Math.sign(A2) * pi2 + A2 / 2;
8499
+ const aR22 = A1b - Math.sign(A2) * pi2 + A2;
8500
+ const sR11 = iSign * Math.sign(A1) * iW12;
8501
+ const sR12 = iSign * Math.sign(A1) * (iW12 + iT1);
8502
+ const sR21 = iSign * Math.sign(A2) * iW12;
8503
+ const sR22 = iSign * Math.sign(A2) * (iW12 + iT1);
8504
+ const pR11 = point13(0, 0).translatePolar(aR0, iW12);
8505
+ const pR12 = pt1c.translatePolar(aR11, param.r1 - sR12);
8506
+ const pR13 = pt1c.translatePolar(aR12, param.r1 - sR12);
8507
+ const pR14 = pt2c.translatePolar(aR21, param.r2 - sR22);
8508
+ const pR15 = pt2c.translatePolar(aR22, param.r2 - sR22);
8509
+ const pR16 = pt2c.translatePolar(aR21, param.r2 - sR21);
8510
+ const pR17 = pt2c.translatePolar(aR20, param.r2 - sR21);
8511
+ const pR18 = pt1c.translatePolar(aR11, param.r1 - sR11);
8512
+ const pR19 = pt1c.translatePolar(aR10, param.r1 - sR11);
8513
+ 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();
8514
+ return rCtr;
8515
+ };
8516
+ var ctrBeam = ctrBeam2, ctrRail = ctrRail2;
8517
+ const pi2 = Math.PI / 2;
8518
+ const A0 = degToRad11(param.a0);
8519
+ const A1 = degToRad11(param.a1);
8520
+ const A2 = degToRad11(param.a2);
8521
+ const Lr1 = Math.abs(A1) * param.r1;
8522
+ const Lr2 = Math.abs(A2) * param.r2;
8523
+ const Ltot = param.L1 + Lr1 + param.L2 + Lr2 + param.L3;
8524
+ const A1b = A0 + A1;
8525
+ const A2b = A1b + A2;
8526
+ const [Lr1c, logTri1] = triLALrL3(param.r1, A1, param.r1);
8527
+ const [Lr2c, logTri2] = triLALrL3(param.r2, A2, param.r2);
8528
+ rGeome.logstr += logTri1 + logTri2;
8529
+ const aLr1c = A1 / 2;
8530
+ const aLr2c = A2 / 2;
8531
+ const H1 = param.H1 / 1e3;
8532
+ const H2 = param.H2 / 1e3;
8533
+ const W12 = param.W1 / 2e3;
8534
+ const T1 = param.T1 / 1e3;
8535
+ const S1 = param.S1 / 1e3;
8536
+ const Wbeam2 = param.B1 / 2e3;
8537
+ const Lbeam2 = W12 + T1 + S1;
8538
+ const Bstep = (param.B1 + param.B2) / 1e3;
8539
+ const Nb1 = Math.floor(param.L1 / Bstep);
8540
+ const Rb1 = param.L1 - Nb1 * Bstep;
8541
+ const Nb1c = Math.floor((Rb1 + Lr1) / Bstep);
8542
+ const Rb1c = Rb1 + Lr1 - Nb1c * Bstep;
8543
+ const a1c = Math.sign(A1) * Bstep / param.r1;
8544
+ const a1ci = Math.sign(A1) * Rb1 / param.r1;
8545
+ const Nb2 = Math.floor((Rb1c + param.L2) / Bstep);
8546
+ const Rb2 = Rb1c + param.L2 - Nb2 * Bstep;
8547
+ const Nb2c = Math.floor((Rb2 + Lr2) / Bstep);
8548
+ const Rb2c = Rb2 + Lr2 - Nb2c * Bstep;
8549
+ const a2c = Math.sign(A2) * Bstep / param.r2;
8550
+ const a2ci = Math.sign(A2) * Rb2 / param.r2;
8551
+ const Nb3 = Math.floor((Rb2c + param.L3) / Bstep);
8552
+ const Nbeam1 = 1 + Math.floor(Ltot / Bstep);
8553
+ const Nbeam2 = 1 + Nb1 + Nb1c + Nb2 + Nb2c + Nb3;
8554
+ if (Math.abs(param.a1) < 0.5) {
8555
+ throw `err102: a1 ${param.a1} degree is too closed to zero`;
8556
+ }
8557
+ if (Math.abs(param.a2) < 0.5) {
8558
+ throw `err112: a2 ${param.a2} degree is too closed to zero`;
8559
+ }
8560
+ rGeome.logstr += `Track-XY length: ${ffix25(Ltot)} m
8561
+ `;
8562
+ rGeome.logstr += `Beam number: ${Nbeam1} ${Nbeam2}, size: ${ffix25(2 * Lbeam2)} x ${ffix25(2 * Wbeam2)} m
8563
+ `;
8564
+ rGeome.logstr += `Final orientation: ${ffix25(radToDeg12(A2b))} degree
8565
+ `;
8566
+ 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);
8567
+ figTop1.addSecond(ctrMidLine);
8568
+ const pt0 = point13(0, 0);
8569
+ figTop1.addMainO(ctrBeam2(pt0.cx, pt0.cy, A0));
8570
+ for (let ii = 0; ii < Nb1; ii++) {
8571
+ const pt = pt0.translatePolar(A0, (ii + 1) * Bstep);
8572
+ figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, A0));
8573
+ }
8574
+ const pt1b = pt0.translatePolar(A0, param.L1);
8575
+ const pt1c = pt1b.translatePolar(A0 + Math.sign(A1) * pi2, param.r1);
8576
+ for (let ii = 0; ii < Nb1c; ii++) {
8577
+ const ia = A0 - Math.sign(A1) * pi2 - a1ci + (ii + 1) * a1c;
8578
+ const pt = pt1c.translatePolar(ia, param.r1);
8579
+ figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, ia - pi2));
8580
+ }
8581
+ const pt1e = pt1b.translatePolar(A0 + aLr1c, Lr1c);
8582
+ for (let ii = 0; ii < Nb2; ii++) {
8583
+ const pt = pt1e.translatePolar(A1b, (ii + 1) * Bstep - Rb1c);
8584
+ figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, A1b));
8585
+ }
8586
+ const pt2b = pt1e.translatePolar(A1b, param.L2);
8587
+ const pt2c = pt2b.translatePolar(A1b + Math.sign(A2) * pi2, param.r2);
8588
+ for (let ii = 0; ii < Nb2c; ii++) {
8589
+ const ia = A1b - Math.sign(A2) * pi2 - a2ci + (ii + 1) * a2c;
8590
+ const pt = pt2c.translatePolar(ia, param.r2);
8591
+ figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, ia - pi2));
8592
+ }
8593
+ const pt2e = pt2b.translatePolar(A1b + aLr2c, Lr2c);
8594
+ for (let ii = 0; ii < Nb3; ii++) {
8595
+ const pt = pt2e.translatePolar(A2b, (ii + 1) * Bstep - Rb2c);
8596
+ figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, A2b));
8597
+ }
8598
+ figTop1.addPoint(point13(pt1c.cx, pt1c.cy, ShapePoint3.eTri2));
8599
+ figTop1.addPoint(point13(pt2c.cx, pt2c.cy, ShapePoint3.eTri2));
8600
+ figTop2.mergeFigure(figTop1, true);
8601
+ const ctrRail1 = ctrRail2(W12, T1, -1);
8602
+ const ctrRail22 = ctrRail2(W12, T1, 1);
8603
+ figTop2.addMainO(ctrRail1);
8604
+ figTop2.addMainO(ctrRail22);
8605
+ figTop1.addSecond(ctrRail1);
8606
+ figTop1.addSecond(ctrRail22);
8607
+ figSection.addSecond(ctrRectangle13(-Lbeam2, 0, 2 * Lbeam2, H1));
8608
+ figSection.addMainO(ctrRectangle13(-Lbeam2 + S1, H1, T1, H2));
8609
+ figSection.addMainO(ctrRectangle13(W12, H1, T1, H2));
8610
+ for (let ii = 0; ii < 11; ii++) {
8611
+ figSide.addSecond(ctrRectangle13(ii * Bstep, 0, 2 * Wbeam2, H1));
8612
+ }
8613
+ figSide.addMainO(ctrRectangle13(0, H1, 2 * Wbeam2 + 10 * Bstep, H2));
8614
+ rGeome.fig = {
8615
+ faceTop1: figTop1,
8616
+ faceTop2: figTop2,
8617
+ faceSide: figSide,
8618
+ faceSection: figSection
8619
+ };
8620
+ const designName = rGeome.partName;
8621
+ rGeome.vol = {
8622
+ extrudes: [
8623
+ {
8624
+ outName: `subpax_${designName}_beam`,
8625
+ face: `${designName}_faceTop1`,
8626
+ extrudeMethod: EExtrude20.eLinearOrtho,
8627
+ length: H1,
8628
+ rotate: [0, 0, 0],
8629
+ translate: [0, 0, 0]
8630
+ },
8631
+ {
8632
+ outName: `subpax_${designName}_rail`,
8633
+ face: `${designName}_faceTop2`,
8634
+ extrudeMethod: EExtrude20.eLinearOrtho,
8635
+ length: H2,
8636
+ rotate: [0, 0, 0],
8637
+ translate: [0, 0, H1]
8638
+ }
8639
+ ],
8640
+ volumes: [
8641
+ {
8642
+ outName: `pax_${designName}`,
8643
+ boolMethod: EBVolume20.eUnion,
8644
+ inList: [`subpax_${designName}_beam`, `subpax_${designName}_rail`]
8645
+ }
8646
+ ]
8647
+ };
8648
+ rGeome.sub = {};
8649
+ rGeome.logstr += "trackXY drawn successfully!\n";
8650
+ rGeome.calcErr = false;
8651
+ } catch (emsg) {
8652
+ rGeome.logstr += emsg;
8653
+ console.log(emsg);
8654
+ }
8655
+ return rGeome;
8656
+ }
8657
+ var trackXYDef = {
8658
+ pTitle: "trackXY",
8659
+ pDescription: "simulation of train-capsule on XY-track",
8660
+ pDef: pDef24,
8661
+ pGeom: pGeom24
8662
+ };
8663
+
8664
+ // src/capsule/trackXZ.ts
8665
+ import {
8666
+ point as point14,
8667
+ contour as contour25,
8668
+ ctrRectangle as ctrRectangle14,
8669
+ figure as figure22,
8670
+ degToRad as degToRad12,
8671
+ radToDeg as radToDeg13,
8672
+ ffix as ffix26,
8673
+ pNumber as pNumber25,
8674
+ pSectionSeparator as pSectionSeparator25,
8675
+ EExtrude as EExtrude21,
8676
+ EBVolume as EBVolume21,
8677
+ initGeom as initGeom25
8678
+ } from "geometrix";
8679
+ var pDef25 = {
8680
+ partName: "trackXZ",
8681
+ params: [
8682
+ //pNumber(name, unit, init, min, max, step)
8683
+ pNumber25("W1", "mm", 1e3, 10, 2e3, 1),
8684
+ pNumber25("T1", "mm", 80, 1, 200, 1),
8685
+ pNumber25("S1", "mm", 200, 1, 500, 1),
8686
+ pNumber25("B1", "mm", 200, 2, 500, 1),
8687
+ pNumber25("B2", "mm", 300, 2, 1e3, 1),
8688
+ pNumber25("H1", "mm", 100, 1, 500, 1),
8689
+ pNumber25("H2", "mm", 200, 1, 500, 1),
8690
+ pSectionSeparator25("Slope"),
8691
+ pNumber25("a1", "%", 5, -90, 90, 1),
8692
+ pNumber25("a3", "%", 20, -90, 90, 1),
8693
+ pNumber25("a5", "%", 2, -90, 90, 1),
8694
+ pNumber25("L1", "m", 30, 0.01, 200, 0.01),
8695
+ pNumber25("L2", "m", 5, 0.01, 200, 0.01),
8696
+ pNumber25("L3", "m", 20, 0.01, 200, 0.01),
8697
+ pNumber25("L4", "m", 3, 0.01, 200, 0.01),
8698
+ pNumber25("L5", "m", 20, 0.01, 200, 0.01)
8699
+ ],
8700
+ paramSvg: {
8701
+ W1: "trackXZ_section.svg",
8702
+ T1: "trackXZ_section.svg",
8703
+ S1: "trackXZ_top.svg",
8704
+ B1: "trackXZ_top.svg",
8705
+ B2: "trackXZ_top.svg",
8706
+ H1: "trackXZ_side.svg",
8707
+ H2: "trackXZ_side.svg",
8708
+ a1: "trackXZ_slope.svg",
8709
+ a3: "trackXZ_slope.svg",
8710
+ a5: "trackXZ_slope.svg",
8711
+ L1: "trackXZ_slope.svg",
8712
+ L2: "trackXZ_slope.svg",
8713
+ L3: "trackXZ_slope.svg",
8714
+ L4: "trackXZ_slope.svg",
8715
+ L5: "trackXZ_slope.svg"
8716
+ },
8717
+ sim: {
8718
+ tMax: 180,
8719
+ tStep: 0.5,
8720
+ tUpdate: 500
8721
+ // every 0.5 second
8722
+ }
8723
+ };
8724
+ function pGeom25(t, param, suffix = "") {
8725
+ const rGeome = initGeom25(pDef25.partName + suffix);
8726
+ const figBeam = figure22();
8727
+ const figRail = figure22();
8728
+ const figTop = figure22();
8729
+ const figSection = figure22();
8730
+ rGeome.logstr += `${rGeome.partName} simTime: ${t}
8731
+ `;
8732
+ try {
8733
+ let ctrBeam2 = function(ix, iy, ia) {
8734
+ const pt = point14(ix, iy).translatePolar(ia + 2 * pi2, Wbeam2);
8735
+ 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();
8736
+ return rCtr;
8737
+ };
8738
+ var ctrBeam = ctrBeam2;
8739
+ const pi2 = Math.PI / 2;
8740
+ const Ltot = param.L1 + param.L2 + param.L3 + param.L4 + param.L5;
8741
+ const H1 = param.H1 / 1e3;
8742
+ const H2 = param.H2 / 1e3;
8743
+ const W12 = param.W1 / 2e3;
8744
+ const T1 = param.T1 / 1e3;
8745
+ const S1 = param.S1 / 1e3;
8746
+ const Wbeam2 = param.B1 / 2e3;
8747
+ const Lbeam2 = W12 + T1 + S1;
8748
+ const Bstep = (param.B1 + param.B2) / 1e3;
8749
+ const a1 = Math.asin(param.a1 / 100);
8750
+ const a3 = Math.asin(param.a3 / 100);
8751
+ const a5 = Math.asin(param.a5 / 100);
8752
+ const aMin = degToRad12(0.1);
8753
+ const aDiff13 = Math.abs(a3 - a1);
8754
+ const aDiff35 = Math.abs(a5 - a3);
8755
+ const aDiffMax = Math.max(aDiff13, aDiff35);
8756
+ const a2 = a3 - a1;
8757
+ const a4 = a5 - a3;
8758
+ const r2 = Math.abs(param.L2 / a2);
8759
+ const r4 = Math.abs(param.L4 / a4);
8760
+ const pt0 = point14(0, 0);
8761
+ const pt1 = pt0.translatePolar(a1, param.L1);
8762
+ const pt2c = pt1.translatePolar(a1 + Math.sign(a2) * pi2, r2);
8763
+ const pt2m = pt2c.translatePolar(a1 - Math.sign(a2) * pi2 + a2 / 2, r2);
8764
+ const pt2 = pt2c.translatePolar(a1 - Math.sign(a2) * pi2 + a2, r2);
8765
+ const pt3 = pt2.translatePolar(a3, param.L3);
8766
+ const pt4c = pt3.translatePolar(a3 + Math.sign(a4) * pi2, r4);
8767
+ const pt4m = pt4c.translatePolar(a3 - Math.sign(a4) * pi2 + a4 / 2, r4);
8768
+ const pt4 = pt4c.translatePolar(a3 - Math.sign(a4) * pi2 + a4, r4);
8769
+ const pt5 = pt4.translatePolar(a5, param.L5);
8770
+ const ava = Math.atan2(pt5.cy, pt5.cx);
8771
+ const avp = 100 * Math.sin(ava);
8772
+ const N0r = Bstep - Wbeam2;
8773
+ const N1 = Math.floor(N0r + param.L1 / Bstep);
8774
+ const N1r = N0r + param.L1 - N1 * Bstep;
8775
+ const N1ra = N1r / r2;
8776
+ const a2s = Bstep / r2;
8777
+ const N2 = Math.floor((N1r + param.L2) / Bstep);
8778
+ const N2r = N1r + param.L2 - N2 * Bstep;
8779
+ const N3 = Math.floor((N2r + param.L3) / Bstep);
8780
+ const N3r = N2r + param.L3 - N3 * Bstep;
8781
+ const N3ra = N3r / r4;
8782
+ const a4s = Bstep / r4;
8783
+ const N4 = Math.floor((N3r + param.L4) / Bstep);
8784
+ const N4r = N3r + param.L4 - N4 * Bstep;
8785
+ const N5 = Math.floor((N4r + param.L5) / Bstep);
8786
+ const beamNb = N1 + N2 + N3 + N4 + N5;
8787
+ const beamNb2 = Math.floor((N0r + Ltot) / Bstep);
8788
+ const H12 = H1 + H2;
8789
+ if (aDiff13 < aMin) {
8790
+ throw `err107: a1 ${ffix26(param.a1)} and a3 ${ffix26(param.a3)} (degree) are too closed`;
8791
+ }
8792
+ if (aDiff35 < aMin) {
8793
+ throw `err107: a3 ${ffix26(param.a3)} and a5 ${ffix26(param.a5)} (degree) are too closed`;
8794
+ }
8795
+ rGeome.logstr += `Slope length: ${ffix26(Ltot)}, X ${ffix26(pt5.cx)} Y ${ffix26(pt5.cy)} m, average ${ffix26(avp)} % ${ffix26(radToDeg13(ava))} degree
8796
+ `;
8797
+ rGeome.logstr += `Slope max transition: aDiffMax ${ffix26(radToDeg13(aDiffMax))} degree
8798
+ `;
8799
+ rGeome.logstr += `Beam number: ${beamNb} ${beamNb2}, size: ${ffix26(2 * Lbeam2)} x ${ffix26(2 * Wbeam2)} m
8800
+ `;
8801
+ figSection.addSecond(ctrRectangle14(-Lbeam2, 0, 2 * Lbeam2, H1));
8802
+ figSection.addMainO(ctrRectangle14(-Lbeam2 + S1, H1, T1, H2));
8803
+ figSection.addMainO(ctrRectangle14(W12, H1, T1, H2));
8804
+ for (let ii = 0; ii < 11; ii++) {
8805
+ figTop.addSecond(ctrRectangle14(ii * Bstep, -Lbeam2, 2 * Wbeam2, 2 * Lbeam2));
8806
+ }
8807
+ figTop.addMainO(ctrRectangle14(0, W12, 2 * Wbeam2 + 10 * Bstep, T1));
8808
+ figTop.addMainO(ctrRectangle14(0, -W12 - T1, 2 * Wbeam2 + 10 * Bstep, T1));
8809
+ 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);
8810
+ figBeam.addSecond(ctrGround);
8811
+ for (let ii = 0; ii < N1; ii++) {
8812
+ const pp = pt0.translatePolar(a1, (ii + 1) * Bstep - N0r);
8813
+ figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, a1));
8814
+ }
8815
+ for (let ii = 0; ii < N2; ii++) {
8816
+ const ai = a1 + Math.sign(a2) * (-pi2 + (ii + 1) * a2s - N1ra);
8817
+ const pp = pt2c.translatePolar(ai, r2);
8818
+ figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, ai + Math.sign(a2) * pi2));
8819
+ }
8820
+ for (let ii = 0; ii < N3; ii++) {
8821
+ const pp = pt2.translatePolar(a3, (ii + 1) * Bstep - N2r);
8822
+ figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, a3));
8823
+ }
8824
+ for (let ii = 0; ii < N4; ii++) {
8825
+ const ai = a3 + Math.sign(a4) * (-pi2 + (ii + 1) * a4s - N3ra);
8826
+ const pp = pt4c.translatePolar(ai, r4);
8827
+ figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, ai + Math.sign(a4) * pi2));
8828
+ }
8829
+ for (let ii = 0; ii < N5; ii++) {
8830
+ const pp = pt4.translatePolar(a5, (ii + 1) * Bstep - N4r);
8831
+ figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, a5));
8832
+ }
8833
+ figRail.mergeFigure(figBeam, true);
8834
+ const pr0 = pt0.translatePolar(a1 + pi2, H1);
8835
+ const pr0b = pt0.translatePolar(a1 + pi2, H12);
8836
+ const pr1 = pt1.translatePolar(a1 + pi2, H1);
8837
+ const pr1b = pt1.translatePolar(a1 + pi2, H12);
8838
+ const pr2m = pt2m.translatePolar((a1 + a3) / 2 + pi2, H1);
8839
+ const pr2mb = pt2m.translatePolar((a1 + a3) / 2 + pi2, H12);
8840
+ const pr2 = pt2.translatePolar(a3 + pi2, H1);
8841
+ const pr2b = pt2.translatePolar(a3 + pi2, H12);
8842
+ const pr3 = pt3.translatePolar(a3 + pi2, H1);
8843
+ const pr3b = pt3.translatePolar(a3 + pi2, H12);
8844
+ const pr4m = pt4m.translatePolar((a3 + a5) / 2 + pi2, H1);
8845
+ const pr4mb = pt4m.translatePolar((a3 + a5) / 2 + pi2, H12);
8846
+ const pr4 = pt4.translatePolar(a5 + pi2, H1);
8847
+ const pr4b = pt4.translatePolar(a5 + pi2, H12);
8848
+ const pr5 = pt5.translatePolar(a5 + pi2, H1);
8849
+ const pr5b = pt5.translatePolar(a5 + pi2, H12);
8850
+ 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();
8851
+ figRail.addMainO(ctrRail);
8852
+ figBeam.addSecond(ctrRail);
8853
+ rGeome.fig = {
8854
+ faceBeam: figBeam,
8855
+ faceRail: figRail,
8856
+ faceTop: figTop,
8857
+ faceSection: figSection
8858
+ };
8859
+ const designName = rGeome.partName;
8860
+ rGeome.vol = {
8861
+ extrudes: [
8862
+ {
8863
+ outName: `subpax_${designName}_beam`,
8864
+ face: `${designName}_faceBeam`,
8865
+ extrudeMethod: EExtrude21.eLinearOrtho,
8866
+ length: 2 * Lbeam2,
8867
+ rotate: [0, 0, 0],
8868
+ translate: [0, 0, 0]
8869
+ },
8870
+ {
8871
+ outName: `subpax_${designName}_rail1`,
8872
+ face: `${designName}_faceRail`,
8873
+ extrudeMethod: EExtrude21.eLinearOrtho,
8874
+ length: T1,
8875
+ rotate: [0, 0, 0],
8876
+ translate: [0, 0, S1]
8877
+ },
8878
+ {
8879
+ outName: `subpax_${designName}_rail2`,
8880
+ face: `${designName}_faceRail`,
8881
+ extrudeMethod: EExtrude21.eLinearOrtho,
8882
+ length: T1,
8883
+ rotate: [0, 0, 0],
8884
+ translate: [0, 0, Lbeam2 + W12]
8885
+ }
8886
+ ],
8887
+ volumes: [
8888
+ {
8889
+ outName: `pax_${designName}`,
8890
+ boolMethod: EBVolume21.eUnion,
8891
+ inList: [
8892
+ `subpax_${designName}_beam`,
8893
+ `subpax_${designName}_rail1`,
8894
+ `subpax_${designName}_rail2`
8895
+ ]
8896
+ }
8897
+ ]
8898
+ };
8899
+ rGeome.sub = {};
8900
+ rGeome.logstr += "trackXZ drawn successfully!\n";
8901
+ rGeome.calcErr = false;
8902
+ } catch (emsg) {
8903
+ rGeome.logstr += emsg;
8904
+ console.log(emsg);
8905
+ }
8906
+ return rGeome;
8907
+ }
8908
+ var trackXZDef = {
8909
+ pTitle: "trackXZ",
8910
+ pDescription: "simulation of train-capsule on XZ-track",
8911
+ pDef: pDef25,
8912
+ pGeom: pGeom25
8913
+ };
8914
+
8915
+ // src/sysmix/square.ts
8916
+ import {
8917
+ contour as contour26,
8918
+ contourCircle as contourCircle20,
8919
+ ctrRectangle as ctrRectangle15,
8920
+ figure as figure23,
8921
+ ffix as ffix27,
8922
+ pNumber as pNumber26,
8923
+ pSectionSeparator as pSectionSeparator26,
8924
+ EExtrude as EExtrude22,
8925
+ EBVolume as EBVolume22,
8926
+ initGeom as initGeom26
8927
+ } from "geometrix";
8928
+ var pDef26 = {
8072
8929
  partName: "square",
8073
8930
  params: [
8074
8931
  //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)
8932
+ pNumber26("W1", "mm", 100, 5, 500, 1),
8933
+ pNumber26("Di", "mm", 50, 2, 500, 1),
8934
+ pSectionSeparator26("Details and thickness"),
8935
+ pNumber26("R1", "mm", 0, 0, 50, 1),
8936
+ pNumber26("T1", "mm", 30, 1, 500, 1)
8080
8937
  ],
8081
8938
  paramSvg: {
8082
8939
  W1: "square_top.svg",
@@ -8091,10 +8948,10 @@ var pDef23 = {
8091
8948
  // every 0.5 second
8092
8949
  }
8093
8950
  };
8094
- function pGeom23(t, param, suffix = "") {
8095
- const rGeome = initGeom23(pDef23.partName + suffix);
8096
- const figSquare = figure20();
8097
- const figHeight = figure20();
8951
+ function pGeom26(t, param, suffix = "") {
8952
+ const rGeome = initGeom26(pDef26.partName + suffix);
8953
+ const figSquare = figure23();
8954
+ const figHeight = figure23();
8098
8955
  rGeome.logstr += `${rGeome.partName} simTime: ${t}
8099
8956
  `;
8100
8957
  try {
@@ -8105,13 +8962,13 @@ function pGeom23(t, param, suffix = "") {
8105
8962
  if (param.W1 < param.Di) {
8106
8963
  throw `err069: W1 ${param.W1} is too small compare to Di ${param.Di}`;
8107
8964
  }
8108
- rGeome.logstr += `Surface ${ffix24(surface)} mm2, volume ${ffix24(volume)} mm3
8965
+ rGeome.logstr += `Surface ${ffix27(surface)} mm2, volume ${ffix27(volume)} mm3
8109
8966
  `;
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();
8967
+ 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
8968
  const ctrHole = contourCircle20(0, 0, Ri);
8112
8969
  figSquare.addMainOI([ctrSquare, ctrHole]);
8113
- figHeight.addMainO(ctrRectangle12(-W12, 0, 2 * W12, param.T1));
8114
- figHeight.addSecond(ctrRectangle12(-Ri, 0, 2 * Ri, param.T1));
8970
+ figHeight.addMainO(ctrRectangle15(-W12, 0, 2 * W12, param.T1));
8971
+ figHeight.addSecond(ctrRectangle15(-Ri, 0, 2 * Ri, param.T1));
8115
8972
  rGeome.fig = {
8116
8973
  faceSquare: figSquare,
8117
8974
  faceHeight: figHeight
@@ -8122,7 +8979,7 @@ function pGeom23(t, param, suffix = "") {
8122
8979
  {
8123
8980
  outName: `subpax_${designName}_square`,
8124
8981
  face: `${designName}_faceSquare`,
8125
- extrudeMethod: EExtrude19.eLinearOrtho,
8982
+ extrudeMethod: EExtrude22.eLinearOrtho,
8126
8983
  length: param.T1,
8127
8984
  rotate: [0, 0, 0],
8128
8985
  translate: [0, 0, 0]
@@ -8131,7 +8988,7 @@ function pGeom23(t, param, suffix = "") {
8131
8988
  volumes: [
8132
8989
  {
8133
8990
  outName: `pax_${designName}`,
8134
- boolMethod: EBVolume19.eUnion,
8991
+ boolMethod: EBVolume22.eUnion,
8135
8992
  inList: [`subpax_${designName}_square`]
8136
8993
  }
8137
8994
  ]
@@ -8148,34 +9005,34 @@ function pGeom23(t, param, suffix = "") {
8148
9005
  var squareDef = {
8149
9006
  pTitle: "square",
8150
9007
  pDescription: "simple square shape for experimenting systemix",
8151
- pDef: pDef23,
8152
- pGeom: pGeom23
9008
+ pDef: pDef26,
9009
+ pGeom: pGeom26
8153
9010
  };
8154
9011
 
8155
9012
  // src/sysmix/triangle.ts
8156
9013
  import {
8157
- contour as contour24,
9014
+ contour as contour27,
8158
9015
  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
9016
+ ctrRectangle as ctrRectangle16,
9017
+ figure as figure24,
9018
+ ffix as ffix28,
9019
+ pNumber as pNumber27,
9020
+ pSectionSeparator as pSectionSeparator27,
9021
+ EExtrude as EExtrude23,
9022
+ EBVolume as EBVolume23,
9023
+ initGeom as initGeom27
8167
9024
  } from "geometrix";
8168
- var pDef24 = {
9025
+ var pDef27 = {
8169
9026
  partName: "triangle",
8170
9027
  params: [
8171
9028
  //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)
9029
+ pNumber27("W1", "mm", 100, 5, 500, 1),
9030
+ pNumber27("T1", "mm", 20, 1, 500, 1),
9031
+ pNumber27("E1", "mm", 10, 1, 500, 1),
9032
+ pNumber27("N1", "triangles", 3, 1, 20, 1),
9033
+ pSectionSeparator27("Details and hole"),
9034
+ pNumber27("R1", "mm", 0, 0, 50, 1),
9035
+ pNumber27("Di", "mm", 50, 2, 500, 1)
8179
9036
  ],
8180
9037
  paramSvg: {
8181
9038
  W1: "triangle_top.svg",
@@ -8192,10 +9049,10 @@ var pDef24 = {
8192
9049
  // every 0.5 second
8193
9050
  }
8194
9051
  };
8195
- function pGeom24(t, param, suffix = "") {
8196
- const rGeome = initGeom24(pDef24.partName + suffix);
8197
- const figTriangle = figure21();
8198
- const figHeight = figure21();
9052
+ function pGeom27(t, param, suffix = "") {
9053
+ const rGeome = initGeom27(pDef27.partName + suffix);
9054
+ const figTriangle = figure24();
9055
+ const figHeight = figure24();
8199
9056
  rGeome.logstr += `${rGeome.partName} simTime: ${t}
8200
9057
  `;
8201
9058
  try {
@@ -8209,15 +9066,15 @@ function pGeom24(t, param, suffix = "") {
8209
9066
  if (W12h < Ri) {
8210
9067
  throw `err077: W1 ${param.W1} is too small compare to Di ${param.Di}`;
8211
9068
  }
8212
- rGeome.logstr += `Surface ${ffix25(surface)} mm2, volume ${ffix25(volume)} mm3
9069
+ rGeome.logstr += `Surface ${ffix28(surface)} mm2, volume ${ffix28(volume)} mm3
8213
9070
  `;
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();
9071
+ 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
9072
  const ctrHole = contourCircle21(0, 0, Ri);
8216
9073
  figTriangle.addMainOI([ctrTriangle, ctrHole]);
8217
9074
  for (let ii = 0; ii < param.N1; ii++) {
8218
9075
  const Zpos = ii * Zoffset;
8219
- figHeight.addMainO(ctrRectangle13(-W12h, Zpos, W1h, param.T1));
8220
- figHeight.addSecond(ctrRectangle13(-Ri, Zpos, 2 * Ri, param.T1));
9076
+ figHeight.addMainO(ctrRectangle16(-W12h, Zpos, W1h, param.T1));
9077
+ figHeight.addSecond(ctrRectangle16(-Ri, Zpos, 2 * Ri, param.T1));
8221
9078
  }
8222
9079
  rGeome.fig = {
8223
9080
  faceTriangle: figTriangle,
@@ -8229,7 +9086,7 @@ function pGeom24(t, param, suffix = "") {
8229
9086
  extrudes: Vidx.map((ii) => ({
8230
9087
  outName: `subpax_${designName}_tri${ii}`,
8231
9088
  face: `${designName}_faceTriangle`,
8232
- extrudeMethod: EExtrude20.eLinearOrtho,
9089
+ extrudeMethod: EExtrude23.eLinearOrtho,
8233
9090
  length: param.T1,
8234
9091
  rotate: [0, 0, 0],
8235
9092
  translate: [0, 0, ii * Zoffset]
@@ -8237,7 +9094,7 @@ function pGeom24(t, param, suffix = "") {
8237
9094
  volumes: [
8238
9095
  {
8239
9096
  outName: `pax_${designName}`,
8240
- boolMethod: EBVolume20.eUnion,
9097
+ boolMethod: EBVolume23.eUnion,
8241
9098
  inList: Vidx.map((ii) => `subpax_${designName}_tri${ii}`)
8242
9099
  }
8243
9100
  ]
@@ -8254,30 +9111,30 @@ function pGeom24(t, param, suffix = "") {
8254
9111
  var triangleDef = {
8255
9112
  pTitle: "triangle",
8256
9113
  pDescription: "triangle sandwich shape for experimenting systemix",
8257
- pDef: pDef24,
8258
- pGeom: pGeom24
9114
+ pDef: pDef27,
9115
+ pGeom: pGeom27
8259
9116
  };
8260
9117
 
8261
9118
  // src/sysmix/cylinder.ts
8262
9119
  import {
8263
9120
  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
9121
+ ctrRectangle as ctrRectangle17,
9122
+ figure as figure25,
9123
+ ffix as ffix29,
9124
+ pNumber as pNumber28,
9125
+ pSectionSeparator as pSectionSeparator28,
9126
+ EExtrude as EExtrude24,
9127
+ EBVolume as EBVolume24,
9128
+ initGeom as initGeom28
8272
9129
  } from "geometrix";
8273
- var pDef25 = {
9130
+ var pDef28 = {
8274
9131
  partName: "cylinder",
8275
9132
  params: [
8276
9133
  //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)
9134
+ pNumber28("D1", "mm", 100, 5, 500, 1),
9135
+ pNumber28("Di", "mm", 50, 2, 500, 1),
9136
+ pSectionSeparator28("Thickness"),
9137
+ pNumber28("T1", "mm", 30, 1, 500, 1)
8281
9138
  ],
8282
9139
  paramSvg: {
8283
9140
  D1: "cylinder_top.svg",
@@ -8291,10 +9148,10 @@ var pDef25 = {
8291
9148
  // every 0.5 second
8292
9149
  }
8293
9150
  };
8294
- function pGeom25(t, param, suffix = "") {
8295
- const rGeome = initGeom25(pDef25.partName + suffix);
8296
- const figCylinder = figure22();
8297
- const figHeight = figure22();
9151
+ function pGeom28(t, param, suffix = "") {
9152
+ const rGeome = initGeom28(pDef28.partName + suffix);
9153
+ const figCylinder = figure25();
9154
+ const figHeight = figure25();
8298
9155
  rGeome.logstr += `${rGeome.partName} simTime: ${t}
8299
9156
  `;
8300
9157
  try {
@@ -8305,13 +9162,13 @@ function pGeom25(t, param, suffix = "") {
8305
9162
  if (R1 < Ri) {
8306
9163
  throw `err071: D1 ${param.D1} is too small compare to Di ${param.Di}`;
8307
9164
  }
8308
- rGeome.logstr += `Surface ${ffix26(surface)} mm2, volume ${ffix26(volume)} mm3
9165
+ rGeome.logstr += `Surface ${ffix29(surface)} mm2, volume ${ffix29(volume)} mm3
8309
9166
  `;
8310
9167
  const ctrCylinder = contourCircle22(0, 0, R1);
8311
9168
  const ctrHole = contourCircle22(0, 0, Ri);
8312
9169
  figCylinder.addMainOI([ctrCylinder, ctrHole]);
8313
- figHeight.addMainO(ctrRectangle14(-R1, 0, 2 * R1, param.T1));
8314
- figHeight.addSecond(ctrRectangle14(-Ri, 0, 2 * Ri, param.T1));
9170
+ figHeight.addMainO(ctrRectangle17(-R1, 0, 2 * R1, param.T1));
9171
+ figHeight.addSecond(ctrRectangle17(-Ri, 0, 2 * Ri, param.T1));
8315
9172
  rGeome.fig = {
8316
9173
  faceCylinder: figCylinder,
8317
9174
  faceHeight: figHeight
@@ -8322,7 +9179,7 @@ function pGeom25(t, param, suffix = "") {
8322
9179
  {
8323
9180
  outName: `subpax_${designName}_cyl`,
8324
9181
  face: `${designName}_faceCylinder`,
8325
- extrudeMethod: EExtrude21.eLinearOrtho,
9182
+ extrudeMethod: EExtrude24.eLinearOrtho,
8326
9183
  length: param.T1,
8327
9184
  rotate: [0, 0, 0],
8328
9185
  translate: [0, 0, 0]
@@ -8331,7 +9188,7 @@ function pGeom25(t, param, suffix = "") {
8331
9188
  volumes: [
8332
9189
  {
8333
9190
  outName: `pax_${designName}`,
8334
- boolMethod: EBVolume21.eIdentity,
9191
+ boolMethod: EBVolume24.eIdentity,
8335
9192
  inList: [`subpax_${designName}_cyl`]
8336
9193
  }
8337
9194
  ]
@@ -8348,10 +9205,11 @@ function pGeom25(t, param, suffix = "") {
8348
9205
  var cylinderDef = {
8349
9206
  pTitle: "cylinder",
8350
9207
  pDescription: "simple cylinder shape for experimenting systemix",
8351
- pDef: pDef25,
8352
- pGeom: pGeom25
9208
+ pDef: pDef28,
9209
+ pGeom: pGeom28
8353
9210
  };
8354
9211
  export {
9212
+ bridgeDef,
8355
9213
  capsuleDef,
8356
9214
  cylinderDef,
8357
9215
  door1arcDef,
@@ -8375,6 +9233,8 @@ export {
8375
9233
  springWormDef,
8376
9234
  squareDef,
8377
9235
  stoneTowerDef,
9236
+ trackXYDef,
9237
+ trackXZDef,
8378
9238
  triangleDef,
8379
9239
  tunnelDef
8380
9240
  };