desi77 0.1.7 → 0.1.9
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
|
@@ -1040,13 +1040,14 @@ var springTorqueADef = {
|
|
|
1040
1040
|
|
|
1041
1041
|
// src/spring/plugTorque.ts
|
|
1042
1042
|
import {
|
|
1043
|
+
withinPiPi as withinPiPi2,
|
|
1043
1044
|
point as point3,
|
|
1044
|
-
contour as
|
|
1045
|
+
contour as contour5,
|
|
1045
1046
|
contourCircle as contourCircle3,
|
|
1046
1047
|
figure as figure4,
|
|
1047
|
-
degToRad,
|
|
1048
|
-
radToDeg as
|
|
1049
|
-
ffix as
|
|
1048
|
+
degToRad as degToRad2,
|
|
1049
|
+
radToDeg as radToDeg5,
|
|
1050
|
+
ffix as ffix5,
|
|
1050
1051
|
pNumber as pNumber4,
|
|
1051
1052
|
pDropdown as pDropdown2,
|
|
1052
1053
|
pSectionSeparator as pSectionSeparator4,
|
|
@@ -1054,7 +1055,68 @@ import {
|
|
|
1054
1055
|
EBVolume as EBVolume4,
|
|
1055
1056
|
initGeom as initGeom4
|
|
1056
1057
|
} from "geometrix";
|
|
1058
|
+
import { triALLrLAA as triALLrLAA2 } from "triangule";
|
|
1059
|
+
|
|
1060
|
+
// src/spring/libPlugTorque.ts
|
|
1061
|
+
import {
|
|
1062
|
+
withinPiPi,
|
|
1063
|
+
contour as contour4,
|
|
1064
|
+
degToRad,
|
|
1065
|
+
radToDeg as radToDeg4,
|
|
1066
|
+
ffix as ffix4
|
|
1067
|
+
} from "geometrix";
|
|
1057
1068
|
import { triALLrLAA } from "triangule";
|
|
1069
|
+
function ctrPlugExtern(param, RbEmax) {
|
|
1070
|
+
let rLog = "";
|
|
1071
|
+
const aM = degToRad(param.aM);
|
|
1072
|
+
const Rt = param.Dt / 2;
|
|
1073
|
+
const aTooth = 2 * Math.PI / param.Nt;
|
|
1074
|
+
const aAddenE = param.ate * aTooth / 100;
|
|
1075
|
+
const Htde = param.Ht * param.dh / 100;
|
|
1076
|
+
const Htae = param.Ht * (param.ah + param.aeh) / 100;
|
|
1077
|
+
const RminE = Rt - Htde;
|
|
1078
|
+
const RbE = Rt + Htae;
|
|
1079
|
+
let aSlopeE = 0;
|
|
1080
|
+
let aAddE = aAddenE;
|
|
1081
|
+
if (Math.abs(aM) > 1e-3) {
|
|
1082
|
+
const tri3 = triALLrLAA(aM, Rt, RminE);
|
|
1083
|
+
const tri4 = triALLrLAA(withinPiPi(Math.PI + aM), Rt, RbE);
|
|
1084
|
+
const [, , a12e, , , , trilog3] = tri3;
|
|
1085
|
+
const [, , , , , a12h, trilog4] = tri4;
|
|
1086
|
+
rLog += trilog3 + trilog4;
|
|
1087
|
+
aSlopeE = -a12e + a12h;
|
|
1088
|
+
aAddE = aAddenE - 2 * a12h;
|
|
1089
|
+
}
|
|
1090
|
+
const aDedE = aTooth - 2 * aSlopeE - aAddE;
|
|
1091
|
+
if (RbE > RbEmax) {
|
|
1092
|
+
throw `err087: RbE ${RbE} is too large compare to RbEmax ${RbEmax}`;
|
|
1093
|
+
}
|
|
1094
|
+
const tooSmallAngle = 1e-4;
|
|
1095
|
+
if (aAddE < tooSmallAngle || aDedE < tooSmallAngle) {
|
|
1096
|
+
throw `err164: aAddE ${ffix4(radToDeg4(aAddE))} or aDedE ${ffix4(radToDeg4(aDedE))} are too small`;
|
|
1097
|
+
}
|
|
1098
|
+
const ctrToothE = contour4(RminE, 0);
|
|
1099
|
+
for (let ii = 0; ii < param.Nt; ii++) {
|
|
1100
|
+
const aRef = ii * aTooth;
|
|
1101
|
+
ctrToothE.addSegStrokeAP(aRef + aSlopeE, RbE).addCornerRounded(param.Rae);
|
|
1102
|
+
if (param.SnAae === 1) {
|
|
1103
|
+
ctrToothE.addPointAP(aRef + aSlopeE + aAddE / 2, RbE).addPointAP(aRef + aSlopeE + aAddE, RbE).addSegArc2();
|
|
1104
|
+
} else {
|
|
1105
|
+
ctrToothE.addSegStrokeAP(aRef + aSlopeE + aAddE, RbE);
|
|
1106
|
+
}
|
|
1107
|
+
ctrToothE.addCornerRounded(param.Rae);
|
|
1108
|
+
ctrToothE.addSegStrokeAP(aRef + 2 * aSlopeE + aAddE, RminE).addCornerRounded(param.Rde);
|
|
1109
|
+
if (param.SnAde === 1) {
|
|
1110
|
+
ctrToothE.addPointAP(aRef + aTooth - aDedE / 2, RminE).addPointAP(aRef + aTooth, RminE).addSegArc2();
|
|
1111
|
+
} else {
|
|
1112
|
+
ctrToothE.addSegStrokeAP(aRef + aTooth, RminE);
|
|
1113
|
+
}
|
|
1114
|
+
ctrToothE.addCornerRounded(param.Rde);
|
|
1115
|
+
}
|
|
1116
|
+
return [ctrToothE, rLog];
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
// src/spring/plugTorque.ts
|
|
1058
1120
|
var pDef4 = {
|
|
1059
1121
|
partName: "plugTorque",
|
|
1060
1122
|
params: [
|
|
@@ -1136,7 +1198,7 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1136
1198
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
1137
1199
|
`;
|
|
1138
1200
|
try {
|
|
1139
|
-
const aM =
|
|
1201
|
+
const aM = degToRad2(param.aM);
|
|
1140
1202
|
const Rt = param.Dt / 2;
|
|
1141
1203
|
const Ri = param.Di / 2;
|
|
1142
1204
|
const Re = param.De / 2;
|
|
@@ -1165,31 +1227,32 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1165
1227
|
let aAddI = aAddenI;
|
|
1166
1228
|
let aAddE = aAddenE;
|
|
1167
1229
|
if (Math.abs(aM) > 1e-3) {
|
|
1168
|
-
const tri1 =
|
|
1169
|
-
const tri2 =
|
|
1170
|
-
const tri3 =
|
|
1171
|
-
const tri4 =
|
|
1172
|
-
const [,
|
|
1173
|
-
const [,
|
|
1174
|
-
const [,
|
|
1175
|
-
const [,
|
|
1230
|
+
const tri1 = triALLrLAA2(aM, Rt, RbI);
|
|
1231
|
+
const tri2 = triALLrLAA2(withinPiPi2(Math.PI + aM), Rt, RmaxI);
|
|
1232
|
+
const tri3 = triALLrLAA2(aM, Rt, RminE);
|
|
1233
|
+
const tri4 = triALLrLAA2(withinPiPi2(Math.PI + aM), Rt, RbE);
|
|
1234
|
+
const [, , a12a, , , , trilog1] = tri1;
|
|
1235
|
+
const [, , , , , a12d, trilog2] = tri2;
|
|
1236
|
+
const [, , a12e, , , , trilog3] = tri3;
|
|
1237
|
+
const [, , , , , a12h, trilog4] = tri4;
|
|
1176
1238
|
rGeome.logstr += trilog1 + trilog2 + trilog3 + trilog4;
|
|
1177
|
-
aSlopeI = -a12a +
|
|
1178
|
-
aSlopeE = -a12e +
|
|
1179
|
-
aAddI = aAddenI - 2 *
|
|
1180
|
-
aAddE = aAddenE - 2 *
|
|
1239
|
+
aSlopeI = -a12a + a12d;
|
|
1240
|
+
aSlopeE = -a12e + a12h;
|
|
1241
|
+
aAddI = aAddenI - 2 * a12d;
|
|
1242
|
+
aAddE = aAddenE - 2 * a12h;
|
|
1181
1243
|
}
|
|
1182
1244
|
const aDedI = aTooth - 2 * aSlopeI - aAddI;
|
|
1183
1245
|
const aDedE = aTooth - 2 * aSlopeE - aAddE;
|
|
1184
1246
|
const aSlack = (param.ate - param.ati) * aTooth / 100;
|
|
1247
|
+
const RbEmax = Re - RTe - param.Ee;
|
|
1185
1248
|
if (RminI < 0.1) {
|
|
1186
1249
|
throw `err087: RminI ${RminI} is too small because of Di ${param.Di}, DTi ${param.DTi} or Ei ${param.Ei}`;
|
|
1187
1250
|
}
|
|
1188
1251
|
if (adTi < 2 * aMindTi) {
|
|
1189
|
-
throw `err131: adTi ${
|
|
1252
|
+
throw `err131: adTi ${ffix5(radToDeg5(adTi))} is too small compare to aMindTi ${ffix5(radToDeg5(aMindTi))} degree`;
|
|
1190
1253
|
}
|
|
1191
1254
|
if (adTe < 2 * aMindTe) {
|
|
1192
|
-
throw `err134: adTe ${
|
|
1255
|
+
throw `err134: adTe ${ffix5(radToDeg5(adTe))} is too small compare to aMindTe ${ffix5(radToDeg5(aMindTe))} degree`;
|
|
1193
1256
|
}
|
|
1194
1257
|
if (param.ati > param.ate) {
|
|
1195
1258
|
throw `err145: ate ${param.ate} is too small compare to ati ${param.ati} %`;
|
|
@@ -1197,27 +1260,27 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1197
1260
|
if (RbI < Ri + RTi + param.Ei) {
|
|
1198
1261
|
throw `err087: RbI ${RbI} is too small compare to Di ${param.Di}, DTi ${param.DTi} or Ei ${param.Ei}`;
|
|
1199
1262
|
}
|
|
1200
|
-
if (RbE >
|
|
1263
|
+
if (RbE > RbEmax) {
|
|
1201
1264
|
throw `err087: RbE ${RbE} is too large compare to De ${param.De}, DTe ${param.DTe} or Ee ${param.Ee}`;
|
|
1202
1265
|
}
|
|
1203
1266
|
const tooSmallAngle = 1e-4;
|
|
1204
1267
|
if (aAddI < tooSmallAngle || aDedI < tooSmallAngle) {
|
|
1205
|
-
throw `err161: aAddI ${
|
|
1268
|
+
throw `err161: aAddI ${ffix5(radToDeg5(aAddI))} or aDedI ${ffix5(radToDeg5(aDedI))} are too small`;
|
|
1206
1269
|
}
|
|
1207
1270
|
if (aAddE < tooSmallAngle || aDedE < tooSmallAngle) {
|
|
1208
|
-
throw `err164: aAddE ${
|
|
1271
|
+
throw `err164: aAddE ${ffix5(radToDeg5(aAddE))} or aDedE ${ffix5(radToDeg5(aDedE))} are too small`;
|
|
1209
1272
|
}
|
|
1210
|
-
rGeome.logstr += `Extern: Dmax ${
|
|
1273
|
+
rGeome.logstr += `Extern: Dmax ${ffix5(2 * RmaxE)}, Dmin ${ffix5(2 * RminE)} mm
|
|
1211
1274
|
`;
|
|
1212
|
-
rGeome.logstr += `Intern: Dmax ${
|
|
1275
|
+
rGeome.logstr += `Intern: Dmax ${ffix5(2 * RmaxI)}, Dmin ${ffix5(2 * RminI)} mm
|
|
1213
1276
|
`;
|
|
1214
|
-
rGeome.logstr += `aSlack: ${
|
|
1277
|
+
rGeome.logstr += `aSlack: ${ffix5(radToDeg5(aSlack))} degree
|
|
1215
1278
|
`;
|
|
1216
|
-
rGeome.logstr += `Tooth: Ht ${param.Ht}, moduli ${
|
|
1279
|
+
rGeome.logstr += `Tooth: Ht ${param.Ht}, moduli ${ffix5(moduli)}, Hti ${ffix5(Htai + Htdi)}, Hte ${ffix5(Htae + Htde)} mm
|
|
1217
1280
|
`;
|
|
1218
|
-
rGeome.logstr += `Tooth angle intern: aM ${param.aM}, aM[adden] ${
|
|
1281
|
+
rGeome.logstr += `Tooth angle intern: aM ${param.aM}, aM[adden] ${ffix5(radToDeg5(-aAddenI / 2))}, aM[deden] ${ffix5(radToDeg5((aTooth - aAddenI) / 2))} degree
|
|
1219
1282
|
`;
|
|
1220
|
-
rGeome.logstr += `Tooth angle extern: aM ${param.aM}, aM[adden] ${
|
|
1283
|
+
rGeome.logstr += `Tooth angle extern: aM ${param.aM}, aM[adden] ${ffix5(radToDeg5(-aAddenE / 2))}, aM[deden] ${ffix5(radToDeg5((aTooth - aAddenE) / 2))} degree
|
|
1221
1284
|
`;
|
|
1222
1285
|
const ctrsI = [];
|
|
1223
1286
|
ctrsI.push(contourCircle3(0, 0, RminI));
|
|
@@ -1225,7 +1288,7 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1225
1288
|
const p1 = point3(0, 0).translatePolar(ii * adTi, Ri);
|
|
1226
1289
|
ctrsI.push(contourCircle3(p1.cx, p1.cy, RTi));
|
|
1227
1290
|
}
|
|
1228
|
-
const ctrToothI =
|
|
1291
|
+
const ctrToothI = contour5(RbI, 0);
|
|
1229
1292
|
for (let ii = 0; ii < param.Nt; ii++) {
|
|
1230
1293
|
const aRef = ii * aTooth;
|
|
1231
1294
|
ctrToothI.addSegStrokeAP(aRef + aSlopeI, RmaxI).addCornerRounded(param.Rai);
|
|
@@ -1249,24 +1312,8 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1249
1312
|
const p1 = point3(0, 0).translatePolar(ii * adTe, Re);
|
|
1250
1313
|
ctrsE.push(contourCircle3(p1.cx, p1.cy, RTe));
|
|
1251
1314
|
}
|
|
1252
|
-
const ctrToothE =
|
|
1253
|
-
|
|
1254
|
-
const aRef = ii * aTooth;
|
|
1255
|
-
ctrToothE.addSegStrokeAP(aRef + aSlopeE, RbE).addCornerRounded(param.Rae);
|
|
1256
|
-
if (param.SnAae === 1) {
|
|
1257
|
-
ctrToothE.addPointAP(aRef + aSlopeE + aAddE / 2, RbE).addPointAP(aRef + aSlopeE + aAddE, RbE).addSegArc2();
|
|
1258
|
-
} else {
|
|
1259
|
-
ctrToothE.addSegStrokeAP(aRef + aSlopeE + aAddE, RbE);
|
|
1260
|
-
}
|
|
1261
|
-
ctrToothE.addCornerRounded(param.Rae);
|
|
1262
|
-
ctrToothE.addSegStrokeAP(aRef + 2 * aSlopeE + aAddE, RminE).addCornerRounded(param.Rde);
|
|
1263
|
-
if (param.SnAde === 1) {
|
|
1264
|
-
ctrToothE.addPointAP(aRef + aTooth - aDedE / 2, RminE).addPointAP(aRef + aTooth, RminE).addSegArc2();
|
|
1265
|
-
} else {
|
|
1266
|
-
ctrToothE.addSegStrokeAP(aRef + aTooth, RminE);
|
|
1267
|
-
}
|
|
1268
|
-
ctrToothE.addCornerRounded(param.Rde);
|
|
1269
|
-
}
|
|
1315
|
+
const [ctrToothE, logE] = ctrPlugExtern(param, RbEmax);
|
|
1316
|
+
rGeome.logstr += logE;
|
|
1270
1317
|
figIntern.addMainOI([ctrToothI, ...ctrsI]);
|
|
1271
1318
|
figIntern.addSecond(contourCircle3(0, 0, Rt));
|
|
1272
1319
|
figIntern.addSecond(ctrToothE);
|
|
@@ -1341,10 +1388,779 @@ var plugTorqueDef = {
|
|
|
1341
1388
|
pDef: pDef4,
|
|
1342
1389
|
pGeom: pGeom4
|
|
1343
1390
|
};
|
|
1391
|
+
|
|
1392
|
+
// src/spring/springTorqueB.ts
|
|
1393
|
+
import {
|
|
1394
|
+
withinZeroPi,
|
|
1395
|
+
point as point4,
|
|
1396
|
+
contour as contour6,
|
|
1397
|
+
contourCircle as contourCircle4,
|
|
1398
|
+
figure as figure5,
|
|
1399
|
+
radToDeg as radToDeg6,
|
|
1400
|
+
ffix as ffix6,
|
|
1401
|
+
pNumber as pNumber5,
|
|
1402
|
+
pCheckbox as pCheckbox3,
|
|
1403
|
+
pDropdown as pDropdown3,
|
|
1404
|
+
pSectionSeparator as pSectionSeparator5,
|
|
1405
|
+
EExtrude as EExtrude5,
|
|
1406
|
+
EBVolume as EBVolume5,
|
|
1407
|
+
initGeom as initGeom5
|
|
1408
|
+
} from "geometrix";
|
|
1409
|
+
var pDef5 = {
|
|
1410
|
+
partName: "springTorqueB",
|
|
1411
|
+
params: [
|
|
1412
|
+
//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),
|
|
1417
|
+
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"),
|
|
1444
|
+
pDropdown3("SnAae", ["stroke", "arc"]),
|
|
1445
|
+
pDropdown3("SnAde", ["stroke", "arc"]),
|
|
1446
|
+
pNumber5("Rae", "mm", 1, 0, 50, 0.1),
|
|
1447
|
+
pNumber5("Rde", "mm", 1, 0, 50, 0.1)
|
|
1448
|
+
],
|
|
1449
|
+
paramSvg: {
|
|
1450
|
+
De: "springTorqueB_profile.svg",
|
|
1451
|
+
Ne: "springTorqueB_profile.svg",
|
|
1452
|
+
DTe: "springTorqueB_profile.svg",
|
|
1453
|
+
Ee: "springTorqueB_profile.svg",
|
|
1454
|
+
Teeth: "springTorqueB_profile.svg",
|
|
1455
|
+
Th: "springTorqueB_profile.svg",
|
|
1456
|
+
Di: "springTorqueB_profile.svg",
|
|
1457
|
+
Ni: "springTorqueB_profile.svg",
|
|
1458
|
+
DTi: "springTorqueB_profile.svg",
|
|
1459
|
+
Ei: "springTorqueB_profile.svg",
|
|
1460
|
+
Ns: "springTorqueB_profile.svg",
|
|
1461
|
+
aEs: "springTorqueB_profile.svg",
|
|
1462
|
+
Esi: "springTorqueB_profile.svg",
|
|
1463
|
+
Ese: "springTorqueB_profile.svg",
|
|
1464
|
+
Nk: "springTorqueB_profile.svg",
|
|
1465
|
+
Wk: "springTorqueB_profile.svg",
|
|
1466
|
+
Wc: "springTorqueB_profile.svg",
|
|
1467
|
+
Rrsi: "springTorqueB_profile.svg",
|
|
1468
|
+
Rrse: "springTorqueB_profile.svg",
|
|
1469
|
+
Nt: "plugTorque_teeth_radial.svg",
|
|
1470
|
+
Dt: "plugTorque_teeth_radial.svg",
|
|
1471
|
+
Ht: "plugTorque_teeth_radial.svg",
|
|
1472
|
+
ate: "plugTorque_teeth_radial.svg",
|
|
1473
|
+
dh: "plugTorque_teeth_radial.svg",
|
|
1474
|
+
ah: "plugTorque_teeth_radial.svg",
|
|
1475
|
+
aeh: "plugTorque_teeth_radial.svg",
|
|
1476
|
+
aM: "plugTorque_teeth_adden.svg",
|
|
1477
|
+
SnAae: "plugTorque_teeth_radial.svg",
|
|
1478
|
+
SnAde: "plugTorque_teeth_radial.svg",
|
|
1479
|
+
Rae: "plugTorque_teeth_radial.svg",
|
|
1480
|
+
Rde: "plugTorque_teeth_radial.svg"
|
|
1481
|
+
},
|
|
1482
|
+
sim: {
|
|
1483
|
+
tMax: 180,
|
|
1484
|
+
tStep: 0.5,
|
|
1485
|
+
tUpdate: 500
|
|
1486
|
+
// every 0.5 second
|
|
1487
|
+
}
|
|
1488
|
+
};
|
|
1489
|
+
function calcAzig(cx1, cx2, r1, r2) {
|
|
1490
|
+
let ra12 = Math.PI / 2;
|
|
1491
|
+
let ra21 = -Math.PI / 2;
|
|
1492
|
+
if (cx2 > cx1) {
|
|
1493
|
+
const triOpp = cx2 - cx1;
|
|
1494
|
+
const triAdj = r1 + r2;
|
|
1495
|
+
const lDiag = Math.sqrt(triAdj ** 2 + triOpp ** 2);
|
|
1496
|
+
const aDiag = Math.atan2(triOpp, triAdj);
|
|
1497
|
+
const lDiag1 = lDiag * r1 / triAdj;
|
|
1498
|
+
const aTri1 = Math.acos(r1 / lDiag1);
|
|
1499
|
+
ra12 = Math.PI / 2 - aDiag - aTri1;
|
|
1500
|
+
ra21 = -Math.PI / 2 - aDiag - aTri1;
|
|
1501
|
+
}
|
|
1502
|
+
return [ra12, ra21];
|
|
1503
|
+
}
|
|
1504
|
+
function calcAzag(cx2, cx1, r2, r1) {
|
|
1505
|
+
let ra22 = Math.PI / 2;
|
|
1506
|
+
let ra11 = -Math.PI / 2;
|
|
1507
|
+
if (cx2 > cx1) {
|
|
1508
|
+
const triOpp = cx2 - cx1;
|
|
1509
|
+
const triAdj = r1 + r2;
|
|
1510
|
+
const lDiag = Math.sqrt(triAdj ** 2 + triOpp ** 2);
|
|
1511
|
+
const aDiag = Math.atan2(triOpp, triAdj);
|
|
1512
|
+
const lDiag2 = lDiag * r2 / triAdj;
|
|
1513
|
+
const aTri2 = Math.acos(r2 / lDiag2);
|
|
1514
|
+
ra22 = Math.PI / 2 + aDiag + aTri2;
|
|
1515
|
+
ra11 = -Math.PI / 2 + aDiag + aTri2;
|
|
1516
|
+
}
|
|
1517
|
+
return [ra22, ra11];
|
|
1518
|
+
}
|
|
1519
|
+
function pGeom5(t, param, suffix = "") {
|
|
1520
|
+
const rGeome = initGeom5(pDef5.partName + suffix);
|
|
1521
|
+
const figProfile = figure5();
|
|
1522
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
1523
|
+
`;
|
|
1524
|
+
try {
|
|
1525
|
+
const Re = param.De / 2;
|
|
1526
|
+
const RTe = param.DTe / 2;
|
|
1527
|
+
const Ri = param.Di / 2;
|
|
1528
|
+
const RTi = param.DTi / 2;
|
|
1529
|
+
const Rmax = Re + RTe + param.Ee;
|
|
1530
|
+
const Rmin1 = Ri - RTi - param.Ei;
|
|
1531
|
+
const Rse = Re - RTe - param.Ee;
|
|
1532
|
+
const Rsi = Ri + RTi + param.Ei;
|
|
1533
|
+
const dRs = Rse - Rsi;
|
|
1534
|
+
const Esi = dRs * param.Esi / 100;
|
|
1535
|
+
const Ese = dRs * param.Ese / 100;
|
|
1536
|
+
const dRLs = dRs - Esi - Ese;
|
|
1537
|
+
const aSpringStep = 2 * Math.PI / param.Ns;
|
|
1538
|
+
const aEs = aSpringStep * param.aEs / 100;
|
|
1539
|
+
const aSpring = aSpringStep - aEs;
|
|
1540
|
+
const HLs = (Rse - Ese) * Math.sin(aSpring);
|
|
1541
|
+
const iHLs = HLs / (2 * param.Nk);
|
|
1542
|
+
const Rk = iHLs / 2;
|
|
1543
|
+
const Ek = iHLs - param.Wk;
|
|
1544
|
+
if (Rmin1 < 0.1) {
|
|
1545
|
+
throw `err120: Di ${param.Di} is too small compare to DTi ${param.DTi}, Ei ${param.Ei}`;
|
|
1546
|
+
}
|
|
1547
|
+
if (dRLs < 2 * param.Ws) {
|
|
1548
|
+
throw `err133: dRLs ${dRLs} is too small compare to Ws ${param.Ws}`;
|
|
1549
|
+
}
|
|
1550
|
+
if (Esi < 0.6 * param.Ws) {
|
|
1551
|
+
throw `err136: Esi ${Esi} is too small compare to Ws ${param.Ws}`;
|
|
1552
|
+
}
|
|
1553
|
+
if (Ese < 0.6 * param.Ws) {
|
|
1554
|
+
throw `err139: Ese ${Ese} is too small compare to Ws ${param.Ws}`;
|
|
1555
|
+
}
|
|
1556
|
+
if (Ek < 0.1) {
|
|
1557
|
+
throw `err145: Ek ${Ek} is too small`;
|
|
1558
|
+
}
|
|
1559
|
+
if (dRLs < 2 * Rk) {
|
|
1560
|
+
throw `err148: dRLs ${dRLs} is too small compare to Rk ${Rk}. Increase Nk ${param.Nk}`;
|
|
1561
|
+
}
|
|
1562
|
+
const aHMinI = 2 * Math.asin((RTi + 0.5 * param.Ei) / Ri);
|
|
1563
|
+
const aHI = param.Ni > 0 ? 2 * Math.PI / param.Ni : 3.14;
|
|
1564
|
+
if (aHI < aHMinI) {
|
|
1565
|
+
throw `err126: aHI ${ffix6(radToDeg6(aHI))} is too small compare to aHMinI ${ffix6(radToDeg6(aHMinI))} degree`;
|
|
1566
|
+
}
|
|
1567
|
+
const aHMinE = 2 * Math.asin((RTe + 0.5 * param.Ee) / Re);
|
|
1568
|
+
const aHE = param.Ne > 0 ? 2 * Math.PI / param.Ne : 3.14;
|
|
1569
|
+
if (aHE < aHMinE) {
|
|
1570
|
+
throw `err131: aHE ${ffix6(radToDeg6(aHE))} is too small compare to aHMinE ${ffix6(radToDeg6(aHMinE))} degree`;
|
|
1571
|
+
}
|
|
1572
|
+
const pts1 = [];
|
|
1573
|
+
const Rk1 = Rsi + Esi + dRLs - Rk;
|
|
1574
|
+
for (let ii = 0; ii < param.Nk; ii++) {
|
|
1575
|
+
const ky = (ii * 4 + 1) * Rk;
|
|
1576
|
+
const kx = Math.sqrt(Rk1 ** 2 - ky ** 2);
|
|
1577
|
+
pts1.push(point4(kx, ky));
|
|
1578
|
+
}
|
|
1579
|
+
const pts2 = [];
|
|
1580
|
+
const Rk2 = Rsi + Esi + Rk;
|
|
1581
|
+
const ak2 = aSpring < Math.PI / 2 - 1e-4 ? 1 / Math.tan(aSpring) : 0;
|
|
1582
|
+
const kak2 = Rk / Math.sin(aSpring);
|
|
1583
|
+
for (let ii = 0; ii < param.Nk; ii++) {
|
|
1584
|
+
const ky = (ii * 4 + 3) * Rk;
|
|
1585
|
+
let kx = ak2 * ky + kak2;
|
|
1586
|
+
if (kx ** 2 + ky ** 2 < Rk2 ** 2) {
|
|
1587
|
+
kx = Math.sqrt(Rk2 ** 2 - ky ** 2);
|
|
1588
|
+
}
|
|
1589
|
+
pts2.push(point4(kx, ky));
|
|
1590
|
+
}
|
|
1591
|
+
const Wk2 = param.Wk / 2;
|
|
1592
|
+
const a14 = Math.asin(Wk2 / Rsi);
|
|
1593
|
+
const a23 = Math.asin(Wk2 / Rse);
|
|
1594
|
+
const pt1 = point4(0, 0).translatePolar(a14, Rsi);
|
|
1595
|
+
const pt2 = point4(0, 0).translatePolar(aSpring + a23, Rse);
|
|
1596
|
+
const pt3 = point4(0, 0).translatePolar(aSpring - a23, Rse);
|
|
1597
|
+
const pt4 = point4(0, 0).translatePolar(-a14, Rsi);
|
|
1598
|
+
const Rks = Rk - Wk2;
|
|
1599
|
+
const Rkl = Rk + Wk2;
|
|
1600
|
+
rGeome.logstr += `Dmax ${ffix6(2 * Rmax)}, Dmin1 ${ffix6(2 * Rmin1)} mm
|
|
1601
|
+
`;
|
|
1602
|
+
rGeome.logstr += `Spring area: aSpring ${ffix6(radToDeg6(aSpring))} degree, dRLs ${ffix6(dRLs)}, HLs ${ffix6(HLs)} mm
|
|
1603
|
+
`;
|
|
1604
|
+
rGeome.logstr += `Spring zigzag: Ek ${ffix6(Ek)}, Rk ${ffix6(Rk)} mm
|
|
1605
|
+
`;
|
|
1606
|
+
const ctrExt = contourCircle4(0, 0, Rmax);
|
|
1607
|
+
const ctrsH = [];
|
|
1608
|
+
if (param.Teeth === 1) {
|
|
1609
|
+
const [ctrToothE, logE] = ctrPlugExtern(param, Rmin1);
|
|
1610
|
+
rGeome.logstr += logE;
|
|
1611
|
+
ctrsH.push(ctrToothE);
|
|
1612
|
+
} else {
|
|
1613
|
+
ctrsH.push(contourCircle4(0, 0, Rmin1));
|
|
1614
|
+
}
|
|
1615
|
+
for (let ii = 0; ii < param.Ni; ii++) {
|
|
1616
|
+
const p1 = point4(0, 0).translatePolar(ii * aHI, Ri);
|
|
1617
|
+
ctrsH.push(contourCircle4(p1.cx, p1.cy, RTi));
|
|
1618
|
+
}
|
|
1619
|
+
for (let ii = 0; ii < param.Ne; ii++) {
|
|
1620
|
+
const p1 = point4(0, 0).translatePolar(ii * aHE, Re);
|
|
1621
|
+
ctrsH.push(contourCircle4(p1.cx, p1.cy, RTe));
|
|
1622
|
+
}
|
|
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();
|
|
1624
|
+
figProfile.addSecond(ctrSpringEnv);
|
|
1625
|
+
figProfile.addSecond(ctrSpringEnv.rotate(0, 0, aSpringStep));
|
|
1626
|
+
figProfile.addSecond(ctrSpringEnv.rotate(0, 0, -aSpringStep));
|
|
1627
|
+
for (let ii = 0; ii < param.Nk; ii++) {
|
|
1628
|
+
figProfile.addSecond(contourCircle4(pts1[ii].cx, pts1[ii].cy, Rk));
|
|
1629
|
+
figProfile.addSecond(contourCircle4(pts2[ii].cx, pts2[ii].cy, Rk));
|
|
1630
|
+
}
|
|
1631
|
+
const ctrPartial1 = contour6(pt1.cx, pt1.cy);
|
|
1632
|
+
for (let ii = 0; ii < param.Nk; ii++) {
|
|
1633
|
+
let a11 = -Math.PI / 2;
|
|
1634
|
+
const [a12, a21] = calcAzig(pts1[ii].cx, pts2[ii].cx, Rks, Rkl);
|
|
1635
|
+
let a22 = Math.PI / 2;
|
|
1636
|
+
if (ii > 0) {
|
|
1637
|
+
const [, tmpa11] = calcAzag(pts2[ii - 1].cx, pts1[ii].cx, Rkl, Rks);
|
|
1638
|
+
a11 = tmpa11;
|
|
1639
|
+
}
|
|
1640
|
+
if (ii < param.Nk - 1) {
|
|
1641
|
+
const [tmpa22] = calcAzag(pts2[ii].cx, pts1[ii + 1].cx, Rkl, Rks);
|
|
1642
|
+
a22 = tmpa22;
|
|
1643
|
+
}
|
|
1644
|
+
const p11 = pts1[ii].translatePolar(a11, Rks);
|
|
1645
|
+
const p1b = pts1[ii].translatePolar(a11 + withinZeroPi((a12 - a11) / 2), Rks);
|
|
1646
|
+
const p12 = pts1[ii].translatePolar(a12, Rks);
|
|
1647
|
+
const p21 = pts2[ii].translatePolar(a21, Rkl);
|
|
1648
|
+
const p2b = pts2[ii].translatePolar(a21 - withinZeroPi((a21 - a22) / 2), Rkl);
|
|
1649
|
+
const p22 = pts2[ii].translatePolar(a22, Rkl);
|
|
1650
|
+
ctrPartial1.addSegStrokeA(p11.cx, p11.cy).addPointA(p1b.cx, p1b.cy).addPointA(p12.cx, p12.cy).addSegArc2().addSegStrokeA(p21.cx, p21.cy);
|
|
1651
|
+
if (ii < param.Nk - 1) {
|
|
1652
|
+
ctrPartial1.addPointA(p2b.cx, p2b.cy).addPointA(p22.cx, p22.cy).addSegArc2();
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
const [, lasta21] = calcAzig(pts1[param.Nk - 1].cx, pts2[param.Nk - 1].cx, Rks, Rkl);
|
|
1656
|
+
const a2c = Math.PI / 2 + aSpring;
|
|
1657
|
+
const a2b = lasta21 - withinZeroPi((lasta21 - a2c) / 2);
|
|
1658
|
+
const pt2b = pts2[param.Nk - 1].translatePolar(a2b, Rkl);
|
|
1659
|
+
const pt2c = pts2[param.Nk - 1].translatePolar(a2c, Rkl);
|
|
1660
|
+
const pt3b = pts2[param.Nk - 1].translatePolar(a2b, Rks);
|
|
1661
|
+
const pt3c = pts2[param.Nk - 1].translatePolar(a2c, Rks);
|
|
1662
|
+
ctrPartial1.addPointA(pt2b.cx, pt2b.cy).addPointA(pt2c.cx, pt2c.cy).addSegArc2().addSegStrokeA(pt2.cx, pt2.cy);
|
|
1663
|
+
const [, firsta22] = calcAzig(pts1[param.Nk - 1].cx, pts2[param.Nk - 1].cx, Rkl, Rks);
|
|
1664
|
+
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();
|
|
1666
|
+
for (let ii = param.Nk - 1; ii >= 0; ii--) {
|
|
1667
|
+
let a21 = Math.PI / 2;
|
|
1668
|
+
let a12 = -Math.PI / 2;
|
|
1669
|
+
const [a11, a22] = calcAzig(pts1[ii].cx, pts2[ii].cx, Rkl, Rks);
|
|
1670
|
+
if (ii > 0) {
|
|
1671
|
+
const [, tmpa12] = calcAzag(pts2[ii - 1].cx, pts1[ii].cx, Rks, Rkl);
|
|
1672
|
+
a12 = tmpa12;
|
|
1673
|
+
}
|
|
1674
|
+
if (ii < param.Nk - 1) {
|
|
1675
|
+
const [tmpa21] = calcAzag(pts2[ii].cx, pts1[ii + 1].cx, Rks, Rkl);
|
|
1676
|
+
a21 = tmpa21;
|
|
1677
|
+
}
|
|
1678
|
+
const p11 = pts1[ii].translatePolar(a11, Rkl);
|
|
1679
|
+
const p1b = pts1[ii].translatePolar(a11 - withinZeroPi((a11 - a12) / 2), Rkl);
|
|
1680
|
+
const p12 = pts1[ii].translatePolar(a12, Rkl);
|
|
1681
|
+
const p21 = pts2[ii].translatePolar(a21, Rks);
|
|
1682
|
+
const p2b = pts2[ii].translatePolar(a21 + withinZeroPi((a22 - a21) / 2), Rks);
|
|
1683
|
+
const p22 = pts2[ii].translatePolar(a22, Rks);
|
|
1684
|
+
if (ii < param.Nk - 1) {
|
|
1685
|
+
ctrPartial2.addSegStrokeA(p21.cx, p21.cy).addPointA(p2b.cx, p2b.cy).addPointA(p22.cx, p22.cy).addSegArc2();
|
|
1686
|
+
}
|
|
1687
|
+
ctrPartial2.addSegStrokeA(p11.cx, p11.cy).addPointA(p1b.cx, p1b.cy).addPointA(p12.cx, p12.cy).addSegArc2();
|
|
1688
|
+
}
|
|
1689
|
+
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();
|
|
1691
|
+
for (let ii = 0; ii < param.Ns; ii++) {
|
|
1692
|
+
ctrsH.push(ctrSpringHollow.rotate(0, 0, ii * aSpringStep));
|
|
1693
|
+
}
|
|
1694
|
+
figProfile.addMainOI([ctrExt, ...ctrsH]);
|
|
1695
|
+
rGeome.fig = {
|
|
1696
|
+
faceProfile: figProfile
|
|
1697
|
+
};
|
|
1698
|
+
const designName = rGeome.partName;
|
|
1699
|
+
rGeome.vol = {
|
|
1700
|
+
extrudes: [
|
|
1701
|
+
{
|
|
1702
|
+
outName: `subpax_${designName}_profile`,
|
|
1703
|
+
face: `${designName}_faceProfile`,
|
|
1704
|
+
extrudeMethod: EExtrude5.eLinearOrtho,
|
|
1705
|
+
length: param.Th,
|
|
1706
|
+
rotate: [0, 0, 0],
|
|
1707
|
+
translate: [0, 0, 0]
|
|
1708
|
+
}
|
|
1709
|
+
],
|
|
1710
|
+
volumes: [
|
|
1711
|
+
{
|
|
1712
|
+
outName: `pax_${designName}`,
|
|
1713
|
+
boolMethod: EBVolume5.eIdentity,
|
|
1714
|
+
inList: [`subpax_${designName}_profile`]
|
|
1715
|
+
}
|
|
1716
|
+
]
|
|
1717
|
+
};
|
|
1718
|
+
rGeome.sub = {};
|
|
1719
|
+
rGeome.logstr += "springTorqueB drawn successfully!\n";
|
|
1720
|
+
rGeome.calcErr = false;
|
|
1721
|
+
} catch (emsg) {
|
|
1722
|
+
rGeome.logstr += emsg;
|
|
1723
|
+
console.log(emsg);
|
|
1724
|
+
}
|
|
1725
|
+
return rGeome;
|
|
1726
|
+
}
|
|
1727
|
+
var springTorqueBDef = {
|
|
1728
|
+
pTitle: "springTorqueB",
|
|
1729
|
+
pDescription: "spring disc for smooth torque transmission",
|
|
1730
|
+
pDef: pDef5,
|
|
1731
|
+
pGeom: pGeom5
|
|
1732
|
+
};
|
|
1733
|
+
|
|
1734
|
+
// src/spring/springTorqueC.ts
|
|
1735
|
+
import {
|
|
1736
|
+
point as point5,
|
|
1737
|
+
contour as contour7,
|
|
1738
|
+
contourCircle as contourCircle5,
|
|
1739
|
+
figure as figure6,
|
|
1740
|
+
radToDeg as radToDeg7,
|
|
1741
|
+
ffix as ffix7,
|
|
1742
|
+
pNumber as pNumber6,
|
|
1743
|
+
pCheckbox as pCheckbox4,
|
|
1744
|
+
pDropdown as pDropdown4,
|
|
1745
|
+
pSectionSeparator as pSectionSeparator6,
|
|
1746
|
+
EExtrude as EExtrude6,
|
|
1747
|
+
EBVolume as EBVolume6,
|
|
1748
|
+
initGeom as initGeom6
|
|
1749
|
+
} from "geometrix";
|
|
1750
|
+
var pDef6 = {
|
|
1751
|
+
partName: "springTorqueC",
|
|
1752
|
+
params: [
|
|
1753
|
+
//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),
|
|
1758
|
+
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),
|
|
1767
|
+
pDropdown4("zig", ["alt", "one", "two"]),
|
|
1768
|
+
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"),
|
|
1786
|
+
pDropdown4("SnAae", ["stroke", "arc"]),
|
|
1787
|
+
pDropdown4("SnAde", ["stroke", "arc"]),
|
|
1788
|
+
pNumber6("Rae", "mm", 1, 0, 50, 0.1),
|
|
1789
|
+
pNumber6("Rde", "mm", 1, 0, 50, 0.1)
|
|
1790
|
+
],
|
|
1791
|
+
paramSvg: {
|
|
1792
|
+
De: "springTorqueC_profile.svg",
|
|
1793
|
+
Ne: "springTorqueC_profile.svg",
|
|
1794
|
+
DTe: "springTorqueC_profile.svg",
|
|
1795
|
+
Ee: "springTorqueC_profile.svg",
|
|
1796
|
+
Teeth: "springTorqueC_profile.svg",
|
|
1797
|
+
Th: "springTorqueC_profile.svg",
|
|
1798
|
+
Di: "springTorqueC_profile.svg",
|
|
1799
|
+
Ni: "springTorqueC_profile.svg",
|
|
1800
|
+
DTi: "springTorqueC_profile.svg",
|
|
1801
|
+
Ei: "springTorqueC_profile.svg",
|
|
1802
|
+
Ns: "springTorqueC_profile.svg",
|
|
1803
|
+
zig: "springTorqueC_profile.svg",
|
|
1804
|
+
zag: "springTorqueC_profile.svg",
|
|
1805
|
+
aEs: "springTorqueC_profile.svg",
|
|
1806
|
+
Esi: "springTorqueC_profile.svg",
|
|
1807
|
+
Ese: "springTorqueC_profile.svg",
|
|
1808
|
+
Nk: "springTorqueC_profile.svg",
|
|
1809
|
+
Wk: "springTorqueC_profile.svg",
|
|
1810
|
+
Rrsi: "springTorqueC_profile.svg",
|
|
1811
|
+
Rrse: "springTorqueC_profile.svg",
|
|
1812
|
+
Nt: "plugTorque_teeth_radial.svg",
|
|
1813
|
+
Dt: "plugTorque_teeth_radial.svg",
|
|
1814
|
+
Ht: "plugTorque_teeth_radial.svg",
|
|
1815
|
+
ate: "plugTorque_teeth_radial.svg",
|
|
1816
|
+
dh: "plugTorque_teeth_radial.svg",
|
|
1817
|
+
ah: "plugTorque_teeth_radial.svg",
|
|
1818
|
+
aeh: "plugTorque_teeth_radial.svg",
|
|
1819
|
+
aM: "plugTorque_teeth_adden.svg",
|
|
1820
|
+
SnAae: "plugTorque_teeth_radial.svg",
|
|
1821
|
+
SnAde: "plugTorque_teeth_radial.svg",
|
|
1822
|
+
Rae: "plugTorque_teeth_radial.svg",
|
|
1823
|
+
Rde: "plugTorque_teeth_radial.svg"
|
|
1824
|
+
},
|
|
1825
|
+
sim: {
|
|
1826
|
+
tMax: 180,
|
|
1827
|
+
tStep: 0.5,
|
|
1828
|
+
tUpdate: 500
|
|
1829
|
+
// every 0.5 second
|
|
1830
|
+
}
|
|
1831
|
+
};
|
|
1832
|
+
function calcZagP2(pA, pE, lAB, lDE, iSign) {
|
|
1833
|
+
const xAE = pE.cx - pA.cx;
|
|
1834
|
+
const yAE = pE.cy - pA.cy;
|
|
1835
|
+
const lAE = Math.sqrt(xAE ** 2 + yAE ** 2);
|
|
1836
|
+
const aAE = Math.atan2(yAE, xAE);
|
|
1837
|
+
const lAC = lAB * lAE / (lAB + lDE);
|
|
1838
|
+
const aCAB = Math.acos(lAB / lAC);
|
|
1839
|
+
const rPt = pA.translatePolar(aAE + iSign * aCAB, lAB);
|
|
1840
|
+
return rPt;
|
|
1841
|
+
}
|
|
1842
|
+
function pGeom6(t, param, suffix = "") {
|
|
1843
|
+
const rGeome = initGeom6(pDef6.partName + suffix);
|
|
1844
|
+
const figProfile = figure6();
|
|
1845
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
1846
|
+
`;
|
|
1847
|
+
try {
|
|
1848
|
+
let prePoints2 = function(ll) {
|
|
1849
|
+
const ka = Math.asin(Rk / ll);
|
|
1850
|
+
const kx = ll * Math.cos(ka);
|
|
1851
|
+
const ra = Math.atan2(Wk2, kx);
|
|
1852
|
+
const rl = Math.sqrt(kx ** 2 + Wk2 ** 2);
|
|
1853
|
+
return [ra, rl];
|
|
1854
|
+
}, pppI2 = function(a1, iParity, l2) {
|
|
1855
|
+
const a2 = iParity === 0 ? a1 : aSpring + a1;
|
|
1856
|
+
return point5(0, 0).translatePolar(a2, l2);
|
|
1857
|
+
}, externParity2 = function(iParity) {
|
|
1858
|
+
const eeParity = (extParity + iParity + 1) % 2;
|
|
1859
|
+
return eeParity;
|
|
1860
|
+
}, pppE2 = function(a1, iParity, l2) {
|
|
1861
|
+
const a2 = externParity2(iParity) === 0 ? a1 : aSpring + a1;
|
|
1862
|
+
return point5(0, 0).translatePolar(a2, l2);
|
|
1863
|
+
}, iiParity2 = function(ii) {
|
|
1864
|
+
let ip0 = ii % 2;
|
|
1865
|
+
let ip1 = ii < param.Ns - 1 ? (ii + 1) % 2 : 0;
|
|
1866
|
+
if (param.zig === 1) {
|
|
1867
|
+
ip0 = 0;
|
|
1868
|
+
ip1 = 0;
|
|
1869
|
+
} else if (param.zig === 2) {
|
|
1870
|
+
ip0 = 1;
|
|
1871
|
+
ip1 = 1;
|
|
1872
|
+
}
|
|
1873
|
+
return [ip0, ip1];
|
|
1874
|
+
}, pppb2 = function(ip1, ip2) {
|
|
1875
|
+
const ai1 = ip1 === 0 ? 0 : aSpring;
|
|
1876
|
+
const ai2 = ip2 === 0 ? aSpringStep : aSpringStep + aSpring;
|
|
1877
|
+
const aib = ai1 + (ai2 - ai1) / 2;
|
|
1878
|
+
const ae1 = externParity2(ip1) === 0 ? 0 : aSpring;
|
|
1879
|
+
const ae2 = externParity2(ip2) === 0 ? aSpringStep : aSpringStep + aSpring;
|
|
1880
|
+
const aeb = ae1 + (ae2 - ae1) / 2;
|
|
1881
|
+
const rpib = point5(0, 0).translatePolar(aib, Rsi);
|
|
1882
|
+
const rpeb = point5(0, 0).translatePolar(aeb, Rse);
|
|
1883
|
+
return [rpib, rpeb];
|
|
1884
|
+
}, ctrPartial12 = function(iParity) {
|
|
1885
|
+
const pts = iParity === 0 ? pts0 : pts1;
|
|
1886
|
+
const aStart1 = iParity === 0 ? -Math.PI / 2 : Math.PI / 2 + aSpring;
|
|
1887
|
+
const siRk = iParity === 0 ? Rks : Rkl;
|
|
1888
|
+
const startPt1 = pts[0].translatePolar(aStart1, siRk);
|
|
1889
|
+
const rCtr = contour7(startPt1.cx, startPt1.cy);
|
|
1890
|
+
for (let ii = 0; ii < param.Nk; ii++) {
|
|
1891
|
+
const iiParity3 = (ii + iParity) % 2;
|
|
1892
|
+
const apt = Math.atan2(pts[ii].cy, pts[ii].cx);
|
|
1893
|
+
const aMid = iiParity3 === 0 ? apt - Math.PI / 2 : apt + Math.PI / 2;
|
|
1894
|
+
const aSign = iiParity3 === 0 ? 1 : -1;
|
|
1895
|
+
const iRk = iiParity3 === 0 ? Rks : Rkl;
|
|
1896
|
+
const iRk2 = iiParity3 === 0 ? Rkl : Rks;
|
|
1897
|
+
if (ii > 0) {
|
|
1898
|
+
if (zagArc) {
|
|
1899
|
+
const p1 = point5(0, 0).translatePolar(aSpring / 2, ptl[ii] - iRk);
|
|
1900
|
+
const p2 = pts[ii].translatePolar(aMid - aSign * Math.PI / 2, iRk);
|
|
1901
|
+
rCtr.addPointA(p1.cx, p1.cy).addPointA(p2.cx, p2.cy).addSegArc2();
|
|
1902
|
+
} else {
|
|
1903
|
+
const p2 = calcZagP2(pts[ii], pts[ii - 1], iRk, iRk2, aSign);
|
|
1904
|
+
rCtr.addSegStrokeA(p2.cx, p2.cy);
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
let da3 = aMid;
|
|
1908
|
+
let da4 = aMid + aSign * Math.PI / 2;
|
|
1909
|
+
if (ii === 0) {
|
|
1910
|
+
da3 = aMid + aSign * Math.PI / 4;
|
|
1911
|
+
} else if (ii === param.Nk - 1) {
|
|
1912
|
+
da3 = aMid - aSign * Math.PI / 4;
|
|
1913
|
+
da4 = iiParity3 === 0 ? -Math.PI / 2 : Math.PI / 2 + aSpring;
|
|
1914
|
+
}
|
|
1915
|
+
if (ii === param.Nk - 1) {
|
|
1916
|
+
const p4 = pts[ii].translatePolar(da4, iRk);
|
|
1917
|
+
rCtr.addPointA(p4.cx, p4.cy).addSegArc(iRk, false, iiParity3 === 0);
|
|
1918
|
+
} else if (zagArc) {
|
|
1919
|
+
const p3 = pts[ii].translatePolar(da3, iRk);
|
|
1920
|
+
const p4 = pts[ii].translatePolar(da4, iRk);
|
|
1921
|
+
rCtr.addPointA(p3.cx, p3.cy).addPointA(p4.cx, p4.cy).addSegArc2();
|
|
1922
|
+
} else {
|
|
1923
|
+
const p3 = pts[ii].translatePolar(da3, iRk);
|
|
1924
|
+
const p4 = calcZagP2(pts[ii], pts[ii + 1], iRk, iRk2, -aSign);
|
|
1925
|
+
if (ii > 0) {
|
|
1926
|
+
rCtr.addPointA(p3.cx, p3.cy).addPointA(p4.cx, p4.cy).addSegArc2();
|
|
1927
|
+
} else {
|
|
1928
|
+
rCtr.addPointA(p4.cx, p4.cy).addSegArc(iRk, false, iiParity3 === 0);
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
return rCtr;
|
|
1933
|
+
}, ctrPartial22 = function(iParity) {
|
|
1934
|
+
const pts = iParity === 0 ? pts0 : pts1;
|
|
1935
|
+
const eParity = externParity2(iParity);
|
|
1936
|
+
const aStart1 = eParity === 0 ? -Math.PI / 2 : Math.PI / 2 + aSpring;
|
|
1937
|
+
const siRk = eParity === 0 ? Rkl : Rks;
|
|
1938
|
+
const startPt1 = pts[param.Nk - 1].translatePolar(aStart1, siRk);
|
|
1939
|
+
const rCtr = contour7(startPt1.cx, startPt1.cy);
|
|
1940
|
+
for (let ii = param.Nk - 1; ii >= 0; ii--) {
|
|
1941
|
+
const iiParity3 = (ii + iParity) % 2;
|
|
1942
|
+
const apt = Math.atan2(pts[ii].cy, pts[ii].cx);
|
|
1943
|
+
const aMid = iiParity3 === 0 ? apt - Math.PI / 2 : apt + Math.PI / 2;
|
|
1944
|
+
const aSign = iiParity3 === 0 ? -1 : 1;
|
|
1945
|
+
const iRk = iiParity3 === 0 ? Rkl : Rks;
|
|
1946
|
+
const iRk2 = iiParity3 === 0 ? Rks : Rkl;
|
|
1947
|
+
if (ii < param.Nk - 1) {
|
|
1948
|
+
if (zagArc) {
|
|
1949
|
+
const p1 = point5(0, 0).translatePolar(aSpring / 2, ptl[ii] + iRk);
|
|
1950
|
+
const p2 = pts[ii].translatePolar(aMid - aSign * Math.PI / 2, iRk);
|
|
1951
|
+
rCtr.addPointA(p1.cx, p1.cy).addPointA(p2.cx, p2.cy).addSegArc2();
|
|
1952
|
+
} else {
|
|
1953
|
+
const p2 = calcZagP2(pts[ii], pts[ii + 1], iRk, iRk2, aSign);
|
|
1954
|
+
rCtr.addSegStrokeA(p2.cx, p2.cy);
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
let da3 = aMid;
|
|
1958
|
+
let da4 = aMid + aSign * Math.PI / 2;
|
|
1959
|
+
if (ii === param.Nk - 1) {
|
|
1960
|
+
da3 = aMid + aSign * Math.PI / 4;
|
|
1961
|
+
} else if (ii === 0) {
|
|
1962
|
+
da3 = aMid - aSign * Math.PI / 4;
|
|
1963
|
+
da4 = iiParity3 === 0 ? -Math.PI / 2 : Math.PI / 2 + aSpring;
|
|
1964
|
+
}
|
|
1965
|
+
if (ii === 0) {
|
|
1966
|
+
const p4 = pts[ii].translatePolar(da4, iRk);
|
|
1967
|
+
rCtr.addPointA(p4.cx, p4.cy).addSegArc(iRk, false, iiParity3 === 1);
|
|
1968
|
+
} else if (zagArc) {
|
|
1969
|
+
const p3 = pts[ii].translatePolar(da3, iRk);
|
|
1970
|
+
const p4 = pts[ii].translatePolar(da4, iRk);
|
|
1971
|
+
rCtr.addPointA(p3.cx, p3.cy).addPointA(p4.cx, p4.cy).addSegArc2();
|
|
1972
|
+
} else {
|
|
1973
|
+
const p3 = pts[ii].translatePolar(da3, iRk);
|
|
1974
|
+
const p4 = calcZagP2(pts[ii], pts[ii - 1], iRk, iRk2, -aSign);
|
|
1975
|
+
if (ii < param.Nk - 1) {
|
|
1976
|
+
rCtr.addPointA(p3.cx, p3.cy).addPointA(p4.cx, p4.cy).addSegArc2();
|
|
1977
|
+
} else {
|
|
1978
|
+
rCtr.addPointA(p4.cx, p4.cy).addSegArc(iRk, false, iiParity3 === 1);
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
return rCtr;
|
|
1983
|
+
}, ctrSpringHollow2 = function(ii) {
|
|
1984
|
+
const [ip1, ip2] = iiParity2(ii);
|
|
1985
|
+
const pp1 = ip1 === 0 ? ppp0 : ppp1;
|
|
1986
|
+
const pp2 = ip2 === 0 ? ppp0 : ppp1;
|
|
1987
|
+
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();
|
|
1989
|
+
return ctr.rotate(0, 0, ii * aSpringStep);
|
|
1990
|
+
};
|
|
1991
|
+
var prePoints = prePoints2, pppI = pppI2, externParity = externParity2, pppE = pppE2, iiParity = iiParity2, pppb = pppb2, ctrPartial1 = ctrPartial12, ctrPartial2 = ctrPartial22, ctrSpringHollow = ctrSpringHollow2;
|
|
1992
|
+
const Re = param.De / 2;
|
|
1993
|
+
const RTe = param.DTe / 2;
|
|
1994
|
+
const Ri = param.Di / 2;
|
|
1995
|
+
const RTi = param.DTi / 2;
|
|
1996
|
+
const Rmax = Re + RTe + param.Ee;
|
|
1997
|
+
const Rmin1 = Ri - RTi - param.Ei;
|
|
1998
|
+
const Rse = Re - RTe - param.Ee;
|
|
1999
|
+
const Rsi = Ri + RTi + param.Ei;
|
|
2000
|
+
const dRs = Rse - Rsi;
|
|
2001
|
+
const Esi = dRs * param.Esi / 100;
|
|
2002
|
+
const Ese = dRs * param.Ese / 100;
|
|
2003
|
+
const dRLs = dRs - Esi - Ese;
|
|
2004
|
+
const aSpringStep = 2 * Math.PI / param.Ns;
|
|
2005
|
+
const aEs = aSpringStep * param.aEs / 100;
|
|
2006
|
+
const aSpring = aSpringStep - aEs;
|
|
2007
|
+
const Rk = dRLs / (2 * (param.Nk - 1));
|
|
2008
|
+
const Ek = 2 * Rk - param.Wk;
|
|
2009
|
+
if (Rmin1 < 0.1) {
|
|
2010
|
+
throw `err120: Di ${param.Di} is too small compare to DTi ${param.DTi}, Ei ${param.Ei}`;
|
|
2011
|
+
}
|
|
2012
|
+
if (dRLs < 2 * param.Ws) {
|
|
2013
|
+
throw `err133: dRLs ${dRLs} is too small compare to Ws ${param.Ws}`;
|
|
2014
|
+
}
|
|
2015
|
+
if (Esi < 0.2 * param.Rrsi) {
|
|
2016
|
+
throw `err136: Esi ${Esi} is too small compare to Rrsi ${param.Rrsi}`;
|
|
2017
|
+
}
|
|
2018
|
+
if (Ese < 0.2 * param.Rrse) {
|
|
2019
|
+
throw `err139: Ese ${Ese} is too small compare to Rrse ${param.Rrse}`;
|
|
2020
|
+
}
|
|
2021
|
+
if (Ek < 0.1) {
|
|
2022
|
+
throw `err145: Ek ${Ek} is too small`;
|
|
2023
|
+
}
|
|
2024
|
+
const aHMinI = 2 * Math.asin((RTi + 0.5 * param.Ei) / Ri);
|
|
2025
|
+
const aHI = param.Ni > 0 ? 2 * Math.PI / param.Ni : 3.14;
|
|
2026
|
+
if (aHI < aHMinI) {
|
|
2027
|
+
throw `err126: aHI ${ffix7(radToDeg7(aHI))} is too small compare to aHMinI ${ffix7(radToDeg7(aHMinI))} degree`;
|
|
2028
|
+
}
|
|
2029
|
+
const aHMinE = 2 * Math.asin((RTe + 0.5 * param.Ee) / Re);
|
|
2030
|
+
const aHE = param.Ne > 0 ? 2 * Math.PI / param.Ne : 3.14;
|
|
2031
|
+
if (aHE < aHMinE) {
|
|
2032
|
+
throw `err131: aHE ${ffix7(radToDeg7(aHE))} is too small compare to aHMinE ${ffix7(radToDeg7(aHMinE))} degree`;
|
|
2033
|
+
}
|
|
2034
|
+
const pts0 = [];
|
|
2035
|
+
const pts1 = [];
|
|
2036
|
+
const ptl = [];
|
|
2037
|
+
const k2Parity1 = param.zig === 2 ? 1 : 0;
|
|
2038
|
+
for (let ii = 0; ii < param.Nk; ii++) {
|
|
2039
|
+
const k2Parity2 = param.zig === 1 ? 0 : 1;
|
|
2040
|
+
const kl = Rsi + Esi + 2 * ii * Rk;
|
|
2041
|
+
ptl.push(kl);
|
|
2042
|
+
const ka = Math.asin(Rk / kl);
|
|
2043
|
+
const kap1 = ii % 2 === k2Parity1 ? ka : aSpring - ka;
|
|
2044
|
+
pts0.push(point5(kl * Math.cos(kap1), kl * Math.sin(kap1)));
|
|
2045
|
+
const kap2 = ii % 2 === k2Parity2 ? ka : aSpring - ka;
|
|
2046
|
+
pts1.push(point5(kl * Math.cos(kap2), kl * Math.sin(kap2)));
|
|
2047
|
+
}
|
|
2048
|
+
const aArcMin = 2 * Math.asin(Rk / (Rsi + Esi));
|
|
2049
|
+
let zagArc = param.zag === 0;
|
|
2050
|
+
const Wk2 = param.Wk / 2;
|
|
2051
|
+
const a18 = Math.asin(Wk2 / Rsi);
|
|
2052
|
+
const [a27, l27] = prePoints2(Rsi + Esi);
|
|
2053
|
+
const [a36, l36] = prePoints2(Rse - Ese);
|
|
2054
|
+
const a45 = Math.asin(Wk2 / Rse);
|
|
2055
|
+
const extParity = param.Nk % 2;
|
|
2056
|
+
const ppp0 = [];
|
|
2057
|
+
ppp0.push(pppI2(a18, 0, Rsi));
|
|
2058
|
+
ppp0.push(pppI2(a27, 0, l27));
|
|
2059
|
+
ppp0.push(pppE2(a36, 0, l36));
|
|
2060
|
+
ppp0.push(pppE2(a45, 0, Rse));
|
|
2061
|
+
ppp0.push(pppE2(-a45, 0, Rse).rotateOrig(aSpringStep));
|
|
2062
|
+
ppp0.push(pppE2(-a36, 0, l36).rotateOrig(aSpringStep));
|
|
2063
|
+
ppp0.push(pppI2(-a27, 0, l27).rotateOrig(aSpringStep));
|
|
2064
|
+
ppp0.push(pppI2(-a18, 0, Rsi).rotateOrig(aSpringStep));
|
|
2065
|
+
const ppp1 = [];
|
|
2066
|
+
ppp1.push(pppI2(a18, 1, Rsi));
|
|
2067
|
+
ppp1.push(pppI2(a27, 1, l27));
|
|
2068
|
+
ppp1.push(pppE2(a36, 1, l36));
|
|
2069
|
+
ppp1.push(pppE2(a45, 1, Rse));
|
|
2070
|
+
ppp1.push(pppE2(-a45, 1, Rse).rotateOrig(aSpringStep));
|
|
2071
|
+
ppp1.push(pppE2(-a36, 1, l36).rotateOrig(aSpringStep));
|
|
2072
|
+
ppp1.push(pppI2(-a27, 1, l27).rotateOrig(aSpringStep));
|
|
2073
|
+
ppp1.push(pppI2(-a18, 1, Rsi).rotateOrig(aSpringStep));
|
|
2074
|
+
const Rks = Rk - Wk2;
|
|
2075
|
+
const Rkl = Rk + Wk2;
|
|
2076
|
+
rGeome.logstr += `Dmax ${ffix7(2 * Rmax)}, Dmin1 ${ffix7(2 * Rmin1)} mm
|
|
2077
|
+
`;
|
|
2078
|
+
rGeome.logstr += `Spring area: aSpring ${ffix7(radToDeg7(aSpring))} degree, dRLs ${ffix7(dRLs)} mm
|
|
2079
|
+
`;
|
|
2080
|
+
rGeome.logstr += `Spring zigzag: Ek ${ffix7(Ek)}, Rk ${ffix7(Rk)} mm
|
|
2081
|
+
`;
|
|
2082
|
+
if (aSpring < aArcMin) {
|
|
2083
|
+
zagArc = false;
|
|
2084
|
+
rGeome.logstr += `Spring zigzag forced to stroke because of aArcMin ${ffix7(radToDeg7(aArcMin))} degree
|
|
2085
|
+
`;
|
|
2086
|
+
}
|
|
2087
|
+
const ctrExt = contourCircle5(0, 0, Rmax);
|
|
2088
|
+
const ctrsH = [];
|
|
2089
|
+
if (param.Teeth === 1) {
|
|
2090
|
+
const [ctrToothE, logE] = ctrPlugExtern(param, Rmin1);
|
|
2091
|
+
rGeome.logstr += logE;
|
|
2092
|
+
ctrsH.push(ctrToothE);
|
|
2093
|
+
} else {
|
|
2094
|
+
ctrsH.push(contourCircle5(0, 0, Rmin1));
|
|
2095
|
+
}
|
|
2096
|
+
for (let ii = 0; ii < param.Ni; ii++) {
|
|
2097
|
+
const p1 = point5(0, 0).translatePolar(ii * aHI, Ri);
|
|
2098
|
+
ctrsH.push(contourCircle5(p1.cx, p1.cy, RTi));
|
|
2099
|
+
}
|
|
2100
|
+
for (let ii = 0; ii < param.Ne; ii++) {
|
|
2101
|
+
const p1 = point5(0, 0).translatePolar(ii * aHE, Re);
|
|
2102
|
+
ctrsH.push(contourCircle5(p1.cx, p1.cy, RTe));
|
|
2103
|
+
}
|
|
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();
|
|
2105
|
+
figProfile.addSecond(ctrSpringEnv);
|
|
2106
|
+
figProfile.addSecond(ctrSpringEnv.rotate(0, 0, aSpringStep));
|
|
2107
|
+
figProfile.addSecond(ctrSpringEnv.rotate(0, 0, -aSpringStep));
|
|
2108
|
+
for (let ii = 0; ii < param.Nk; ii++) {
|
|
2109
|
+
figProfile.addSecond(contourCircle5(pts0[ii].cx, pts0[ii].cy, Rk));
|
|
2110
|
+
const pt1 = pts1[ii].rotateOrig(aSpringStep);
|
|
2111
|
+
figProfile.addSecond(contourCircle5(pt1.cx, pt1.cy, Rk));
|
|
2112
|
+
if (ii > 0) {
|
|
2113
|
+
figProfile.addSecond(contourCircle5(0, 0, ptl[ii] - Rk));
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
for (let ii = 0; ii < param.Ns; ii++) {
|
|
2117
|
+
ctrsH.push(ctrSpringHollow2(ii));
|
|
2118
|
+
}
|
|
2119
|
+
figProfile.addMainOI([ctrExt, ...ctrsH]);
|
|
2120
|
+
rGeome.fig = {
|
|
2121
|
+
faceProfile: figProfile
|
|
2122
|
+
};
|
|
2123
|
+
const designName = rGeome.partName;
|
|
2124
|
+
rGeome.vol = {
|
|
2125
|
+
extrudes: [
|
|
2126
|
+
{
|
|
2127
|
+
outName: `subpax_${designName}_profile`,
|
|
2128
|
+
face: `${designName}_faceProfile`,
|
|
2129
|
+
extrudeMethod: EExtrude6.eLinearOrtho,
|
|
2130
|
+
length: param.Th,
|
|
2131
|
+
rotate: [0, 0, 0],
|
|
2132
|
+
translate: [0, 0, 0]
|
|
2133
|
+
}
|
|
2134
|
+
],
|
|
2135
|
+
volumes: [
|
|
2136
|
+
{
|
|
2137
|
+
outName: `pax_${designName}`,
|
|
2138
|
+
boolMethod: EBVolume6.eIdentity,
|
|
2139
|
+
inList: [`subpax_${designName}_profile`]
|
|
2140
|
+
}
|
|
2141
|
+
]
|
|
2142
|
+
};
|
|
2143
|
+
rGeome.sub = {};
|
|
2144
|
+
rGeome.logstr += "springTorqueC drawn successfully!\n";
|
|
2145
|
+
rGeome.calcErr = false;
|
|
2146
|
+
} catch (emsg) {
|
|
2147
|
+
rGeome.logstr += emsg;
|
|
2148
|
+
console.log(emsg);
|
|
2149
|
+
}
|
|
2150
|
+
return rGeome;
|
|
2151
|
+
}
|
|
2152
|
+
var springTorqueCDef = {
|
|
2153
|
+
pTitle: "springTorqueC",
|
|
2154
|
+
pDescription: "spring disc for smooth torque transmission",
|
|
2155
|
+
pDef: pDef6,
|
|
2156
|
+
pGeom: pGeom6
|
|
2157
|
+
};
|
|
1344
2158
|
export {
|
|
1345
2159
|
door1arcDef,
|
|
1346
2160
|
plugTorqueDef,
|
|
1347
2161
|
springTorqueADef,
|
|
2162
|
+
springTorqueBDef,
|
|
2163
|
+
springTorqueCDef,
|
|
1348
2164
|
stoneTowerDef
|
|
1349
2165
|
};
|
|
1350
2166
|
//# sourceMappingURL=index.js.map
|