desi77 0.1.10 → 0.1.12

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
@@ -864,40 +864,337 @@ var stoneTowerDef = {
864
864
  pGeom: pGeom2
865
865
  };
866
866
 
867
- // src/spring/springTorqueA.ts
867
+ // src/stone/house.ts
868
868
  import {
869
- point as point2,
870
869
  contour as contour3,
871
- contourCircle as contourCircle2,
870
+ ctrRectangle as ctrRectangle3,
872
871
  figure as figure3,
873
- radToDeg as radToDeg3,
874
872
  ffix as ffix3,
875
873
  pNumber as pNumber3,
876
- pCheckbox as pCheckbox2,
877
874
  pSectionSeparator as pSectionSeparator3,
878
875
  EExtrude as EExtrude3,
879
876
  EBVolume as EBVolume3,
880
877
  initGeom as initGeom3
881
878
  } from "geometrix";
882
879
  var pDef3 = {
880
+ partName: "house",
881
+ params: [
882
+ //pNumber(name, unit, init, min, max, step)
883
+ pNumber3("WA", "cm", 1e3, 100, 2e3, 1),
884
+ pNumber3("WB", "cm", 800, 100, 2e3, 1),
885
+ pNumber3("WC", "cm", 800, 100, 2e3, 1),
886
+ pNumber3("WD", "cm", 500, 100, 2e3, 1),
887
+ pNumber3("WE", "cm", 400, 100, 2e3, 1),
888
+ pSectionSeparator3("Heights"),
889
+ pNumber3("HA1", "cm", 400, 200, 2e3, 1),
890
+ pNumber3("HA2", "cm", 1200, 200, 2e3, 1),
891
+ pNumber3("HB1", "cm", 600, 200, 2e3, 1),
892
+ pNumber3("HB2", "cm", 1100, 200, 2e3, 1),
893
+ pNumber3("HC1", "cm", 700, 200, 2e3, 1),
894
+ pNumber3("HC2", "cm", 600, 200, 2e3, 1),
895
+ pNumber3("HD1", "cm", 700, 200, 2e3, 1),
896
+ pNumber3("HD2", "cm", 600, 200, 2e3, 1),
897
+ pNumber3("HE1", "cm", 1e3, 200, 2e3, 1),
898
+ pNumber3("HE2", "cm", 600, 200, 2e3, 1),
899
+ pSectionSeparator3("L-Lengths"),
900
+ pNumber3("L1", "cm", 1200, 200, 2e3, 1),
901
+ pNumber3("L2", "cm", 200, 200, 2e3, 1),
902
+ pNumber3("L3", "cm", 1500, 200, 2e3, 1),
903
+ pNumber3("S1", "cm", 200, 50, 2e3, 1),
904
+ pNumber3("S2", "cm", 300, 50, 2e3, 1),
905
+ pNumber3("S3", "cm", 100, 50, 2e3, 1),
906
+ pNumber3("Ht", "cm", 400, 50, 2e3, 1),
907
+ pSectionSeparator3("M-Lengths"),
908
+ pNumber3("M1", "cm", 200, 50, 2e3, 1),
909
+ pNumber3("M2", "cm", 400, 50, 2e3, 1),
910
+ pNumber3("M3", "cm", 800, 50, 2e3, 1),
911
+ pNumber3("M4", "cm", 100, 50, 2e3, 1),
912
+ pSectionSeparator3("Nest"),
913
+ pNumber3("AE1", "cm", 400, 50, 2e3, 1),
914
+ pNumber3("AE2", "cm", 300, 50, 2e3, 1),
915
+ pNumber3("BE1", "cm", 400, 50, 2e3, 1),
916
+ pNumber3("BE2", "cm", 400, 50, 2e3, 1)
917
+ ],
918
+ paramSvg: {
919
+ WA: "house_top.svg",
920
+ WB: "house_top.svg",
921
+ WC: "house_top.svg",
922
+ WD: "house_top.svg",
923
+ WE: "house_top.svg",
924
+ HA1: "house_pignon.svg",
925
+ HA2: "house_pignon.svg",
926
+ HB1: "house_pignon.svg",
927
+ HB2: "house_pignon.svg",
928
+ HC1: "house_pignon.svg",
929
+ HC2: "house_pignon.svg",
930
+ HD1: "house_pignon.svg",
931
+ HD2: "house_pignon.svg",
932
+ HE1: "house_pignon.svg",
933
+ HE2: "house_pignon.svg",
934
+ L1: "house_top.svg",
935
+ L2: "house_top.svg",
936
+ L3: "house_top.svg",
937
+ S1: "house_top.svg",
938
+ S2: "house_top.svg",
939
+ S3: "house_top.svg",
940
+ Ht: "house_top.svg",
941
+ M1: "house_top.svg",
942
+ M2: "house_top.svg",
943
+ M3: "house_top.svg",
944
+ M4: "house_top.svg",
945
+ AE1: "house_top.svg",
946
+ AE2: "house_top.svg",
947
+ BE1: "house_top.svg",
948
+ BE2: "house_top.svg"
949
+ },
950
+ sim: {
951
+ tMax: 180,
952
+ tStep: 0.5,
953
+ tUpdate: 500
954
+ // every 0.5 second
955
+ }
956
+ };
957
+ function pGeom3(t, param, suffix = "") {
958
+ const rGeome = initGeom3(pDef3.partName + suffix);
959
+ const figPA = figure3();
960
+ const figPB = figure3();
961
+ const figPC = figure3();
962
+ const figPD = figure3();
963
+ const figPE = figure3();
964
+ const figTerrasse = figure3();
965
+ rGeome.logstr += `${rGeome.partName} simTime: ${t}
966
+ `;
967
+ try {
968
+ let makeCtrPignon2 = function(iW2, iH1, iH2) {
969
+ const rCtr = contour3(-iW2, 0).addSegStrokeR(2 * iW2, 0).addSegStrokeR(0, iH1).addSegStrokeR(-iW2, iH2).addSegStrokeR(-iW2, -iH2).closeSegStroke();
970
+ return rCtr;
971
+ }, makeCtrPtop2 = function(iW2, iL, iOrientation, iX, iY) {
972
+ const rCtr = ctrRectangle3(-iW2, 0, 2 * iW2, iL).rotate(0, 0, (2 + iOrientation) * pi2).translate(iX, iY);
973
+ return rCtr;
974
+ };
975
+ var makeCtrPignon = makeCtrPignon2, makeCtrPtop = makeCtrPtop2;
976
+ const WA2 = param.WA / 2;
977
+ const WB2 = param.WB / 2;
978
+ const WC2 = param.WC / 2;
979
+ const WD2 = param.WD / 2;
980
+ const WE2 = param.WE / 2;
981
+ const HAtotal = param.HA1 + param.HA2;
982
+ const HBtotal = param.HB1 + param.HB2;
983
+ const HCtotal = param.HC1 + param.HC2;
984
+ const HDtotal = param.HD1 + param.HD2;
985
+ const HEtotal = param.HE1 + param.HE2;
986
+ if (HBtotal < HAtotal) {
987
+ throw `err167: HBtotal ${ffix3(HBtotal)} is too small compare to HAtotal ${ffix3(HAtotal)}`;
988
+ }
989
+ rGeome.logstr += `HAtotal ${ffix3(HAtotal / 100)} m
990
+ `;
991
+ rGeome.logstr += `HBtotal ${ffix3(HBtotal / 100)} m
992
+ `;
993
+ rGeome.logstr += `HCtotal ${ffix3(HCtotal / 100)} m
994
+ `;
995
+ rGeome.logstr += `HDtotal ${ffix3(HDtotal / 100)} m
996
+ `;
997
+ rGeome.logstr += `HEtotal ${ffix3(HEtotal / 100)} m
998
+ `;
999
+ const pi2 = Math.PI / 2;
1000
+ figPA.addMainO(makeCtrPignon2(WA2, param.HA1, param.HA2));
1001
+ figPB.addMainO(makeCtrPignon2(WB2, param.HB1, param.HB2));
1002
+ figPC.addMainO(makeCtrPignon2(WC2, param.HC1, param.HC2));
1003
+ figPD.addMainO(makeCtrPignon2(WD2, param.HD1, param.HD2));
1004
+ figPE.addMainO(makeCtrPignon2(WE2, param.HE1, param.HE2));
1005
+ figPA.mergeFigure(figPB.translate(WA2 + WB2, 0), true);
1006
+ figPA.mergeFigure(figPC.translate(WA2 + 2 * WB2 + WC2, 0), true);
1007
+ figPA.mergeFigure(figPD.translate(WA2 + 2 * (WB2 + WC2) + WD2, 0), true);
1008
+ figPA.mergeFigure(figPE.translate(WA2 + 2 * (WB2 + WC2 + WD2) + WE2, 0), true);
1009
+ figPA.addSecond(ctrRectangle3(-WA2 - param.S2, 0, param.S2, param.Ht));
1010
+ const xTerrasse1 = WB2 + 2 * WC2 + param.L1;
1011
+ const xTerrasse2 = WB2 + param.L3 / 2;
1012
+ const pALenW = xTerrasse1;
1013
+ const pALenE = WB2 + param.L2;
1014
+ const pBLenN = WA2 + param.M2;
1015
+ const pBLenS = WA2 + param.M3 + param.M4;
1016
+ const pCLenN = WA2 + param.M1;
1017
+ const pCx = -WB2 - WC2;
1018
+ const pD1LenS = WA2;
1019
+ const pD1x = -WB2 - param.L3 + WD2 + param.S3;
1020
+ const pD2LenE = WB2;
1021
+ const pD2y = -WA2 - param.M3 + WD2;
1022
+ const pE1LenS = param.AE1;
1023
+ const pE1x = -param.BE1 - WE2;
1024
+ const pE2LenW = param.AE2;
1025
+ const pE2y = -param.BE2 - WE2;
1026
+ figTerrasse.addMainO(makeCtrPtop2(WA2 / 2, param.S1, 3, -xTerrasse1, 0));
1027
+ figTerrasse.addMainO(makeCtrPtop2(param.L3 / 2, param.S2, 0, -xTerrasse2, -WA2));
1028
+ figTerrasse.addSecond(makeCtrPtop2(WA2, pALenW, 3, 0, 0));
1029
+ figTerrasse.addSecond(makeCtrPtop2(WA2, pALenE, 1, 0, 0));
1030
+ figTerrasse.addSecond(makeCtrPtop2(WB2, pBLenN, 2, 0, 0));
1031
+ figTerrasse.addSecond(makeCtrPtop2(WB2, pBLenS, 0, 0, 0));
1032
+ figTerrasse.addSecond(makeCtrPtop2(WC2, pCLenN, 2, pCx, 0));
1033
+ figTerrasse.addSecond(makeCtrPtop2(WD2, pD1LenS, 0, pD1x, 0));
1034
+ figTerrasse.addSecond(makeCtrPtop2(WD2, pD2LenE, 1, 0, pD2y));
1035
+ figTerrasse.addSecond(makeCtrPtop2(WE2, pE1LenS, 0, pE1x, 0));
1036
+ figTerrasse.addSecond(makeCtrPtop2(WE2, pE2LenW, 3, 0, pE2y));
1037
+ rGeome.fig = {
1038
+ facePA: figPA,
1039
+ facePB: figPB,
1040
+ facePC: figPC,
1041
+ facePD: figPD,
1042
+ facePE: figPE,
1043
+ faceTerrasse: figTerrasse
1044
+ };
1045
+ const designName = rGeome.partName;
1046
+ rGeome.vol = {
1047
+ extrudes: [
1048
+ {
1049
+ outName: `subpax_${designName}_pAw`,
1050
+ face: `${designName}_facePA`,
1051
+ extrudeMethod: EExtrude3.eLinearOrtho,
1052
+ length: pALenW,
1053
+ rotate: [pi2, 0, 3 * pi2],
1054
+ translate: [0, 0, 0]
1055
+ },
1056
+ {
1057
+ outName: `subpax_${designName}_pAe`,
1058
+ face: `${designName}_facePA`,
1059
+ extrudeMethod: EExtrude3.eLinearOrtho,
1060
+ length: pALenE,
1061
+ rotate: [pi2, 0, 1 * pi2],
1062
+ translate: [0, 0, 0]
1063
+ },
1064
+ {
1065
+ outName: `subpax_${designName}_pBn`,
1066
+ face: `${designName}_facePB`,
1067
+ extrudeMethod: EExtrude3.eLinearOrtho,
1068
+ length: pBLenN,
1069
+ rotate: [pi2, 0, 2 * pi2],
1070
+ translate: [0, 0, 0]
1071
+ },
1072
+ {
1073
+ outName: `subpax_${designName}_pBs`,
1074
+ face: `${designName}_facePB`,
1075
+ extrudeMethod: EExtrude3.eLinearOrtho,
1076
+ length: pBLenS,
1077
+ rotate: [pi2, 0, 0 * pi2],
1078
+ translate: [0, 0, 0]
1079
+ },
1080
+ {
1081
+ outName: `subpax_${designName}_pCn`,
1082
+ face: `${designName}_facePC`,
1083
+ extrudeMethod: EExtrude3.eLinearOrtho,
1084
+ length: pCLenN,
1085
+ rotate: [pi2, 0, 2 * pi2],
1086
+ translate: [pCx, 0, 0]
1087
+ },
1088
+ {
1089
+ outName: `subpax_${designName}_pD1s`,
1090
+ face: `${designName}_facePD`,
1091
+ extrudeMethod: EExtrude3.eLinearOrtho,
1092
+ length: pD1LenS,
1093
+ rotate: [pi2, 0, 0 * pi2],
1094
+ translate: [pD1x, 0, 0]
1095
+ },
1096
+ {
1097
+ outName: `subpax_${designName}_pD2e`,
1098
+ face: `${designName}_facePD`,
1099
+ extrudeMethod: EExtrude3.eLinearOrtho,
1100
+ length: pD2LenE,
1101
+ rotate: [pi2, 0, 1 * pi2],
1102
+ translate: [0, pD2y, 0]
1103
+ },
1104
+ {
1105
+ outName: `subpax_${designName}_pE1s`,
1106
+ face: `${designName}_facePE`,
1107
+ extrudeMethod: EExtrude3.eLinearOrtho,
1108
+ length: pE1LenS,
1109
+ rotate: [pi2, 0, 0 * pi2],
1110
+ translate: [pE1x, 0, 0]
1111
+ },
1112
+ {
1113
+ outName: `subpax_${designName}_pE2w`,
1114
+ face: `${designName}_facePE`,
1115
+ extrudeMethod: EExtrude3.eLinearOrtho,
1116
+ length: pE2LenW,
1117
+ rotate: [pi2, 0, 3 * pi2],
1118
+ translate: [0, pE2y, 0]
1119
+ },
1120
+ {
1121
+ outName: `subpax_${designName}_terras`,
1122
+ face: `${designName}_faceTerrasse`,
1123
+ extrudeMethod: EExtrude3.eLinearOrtho,
1124
+ length: param.Ht,
1125
+ rotate: [0, 0, 0],
1126
+ translate: [0, 0, 0]
1127
+ }
1128
+ ],
1129
+ volumes: [
1130
+ {
1131
+ outName: `pax_${designName}`,
1132
+ boolMethod: EBVolume3.eUnion,
1133
+ inList: [
1134
+ `subpax_${designName}_pAw`,
1135
+ `subpax_${designName}_pAe`,
1136
+ `subpax_${designName}_pBn`,
1137
+ `subpax_${designName}_pBs`,
1138
+ `subpax_${designName}_pCn`,
1139
+ `subpax_${designName}_pD1s`,
1140
+ `subpax_${designName}_pD2e`,
1141
+ `subpax_${designName}_pE1s`,
1142
+ `subpax_${designName}_pE2w`,
1143
+ `subpax_${designName}_terras`
1144
+ ]
1145
+ }
1146
+ ]
1147
+ };
1148
+ rGeome.sub = {};
1149
+ rGeome.logstr += "house drawn successfully!\n";
1150
+ rGeome.calcErr = false;
1151
+ } catch (emsg) {
1152
+ rGeome.logstr += emsg;
1153
+ console.log(emsg);
1154
+ }
1155
+ return rGeome;
1156
+ }
1157
+ var houseDef = {
1158
+ pTitle: "house",
1159
+ pDescription: "the envelop of an house with large roof",
1160
+ pDef: pDef3,
1161
+ pGeom: pGeom3
1162
+ };
1163
+
1164
+ // src/spring/springTorqueA.ts
1165
+ import {
1166
+ point as point2,
1167
+ contour as contour4,
1168
+ contourCircle as contourCircle2,
1169
+ figure as figure4,
1170
+ radToDeg as radToDeg3,
1171
+ ffix as ffix4,
1172
+ pNumber as pNumber4,
1173
+ pCheckbox as pCheckbox2,
1174
+ pSectionSeparator as pSectionSeparator4,
1175
+ EExtrude as EExtrude4,
1176
+ EBVolume as EBVolume4,
1177
+ initGeom as initGeom4
1178
+ } from "geometrix";
1179
+ var pDef4 = {
883
1180
  partName: "springTorqueA",
884
1181
  params: [
885
1182
  //pNumber(name, unit, init, min, max, step)
886
- pNumber3("D1", "mm", 20, 1, 1e3, 1),
887
- pNumber3("N1", "hole", 16, 0, 400, 1),
888
- pNumber3("T1", "mm", 2, 0.1, 50, 0.1),
889
- pNumber3("E1", "mm", 1, 0.1, 50, 0.1),
890
- pSectionSeparator3("External ring"),
1183
+ pNumber4("D1", "mm", 20, 1, 1e3, 1),
1184
+ pNumber4("N1", "hole", 16, 0, 400, 1),
1185
+ pNumber4("T1", "mm", 2, 0.1, 50, 0.1),
1186
+ pNumber4("E1", "mm", 1, 0.1, 50, 0.1),
1187
+ pSectionSeparator4("External ring"),
891
1188
  pCheckbox2("Ring2", true),
892
- pNumber3("D2", "mm", 80, 1, 1e3, 1),
893
- pNumber3("N2", "hole", 16, 0, 400, 1),
894
- pNumber3("T2", "mm", 2, 0.1, 50, 0.1),
895
- pNumber3("E2", "mm", 1, 0.1, 50, 0.1),
896
- pSectionSeparator3("Spoke"),
897
- pNumber3("N3", "spoke", 5, 0, 60, 1),
898
- pNumber3("E3", "mm", 3, 0.1, 100, 0.1),
899
- pNumber3("R3", "mm", 3, 0, 100, 0.1),
900
- pNumber3("Th", "mm", 3, 0.1, 100, 0.1)
1189
+ pNumber4("D2", "mm", 80, 1, 1e3, 1),
1190
+ pNumber4("N2", "hole", 16, 0, 400, 1),
1191
+ pNumber4("T2", "mm", 2, 0.1, 50, 0.1),
1192
+ pNumber4("E2", "mm", 1, 0.1, 50, 0.1),
1193
+ pSectionSeparator4("Spoke"),
1194
+ pNumber4("N3", "spoke", 5, 0, 60, 1),
1195
+ pNumber4("E3", "mm", 3, 0.1, 100, 0.1),
1196
+ pNumber4("R3", "mm", 3, 0, 100, 0.1),
1197
+ pNumber4("Th", "mm", 3, 0.1, 100, 0.1)
901
1198
  ],
902
1199
  paramSvg: {
903
1200
  D1: "springTorqueA_profile.svg",
@@ -921,9 +1218,9 @@ var pDef3 = {
921
1218
  // every 0.5 second
922
1219
  }
923
1220
  };
924
- function pGeom3(t, param, suffix = "") {
925
- const rGeome = initGeom3(pDef3.partName + suffix);
926
- const figProfile = figure3();
1221
+ function pGeom4(t, param, suffix = "") {
1222
+ const rGeome = initGeom4(pDef4.partName + suffix);
1223
+ const figProfile = figure4();
927
1224
  rGeome.logstr += `${rGeome.partName} simTime: ${t}
928
1225
  `;
929
1226
  try {
@@ -945,12 +1242,12 @@ function pGeom3(t, param, suffix = "") {
945
1242
  const aIntMin = 2 * Math.asin((RT1 + 0.5 * param.E1) / R1);
946
1243
  const aInt = param.N1 > 0 ? 2 * Math.PI / param.N1 : 3.14;
947
1244
  if (aInt < aIntMin) {
948
- throw `err101: aInt ${ffix3(radToDeg3(aInt))} is too small compare to aIntMin ${ffix3(radToDeg3(aIntMin))} degree`;
1245
+ throw `err101: aInt ${ffix4(radToDeg3(aInt))} is too small compare to aIntMin ${ffix4(radToDeg3(aIntMin))} degree`;
949
1246
  }
950
1247
  const aExtMin = 2 * Math.asin((RT2 + 0.5 * param.E2) / R2);
951
1248
  const aExt = param.N2 > 0 ? 2 * Math.PI / param.N2 : 3.14;
952
1249
  if (aExt < aExtMin) {
953
- throw `err106: aExt ${ffix3(radToDeg3(aExt))} is too small compare to aExtMin ${ffix3(radToDeg3(aExtMin))} degree`;
1250
+ throw `err106: aExt ${ffix4(radToDeg3(aExt))} is too small compare to aExtMin ${ffix4(radToDeg3(aExtMin))} degree`;
954
1251
  }
955
1252
  const ah2 = Math.asin(E32 / Rh2);
956
1253
  const ah1 = Math.asin(E32 / Rh1);
@@ -961,9 +1258,9 @@ function pGeom3(t, param, suffix = "") {
961
1258
  const Rh1b2 = sinah02 > 0.1 ? (E32 + param.R3) / sinah02 : Rh1 / 2;
962
1259
  const hollowTriangle = param.N3 > 1 && Rh1b2 > Rh1 + param.R3 - 0.1 ? true : false;
963
1260
  if (!hollowTriangle && ah0 < 2 * ahR1) {
964
- throw `err115: ah0 ${ffix3(radToDeg3(ah0))} is too small compare to ah1 ${ffix3(radToDeg3(ah1))}, ahR1 ${ffix3(radToDeg3(ahR1))} degree`;
1261
+ throw `err115: ah0 ${ffix4(radToDeg3(ah0))} is too small compare to ah1 ${ffix4(radToDeg3(ah1))}, ahR1 ${ffix4(radToDeg3(ahR1))} degree`;
965
1262
  }
966
- rGeome.logstr += `Dmax ${ffix3(2 * Rmax)}, Dmin ${ffix3(2 * Rmin)} mm
1263
+ rGeome.logstr += `Dmax ${ffix4(2 * Rmax)}, Dmin ${ffix4(2 * Rmin)} mm
967
1264
  `;
968
1265
  rGeome.logstr += `Triangle vs quadri: ${hollowTriangle ? "triangle" : "quadri"}
969
1266
  `;
@@ -986,7 +1283,7 @@ function pGeom3(t, param, suffix = "") {
986
1283
  const p1 = point2(0, 0).translatePolar(aRef + ah1, Rh1);
987
1284
  const p1b = point2(0, 0).translatePolar(aRef + ah0 / 2, Rh1b);
988
1285
  const [x0, y0] = hollowTriangle ? [p1b.cx, p1b.cy] : [p1.cx, p1.cy];
989
- const iCtr = contour3(x0, y0).addCornerRounded(param.R3).addSegStrokeAP(aRef + ah2, Rh2).addCornerRounded(param.R3).addPointAP(aRef + ah0 / 2, Rh2).addPointAP(aRef + ah0 - ah2, Rh2).addSegArc2().addCornerRounded(param.R3);
1286
+ const iCtr = contour4(x0, y0).addCornerRounded(param.R3).addSegStrokeAP(aRef + ah2, Rh2).addCornerRounded(param.R3).addPointAP(aRef + ah0 / 2, Rh2).addPointAP(aRef + ah0 - ah2, Rh2).addSegArc2().addCornerRounded(param.R3);
990
1287
  if (hollowTriangle) {
991
1288
  iCtr.closeSegStroke();
992
1289
  } else {
@@ -1008,7 +1305,7 @@ function pGeom3(t, param, suffix = "") {
1008
1305
  {
1009
1306
  outName: `subpax_${designName}_profile`,
1010
1307
  face: `${designName}_faceProfile`,
1011
- extrudeMethod: EExtrude3.eLinearOrtho,
1308
+ extrudeMethod: EExtrude4.eLinearOrtho,
1012
1309
  length: param.Th,
1013
1310
  rotate: [0, 0, 0],
1014
1311
  translate: [0, 0, 0]
@@ -1017,7 +1314,7 @@ function pGeom3(t, param, suffix = "") {
1017
1314
  volumes: [
1018
1315
  {
1019
1316
  outName: `pax_${designName}`,
1020
- boolMethod: EBVolume3.eIdentity,
1317
+ boolMethod: EBVolume4.eIdentity,
1021
1318
  inList: [`subpax_${designName}_profile`]
1022
1319
  }
1023
1320
  ]
@@ -1034,36 +1331,36 @@ function pGeom3(t, param, suffix = "") {
1034
1331
  var springTorqueADef = {
1035
1332
  pTitle: "springTorqueA",
1036
1333
  pDescription: "spring disc for torque transmission",
1037
- pDef: pDef3,
1038
- pGeom: pGeom3
1334
+ pDef: pDef4,
1335
+ pGeom: pGeom4
1039
1336
  };
1040
1337
 
1041
1338
  // src/spring/plugTorque.ts
1042
1339
  import {
1043
1340
  withinPiPi as withinPiPi2,
1044
1341
  point as point3,
1045
- contour as contour5,
1342
+ contour as contour6,
1046
1343
  contourCircle as contourCircle3,
1047
- figure as figure4,
1344
+ figure as figure5,
1048
1345
  degToRad as degToRad2,
1049
1346
  radToDeg as radToDeg5,
1050
- ffix as ffix5,
1051
- pNumber as pNumber4,
1347
+ ffix as ffix6,
1348
+ pNumber as pNumber5,
1052
1349
  pDropdown as pDropdown2,
1053
- pSectionSeparator as pSectionSeparator4,
1054
- EExtrude as EExtrude4,
1055
- EBVolume as EBVolume4,
1056
- initGeom as initGeom4
1350
+ pSectionSeparator as pSectionSeparator5,
1351
+ EExtrude as EExtrude5,
1352
+ EBVolume as EBVolume5,
1353
+ initGeom as initGeom5
1057
1354
  } from "geometrix";
1058
1355
  import { triALLrLAA as triALLrLAA2 } from "triangule";
1059
1356
 
1060
1357
  // src/spring/libPlugTorque.ts
1061
1358
  import {
1062
1359
  withinPiPi,
1063
- contour as contour4,
1360
+ contour as contour5,
1064
1361
  degToRad,
1065
1362
  radToDeg as radToDeg4,
1066
- ffix as ffix4
1363
+ ffix as ffix5
1067
1364
  } from "geometrix";
1068
1365
  import { triALLrLAA } from "triangule";
1069
1366
  function ctrPlugExtern(param, RbEmax) {
@@ -1093,9 +1390,9 @@ function ctrPlugExtern(param, RbEmax) {
1093
1390
  }
1094
1391
  const tooSmallAngle = 1e-4;
1095
1392
  if (aAddE < tooSmallAngle || aDedE < tooSmallAngle) {
1096
- throw `err164: aAddE ${ffix4(radToDeg4(aAddE))} or aDedE ${ffix4(radToDeg4(aDedE))} are too small`;
1393
+ throw `err164: aAddE ${ffix5(radToDeg4(aAddE))} or aDedE ${ffix5(radToDeg4(aDedE))} are too small`;
1097
1394
  }
1098
- const ctrToothE = contour4(RminE, 0);
1395
+ const ctrToothE = contour5(RminE, 0);
1099
1396
  for (let ii = 0; ii < param.Nt; ii++) {
1100
1397
  const aRef = ii * aTooth;
1101
1398
  ctrToothE.addSegStrokeAP(aRef + aSlopeE, RbE).addCornerRounded(param.Rae);
@@ -1117,42 +1414,42 @@ function ctrPlugExtern(param, RbEmax) {
1117
1414
  }
1118
1415
 
1119
1416
  // src/spring/plugTorque.ts
1120
- var pDef4 = {
1417
+ var pDef5 = {
1121
1418
  partName: "plugTorque",
1122
1419
  params: [
1123
1420
  //pNumber(name, unit, init, min, max, step)
1124
- pNumber4("Nt", "teeth", 8, 1, 1e3, 1),
1125
- pNumber4("Dt", "mm", 22, 0.1, 1e3, 0.1),
1126
- pNumber4("Ht", "mm", 2, 0.1, 100, 0.1),
1127
- pNumber4("Th", "mm", 1, 0.1, 100, 0.1),
1421
+ pNumber5("Nt", "teeth", 8, 1, 1e3, 1),
1422
+ pNumber5("Dt", "mm", 22, 0.1, 1e3, 0.1),
1423
+ pNumber5("Ht", "mm", 2, 0.1, 100, 0.1),
1424
+ pNumber5("Th", "mm", 1, 0.1, 100, 0.1),
1128
1425
  pDropdown2("make3D", ["both", "intern", "extern"]),
1129
- pSectionSeparator4("Tooth profile"),
1130
- pNumber4("ati", "%", 50, 1, 99, 0.1),
1131
- pNumber4("ate", "%", 52, 1, 99, 1),
1132
- pNumber4("ah", "%", 100, 1, 400, 1),
1133
- pNumber4("dh", "%", 100, 1, 400, 1),
1134
- pNumber4("aeh", "%", 10, 0, 100, 1),
1135
- pNumber4("deh", "%", 10, 0, 100, 1),
1136
- pNumber4("aM", "degree", 0, -30, 30, 0.1),
1137
- pSectionSeparator4("Tooth profile details"),
1426
+ pSectionSeparator5("Tooth profile"),
1427
+ pNumber5("ati", "%", 50, 1, 99, 0.1),
1428
+ pNumber5("ate", "%", 52, 1, 99, 1),
1429
+ pNumber5("ah", "%", 100, 1, 400, 1),
1430
+ pNumber5("dh", "%", 100, 1, 400, 1),
1431
+ pNumber5("aeh", "%", 10, 0, 100, 1),
1432
+ pNumber5("deh", "%", 10, 0, 100, 1),
1433
+ pNumber5("aM", "degree", 0, -30, 30, 0.1),
1434
+ pSectionSeparator5("Tooth profile details"),
1138
1435
  pDropdown2("SnAai", ["stroke", "arc"]),
1139
1436
  pDropdown2("SnAae", ["stroke", "arc"]),
1140
1437
  pDropdown2("SnAdi", ["stroke", "arc"]),
1141
1438
  pDropdown2("SnAde", ["stroke", "arc"]),
1142
- pNumber4("Rai", "mm", 1, 0, 50, 0.1),
1143
- pNumber4("Rae", "mm", 1, 0, 50, 0.1),
1144
- pNumber4("Rdi", "mm", 1, 0, 50, 0.1),
1145
- pNumber4("Rde", "mm", 1, 0, 50, 0.1),
1146
- pSectionSeparator4("Internal part"),
1147
- pNumber4("Ni", "holes", 5, 0, 1e3, 1),
1148
- pNumber4("Di", "mm", 12, 0.1, 1e3, 0.1),
1149
- pNumber4("DTi", "mm", 3, 0.1, 100, 0.1),
1150
- pNumber4("Ei", "mm", 1, 0.1, 100, 0.1),
1151
- pSectionSeparator4("External part"),
1152
- pNumber4("Ne", "holes", 8, 0, 1e3, 1),
1153
- pNumber4("De", "mm", 32, 0.1, 1e3, 0.1),
1154
- pNumber4("DTe", "mm", 3, 0.1, 100, 0.1),
1155
- pNumber4("Ee", "mm", 1, 0.1, 100, 0.1)
1439
+ pNumber5("Rai", "mm", 1, 0, 50, 0.1),
1440
+ pNumber5("Rae", "mm", 1, 0, 50, 0.1),
1441
+ pNumber5("Rdi", "mm", 1, 0, 50, 0.1),
1442
+ pNumber5("Rde", "mm", 1, 0, 50, 0.1),
1443
+ pSectionSeparator5("Internal part"),
1444
+ pNumber5("Ni", "holes", 5, 0, 1e3, 1),
1445
+ pNumber5("Di", "mm", 12, 0.1, 1e3, 0.1),
1446
+ pNumber5("DTi", "mm", 3, 0.1, 100, 0.1),
1447
+ pNumber5("Ei", "mm", 1, 0.1, 100, 0.1),
1448
+ pSectionSeparator5("External part"),
1449
+ pNumber5("Ne", "holes", 8, 0, 1e3, 1),
1450
+ pNumber5("De", "mm", 32, 0.1, 1e3, 0.1),
1451
+ pNumber5("DTe", "mm", 3, 0.1, 100, 0.1),
1452
+ pNumber5("Ee", "mm", 1, 0.1, 100, 0.1)
1156
1453
  ],
1157
1454
  paramSvg: {
1158
1455
  Nt: "plugTorque_teeth_radial.svg",
@@ -1191,10 +1488,10 @@ var pDef4 = {
1191
1488
  // every 0.5 second
1192
1489
  }
1193
1490
  };
1194
- function pGeom4(t, param, suffix = "") {
1195
- const rGeome = initGeom4(pDef4.partName + suffix);
1196
- const figIntern = figure4();
1197
- const figExtern = figure4();
1491
+ function pGeom5(t, param, suffix = "") {
1492
+ const rGeome = initGeom5(pDef5.partName + suffix);
1493
+ const figIntern = figure5();
1494
+ const figExtern = figure5();
1198
1495
  rGeome.logstr += `${rGeome.partName} simTime: ${t}
1199
1496
  `;
1200
1497
  try {
@@ -1249,10 +1546,10 @@ function pGeom4(t, param, suffix = "") {
1249
1546
  throw `err087: RminI ${RminI} is too small because of Di ${param.Di}, DTi ${param.DTi} or Ei ${param.Ei}`;
1250
1547
  }
1251
1548
  if (adTi < 2 * aMindTi) {
1252
- throw `err131: adTi ${ffix5(radToDeg5(adTi))} is too small compare to aMindTi ${ffix5(radToDeg5(aMindTi))} degree`;
1549
+ throw `err131: adTi ${ffix6(radToDeg5(adTi))} is too small compare to aMindTi ${ffix6(radToDeg5(aMindTi))} degree`;
1253
1550
  }
1254
1551
  if (adTe < 2 * aMindTe) {
1255
- throw `err134: adTe ${ffix5(radToDeg5(adTe))} is too small compare to aMindTe ${ffix5(radToDeg5(aMindTe))} degree`;
1552
+ throw `err134: adTe ${ffix6(radToDeg5(adTe))} is too small compare to aMindTe ${ffix6(radToDeg5(aMindTe))} degree`;
1256
1553
  }
1257
1554
  if (param.ati > param.ate) {
1258
1555
  throw `err145: ate ${param.ate} is too small compare to ati ${param.ati} %`;
@@ -1265,22 +1562,22 @@ function pGeom4(t, param, suffix = "") {
1265
1562
  }
1266
1563
  const tooSmallAngle = 1e-4;
1267
1564
  if (aAddI < tooSmallAngle || aDedI < tooSmallAngle) {
1268
- throw `err161: aAddI ${ffix5(radToDeg5(aAddI))} or aDedI ${ffix5(radToDeg5(aDedI))} are too small`;
1565
+ throw `err161: aAddI ${ffix6(radToDeg5(aAddI))} or aDedI ${ffix6(radToDeg5(aDedI))} are too small`;
1269
1566
  }
1270
1567
  if (aAddE < tooSmallAngle || aDedE < tooSmallAngle) {
1271
- throw `err164: aAddE ${ffix5(radToDeg5(aAddE))} or aDedE ${ffix5(radToDeg5(aDedE))} are too small`;
1568
+ throw `err164: aAddE ${ffix6(radToDeg5(aAddE))} or aDedE ${ffix6(radToDeg5(aDedE))} are too small`;
1272
1569
  }
1273
- rGeome.logstr += `Extern: Dmax ${ffix5(2 * RmaxE)}, Dmin ${ffix5(2 * RminE)} mm
1570
+ rGeome.logstr += `Extern: Dmax ${ffix6(2 * RmaxE)}, Dmin ${ffix6(2 * RminE)} mm
1274
1571
  `;
1275
- rGeome.logstr += `Intern: Dmax ${ffix5(2 * RmaxI)}, Dmin ${ffix5(2 * RminI)} mm
1572
+ rGeome.logstr += `Intern: Dmax ${ffix6(2 * RmaxI)}, Dmin ${ffix6(2 * RminI)} mm
1276
1573
  `;
1277
- rGeome.logstr += `aSlack: ${ffix5(radToDeg5(aSlack))} degree
1574
+ rGeome.logstr += `aSlack: ${ffix6(radToDeg5(aSlack))} degree
1278
1575
  `;
1279
- rGeome.logstr += `Tooth: Ht ${param.Ht}, moduli ${ffix5(moduli)}, Hti ${ffix5(Htai + Htdi)}, Hte ${ffix5(Htae + Htde)} mm
1576
+ rGeome.logstr += `Tooth: Ht ${param.Ht}, moduli ${ffix6(moduli)}, Hti ${ffix6(Htai + Htdi)}, Hte ${ffix6(Htae + Htde)} mm
1280
1577
  `;
1281
- rGeome.logstr += `Tooth angle intern: aM ${param.aM}, aM[adden] ${ffix5(radToDeg5(-aAddenI / 2))}, aM[deden] ${ffix5(radToDeg5((aTooth - aAddenI) / 2))} degree
1578
+ rGeome.logstr += `Tooth angle intern: aM ${param.aM}, aM[adden] ${ffix6(radToDeg5(-aAddenI / 2))}, aM[deden] ${ffix6(radToDeg5((aTooth - aAddenI) / 2))} degree
1282
1579
  `;
1283
- rGeome.logstr += `Tooth angle extern: aM ${param.aM}, aM[adden] ${ffix5(radToDeg5(-aAddenE / 2))}, aM[deden] ${ffix5(radToDeg5((aTooth - aAddenE) / 2))} degree
1580
+ rGeome.logstr += `Tooth angle extern: aM ${param.aM}, aM[adden] ${ffix6(radToDeg5(-aAddenE / 2))}, aM[deden] ${ffix6(radToDeg5((aTooth - aAddenE) / 2))} degree
1284
1581
  `;
1285
1582
  const ctrsI = [];
1286
1583
  ctrsI.push(contourCircle3(0, 0, RminI));
@@ -1288,7 +1585,7 @@ function pGeom4(t, param, suffix = "") {
1288
1585
  const p1 = point3(0, 0).translatePolar(ii * adTi, Ri);
1289
1586
  ctrsI.push(contourCircle3(p1.cx, p1.cy, RTi));
1290
1587
  }
1291
- const ctrToothI = contour5(RbI, 0);
1588
+ const ctrToothI = contour6(RbI, 0);
1292
1589
  for (let ii = 0; ii < param.Nt; ii++) {
1293
1590
  const aRef = ii * aTooth;
1294
1591
  ctrToothI.addSegStrokeAP(aRef + aSlopeI, RmaxI).addCornerRounded(param.Rai);
@@ -1351,7 +1648,7 @@ function pGeom4(t, param, suffix = "") {
1351
1648
  {
1352
1649
  outName: nameSubpaxIntern,
1353
1650
  face: `${designName}_faceIntern`,
1354
- extrudeMethod: EExtrude4.eLinearOrtho,
1651
+ extrudeMethod: EExtrude5.eLinearOrtho,
1355
1652
  length: param.Th,
1356
1653
  rotate: [0, 0, 0],
1357
1654
  translate: [0, 0, 0]
@@ -1359,7 +1656,7 @@ function pGeom4(t, param, suffix = "") {
1359
1656
  {
1360
1657
  outName: nameSubpaxExtern,
1361
1658
  face: `${designName}_faceExtern`,
1362
- extrudeMethod: EExtrude4.eLinearOrtho,
1659
+ extrudeMethod: EExtrude5.eLinearOrtho,
1363
1660
  length: param.Th,
1364
1661
  rotate: [0, 0, -aSlack / 2],
1365
1662
  translate: [0, 0, 0]
@@ -1368,7 +1665,7 @@ function pGeom4(t, param, suffix = "") {
1368
1665
  volumes: [
1369
1666
  {
1370
1667
  outName: `pax_${designName}`,
1371
- boolMethod: EBVolume4.eUnion,
1668
+ boolMethod: EBVolume5.eUnion,
1372
1669
  inList: nameList
1373
1670
  }
1374
1671
  ]
@@ -1385,66 +1682,66 @@ function pGeom4(t, param, suffix = "") {
1385
1682
  var plugTorqueDef = {
1386
1683
  pTitle: "plugTorque",
1387
1684
  pDescription: "plugable torque transmission",
1388
- pDef: pDef4,
1389
- pGeom: pGeom4
1685
+ pDef: pDef5,
1686
+ pGeom: pGeom5
1390
1687
  };
1391
1688
 
1392
1689
  // src/spring/springTorqueB.ts
1393
1690
  import {
1394
1691
  withinZeroPi,
1395
1692
  point as point4,
1396
- contour as contour6,
1693
+ contour as contour7,
1397
1694
  contourCircle as contourCircle4,
1398
- figure as figure5,
1695
+ figure as figure6,
1399
1696
  radToDeg as radToDeg6,
1400
- ffix as ffix6,
1401
- pNumber as pNumber5,
1697
+ ffix as ffix7,
1698
+ pNumber as pNumber6,
1402
1699
  pCheckbox as pCheckbox3,
1403
1700
  pDropdown as pDropdown3,
1404
- pSectionSeparator as pSectionSeparator5,
1405
- EExtrude as EExtrude5,
1406
- EBVolume as EBVolume5,
1407
- initGeom as initGeom5
1701
+ pSectionSeparator as pSectionSeparator6,
1702
+ EExtrude as EExtrude6,
1703
+ EBVolume as EBVolume6,
1704
+ initGeom as initGeom6
1408
1705
  } from "geometrix";
1409
- var pDef5 = {
1706
+ var pDef6 = {
1410
1707
  partName: "springTorqueB",
1411
1708
  params: [
1412
1709
  //pNumber(name, unit, init, min, max, step)
1413
- pNumber5("De", "mm", 80, 1, 1e3, 1),
1414
- pNumber5("Ne", "hole", 16, 0, 400, 1),
1415
- pNumber5("DTe", "mm", 2, 0.1, 50, 0.1),
1416
- pNumber5("Ee", "mm", 1, 0.1, 50, 0.1),
1710
+ pNumber6("De", "mm", 80, 1, 1e3, 1),
1711
+ pNumber6("Ne", "hole", 16, 0, 400, 1),
1712
+ pNumber6("DTe", "mm", 2, 0.1, 50, 0.1),
1713
+ pNumber6("Ee", "mm", 1, 0.1, 50, 0.1),
1417
1714
  pCheckbox3("Teeth", true),
1418
- pNumber5("Th", "mm", 3, 0.1, 100, 0.1),
1419
- pSectionSeparator5("Internal ring"),
1420
- pNumber5("Di", "mm", 30, 1, 1e3, 1),
1421
- pNumber5("Ni", "hole", 8, 0, 400, 1),
1422
- pNumber5("DTi", "mm", 2, 0.1, 50, 0.1),
1423
- pNumber5("Ei", "mm", 1, 0.1, 50, 0.1),
1424
- pSectionSeparator5("Spring"),
1425
- pNumber5("Ns", "spring", 6, 4, 60, 1),
1426
- pNumber5("aEs", "%", 10, 1, 90, 1),
1427
- pNumber5("Esi", "%", 10, 1, 90, 1),
1428
- pNumber5("Ese", "%", 10, 1, 90, 1),
1429
- pNumber5("Nk", "zigzag", 3, 1, 100, 1),
1430
- pNumber5("Wk", "mm", 1, 0.1, 20, 0.1),
1431
- pNumber5("Wc", "mm", 1, 0.1, 20, 0.1),
1432
- pNumber5("Rrsi", "mm", 1, 0, 20, 0.1),
1433
- pNumber5("Rrse", "mm", 1, 0, 20, 0.1),
1434
- pSectionSeparator5("Tooth Profile"),
1435
- pNumber5("Nt", "teeth", 8, 1, 1e3, 1),
1436
- pNumber5("Dt", "mm", 20, 0.1, 1e3, 0.1),
1437
- pNumber5("Ht", "mm", 2, 0.1, 100, 0.1),
1438
- pNumber5("ate", "%", 52, 1, 99, 1),
1439
- pNumber5("ah", "%", 100, 1, 400, 1),
1440
- pNumber5("dh", "%", 100, 1, 400, 1),
1441
- pNumber5("aeh", "%", 10, 0, 100, 1),
1442
- pNumber5("aM", "degree", 0, -30, 30, 0.1),
1443
- pSectionSeparator5("Tooth profile details"),
1715
+ pNumber6("Th", "mm", 3, 0.1, 100, 0.1),
1716
+ pSectionSeparator6("Internal ring"),
1717
+ pNumber6("Di", "mm", 30, 1, 1e3, 1),
1718
+ pNumber6("Ni", "hole", 8, 0, 400, 1),
1719
+ pNumber6("DTi", "mm", 2, 0.1, 50, 0.1),
1720
+ pNumber6("Ei", "mm", 1, 0.1, 50, 0.1),
1721
+ pSectionSeparator6("Spring"),
1722
+ pNumber6("Ns", "spring", 6, 4, 60, 1),
1723
+ pNumber6("aEs", "%", 10, 1, 90, 1),
1724
+ pNumber6("Esi", "%", 10, 1, 90, 1),
1725
+ pNumber6("Ese", "%", 10, 1, 90, 1),
1726
+ pNumber6("Nk", "zigzag", 3, 1, 100, 1),
1727
+ pNumber6("Wk", "mm", 1, 0.1, 20, 0.1),
1728
+ pNumber6("Wc", "mm", 1, 0.1, 20, 0.1),
1729
+ pNumber6("Rrsi", "mm", 1, 0, 20, 0.1),
1730
+ pNumber6("Rrse", "mm", 1, 0, 20, 0.1),
1731
+ pSectionSeparator6("Tooth Profile"),
1732
+ pNumber6("Nt", "teeth", 8, 1, 1e3, 1),
1733
+ pNumber6("Dt", "mm", 20, 0.1, 1e3, 0.1),
1734
+ pNumber6("Ht", "mm", 2, 0.1, 100, 0.1),
1735
+ pNumber6("ate", "%", 52, 1, 99, 1),
1736
+ pNumber6("ah", "%", 100, 1, 400, 1),
1737
+ pNumber6("dh", "%", 100, 1, 400, 1),
1738
+ pNumber6("aeh", "%", 10, 0, 100, 1),
1739
+ pNumber6("aM", "degree", 0, -30, 30, 0.1),
1740
+ pSectionSeparator6("Tooth profile details"),
1444
1741
  pDropdown3("SnAae", ["stroke", "arc"]),
1445
1742
  pDropdown3("SnAde", ["stroke", "arc"]),
1446
- pNumber5("Rae", "mm", 1, 0, 50, 0.1),
1447
- pNumber5("Rde", "mm", 1, 0, 50, 0.1)
1743
+ pNumber6("Rae", "mm", 1, 0, 50, 0.1),
1744
+ pNumber6("Rde", "mm", 1, 0, 50, 0.1)
1448
1745
  ],
1449
1746
  paramSvg: {
1450
1747
  De: "springTorqueB_profile.svg",
@@ -1516,9 +1813,9 @@ function calcAzag(cx2, cx1, r2, r1) {
1516
1813
  }
1517
1814
  return [ra22, ra11];
1518
1815
  }
1519
- function pGeom5(t, param, suffix = "") {
1520
- const rGeome = initGeom5(pDef5.partName + suffix);
1521
- const figProfile = figure5();
1816
+ function pGeom6(t, param, suffix = "") {
1817
+ const rGeome = initGeom6(pDef6.partName + suffix);
1818
+ const figProfile = figure6();
1522
1819
  rGeome.logstr += `${rGeome.partName} simTime: ${t}
1523
1820
  `;
1524
1821
  try {
@@ -1562,12 +1859,12 @@ function pGeom5(t, param, suffix = "") {
1562
1859
  const aHMinI = 2 * Math.asin((RTi + 0.5 * param.Ei) / Ri);
1563
1860
  const aHI = param.Ni > 0 ? 2 * Math.PI / param.Ni : 3.14;
1564
1861
  if (aHI < aHMinI) {
1565
- throw `err126: aHI ${ffix6(radToDeg6(aHI))} is too small compare to aHMinI ${ffix6(radToDeg6(aHMinI))} degree`;
1862
+ throw `err126: aHI ${ffix7(radToDeg6(aHI))} is too small compare to aHMinI ${ffix7(radToDeg6(aHMinI))} degree`;
1566
1863
  }
1567
1864
  const aHMinE = 2 * Math.asin((RTe + 0.5 * param.Ee) / Re);
1568
1865
  const aHE = param.Ne > 0 ? 2 * Math.PI / param.Ne : 3.14;
1569
1866
  if (aHE < aHMinE) {
1570
- throw `err131: aHE ${ffix6(radToDeg6(aHE))} is too small compare to aHMinE ${ffix6(radToDeg6(aHMinE))} degree`;
1867
+ throw `err131: aHE ${ffix7(radToDeg6(aHE))} is too small compare to aHMinE ${ffix7(radToDeg6(aHMinE))} degree`;
1571
1868
  }
1572
1869
  const pts1 = [];
1573
1870
  const Rk1 = Rsi + Esi + dRLs - Rk;
@@ -1597,11 +1894,11 @@ function pGeom5(t, param, suffix = "") {
1597
1894
  const pt4 = point4(0, 0).translatePolar(-a14, Rsi);
1598
1895
  const Rks = Rk - Wk2;
1599
1896
  const Rkl = Rk + Wk2;
1600
- rGeome.logstr += `Dmax ${ffix6(2 * Rmax)}, Dmin1 ${ffix6(2 * Rmin1)} mm
1897
+ rGeome.logstr += `Dmax ${ffix7(2 * Rmax)}, Dmin1 ${ffix7(2 * Rmin1)} mm
1601
1898
  `;
1602
- rGeome.logstr += `Spring area: aSpring ${ffix6(radToDeg6(aSpring))} degree, dRLs ${ffix6(dRLs)}, HLs ${ffix6(HLs)} mm
1899
+ rGeome.logstr += `Spring area: aSpring ${ffix7(radToDeg6(aSpring))} degree, dRLs ${ffix7(dRLs)}, HLs ${ffix7(HLs)} mm
1603
1900
  `;
1604
- rGeome.logstr += `Spring zigzag: Ek ${ffix6(Ek)}, Rk ${ffix6(Rk)} mm
1901
+ rGeome.logstr += `Spring zigzag: Ek ${ffix7(Ek)}, Rk ${ffix7(Rk)} mm
1605
1902
  `;
1606
1903
  const ctrExt = contourCircle4(0, 0, Rmax);
1607
1904
  const ctrsH = [];
@@ -1620,7 +1917,7 @@ function pGeom5(t, param, suffix = "") {
1620
1917
  const p1 = point4(0, 0).translatePolar(ii * aHE, Re);
1621
1918
  ctrsH.push(contourCircle4(p1.cx, p1.cy, RTe));
1622
1919
  }
1623
- const ctrSpringEnv = contour6(Rsi + Esi, 0).addSegStrokeAP(0, Rse - Ese).addPointAP(aSpring / 2, Rse - Ese).addPointAP(aSpring, Rse - Ese).addSegArc2().addSegStrokeAP(aSpring, Rsi + Esi).addPointAP(aSpring / 2, Rsi + Esi).addPointAP(0, Rsi + Esi).addSegArc2();
1920
+ const ctrSpringEnv = contour7(Rsi + Esi, 0).addSegStrokeAP(0, Rse - Ese).addPointAP(aSpring / 2, Rse - Ese).addPointAP(aSpring, Rse - Ese).addSegArc2().addSegStrokeAP(aSpring, Rsi + Esi).addPointAP(aSpring / 2, Rsi + Esi).addPointAP(0, Rsi + Esi).addSegArc2();
1624
1921
  figProfile.addSecond(ctrSpringEnv);
1625
1922
  figProfile.addSecond(ctrSpringEnv.rotate(0, 0, aSpringStep));
1626
1923
  figProfile.addSecond(ctrSpringEnv.rotate(0, 0, -aSpringStep));
@@ -1628,7 +1925,7 @@ function pGeom5(t, param, suffix = "") {
1628
1925
  figProfile.addSecond(contourCircle4(pts1[ii].cx, pts1[ii].cy, Rk));
1629
1926
  figProfile.addSecond(contourCircle4(pts2[ii].cx, pts2[ii].cy, Rk));
1630
1927
  }
1631
- const ctrPartial1 = contour6(pt1.cx, pt1.cy);
1928
+ const ctrPartial1 = contour7(pt1.cx, pt1.cy);
1632
1929
  for (let ii = 0; ii < param.Nk; ii++) {
1633
1930
  let a11 = -Math.PI / 2;
1634
1931
  const [a12, a21] = calcAzig(pts1[ii].cx, pts2[ii].cx, Rks, Rkl);
@@ -1662,7 +1959,7 @@ function pGeom5(t, param, suffix = "") {
1662
1959
  ctrPartial1.addPointA(pt2b.cx, pt2b.cy).addPointA(pt2c.cx, pt2c.cy).addSegArc2().addSegStrokeA(pt2.cx, pt2.cy);
1663
1960
  const [, firsta22] = calcAzig(pts1[param.Nk - 1].cx, pts2[param.Nk - 1].cx, Rkl, Rks);
1664
1961
  const firstp22 = pts2[param.Nk - 1].translatePolar(firsta22, Rks);
1665
- const ctrPartial2 = contour6(pt3.cx, pt3.cy).addSegStrokeA(pt3c.cx, pt3c.cy).addPointA(pt3b.cx, pt3b.cy).addPointA(firstp22.cx, firstp22.cy).addSegArc2();
1962
+ const ctrPartial2 = contour7(pt3.cx, pt3.cy).addSegStrokeA(pt3c.cx, pt3c.cy).addPointA(pt3b.cx, pt3b.cy).addPointA(firstp22.cx, firstp22.cy).addSegArc2();
1666
1963
  for (let ii = param.Nk - 1; ii >= 0; ii--) {
1667
1964
  let a21 = Math.PI / 2;
1668
1965
  let a12 = -Math.PI / 2;
@@ -1687,7 +1984,7 @@ function pGeom5(t, param, suffix = "") {
1687
1984
  ctrPartial2.addSegStrokeA(p11.cx, p11.cy).addPointA(p1b.cx, p1b.cy).addPointA(p12.cx, p12.cy).addSegArc2();
1688
1985
  }
1689
1986
  ctrPartial2.addSegStrokeA(pt4.cx, pt4.cy);
1690
- const ctrSpringHollow = contour6(pt1.cx, pt1.cy).addCornerRounded(param.Rrsi).addPartial(ctrPartial1).addCornerRounded(param.Rrse).addPointAP(aSpring + aSpringStep / 2, Rse).addPointAP(aSpring + aSpringStep - a23, Rse).addSegArc2().addCornerRounded(param.Rrse).addPartial(ctrPartial2.rotate(0, 0, aSpringStep)).addCornerRounded(param.Rrsi).addPointAP(aSpringStep / 2, Rsi).addPointAP(a14, Rsi).addSegArc2();
1987
+ const ctrSpringHollow = contour7(pt1.cx, pt1.cy).addCornerRounded(param.Rrsi).addPartial(ctrPartial1).addCornerRounded(param.Rrse).addPointAP(aSpring + aSpringStep / 2, Rse).addPointAP(aSpring + aSpringStep - a23, Rse).addSegArc2().addCornerRounded(param.Rrse).addPartial(ctrPartial2.rotate(0, 0, aSpringStep)).addCornerRounded(param.Rrsi).addPointAP(aSpringStep / 2, Rsi).addPointAP(a14, Rsi).addSegArc2();
1691
1988
  for (let ii = 0; ii < param.Ns; ii++) {
1692
1989
  ctrsH.push(ctrSpringHollow.rotate(0, 0, ii * aSpringStep));
1693
1990
  }
@@ -1701,7 +1998,7 @@ function pGeom5(t, param, suffix = "") {
1701
1998
  {
1702
1999
  outName: `subpax_${designName}_profile`,
1703
2000
  face: `${designName}_faceProfile`,
1704
- extrudeMethod: EExtrude5.eLinearOrtho,
2001
+ extrudeMethod: EExtrude6.eLinearOrtho,
1705
2002
  length: param.Th,
1706
2003
  rotate: [0, 0, 0],
1707
2004
  translate: [0, 0, 0]
@@ -1710,7 +2007,7 @@ function pGeom5(t, param, suffix = "") {
1710
2007
  volumes: [
1711
2008
  {
1712
2009
  outName: `pax_${designName}`,
1713
- boolMethod: EBVolume5.eIdentity,
2010
+ boolMethod: EBVolume6.eIdentity,
1714
2011
  inList: [`subpax_${designName}_profile`]
1715
2012
  }
1716
2013
  ]
@@ -1727,66 +2024,66 @@ function pGeom5(t, param, suffix = "") {
1727
2024
  var springTorqueBDef = {
1728
2025
  pTitle: "springTorqueB",
1729
2026
  pDescription: "spring disc for smooth torque transmission",
1730
- pDef: pDef5,
1731
- pGeom: pGeom5
2027
+ pDef: pDef6,
2028
+ pGeom: pGeom6
1732
2029
  };
1733
2030
 
1734
2031
  // src/spring/springTorqueC.ts
1735
2032
  import {
1736
2033
  point as point5,
1737
- contour as contour7,
2034
+ contour as contour8,
1738
2035
  contourCircle as contourCircle5,
1739
- figure as figure6,
2036
+ figure as figure7,
1740
2037
  radToDeg as radToDeg7,
1741
- ffix as ffix7,
1742
- pNumber as pNumber6,
2038
+ ffix as ffix8,
2039
+ pNumber as pNumber7,
1743
2040
  pCheckbox as pCheckbox4,
1744
2041
  pDropdown as pDropdown4,
1745
- pSectionSeparator as pSectionSeparator6,
1746
- EExtrude as EExtrude6,
1747
- EBVolume as EBVolume6,
1748
- initGeom as initGeom6
2042
+ pSectionSeparator as pSectionSeparator7,
2043
+ EExtrude as EExtrude7,
2044
+ EBVolume as EBVolume7,
2045
+ initGeom as initGeom7
1749
2046
  } from "geometrix";
1750
- var pDef6 = {
2047
+ var pDef7 = {
1751
2048
  partName: "springTorqueC",
1752
2049
  params: [
1753
2050
  //pNumber(name, unit, init, min, max, step)
1754
- pNumber6("De", "mm", 80, 1, 1e3, 1),
1755
- pNumber6("Ne", "hole", 16, 0, 400, 1),
1756
- pNumber6("DTe", "mm", 2, 0.1, 50, 0.1),
1757
- pNumber6("Ee", "mm", 1, 0.1, 50, 0.1),
2051
+ pNumber7("De", "mm", 80, 1, 1e3, 1),
2052
+ pNumber7("Ne", "hole", 16, 0, 400, 1),
2053
+ pNumber7("DTe", "mm", 2, 0.1, 50, 0.1),
2054
+ pNumber7("Ee", "mm", 1, 0.1, 50, 0.1),
1758
2055
  pCheckbox4("Teeth", true),
1759
- pNumber6("Th", "mm", 3, 0.1, 100, 0.1),
1760
- pSectionSeparator6("Internal ring"),
1761
- pNumber6("Di", "mm", 30, 1, 1e3, 1),
1762
- pNumber6("Ni", "hole", 8, 0, 400, 1),
1763
- pNumber6("DTi", "mm", 2, 0.1, 50, 0.1),
1764
- pNumber6("Ei", "mm", 1, 0.1, 50, 0.1),
1765
- pSectionSeparator6("Spring"),
1766
- pNumber6("Ns", "spring", 6, 1, 60, 1),
2056
+ pNumber7("Th", "mm", 3, 0.1, 100, 0.1),
2057
+ pSectionSeparator7("Internal ring"),
2058
+ pNumber7("Di", "mm", 30, 1, 1e3, 1),
2059
+ pNumber7("Ni", "hole", 8, 0, 400, 1),
2060
+ pNumber7("DTi", "mm", 2, 0.1, 50, 0.1),
2061
+ pNumber7("Ei", "mm", 1, 0.1, 50, 0.1),
2062
+ pSectionSeparator7("Spring"),
2063
+ pNumber7("Ns", "spring", 6, 1, 60, 1),
1767
2064
  pDropdown4("zig", ["alt", "one", "two"]),
1768
2065
  pDropdown4("zag", ["arc", "stroke"]),
1769
- pNumber6("aEs", "%", 20, 1, 99, 1),
1770
- pNumber6("Esi", "%", 10, 0, 90, 1),
1771
- pNumber6("Ese", "%", 10, 0, 90, 1),
1772
- pNumber6("Nk", "zigzag", 4, 2, 100, 1),
1773
- pNumber6("Wk", "mm", 1, 0.1, 20, 0.1),
1774
- pNumber6("Rrsi", "mm", 0.1, 0, 20, 0.1),
1775
- pNumber6("Rrse", "mm", 1, 0, 20, 0.1),
1776
- pSectionSeparator6("Tooth Profile"),
1777
- pNumber6("Nt", "teeth", 8, 1, 1e3, 1),
1778
- pNumber6("Dt", "mm", 20, 0.1, 1e3, 0.1),
1779
- pNumber6("Ht", "mm", 2, 0.1, 100, 0.1),
1780
- pNumber6("ate", "%", 52, 1, 99, 1),
1781
- pNumber6("ah", "%", 100, 1, 400, 1),
1782
- pNumber6("dh", "%", 100, 1, 400, 1),
1783
- pNumber6("aeh", "%", 10, 0, 100, 1),
1784
- pNumber6("aM", "degree", 0, -30, 30, 0.1),
1785
- pSectionSeparator6("Tooth profile details"),
2066
+ pNumber7("aEs", "%", 20, 1, 99, 1),
2067
+ pNumber7("Esi", "%", 10, 0, 90, 1),
2068
+ pNumber7("Ese", "%", 10, 0, 90, 1),
2069
+ pNumber7("Nk", "zigzag", 4, 2, 100, 1),
2070
+ pNumber7("Wk", "mm", 1, 0.1, 20, 0.1),
2071
+ pNumber7("Rrsi", "mm", 0.1, 0, 20, 0.1),
2072
+ pNumber7("Rrse", "mm", 1, 0, 20, 0.1),
2073
+ pSectionSeparator7("Tooth Profile"),
2074
+ pNumber7("Nt", "teeth", 8, 1, 1e3, 1),
2075
+ pNumber7("Dt", "mm", 20, 0.1, 1e3, 0.1),
2076
+ pNumber7("Ht", "mm", 2, 0.1, 100, 0.1),
2077
+ pNumber7("ate", "%", 52, 1, 99, 1),
2078
+ pNumber7("ah", "%", 100, 1, 400, 1),
2079
+ pNumber7("dh", "%", 100, 1, 400, 1),
2080
+ pNumber7("aeh", "%", 10, 0, 100, 1),
2081
+ pNumber7("aM", "degree", 0, -30, 30, 0.1),
2082
+ pSectionSeparator7("Tooth profile details"),
1786
2083
  pDropdown4("SnAae", ["stroke", "arc"]),
1787
2084
  pDropdown4("SnAde", ["stroke", "arc"]),
1788
- pNumber6("Rae", "mm", 1, 0, 50, 0.1),
1789
- pNumber6("Rde", "mm", 1, 0, 50, 0.1)
2085
+ pNumber7("Rae", "mm", 1, 0, 50, 0.1),
2086
+ pNumber7("Rde", "mm", 1, 0, 50, 0.1)
1790
2087
  ],
1791
2088
  paramSvg: {
1792
2089
  De: "springTorqueC_profile.svg",
@@ -1839,9 +2136,9 @@ function calcZagP2(pA, pE, lAB, lDE, iSign) {
1839
2136
  const rPt = pA.translatePolar(aAE + iSign * aCAB, lAB);
1840
2137
  return rPt;
1841
2138
  }
1842
- function pGeom6(t, param, suffix = "") {
1843
- const rGeome = initGeom6(pDef6.partName + suffix);
1844
- const figProfile = figure6();
2139
+ function pGeom7(t, param, suffix = "") {
2140
+ const rGeome = initGeom7(pDef7.partName + suffix);
2141
+ const figProfile = figure7();
1845
2142
  rGeome.logstr += `${rGeome.partName} simTime: ${t}
1846
2143
  `;
1847
2144
  try {
@@ -1886,7 +2183,7 @@ function pGeom6(t, param, suffix = "") {
1886
2183
  const aStart1 = iParity === 0 ? -Math.PI / 2 : Math.PI / 2 + aSpring;
1887
2184
  const siRk = iParity === 0 ? Rks : Rkl;
1888
2185
  const startPt1 = pts[0].translatePolar(aStart1, siRk);
1889
- const rCtr = contour7(startPt1.cx, startPt1.cy);
2186
+ const rCtr = contour8(startPt1.cx, startPt1.cy);
1890
2187
  for (let ii = 0; ii < param.Nk; ii++) {
1891
2188
  const iiParity3 = (ii + iParity) % 2;
1892
2189
  const apt = Math.atan2(pts[ii].cy, pts[ii].cx);
@@ -1936,7 +2233,7 @@ function pGeom6(t, param, suffix = "") {
1936
2233
  const aStart1 = eParity === 0 ? -Math.PI / 2 : Math.PI / 2 + aSpring;
1937
2234
  const siRk = eParity === 0 ? Rkl : Rks;
1938
2235
  const startPt1 = pts[param.Nk - 1].translatePolar(aStart1, siRk);
1939
- const rCtr = contour7(startPt1.cx, startPt1.cy);
2236
+ const rCtr = contour8(startPt1.cx, startPt1.cy);
1940
2237
  for (let ii = param.Nk - 1; ii >= 0; ii--) {
1941
2238
  const iiParity3 = (ii + iParity) % 2;
1942
2239
  const apt = Math.atan2(pts[ii].cy, pts[ii].cx);
@@ -1985,7 +2282,7 @@ function pGeom6(t, param, suffix = "") {
1985
2282
  const pp1 = ip1 === 0 ? ppp0 : ppp1;
1986
2283
  const pp2 = ip2 === 0 ? ppp0 : ppp1;
1987
2284
  const [ppib, ppeb] = pppb2(ip1, ip2);
1988
- const ctr = contour7(pp1[0].cx, pp1[0].cy).addCornerRounded(param.Rrsi).addSegStrokeA(pp1[1].cx, pp1[1].cy).addPartial(ctrPartial12(ip1)).addSegStrokeA(pp1[3].cx, pp1[3].cy).addCornerRounded(param.Rrse).addPointA(ppeb.cx, ppeb.cy).addPointA(pp2[4].cx, pp2[4].cy).addSegArc2().addCornerRounded(param.Rrse).addSegStrokeA(pp2[5].cx, pp2[5].cy).addPartial(ctrPartial22(ip2).rotate(0, 0, aSpringStep)).addSegStrokeA(pp2[7].cx, pp2[7].cy).addCornerRounded(param.Rrsi).addPointA(ppib.cx, ppib.cy).addPointA(pp1[0].cx, pp1[0].cy).addSegArc2();
2285
+ const ctr = contour8(pp1[0].cx, pp1[0].cy).addCornerRounded(param.Rrsi).addSegStrokeA(pp1[1].cx, pp1[1].cy).addPartial(ctrPartial12(ip1)).addSegStrokeA(pp1[3].cx, pp1[3].cy).addCornerRounded(param.Rrse).addPointA(ppeb.cx, ppeb.cy).addPointA(pp2[4].cx, pp2[4].cy).addSegArc2().addCornerRounded(param.Rrse).addSegStrokeA(pp2[5].cx, pp2[5].cy).addPartial(ctrPartial22(ip2).rotate(0, 0, aSpringStep)).addSegStrokeA(pp2[7].cx, pp2[7].cy).addCornerRounded(param.Rrsi).addPointA(ppib.cx, ppib.cy).addPointA(pp1[0].cx, pp1[0].cy).addSegArc2();
1989
2286
  return ctr.rotate(0, 0, ii * aSpringStep);
1990
2287
  };
1991
2288
  var prePoints = prePoints2, pppI = pppI2, externParity = externParity2, pppE = pppE2, iiParity = iiParity2, pppb = pppb2, ctrPartial1 = ctrPartial12, ctrPartial2 = ctrPartial22, ctrSpringHollow = ctrSpringHollow2;
@@ -2024,12 +2321,12 @@ function pGeom6(t, param, suffix = "") {
2024
2321
  const aHMinI = 2 * Math.asin((RTi + 0.5 * param.Ei) / Ri);
2025
2322
  const aHI = param.Ni > 0 ? 2 * Math.PI / param.Ni : 3.14;
2026
2323
  if (aHI < aHMinI) {
2027
- throw `err126: aHI ${ffix7(radToDeg7(aHI))} is too small compare to aHMinI ${ffix7(radToDeg7(aHMinI))} degree`;
2324
+ throw `err126: aHI ${ffix8(radToDeg7(aHI))} is too small compare to aHMinI ${ffix8(radToDeg7(aHMinI))} degree`;
2028
2325
  }
2029
2326
  const aHMinE = 2 * Math.asin((RTe + 0.5 * param.Ee) / Re);
2030
2327
  const aHE = param.Ne > 0 ? 2 * Math.PI / param.Ne : 3.14;
2031
2328
  if (aHE < aHMinE) {
2032
- throw `err131: aHE ${ffix7(radToDeg7(aHE))} is too small compare to aHMinE ${ffix7(radToDeg7(aHMinE))} degree`;
2329
+ throw `err131: aHE ${ffix8(radToDeg7(aHE))} is too small compare to aHMinE ${ffix8(radToDeg7(aHMinE))} degree`;
2033
2330
  }
2034
2331
  const pts0 = [];
2035
2332
  const pts1 = [];
@@ -2073,15 +2370,15 @@ function pGeom6(t, param, suffix = "") {
2073
2370
  ppp1.push(pppI2(-a18, 1, Rsi).rotateOrig(aSpringStep));
2074
2371
  const Rks = Rk - Wk2;
2075
2372
  const Rkl = Rk + Wk2;
2076
- rGeome.logstr += `Dmax ${ffix7(2 * Rmax)}, Dmin1 ${ffix7(2 * Rmin1)} mm
2373
+ rGeome.logstr += `Dmax ${ffix8(2 * Rmax)}, Dmin1 ${ffix8(2 * Rmin1)} mm
2077
2374
  `;
2078
- rGeome.logstr += `Spring area: aSpring ${ffix7(radToDeg7(aSpring))} degree, dRLs ${ffix7(dRLs)} mm
2375
+ rGeome.logstr += `Spring area: aSpring ${ffix8(radToDeg7(aSpring))} degree, dRLs ${ffix8(dRLs)} mm
2079
2376
  `;
2080
- rGeome.logstr += `Spring zigzag: Ek ${ffix7(Ek)}, Rk ${ffix7(Rk)} mm
2377
+ rGeome.logstr += `Spring zigzag: Ek ${ffix8(Ek)}, Rk ${ffix8(Rk)} mm
2081
2378
  `;
2082
2379
  if (aSpring < 2 * aArcMin) {
2083
2380
  zagArc = false;
2084
- rGeome.logstr += `Spring zigzag forced to stroke because of aArcMin ${ffix7(radToDeg7(aArcMin))} degree
2381
+ rGeome.logstr += `Spring zigzag forced to stroke because of aArcMin ${ffix8(radToDeg7(aArcMin))} degree
2085
2382
  `;
2086
2383
  }
2087
2384
  const ctrExt = contourCircle5(0, 0, Rmax);
@@ -2101,7 +2398,7 @@ function pGeom6(t, param, suffix = "") {
2101
2398
  const p1 = point5(0, 0).translatePolar(ii * aHE, Re);
2102
2399
  ctrsH.push(contourCircle5(p1.cx, p1.cy, RTe));
2103
2400
  }
2104
- const ctrSpringEnv = contour7(Rsi + Esi, 0).addSegStrokeAP(0, Rse - Ese).addPointAP(aSpring / 2, Rse - Ese).addPointAP(aSpring, Rse - Ese).addSegArc2().addSegStrokeAP(aSpring, Rsi + Esi).addPointAP(aSpring / 2, Rsi + Esi).addPointAP(0, Rsi + Esi).addSegArc2();
2401
+ const ctrSpringEnv = contour8(Rsi + Esi, 0).addSegStrokeAP(0, Rse - Ese).addPointAP(aSpring / 2, Rse - Ese).addPointAP(aSpring, Rse - Ese).addSegArc2().addSegStrokeAP(aSpring, Rsi + Esi).addPointAP(aSpring / 2, Rsi + Esi).addPointAP(0, Rsi + Esi).addSegArc2();
2105
2402
  figProfile.addSecond(ctrSpringEnv);
2106
2403
  figProfile.addSecond(ctrSpringEnv.rotate(0, 0, aSpringStep));
2107
2404
  figProfile.addSecond(ctrSpringEnv.rotate(0, 0, -aSpringStep));
@@ -2126,7 +2423,7 @@ function pGeom6(t, param, suffix = "") {
2126
2423
  {
2127
2424
  outName: `subpax_${designName}_profile`,
2128
2425
  face: `${designName}_faceProfile`,
2129
- extrudeMethod: EExtrude6.eLinearOrtho,
2426
+ extrudeMethod: EExtrude7.eLinearOrtho,
2130
2427
  length: param.Th,
2131
2428
  rotate: [0, 0, 0],
2132
2429
  translate: [0, 0, 0]
@@ -2135,7 +2432,7 @@ function pGeom6(t, param, suffix = "") {
2135
2432
  volumes: [
2136
2433
  {
2137
2434
  outName: `pax_${designName}`,
2138
- boolMethod: EBVolume6.eIdentity,
2435
+ boolMethod: EBVolume7.eIdentity,
2139
2436
  inList: [`subpax_${designName}_profile`]
2140
2437
  }
2141
2438
  ]
@@ -2152,64 +2449,64 @@ function pGeom6(t, param, suffix = "") {
2152
2449
  var springTorqueCDef = {
2153
2450
  pTitle: "springTorqueC",
2154
2451
  pDescription: "spring disc for smooth torque transmission",
2155
- pDef: pDef6,
2156
- pGeom: pGeom6
2452
+ pDef: pDef7,
2453
+ pGeom: pGeom7
2157
2454
  };
2158
2455
 
2159
2456
  // src/spring/springWorm.ts
2160
2457
  import {
2161
- contour as contour8,
2458
+ contour as contour9,
2162
2459
  contourCircle as contourCircle6,
2163
- ctrRectangle as ctrRectangle3,
2164
- figure as figure7,
2165
- ffix as ffix8,
2166
- pNumber as pNumber7,
2460
+ ctrRectangle as ctrRectangle4,
2461
+ figure as figure8,
2462
+ ffix as ffix9,
2463
+ pNumber as pNumber8,
2167
2464
  pDropdown as pDropdown5,
2168
- pSectionSeparator as pSectionSeparator7,
2169
- EExtrude as EExtrude7,
2170
- EBVolume as EBVolume7,
2171
- initGeom as initGeom7
2465
+ pSectionSeparator as pSectionSeparator8,
2466
+ EExtrude as EExtrude8,
2467
+ EBVolume as EBVolume8,
2468
+ initGeom as initGeom8
2172
2469
  } from "geometrix";
2173
2470
  function makeCtrGroove(x0, y0, xl, yl, roundTop) {
2174
2471
  const xl2 = xl / 2;
2175
2472
  const yl2 = yl - xl2;
2176
2473
  if (roundTop) {
2177
- const rCtr = contour8(x0, y0).addSegStrokeR(xl, 0).addSegStrokeR(0, yl2).addPointR(-xl2, xl2).addPointR(-xl, 0).addSegArc2().closeSegStroke();
2474
+ const rCtr = contour9(x0, y0).addSegStrokeR(xl, 0).addSegStrokeR(0, yl2).addPointR(-xl2, xl2).addPointR(-xl, 0).addSegArc2().closeSegStroke();
2178
2475
  return rCtr;
2179
2476
  } else {
2180
- const rCtr = contour8(x0, y0 + xl2).addPointR(xl2, -xl2).addPointR(xl, 0).addSegArc2().addSegStrokeR(0, yl2).addSegStrokeR(-xl, 0).closeSegStroke();
2477
+ const rCtr = contour9(x0, y0 + xl2).addPointR(xl2, -xl2).addPointR(xl, 0).addSegArc2().addSegStrokeR(0, yl2).addSegStrokeR(-xl, 0).closeSegStroke();
2181
2478
  return rCtr;
2182
2479
  }
2183
2480
  }
2184
- var pDef7 = {
2481
+ var pDef8 = {
2185
2482
  partName: "springWorm",
2186
2483
  params: [
2187
2484
  //pNumber(name, unit, init, min, max, step)
2188
- pNumber7("D1", "mm", 30, 2, 200, 1),
2189
- pNumber7("E1", "mm", 2, 0.1, 50, 0.1),
2190
- pNumber7("N1", "groove", 6, 2, 200, 1),
2191
- pNumber7("W2", "mm", 2, 0.1, 50, 0.1),
2192
- pNumber7("W3", "mm", 1, 0.1, 50, 0.1),
2193
- pNumber7("S1", "mm", 1, 0.1, 50, 0.1),
2194
- pSectionSeparator7("Extremity caps"),
2485
+ pNumber8("D1", "mm", 30, 2, 200, 1),
2486
+ pNumber8("E1", "mm", 2, 0.1, 50, 0.1),
2487
+ pNumber8("N1", "groove", 6, 2, 200, 1),
2488
+ pNumber8("W2", "mm", 2, 0.1, 50, 0.1),
2489
+ pNumber8("W3", "mm", 1, 0.1, 50, 0.1),
2490
+ pNumber8("S1", "mm", 1, 0.1, 50, 0.1),
2491
+ pSectionSeparator8("Extremity caps"),
2195
2492
  pDropdown5("leftCaps", ["ext", "int"]),
2196
2493
  pDropdown5("rightCaps", ["ext", "int"]),
2197
- pNumber7("W1", "mm", 2, 0.1, 50, 0.1),
2198
- pNumber7("W1b", "mm", 1, 0.1, 50, 0.1),
2199
- pSectionSeparator7("Tooth Profile"),
2200
- pNumber7("Nt", "teeth", 8, 1, 1e3, 1),
2201
- pNumber7("Dt", "mm", 20, 0.1, 1e3, 0.1),
2202
- pNumber7("Ht", "mm", 2, 0.1, 100, 0.1),
2203
- pNumber7("ate", "%", 52, 1, 99, 1),
2204
- pNumber7("ah", "%", 100, 1, 400, 1),
2205
- pNumber7("dh", "%", 100, 1, 400, 1),
2206
- pNumber7("aeh", "%", 10, 0, 100, 1),
2207
- pNumber7("aM", "degree", 0, -30, 30, 0.1),
2208
- pSectionSeparator7("Tooth profile details"),
2494
+ pNumber8("W1", "mm", 2, 0.1, 50, 0.1),
2495
+ pNumber8("W1b", "mm", 1, 0.1, 50, 0.1),
2496
+ pSectionSeparator8("Tooth Profile"),
2497
+ pNumber8("Nt", "teeth", 8, 1, 1e3, 1),
2498
+ pNumber8("Dt", "mm", 20, 0.1, 1e3, 0.1),
2499
+ pNumber8("Ht", "mm", 2, 0.1, 100, 0.1),
2500
+ pNumber8("ate", "%", 52, 1, 99, 1),
2501
+ pNumber8("ah", "%", 100, 1, 400, 1),
2502
+ pNumber8("dh", "%", 100, 1, 400, 1),
2503
+ pNumber8("aeh", "%", 10, 0, 100, 1),
2504
+ pNumber8("aM", "degree", 0, -30, 30, 0.1),
2505
+ pSectionSeparator8("Tooth profile details"),
2209
2506
  pDropdown5("SnAae", ["stroke", "arc"]),
2210
2507
  pDropdown5("SnAde", ["stroke", "arc"]),
2211
- pNumber7("Rae", "mm", 1, 0, 50, 0.1),
2212
- pNumber7("Rde", "mm", 1, 0, 50, 0.1)
2508
+ pNumber8("Rae", "mm", 1, 0, 50, 0.1),
2509
+ pNumber8("Rde", "mm", 1, 0, 50, 0.1)
2213
2510
  ],
2214
2511
  paramSvg: {
2215
2512
  D1: "springWorm_mid.svg",
@@ -2242,14 +2539,14 @@ var pDef7 = {
2242
2539
  // every 0.5 second
2243
2540
  }
2244
2541
  };
2245
- function pGeom7(t, param, suffix = "") {
2246
- const rGeome = initGeom7(pDef7.partName + suffix);
2247
- const figTube = figure7();
2248
- const figGroove1 = figure7();
2249
- const figGroove2 = figure7();
2250
- const figLeft = figure7();
2251
- const figRight = figure7();
2252
- const figW1b = figure7();
2542
+ function pGeom8(t, param, suffix = "") {
2543
+ const rGeome = initGeom8(pDef8.partName + suffix);
2544
+ const figTube = figure8();
2545
+ const figGroove1 = figure8();
2546
+ const figGroove2 = figure8();
2547
+ const figLeft = figure8();
2548
+ const figRight = figure8();
2549
+ const figW1b = figure8();
2253
2550
  rGeome.logstr += `${rGeome.partName} simTime: ${t}
2254
2551
  `;
2255
2552
  try {
@@ -2270,27 +2567,27 @@ function pGeom7(t, param, suffix = "") {
2270
2567
  if (R1 - S12 < W32) {
2271
2568
  throw `err130: R1 ${R1} is too small compare to S12 ${S12} or W32 ${W32}`;
2272
2569
  }
2273
- rGeome.logstr += `Dint ${ffix8(2 * Ri)} mm
2570
+ rGeome.logstr += `Dint ${ffix9(2 * Ri)} mm
2274
2571
  `;
2275
- rGeome.logstr += `Total length ${ffix8(lenTotal)} mm
2572
+ rGeome.logstr += `Total length ${ffix9(lenTotal)} mm
2276
2573
  `;
2277
2574
  const [ctrToothE, logE] = ctrPlugExtern(param, R1);
2278
2575
  rGeome.logstr += logE;
2279
2576
  figTube.addMainOI([contourCircle6(0, 0, R1), contourCircle6(0, 0, Ri)]);
2280
- figTube.addSecond(ctrRectangle3(S12, -R12, R1, 2 * R12));
2281
- figTube.addSecond(ctrRectangle3(-R1 - S12, -R12, R1, 2 * R12));
2282
- figTube.addSecond(ctrRectangle3(-R12, S12, 2 * R12, R1));
2283
- figTube.addSecond(ctrRectangle3(-R12, -R1 - S12, 2 * R12, R1));
2577
+ figTube.addSecond(ctrRectangle4(S12, -R12, R1, 2 * R12));
2578
+ figTube.addSecond(ctrRectangle4(-R1 - S12, -R12, R1, 2 * R12));
2579
+ figTube.addSecond(ctrRectangle4(-R12, S12, 2 * R12, R1));
2580
+ figTube.addSecond(ctrRectangle4(-R12, -R1 - S12, 2 * R12, R1));
2284
2581
  const ctrTubes = [];
2285
- ctrTubes.push(ctrRectangle3(0, -R1, param.W1, param.D1));
2582
+ ctrTubes.push(ctrRectangle4(0, -R1, param.W1, param.D1));
2286
2583
  if (!capsLeftExt) {
2287
- ctrTubes.push(ctrRectangle3(param.W1, -R1, param.W1b, param.D1));
2584
+ ctrTubes.push(ctrRectangle4(param.W1, -R1, param.W1b, param.D1));
2288
2585
  }
2289
- ctrTubes.push(ctrRectangle3(lenLeft, -R1, lenMid, param.D1));
2586
+ ctrTubes.push(ctrRectangle4(lenLeft, -R1, lenMid, param.D1));
2290
2587
  if (!capsRightExt) {
2291
- ctrTubes.push(ctrRectangle3(lenLeft + lenMid, -R1, param.W1b, param.D1));
2588
+ ctrTubes.push(ctrRectangle4(lenLeft + lenMid, -R1, param.W1b, param.D1));
2292
2589
  }
2293
- ctrTubes.push(ctrRectangle3(lenTotal - param.W1, -R1, param.W1, param.D1));
2590
+ ctrTubes.push(ctrRectangle4(lenTotal - param.W1, -R1, param.W1, param.D1));
2294
2591
  for (const iCtr of ctrTubes) {
2295
2592
  figGroove1.addSecond(iCtr);
2296
2593
  figGroove2.addSecond(iCtr);
@@ -2352,7 +2649,7 @@ function pGeom7(t, param, suffix = "") {
2352
2649
  {
2353
2650
  outName: `subpax_${designName}_tube`,
2354
2651
  face: `${designName}_faceTube`,
2355
- extrudeMethod: EExtrude7.eLinearOrtho,
2652
+ extrudeMethod: EExtrude8.eLinearOrtho,
2356
2653
  length: lenMid,
2357
2654
  rotate: [0, 0, 0],
2358
2655
  translate: [0, 0, lenLeft]
@@ -2360,7 +2657,7 @@ function pGeom7(t, param, suffix = "") {
2360
2657
  {
2361
2658
  outName: `subpax_${designName}_left`,
2362
2659
  face: `${designName}_faceLeft`,
2363
- extrudeMethod: EExtrude7.eLinearOrtho,
2660
+ extrudeMethod: EExtrude8.eLinearOrtho,
2364
2661
  length: param.W1,
2365
2662
  rotate: [0, 0, 0],
2366
2663
  translate: [0, 0, 0]
@@ -2368,7 +2665,7 @@ function pGeom7(t, param, suffix = "") {
2368
2665
  {
2369
2666
  outName: `subpax_${designName}_leftB`,
2370
2667
  face: `${designName}_faceW1b`,
2371
- extrudeMethod: EExtrude7.eLinearOrtho,
2668
+ extrudeMethod: EExtrude8.eLinearOrtho,
2372
2669
  length: param.W1b,
2373
2670
  rotate: [0, 0, 0],
2374
2671
  translate: [0, 0, param.W1]
@@ -2376,7 +2673,7 @@ function pGeom7(t, param, suffix = "") {
2376
2673
  {
2377
2674
  outName: `subpax_${designName}_rightB`,
2378
2675
  face: `${designName}_faceW1b`,
2379
- extrudeMethod: EExtrude7.eLinearOrtho,
2676
+ extrudeMethod: EExtrude8.eLinearOrtho,
2380
2677
  length: param.W1b,
2381
2678
  rotate: [0, 0, 0],
2382
2679
  translate: [0, 0, lenLeft + lenMid]
@@ -2384,7 +2681,7 @@ function pGeom7(t, param, suffix = "") {
2384
2681
  {
2385
2682
  outName: `subpax_${designName}_right`,
2386
2683
  face: `${designName}_faceRight`,
2387
- extrudeMethod: EExtrude7.eLinearOrtho,
2684
+ extrudeMethod: EExtrude8.eLinearOrtho,
2388
2685
  length: param.W1,
2389
2686
  rotate: [0, 0, 0],
2390
2687
  translate: [0, 0, lenTotal - param.W1]
@@ -2392,7 +2689,7 @@ function pGeom7(t, param, suffix = "") {
2392
2689
  {
2393
2690
  outName: `subpax_${designName}_groove1`,
2394
2691
  face: `${designName}_faceGroove1`,
2395
- extrudeMethod: EExtrude7.eLinearOrtho,
2692
+ extrudeMethod: EExtrude8.eLinearOrtho,
2396
2693
  length: 2 * R12,
2397
2694
  rotate: [0, -Math.PI / 2, 0],
2398
2695
  translate: [R12, 0, 0]
@@ -2400,7 +2697,7 @@ function pGeom7(t, param, suffix = "") {
2400
2697
  {
2401
2698
  outName: `subpax_${designName}_groove2`,
2402
2699
  face: `${designName}_faceGroove2`,
2403
- extrudeMethod: EExtrude7.eLinearOrtho,
2700
+ extrudeMethod: EExtrude8.eLinearOrtho,
2404
2701
  length: 2 * R12,
2405
2702
  rotate: [0, -Math.PI / 2, -Math.PI / 2],
2406
2703
  translate: [0, -R12, 0]
@@ -2409,17 +2706,17 @@ function pGeom7(t, param, suffix = "") {
2409
2706
  volumes: [
2410
2707
  {
2411
2708
  outName: `ipax_${designName}_plus`,
2412
- boolMethod: EBVolume7.eUnion,
2709
+ boolMethod: EBVolume8.eUnion,
2413
2710
  inList: union_list
2414
2711
  },
2415
2712
  {
2416
2713
  outName: `ipax_${designName}_moins`,
2417
- boolMethod: EBVolume7.eUnion,
2714
+ boolMethod: EBVolume8.eUnion,
2418
2715
  inList: [`subpax_${designName}_groove1`, `subpax_${designName}_groove2`]
2419
2716
  },
2420
2717
  {
2421
2718
  outName: `pax_${designName}`,
2422
- boolMethod: EBVolume7.eSubstraction,
2719
+ boolMethod: EBVolume8.eSubstraction,
2423
2720
  inList: [`ipax_${designName}_plus`, `ipax_${designName}_moins`]
2424
2721
  }
2425
2722
  ]
@@ -2436,21 +2733,21 @@ function pGeom7(t, param, suffix = "") {
2436
2733
  var springWormDef = {
2437
2734
  pTitle: "springWorm",
2438
2735
  pDescription: "Flex-part for unperfect coaxial transmission",
2439
- pDef: pDef7,
2440
- pGeom: pGeom7
2736
+ pDef: pDef8,
2737
+ pGeom: pGeom8
2441
2738
  };
2442
2739
 
2443
2740
  // src/spring/springOne.ts
2444
2741
  import {
2445
- contour as contour9,
2742
+ contour as contour10,
2446
2743
  contourCircle as contourCircle7,
2447
- figure as figure8,
2744
+ figure as figure9,
2448
2745
  degToRad as degToRad3,
2449
- ffix as ffix9,
2450
- pNumber as pNumber8,
2746
+ ffix as ffix10,
2747
+ pNumber as pNumber9,
2451
2748
  pCheckbox as pCheckbox5,
2452
- pSectionSeparator as pSectionSeparator8,
2453
- initGeom as initGeom8
2749
+ pSectionSeparator as pSectionSeparator9,
2750
+ initGeom as initGeom9
2454
2751
  } from "geometrix";
2455
2752
  import {
2456
2753
  tJDir,
@@ -2460,46 +2757,46 @@ import {
2460
2757
  facet2figure,
2461
2758
  sheetFold
2462
2759
  } from "sheetfold";
2463
- var pDef8 = {
2760
+ var pDef9 = {
2464
2761
  partName: "springOne",
2465
2762
  params: [
2466
2763
  //pNumber(name, unit, init, min, max, step)
2467
- pNumber8("D1", "mm", 16, 1, 100, 0.1),
2468
- pNumber8("Dbearing", "mm", 35, 1, 100, 0.1),
2469
- pNumber8("H1", "mm", 5, 1, 100, 1),
2470
- pNumber8("H2", "mm", 15, 1, 100, 1),
2471
- pNumber8("R2", "mm", 15, 1, 100, 1),
2472
- pNumber8("L1", "mm", 50, 1, 200, 1),
2473
- pNumber8("Rc1", "mm", 5, 0, 50, 1),
2474
- pSectionSeparator8("Spring zone"),
2764
+ pNumber9("D1", "mm", 16, 1, 100, 0.1),
2765
+ pNumber9("Dbearing", "mm", 35, 1, 100, 0.1),
2766
+ pNumber9("H1", "mm", 5, 1, 100, 1),
2767
+ pNumber9("H2", "mm", 15, 1, 100, 1),
2768
+ pNumber9("R2", "mm", 15, 1, 100, 1),
2769
+ pNumber9("L1", "mm", 50, 1, 200, 1),
2770
+ pNumber9("Rc1", "mm", 5, 0, 50, 1),
2771
+ pSectionSeparator9("Spring zone"),
2475
2772
  pCheckbox5("spring", true),
2476
- pNumber8("E1", "mm", 2, 1, 100, 1),
2477
- pNumber8("E2", "mm", 2, 1, 100, 1),
2478
- pNumber8("smEy", "mm", 1, 0.1, 10, 0.1),
2479
- pNumber8("shEy", "mm", 1, 0.1, 10, 0.1),
2480
- pNumber8("shPr", "%", 90, 0, 99, 1),
2481
- pNumber8("sNx", "xHoles", 2, 2, 200, 1),
2482
- pNumber8("smEx", "mm", 1, 0.1, 10, 0.1),
2483
- pNumber8("smExS", "mm", 0.5, 0.1, 10, 0.1),
2484
- pSectionSeparator8("Screw holes"),
2485
- pNumber8("D3", "mm", 6, 1, 100, 1),
2486
- pNumber8("P3", "mm", 70, 1, 200, 1),
2487
- pNumber8("P4", "mm", 30, 1, 200, 1),
2488
- pSectionSeparator8("Borders"),
2489
- pNumber8("L2", "mm", 20, 1, 200, 1),
2490
- pNumber8("E3", "mm", 1, 0, 20, 0.1),
2491
- pNumber8("W1", "mm", 20, 1, 200, 1),
2492
- pNumber8("W3", "mm", 50, 1, 400, 1),
2493
- pNumber8("Rc3", "mm", 0.5, 0, 10, 0.1),
2773
+ pNumber9("E1", "mm", 2, 1, 100, 1),
2774
+ pNumber9("E2", "mm", 2, 1, 100, 1),
2775
+ pNumber9("smEy", "mm", 1, 0.1, 10, 0.1),
2776
+ pNumber9("shEy", "mm", 1, 0.1, 10, 0.1),
2777
+ pNumber9("shPr", "%", 90, 0, 99, 1),
2778
+ pNumber9("sNx", "xHoles", 2, 2, 200, 1),
2779
+ pNumber9("smEx", "mm", 1, 0.1, 10, 0.1),
2780
+ pNumber9("smExS", "mm", 0.5, 0.1, 10, 0.1),
2781
+ pSectionSeparator9("Screw holes"),
2782
+ pNumber9("D3", "mm", 6, 1, 100, 1),
2783
+ pNumber9("P3", "mm", 70, 1, 200, 1),
2784
+ pNumber9("P4", "mm", 30, 1, 200, 1),
2785
+ pSectionSeparator9("Borders"),
2786
+ pNumber9("L2", "mm", 20, 1, 200, 1),
2787
+ pNumber9("E3", "mm", 1, 0, 20, 0.1),
2788
+ pNumber9("W1", "mm", 20, 1, 200, 1),
2789
+ pNumber9("W3", "mm", 50, 1, 400, 1),
2790
+ pNumber9("Rc3", "mm", 0.5, 0, 10, 0.1),
2494
2791
  pCheckbox5("B2", true),
2495
- pNumber8("A2", "mm", 10, 1, 200, 1),
2496
- pNumber8("Rc2", "mm", 5, 0, 50, 1),
2497
- pSectionSeparator8("Folding"),
2498
- pNumber8("Th", "mm", 1, 0.1, 10, 0.1),
2499
- pNumber8("Jangle", "degree", 90, 0, 120, 1),
2500
- pNumber8("Jradius", "mm", 2, 0.1, 10, 0.1),
2501
- pNumber8("Jneutral", "%", 50, 0, 100, 1),
2502
- pNumber8("Jmark", "mm", 1, 0.1, 10, 0.1)
2792
+ pNumber9("A2", "mm", 10, 1, 200, 1),
2793
+ pNumber9("Rc2", "mm", 5, 0, 50, 1),
2794
+ pSectionSeparator9("Folding"),
2795
+ pNumber9("Th", "mm", 1, 0.1, 10, 0.1),
2796
+ pNumber9("Jangle", "degree", 90, 0, 120, 1),
2797
+ pNumber9("Jradius", "mm", 2, 0.1, 10, 0.1),
2798
+ pNumber9("Jneutral", "%", 50, 0, 100, 1),
2799
+ pNumber9("Jmark", "mm", 1, 0.1, 10, 0.1)
2503
2800
  ],
2504
2801
  paramSvg: {
2505
2802
  D1: "springOne_face.svg",
@@ -2542,14 +2839,14 @@ var pDef8 = {
2542
2839
  // every 0.5 second
2543
2840
  }
2544
2841
  };
2545
- function pGeom8(t, param, suffix = "") {
2546
- const rGeome = initGeom8(pDef8.partName + suffix);
2547
- const figWallB = figure8();
2842
+ function pGeom9(t, param, suffix = "") {
2843
+ const rGeome = initGeom9(pDef9.partName + suffix);
2844
+ const figWallB = figure9();
2548
2845
  rGeome.logstr += `${rGeome.partName} simTime: ${t}
2549
2846
  `;
2550
2847
  try {
2551
2848
  let makeSpringHollow2 = function(iLen) {
2552
- const rCtr = contour9(0, 0).addCornerRounded(sRc).addSegStrokeR(iLen, 0).addCornerRounded(sRc).addSegStrokeR(0, param.shEy).addCornerRounded(sRc).addSegStrokeR(-iLen, 0).addCornerRounded(sRc).closeSegStroke();
2849
+ const rCtr = contour10(0, 0).addCornerRounded(sRc).addSegStrokeR(iLen, 0).addCornerRounded(sRc).addSegStrokeR(0, param.shEy).addCornerRounded(sRc).addSegStrokeR(-iLen, 0).addCornerRounded(sRc).closeSegStroke();
2553
2850
  return rCtr;
2554
2851
  }, calcXref2 = function(iyRef, iSel, idx) {
2555
2852
  const cotan = iSel === 0 ? cotanBAD : cotanBADb;
@@ -2562,7 +2859,7 @@ function pGeom8(t, param, suffix = "") {
2562
2859
  const lxAZpre = lx / 2 - param.smEx / 2;
2563
2860
  const lxAZ = idx % 2 === 0 ? lxAZpre : lx;
2564
2861
  if (lxAZ < 2 * sRc) {
2565
- throw `err228: lxAZ ${ffix9(lxAZ)} is too small compare to ${param.sNx} or ${param.smEx}`;
2862
+ throw `err228: lxAZ ${ffix10(lxAZ)} is too small compare to ${param.sNx} or ${param.smEx}`;
2566
2863
  }
2567
2864
  return [cx0, lxAZ, lx, nx];
2568
2865
  }, makeCtrWall2 = function(iJunctionName) {
@@ -2586,7 +2883,7 @@ function pGeom8(t, param, suffix = "") {
2586
2883
  const aBAC = Math.atan2(param.H2, L12);
2587
2884
  const lAC = Math.sqrt(L12 ** 2 + param.H2 ** 2);
2588
2885
  if (param.R2 > lAC) {
2589
- throw `err141: R2 ${param.R2} is too large comapre to lAC ${ffix9(lAC)} mm`;
2886
+ throw `err141: R2 ${param.R2} is too large comapre to lAC ${ffix10(lAC)} mm`;
2590
2887
  }
2591
2888
  const aCAD = Math.asin(param.R2 / lAC);
2592
2889
  const lAD = lAC * Math.cos(aCAD);
@@ -2614,26 +2911,26 @@ function pGeom8(t, param, suffix = "") {
2614
2911
  const sNy = Math.floor((sHeight + param.smEy) / sStepY);
2615
2912
  const sRc = param.shEy * param.shPr / 200;
2616
2913
  if (R1 < 0.1) {
2617
- throw `err087: R1 ${ffix9(R1)} is too small because of D1 ${param.D1}`;
2914
+ throw `err087: R1 ${ffix10(R1)} is too small because of D1 ${param.D1}`;
2618
2915
  }
2619
2916
  if (L2b < 0.1) {
2620
- throw `err165: L2b ${ffix9(L2b)} is too small because of E3 ${param.E3}`;
2917
+ throw `err165: L2b ${ffix10(L2b)} is too small because of E3 ${param.E3}`;
2621
2918
  }
2622
2919
  if (param.E3 < param.Rc3) {
2623
2920
  throw `err170: E3 ${param.E3} is too small compare to Rc3 ${param.Rc3}`;
2624
2921
  }
2625
2922
  if (W3b < param.Rc3) {
2626
- throw `err174: W3b ${ffix9(W3b)} is too small compare to Rc3 ${param.Rc3}`;
2923
+ throw `err174: W3b ${ffix10(W3b)} is too small compare to Rc3 ${param.Rc3}`;
2627
2924
  }
2628
2925
  if (param.spring === 1) {
2629
2926
  if (sHeight < 0.1) {
2630
- throw `err189: sHeight ${ffix9(sHeight)} is too small because of E1 ${param.E1} or E2 ${param.E2}`;
2927
+ throw `err189: sHeight ${ffix10(sHeight)} is too small because of E1 ${param.E1} or E2 ${param.E2}`;
2631
2928
  }
2632
2929
  }
2633
- rGeome.logstr += `Bearing holder wall: Hwall ${ffix9(Hwall)}, Hfoot ${ffix9(Hfoot)} mm
2930
+ rGeome.logstr += `Bearing holder wall: Hwall ${ffix10(Hwall)}, Hfoot ${ffix10(Hfoot)} mm
2634
2931
  `;
2635
2932
  if (param.spring === 1) {
2636
- rGeome.logstr += `spring: sNy ${sNy}, sRc ${ffix9(sRc)} mm
2933
+ rGeome.logstr += `spring: sNy ${sNy}, sRc ${ffix10(sRc)} mm
2637
2934
  `;
2638
2935
  } else {
2639
2936
  rGeome.logstr += `No spring
@@ -2735,14 +3032,1277 @@ function pGeom8(t, param, suffix = "") {
2735
3032
  }
2736
3033
  var springOneDef = {
2737
3034
  pTitle: "springOne",
2738
- pDescription: "bearing-holder with integated spring",
2739
- pDef: pDef8,
2740
- pGeom: pGeom8
3035
+ pDescription: "bearing-holder with integrated spring",
3036
+ pDef: pDef9,
3037
+ pGeom: pGeom9
3038
+ };
3039
+
3040
+ // src/spring/springSide.ts
3041
+ import {
3042
+ contour as contour11,
3043
+ contourCircle as contourCircle8,
3044
+ ffix as ffix11,
3045
+ pNumber as pNumber10,
3046
+ pCheckbox as pCheckbox6,
3047
+ pSectionSeparator as pSectionSeparator10,
3048
+ initGeom as initGeom10
3049
+ } from "geometrix";
3050
+ import {
3051
+ tJDir as tJDir2,
3052
+ tJSide as tJSide2,
3053
+ contourJ as contourJ2,
3054
+ facet as facet2,
3055
+ sheetFold as sheetFold2
3056
+ } from "sheetfold";
3057
+ var pDef10 = {
3058
+ partName: "springSide",
3059
+ params: [
3060
+ //pNumber(name, unit, init, min, max, step)
3061
+ pNumber10("D5", "mm", 100, 10, 5e3, 1),
3062
+ pNumber10("N5", "unit", 8, 3, 100, 1),
3063
+ pNumber10("W2", "mm", 20, 1, 200, 1),
3064
+ pSectionSeparator10("One unit"),
3065
+ pNumber10("D1", "mm", 16, 1, 100, 0.1),
3066
+ pNumber10("H1", "mm", 5, 1, 100, 1),
3067
+ pNumber10("H2", "mm", 15, 1, 100, 1),
3068
+ pNumber10("R2", "mm", 15, 1, 100, 1),
3069
+ pSectionSeparator10("Spring zone"),
3070
+ pCheckbox6("spring", true),
3071
+ pNumber10("E1", "mm", 2, 1, 100, 1),
3072
+ pNumber10("E2", "mm", 2, 1, 100, 1),
3073
+ pNumber10("smEy", "mm", 1, 0.1, 10, 0.1),
3074
+ pNumber10("shEy", "mm", 1, 0.1, 10, 0.1),
3075
+ pNumber10("shPr", "%", 90, 0, 99, 1),
3076
+ pNumber10("sNx", "xHoles", 2, 2, 200, 1),
3077
+ pNumber10("smEx", "mm", 1, 0.1, 10, 0.1),
3078
+ pNumber10("smExS", "mm", 0.5, 0.1, 10, 0.1),
3079
+ pSectionSeparator10("Folding"),
3080
+ pNumber10("Th", "mm", 1, 0.1, 10, 0.1),
3081
+ //pNumber('Jangle', 'degree', 90, 0, 120, 1),
3082
+ pNumber10("Jradius", "mm", 2, 0.1, 10, 0.1),
3083
+ pNumber10("Jneutral", "%", 50, 0, 100, 1),
3084
+ pNumber10("Jmark", "mm", 1, 0.1, 10, 0.1)
3085
+ ],
3086
+ paramSvg: {
3087
+ D5: "springSide_top.svg",
3088
+ N5: "springSide_top.svg",
3089
+ W2: "springSide_top.svg",
3090
+ D1: "springSide_face.svg",
3091
+ H1: "springSide_face.svg",
3092
+ H2: "springSide_face.svg",
3093
+ R2: "springSide_face.svg",
3094
+ spring: "springSide_spring.svg",
3095
+ E1: "springSide_face.svg",
3096
+ E2: "springSide_face.svg",
3097
+ smEy: "springSide_spring.svg",
3098
+ shEy: "springSide_spring.svg",
3099
+ shPr: "springSide_spring.svg",
3100
+ sNx: "springSide_spring.svg",
3101
+ smEx: "springSide_spring.svg",
3102
+ smExS: "springSide_spring.svg",
3103
+ Th: "springSide_section.svg",
3104
+ //Jangle: 'springSide_face.svg',
3105
+ Jradius: "springSide_face.svg",
3106
+ Jneutral: "springSide_face.svg",
3107
+ Jmark: "springSide_face.svg"
3108
+ },
3109
+ sim: {
3110
+ tMax: 180,
3111
+ tStep: 0.5,
3112
+ tUpdate: 500
3113
+ // every 0.5 second
3114
+ }
3115
+ };
3116
+ function pGeom10(t, param, suffix = "") {
3117
+ const rGeome = initGeom10(pDef10.partName + suffix);
3118
+ rGeome.logstr += `${rGeome.partName} simTime: ${t}
3119
+ `;
3120
+ try {
3121
+ let makeSpringHollow2 = function(iLen) {
3122
+ const rCtr = contour11(0, 0).addCornerRounded(sRc).addSegStrokeR(iLen, 0).addCornerRounded(sRc).addSegStrokeR(0, param.shEy).addCornerRounded(sRc).addSegStrokeR(-iLen, 0).addCornerRounded(sRc).closeSegStroke();
3123
+ return rCtr;
3124
+ }, calcXref2 = function(iyRef, iSel, idx) {
3125
+ const cotan = iSel === 0 ? cotanBAD : cotanBADb;
3126
+ const cL = iSel === 0 ? Li : Le;
3127
+ const cy = iyRef - Hfoot - param.H1;
3128
+ const cx = cy < 0 ? cL : cL - 2 * cy * cotan;
3129
+ const cx0 = cL / 2 - cx / 2 + param.smExS;
3130
+ const nx = idx % 2 === 0 ? param.sNx + 1 : param.sNx;
3131
+ const lx = (cx - 2 * param.smExS + param.smEx) / (param.sNx + 1) - param.smEx;
3132
+ const lxAZpre = lx / 2 - param.smEx / 2;
3133
+ const lxAZ = idx % 2 === 0 ? lxAZpre : lx;
3134
+ if (lxAZ < 2 * sRc) {
3135
+ throw `err228: lxAZ ${ffix11(lxAZ)} is too small compare to ${param.sNx} or ${param.smEx}`;
3136
+ }
3137
+ return [cx0, lxAZ, lx, nx];
3138
+ }, makeCtrWall2 = function(iJ0, iJ1, iJb, iL, iL2, iJ1b, iSel) {
3139
+ const Xad = iSel ? xADb : xAD;
3140
+ const Yad = iSel ? yADb : yAD;
3141
+ const rCtr = contourJ2(0, Hfoot);
3142
+ if (iL2 > 0) {
3143
+ rCtr.addSegStrokeR(iL2, 0);
3144
+ }
3145
+ rCtr.startJunction(iJb, tJDir2.eB, tJSide2.eABRight).addSegStrokeR(Li, 0);
3146
+ if (iL2 > 0) {
3147
+ rCtr.addSegStrokeR(iL2, 0);
3148
+ }
3149
+ if (iSel) {
3150
+ rCtr.startJunction(iJ0, tJDir2.eA, tJSide2.eABLeft);
3151
+ } else {
3152
+ if (iJ1b) {
3153
+ rCtr.startJunction(iJ1, tJDir2.eB, tJSide2.eABRight);
3154
+ }
3155
+ }
3156
+ rCtr.addSegStrokeR(0, param.H1).addSegStrokeR(-Xad, Yad).addPointA(iL2 + iL / 2, Hwall + Hfoot).addPointA(Xad, param.H1 + Yad + Hfoot).addSegArc2().addSegStrokeR(-Xad, -Yad);
3157
+ if (iSel) {
3158
+ if (iJ1b) {
3159
+ rCtr.startJunction(iJ1, tJDir2.eB, tJSide2.eABRight);
3160
+ }
3161
+ } else {
3162
+ rCtr.startJunction(iJ0, tJDir2.eA, tJSide2.eABLeft);
3163
+ }
3164
+ rCtr.closeSegStroke();
3165
+ return rCtr;
3166
+ };
3167
+ var makeSpringHollow = makeSpringHollow2, calcXref = calcXref2, makeCtrWall = makeCtrWall2;
3168
+ const pi2 = Math.PI / 2;
3169
+ const aJn = param.Jneutral / 100;
3170
+ const aJr = param.Jradius;
3171
+ const aJm = param.Jmark;
3172
+ const Hfoot = aJr + (1 - aJn) * param.Th;
3173
+ const R5 = param.D5 / 2;
3174
+ const a5 = 2 * Math.PI / param.N5;
3175
+ const a52 = a5 / 2;
3176
+ const W22 = (param.W2 + param.Th) / 2;
3177
+ const LiY = R5 - W22;
3178
+ const Lii = 2 * LiY * Math.tan(a52);
3179
+ const Lee = 2 * (R5 + W22) * Math.tan(a52);
3180
+ const Lm = aJr * Math.tan(a52);
3181
+ const Li = Lii - 2 * Lm;
3182
+ const Le = Lee - 2 * Lm;
3183
+ const W1 = param.W2 + 2 * param.Th - 2 * Hfoot;
3184
+ const W12 = W1 / 2;
3185
+ const Le2 = (Le - Li) / 2;
3186
+ const R3 = W1 / 8;
3187
+ const D3 = 2 * R3;
3188
+ const Lih = Li / 2;
3189
+ const Leh = Le / 2;
3190
+ const R1 = param.D1 / 2;
3191
+ const Hwall = param.H1 + param.H2 + param.R2;
3192
+ const aBAC = Math.atan2(param.H2, Lih);
3193
+ const lAC = Math.sqrt(Lih ** 2 + param.H2 ** 2);
3194
+ if (param.R2 > lAC) {
3195
+ throw `err141: R2 ${param.R2} is too large comapre to lAC ${ffix11(lAC)} mm`;
3196
+ }
3197
+ const aCAD = Math.asin(param.R2 / lAC);
3198
+ const lAD = lAC * Math.cos(aCAD);
3199
+ const xAD = lAD * Math.cos(aBAC + aCAD);
3200
+ const yAD = lAD * Math.sin(aBAC + aCAD);
3201
+ const cotanBAD = xAD / yAD;
3202
+ const aBACb = Math.atan2(param.H2, Leh);
3203
+ const lACb = Math.sqrt(Leh ** 2 + param.H2 ** 2);
3204
+ const aCADb = Math.asin(param.R2 / lACb);
3205
+ const lADb = lACb * Math.cos(aCADb);
3206
+ const xADb = lADb * Math.cos(aBACb + aCADb);
3207
+ const yADb = lADb * Math.sin(aBACb + aCADb);
3208
+ const cotanBADb = xADb / yADb;
3209
+ const sHeight = param.H1 + param.H2 - R1 - param.E1 - param.E2;
3210
+ const sStepY = param.smEy + param.shEy;
3211
+ const sNy = Math.floor((sHeight + param.smEy) / sStepY);
3212
+ const sRc = param.shEy * param.shPr / 200;
3213
+ if (R1 < 0.1) {
3214
+ throw `err087: R1 ${ffix11(R1)} is too small because of D1 ${param.D1}`;
3215
+ }
3216
+ if (LiY < 0.1) {
3217
+ throw `err168: R5 ${ffix11(R5)} is too small compare to W2 ${ffix11(W22)} or Th ${param.Th} mm`;
3218
+ }
3219
+ if (Li < 0.1) {
3220
+ throw `err171: Li ${ffix11(Li)} is too small because of aJr ${aJr} mm`;
3221
+ }
3222
+ if (W1 < 0.1) {
3223
+ throw `err174: W1 ${ffix11(W1)} is too small because of Hfoot ${ffix11(Hfoot)} mm`;
3224
+ }
3225
+ if (param.spring === 1) {
3226
+ if (sHeight < 0.1) {
3227
+ throw `err189: sHeight ${ffix11(sHeight)} is too small because of E1 ${param.E1} or E2 ${param.E2}`;
3228
+ }
3229
+ }
3230
+ rGeome.logstr += `Bearing holder wall: Hwall ${ffix11(Hwall)}, Hfoot ${ffix11(Hfoot)} mm
3231
+ `;
3232
+ rGeome.logstr += `Width of one unit interior: Lii ${ffix11(Lii)}, Li ${ffix11(Li)} mm
3233
+ `;
3234
+ rGeome.logstr += `Width of one unit exterior: Lee ${ffix11(Lee)}, Le ${ffix11(Le)} mm
3235
+ `;
3236
+ rGeome.logstr += `Ratio R2/Li ${ffix11(100 * param.R2 / Lih)} %
3237
+ `;
3238
+ rGeome.logstr += `Width of bottom: W1 ${ffix11(W1)}, D3 ${ffix11(D3)} mm
3239
+ `;
3240
+ if (param.spring === 1) {
3241
+ rGeome.logstr += `spring: sNy ${sNy}, sRc ${ffix11(sRc)} mm
3242
+ `;
3243
+ } else {
3244
+ rGeome.logstr += `No spring
3245
+ `;
3246
+ }
3247
+ const sWi = [];
3248
+ const sWe = [];
3249
+ if (param.spring === 1) {
3250
+ for (let jj = 0; jj < sNy; jj++) {
3251
+ const yy = Hfoot + param.E1 + jj * sStepY;
3252
+ const yRef = yy + param.shEy / 2;
3253
+ const [xRef, lxAZ, lx, nx] = calcXref2(yRef, 0, jj);
3254
+ const [xRefB, lxAZb, lxb] = calcXref2(yRef, 1, jj);
3255
+ let xx = xRef;
3256
+ let xxb = xRefB;
3257
+ sWi.push(makeSpringHollow2(lxAZ).translate(xx, yy));
3258
+ sWe.push(makeSpringHollow2(lxAZb).translate(xxb, yy));
3259
+ xx += lxAZ + param.smEx;
3260
+ xxb += lxAZb + param.smEx;
3261
+ for (let ii = 0; ii < nx - 1; ii++) {
3262
+ sWi.push(makeSpringHollow2(lx).translate(xx, yy));
3263
+ sWe.push(makeSpringHollow2(lxb).translate(xxb, yy));
3264
+ xx += lx + param.smEx;
3265
+ xxb += lxb + param.smEx;
3266
+ }
3267
+ sWi.push(makeSpringHollow2(lxAZ).translate(xx, yy));
3268
+ sWe.push(makeSpringHollow2(lxAZb).translate(xxb, yy));
3269
+ }
3270
+ }
3271
+ const ctrAxisi = contourCircle8(Lih, Hfoot + param.H1 + param.H2, R1);
3272
+ const ctrAxise = contourCircle8(Leh, Hfoot + param.H1 + param.H2, R1);
3273
+ const ctrBase = contourJ2(0, 0).startJunction("Jbi0", tJDir2.eA, tJSide2.eABLeft).addSegStrokeR(Li, 0).addSegStrokeR(0, W1).startJunction("Jbe0", tJDir2.eA, tJSide2.eABLeft).addSegStrokeR(-Li, 0).closeSegStroke();
3274
+ const ctrsHole = [];
3275
+ ctrsHole.push(contourCircle8(D3, D3, R3));
3276
+ ctrsHole.push(contourCircle8(Li - D3, D3, R3));
3277
+ ctrsHole.push(contourCircle8(D3, W1 - D3, R3));
3278
+ ctrsHole.push(contourCircle8(Li - D3, W1 - D3, R3));
3279
+ const faBase = facet2([ctrBase, ...ctrsHole]);
3280
+ const fasInt = [];
3281
+ const junctionInt = {};
3282
+ for (let ii = 0; ii < param.N5; ii++) {
3283
+ const Jcond = ii < param.N5 - 1;
3284
+ const iCtr = makeCtrWall2(`Ji${ii}`, `Ji${ii + 1}`, `Jbi${ii}`, Li, 0, Jcond, false);
3285
+ fasInt.push(facet2([iCtr, ctrAxisi, ...sWi]));
3286
+ junctionInt[`Ji${ii}`] = { angle: -a5, radius: aJr, neutral: aJn, mark: aJm };
3287
+ junctionInt[`Jbi${ii}`] = { angle: pi2, radius: aJr, neutral: aJn, mark: aJm };
3288
+ if (ii > 0) {
3289
+ const iCtr2 = contourJ2(0, 0).startJunction(`Jbi${ii}`, tJDir2.eA, tJSide2.eABLeft).addSegStrokeR(Li, 0).addSegStrokeR(0, W12).addSegStrokeR(-Li, 0).closeSegStroke();
3290
+ const iCtr2Hole = [];
3291
+ iCtr2Hole.push(contourCircle8(D3, D3, R3));
3292
+ iCtr2Hole.push(contourCircle8(Li - D3, D3, R3));
3293
+ fasInt.push(facet2([iCtr2, ...iCtr2Hole]));
3294
+ }
3295
+ }
3296
+ const fasExt = [];
3297
+ const junctionExt = {};
3298
+ for (let ii = 0; ii < param.N5; ii++) {
3299
+ const Jcond = ii < param.N5 - 1;
3300
+ const iCtr = makeCtrWall2(`Je${ii}`, `Je${ii + 1}`, `Jbe${ii}`, Li, Le2, Jcond, true);
3301
+ fasExt.push(facet2([iCtr, ctrAxise, ...sWe]));
3302
+ junctionExt[`Je${ii}`] = { angle: a5, radius: aJr, neutral: aJn, mark: aJm };
3303
+ junctionExt[`Jbe${ii}`] = { angle: pi2, radius: aJr, neutral: aJn, mark: aJm };
3304
+ if (ii > 0) {
3305
+ const iCtr2 = contourJ2(0, 0).addSegStrokeR(Li, 0).addSegStrokeR(0, W12).startJunction(`Jbe${ii}`, tJDir2.eA, tJSide2.eABLeft).addSegStrokeR(-Li, 0).closeSegStroke();
3306
+ const iCtr2Hole = [];
3307
+ iCtr2Hole.push(contourCircle8(D3, D3, R3));
3308
+ iCtr2Hole.push(contourCircle8(Li - D3, D3, R3));
3309
+ fasExt.push(facet2([iCtr2, ...iCtr2Hole]));
3310
+ }
3311
+ }
3312
+ const postHi = [];
3313
+ const postHe = [];
3314
+ for (let ii = 1; ii < param.N5; ii++) {
3315
+ postHi.push(...[`Ji${ii}`, Li]);
3316
+ postHe.push(...[`Je${ii}`, Le]);
3317
+ }
3318
+ const deltaY = param.Th + param.W2;
3319
+ const sFold = sheetFold2(
3320
+ [faBase, ...fasInt, ...fasExt],
3321
+ {
3322
+ Jbi0: { angle: pi2, radius: aJr, neutral: aJn, mark: aJm },
3323
+ Jbe0: { angle: pi2, radius: aJr, neutral: aJn, mark: aJm },
3324
+ ...junctionInt,
3325
+ ...junctionExt
3326
+ },
3327
+ [
3328
+ { x1: 0, y1: deltaY, a1: 0, l1: W1, ante: ["Jbi0", Hwall], post: ["Jbe0", Hwall] },
3329
+ { x1: -Le2, y1: 0, a1: 0, l1: Le, ante: ["Je0"], post: postHe },
3330
+ { x1: 0, y1: -deltaY, a1: 0, l1: Li, ante: ["Ji0"], post: postHi }
3331
+ ],
3332
+ param.Th,
3333
+ rGeome.partName
3334
+ );
3335
+ const ffObj = sFold.makeFigures();
3336
+ for (const iFace of Object.keys(ffObj)) {
3337
+ rGeome.fig[iFace] = ffObj[iFace];
3338
+ }
3339
+ rGeome.vol = sFold.makeVolume();
3340
+ rGeome.sub = {};
3341
+ rGeome.logstr += "springSide drawn successfully!\n";
3342
+ rGeome.calcErr = false;
3343
+ } catch (emsg) {
3344
+ rGeome.logstr += emsg;
3345
+ console.log(emsg);
3346
+ }
3347
+ return rGeome;
3348
+ }
3349
+ var springSideDef = {
3350
+ pTitle: "springSide",
3351
+ pDescription: "bearing-holder on the side of a ring",
3352
+ pDef: pDef10,
3353
+ pGeom: pGeom10
3354
+ };
3355
+
3356
+ // src/spring/springInt.ts
3357
+ import {
3358
+ contour as contour12,
3359
+ contourCircle as contourCircle9,
3360
+ degToRad as degToRad4,
3361
+ ffix as ffix12,
3362
+ pNumber as pNumber11,
3363
+ pCheckbox as pCheckbox7,
3364
+ pSectionSeparator as pSectionSeparator11,
3365
+ initGeom as initGeom11
3366
+ } from "geometrix";
3367
+ import {
3368
+ tJDir as tJDir3,
3369
+ tJSide as tJSide3,
3370
+ contourJ as contourJ3,
3371
+ facet as facet3,
3372
+ sheetFold as sheetFold3
3373
+ } from "sheetfold";
3374
+ var pDef11 = {
3375
+ partName: "springInt",
3376
+ params: [
3377
+ //pNumber(name, unit, init, min, max, step)
3378
+ pNumber11("D5", "mm", 140, 10, 5e3, 1),
3379
+ pNumber11("N5", "unit", 8, 3, 100, 1),
3380
+ pNumber11("W2", "mm", 20, 1, 200, 1),
3381
+ pSectionSeparator11("One unit"),
3382
+ pNumber11("D1", "mm", 16, 1, 100, 0.1),
3383
+ pNumber11("H1", "mm", 5, 1, 100, 1),
3384
+ pNumber11("H2", "mm", 15, 1, 100, 1),
3385
+ pNumber11("R2", "mm", 15, 1, 100, 1),
3386
+ pSectionSeparator11("Spring zone"),
3387
+ pCheckbox7("spring", true),
3388
+ pNumber11("E1", "mm", 2, 1, 100, 1),
3389
+ pNumber11("E2", "mm", 2, 1, 100, 1),
3390
+ pNumber11("smEy", "mm", 1, 0.1, 10, 0.1),
3391
+ pNumber11("shEy", "mm", 1, 0.1, 10, 0.1),
3392
+ pNumber11("shPr", "%", 90, 0, 99, 1),
3393
+ pNumber11("sNx", "xHoles", 2, 2, 200, 1),
3394
+ pNumber11("smEx", "mm", 1, 0.1, 10, 0.1),
3395
+ pNumber11("smExS", "mm", 0.5, 0.1, 10, 0.1),
3396
+ pSectionSeparator11("Folding"),
3397
+ pNumber11("Th", "mm", 1, 0.1, 10, 0.1),
3398
+ pNumber11("Jangle", "degree", 90, 0, 120, 1),
3399
+ pNumber11("Jradius", "mm", 2, 0.1, 10, 0.1),
3400
+ pNumber11("Jneutral", "%", 50, 0, 100, 1),
3401
+ pNumber11("Jmark", "mm", 1, 0.1, 10, 0.1)
3402
+ ],
3403
+ paramSvg: {
3404
+ D5: "springInt_global.svg",
3405
+ N5: "springInt_global.svg",
3406
+ W2: "springInt_global.svg",
3407
+ D1: "springInt_face.svg",
3408
+ H1: "springInt_face.svg",
3409
+ H2: "springInt_face.svg",
3410
+ R2: "springInt_face.svg",
3411
+ spring: "springInt_spring.svg",
3412
+ E1: "springInt_face.svg",
3413
+ E2: "springInt_face.svg",
3414
+ smEy: "springInt_spring.svg",
3415
+ shEy: "springInt_spring.svg",
3416
+ shPr: "springInt_spring.svg",
3417
+ sNx: "springInt_spring.svg",
3418
+ smEx: "springInt_spring.svg",
3419
+ smExS: "springInt_spring.svg",
3420
+ Th: "springInt_section.svg",
3421
+ Jangle: "springInt_face.svg",
3422
+ Jradius: "springInt_face.svg",
3423
+ Jneutral: "springInt_face.svg",
3424
+ Jmark: "springInt_face.svg"
3425
+ },
3426
+ sim: {
3427
+ tMax: 180,
3428
+ tStep: 0.5,
3429
+ tUpdate: 500
3430
+ // every 0.5 second
3431
+ }
3432
+ };
3433
+ function pGeom11(t, param, suffix = "") {
3434
+ const rGeome = initGeom11(pDef11.partName + suffix);
3435
+ rGeome.logstr += `${rGeome.partName} simTime: ${t}
3436
+ `;
3437
+ try {
3438
+ let makeSpringHollow2 = function(iLen) {
3439
+ const rCtr = contour12(0, 0).addCornerRounded(sRc).addSegStrokeR(iLen, 0).addCornerRounded(sRc).addSegStrokeR(0, param.shEy).addCornerRounded(sRc).addSegStrokeR(-iLen, 0).addCornerRounded(sRc).closeSegStroke();
3440
+ return rCtr;
3441
+ }, calcXref2 = function(iyRef, idx) {
3442
+ const cotan = cotanBAD;
3443
+ const cL = Li;
3444
+ const cy = iyRef - Hfoot - param.H1;
3445
+ const cx = cy < 0 ? cL : cL - 2 * cy * cotan;
3446
+ const cx0 = cL / 2 - cx / 2 + param.smExS;
3447
+ const nx = idx % 2 === 0 ? param.sNx + 1 : param.sNx;
3448
+ const lx = (cx - 2 * param.smExS + param.smEx) / (param.sNx + 1) - param.smEx;
3449
+ const lxAZpre = lx / 2 - param.smEx / 2;
3450
+ const lxAZ = idx % 2 === 0 ? lxAZpre : lx;
3451
+ if (lxAZ < 2 * sRc) {
3452
+ throw `err228: lxAZ ${ffix12(lxAZ)} is too small compare to ${param.sNx} or ${param.smEx}`;
3453
+ }
3454
+ return [cx0, lxAZ, lx, nx];
3455
+ }, makeCtrWall2 = function(iJb) {
3456
+ const Xad = xAD;
3457
+ const Yad = yAD;
3458
+ const rCtr = contourJ3(0, Hfoot).startJunction(iJb, tJDir3.eB, tJSide3.eABRight).addSegStrokeR(Li, 0).addSegStrokeR(0, param.H1).addSegStrokeR(-Xad, Yad).addPointA(Li / 2, Hwall + Hfoot).addPointA(Xad, param.H1 + Yad + Hfoot).addSegArc2().addSegStrokeR(-Xad, -Yad).closeSegStroke();
3459
+ return rCtr;
3460
+ }, makeFaBottom2 = function(iJb0, iJb1, iJl, iJr, iJcond) {
3461
+ const ctrBase = contourJ3(0, 0).startJunction(iJl, tJDir3.eA, tJSide3.eABLeft).addSegStrokeR(Li, 0).startJunction(iJb0, tJDir3.eA, tJSide3.eABLeft).addSegStrokeR(0, W1).startJunction(iJr, tJDir3.eA, tJSide3.eABLeft).addSegStrokeR(-Li, 0);
3462
+ if (iJcond) {
3463
+ ctrBase.startJunction(iJb1, tJDir3.eB, tJSide3.eABRight);
3464
+ }
3465
+ ctrBase.closeSegStroke();
3466
+ const ctrsHole = [];
3467
+ ctrsHole.push(contourCircle9(D3, D3, R3));
3468
+ ctrsHole.push(contourCircle9(Li - D3, D3, R3));
3469
+ ctrsHole.push(contourCircle9(D3, W1 - D3, R3));
3470
+ ctrsHole.push(contourCircle9(Li - D3, W1 - D3, R3));
3471
+ const rFa = facet3([ctrBase, ...ctrsHole]);
3472
+ return rFa;
3473
+ };
3474
+ var makeSpringHollow = makeSpringHollow2, calcXref = calcXref2, makeCtrWall = makeCtrWall2, makeFaBottom = makeFaBottom2;
3475
+ const aJa = degToRad4(param.Jangle);
3476
+ const aJn = param.Jneutral / 100;
3477
+ const aJr = param.Jradius;
3478
+ const aJm = param.Jmark;
3479
+ const Hfoot = aJr + (1 - aJn) * param.Th;
3480
+ const R5 = param.D5 / 2;
3481
+ const R5b = R5 - (Hfoot + param.H1 + param.H2);
3482
+ const a5 = 2 * Math.PI / param.N5;
3483
+ const a52 = a5 / 2;
3484
+ const Lii = 2 * R5b * Math.tan(a52);
3485
+ const Lm = aJr * Math.tan(a52);
3486
+ const Li = Lii - 2 * Lm;
3487
+ const W1 = param.W2 + 2 * param.Th - 2 * Hfoot;
3488
+ const R3 = W1 / 8;
3489
+ const D3 = 2 * R3;
3490
+ const Lih = Li / 2;
3491
+ const R1 = param.D1 / 2;
3492
+ const Hwall = param.H1 + param.H2 + param.R2;
3493
+ const aBAC = Math.atan2(param.H2, Lih);
3494
+ const lAC = Math.sqrt(Lih ** 2 + param.H2 ** 2);
3495
+ if (param.R2 > lAC) {
3496
+ throw `err141: R2 ${param.R2} is too large comapre to lAC ${ffix12(lAC)} mm`;
3497
+ }
3498
+ const aCAD = Math.asin(param.R2 / lAC);
3499
+ const lAD = lAC * Math.cos(aCAD);
3500
+ const xAD = lAD * Math.cos(aBAC + aCAD);
3501
+ const yAD = lAD * Math.sin(aBAC + aCAD);
3502
+ const cotanBAD = xAD / yAD;
3503
+ const sHeight = param.H1 + param.H2 - R1 - param.E1 - param.E2;
3504
+ const sStepY = param.smEy + param.shEy;
3505
+ const sNy = Math.floor((sHeight + param.smEy) / sStepY);
3506
+ const sRc = param.shEy * param.shPr / 200;
3507
+ if (R1 < 0.1) {
3508
+ throw `err087: R1 ${ffix12(R1)} is too small because of D1 ${param.D1}`;
3509
+ }
3510
+ if (param.R2 < R1 + 0.1) {
3511
+ throw `err150: R2 ${ffix12(param.R2)} is too small compare to R1 ${R1} mm`;
3512
+ }
3513
+ if (R5b < aJr) {
3514
+ throw `err154: R5b ${ffix12(R5b)} is too small because of H2 ${param.D2}, H1 ${param.H1} or Hfoot ${ffix12(Hfoot)}`;
3515
+ }
3516
+ if (Li < 0.1) {
3517
+ throw `err158: Li ${ffix12(Li)} is too small because of aJr ${ffix12(aJr)} radian`;
3518
+ }
3519
+ if (W1 < 0.1) {
3520
+ throw `err161: W1 ${ffix12(W1)} is too small because of Hfoot ${ffix12(Hfoot)} mm`;
3521
+ }
3522
+ if (Li < 3 * D3) {
3523
+ throw `err166: D3 ${ffix12(D3)} is too large compare to Li ${ffix12(Li)} mm`;
3524
+ }
3525
+ if (param.spring === 1) {
3526
+ if (sHeight < 0.1) {
3527
+ throw `err189: sHeight ${ffix12(sHeight)} is too small because of E1 ${param.E1} or E2 ${param.E2}`;
3528
+ }
3529
+ }
3530
+ rGeome.logstr += `Bearing holder wall: Hwall ${ffix12(Hwall)}, Hfoot ${ffix12(Hfoot)} mm
3531
+ `;
3532
+ rGeome.logstr += `Width of one unit: Lii ${ffix12(Lii)}, Li ${ffix12(Li)} mm
3533
+ `;
3534
+ rGeome.logstr += `Ratio R2/Li ${ffix12(100 * param.R2 / Lih)} %
3535
+ `;
3536
+ rGeome.logstr += `Width of bottom: W1 ${ffix12(W1)}, D3 ${ffix12(D3)} mm
3537
+ `;
3538
+ if (param.spring === 1) {
3539
+ rGeome.logstr += `spring: sNy ${sNy}, sRc ${ffix12(sRc)} mm
3540
+ `;
3541
+ } else {
3542
+ rGeome.logstr += `No spring
3543
+ `;
3544
+ }
3545
+ const sWi = [];
3546
+ if (param.spring === 1) {
3547
+ for (let jj = 0; jj < sNy; jj++) {
3548
+ const yy = Hfoot + param.E1 + jj * sStepY;
3549
+ const yRef = yy + param.shEy / 2;
3550
+ const [xRef, lxAZ, lx, nx] = calcXref2(yRef, jj);
3551
+ let xx = xRef;
3552
+ sWi.push(makeSpringHollow2(lxAZ).translate(xx, yy));
3553
+ xx += lxAZ + param.smEx;
3554
+ for (let ii = 0; ii < nx - 1; ii++) {
3555
+ sWi.push(makeSpringHollow2(lx).translate(xx, yy));
3556
+ xx += lx + param.smEx;
3557
+ }
3558
+ sWi.push(makeSpringHollow2(lxAZ).translate(xx, yy));
3559
+ }
3560
+ }
3561
+ const ctrAxisi = contourCircle9(Lih, Hfoot + param.H1 + param.H2, R1);
3562
+ const fas = [];
3563
+ const junction = {};
3564
+ for (let ii = 0; ii < param.N5; ii++) {
3565
+ const Jcond = ii < param.N5 - 1;
3566
+ fas.push(makeFaBottom2(`Jb${ii}`, `Jb${ii + 1}`, `Jl${ii}`, `Jr${ii}`, Jcond));
3567
+ const ctrL = makeCtrWall2(`Jl${ii}`);
3568
+ const ctrR = makeCtrWall2(`Jr${ii}`);
3569
+ fas.push(facet3([ctrL, ctrAxisi, ...sWi]));
3570
+ fas.push(facet3([ctrR, ctrAxisi, ...sWi]));
3571
+ junction[`Jb${ii}`] = { angle: -a5, radius: aJr, neutral: aJn, mark: aJm };
3572
+ junction[`Jl${ii}`] = { angle: aJa, radius: aJr, neutral: aJn, mark: aJm };
3573
+ junction[`Jr${ii}`] = { angle: aJa, radius: aJr, neutral: aJn, mark: aJm };
3574
+ }
3575
+ const postHalf = [];
3576
+ for (let ii = 1; ii < param.N5; ii++) {
3577
+ postHalf.push(...[`Jb${ii}`, Li]);
3578
+ }
3579
+ const sFold = sheetFold3(
3580
+ [...fas],
3581
+ {
3582
+ ...junction
3583
+ },
3584
+ [
3585
+ { x1: 0, y1: 0, a1: 0, l1: W1, ante: ["Jl0", Hwall], post: ["Jr0", Hwall] },
3586
+ { x1: 0, y1: -param.Th - param.W2, a1: 0, l1: Li, ante: ["Jb0"], post: postHalf }
3587
+ ],
3588
+ param.Th,
3589
+ rGeome.partName
3590
+ );
3591
+ const ffObj = sFold.makeFigures();
3592
+ for (const iFace of Object.keys(ffObj)) {
3593
+ rGeome.fig[iFace] = ffObj[iFace];
3594
+ }
3595
+ rGeome.vol = sFold.makeVolume();
3596
+ rGeome.sub = {};
3597
+ rGeome.logstr += "springInt drawn successfully!\n";
3598
+ rGeome.calcErr = false;
3599
+ } catch (emsg) {
3600
+ rGeome.logstr += emsg;
3601
+ console.log(emsg);
3602
+ }
3603
+ return rGeome;
3604
+ }
3605
+ var springIntDef = {
3606
+ pTitle: "springInt",
3607
+ pDescription: "bearing-holder in the interior of a ring",
3608
+ pDef: pDef11,
3609
+ pGeom: pGeom11
3610
+ };
3611
+
3612
+ // src/heliostat/heliostat.ts
3613
+ import {
3614
+ point as point6,
3615
+ contour as contour13,
3616
+ contourCircle as contourCircle10,
3617
+ ctrRectangle as ctrRectangle5,
3618
+ figure as figure10,
3619
+ degToRad as degToRad5,
3620
+ radToDeg as radToDeg8,
3621
+ ffix as ffix13,
3622
+ pNumber as pNumber12,
3623
+ pDropdown as pDropdown6,
3624
+ pSectionSeparator as pSectionSeparator12,
3625
+ EExtrude as EExtrude9,
3626
+ EBVolume as EBVolume9,
3627
+ initGeom as initGeom12
3628
+ } from "geometrix";
3629
+ import { triLALrL, triLLLrA } from "triangule";
3630
+ var pDef12 = {
3631
+ partName: "heliostat",
3632
+ params: [
3633
+ //pNumber(name, unit, init, min, max, step)
3634
+ pNumber12("L1", "mm", 4e3, 1e3, 2e4, 1),
3635
+ pNumber12("D1", "mm", 1e3, 100, 4e3, 1),
3636
+ pNumber12("D3", "mm", 600, 100, 2e3, 1),
3637
+ pNumber12("L9", "mm", 8e3, 1e3, 2e4, 1),
3638
+ pSectionSeparator12("Bottom details"),
3639
+ pNumber12("E1", "mm", 10, 1, 100, 1),
3640
+ pNumber12("E2", "mm", 10, 1, 100, 1),
3641
+ pNumber12("E3", "mm", 10, 1, 100, 1),
3642
+ pNumber12("S1", "mm", 100, 1, 500, 1),
3643
+ pNumber12("S3", "mm", 100, 1, 500, 1),
3644
+ pSectionSeparator12("Fixation"),
3645
+ pNumber12("N2", "holes", 24, 1, 500, 1),
3646
+ pNumber12("D2", "mm", 40, 1, 400, 1),
3647
+ pNumber12("W1", "mm", 20, 1, 400, 1),
3648
+ pSectionSeparator12("Door"),
3649
+ pNumber12("H1H", "mm", 1500, 100, 3e3, 1),
3650
+ pNumber12("H1W", "mm", 600, 100, 1e3, 1),
3651
+ pNumber12("H1P", "mm", 300, 100, 2e3, 1),
3652
+ pSectionSeparator12("Junction"),
3653
+ pNumber12("Z3", "mm", 200, 1, 500, 1),
3654
+ pNumber12("Z4", "mm", 200, 1, 500, 1),
3655
+ pDropdown6("gen3D", ["Both", "Top", "Bottom"]),
3656
+ pSectionSeparator12("Top-trunk"),
3657
+ pNumber12("L4", "mm", 2e3, 100, 2e4, 1),
3658
+ pNumber12("E4", "mm", 10, 1, 100, 1),
3659
+ pNumber12("E5", "mm", 10, 1, 100, 1),
3660
+ pNumber12("H6", "mm", 600, 100, 2e3, 1),
3661
+ pNumber12("E7", "mm", 10, 1, 100, 1),
3662
+ pNumber12("D7", "mm", 200, 10, 2e3, 1),
3663
+ pSectionSeparator12("Top-branch"),
3664
+ pNumber12("E6", "mm", 10, 1, 100, 1),
3665
+ pNumber12("D6", "mm", 400, 100, 2e3, 1),
3666
+ pNumber12("W8", "mm", 300, 100, 2e3, 1),
3667
+ pNumber12("L8", "mm", 2e3, 100, 2e4, 1),
3668
+ pNumber12("H8", "mm", 1e3, 100, 3e3, 1),
3669
+ pNumber12("G8", "mm", 500, 100, 2e3, 1),
3670
+ pNumber12("F8", "mm", 200, 10, 1e3, 1),
3671
+ pNumber12("a8", "degre", 140, 30, 200, 1),
3672
+ pSectionSeparator12("Top-diagonal"),
3673
+ pNumber12("D4", "mm", 300, 10, 2e3, 1),
3674
+ pNumber12("EE4", "mm", 10, 1, 100, 1),
3675
+ pNumber12("R4v", "mm", 400, 10, 5e3, 1),
3676
+ pNumber12("R4h", "mm", 400, 10, 5e3, 1)
3677
+ ],
3678
+ paramSvg: {
3679
+ L1: "heliostat_bottom.svg",
3680
+ D1: "heliostat_bottom.svg",
3681
+ D3: "heliostat_bottom.svg",
3682
+ L9: "heliostat_junction.svg",
3683
+ E1: "heliostat_bottom.svg",
3684
+ E2: "heliostat_bottom.svg",
3685
+ E3: "heliostat_bottom.svg",
3686
+ S1: "heliostat_bottom.svg",
3687
+ S3: "heliostat_bottom.svg",
3688
+ N2: "heliostat_fixation.svg",
3689
+ D2: "heliostat_fixation.svg",
3690
+ W1: "heliostat_fixation.svg",
3691
+ H1H: "heliostat_bottom.svg",
3692
+ H1W: "heliostat_bottom.svg",
3693
+ H1P: "heliostat_bottom.svg",
3694
+ Z3: "heliostat_junction.svg",
3695
+ Z4: "heliostat_junction.svg",
3696
+ gen3D: "heliostat_junction.svg",
3697
+ L4: "heliostat_top.svg",
3698
+ E4: "heliostat_top.svg",
3699
+ E5: "heliostat_top.svg",
3700
+ E6: "heliostat_top.svg",
3701
+ D6: "heliostat_top.svg",
3702
+ H6: "heliostat_top.svg",
3703
+ E7: "heliostat_top.svg",
3704
+ D7: "heliostat_top.svg",
3705
+ W8: "heliostat_top.svg",
3706
+ L8: "heliostat_top.svg",
3707
+ H8: "heliostat_hand.svg",
3708
+ G8: "heliostat_hand.svg",
3709
+ F8: "heliostat_hand.svg",
3710
+ a8: "heliostat_hand.svg",
3711
+ D4: "heliostat_top.svg",
3712
+ EE4: "heliostat_top.svg",
3713
+ R4v: "heliostat_top.svg",
3714
+ R4h: "heliostat_top.svg"
3715
+ },
3716
+ sim: {
3717
+ tMax: 180,
3718
+ tStep: 0.5,
3719
+ tUpdate: 500
3720
+ // every 0.5 second
3721
+ }
3722
+ };
3723
+ function pGeom12(t, param, suffix = "") {
3724
+ const rGeome = initGeom12(pDef12.partName + suffix);
3725
+ const figBottomDisc = figure10();
3726
+ const figBottomPole = figure10();
3727
+ const figDoor = figure10();
3728
+ const figTopPole = figure10();
3729
+ const figHorizPole = figure10();
3730
+ const figHorizPoleInt = figure10();
3731
+ const figDiag3 = figure10();
3732
+ const figDiagE = figure10();
3733
+ const figDiagI = figure10();
3734
+ const figCleanDiag = figure10();
3735
+ const figHand = figure10();
3736
+ rGeome.logstr += `${rGeome.partName} simTime: ${t}
3737
+ `;
3738
+ try {
3739
+ let ctrBottomPole2 = function(sig) {
3740
+ const rCtr = contour13(sig * R1, 0).addSegStrokeR(0, param.E1).addSegStrokeR(sig * (R3 - R1), L1b).addSegStrokeR(-sig * S3c, 0).addSegStrokeR(0, -param.E3).addSegStrokeR(sig * param.S3, 0).addSegStrokeA(sig * (R1 - S1b), param.E1).addSegStrokeR(0, -param.E1).closeSegStroke();
3741
+ return rCtr;
3742
+ }, ctrTopPole2 = function(sig) {
3743
+ const rCtr = contour13(-sig * R4e, posY4).addSegStrokeR(sig * E4b, 0).addSegStrokeR(sig * (R4i - R5b), param.L4).addSegStrokeR(sig * (R5b - R5), 0).addSegStrokeR(0, param.E5).addSegStrokeR(sig * (R5 - R5t), 0).addSegStrokeR(sig * (R5t - R7b), param.H6).addSegStrokeR(sig * (R7b - R7i), 0).addSegStrokeR(0, param.E7).addSegStrokeR(sig * (R7i - R7t), 0).closeSegStroke();
3744
+ return rCtr;
3745
+ }, ctrDiag2 = function(posX, RR, AA) {
3746
+ const rCtr = ctrRectangle5(posX - RR, posY4, 2 * RR, diagL).rotate(posX, posY4, AA);
3747
+ return rCtr;
3748
+ }, ctrCleanDiag2 = function(sig) {
3749
+ const rCtr = contour13(-sig * R4i, posY4).addSegStrokeR(sig * (R4i - R5b), param.L4).addSegStrokeR(sig * R5b, 0).addSegStrokeR(0, -param.L4 - 2 * param.D6).addSegStrokeR(-sig * R4i, 0).closeSegStroke();
3750
+ return rCtr;
3751
+ };
3752
+ var ctrBottomPole = ctrBottomPole2, ctrTopPole = ctrTopPole2, ctrDiag = ctrDiag2, ctrCleanDiag = ctrCleanDiag2;
3753
+ const pi2 = Math.PI / 2;
3754
+ const H1W2 = param.H1W / 2;
3755
+ const H1h = param.H1H - 2 * H1W2;
3756
+ const R1 = param.D1 / 2;
3757
+ const R3 = param.D3 / 2;
3758
+ const L1b = param.L1 - param.E1;
3759
+ const inclination = Math.atan2(L1b, R1 - R3);
3760
+ const S1b = param.E2 / Math.cos(pi2 - inclination);
3761
+ const S1c = param.S1 + S1b;
3762
+ const R1b = R1 - S1c;
3763
+ const R1bb = R1 - S1b;
3764
+ const S3b = param.E3 / Math.tan(inclination);
3765
+ const S3c = param.S3 + S1b - S3b;
3766
+ const R5 = R3 - S3c;
3767
+ const R2 = param.D2 / 2;
3768
+ const lFixation = R1b + param.W1 + R2;
3769
+ const aFixation = 2 * Math.PI / param.N2;
3770
+ const d5b = param.Z3 / Math.tan(inclination);
3771
+ const S5b = S3c + param.Z4 - d5b;
3772
+ const S5t = S5b - param.E5 / Math.tan(inclination);
3773
+ const d4b = param.L4 / Math.tan(inclination);
3774
+ const R5b = R5 + S5b;
3775
+ const R5t = R5 + S5t;
3776
+ const R4i = R5b + d4b;
3777
+ const E4b = param.E4 / Math.sin(inclination);
3778
+ const R4e = R4i + E4b;
3779
+ const posY4 = param.L1 + param.Z3 - param.L4;
3780
+ const R7b = R5t - param.H6 / Math.tan(inclination);
3781
+ const R7t = R7b - param.E7 / Math.tan(inclination) + E4b;
3782
+ const R7i = param.D7 / 2;
3783
+ const genTop = param.gen3D === 2 ? false : true;
3784
+ const genBottom = param.gen3D === 1 ? false : true;
3785
+ const R6e = param.D6 / 2;
3786
+ const R6i = R6e - param.E6;
3787
+ const posY6 = param.L1 + param.Z3 + param.E5 + param.H6 / 2;
3788
+ const L92 = param.L9 / 2;
3789
+ const diagHeight = param.L4 + param.E5 + param.H6 / 2;
3790
+ const diagHeight2 = diagHeight - R6e;
3791
+ const diagV = diagHeight2 / Math.sin(inclination);
3792
+ const diagH = L92 - (R4e - diagHeight2 / Math.tan(inclination));
3793
+ const triL1 = diagH - param.R4h;
3794
+ const triL2 = diagV - param.R4v;
3795
+ const [triL3, triLog1] = triLALrL(triL1, inclination, triL2);
3796
+ const [triA31, triLog2] = triLLLrA(triL1, triL2, triL3);
3797
+ rGeome.logstr += triLog1 + triLog2;
3798
+ const diagA = pi2 - triA31;
3799
+ const diagDX = diagHeight2 / Math.tan(triA31);
3800
+ const RR4e = param.D4 / 2;
3801
+ const RR4i = RR4e - param.EE4;
3802
+ const diagDX2 = RR4e / Math.cos(diagA);
3803
+ const posX4 = -L92 + param.R4h + diagDX + diagDX2;
3804
+ const diagL = diagHeight / Math.cos(diagA);
3805
+ const R8 = param.G8 / 2;
3806
+ const R82 = R8 + param.F8;
3807
+ const a82 = degToRad5(param.a8) / 2;
3808
+ const posY8 = posY6 + param.H8;
3809
+ const [t2iL3, triLog3] = triLALrL(param.H8, a82, R82);
3810
+ const [t2iA31, triLog4] = triLLLrA(param.H8, R82, t2iL3);
3811
+ rGeome.logstr += triLog3 + triLog4;
3812
+ const t3iA = Math.acos(R6e / t2iL3);
3813
+ const a62pre = t2iA31 + t3iA;
3814
+ const a62 = Math.min(pi2, a62pre);
3815
+ const L82 = param.L8 / 2;
3816
+ const posX9 = [-L92, -L82 - param.W8, L82, L92 - param.W8];
3817
+ if (R1 < R3) {
3818
+ throw `err176: D1 ${ffix13(param.D1)} is too small compare to D3 ${ffix13(param.D3)} mm`;
3819
+ }
3820
+ if (R1b < 0.1) {
3821
+ throw `err183: R1b ${ffix13(R1b)} is too small because of ${ffix13(param.E2)} or ${ffix13(param.S1)} mm`;
3822
+ }
3823
+ if (param.S1 < 2 * (param.W1 + R2)) {
3824
+ throw `err142: S1 ${ffix13(param.S1)} is too small compare to W1 ${ffix13(param.W1)} and D2 ${ffix13(2 * R2)} mm`;
3825
+ }
3826
+ if (H1h < 0.1) {
3827
+ throw `err167: H1H ${ffix13(param.H1H)} is too small compare to H1W ${ffix13(param.H1W)} mm`;
3828
+ }
3829
+ if (param.Z4 < d5b) {
3830
+ throw `err154: Z4 ${ffix13(param.Z4)} is too small compare to d5b ${ffix13(d5b)} mm`;
3831
+ }
3832
+ if (R7b < R7i) {
3833
+ throw `err169: R7b ${ffix13(2 * R7b)} is too small because to D7 ${ffix13(2 * R7i)} mm`;
3834
+ }
3835
+ if (R6i < 0.1) {
3836
+ throw `err185: R6i ${ffix13(R6i)} is too small because to E6 ${ffix13(param.E6)} mm`;
3837
+ }
3838
+ if (param.H6 < param.D6) {
3839
+ throw `err200: H6 ${ffix13(param.H6)} is too small compare to D6 ${ffix13(param.D6)} mm`;
3840
+ }
3841
+ rGeome.logstr += `Cone inclination ${ffix13(radToDeg8(inclination))}, diagonal ${ffix13(radToDeg8(diagA))} deg
3842
+ `;
3843
+ rGeome.logstr += `Diameters: D1 ${ffix13(2 * R1)}, D1b ${ffix13(2 * R1)}, D3 ${ffix13(2 * R3)}, D5 ${ffix13(2 * R5)} mm
3844
+ `;
3845
+ rGeome.logstr += `TopPole: posY4 ${ffix13(posY4)}, D4 ${ffix13(2 * R4e)} mm
3846
+ `;
3847
+ const fixationHoles = [];
3848
+ for (let ii = 0; ii < param.N2; ii++) {
3849
+ const pt = point6(0, 0).translatePolar(ii * aFixation, lFixation);
3850
+ fixationHoles.push(contourCircle10(pt.cx, pt.cy, R2));
3851
+ }
3852
+ figBottomDisc.addMainOI([
3853
+ contourCircle10(0, 0, R1),
3854
+ contourCircle10(0, 0, R1b),
3855
+ ...fixationHoles
3856
+ ]);
3857
+ figBottomDisc.addSecond(contourCircle10(0, 0, R1bb));
3858
+ figBottomDisc.addSecond(contourCircle10(0, 0, R3));
3859
+ figBottomDisc.addSecond(contourCircle10(0, 0, R5));
3860
+ figBottomPole.addMainO(ctrBottomPole2(-1));
3861
+ figBottomPole.addSecond(ctrBottomPole2(1));
3862
+ const ctrDoor = contour13(H1W2, param.H1P + H1W2).addSegStrokeR(0, H1h).addPointR(-H1W2, H1W2).addPointR(-2 * H1W2, 0).addSegArc2().addSegStrokeR(0, -H1h).addPointR(H1W2, -H1W2).addPointR(2 * H1W2, 0).addSegArc2();
3863
+ figDoor.addMainO(ctrDoor);
3864
+ figDoor.addSecond(ctrBottomPole2(1));
3865
+ figDoor.addSecond(ctrBottomPole2(-1));
3866
+ figBottomPole.addSecond(ctrDoor);
3867
+ figTopPole.addMainO(ctrTopPole2(1));
3868
+ figTopPole.addSecond(ctrTopPole2(-1));
3869
+ figTopPole.addSecond(ctrBottomPole2(1));
3870
+ figTopPole.addSecond(ctrBottomPole2(-1));
3871
+ figTopPole.addSecond(ctrDoor);
3872
+ figBottomPole.addSecond(ctrTopPole2(-1));
3873
+ figBottomPole.addSecond(ctrTopPole2(1));
3874
+ const ctrHorizExt = contourCircle10(0, posY6, R6e);
3875
+ const ctrHorizInt = contourCircle10(0, posY6, R6i);
3876
+ figHorizPole.addMainOI([ctrHorizExt, ctrHorizInt]);
3877
+ figHorizPole.addSecond(ctrTopPole2(-1));
3878
+ figHorizPole.addSecond(ctrTopPole2(1));
3879
+ figHorizPoleInt.addMainO(ctrHorizInt);
3880
+ figHorizPoleInt.addSecond(ctrHorizExt);
3881
+ figHorizPoleInt.addSecond(ctrTopPole2(-1));
3882
+ figHorizPoleInt.addSecond(ctrTopPole2(1));
3883
+ figDiag3.addMainOI([
3884
+ ctrRectangle5(-L92, posY6 - R6e, 2 * L92, 2 * R6e),
3885
+ ctrRectangle5(-L92, posY6 - R6i, 2 * L92, 2 * R6i)
3886
+ ]);
3887
+ figDiag3.addSecond(ctrTopPole2(-1));
3888
+ figDiag3.addSecond(ctrTopPole2(1));
3889
+ figDiag3.addSecond(ctrDiag2(posX4, RR4e, diagA));
3890
+ figDiag3.addSecond(ctrDiag2(posX4, RR4i, diagA));
3891
+ figDiag3.addSecond(ctrDiag2(-posX4, RR4e, -diagA));
3892
+ figDiag3.addSecond(ctrDiag2(-posX4, RR4i, -diagA));
3893
+ for (let ii = 0; ii < 4; ii++) {
3894
+ figDiag3.addSecond(ctrRectangle5(posX9[ii], posY6, param.W8, param.H8));
3895
+ }
3896
+ const ctrDiagE = contourCircle10(0, 0, RR4e);
3897
+ const ctrDiagI = contourCircle10(0, 0, RR4i);
3898
+ figDiagE.addMainOI([ctrDiagE, ctrDiagI]);
3899
+ figDiagI.addMainO(ctrDiagI);
3900
+ figDiagI.addSecond(ctrDiagE);
3901
+ figCleanDiag.addMainO(ctrCleanDiag2(1));
3902
+ figCleanDiag.addSecond(ctrTopPole2(1));
3903
+ figCleanDiag.addSecond(ctrTopPole2(-1));
3904
+ const p1 = point6(0, posY8).translatePolar(a82 - pi2, R82);
3905
+ const p2 = point6(0, posY8).translatePolar(a82 - pi2, R8);
3906
+ const p3 = point6(0, posY8).translatePolar(-a82 - pi2, R8);
3907
+ const p4 = point6(0, posY8).translatePolar(-a82 - pi2, R82);
3908
+ const p5 = point6(0, posY6).translatePolar(pi2 + a62, R6e);
3909
+ const p6 = point6(0, posY6).translatePolar(pi2 - a62, R6e);
3910
+ const ctrHand = contour13(p1.cx, p1.cy).addSegStrokeA(p2.cx, p2.cy).addPointA(0, posY8 - R8).addPointA(p3.cx, p3.cy).addSegArc2().addSegStrokeA(p4.cx, p4.cy).addSegStrokeA(p5.cx, p5.cy).addPointA(0, posY6 + R6e).addPointA(p6.cx, p6.cy).addSegArc2().closeSegStroke();
3911
+ figHand.addMainO(ctrHand);
3912
+ figHand.addSecond(contourCircle10(0, posY6, R6e));
3913
+ figHand.addSecond(contourCircle10(0, posY6, R6i));
3914
+ figHand.addSecond(contourCircle10(0, posY8, R8));
3915
+ figHand.addSecond(contourCircle10(0, posY8, R82));
3916
+ figHand.addSecond(ctrTopPole2(1));
3917
+ figHand.addSecond(ctrTopPole2(-1));
3918
+ rGeome.fig = {
3919
+ faceBottomPole: figBottomPole,
3920
+ faceDoor: figDoor,
3921
+ faceBottomDisc: figBottomDisc,
3922
+ faceTopPole: figTopPole,
3923
+ faceHorizPole: figHorizPole,
3924
+ faceHorizPoleInt: figHorizPoleInt,
3925
+ faceDiag3: figDiag3,
3926
+ faceDiagE: figDiagE,
3927
+ faceDiagI: figDiagI,
3928
+ faceCleanDiag: figCleanDiag,
3929
+ faceHand: figHand
3930
+ };
3931
+ const designName = rGeome.partName;
3932
+ const selectedList = [];
3933
+ if (genTop) {
3934
+ selectedList.push(`ipax_${designName}_topPart`);
3935
+ }
3936
+ if (genBottom) {
3937
+ selectedList.push(`ipax_${designName}_bottomPart`);
3938
+ }
3939
+ rGeome.vol = {
3940
+ extrudes: [
3941
+ {
3942
+ outName: `subpax_${designName}_bottomPole`,
3943
+ face: `${designName}_faceBottomPole`,
3944
+ extrudeMethod: EExtrude9.eRotate,
3945
+ rotate: [0, 0, 0],
3946
+ translate: [0, 0, 0]
3947
+ },
3948
+ {
3949
+ outName: `subpax_${designName}_door`,
3950
+ face: `${designName}_faceDoor`,
3951
+ extrudeMethod: EExtrude9.eLinearOrtho,
3952
+ length: 2 * R1,
3953
+ rotate: [pi2, 0, 0],
3954
+ translate: [0, 0, 0]
3955
+ },
3956
+ {
3957
+ outName: `subpax_${designName}_bottomDisc`,
3958
+ face: `${designName}_faceBottomDisc`,
3959
+ extrudeMethod: EExtrude9.eLinearOrtho,
3960
+ length: param.E1,
3961
+ rotate: [0, 0, 0],
3962
+ translate: [0, 0, 0]
3963
+ },
3964
+ {
3965
+ outName: `subpax_${designName}_topPole`,
3966
+ face: `${designName}_faceTopPole`,
3967
+ extrudeMethod: EExtrude9.eRotate,
3968
+ rotate: [0, 0, 0],
3969
+ translate: [0, 0, 0]
3970
+ },
3971
+ {
3972
+ outName: `subpax_${designName}_horizPole`,
3973
+ face: `${designName}_faceHorizPole`,
3974
+ extrudeMethod: EExtrude9.eLinearOrtho,
3975
+ length: param.L9,
3976
+ rotate: [pi2, 0, 0],
3977
+ translate: [0, L92, 0]
3978
+ },
3979
+ {
3980
+ outName: `subpax_${designName}_horizPoleInt`,
3981
+ face: `${designName}_faceHorizPoleInt`,
3982
+ extrudeMethod: EExtrude9.eLinearOrtho,
3983
+ length: param.L9,
3984
+ rotate: [pi2, 0, 0],
3985
+ translate: [0, L92, 0]
3986
+ },
3987
+ {
3988
+ outName: `subpax_${designName}_diag1e`,
3989
+ face: `${designName}_faceDiagE`,
3990
+ extrudeMethod: EExtrude9.eLinearOrtho,
3991
+ length: diagL,
3992
+ rotate: [diagA, 0, 0],
3993
+ translate: [0, posX4, posY4]
3994
+ },
3995
+ {
3996
+ outName: `subpax_${designName}_diag1i`,
3997
+ face: `${designName}_faceDiagI`,
3998
+ extrudeMethod: EExtrude9.eLinearOrtho,
3999
+ length: diagL,
4000
+ rotate: [diagA, 0, 0],
4001
+ translate: [0, posX4, posY4]
4002
+ },
4003
+ {
4004
+ outName: `subpax_${designName}_diag2e`,
4005
+ face: `${designName}_faceDiagE`,
4006
+ extrudeMethod: EExtrude9.eLinearOrtho,
4007
+ length: diagL,
4008
+ rotate: [-diagA, 0, 0],
4009
+ translate: [0, -posX4, posY4]
4010
+ },
4011
+ {
4012
+ outName: `subpax_${designName}_diag2i`,
4013
+ face: `${designName}_faceDiagI`,
4014
+ extrudeMethod: EExtrude9.eLinearOrtho,
4015
+ length: diagL,
4016
+ rotate: [-diagA, 0, 0],
4017
+ translate: [0, -posX4, posY4]
4018
+ },
4019
+ {
4020
+ outName: `subpax_${designName}_cleanDiag`,
4021
+ face: `${designName}_faceCleanDiag`,
4022
+ extrudeMethod: EExtrude9.eRotate,
4023
+ rotate: [0, 0, 0],
4024
+ translate: [0, 0, 0]
4025
+ },
4026
+ {
4027
+ outName: `subpax_${designName}_hand1`,
4028
+ face: `${designName}_faceHand`,
4029
+ extrudeMethod: EExtrude9.eLinearOrtho,
4030
+ length: param.W8,
4031
+ rotate: [pi2, 0, 0],
4032
+ translate: [0, posX9[0] + param.W8, 0]
4033
+ },
4034
+ {
4035
+ outName: `subpax_${designName}_hand2`,
4036
+ face: `${designName}_faceHand`,
4037
+ extrudeMethod: EExtrude9.eLinearOrtho,
4038
+ length: param.W8,
4039
+ rotate: [pi2, 0, 0],
4040
+ translate: [0, posX9[1] + param.W8, 0]
4041
+ },
4042
+ {
4043
+ outName: `subpax_${designName}_hand3`,
4044
+ face: `${designName}_faceHand`,
4045
+ extrudeMethod: EExtrude9.eLinearOrtho,
4046
+ length: param.W8,
4047
+ rotate: [pi2, 0, 0],
4048
+ translate: [0, posX9[2] + param.W8, 0]
4049
+ },
4050
+ {
4051
+ outName: `subpax_${designName}_hand4`,
4052
+ face: `${designName}_faceHand`,
4053
+ extrudeMethod: EExtrude9.eLinearOrtho,
4054
+ length: param.W8,
4055
+ rotate: [pi2, 0, 0],
4056
+ translate: [0, posX9[3] + param.W8, 0]
4057
+ }
4058
+ ],
4059
+ volumes: [
4060
+ {
4061
+ outName: `ipax_${designName}_bottomPolePlus`,
4062
+ boolMethod: EBVolume9.eUnion,
4063
+ inList: [`subpax_${designName}_bottomDisc`, `subpax_${designName}_bottomPole`]
4064
+ },
4065
+ {
4066
+ outName: `ipax_${designName}_bottomPart`,
4067
+ boolMethod: EBVolume9.eSubstraction,
4068
+ inList: [`ipax_${designName}_bottomPolePlus`, `subpax_${designName}_door`]
4069
+ },
4070
+ {
4071
+ outName: `ipax_${designName}_topPlus`,
4072
+ boolMethod: EBVolume9.eUnion,
4073
+ inList: [
4074
+ `subpax_${designName}_topPole`,
4075
+ `subpax_${designName}_horizPole`,
4076
+ `subpax_${designName}_diag1e`,
4077
+ `subpax_${designName}_diag2e`,
4078
+ `subpax_${designName}_hand1`,
4079
+ `subpax_${designName}_hand2`,
4080
+ `subpax_${designName}_hand3`,
4081
+ `subpax_${designName}_hand4`
4082
+ ]
4083
+ },
4084
+ {
4085
+ outName: `ipax_${designName}_topMinus`,
4086
+ boolMethod: EBVolume9.eUnion,
4087
+ inList: [
4088
+ `subpax_${designName}_horizPoleInt`,
4089
+ `subpax_${designName}_diag1i`,
4090
+ `subpax_${designName}_diag2i`,
4091
+ `subpax_${designName}_cleanDiag`
4092
+ ]
4093
+ },
4094
+ {
4095
+ outName: `ipax_${designName}_topPart`,
4096
+ boolMethod: EBVolume9.eSubstraction,
4097
+ inList: [`ipax_${designName}_topPlus`, `ipax_${designName}_topMinus`]
4098
+ },
4099
+ {
4100
+ outName: `pax_${designName}`,
4101
+ boolMethod: EBVolume9.eUnion,
4102
+ inList: selectedList
4103
+ }
4104
+ ]
4105
+ };
4106
+ rGeome.sub = {};
4107
+ rGeome.logstr += "heliostat drawn successfully!\n";
4108
+ rGeome.calcErr = false;
4109
+ } catch (emsg) {
4110
+ rGeome.logstr += emsg;
4111
+ console.log(emsg);
4112
+ }
4113
+ return rGeome;
4114
+ }
4115
+ var heliostatDef = {
4116
+ pTitle: "heliostat",
4117
+ pDescription: "the structure of an heliostat",
4118
+ pDef: pDef12,
4119
+ pGeom: pGeom12
4120
+ };
4121
+
4122
+ // src/rccar/rccar.ts
4123
+ import {
4124
+ ctrRectangle as ctrRectangle6,
4125
+ figure as figure11,
4126
+ ffix as ffix14,
4127
+ pNumber as pNumber13,
4128
+ pSectionSeparator as pSectionSeparator13,
4129
+ EExtrude as EExtrude10,
4130
+ EBVolume as EBVolume10,
4131
+ initGeom as initGeom13
4132
+ } from "geometrix";
4133
+ var pDef13 = {
4134
+ partName: "rccar",
4135
+ params: [
4136
+ //pNumber(name, unit, init, min, max, step)
4137
+ pNumber13("W1", "mm", 400, 10, 2e3, 1),
4138
+ pNumber13("L1", "mm", 1e3, 100, 8e3, 1),
4139
+ pSectionSeparator13("Platform"),
4140
+ pNumber13("E1", "mm", 10, 1, 100, 1),
4141
+ pSectionSeparator13("Angles"),
4142
+ pNumber13("a1", "degree", 45, 10, 80, 1),
4143
+ pNumber13("a2", "degree", 45, 10, 80, 1)
4144
+ ],
4145
+ paramSvg: {
4146
+ W1: "rccar_angles.svg",
4147
+ L1: "rccar_angles.svg",
4148
+ E1: "rccar_angles.svg",
4149
+ a1: "rccar_angles.svg",
4150
+ a2: "rccar_angles.svg"
4151
+ },
4152
+ sim: {
4153
+ tMax: 180,
4154
+ tStep: 0.5,
4155
+ tUpdate: 500
4156
+ // every 0.5 second
4157
+ }
4158
+ };
4159
+ function pGeom13(t, param, suffix = "") {
4160
+ const rGeome = initGeom13(pDef13.partName + suffix);
4161
+ const figPlatform = figure11();
4162
+ rGeome.logstr += `${rGeome.partName} simTime: ${t}
4163
+ `;
4164
+ try {
4165
+ const W12 = param.W1 / 2;
4166
+ const platSurface = param.L1 * param.W1 / 10 ** 6;
4167
+ if (param.L1 < param.W1) {
4168
+ throw `err176: L1 ${ffix14(param.L1)} is too small compare to W1 ${ffix14(param.W1)} mm`;
4169
+ }
4170
+ rGeome.logstr += `Platform surface: ${ffix14(platSurface)} m2
4171
+ `;
4172
+ figPlatform.addMainO(ctrRectangle6(-W12, 0, 2 * W12, param.E1));
4173
+ rGeome.fig = {
4174
+ facePlatform: figPlatform
4175
+ };
4176
+ const designName = rGeome.partName;
4177
+ rGeome.vol = {
4178
+ extrudes: [
4179
+ {
4180
+ outName: `subpax_${designName}_platform`,
4181
+ face: `${designName}_facePlatform`,
4182
+ extrudeMethod: EExtrude10.eLinearOrtho,
4183
+ length: param.L1,
4184
+ rotate: [0, 0, 0],
4185
+ translate: [0, 0, 0]
4186
+ }
4187
+ ],
4188
+ volumes: [
4189
+ {
4190
+ outName: `pax_${designName}`,
4191
+ boolMethod: EBVolume10.eUnion,
4192
+ inList: [`subpax_${designName}_platform`]
4193
+ }
4194
+ ]
4195
+ };
4196
+ rGeome.sub = {};
4197
+ rGeome.logstr += "RC-car drawn successfully!\n";
4198
+ rGeome.calcErr = false;
4199
+ } catch (emsg) {
4200
+ rGeome.logstr += emsg;
4201
+ console.log(emsg);
4202
+ }
4203
+ return rGeome;
4204
+ }
4205
+ var rccarDef = {
4206
+ pTitle: "rccar",
4207
+ pDescription: "high-level concept of the RC-car",
4208
+ pDef: pDef13,
4209
+ pGeom: pGeom13
4210
+ };
4211
+
4212
+ // src/capsule/capsule.ts
4213
+ import {
4214
+ ctrRectangle as ctrRectangle7,
4215
+ figure as figure12,
4216
+ ffix as ffix15,
4217
+ pNumber as pNumber14,
4218
+ pSectionSeparator as pSectionSeparator14,
4219
+ EExtrude as EExtrude11,
4220
+ EBVolume as EBVolume11,
4221
+ initGeom as initGeom14
4222
+ } from "geometrix";
4223
+ var pDef14 = {
4224
+ partName: "capsule",
4225
+ params: [
4226
+ //pNumber(name, unit, init, min, max, step)
4227
+ pNumber14("W1", "mm", 400, 10, 2e3, 1),
4228
+ pNumber14("L1", "mm", 1e3, 100, 8e3, 1),
4229
+ pSectionSeparator14("Platform"),
4230
+ pNumber14("E1", "mm", 10, 1, 100, 1)
4231
+ ],
4232
+ paramSvg: {
4233
+ W1: "capsule_side.svg",
4234
+ L1: "capsule_side.svg",
4235
+ E1: "capsule_side.svg"
4236
+ },
4237
+ sim: {
4238
+ tMax: 180,
4239
+ tStep: 0.5,
4240
+ tUpdate: 500
4241
+ // every 0.5 second
4242
+ }
4243
+ };
4244
+ function pGeom14(t, param, suffix = "") {
4245
+ const rGeome = initGeom14(pDef14.partName + suffix);
4246
+ const figPlatform = figure12();
4247
+ rGeome.logstr += `${rGeome.partName} simTime: ${t}
4248
+ `;
4249
+ try {
4250
+ const W12 = param.W1 / 2;
4251
+ const platSurface = param.L1 * param.W1 / 10 ** 6;
4252
+ if (param.L1 < param.W1) {
4253
+ throw `err176: L1 ${ffix15(param.L1)} is too small compare to W1 ${ffix15(param.W1)} mm`;
4254
+ }
4255
+ rGeome.logstr += `Platform surface: ${ffix15(platSurface)} m2
4256
+ `;
4257
+ figPlatform.addMainO(ctrRectangle7(-W12, 0, 2 * W12, param.E1));
4258
+ rGeome.fig = {
4259
+ facePlatform: figPlatform
4260
+ };
4261
+ const designName = rGeome.partName;
4262
+ rGeome.vol = {
4263
+ extrudes: [
4264
+ {
4265
+ outName: `subpax_${designName}_platform`,
4266
+ face: `${designName}_facePlatform`,
4267
+ extrudeMethod: EExtrude11.eLinearOrtho,
4268
+ length: param.L1,
4269
+ rotate: [0, 0, 0],
4270
+ translate: [0, 0, 0]
4271
+ }
4272
+ ],
4273
+ volumes: [
4274
+ {
4275
+ outName: `pax_${designName}`,
4276
+ boolMethod: EBVolume11.eUnion,
4277
+ inList: [`subpax_${designName}_platform`]
4278
+ }
4279
+ ]
4280
+ };
4281
+ rGeome.sub = {};
4282
+ rGeome.logstr += "capsule drawn successfully!\n";
4283
+ rGeome.calcErr = false;
4284
+ } catch (emsg) {
4285
+ rGeome.logstr += emsg;
4286
+ console.log(emsg);
4287
+ }
4288
+ return rGeome;
4289
+ }
4290
+ var capsuleDef = {
4291
+ pTitle: "capsule",
4292
+ pDescription: "high-level concept of the train-capsule",
4293
+ pDef: pDef14,
4294
+ pGeom: pGeom14
2741
4295
  };
2742
4296
  export {
4297
+ capsuleDef,
2743
4298
  door1arcDef,
4299
+ heliostatDef,
4300
+ houseDef,
2744
4301
  plugTorqueDef,
4302
+ rccarDef,
4303
+ springIntDef,
2745
4304
  springOneDef,
4305
+ springSideDef,
2746
4306
  springTorqueADef,
2747
4307
  springTorqueBDef,
2748
4308
  springTorqueCDef,