desi77 0.1.16 → 0.1.18
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.d.ts +3 -1
- package/dist/index.js +1299 -1028
- package/dist/pgdsvg/capsule_nose.svg +1 -1
- package/dist/pgdsvg/capsule_side.svg +1 -1
- package/dist/pgdsvg/capsule_top.svg +1 -1
- package/dist/pgdsvg/capsule_wall.svg +1 -1
- package/dist/pgdsvg/capsule_wheels.svg +1 -1
- package/dist/pgdsvg/door1Arc_face.svg +1 -1
- package/dist/pgdsvg/door1Arc_nArcs.svg +1 -1
- package/dist/pgdsvg/door1Arc_spread.svg +1 -1
- package/dist/pgdsvg/door1Arc_vaultStone.svg +1 -1
- package/dist/pgdsvg/doubleBone_face.svg +1 -1
- package/dist/pgdsvg/doubleBone_folding.svg +1 -1
- package/dist/pgdsvg/doubleBone_side.svg +1 -1
- package/dist/pgdsvg/doubleBone_top.svg +1 -1
- package/dist/pgdsvg/factory_front_window.svg +1 -0
- package/dist/pgdsvg/factory_side_window.svg +1 -0
- package/dist/pgdsvg/factory_top.svg +2 -0
- package/dist/pgdsvg/factory_west.svg +1 -0
- package/dist/pgdsvg/heliostat_bottom.svg +1 -1
- package/dist/pgdsvg/heliostat_fixation.svg +1 -1
- package/dist/pgdsvg/heliostat_hand.svg +1 -1
- package/dist/pgdsvg/heliostat_junction.svg +2 -2
- package/dist/pgdsvg/heliostat_top.svg +1 -1
- package/dist/pgdsvg/house_pignon.svg +1 -1
- package/dist/pgdsvg/house_top.svg +1 -1
- package/dist/pgdsvg/pcar_front.svg +2 -2
- package/dist/pgdsvg/pcar_side.svg +1 -1
- package/dist/pgdsvg/pcar_top.svg +1 -1
- package/dist/pgdsvg/plugTorque_parts.svg +1 -1
- package/dist/pgdsvg/plugTorque_teeth_adden.svg +1 -1
- package/dist/pgdsvg/plugTorque_teeth_deden.svg +1 -1
- package/dist/pgdsvg/plugTorque_teeth_radial.svg +1 -1
- package/dist/pgdsvg/rccar_all_xy.svg +3 -3
- package/dist/pgdsvg/rccar_all_xz.svg +1 -1
- package/dist/pgdsvg/rccar_bone.svg +1 -1
- package/dist/pgdsvg/rccar_motor_xz.svg +1 -1
- package/dist/pgdsvg/rccar_one_xy.svg +1 -1
- package/dist/pgdsvg/rccar_platform_xz.svg +1 -1
- package/dist/pgdsvg/singleBone_face.svg +1 -1
- package/dist/pgdsvg/springInt_face.svg +3 -3
- package/dist/pgdsvg/springInt_global.svg +1 -1
- package/dist/pgdsvg/springInt_section.svg +2 -2
- package/dist/pgdsvg/springInt_spring.svg +1 -1
- package/dist/pgdsvg/springOne_face.svg +3 -3
- package/dist/pgdsvg/springOne_side.svg +2 -2
- package/dist/pgdsvg/springOne_spring.svg +1 -1
- package/dist/pgdsvg/springOne_top.svg +2 -2
- package/dist/pgdsvg/springSide_face.svg +3 -3
- package/dist/pgdsvg/springSide_section.svg +2 -2
- package/dist/pgdsvg/springSide_spring.svg +1 -1
- package/dist/pgdsvg/springSide_top.svg +1 -1
- package/dist/pgdsvg/springTorqueA_profile.svg +1 -1
- package/dist/pgdsvg/springTorqueB_profile.svg +5 -5
- package/dist/pgdsvg/springTorqueC_profile.svg +5 -5
- package/dist/pgdsvg/springWorm_caps.svg +3 -3
- package/dist/pgdsvg/springWorm_mid.svg +1 -1
- package/dist/pgdsvg/springWorm_side.svg +1 -1
- package/dist/pgdsvg/src_capsule.svg +2 -2
- package/dist/pgdsvg/src_door1Arc.svg +1 -1
- package/dist/pgdsvg/src_doubleBone.svg +1 -1
- package/dist/pgdsvg/src_factory.svg +2 -0
- package/dist/pgdsvg/src_heliostat.svg +2 -2
- package/dist/pgdsvg/src_house.svg +1 -1
- package/dist/pgdsvg/src_pcar.svg +3 -3
- package/dist/pgdsvg/src_plugTorque.svg +1 -1
- package/dist/pgdsvg/src_rccar.svg +3 -3
- package/dist/pgdsvg/src_singleBone.svg +1 -1
- package/dist/pgdsvg/src_springInt.svg +4 -4
- package/dist/pgdsvg/src_springOne.svg +5 -5
- package/dist/pgdsvg/src_springSide.svg +5 -5
- package/dist/pgdsvg/src_springTorqueA.svg +1 -1
- package/dist/pgdsvg/src_springTorqueB.svg +5 -5
- package/dist/pgdsvg/src_springTorqueC.svg +5 -5
- package/dist/pgdsvg/src_springWorm.svg +3 -3
- package/dist/pgdsvg/src_stoneTower.svg +1 -1
- package/dist/pgdsvg/stoneTower_hplan.svg +1 -1
- package/dist/pgdsvg/stoneTower_vw.svg +1 -1
- package/dist/pgdsvg/stoneTower_window2.svg +1 -1
- package/package.json +16 -16
package/dist/index.js
CHANGED
|
@@ -1161,40 +1161,310 @@ var houseDef = {
|
|
|
1161
1161
|
pGeom: pGeom3
|
|
1162
1162
|
};
|
|
1163
1163
|
|
|
1164
|
-
// src/
|
|
1164
|
+
// src/stone/factory.ts
|
|
1165
1165
|
import {
|
|
1166
|
-
point as point2,
|
|
1167
1166
|
contour as contour4,
|
|
1168
|
-
|
|
1167
|
+
ctrRectangle as ctrRectangle4,
|
|
1169
1168
|
figure as figure4,
|
|
1169
|
+
degToRad,
|
|
1170
1170
|
radToDeg as radToDeg3,
|
|
1171
1171
|
ffix as ffix4,
|
|
1172
1172
|
pNumber as pNumber4,
|
|
1173
1173
|
pCheckbox as pCheckbox2,
|
|
1174
|
+
pDropdown as pDropdown2,
|
|
1174
1175
|
pSectionSeparator as pSectionSeparator4,
|
|
1175
1176
|
EExtrude as EExtrude4,
|
|
1176
1177
|
EBVolume as EBVolume4,
|
|
1177
1178
|
initGeom as initGeom4
|
|
1178
1179
|
} from "geometrix";
|
|
1180
|
+
import { triALArLL } from "triangule";
|
|
1179
1181
|
var pDef4 = {
|
|
1182
|
+
// partName is used in URL. Choose a name without slash, backslash and space.
|
|
1183
|
+
partName: "factory",
|
|
1184
|
+
params: [
|
|
1185
|
+
//pNumber(name, unit, init, min, max, step)
|
|
1186
|
+
pNumber4("onx", "office", 4, 1, 50, 1),
|
|
1187
|
+
pNumber4("ony", "office", 3, 1, 50, 1),
|
|
1188
|
+
pNumber4("olx", "mm", 5e3, 1e3, 5e4, 10),
|
|
1189
|
+
pNumber4("oly", "mm", 5e3, 1e3, 5e4, 10),
|
|
1190
|
+
pNumber4("iwx", "mm", 2e3, 500, 1e4, 10),
|
|
1191
|
+
pNumber4("iwy", "mm", 2e3, 500, 1e4, 10),
|
|
1192
|
+
pSectionSeparator4("details"),
|
|
1193
|
+
pNumber4("ewx", "mm", 5e3, 500, 2e4, 10),
|
|
1194
|
+
pNumber4("ewy", "mm", 5e3, 500, 2e4, 10),
|
|
1195
|
+
pDropdown2("officeOrientation", ["xdw", "xup", "xal", "ydw", "yup", "yal"]),
|
|
1196
|
+
pNumber4("ith", "mm", 400, 100, 2e3, 10),
|
|
1197
|
+
pNumber4("eth", "mm", 400, 100, 2e3, 10),
|
|
1198
|
+
pNumber4("bw", "mm", 1500, 200, 1e4, 10),
|
|
1199
|
+
pSectionSeparator4("heights and roof"),
|
|
1200
|
+
pNumber4("oh1", "mm", 2800, 2e3, 5e3, 10),
|
|
1201
|
+
pNumber4("oh2", "mm", 4e3, 2e3, 1e4, 10),
|
|
1202
|
+
pNumber4("rtn", "triangle", 6, 1, 1e3, 1),
|
|
1203
|
+
pNumber4("ran", "degree", 49, 20, 90, 0.1),
|
|
1204
|
+
pNumber4("ram", "degree", 90, 80, 160, 0.1),
|
|
1205
|
+
pNumber4("rth", "mm", 200, 10, 1e3, 10),
|
|
1206
|
+
pSectionSeparator4("lateral windows"),
|
|
1207
|
+
pNumber4("swx1", "mm", 1e3, 10, 5e3, 10),
|
|
1208
|
+
pNumber4("swx2", "mm", 1e3, 10, 5e3, 10),
|
|
1209
|
+
pNumber4("swh1", "mm", 1e3, 10, 5e3, 10),
|
|
1210
|
+
pNumber4("swh2", "mm", 1e3, 10, 5e3, 10),
|
|
1211
|
+
pNumber4("swh3", "mm", 200, 10, 5e3, 10),
|
|
1212
|
+
pSectionSeparator4("front windows"),
|
|
1213
|
+
pNumber4("fwx1", "mm", 1e3, 10, 5e3, 10),
|
|
1214
|
+
pNumber4("fwx2", "mm", 1e3, 10, 5e3, 10),
|
|
1215
|
+
pNumber4("fwh1", "mm", 1e3, 10, 5e3, 10),
|
|
1216
|
+
pNumber4("fwh2", "mm", 1e3, 10, 5e3, 10),
|
|
1217
|
+
pNumber4("fwh3", "mm", 200, 10, 5e3, 10),
|
|
1218
|
+
pNumber4("fdx1", "mm", 1e3, 10, 5e3, 10),
|
|
1219
|
+
pNumber4("fdx2", "mm", 1e3, 10, 5e3, 10),
|
|
1220
|
+
pNumber4("fdh2", "mm", 2e3, 10, 5e3, 10),
|
|
1221
|
+
pNumber4("fdh3", "mm", 200, 10, 5e3, 10),
|
|
1222
|
+
pSectionSeparator4("to be deleted"),
|
|
1223
|
+
pNumber4("L1", "mm", 120, 1, 400, 1),
|
|
1224
|
+
pNumber4("L2", "mm", 80, 1, 400, 1),
|
|
1225
|
+
pNumber4("W1", "mm", 2, 0.1, 10, 0.1),
|
|
1226
|
+
pNumber4("H1", "mm", 40, 1, 400, 1),
|
|
1227
|
+
pNumber4("H2", "mm", 2, 0.1, 10, 0.1),
|
|
1228
|
+
//pSectionSeparator(name)
|
|
1229
|
+
pSectionSeparator4("hollow"),
|
|
1230
|
+
//pCheckbox(name, init)
|
|
1231
|
+
pCheckbox2("holes", true),
|
|
1232
|
+
pNumber4("D1", "mm", 10, 1, 400, 1),
|
|
1233
|
+
pNumber4("D2", "mm", 5, 1, 400, 1),
|
|
1234
|
+
pSectionSeparator4("corners"),
|
|
1235
|
+
pNumber4("Rc", "mm", 10, 0, 400, 1)
|
|
1236
|
+
],
|
|
1237
|
+
paramSvg: {
|
|
1238
|
+
onx: "factory_top.svg",
|
|
1239
|
+
ony: "factory_top.svg",
|
|
1240
|
+
olx: "factory_top.svg",
|
|
1241
|
+
oly: "factory_top.svg",
|
|
1242
|
+
iwx: "factory_top.svg",
|
|
1243
|
+
iwy: "factory_top.svg",
|
|
1244
|
+
ewx: "factory_top.svg",
|
|
1245
|
+
ewy: "factory_top.svg",
|
|
1246
|
+
officeOrientation: "factory_top.svg",
|
|
1247
|
+
ith: "factory_top.svg",
|
|
1248
|
+
eth: "factory_top.svg",
|
|
1249
|
+
bw: "factory_top.svg",
|
|
1250
|
+
oh1: "factory_west.svg",
|
|
1251
|
+
oh2: "factory_west.svg",
|
|
1252
|
+
rtn: "factory_west.svg",
|
|
1253
|
+
ran: "factory_west.svg",
|
|
1254
|
+
ram: "factory_west.svg",
|
|
1255
|
+
rth: "factory_west.svg",
|
|
1256
|
+
swx1: "factory_side_window.svg",
|
|
1257
|
+
swx2: "factory_side_window.svg",
|
|
1258
|
+
swh1: "factory_side_window.svg",
|
|
1259
|
+
swh2: "factory_side_window.svg",
|
|
1260
|
+
swh3: "factory_side_window.svg",
|
|
1261
|
+
fwx1: "factory_front_window.svg",
|
|
1262
|
+
fwx2: "factory_front_window.svg",
|
|
1263
|
+
fwh1: "factory_front_window.svg",
|
|
1264
|
+
fwh2: "factory_front_window.svg",
|
|
1265
|
+
fwh3: "factory_front_window.svg",
|
|
1266
|
+
fdx1: "factory_front_window.svg",
|
|
1267
|
+
fdx2: "factory_front_window.svg",
|
|
1268
|
+
fdh2: "factory_front_window.svg",
|
|
1269
|
+
fdh3: "factory_front_window.svg",
|
|
1270
|
+
//
|
|
1271
|
+
L1: "factory_top.svg",
|
|
1272
|
+
L2: "factory_west.svg",
|
|
1273
|
+
W1: "factory_side_window.svg",
|
|
1274
|
+
H1: "factory_front_window.svg",
|
|
1275
|
+
H2: "factory_top.svg",
|
|
1276
|
+
holes: "factory_top.svg",
|
|
1277
|
+
D1: "factory_top.svg",
|
|
1278
|
+
D2: "factory_top.svg",
|
|
1279
|
+
Rc: "factory_top.svg"
|
|
1280
|
+
},
|
|
1281
|
+
sim: {
|
|
1282
|
+
tMax: 180,
|
|
1283
|
+
tStep: 0.5,
|
|
1284
|
+
tUpdate: 500
|
|
1285
|
+
// every 0.5 second
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1288
|
+
function pGeom4(t, param, suffix = "") {
|
|
1289
|
+
const rGeome = initGeom4(pDef4.partName + suffix);
|
|
1290
|
+
const figTop = figure4();
|
|
1291
|
+
const figWest = figure4();
|
|
1292
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
1293
|
+
`;
|
|
1294
|
+
try {
|
|
1295
|
+
const llix = param.onx * param.olx + (param.onx - 1) * param.iwx + 2 * param.ewx;
|
|
1296
|
+
const llex = llix + 2 * param.eth;
|
|
1297
|
+
const lliy = param.ony * param.oly + (param.ony - 1) * param.iwy + 2 * param.ewy;
|
|
1298
|
+
const lley = lliy + 2 * param.eth;
|
|
1299
|
+
const llixm = llix / 1e3;
|
|
1300
|
+
const llexm = llex / 1e3;
|
|
1301
|
+
const lliym = lliy / 1e3;
|
|
1302
|
+
const lleym = lley / 1e3;
|
|
1303
|
+
const fh = param.oh1 + param.oh2;
|
|
1304
|
+
const olix = param.olx - 2 * param.ith;
|
|
1305
|
+
const oliy = param.oly - 2 * param.ith;
|
|
1306
|
+
const officeOx = param.eth + param.ewx;
|
|
1307
|
+
const officeOy = param.eth + param.ewy;
|
|
1308
|
+
const roofTriLx = llex / param.rtn;
|
|
1309
|
+
const ran = degToRad(param.ran);
|
|
1310
|
+
const ram = degToRad(param.ram);
|
|
1311
|
+
const ras = Math.PI - ran - ram;
|
|
1312
|
+
if (ras < 0.1) {
|
|
1313
|
+
throw `err162: ras ${ffix4(radToDeg3(ras))} is too small. Reduce ran ${ffix4(param.ran)} or ram ${ffix4(param.ram)} degree`;
|
|
1314
|
+
}
|
|
1315
|
+
const [tr1lBC, tr1lCA, tr1Log] = triALArLL(ras, roofTriLx, ran);
|
|
1316
|
+
rGeome.logstr += tr1Log;
|
|
1317
|
+
const Rh = tr1lBC * Math.sin(ran);
|
|
1318
|
+
const Rhx = tr1lBC * Math.cos(ran);
|
|
1319
|
+
const Rhxs = roofTriLx - Rhx;
|
|
1320
|
+
const Rhxp = 100 * Rhx / roofTriLx;
|
|
1321
|
+
const Rhxsp = 100 * Rhxs / roofTriLx;
|
|
1322
|
+
const Rhyp = 100 * Rh / roofTriLx;
|
|
1323
|
+
if (olix < 0) {
|
|
1324
|
+
throw `err158: olix ${ffix4(olix)} is too small compare to ith ${param.ith}`;
|
|
1325
|
+
}
|
|
1326
|
+
if (oliy < 0) {
|
|
1327
|
+
throw `err161: oliy ${ffix4(oliy)} is too small compare to ith ${param.ith}`;
|
|
1328
|
+
}
|
|
1329
|
+
if (param.olx < 2 * param.ith + param.swx1 + param.swx2) {
|
|
1330
|
+
throw `err151: olx ${param.olx} is too small compare to swx1 ${param.swx1} and swx2 ${param.swx2}`;
|
|
1331
|
+
}
|
|
1332
|
+
if (param.oly < 2 * param.ith + param.fwx1 + param.fwx2 + param.fdx1 + param.fdx2) {
|
|
1333
|
+
throw `err154: oly ${param.oly} is too small compare to fwx1 ${param.fwx1}, fwx2 ${param.fwx2}, fdx1 ${param.fdx1}, fdx2 ${param.fdx2}`;
|
|
1334
|
+
}
|
|
1335
|
+
if (Math.min(param.olx, param.oly) < param.bw) {
|
|
1336
|
+
throw `err172: bw ${param.bw} is too large compare to olx ${param.olx} or oly ${param.oly}`;
|
|
1337
|
+
}
|
|
1338
|
+
rGeome.logstr += `factory size: llex ${ffix4(llexm)} x lley ${ffix4(lleym)} m
|
|
1339
|
+
`;
|
|
1340
|
+
rGeome.logstr += `factory surface: ext ${ffix4(llexm * lleym)}, int ${ffix4(llixm * lliym)} m2
|
|
1341
|
+
`;
|
|
1342
|
+
rGeome.logstr += `roof: triL ${ffix4(roofTriLx)}, Rh ${ffix4(Rh)} mm, Rhyp ${ffix4(Rhyp)} %
|
|
1343
|
+
`;
|
|
1344
|
+
rGeome.logstr += `roof north glass length ${ffix4(tr1lBC)} mm, Rhxp ${ffix4(Rhxp)} %, roof south opaque ${ffix4(tr1lCA)} mm, Rhxsp ${ffix4(Rhxsp)} %
|
|
1345
|
+
`;
|
|
1346
|
+
const ctrFext = ctrRectangle4(0, 0, llex, lley);
|
|
1347
|
+
const ctrFint = ctrRectangle4(param.eth, param.eth, llix, lliy);
|
|
1348
|
+
figTop.addMainOI([ctrFext, ctrFint]);
|
|
1349
|
+
for (let ii = 0; ii < param.onx; ii++) {
|
|
1350
|
+
for (let jj = 0; jj < param.ony; jj++) {
|
|
1351
|
+
const pox = officeOx + ii * (param.olx + param.iwx);
|
|
1352
|
+
const poy = officeOy + jj * (param.oly + param.iwy);
|
|
1353
|
+
const ctrOext = ctrRectangle4(pox, poy, param.olx, param.oly);
|
|
1354
|
+
const ctrOint = ctrRectangle4(pox + param.ith, poy + param.ith, olix, oliy);
|
|
1355
|
+
figTop.addMainOI([ctrOext, ctrOint]);
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
for (let ii = 0; ii < param.onx - 1; ii++) {
|
|
1359
|
+
for (let jj = 0; jj < param.ony; jj++) {
|
|
1360
|
+
const pox = officeOx + ii * (param.olx + param.iwx) + param.olx;
|
|
1361
|
+
const poy = officeOy + jj * (param.oly + param.iwy) + (param.oly - param.bw) / 2;
|
|
1362
|
+
const ctrBridge = ctrRectangle4(pox, poy, param.iwx, param.bw);
|
|
1363
|
+
figTop.addMainO(ctrBridge);
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
for (let ii = 0; ii < param.onx; ii++) {
|
|
1367
|
+
for (let jj = 0; jj < param.ony - 1; jj++) {
|
|
1368
|
+
const pox = officeOx + ii * (param.olx + param.iwx) + (param.olx - param.bw) / 2;
|
|
1369
|
+
const poy = officeOy + jj * (param.oly + param.iwy) + param.oly;
|
|
1370
|
+
const ctrBridge = ctrRectangle4(pox, poy, param.bw, param.iwy);
|
|
1371
|
+
figTop.addMainO(ctrBridge);
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
figWest.addMainO(ctrRectangle4(0, -param.eth, llex, param.eth));
|
|
1375
|
+
figWest.addMainO(ctrRectangle4(0, 0, param.eth, fh));
|
|
1376
|
+
figWest.addMainO(ctrRectangle4(llex - param.eth, 0, param.eth, fh));
|
|
1377
|
+
for (let ii = 0; ii < param.onx; ii++) {
|
|
1378
|
+
const pox = officeOx + ii * (param.olx + param.iwx);
|
|
1379
|
+
figWest.addMainOI([
|
|
1380
|
+
ctrRectangle4(pox, 0, param.olx, param.oh1),
|
|
1381
|
+
ctrRectangle4(pox + param.ith, 0, olix, param.oh1 - param.ith)
|
|
1382
|
+
]);
|
|
1383
|
+
}
|
|
1384
|
+
const ctrRoof = contour4(0, fh);
|
|
1385
|
+
for (let ii = 0; ii < param.rtn; ii++) {
|
|
1386
|
+
ctrRoof.addSegStrokeR(Rhx, Rh).addSegStrokeR(Rhxs, -Rh);
|
|
1387
|
+
}
|
|
1388
|
+
ctrRoof.addSegStrokeR(0, param.rth);
|
|
1389
|
+
for (let ii = 0; ii < param.rtn; ii++) {
|
|
1390
|
+
ctrRoof.addSegStrokeR(-Rhxs, Rh).addSegStrokeR(-Rhx, -Rh);
|
|
1391
|
+
}
|
|
1392
|
+
ctrRoof.closeSegStroke();
|
|
1393
|
+
figWest.addMainO(ctrRoof);
|
|
1394
|
+
rGeome.fig = {
|
|
1395
|
+
faceTop: figTop,
|
|
1396
|
+
faceWest: figWest
|
|
1397
|
+
};
|
|
1398
|
+
const designName = rGeome.partName;
|
|
1399
|
+
rGeome.vol = {
|
|
1400
|
+
extrudes: [
|
|
1401
|
+
{
|
|
1402
|
+
outName: `subpax_${designName}_top`,
|
|
1403
|
+
face: `${designName}_faceTop`,
|
|
1404
|
+
extrudeMethod: EExtrude4.eLinearOrtho,
|
|
1405
|
+
length: fh,
|
|
1406
|
+
rotate: [0, 0, 0],
|
|
1407
|
+
translate: [0, 0, 0]
|
|
1408
|
+
}
|
|
1409
|
+
],
|
|
1410
|
+
volumes: [
|
|
1411
|
+
{
|
|
1412
|
+
outName: `pax_${designName}`,
|
|
1413
|
+
boolMethod: EBVolume4.eUnion,
|
|
1414
|
+
inList: [`subpax_${designName}_top`]
|
|
1415
|
+
}
|
|
1416
|
+
]
|
|
1417
|
+
};
|
|
1418
|
+
rGeome.sub = {};
|
|
1419
|
+
rGeome.logstr += "factory drawn successfully!\n";
|
|
1420
|
+
rGeome.calcErr = false;
|
|
1421
|
+
} catch (emsg) {
|
|
1422
|
+
rGeome.logstr += emsg;
|
|
1423
|
+
console.log(emsg);
|
|
1424
|
+
}
|
|
1425
|
+
return rGeome;
|
|
1426
|
+
}
|
|
1427
|
+
var factoryDef = {
|
|
1428
|
+
pTitle: "factory",
|
|
1429
|
+
pDescription: "a scalable factory-plan",
|
|
1430
|
+
pDef: pDef4,
|
|
1431
|
+
pGeom: pGeom4
|
|
1432
|
+
};
|
|
1433
|
+
|
|
1434
|
+
// src/spring/springTorqueA.ts
|
|
1435
|
+
import {
|
|
1436
|
+
point as point2,
|
|
1437
|
+
contour as contour5,
|
|
1438
|
+
contourCircle as contourCircle2,
|
|
1439
|
+
figure as figure5,
|
|
1440
|
+
radToDeg as radToDeg4,
|
|
1441
|
+
ffix as ffix5,
|
|
1442
|
+
pNumber as pNumber5,
|
|
1443
|
+
pCheckbox as pCheckbox3,
|
|
1444
|
+
pSectionSeparator as pSectionSeparator5,
|
|
1445
|
+
EExtrude as EExtrude5,
|
|
1446
|
+
EBVolume as EBVolume5,
|
|
1447
|
+
initGeom as initGeom5
|
|
1448
|
+
} from "geometrix";
|
|
1449
|
+
var pDef5 = {
|
|
1180
1450
|
partName: "springTorqueA",
|
|
1181
1451
|
params: [
|
|
1182
1452
|
//pNumber(name, unit, init, min, max, step)
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1453
|
+
pNumber5("D1", "mm", 20, 1, 1e3, 1),
|
|
1454
|
+
pNumber5("N1", "hole", 16, 0, 400, 1),
|
|
1455
|
+
pNumber5("T1", "mm", 2, 0.1, 50, 0.1),
|
|
1456
|
+
pNumber5("E1", "mm", 1, 0.1, 50, 0.1),
|
|
1457
|
+
pSectionSeparator5("External ring"),
|
|
1458
|
+
pCheckbox3("Ring2", true),
|
|
1459
|
+
pNumber5("D2", "mm", 80, 1, 1e3, 1),
|
|
1460
|
+
pNumber5("N2", "hole", 16, 0, 400, 1),
|
|
1461
|
+
pNumber5("T2", "mm", 2, 0.1, 50, 0.1),
|
|
1462
|
+
pNumber5("E2", "mm", 1, 0.1, 50, 0.1),
|
|
1463
|
+
pSectionSeparator5("Spoke"),
|
|
1464
|
+
pNumber5("N3", "spoke", 5, 0, 60, 1),
|
|
1465
|
+
pNumber5("E3", "mm", 3, 0.1, 100, 0.1),
|
|
1466
|
+
pNumber5("R3", "mm", 3, 0, 100, 0.1),
|
|
1467
|
+
pNumber5("Th", "mm", 3, 0.1, 100, 0.1)
|
|
1198
1468
|
],
|
|
1199
1469
|
paramSvg: {
|
|
1200
1470
|
D1: "springTorqueA_profile.svg",
|
|
@@ -1218,9 +1488,9 @@ var pDef4 = {
|
|
|
1218
1488
|
// every 0.5 second
|
|
1219
1489
|
}
|
|
1220
1490
|
};
|
|
1221
|
-
function
|
|
1222
|
-
const rGeome =
|
|
1223
|
-
const figProfile =
|
|
1491
|
+
function pGeom5(t, param, suffix = "") {
|
|
1492
|
+
const rGeome = initGeom5(pDef5.partName + suffix);
|
|
1493
|
+
const figProfile = figure5();
|
|
1224
1494
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
1225
1495
|
`;
|
|
1226
1496
|
try {
|
|
@@ -1242,12 +1512,12 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1242
1512
|
const aIntMin = 2 * Math.asin((RT1 + 0.5 * param.E1) / R1);
|
|
1243
1513
|
const aInt = param.N1 > 0 ? 2 * Math.PI / param.N1 : 3.14;
|
|
1244
1514
|
if (aInt < aIntMin) {
|
|
1245
|
-
throw `err101: aInt ${
|
|
1515
|
+
throw `err101: aInt ${ffix5(radToDeg4(aInt))} is too small compare to aIntMin ${ffix5(radToDeg4(aIntMin))} degree`;
|
|
1246
1516
|
}
|
|
1247
1517
|
const aExtMin = 2 * Math.asin((RT2 + 0.5 * param.E2) / R2);
|
|
1248
1518
|
const aExt = param.N2 > 0 ? 2 * Math.PI / param.N2 : 3.14;
|
|
1249
1519
|
if (aExt < aExtMin) {
|
|
1250
|
-
throw `err106: aExt ${
|
|
1520
|
+
throw `err106: aExt ${ffix5(radToDeg4(aExt))} is too small compare to aExtMin ${ffix5(radToDeg4(aExtMin))} degree`;
|
|
1251
1521
|
}
|
|
1252
1522
|
const ah2 = Math.asin(E32 / Rh2);
|
|
1253
1523
|
const ah1 = Math.asin(E32 / Rh1);
|
|
@@ -1258,9 +1528,9 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1258
1528
|
const Rh1b2 = sinah02 > 0.1 ? (E32 + param.R3) / sinah02 : Rh1 / 2;
|
|
1259
1529
|
const hollowTriangle = param.N3 > 1 && Rh1b2 > Rh1 + param.R3 - 0.1 ? true : false;
|
|
1260
1530
|
if (!hollowTriangle && ah0 < 2 * ahR1) {
|
|
1261
|
-
throw `err115: ah0 ${
|
|
1531
|
+
throw `err115: ah0 ${ffix5(radToDeg4(ah0))} is too small compare to ah1 ${ffix5(radToDeg4(ah1))}, ahR1 ${ffix5(radToDeg4(ahR1))} degree`;
|
|
1262
1532
|
}
|
|
1263
|
-
rGeome.logstr += `Dmax ${
|
|
1533
|
+
rGeome.logstr += `Dmax ${ffix5(2 * Rmax)}, Dmin ${ffix5(2 * Rmin)} mm
|
|
1264
1534
|
`;
|
|
1265
1535
|
rGeome.logstr += `Triangle vs quadri: ${hollowTriangle ? "triangle" : "quadri"}
|
|
1266
1536
|
`;
|
|
@@ -1283,7 +1553,7 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1283
1553
|
const p1 = point2(0, 0).translatePolar(aRef + ah1, Rh1);
|
|
1284
1554
|
const p1b = point2(0, 0).translatePolar(aRef + ah0 / 2, Rh1b);
|
|
1285
1555
|
const [x0, y0] = hollowTriangle ? [p1b.cx, p1b.cy] : [p1.cx, p1.cy];
|
|
1286
|
-
const iCtr =
|
|
1556
|
+
const iCtr = contour5(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);
|
|
1287
1557
|
if (hollowTriangle) {
|
|
1288
1558
|
iCtr.closeSegStroke();
|
|
1289
1559
|
} else {
|
|
@@ -1305,7 +1575,7 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1305
1575
|
{
|
|
1306
1576
|
outName: `subpax_${designName}_profile`,
|
|
1307
1577
|
face: `${designName}_faceProfile`,
|
|
1308
|
-
extrudeMethod:
|
|
1578
|
+
extrudeMethod: EExtrude5.eLinearOrtho,
|
|
1309
1579
|
length: param.Th,
|
|
1310
1580
|
rotate: [0, 0, 0],
|
|
1311
1581
|
translate: [0, 0, 0]
|
|
@@ -1314,7 +1584,7 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1314
1584
|
volumes: [
|
|
1315
1585
|
{
|
|
1316
1586
|
outName: `pax_${designName}`,
|
|
1317
|
-
boolMethod:
|
|
1587
|
+
boolMethod: EBVolume5.eIdentity,
|
|
1318
1588
|
inList: [`subpax_${designName}_profile`]
|
|
1319
1589
|
}
|
|
1320
1590
|
]
|
|
@@ -1331,41 +1601,41 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1331
1601
|
var springTorqueADef = {
|
|
1332
1602
|
pTitle: "springTorqueA",
|
|
1333
1603
|
pDescription: "spring disc for torque transmission",
|
|
1334
|
-
pDef:
|
|
1335
|
-
pGeom:
|
|
1604
|
+
pDef: pDef5,
|
|
1605
|
+
pGeom: pGeom5
|
|
1336
1606
|
};
|
|
1337
1607
|
|
|
1338
1608
|
// src/spring/plugTorque.ts
|
|
1339
1609
|
import {
|
|
1340
1610
|
withinPiPi as withinPiPi2,
|
|
1341
1611
|
point as point3,
|
|
1342
|
-
contour as
|
|
1612
|
+
contour as contour7,
|
|
1343
1613
|
contourCircle as contourCircle3,
|
|
1344
|
-
figure as
|
|
1345
|
-
degToRad as
|
|
1346
|
-
radToDeg as
|
|
1347
|
-
ffix as
|
|
1348
|
-
pNumber as
|
|
1349
|
-
pDropdown as
|
|
1350
|
-
pSectionSeparator as
|
|
1351
|
-
EExtrude as
|
|
1352
|
-
EBVolume as
|
|
1353
|
-
initGeom as
|
|
1614
|
+
figure as figure6,
|
|
1615
|
+
degToRad as degToRad3,
|
|
1616
|
+
radToDeg as radToDeg6,
|
|
1617
|
+
ffix as ffix7,
|
|
1618
|
+
pNumber as pNumber6,
|
|
1619
|
+
pDropdown as pDropdown3,
|
|
1620
|
+
pSectionSeparator as pSectionSeparator6,
|
|
1621
|
+
EExtrude as EExtrude6,
|
|
1622
|
+
EBVolume as EBVolume6,
|
|
1623
|
+
initGeom as initGeom6
|
|
1354
1624
|
} from "geometrix";
|
|
1355
1625
|
import { triALLrLAA as triALLrLAA2 } from "triangule";
|
|
1356
1626
|
|
|
1357
1627
|
// src/spring/libPlugTorque.ts
|
|
1358
1628
|
import {
|
|
1359
1629
|
withinPiPi,
|
|
1360
|
-
contour as
|
|
1361
|
-
degToRad,
|
|
1362
|
-
radToDeg as
|
|
1363
|
-
ffix as
|
|
1630
|
+
contour as contour6,
|
|
1631
|
+
degToRad as degToRad2,
|
|
1632
|
+
radToDeg as radToDeg5,
|
|
1633
|
+
ffix as ffix6
|
|
1364
1634
|
} from "geometrix";
|
|
1365
1635
|
import { triALLrLAA } from "triangule";
|
|
1366
1636
|
function ctrPlugExtern(param, RbEmax) {
|
|
1367
1637
|
let rLog = "";
|
|
1368
|
-
const aM =
|
|
1638
|
+
const aM = degToRad2(param.aM);
|
|
1369
1639
|
const Rt = param.Dt / 2;
|
|
1370
1640
|
const aTooth = 2 * Math.PI / param.Nt;
|
|
1371
1641
|
const aAddenE = param.ate * aTooth / 100;
|
|
@@ -1390,9 +1660,9 @@ function ctrPlugExtern(param, RbEmax) {
|
|
|
1390
1660
|
}
|
|
1391
1661
|
const tooSmallAngle = 1e-4;
|
|
1392
1662
|
if (aAddE < tooSmallAngle || aDedE < tooSmallAngle) {
|
|
1393
|
-
throw `err164: aAddE ${
|
|
1663
|
+
throw `err164: aAddE ${ffix6(radToDeg5(aAddE))} or aDedE ${ffix6(radToDeg5(aDedE))} are too small`;
|
|
1394
1664
|
}
|
|
1395
|
-
const ctrToothE =
|
|
1665
|
+
const ctrToothE = contour6(RminE, 0);
|
|
1396
1666
|
for (let ii = 0; ii < param.Nt; ii++) {
|
|
1397
1667
|
const aRef = ii * aTooth;
|
|
1398
1668
|
ctrToothE.addSegStrokeAP(aRef + aSlopeE, RbE).addCornerRounded(param.Rae);
|
|
@@ -1414,42 +1684,42 @@ function ctrPlugExtern(param, RbEmax) {
|
|
|
1414
1684
|
}
|
|
1415
1685
|
|
|
1416
1686
|
// src/spring/plugTorque.ts
|
|
1417
|
-
var
|
|
1687
|
+
var pDef6 = {
|
|
1418
1688
|
partName: "plugTorque",
|
|
1419
1689
|
params: [
|
|
1420
1690
|
//pNumber(name, unit, init, min, max, step)
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1691
|
+
pNumber6("Nt", "teeth", 8, 1, 1e3, 1),
|
|
1692
|
+
pNumber6("Dt", "mm", 22, 0.1, 1e3, 0.1),
|
|
1693
|
+
pNumber6("Ht", "mm", 2, 0.1, 100, 0.1),
|
|
1694
|
+
pNumber6("Th", "mm", 1, 0.1, 100, 0.1),
|
|
1695
|
+
pDropdown3("make3D", ["both", "intern", "extern"]),
|
|
1696
|
+
pSectionSeparator6("Tooth profile"),
|
|
1697
|
+
pNumber6("ati", "%", 50, 1, 99, 0.1),
|
|
1698
|
+
pNumber6("ate", "%", 52, 1, 99, 1),
|
|
1699
|
+
pNumber6("ah", "%", 100, 1, 400, 1),
|
|
1700
|
+
pNumber6("dh", "%", 100, 1, 400, 1),
|
|
1701
|
+
pNumber6("aeh", "%", 10, 0, 100, 1),
|
|
1702
|
+
pNumber6("deh", "%", 10, 0, 100, 1),
|
|
1703
|
+
pNumber6("aM", "degree", 0, -30, 30, 0.1),
|
|
1704
|
+
pSectionSeparator6("Tooth profile details"),
|
|
1705
|
+
pDropdown3("SnAai", ["stroke", "arc"]),
|
|
1706
|
+
pDropdown3("SnAae", ["stroke", "arc"]),
|
|
1707
|
+
pDropdown3("SnAdi", ["stroke", "arc"]),
|
|
1708
|
+
pDropdown3("SnAde", ["stroke", "arc"]),
|
|
1709
|
+
pNumber6("Rai", "mm", 1, 0, 50, 0.1),
|
|
1710
|
+
pNumber6("Rae", "mm", 1, 0, 50, 0.1),
|
|
1711
|
+
pNumber6("Rdi", "mm", 1, 0, 50, 0.1),
|
|
1712
|
+
pNumber6("Rde", "mm", 1, 0, 50, 0.1),
|
|
1713
|
+
pSectionSeparator6("Internal part"),
|
|
1714
|
+
pNumber6("Ni", "holes", 5, 0, 1e3, 1),
|
|
1715
|
+
pNumber6("Di", "mm", 12, 0.1, 1e3, 0.1),
|
|
1716
|
+
pNumber6("DTi", "mm", 3, 0.1, 100, 0.1),
|
|
1717
|
+
pNumber6("Ei", "mm", 1, 0.1, 100, 0.1),
|
|
1718
|
+
pSectionSeparator6("External part"),
|
|
1719
|
+
pNumber6("Ne", "holes", 8, 0, 1e3, 1),
|
|
1720
|
+
pNumber6("De", "mm", 32, 0.1, 1e3, 0.1),
|
|
1721
|
+
pNumber6("DTe", "mm", 3, 0.1, 100, 0.1),
|
|
1722
|
+
pNumber6("Ee", "mm", 1, 0.1, 100, 0.1)
|
|
1453
1723
|
],
|
|
1454
1724
|
paramSvg: {
|
|
1455
1725
|
Nt: "plugTorque_teeth_radial.svg",
|
|
@@ -1488,14 +1758,14 @@ var pDef5 = {
|
|
|
1488
1758
|
// every 0.5 second
|
|
1489
1759
|
}
|
|
1490
1760
|
};
|
|
1491
|
-
function
|
|
1492
|
-
const rGeome =
|
|
1493
|
-
const figIntern =
|
|
1494
|
-
const figExtern =
|
|
1761
|
+
function pGeom6(t, param, suffix = "") {
|
|
1762
|
+
const rGeome = initGeom6(pDef6.partName + suffix);
|
|
1763
|
+
const figIntern = figure6();
|
|
1764
|
+
const figExtern = figure6();
|
|
1495
1765
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
1496
1766
|
`;
|
|
1497
1767
|
try {
|
|
1498
|
-
const aM =
|
|
1768
|
+
const aM = degToRad3(param.aM);
|
|
1499
1769
|
const Rt = param.Dt / 2;
|
|
1500
1770
|
const Ri = param.Di / 2;
|
|
1501
1771
|
const Re = param.De / 2;
|
|
@@ -1546,10 +1816,10 @@ function pGeom5(t, param, suffix = "") {
|
|
|
1546
1816
|
throw `err087: RminI ${RminI} is too small because of Di ${param.Di}, DTi ${param.DTi} or Ei ${param.Ei}`;
|
|
1547
1817
|
}
|
|
1548
1818
|
if (adTi < 2 * aMindTi) {
|
|
1549
|
-
throw `err131: adTi ${
|
|
1819
|
+
throw `err131: adTi ${ffix7(radToDeg6(adTi))} is too small compare to aMindTi ${ffix7(radToDeg6(aMindTi))} degree`;
|
|
1550
1820
|
}
|
|
1551
1821
|
if (adTe < 2 * aMindTe) {
|
|
1552
|
-
throw `err134: adTe ${
|
|
1822
|
+
throw `err134: adTe ${ffix7(radToDeg6(adTe))} is too small compare to aMindTe ${ffix7(radToDeg6(aMindTe))} degree`;
|
|
1553
1823
|
}
|
|
1554
1824
|
if (param.ati > param.ate) {
|
|
1555
1825
|
throw `err145: ate ${param.ate} is too small compare to ati ${param.ati} %`;
|
|
@@ -1562,22 +1832,22 @@ function pGeom5(t, param, suffix = "") {
|
|
|
1562
1832
|
}
|
|
1563
1833
|
const tooSmallAngle = 1e-4;
|
|
1564
1834
|
if (aAddI < tooSmallAngle || aDedI < tooSmallAngle) {
|
|
1565
|
-
throw `err161: aAddI ${
|
|
1835
|
+
throw `err161: aAddI ${ffix7(radToDeg6(aAddI))} or aDedI ${ffix7(radToDeg6(aDedI))} are too small`;
|
|
1566
1836
|
}
|
|
1567
1837
|
if (aAddE < tooSmallAngle || aDedE < tooSmallAngle) {
|
|
1568
|
-
throw `err164: aAddE ${
|
|
1838
|
+
throw `err164: aAddE ${ffix7(radToDeg6(aAddE))} or aDedE ${ffix7(radToDeg6(aDedE))} are too small`;
|
|
1569
1839
|
}
|
|
1570
|
-
rGeome.logstr += `Extern: Dmax ${
|
|
1840
|
+
rGeome.logstr += `Extern: Dmax ${ffix7(2 * RmaxE)}, Dmin ${ffix7(2 * RminE)} mm
|
|
1571
1841
|
`;
|
|
1572
|
-
rGeome.logstr += `Intern: Dmax ${
|
|
1842
|
+
rGeome.logstr += `Intern: Dmax ${ffix7(2 * RmaxI)}, Dmin ${ffix7(2 * RminI)} mm
|
|
1573
1843
|
`;
|
|
1574
|
-
rGeome.logstr += `aSlack: ${
|
|
1844
|
+
rGeome.logstr += `aSlack: ${ffix7(radToDeg6(aSlack))} degree
|
|
1575
1845
|
`;
|
|
1576
|
-
rGeome.logstr += `Tooth: Ht ${param.Ht}, moduli ${
|
|
1846
|
+
rGeome.logstr += `Tooth: Ht ${param.Ht}, moduli ${ffix7(moduli)}, Hti ${ffix7(Htai + Htdi)}, Hte ${ffix7(Htae + Htde)} mm
|
|
1577
1847
|
`;
|
|
1578
|
-
rGeome.logstr += `Tooth angle intern: aM ${param.aM}, aM[adden] ${
|
|
1848
|
+
rGeome.logstr += `Tooth angle intern: aM ${param.aM}, aM[adden] ${ffix7(radToDeg6(-aAddenI / 2))}, aM[deden] ${ffix7(radToDeg6((aTooth - aAddenI) / 2))} degree
|
|
1579
1849
|
`;
|
|
1580
|
-
rGeome.logstr += `Tooth angle extern: aM ${param.aM}, aM[adden] ${
|
|
1850
|
+
rGeome.logstr += `Tooth angle extern: aM ${param.aM}, aM[adden] ${ffix7(radToDeg6(-aAddenE / 2))}, aM[deden] ${ffix7(radToDeg6((aTooth - aAddenE) / 2))} degree
|
|
1581
1851
|
`;
|
|
1582
1852
|
const ctrsI = [];
|
|
1583
1853
|
ctrsI.push(contourCircle3(0, 0, RminI));
|
|
@@ -1585,7 +1855,7 @@ function pGeom5(t, param, suffix = "") {
|
|
|
1585
1855
|
const p1 = point3(0, 0).translatePolar(ii * adTi, Ri);
|
|
1586
1856
|
ctrsI.push(contourCircle3(p1.cx, p1.cy, RTi));
|
|
1587
1857
|
}
|
|
1588
|
-
const ctrToothI =
|
|
1858
|
+
const ctrToothI = contour7(RbI, 0);
|
|
1589
1859
|
for (let ii = 0; ii < param.Nt; ii++) {
|
|
1590
1860
|
const aRef = ii * aTooth;
|
|
1591
1861
|
ctrToothI.addSegStrokeAP(aRef + aSlopeI, RmaxI).addCornerRounded(param.Rai);
|
|
@@ -1648,7 +1918,7 @@ function pGeom5(t, param, suffix = "") {
|
|
|
1648
1918
|
{
|
|
1649
1919
|
outName: nameSubpaxIntern,
|
|
1650
1920
|
face: `${designName}_faceIntern`,
|
|
1651
|
-
extrudeMethod:
|
|
1921
|
+
extrudeMethod: EExtrude6.eLinearOrtho,
|
|
1652
1922
|
length: param.Th,
|
|
1653
1923
|
rotate: [0, 0, 0],
|
|
1654
1924
|
translate: [0, 0, 0]
|
|
@@ -1656,7 +1926,7 @@ function pGeom5(t, param, suffix = "") {
|
|
|
1656
1926
|
{
|
|
1657
1927
|
outName: nameSubpaxExtern,
|
|
1658
1928
|
face: `${designName}_faceExtern`,
|
|
1659
|
-
extrudeMethod:
|
|
1929
|
+
extrudeMethod: EExtrude6.eLinearOrtho,
|
|
1660
1930
|
length: param.Th,
|
|
1661
1931
|
rotate: [0, 0, -aSlack / 2],
|
|
1662
1932
|
translate: [0, 0, 0]
|
|
@@ -1665,7 +1935,7 @@ function pGeom5(t, param, suffix = "") {
|
|
|
1665
1935
|
volumes: [
|
|
1666
1936
|
{
|
|
1667
1937
|
outName: `pax_${designName}`,
|
|
1668
|
-
boolMethod:
|
|
1938
|
+
boolMethod: EBVolume6.eUnion,
|
|
1669
1939
|
inList: nameList
|
|
1670
1940
|
}
|
|
1671
1941
|
]
|
|
@@ -1682,66 +1952,66 @@ function pGeom5(t, param, suffix = "") {
|
|
|
1682
1952
|
var plugTorqueDef = {
|
|
1683
1953
|
pTitle: "plugTorque",
|
|
1684
1954
|
pDescription: "plugable torque transmission",
|
|
1685
|
-
pDef:
|
|
1686
|
-
pGeom:
|
|
1955
|
+
pDef: pDef6,
|
|
1956
|
+
pGeom: pGeom6
|
|
1687
1957
|
};
|
|
1688
1958
|
|
|
1689
1959
|
// src/spring/springTorqueB.ts
|
|
1690
1960
|
import {
|
|
1691
1961
|
withinZeroPi,
|
|
1692
1962
|
point as point4,
|
|
1693
|
-
contour as
|
|
1963
|
+
contour as contour8,
|
|
1694
1964
|
contourCircle as contourCircle4,
|
|
1695
|
-
figure as
|
|
1696
|
-
radToDeg as
|
|
1697
|
-
ffix as
|
|
1698
|
-
pNumber as
|
|
1699
|
-
pCheckbox as
|
|
1700
|
-
pDropdown as
|
|
1701
|
-
pSectionSeparator as
|
|
1702
|
-
EExtrude as
|
|
1703
|
-
EBVolume as
|
|
1704
|
-
initGeom as
|
|
1965
|
+
figure as figure7,
|
|
1966
|
+
radToDeg as radToDeg7,
|
|
1967
|
+
ffix as ffix8,
|
|
1968
|
+
pNumber as pNumber7,
|
|
1969
|
+
pCheckbox as pCheckbox4,
|
|
1970
|
+
pDropdown as pDropdown4,
|
|
1971
|
+
pSectionSeparator as pSectionSeparator7,
|
|
1972
|
+
EExtrude as EExtrude7,
|
|
1973
|
+
EBVolume as EBVolume7,
|
|
1974
|
+
initGeom as initGeom7
|
|
1705
1975
|
} from "geometrix";
|
|
1706
|
-
var
|
|
1976
|
+
var pDef7 = {
|
|
1707
1977
|
partName: "springTorqueB",
|
|
1708
1978
|
params: [
|
|
1709
1979
|
//pNumber(name, unit, init, min, max, step)
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1980
|
+
pNumber7("De", "mm", 80, 1, 1e3, 1),
|
|
1981
|
+
pNumber7("Ne", "hole", 16, 0, 400, 1),
|
|
1982
|
+
pNumber7("DTe", "mm", 2, 0.1, 50, 0.1),
|
|
1983
|
+
pNumber7("Ee", "mm", 1, 0.1, 50, 0.1),
|
|
1984
|
+
pCheckbox4("Teeth", true),
|
|
1985
|
+
pNumber7("Th", "mm", 3, 0.1, 100, 0.1),
|
|
1986
|
+
pSectionSeparator7("Internal ring"),
|
|
1987
|
+
pNumber7("Di", "mm", 30, 1, 1e3, 1),
|
|
1988
|
+
pNumber7("Ni", "hole", 8, 0, 400, 1),
|
|
1989
|
+
pNumber7("DTi", "mm", 2, 0.1, 50, 0.1),
|
|
1990
|
+
pNumber7("Ei", "mm", 1, 0.1, 50, 0.1),
|
|
1991
|
+
pSectionSeparator7("Spring"),
|
|
1992
|
+
pNumber7("Ns", "spring", 6, 4, 60, 1),
|
|
1993
|
+
pNumber7("aEs", "%", 10, 1, 90, 1),
|
|
1994
|
+
pNumber7("Esi", "%", 10, 1, 90, 1),
|
|
1995
|
+
pNumber7("Ese", "%", 10, 1, 90, 1),
|
|
1996
|
+
pNumber7("Nk", "zigzag", 3, 1, 100, 1),
|
|
1997
|
+
pNumber7("Wk", "mm", 1, 0.1, 20, 0.1),
|
|
1998
|
+
pNumber7("Wc", "mm", 1, 0.1, 20, 0.1),
|
|
1999
|
+
pNumber7("Rrsi", "mm", 1, 0, 20, 0.1),
|
|
2000
|
+
pNumber7("Rrse", "mm", 1, 0, 20, 0.1),
|
|
2001
|
+
pSectionSeparator7("Tooth Profile"),
|
|
2002
|
+
pNumber7("Nt", "teeth", 8, 1, 1e3, 1),
|
|
2003
|
+
pNumber7("Dt", "mm", 20, 0.1, 1e3, 0.1),
|
|
2004
|
+
pNumber7("Ht", "mm", 2, 0.1, 100, 0.1),
|
|
2005
|
+
pNumber7("ate", "%", 52, 1, 99, 1),
|
|
2006
|
+
pNumber7("ah", "%", 100, 1, 400, 1),
|
|
2007
|
+
pNumber7("dh", "%", 100, 1, 400, 1),
|
|
2008
|
+
pNumber7("aeh", "%", 10, 0, 100, 1),
|
|
2009
|
+
pNumber7("aM", "degree", 0, -30, 30, 0.1),
|
|
2010
|
+
pSectionSeparator7("Tooth profile details"),
|
|
2011
|
+
pDropdown4("SnAae", ["stroke", "arc"]),
|
|
2012
|
+
pDropdown4("SnAde", ["stroke", "arc"]),
|
|
2013
|
+
pNumber7("Rae", "mm", 1, 0, 50, 0.1),
|
|
2014
|
+
pNumber7("Rde", "mm", 1, 0, 50, 0.1)
|
|
1745
2015
|
],
|
|
1746
2016
|
paramSvg: {
|
|
1747
2017
|
De: "springTorqueB_profile.svg",
|
|
@@ -1813,9 +2083,9 @@ function calcAzag(cx2, cx1, r2, r1) {
|
|
|
1813
2083
|
}
|
|
1814
2084
|
return [ra22, ra11];
|
|
1815
2085
|
}
|
|
1816
|
-
function
|
|
1817
|
-
const rGeome =
|
|
1818
|
-
const figProfile =
|
|
2086
|
+
function pGeom7(t, param, suffix = "") {
|
|
2087
|
+
const rGeome = initGeom7(pDef7.partName + suffix);
|
|
2088
|
+
const figProfile = figure7();
|
|
1819
2089
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
1820
2090
|
`;
|
|
1821
2091
|
try {
|
|
@@ -1841,14 +2111,14 @@ function pGeom6(t, param, suffix = "") {
|
|
|
1841
2111
|
if (Rmin1 < 0.1) {
|
|
1842
2112
|
throw `err120: Di ${param.Di} is too small compare to DTi ${param.DTi}, Ei ${param.Ei}`;
|
|
1843
2113
|
}
|
|
1844
|
-
if (dRLs < 2 * param.
|
|
1845
|
-
throw `err133: dRLs ${dRLs} is too small compare to
|
|
2114
|
+
if (dRLs < 2 * param.Wk) {
|
|
2115
|
+
throw `err133: dRLs ${dRLs} is too small compare to Wk ${param.Wk}`;
|
|
1846
2116
|
}
|
|
1847
|
-
if (Esi < 0.6 * param.
|
|
1848
|
-
throw `err136: Esi ${Esi} is too small compare to
|
|
2117
|
+
if (Esi < 0.6 * param.Wk) {
|
|
2118
|
+
throw `err136: Esi ${Esi} is too small compare to Wk ${param.Wk}`;
|
|
1849
2119
|
}
|
|
1850
|
-
if (Ese < 0.6 * param.
|
|
1851
|
-
throw `err139: Ese ${Ese} is too small compare to
|
|
2120
|
+
if (Ese < 0.6 * param.Wk) {
|
|
2121
|
+
throw `err139: Ese ${Ese} is too small compare to Wk ${param.Wk}`;
|
|
1852
2122
|
}
|
|
1853
2123
|
if (Ek < 0.1) {
|
|
1854
2124
|
throw `err145: Ek ${Ek} is too small`;
|
|
@@ -1859,12 +2129,12 @@ function pGeom6(t, param, suffix = "") {
|
|
|
1859
2129
|
const aHMinI = 2 * Math.asin((RTi + 0.5 * param.Ei) / Ri);
|
|
1860
2130
|
const aHI = param.Ni > 0 ? 2 * Math.PI / param.Ni : 3.14;
|
|
1861
2131
|
if (aHI < aHMinI) {
|
|
1862
|
-
throw `err126: aHI ${
|
|
2132
|
+
throw `err126: aHI ${ffix8(radToDeg7(aHI))} is too small compare to aHMinI ${ffix8(radToDeg7(aHMinI))} degree`;
|
|
1863
2133
|
}
|
|
1864
2134
|
const aHMinE = 2 * Math.asin((RTe + 0.5 * param.Ee) / Re);
|
|
1865
2135
|
const aHE = param.Ne > 0 ? 2 * Math.PI / param.Ne : 3.14;
|
|
1866
2136
|
if (aHE < aHMinE) {
|
|
1867
|
-
throw `err131: aHE ${
|
|
2137
|
+
throw `err131: aHE ${ffix8(radToDeg7(aHE))} is too small compare to aHMinE ${ffix8(radToDeg7(aHMinE))} degree`;
|
|
1868
2138
|
}
|
|
1869
2139
|
const pts1 = [];
|
|
1870
2140
|
const Rk1 = Rsi + Esi + dRLs - Rk;
|
|
@@ -1894,11 +2164,11 @@ function pGeom6(t, param, suffix = "") {
|
|
|
1894
2164
|
const pt4 = point4(0, 0).translatePolar(-a14, Rsi);
|
|
1895
2165
|
const Rks = Rk - Wk2;
|
|
1896
2166
|
const Rkl = Rk + Wk2;
|
|
1897
|
-
rGeome.logstr += `Dmax ${
|
|
2167
|
+
rGeome.logstr += `Dmax ${ffix8(2 * Rmax)}, Dmin1 ${ffix8(2 * Rmin1)} mm
|
|
1898
2168
|
`;
|
|
1899
|
-
rGeome.logstr += `Spring area: aSpring ${
|
|
2169
|
+
rGeome.logstr += `Spring area: aSpring ${ffix8(radToDeg7(aSpring))} degree, dRLs ${ffix8(dRLs)}, HLs ${ffix8(HLs)} mm
|
|
1900
2170
|
`;
|
|
1901
|
-
rGeome.logstr += `Spring zigzag: Ek ${
|
|
2171
|
+
rGeome.logstr += `Spring zigzag: Ek ${ffix8(Ek)}, Rk ${ffix8(Rk)} mm
|
|
1902
2172
|
`;
|
|
1903
2173
|
const ctrExt = contourCircle4(0, 0, Rmax);
|
|
1904
2174
|
const ctrsH = [];
|
|
@@ -1917,7 +2187,7 @@ function pGeom6(t, param, suffix = "") {
|
|
|
1917
2187
|
const p1 = point4(0, 0).translatePolar(ii * aHE, Re);
|
|
1918
2188
|
ctrsH.push(contourCircle4(p1.cx, p1.cy, RTe));
|
|
1919
2189
|
}
|
|
1920
|
-
const ctrSpringEnv =
|
|
2190
|
+
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();
|
|
1921
2191
|
figProfile.addSecond(ctrSpringEnv);
|
|
1922
2192
|
figProfile.addSecond(ctrSpringEnv.rotate(0, 0, aSpringStep));
|
|
1923
2193
|
figProfile.addSecond(ctrSpringEnv.rotate(0, 0, -aSpringStep));
|
|
@@ -1925,7 +2195,7 @@ function pGeom6(t, param, suffix = "") {
|
|
|
1925
2195
|
figProfile.addSecond(contourCircle4(pts1[ii].cx, pts1[ii].cy, Rk));
|
|
1926
2196
|
figProfile.addSecond(contourCircle4(pts2[ii].cx, pts2[ii].cy, Rk));
|
|
1927
2197
|
}
|
|
1928
|
-
const ctrPartial1 =
|
|
2198
|
+
const ctrPartial1 = contour8(pt1.cx, pt1.cy);
|
|
1929
2199
|
for (let ii = 0; ii < param.Nk; ii++) {
|
|
1930
2200
|
let a11 = -Math.PI / 2;
|
|
1931
2201
|
const [a12, a21] = calcAzig(pts1[ii].cx, pts2[ii].cx, Rks, Rkl);
|
|
@@ -1959,7 +2229,7 @@ function pGeom6(t, param, suffix = "") {
|
|
|
1959
2229
|
ctrPartial1.addPointA(pt2b.cx, pt2b.cy).addPointA(pt2c.cx, pt2c.cy).addSegArc2().addSegStrokeA(pt2.cx, pt2.cy);
|
|
1960
2230
|
const [, firsta22] = calcAzig(pts1[param.Nk - 1].cx, pts2[param.Nk - 1].cx, Rkl, Rks);
|
|
1961
2231
|
const firstp22 = pts2[param.Nk - 1].translatePolar(firsta22, Rks);
|
|
1962
|
-
const ctrPartial2 =
|
|
2232
|
+
const ctrPartial2 = contour8(pt3.cx, pt3.cy).addSegStrokeA(pt3c.cx, pt3c.cy).addPointA(pt3b.cx, pt3b.cy).addPointA(firstp22.cx, firstp22.cy).addSegArc2();
|
|
1963
2233
|
for (let ii = param.Nk - 1; ii >= 0; ii--) {
|
|
1964
2234
|
let a21 = Math.PI / 2;
|
|
1965
2235
|
let a12 = -Math.PI / 2;
|
|
@@ -1984,7 +2254,7 @@ function pGeom6(t, param, suffix = "") {
|
|
|
1984
2254
|
ctrPartial2.addSegStrokeA(p11.cx, p11.cy).addPointA(p1b.cx, p1b.cy).addPointA(p12.cx, p12.cy).addSegArc2();
|
|
1985
2255
|
}
|
|
1986
2256
|
ctrPartial2.addSegStrokeA(pt4.cx, pt4.cy);
|
|
1987
|
-
const ctrSpringHollow =
|
|
2257
|
+
const ctrSpringHollow = contour8(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();
|
|
1988
2258
|
for (let ii = 0; ii < param.Ns; ii++) {
|
|
1989
2259
|
ctrsH.push(ctrSpringHollow.rotate(0, 0, ii * aSpringStep));
|
|
1990
2260
|
}
|
|
@@ -1998,7 +2268,7 @@ function pGeom6(t, param, suffix = "") {
|
|
|
1998
2268
|
{
|
|
1999
2269
|
outName: `subpax_${designName}_profile`,
|
|
2000
2270
|
face: `${designName}_faceProfile`,
|
|
2001
|
-
extrudeMethod:
|
|
2271
|
+
extrudeMethod: EExtrude7.eLinearOrtho,
|
|
2002
2272
|
length: param.Th,
|
|
2003
2273
|
rotate: [0, 0, 0],
|
|
2004
2274
|
translate: [0, 0, 0]
|
|
@@ -2007,7 +2277,7 @@ function pGeom6(t, param, suffix = "") {
|
|
|
2007
2277
|
volumes: [
|
|
2008
2278
|
{
|
|
2009
2279
|
outName: `pax_${designName}`,
|
|
2010
|
-
boolMethod:
|
|
2280
|
+
boolMethod: EBVolume7.eIdentity,
|
|
2011
2281
|
inList: [`subpax_${designName}_profile`]
|
|
2012
2282
|
}
|
|
2013
2283
|
]
|
|
@@ -2024,66 +2294,66 @@ function pGeom6(t, param, suffix = "") {
|
|
|
2024
2294
|
var springTorqueBDef = {
|
|
2025
2295
|
pTitle: "springTorqueB",
|
|
2026
2296
|
pDescription: "spring disc for smooth torque transmission",
|
|
2027
|
-
pDef:
|
|
2028
|
-
pGeom:
|
|
2297
|
+
pDef: pDef7,
|
|
2298
|
+
pGeom: pGeom7
|
|
2029
2299
|
};
|
|
2030
2300
|
|
|
2031
2301
|
// src/spring/springTorqueC.ts
|
|
2032
2302
|
import {
|
|
2033
2303
|
point as point5,
|
|
2034
|
-
contour as
|
|
2304
|
+
contour as contour9,
|
|
2035
2305
|
contourCircle as contourCircle5,
|
|
2036
|
-
figure as
|
|
2037
|
-
radToDeg as
|
|
2038
|
-
ffix as
|
|
2039
|
-
pNumber as
|
|
2040
|
-
pCheckbox as
|
|
2041
|
-
pDropdown as
|
|
2042
|
-
pSectionSeparator as
|
|
2043
|
-
EExtrude as
|
|
2044
|
-
EBVolume as
|
|
2045
|
-
initGeom as
|
|
2306
|
+
figure as figure8,
|
|
2307
|
+
radToDeg as radToDeg8,
|
|
2308
|
+
ffix as ffix9,
|
|
2309
|
+
pNumber as pNumber8,
|
|
2310
|
+
pCheckbox as pCheckbox5,
|
|
2311
|
+
pDropdown as pDropdown5,
|
|
2312
|
+
pSectionSeparator as pSectionSeparator8,
|
|
2313
|
+
EExtrude as EExtrude8,
|
|
2314
|
+
EBVolume as EBVolume8,
|
|
2315
|
+
initGeom as initGeom8
|
|
2046
2316
|
} from "geometrix";
|
|
2047
|
-
var
|
|
2317
|
+
var pDef8 = {
|
|
2048
2318
|
partName: "springTorqueC",
|
|
2049
2319
|
params: [
|
|
2050
2320
|
//pNumber(name, unit, init, min, max, step)
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2321
|
+
pNumber8("De", "mm", 80, 1, 1e3, 1),
|
|
2322
|
+
pNumber8("Ne", "hole", 16, 0, 400, 1),
|
|
2323
|
+
pNumber8("DTe", "mm", 2, 0.1, 50, 0.1),
|
|
2324
|
+
pNumber8("Ee", "mm", 1, 0.1, 50, 0.1),
|
|
2325
|
+
pCheckbox5("Teeth", true),
|
|
2326
|
+
pNumber8("Th", "mm", 3, 0.1, 100, 0.1),
|
|
2327
|
+
pSectionSeparator8("Internal ring"),
|
|
2328
|
+
pNumber8("Di", "mm", 30, 1, 1e3, 1),
|
|
2329
|
+
pNumber8("Ni", "hole", 8, 0, 400, 1),
|
|
2330
|
+
pNumber8("DTi", "mm", 2, 0.1, 50, 0.1),
|
|
2331
|
+
pNumber8("Ei", "mm", 1, 0.1, 50, 0.1),
|
|
2332
|
+
pSectionSeparator8("Spring"),
|
|
2333
|
+
pNumber8("Ns", "spring", 6, 1, 60, 1),
|
|
2334
|
+
pDropdown5("zig", ["alt", "one", "two"]),
|
|
2335
|
+
pDropdown5("zag", ["arc", "stroke"]),
|
|
2336
|
+
pNumber8("aEs", "%", 20, 1, 99, 1),
|
|
2337
|
+
pNumber8("Esi", "%", 10, 0, 90, 1),
|
|
2338
|
+
pNumber8("Ese", "%", 10, 0, 90, 1),
|
|
2339
|
+
pNumber8("Nk", "zigzag", 4, 2, 100, 1),
|
|
2340
|
+
pNumber8("Wk", "mm", 1, 0.1, 20, 0.1),
|
|
2341
|
+
pNumber8("Rrsi", "mm", 0.1, 0, 20, 0.1),
|
|
2342
|
+
pNumber8("Rrse", "mm", 1, 0, 20, 0.1),
|
|
2343
|
+
pSectionSeparator8("Tooth Profile"),
|
|
2344
|
+
pNumber8("Nt", "teeth", 8, 1, 1e3, 1),
|
|
2345
|
+
pNumber8("Dt", "mm", 20, 0.1, 1e3, 0.1),
|
|
2346
|
+
pNumber8("Ht", "mm", 2, 0.1, 100, 0.1),
|
|
2347
|
+
pNumber8("ate", "%", 52, 1, 99, 1),
|
|
2348
|
+
pNumber8("ah", "%", 100, 1, 400, 1),
|
|
2349
|
+
pNumber8("dh", "%", 100, 1, 400, 1),
|
|
2350
|
+
pNumber8("aeh", "%", 10, 0, 100, 1),
|
|
2351
|
+
pNumber8("aM", "degree", 0, -30, 30, 0.1),
|
|
2352
|
+
pSectionSeparator8("Tooth profile details"),
|
|
2353
|
+
pDropdown5("SnAae", ["stroke", "arc"]),
|
|
2354
|
+
pDropdown5("SnAde", ["stroke", "arc"]),
|
|
2355
|
+
pNumber8("Rae", "mm", 1, 0, 50, 0.1),
|
|
2356
|
+
pNumber8("Rde", "mm", 1, 0, 50, 0.1)
|
|
2087
2357
|
],
|
|
2088
2358
|
paramSvg: {
|
|
2089
2359
|
De: "springTorqueC_profile.svg",
|
|
@@ -2136,9 +2406,9 @@ function calcZagP2(pA, pE, lAB, lDE, iSign) {
|
|
|
2136
2406
|
const rPt = pA.translatePolar(aAE + iSign * aCAB, lAB);
|
|
2137
2407
|
return rPt;
|
|
2138
2408
|
}
|
|
2139
|
-
function
|
|
2140
|
-
const rGeome =
|
|
2141
|
-
const figProfile =
|
|
2409
|
+
function pGeom8(t, param, suffix = "") {
|
|
2410
|
+
const rGeome = initGeom8(pDef8.partName + suffix);
|
|
2411
|
+
const figProfile = figure8();
|
|
2142
2412
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
2143
2413
|
`;
|
|
2144
2414
|
try {
|
|
@@ -2183,7 +2453,7 @@ function pGeom7(t, param, suffix = "") {
|
|
|
2183
2453
|
const aStart1 = iParity === 0 ? -Math.PI / 2 : Math.PI / 2 + aSpring;
|
|
2184
2454
|
const siRk = iParity === 0 ? Rks : Rkl;
|
|
2185
2455
|
const startPt1 = pts[0].translatePolar(aStart1, siRk);
|
|
2186
|
-
const rCtr =
|
|
2456
|
+
const rCtr = contour9(startPt1.cx, startPt1.cy);
|
|
2187
2457
|
for (let ii = 0; ii < param.Nk; ii++) {
|
|
2188
2458
|
const iiParity3 = (ii + iParity) % 2;
|
|
2189
2459
|
const apt = Math.atan2(pts[ii].cy, pts[ii].cx);
|
|
@@ -2233,7 +2503,7 @@ function pGeom7(t, param, suffix = "") {
|
|
|
2233
2503
|
const aStart1 = eParity === 0 ? -Math.PI / 2 : Math.PI / 2 + aSpring;
|
|
2234
2504
|
const siRk = eParity === 0 ? Rkl : Rks;
|
|
2235
2505
|
const startPt1 = pts[param.Nk - 1].translatePolar(aStart1, siRk);
|
|
2236
|
-
const rCtr =
|
|
2506
|
+
const rCtr = contour9(startPt1.cx, startPt1.cy);
|
|
2237
2507
|
for (let ii = param.Nk - 1; ii >= 0; ii--) {
|
|
2238
2508
|
const iiParity3 = (ii + iParity) % 2;
|
|
2239
2509
|
const apt = Math.atan2(pts[ii].cy, pts[ii].cx);
|
|
@@ -2282,7 +2552,7 @@ function pGeom7(t, param, suffix = "") {
|
|
|
2282
2552
|
const pp1 = ip1 === 0 ? ppp0 : ppp1;
|
|
2283
2553
|
const pp2 = ip2 === 0 ? ppp0 : ppp1;
|
|
2284
2554
|
const [ppib, ppeb] = pppb2(ip1, ip2);
|
|
2285
|
-
const ctr =
|
|
2555
|
+
const ctr = contour9(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();
|
|
2286
2556
|
return ctr.rotate(0, 0, ii * aSpringStep);
|
|
2287
2557
|
};
|
|
2288
2558
|
var prePoints = prePoints2, pppI = pppI2, externParity = externParity2, pppE = pppE2, iiParity = iiParity2, pppb = pppb2, ctrPartial1 = ctrPartial12, ctrPartial2 = ctrPartial22, ctrSpringHollow = ctrSpringHollow2;
|
|
@@ -2306,8 +2576,8 @@ function pGeom7(t, param, suffix = "") {
|
|
|
2306
2576
|
if (Rmin1 < 0.1) {
|
|
2307
2577
|
throw `err120: Di ${param.Di} is too small compare to DTi ${param.DTi}, Ei ${param.Ei}`;
|
|
2308
2578
|
}
|
|
2309
|
-
if (dRLs < 2 * param.
|
|
2310
|
-
throw `err133: dRLs ${dRLs} is too small compare to
|
|
2579
|
+
if (dRLs < 2 * param.Wk) {
|
|
2580
|
+
throw `err133: dRLs ${dRLs} is too small compare to Wk ${param.Wk}`;
|
|
2311
2581
|
}
|
|
2312
2582
|
if (Esi < 0.2 * param.Rrsi) {
|
|
2313
2583
|
throw `err136: Esi ${Esi} is too small compare to Rrsi ${param.Rrsi}`;
|
|
@@ -2321,12 +2591,12 @@ function pGeom7(t, param, suffix = "") {
|
|
|
2321
2591
|
const aHMinI = 2 * Math.asin((RTi + 0.5 * param.Ei) / Ri);
|
|
2322
2592
|
const aHI = param.Ni > 0 ? 2 * Math.PI / param.Ni : 3.14;
|
|
2323
2593
|
if (aHI < aHMinI) {
|
|
2324
|
-
throw `err126: aHI ${
|
|
2594
|
+
throw `err126: aHI ${ffix9(radToDeg8(aHI))} is too small compare to aHMinI ${ffix9(radToDeg8(aHMinI))} degree`;
|
|
2325
2595
|
}
|
|
2326
2596
|
const aHMinE = 2 * Math.asin((RTe + 0.5 * param.Ee) / Re);
|
|
2327
2597
|
const aHE = param.Ne > 0 ? 2 * Math.PI / param.Ne : 3.14;
|
|
2328
2598
|
if (aHE < aHMinE) {
|
|
2329
|
-
throw `err131: aHE ${
|
|
2599
|
+
throw `err131: aHE ${ffix9(radToDeg8(aHE))} is too small compare to aHMinE ${ffix9(radToDeg8(aHMinE))} degree`;
|
|
2330
2600
|
}
|
|
2331
2601
|
const pts0 = [];
|
|
2332
2602
|
const pts1 = [];
|
|
@@ -2370,15 +2640,15 @@ function pGeom7(t, param, suffix = "") {
|
|
|
2370
2640
|
ppp1.push(pppI2(-a18, 1, Rsi).rotateOrig(aSpringStep));
|
|
2371
2641
|
const Rks = Rk - Wk2;
|
|
2372
2642
|
const Rkl = Rk + Wk2;
|
|
2373
|
-
rGeome.logstr += `Dmax ${
|
|
2643
|
+
rGeome.logstr += `Dmax ${ffix9(2 * Rmax)}, Dmin1 ${ffix9(2 * Rmin1)} mm
|
|
2374
2644
|
`;
|
|
2375
|
-
rGeome.logstr += `Spring area: aSpring ${
|
|
2645
|
+
rGeome.logstr += `Spring area: aSpring ${ffix9(radToDeg8(aSpring))} degree, dRLs ${ffix9(dRLs)} mm
|
|
2376
2646
|
`;
|
|
2377
|
-
rGeome.logstr += `Spring zigzag: Ek ${
|
|
2647
|
+
rGeome.logstr += `Spring zigzag: Ek ${ffix9(Ek)}, Rk ${ffix9(Rk)} mm
|
|
2378
2648
|
`;
|
|
2379
2649
|
if (aSpring < 2 * aArcMin) {
|
|
2380
2650
|
zagArc = false;
|
|
2381
|
-
rGeome.logstr += `Spring zigzag forced to stroke because of aArcMin ${
|
|
2651
|
+
rGeome.logstr += `Spring zigzag forced to stroke because of aArcMin ${ffix9(radToDeg8(aArcMin))} degree
|
|
2382
2652
|
`;
|
|
2383
2653
|
}
|
|
2384
2654
|
const ctrExt = contourCircle5(0, 0, Rmax);
|
|
@@ -2398,7 +2668,7 @@ function pGeom7(t, param, suffix = "") {
|
|
|
2398
2668
|
const p1 = point5(0, 0).translatePolar(ii * aHE, Re);
|
|
2399
2669
|
ctrsH.push(contourCircle5(p1.cx, p1.cy, RTe));
|
|
2400
2670
|
}
|
|
2401
|
-
const ctrSpringEnv =
|
|
2671
|
+
const ctrSpringEnv = contour9(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();
|
|
2402
2672
|
figProfile.addSecond(ctrSpringEnv);
|
|
2403
2673
|
figProfile.addSecond(ctrSpringEnv.rotate(0, 0, aSpringStep));
|
|
2404
2674
|
figProfile.addSecond(ctrSpringEnv.rotate(0, 0, -aSpringStep));
|
|
@@ -2423,7 +2693,7 @@ function pGeom7(t, param, suffix = "") {
|
|
|
2423
2693
|
{
|
|
2424
2694
|
outName: `subpax_${designName}_profile`,
|
|
2425
2695
|
face: `${designName}_faceProfile`,
|
|
2426
|
-
extrudeMethod:
|
|
2696
|
+
extrudeMethod: EExtrude8.eLinearOrtho,
|
|
2427
2697
|
length: param.Th,
|
|
2428
2698
|
rotate: [0, 0, 0],
|
|
2429
2699
|
translate: [0, 0, 0]
|
|
@@ -2432,7 +2702,7 @@ function pGeom7(t, param, suffix = "") {
|
|
|
2432
2702
|
volumes: [
|
|
2433
2703
|
{
|
|
2434
2704
|
outName: `pax_${designName}`,
|
|
2435
|
-
boolMethod:
|
|
2705
|
+
boolMethod: EBVolume8.eIdentity,
|
|
2436
2706
|
inList: [`subpax_${designName}_profile`]
|
|
2437
2707
|
}
|
|
2438
2708
|
]
|
|
@@ -2449,64 +2719,64 @@ function pGeom7(t, param, suffix = "") {
|
|
|
2449
2719
|
var springTorqueCDef = {
|
|
2450
2720
|
pTitle: "springTorqueC",
|
|
2451
2721
|
pDescription: "spring disc for smooth torque transmission",
|
|
2452
|
-
pDef:
|
|
2453
|
-
pGeom:
|
|
2722
|
+
pDef: pDef8,
|
|
2723
|
+
pGeom: pGeom8
|
|
2454
2724
|
};
|
|
2455
2725
|
|
|
2456
2726
|
// src/spring/springWorm.ts
|
|
2457
2727
|
import {
|
|
2458
|
-
contour as
|
|
2728
|
+
contour as contour10,
|
|
2459
2729
|
contourCircle as contourCircle6,
|
|
2460
|
-
ctrRectangle as
|
|
2461
|
-
figure as
|
|
2462
|
-
ffix as
|
|
2463
|
-
pNumber as
|
|
2464
|
-
pDropdown as
|
|
2465
|
-
pSectionSeparator as
|
|
2466
|
-
EExtrude as
|
|
2467
|
-
EBVolume as
|
|
2468
|
-
initGeom as
|
|
2730
|
+
ctrRectangle as ctrRectangle5,
|
|
2731
|
+
figure as figure9,
|
|
2732
|
+
ffix as ffix10,
|
|
2733
|
+
pNumber as pNumber9,
|
|
2734
|
+
pDropdown as pDropdown6,
|
|
2735
|
+
pSectionSeparator as pSectionSeparator9,
|
|
2736
|
+
EExtrude as EExtrude9,
|
|
2737
|
+
EBVolume as EBVolume9,
|
|
2738
|
+
initGeom as initGeom9
|
|
2469
2739
|
} from "geometrix";
|
|
2470
2740
|
function makeCtrGroove(x0, y0, xl, yl, roundTop) {
|
|
2471
2741
|
const xl2 = xl / 2;
|
|
2472
2742
|
const yl2 = yl - xl2;
|
|
2473
2743
|
if (roundTop) {
|
|
2474
|
-
const rCtr =
|
|
2744
|
+
const rCtr = contour10(x0, y0).addSegStrokeR(xl, 0).addSegStrokeR(0, yl2).addPointR(-xl2, xl2).addPointR(-xl, 0).addSegArc2().closeSegStroke();
|
|
2475
2745
|
return rCtr;
|
|
2476
2746
|
} else {
|
|
2477
|
-
const rCtr =
|
|
2747
|
+
const rCtr = contour10(x0, y0 + xl2).addPointR(xl2, -xl2).addPointR(xl, 0).addSegArc2().addSegStrokeR(0, yl2).addSegStrokeR(-xl, 0).closeSegStroke();
|
|
2478
2748
|
return rCtr;
|
|
2479
2749
|
}
|
|
2480
2750
|
}
|
|
2481
|
-
var
|
|
2751
|
+
var pDef9 = {
|
|
2482
2752
|
partName: "springWorm",
|
|
2483
2753
|
params: [
|
|
2484
2754
|
//pNumber(name, unit, init, min, max, step)
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2755
|
+
pNumber9("D1", "mm", 30, 2, 200, 1),
|
|
2756
|
+
pNumber9("E1", "mm", 2, 0.1, 50, 0.1),
|
|
2757
|
+
pNumber9("N1", "groove", 6, 2, 200, 1),
|
|
2758
|
+
pNumber9("W2", "mm", 2, 0.1, 50, 0.1),
|
|
2759
|
+
pNumber9("W3", "mm", 1, 0.1, 50, 0.1),
|
|
2760
|
+
pNumber9("S1", "mm", 1, 0.1, 50, 0.1),
|
|
2761
|
+
pSectionSeparator9("Extremity caps"),
|
|
2762
|
+
pDropdown6("leftCaps", ["ext", "int"]),
|
|
2763
|
+
pDropdown6("rightCaps", ["ext", "int"]),
|
|
2764
|
+
pNumber9("W1", "mm", 2, 0.1, 50, 0.1),
|
|
2765
|
+
pNumber9("W1b", "mm", 1, 0.1, 50, 0.1),
|
|
2766
|
+
pSectionSeparator9("Tooth Profile"),
|
|
2767
|
+
pNumber9("Nt", "teeth", 8, 1, 1e3, 1),
|
|
2768
|
+
pNumber9("Dt", "mm", 20, 0.1, 1e3, 0.1),
|
|
2769
|
+
pNumber9("Ht", "mm", 2, 0.1, 100, 0.1),
|
|
2770
|
+
pNumber9("ate", "%", 52, 1, 99, 1),
|
|
2771
|
+
pNumber9("ah", "%", 100, 1, 400, 1),
|
|
2772
|
+
pNumber9("dh", "%", 100, 1, 400, 1),
|
|
2773
|
+
pNumber9("aeh", "%", 10, 0, 100, 1),
|
|
2774
|
+
pNumber9("aM", "degree", 0, -30, 30, 0.1),
|
|
2775
|
+
pSectionSeparator9("Tooth profile details"),
|
|
2776
|
+
pDropdown6("SnAae", ["stroke", "arc"]),
|
|
2777
|
+
pDropdown6("SnAde", ["stroke", "arc"]),
|
|
2778
|
+
pNumber9("Rae", "mm", 1, 0, 50, 0.1),
|
|
2779
|
+
pNumber9("Rde", "mm", 1, 0, 50, 0.1)
|
|
2510
2780
|
],
|
|
2511
2781
|
paramSvg: {
|
|
2512
2782
|
D1: "springWorm_mid.svg",
|
|
@@ -2539,14 +2809,14 @@ var pDef8 = {
|
|
|
2539
2809
|
// every 0.5 second
|
|
2540
2810
|
}
|
|
2541
2811
|
};
|
|
2542
|
-
function
|
|
2543
|
-
const rGeome =
|
|
2544
|
-
const figTube =
|
|
2545
|
-
const figGroove1 =
|
|
2546
|
-
const figGroove2 =
|
|
2547
|
-
const figLeft =
|
|
2548
|
-
const figRight =
|
|
2549
|
-
const figW1b =
|
|
2812
|
+
function pGeom9(t, param, suffix = "") {
|
|
2813
|
+
const rGeome = initGeom9(pDef9.partName + suffix);
|
|
2814
|
+
const figTube = figure9();
|
|
2815
|
+
const figGroove1 = figure9();
|
|
2816
|
+
const figGroove2 = figure9();
|
|
2817
|
+
const figLeft = figure9();
|
|
2818
|
+
const figRight = figure9();
|
|
2819
|
+
const figW1b = figure9();
|
|
2550
2820
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
2551
2821
|
`;
|
|
2552
2822
|
try {
|
|
@@ -2567,27 +2837,27 @@ function pGeom8(t, param, suffix = "") {
|
|
|
2567
2837
|
if (R1 - S12 < W32) {
|
|
2568
2838
|
throw `err130: R1 ${R1} is too small compare to S12 ${S12} or W32 ${W32}`;
|
|
2569
2839
|
}
|
|
2570
|
-
rGeome.logstr += `Dint ${
|
|
2840
|
+
rGeome.logstr += `Dint ${ffix10(2 * Ri)} mm
|
|
2571
2841
|
`;
|
|
2572
|
-
rGeome.logstr += `Total length ${
|
|
2842
|
+
rGeome.logstr += `Total length ${ffix10(lenTotal)} mm
|
|
2573
2843
|
`;
|
|
2574
2844
|
const [ctrToothE, logE] = ctrPlugExtern(param, R1);
|
|
2575
2845
|
rGeome.logstr += logE;
|
|
2576
2846
|
figTube.addMainOI([contourCircle6(0, 0, R1), contourCircle6(0, 0, Ri)]);
|
|
2577
|
-
figTube.addSecond(
|
|
2578
|
-
figTube.addSecond(
|
|
2579
|
-
figTube.addSecond(
|
|
2580
|
-
figTube.addSecond(
|
|
2847
|
+
figTube.addSecond(ctrRectangle5(S12, -R12, R1, 2 * R12));
|
|
2848
|
+
figTube.addSecond(ctrRectangle5(-R1 - S12, -R12, R1, 2 * R12));
|
|
2849
|
+
figTube.addSecond(ctrRectangle5(-R12, S12, 2 * R12, R1));
|
|
2850
|
+
figTube.addSecond(ctrRectangle5(-R12, -R1 - S12, 2 * R12, R1));
|
|
2581
2851
|
const ctrTubes = [];
|
|
2582
|
-
ctrTubes.push(
|
|
2852
|
+
ctrTubes.push(ctrRectangle5(0, -R1, param.W1, param.D1));
|
|
2583
2853
|
if (!capsLeftExt) {
|
|
2584
|
-
ctrTubes.push(
|
|
2854
|
+
ctrTubes.push(ctrRectangle5(param.W1, -R1, param.W1b, param.D1));
|
|
2585
2855
|
}
|
|
2586
|
-
ctrTubes.push(
|
|
2856
|
+
ctrTubes.push(ctrRectangle5(lenLeft, -R1, lenMid, param.D1));
|
|
2587
2857
|
if (!capsRightExt) {
|
|
2588
|
-
ctrTubes.push(
|
|
2858
|
+
ctrTubes.push(ctrRectangle5(lenLeft + lenMid, -R1, param.W1b, param.D1));
|
|
2589
2859
|
}
|
|
2590
|
-
ctrTubes.push(
|
|
2860
|
+
ctrTubes.push(ctrRectangle5(lenTotal - param.W1, -R1, param.W1, param.D1));
|
|
2591
2861
|
for (const iCtr of ctrTubes) {
|
|
2592
2862
|
figGroove1.addSecond(iCtr);
|
|
2593
2863
|
figGroove2.addSecond(iCtr);
|
|
@@ -2649,7 +2919,7 @@ function pGeom8(t, param, suffix = "") {
|
|
|
2649
2919
|
{
|
|
2650
2920
|
outName: `subpax_${designName}_tube`,
|
|
2651
2921
|
face: `${designName}_faceTube`,
|
|
2652
|
-
extrudeMethod:
|
|
2922
|
+
extrudeMethod: EExtrude9.eLinearOrtho,
|
|
2653
2923
|
length: lenMid,
|
|
2654
2924
|
rotate: [0, 0, 0],
|
|
2655
2925
|
translate: [0, 0, lenLeft]
|
|
@@ -2657,7 +2927,7 @@ function pGeom8(t, param, suffix = "") {
|
|
|
2657
2927
|
{
|
|
2658
2928
|
outName: `subpax_${designName}_left`,
|
|
2659
2929
|
face: `${designName}_faceLeft`,
|
|
2660
|
-
extrudeMethod:
|
|
2930
|
+
extrudeMethod: EExtrude9.eLinearOrtho,
|
|
2661
2931
|
length: param.W1,
|
|
2662
2932
|
rotate: [0, 0, 0],
|
|
2663
2933
|
translate: [0, 0, 0]
|
|
@@ -2665,7 +2935,7 @@ function pGeom8(t, param, suffix = "") {
|
|
|
2665
2935
|
{
|
|
2666
2936
|
outName: `subpax_${designName}_leftB`,
|
|
2667
2937
|
face: `${designName}_faceW1b`,
|
|
2668
|
-
extrudeMethod:
|
|
2938
|
+
extrudeMethod: EExtrude9.eLinearOrtho,
|
|
2669
2939
|
length: param.W1b,
|
|
2670
2940
|
rotate: [0, 0, 0],
|
|
2671
2941
|
translate: [0, 0, param.W1]
|
|
@@ -2673,7 +2943,7 @@ function pGeom8(t, param, suffix = "") {
|
|
|
2673
2943
|
{
|
|
2674
2944
|
outName: `subpax_${designName}_rightB`,
|
|
2675
2945
|
face: `${designName}_faceW1b`,
|
|
2676
|
-
extrudeMethod:
|
|
2946
|
+
extrudeMethod: EExtrude9.eLinearOrtho,
|
|
2677
2947
|
length: param.W1b,
|
|
2678
2948
|
rotate: [0, 0, 0],
|
|
2679
2949
|
translate: [0, 0, lenLeft + lenMid]
|
|
@@ -2681,7 +2951,7 @@ function pGeom8(t, param, suffix = "") {
|
|
|
2681
2951
|
{
|
|
2682
2952
|
outName: `subpax_${designName}_right`,
|
|
2683
2953
|
face: `${designName}_faceRight`,
|
|
2684
|
-
extrudeMethod:
|
|
2954
|
+
extrudeMethod: EExtrude9.eLinearOrtho,
|
|
2685
2955
|
length: param.W1,
|
|
2686
2956
|
rotate: [0, 0, 0],
|
|
2687
2957
|
translate: [0, 0, lenTotal - param.W1]
|
|
@@ -2689,7 +2959,7 @@ function pGeom8(t, param, suffix = "") {
|
|
|
2689
2959
|
{
|
|
2690
2960
|
outName: `subpax_${designName}_groove1`,
|
|
2691
2961
|
face: `${designName}_faceGroove1`,
|
|
2692
|
-
extrudeMethod:
|
|
2962
|
+
extrudeMethod: EExtrude9.eLinearOrtho,
|
|
2693
2963
|
length: 2 * R12,
|
|
2694
2964
|
rotate: [0, -Math.PI / 2, 0],
|
|
2695
2965
|
translate: [R12, 0, 0]
|
|
@@ -2697,7 +2967,7 @@ function pGeom8(t, param, suffix = "") {
|
|
|
2697
2967
|
{
|
|
2698
2968
|
outName: `subpax_${designName}_groove2`,
|
|
2699
2969
|
face: `${designName}_faceGroove2`,
|
|
2700
|
-
extrudeMethod:
|
|
2970
|
+
extrudeMethod: EExtrude9.eLinearOrtho,
|
|
2701
2971
|
length: 2 * R12,
|
|
2702
2972
|
rotate: [0, -Math.PI / 2, -Math.PI / 2],
|
|
2703
2973
|
translate: [0, -R12, 0]
|
|
@@ -2706,17 +2976,17 @@ function pGeom8(t, param, suffix = "") {
|
|
|
2706
2976
|
volumes: [
|
|
2707
2977
|
{
|
|
2708
2978
|
outName: `ipax_${designName}_plus`,
|
|
2709
|
-
boolMethod:
|
|
2979
|
+
boolMethod: EBVolume9.eUnion,
|
|
2710
2980
|
inList: union_list
|
|
2711
2981
|
},
|
|
2712
2982
|
{
|
|
2713
2983
|
outName: `ipax_${designName}_moins`,
|
|
2714
|
-
boolMethod:
|
|
2984
|
+
boolMethod: EBVolume9.eUnion,
|
|
2715
2985
|
inList: [`subpax_${designName}_groove1`, `subpax_${designName}_groove2`]
|
|
2716
2986
|
},
|
|
2717
2987
|
{
|
|
2718
2988
|
outName: `pax_${designName}`,
|
|
2719
|
-
boolMethod:
|
|
2989
|
+
boolMethod: EBVolume9.eSubstraction,
|
|
2720
2990
|
inList: [`ipax_${designName}_plus`, `ipax_${designName}_moins`]
|
|
2721
2991
|
}
|
|
2722
2992
|
]
|
|
@@ -2733,21 +3003,21 @@ function pGeom8(t, param, suffix = "") {
|
|
|
2733
3003
|
var springWormDef = {
|
|
2734
3004
|
pTitle: "springWorm",
|
|
2735
3005
|
pDescription: "Flex-part for unperfect coaxial transmission",
|
|
2736
|
-
pDef:
|
|
2737
|
-
pGeom:
|
|
3006
|
+
pDef: pDef9,
|
|
3007
|
+
pGeom: pGeom9
|
|
2738
3008
|
};
|
|
2739
3009
|
|
|
2740
3010
|
// src/spring/springOne.ts
|
|
2741
3011
|
import {
|
|
2742
|
-
contour as
|
|
3012
|
+
contour as contour11,
|
|
2743
3013
|
contourCircle as contourCircle7,
|
|
2744
|
-
figure as
|
|
2745
|
-
degToRad as
|
|
2746
|
-
ffix as
|
|
2747
|
-
pNumber as
|
|
2748
|
-
pCheckbox as
|
|
2749
|
-
pSectionSeparator as
|
|
2750
|
-
initGeom as
|
|
3014
|
+
figure as figure10,
|
|
3015
|
+
degToRad as degToRad4,
|
|
3016
|
+
ffix as ffix11,
|
|
3017
|
+
pNumber as pNumber10,
|
|
3018
|
+
pCheckbox as pCheckbox6,
|
|
3019
|
+
pSectionSeparator as pSectionSeparator10,
|
|
3020
|
+
initGeom as initGeom10
|
|
2751
3021
|
} from "geometrix";
|
|
2752
3022
|
import {
|
|
2753
3023
|
tJDir,
|
|
@@ -2757,46 +3027,46 @@ import {
|
|
|
2757
3027
|
facet2figure,
|
|
2758
3028
|
sheetFold
|
|
2759
3029
|
} from "sheetfold";
|
|
2760
|
-
var
|
|
3030
|
+
var pDef10 = {
|
|
2761
3031
|
partName: "springOne",
|
|
2762
3032
|
params: [
|
|
2763
3033
|
//pNumber(name, unit, init, min, max, step)
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
3034
|
+
pNumber10("D1", "mm", 16, 1, 100, 0.1),
|
|
3035
|
+
pNumber10("Dbearing", "mm", 35, 1, 100, 0.1),
|
|
3036
|
+
pNumber10("H1", "mm", 5, 1, 100, 1),
|
|
3037
|
+
pNumber10("H2", "mm", 15, 1, 100, 1),
|
|
3038
|
+
pNumber10("R2", "mm", 15, 1, 100, 1),
|
|
3039
|
+
pNumber10("L1", "mm", 50, 1, 200, 1),
|
|
3040
|
+
pNumber10("Rc1", "mm", 5, 0, 50, 1),
|
|
3041
|
+
pSectionSeparator10("Spring zone"),
|
|
3042
|
+
pCheckbox6("spring", true),
|
|
3043
|
+
pNumber10("E1", "mm", 2, 1, 100, 1),
|
|
3044
|
+
pNumber10("E2", "mm", 2, 1, 100, 1),
|
|
3045
|
+
pNumber10("smEy", "mm", 1, 0.1, 10, 0.1),
|
|
3046
|
+
pNumber10("shEy", "mm", 1, 0.1, 10, 0.1),
|
|
3047
|
+
pNumber10("shPr", "%", 90, 0, 99, 1),
|
|
3048
|
+
pNumber10("sNx", "xHoles", 2, 2, 200, 1),
|
|
3049
|
+
pNumber10("smEx", "mm", 1, 0.1, 10, 0.1),
|
|
3050
|
+
pNumber10("smExS", "mm", 0.5, 0.1, 10, 0.1),
|
|
3051
|
+
pSectionSeparator10("Screw holes"),
|
|
3052
|
+
pNumber10("D3", "mm", 6, 1, 100, 1),
|
|
3053
|
+
pNumber10("P3", "mm", 70, 1, 200, 1),
|
|
3054
|
+
pNumber10("P4", "mm", 30, 1, 200, 1),
|
|
3055
|
+
pSectionSeparator10("Borders"),
|
|
3056
|
+
pNumber10("L2", "mm", 20, 1, 200, 1),
|
|
3057
|
+
pNumber10("E3", "mm", 1, 0, 20, 0.1),
|
|
3058
|
+
pNumber10("W1", "mm", 20, 1, 200, 1),
|
|
3059
|
+
pNumber10("W3", "mm", 50, 1, 400, 1),
|
|
3060
|
+
pNumber10("Rc3", "mm", 0.5, 0, 10, 0.1),
|
|
3061
|
+
pCheckbox6("B2", true),
|
|
3062
|
+
pNumber10("A2", "mm", 10, 1, 200, 1),
|
|
3063
|
+
pNumber10("Rc2", "mm", 5, 0, 50, 1),
|
|
3064
|
+
pSectionSeparator10("Folding"),
|
|
3065
|
+
pNumber10("Th", "mm", 1, 0.1, 10, 0.1),
|
|
3066
|
+
pNumber10("Jangle", "degree", 90, 0, 120, 1),
|
|
3067
|
+
pNumber10("Jradius", "mm", 2, 0.1, 10, 0.1),
|
|
3068
|
+
pNumber10("Jneutral", "%", 50, 0, 100, 1),
|
|
3069
|
+
pNumber10("Jmark", "mm", 1, 0.1, 10, 0.1)
|
|
2800
3070
|
],
|
|
2801
3071
|
paramSvg: {
|
|
2802
3072
|
D1: "springOne_face.svg",
|
|
@@ -2839,14 +3109,14 @@ var pDef9 = {
|
|
|
2839
3109
|
// every 0.5 second
|
|
2840
3110
|
}
|
|
2841
3111
|
};
|
|
2842
|
-
function
|
|
2843
|
-
const rGeome =
|
|
2844
|
-
const figWallB =
|
|
3112
|
+
function pGeom10(t, param, suffix = "") {
|
|
3113
|
+
const rGeome = initGeom10(pDef10.partName + suffix);
|
|
3114
|
+
const figWallB = figure10();
|
|
2845
3115
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
2846
3116
|
`;
|
|
2847
3117
|
try {
|
|
2848
3118
|
let makeSpringHollow2 = function(iLen) {
|
|
2849
|
-
const rCtr =
|
|
3119
|
+
const rCtr = contour11(0, 0).addCornerRounded(sRc).addSegStrokeR(iLen, 0).addCornerRounded(sRc).addSegStrokeR(0, param.shEy).addCornerRounded(sRc).addSegStrokeR(-iLen, 0).addCornerRounded(sRc).closeSegStroke();
|
|
2850
3120
|
return rCtr;
|
|
2851
3121
|
}, calcXref2 = function(iyRef, iSel, idx) {
|
|
2852
3122
|
const cotan = iSel === 0 ? cotanBAD : cotanBADb;
|
|
@@ -2859,7 +3129,7 @@ function pGeom9(t, param, suffix = "") {
|
|
|
2859
3129
|
const lxAZpre = lx / 2 - param.smEx / 2;
|
|
2860
3130
|
const lxAZ = idx % 2 === 0 ? lxAZpre : lx;
|
|
2861
3131
|
if (lxAZ < 2 * sRc) {
|
|
2862
|
-
throw `err228: lxAZ ${
|
|
3132
|
+
throw `err228: lxAZ ${ffix11(lxAZ)} is too small compare to ${param.sNx} or ${param.smEx}`;
|
|
2863
3133
|
}
|
|
2864
3134
|
return [cx0, lxAZ, lx, nx];
|
|
2865
3135
|
}, makeCtrWall2 = function(iJunctionName) {
|
|
@@ -2873,7 +3143,7 @@ function pGeom9(t, param, suffix = "") {
|
|
|
2873
3143
|
const R1 = param.D1 / 2;
|
|
2874
3144
|
const R3 = param.D3 / 2;
|
|
2875
3145
|
const Hwall = param.H1 + param.H2 + param.R2;
|
|
2876
|
-
const aJa =
|
|
3146
|
+
const aJa = degToRad4(param.Jangle);
|
|
2877
3147
|
const aJn = param.Jneutral / 100;
|
|
2878
3148
|
const aJr = param.Jradius;
|
|
2879
3149
|
const aJm = param.Jmark;
|
|
@@ -2883,7 +3153,7 @@ function pGeom9(t, param, suffix = "") {
|
|
|
2883
3153
|
const aBAC = Math.atan2(param.H2, L12);
|
|
2884
3154
|
const lAC = Math.sqrt(L12 ** 2 + param.H2 ** 2);
|
|
2885
3155
|
if (param.R2 > lAC) {
|
|
2886
|
-
throw `err141: R2 ${param.R2} is too large comapre to lAC ${
|
|
3156
|
+
throw `err141: R2 ${param.R2} is too large comapre to lAC ${ffix11(lAC)} mm`;
|
|
2887
3157
|
}
|
|
2888
3158
|
const aCAD = Math.asin(param.R2 / lAC);
|
|
2889
3159
|
const lAD = lAC * Math.cos(aCAD);
|
|
@@ -2911,26 +3181,26 @@ function pGeom9(t, param, suffix = "") {
|
|
|
2911
3181
|
const sNy = Math.floor((sHeight + param.smEy) / sStepY);
|
|
2912
3182
|
const sRc = param.shEy * param.shPr / 200;
|
|
2913
3183
|
if (R1 < 0.1) {
|
|
2914
|
-
throw `err087: R1 ${
|
|
3184
|
+
throw `err087: R1 ${ffix11(R1)} is too small because of D1 ${param.D1}`;
|
|
2915
3185
|
}
|
|
2916
3186
|
if (L2b < 0.1) {
|
|
2917
|
-
throw `err165: L2b ${
|
|
3187
|
+
throw `err165: L2b ${ffix11(L2b)} is too small because of E3 ${param.E3}`;
|
|
2918
3188
|
}
|
|
2919
3189
|
if (param.E3 < param.Rc3) {
|
|
2920
3190
|
throw `err170: E3 ${param.E3} is too small compare to Rc3 ${param.Rc3}`;
|
|
2921
3191
|
}
|
|
2922
3192
|
if (W3b < param.Rc3) {
|
|
2923
|
-
throw `err174: W3b ${
|
|
3193
|
+
throw `err174: W3b ${ffix11(W3b)} is too small compare to Rc3 ${param.Rc3}`;
|
|
2924
3194
|
}
|
|
2925
3195
|
if (param.spring === 1) {
|
|
2926
3196
|
if (sHeight < 0.1) {
|
|
2927
|
-
throw `err189: sHeight ${
|
|
3197
|
+
throw `err189: sHeight ${ffix11(sHeight)} is too small because of E1 ${param.E1} or E2 ${param.E2}`;
|
|
2928
3198
|
}
|
|
2929
3199
|
}
|
|
2930
|
-
rGeome.logstr += `Bearing holder wall: Hwall ${
|
|
3200
|
+
rGeome.logstr += `Bearing holder wall: Hwall ${ffix11(Hwall)}, Hfoot ${ffix11(Hfoot)} mm
|
|
2931
3201
|
`;
|
|
2932
3202
|
if (param.spring === 1) {
|
|
2933
|
-
rGeome.logstr += `spring: sNy ${sNy}, sRc ${
|
|
3203
|
+
rGeome.logstr += `spring: sNy ${sNy}, sRc ${ffix11(sRc)} mm
|
|
2934
3204
|
`;
|
|
2935
3205
|
} else {
|
|
2936
3206
|
rGeome.logstr += `No spring
|
|
@@ -3033,19 +3303,19 @@ function pGeom9(t, param, suffix = "") {
|
|
|
3033
3303
|
var springOneDef = {
|
|
3034
3304
|
pTitle: "springOne",
|
|
3035
3305
|
pDescription: "bearing-holder with integrated spring",
|
|
3036
|
-
pDef:
|
|
3037
|
-
pGeom:
|
|
3306
|
+
pDef: pDef10,
|
|
3307
|
+
pGeom: pGeom10
|
|
3038
3308
|
};
|
|
3039
3309
|
|
|
3040
3310
|
// src/spring/springSide.ts
|
|
3041
3311
|
import {
|
|
3042
|
-
contour as
|
|
3312
|
+
contour as contour12,
|
|
3043
3313
|
contourCircle as contourCircle8,
|
|
3044
|
-
ffix as
|
|
3045
|
-
pNumber as
|
|
3046
|
-
pCheckbox as
|
|
3047
|
-
pSectionSeparator as
|
|
3048
|
-
initGeom as
|
|
3314
|
+
ffix as ffix12,
|
|
3315
|
+
pNumber as pNumber11,
|
|
3316
|
+
pCheckbox as pCheckbox7,
|
|
3317
|
+
pSectionSeparator as pSectionSeparator11,
|
|
3318
|
+
initGeom as initGeom11
|
|
3049
3319
|
} from "geometrix";
|
|
3050
3320
|
import {
|
|
3051
3321
|
tJDir as tJDir2,
|
|
@@ -3054,34 +3324,34 @@ import {
|
|
|
3054
3324
|
facet as facet2,
|
|
3055
3325
|
sheetFold as sheetFold2
|
|
3056
3326
|
} from "sheetfold";
|
|
3057
|
-
var
|
|
3327
|
+
var pDef11 = {
|
|
3058
3328
|
partName: "springSide",
|
|
3059
3329
|
params: [
|
|
3060
3330
|
//pNumber(name, unit, init, min, max, step)
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3331
|
+
pNumber11("D5", "mm", 100, 10, 5e3, 1),
|
|
3332
|
+
pNumber11("N5", "unit", 8, 3, 100, 1),
|
|
3333
|
+
pNumber11("W2", "mm", 20, 1, 200, 1),
|
|
3334
|
+
pSectionSeparator11("One unit"),
|
|
3335
|
+
pNumber11("D1", "mm", 16, 1, 100, 0.1),
|
|
3336
|
+
pNumber11("H1", "mm", 5, 1, 100, 1),
|
|
3337
|
+
pNumber11("H2", "mm", 15, 1, 100, 1),
|
|
3338
|
+
pNumber11("R2", "mm", 15, 1, 100, 1),
|
|
3339
|
+
pSectionSeparator11("Spring zone"),
|
|
3340
|
+
pCheckbox7("spring", true),
|
|
3341
|
+
pNumber11("E1", "mm", 2, 1, 100, 1),
|
|
3342
|
+
pNumber11("E2", "mm", 2, 1, 100, 1),
|
|
3343
|
+
pNumber11("smEy", "mm", 1, 0.1, 10, 0.1),
|
|
3344
|
+
pNumber11("shEy", "mm", 1, 0.1, 10, 0.1),
|
|
3345
|
+
pNumber11("shPr", "%", 90, 0, 99, 1),
|
|
3346
|
+
pNumber11("sNx", "xHoles", 2, 2, 200, 1),
|
|
3347
|
+
pNumber11("smEx", "mm", 1, 0.1, 10, 0.1),
|
|
3348
|
+
pNumber11("smExS", "mm", 0.5, 0.1, 10, 0.1),
|
|
3349
|
+
pSectionSeparator11("Folding"),
|
|
3350
|
+
pNumber11("Th", "mm", 1, 0.1, 10, 0.1),
|
|
3081
3351
|
//pNumber('Jangle', 'degree', 90, 0, 120, 1),
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3352
|
+
pNumber11("Jradius", "mm", 2, 0.1, 10, 0.1),
|
|
3353
|
+
pNumber11("Jneutral", "%", 50, 0, 100, 1),
|
|
3354
|
+
pNumber11("Jmark", "mm", 1, 0.1, 10, 0.1)
|
|
3085
3355
|
],
|
|
3086
3356
|
paramSvg: {
|
|
3087
3357
|
D5: "springSide_top.svg",
|
|
@@ -3113,13 +3383,13 @@ var pDef10 = {
|
|
|
3113
3383
|
// every 0.5 second
|
|
3114
3384
|
}
|
|
3115
3385
|
};
|
|
3116
|
-
function
|
|
3117
|
-
const rGeome =
|
|
3386
|
+
function pGeom11(t, param, suffix = "") {
|
|
3387
|
+
const rGeome = initGeom11(pDef11.partName + suffix);
|
|
3118
3388
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
3119
3389
|
`;
|
|
3120
3390
|
try {
|
|
3121
3391
|
let makeSpringHollow2 = function(iLen) {
|
|
3122
|
-
const rCtr =
|
|
3392
|
+
const rCtr = contour12(0, 0).addCornerRounded(sRc).addSegStrokeR(iLen, 0).addCornerRounded(sRc).addSegStrokeR(0, param.shEy).addCornerRounded(sRc).addSegStrokeR(-iLen, 0).addCornerRounded(sRc).closeSegStroke();
|
|
3123
3393
|
return rCtr;
|
|
3124
3394
|
}, calcXref2 = function(iyRef, iSel, idx) {
|
|
3125
3395
|
const cotan = iSel === 0 ? cotanBAD : cotanBADb;
|
|
@@ -3132,7 +3402,7 @@ function pGeom10(t, param, suffix = "") {
|
|
|
3132
3402
|
const lxAZpre = lx / 2 - param.smEx / 2;
|
|
3133
3403
|
const lxAZ = idx % 2 === 0 ? lxAZpre : lx;
|
|
3134
3404
|
if (lxAZ < 2 * sRc) {
|
|
3135
|
-
throw `err228: lxAZ ${
|
|
3405
|
+
throw `err228: lxAZ ${ffix12(lxAZ)} is too small compare to ${param.sNx} or ${param.smEx}`;
|
|
3136
3406
|
}
|
|
3137
3407
|
return [cx0, lxAZ, lx, nx];
|
|
3138
3408
|
}, makeCtrWall2 = function(iJ0, iJ1, iJb, iL, iL2, iJ1b, iSel) {
|
|
@@ -3192,7 +3462,7 @@ function pGeom10(t, param, suffix = "") {
|
|
|
3192
3462
|
const aBAC = Math.atan2(param.H2, Lih);
|
|
3193
3463
|
const lAC = Math.sqrt(Lih ** 2 + param.H2 ** 2);
|
|
3194
3464
|
if (param.R2 > lAC) {
|
|
3195
|
-
throw `err141: R2 ${param.R2} is too large comapre to lAC ${
|
|
3465
|
+
throw `err141: R2 ${param.R2} is too large comapre to lAC ${ffix12(lAC)} mm`;
|
|
3196
3466
|
}
|
|
3197
3467
|
const aCAD = Math.asin(param.R2 / lAC);
|
|
3198
3468
|
const lAD = lAC * Math.cos(aCAD);
|
|
@@ -3211,34 +3481,34 @@ function pGeom10(t, param, suffix = "") {
|
|
|
3211
3481
|
const sNy = Math.floor((sHeight + param.smEy) / sStepY);
|
|
3212
3482
|
const sRc = param.shEy * param.shPr / 200;
|
|
3213
3483
|
if (R1 < 0.1) {
|
|
3214
|
-
throw `err087: R1 ${
|
|
3484
|
+
throw `err087: R1 ${ffix12(R1)} is too small because of D1 ${param.D1}`;
|
|
3215
3485
|
}
|
|
3216
3486
|
if (LiY < 0.1) {
|
|
3217
|
-
throw `err168: R5 ${
|
|
3487
|
+
throw `err168: R5 ${ffix12(R5)} is too small compare to W2 ${ffix12(W22)} or Th ${param.Th} mm`;
|
|
3218
3488
|
}
|
|
3219
3489
|
if (Li < 0.1) {
|
|
3220
|
-
throw `err171: Li ${
|
|
3490
|
+
throw `err171: Li ${ffix12(Li)} is too small because of aJr ${aJr} mm`;
|
|
3221
3491
|
}
|
|
3222
3492
|
if (W1 < 0.1) {
|
|
3223
|
-
throw `err174: W1 ${
|
|
3493
|
+
throw `err174: W1 ${ffix12(W1)} is too small because of Hfoot ${ffix12(Hfoot)} mm`;
|
|
3224
3494
|
}
|
|
3225
3495
|
if (param.spring === 1) {
|
|
3226
3496
|
if (sHeight < 0.1) {
|
|
3227
|
-
throw `err189: sHeight ${
|
|
3497
|
+
throw `err189: sHeight ${ffix12(sHeight)} is too small because of E1 ${param.E1} or E2 ${param.E2}`;
|
|
3228
3498
|
}
|
|
3229
3499
|
}
|
|
3230
|
-
rGeome.logstr += `Bearing holder wall: Hwall ${
|
|
3500
|
+
rGeome.logstr += `Bearing holder wall: Hwall ${ffix12(Hwall)}, Hfoot ${ffix12(Hfoot)} mm
|
|
3231
3501
|
`;
|
|
3232
|
-
rGeome.logstr += `Width of one unit interior: Lii ${
|
|
3502
|
+
rGeome.logstr += `Width of one unit interior: Lii ${ffix12(Lii)}, Li ${ffix12(Li)} mm
|
|
3233
3503
|
`;
|
|
3234
|
-
rGeome.logstr += `Width of one unit exterior: Lee ${
|
|
3504
|
+
rGeome.logstr += `Width of one unit exterior: Lee ${ffix12(Lee)}, Le ${ffix12(Le)} mm
|
|
3235
3505
|
`;
|
|
3236
|
-
rGeome.logstr += `Ratio R2/Li ${
|
|
3506
|
+
rGeome.logstr += `Ratio R2/Li ${ffix12(100 * param.R2 / Lih)} %
|
|
3237
3507
|
`;
|
|
3238
|
-
rGeome.logstr += `Width of bottom: W1 ${
|
|
3508
|
+
rGeome.logstr += `Width of bottom: W1 ${ffix12(W1)}, D3 ${ffix12(D3)} mm
|
|
3239
3509
|
`;
|
|
3240
3510
|
if (param.spring === 1) {
|
|
3241
|
-
rGeome.logstr += `spring: sNy ${sNy}, sRc ${
|
|
3511
|
+
rGeome.logstr += `spring: sNy ${sNy}, sRc ${ffix12(sRc)} mm
|
|
3242
3512
|
`;
|
|
3243
3513
|
} else {
|
|
3244
3514
|
rGeome.logstr += `No spring
|
|
@@ -3349,56 +3619,56 @@ function pGeom10(t, param, suffix = "") {
|
|
|
3349
3619
|
var springSideDef = {
|
|
3350
3620
|
pTitle: "springSide",
|
|
3351
3621
|
pDescription: "bearing-holder on the side of a ring",
|
|
3352
|
-
pDef:
|
|
3353
|
-
pGeom:
|
|
3622
|
+
pDef: pDef11,
|
|
3623
|
+
pGeom: pGeom11
|
|
3354
3624
|
};
|
|
3355
3625
|
|
|
3356
3626
|
// src/spring/springInt.ts
|
|
3357
3627
|
import {
|
|
3358
|
-
contour as
|
|
3628
|
+
contour as contour13,
|
|
3359
3629
|
contourCircle as contourCircle9,
|
|
3360
|
-
degToRad as
|
|
3361
|
-
ffix as
|
|
3362
|
-
pNumber as
|
|
3363
|
-
pCheckbox as
|
|
3364
|
-
pSectionSeparator as
|
|
3365
|
-
initGeom as
|
|
3630
|
+
degToRad as degToRad5,
|
|
3631
|
+
ffix as ffix13,
|
|
3632
|
+
pNumber as pNumber12,
|
|
3633
|
+
pCheckbox as pCheckbox8,
|
|
3634
|
+
pSectionSeparator as pSectionSeparator12,
|
|
3635
|
+
initGeom as initGeom12
|
|
3366
3636
|
} from "geometrix";
|
|
3367
3637
|
import {
|
|
3368
3638
|
tJDir as tJDir3,
|
|
3369
3639
|
tJSide as tJSide3,
|
|
3370
3640
|
contourJ as contourJ3,
|
|
3371
3641
|
facet as facet3,
|
|
3372
|
-
sheetFold as sheetFold3
|
|
3373
|
-
} from "sheetfold";
|
|
3374
|
-
var
|
|
3375
|
-
partName: "springInt",
|
|
3376
|
-
params: [
|
|
3377
|
-
//pNumber(name, unit, init, min, max, step)
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3642
|
+
sheetFold as sheetFold3
|
|
3643
|
+
} from "sheetfold";
|
|
3644
|
+
var pDef12 = {
|
|
3645
|
+
partName: "springInt",
|
|
3646
|
+
params: [
|
|
3647
|
+
//pNumber(name, unit, init, min, max, step)
|
|
3648
|
+
pNumber12("D5", "mm", 140, 10, 5e3, 1),
|
|
3649
|
+
pNumber12("N5", "unit", 8, 3, 100, 1),
|
|
3650
|
+
pNumber12("W2", "mm", 20, 1, 200, 1),
|
|
3651
|
+
pSectionSeparator12("One unit"),
|
|
3652
|
+
pNumber12("D1", "mm", 16, 1, 100, 0.1),
|
|
3653
|
+
pNumber12("H1", "mm", 5, 1, 100, 1),
|
|
3654
|
+
pNumber12("H2", "mm", 15, 1, 100, 1),
|
|
3655
|
+
pNumber12("R2", "mm", 15, 1, 100, 1),
|
|
3656
|
+
pSectionSeparator12("Spring zone"),
|
|
3657
|
+
pCheckbox8("spring", true),
|
|
3658
|
+
pNumber12("E1", "mm", 2, 1, 100, 1),
|
|
3659
|
+
pNumber12("E2", "mm", 2, 1, 100, 1),
|
|
3660
|
+
pNumber12("smEy", "mm", 1, 0.1, 10, 0.1),
|
|
3661
|
+
pNumber12("shEy", "mm", 1, 0.1, 10, 0.1),
|
|
3662
|
+
pNumber12("shPr", "%", 90, 0, 99, 1),
|
|
3663
|
+
pNumber12("sNx", "xHoles", 2, 2, 200, 1),
|
|
3664
|
+
pNumber12("smEx", "mm", 1, 0.1, 10, 0.1),
|
|
3665
|
+
pNumber12("smExS", "mm", 0.5, 0.1, 10, 0.1),
|
|
3666
|
+
pSectionSeparator12("Folding"),
|
|
3667
|
+
pNumber12("Th", "mm", 1, 0.1, 10, 0.1),
|
|
3668
|
+
pNumber12("Jangle", "degree", 90, 0, 120, 1),
|
|
3669
|
+
pNumber12("Jradius", "mm", 2, 0.1, 10, 0.1),
|
|
3670
|
+
pNumber12("Jneutral", "%", 50, 0, 100, 1),
|
|
3671
|
+
pNumber12("Jmark", "mm", 1, 0.1, 10, 0.1)
|
|
3402
3672
|
],
|
|
3403
3673
|
paramSvg: {
|
|
3404
3674
|
D5: "springInt_global.svg",
|
|
@@ -3430,13 +3700,13 @@ var pDef11 = {
|
|
|
3430
3700
|
// every 0.5 second
|
|
3431
3701
|
}
|
|
3432
3702
|
};
|
|
3433
|
-
function
|
|
3434
|
-
const rGeome =
|
|
3703
|
+
function pGeom12(t, param, suffix = "") {
|
|
3704
|
+
const rGeome = initGeom12(pDef12.partName + suffix);
|
|
3435
3705
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
3436
3706
|
`;
|
|
3437
3707
|
try {
|
|
3438
3708
|
let makeSpringHollow2 = function(iLen) {
|
|
3439
|
-
const rCtr =
|
|
3709
|
+
const rCtr = contour13(0, 0).addCornerRounded(sRc).addSegStrokeR(iLen, 0).addCornerRounded(sRc).addSegStrokeR(0, param.shEy).addCornerRounded(sRc).addSegStrokeR(-iLen, 0).addCornerRounded(sRc).closeSegStroke();
|
|
3440
3710
|
return rCtr;
|
|
3441
3711
|
}, calcXref2 = function(iyRef, idx) {
|
|
3442
3712
|
const cotan = cotanBAD;
|
|
@@ -3449,7 +3719,7 @@ function pGeom11(t, param, suffix = "") {
|
|
|
3449
3719
|
const lxAZpre = lx / 2 - param.smEx / 2;
|
|
3450
3720
|
const lxAZ = idx % 2 === 0 ? lxAZpre : lx;
|
|
3451
3721
|
if (lxAZ < 2 * sRc) {
|
|
3452
|
-
throw `err228: lxAZ ${
|
|
3722
|
+
throw `err228: lxAZ ${ffix13(lxAZ)} is too small compare to ${param.sNx} or ${param.smEx}`;
|
|
3453
3723
|
}
|
|
3454
3724
|
return [cx0, lxAZ, lx, nx];
|
|
3455
3725
|
}, makeCtrWall2 = function(iJb) {
|
|
@@ -3472,7 +3742,7 @@ function pGeom11(t, param, suffix = "") {
|
|
|
3472
3742
|
return rFa;
|
|
3473
3743
|
};
|
|
3474
3744
|
var makeSpringHollow = makeSpringHollow2, calcXref = calcXref2, makeCtrWall = makeCtrWall2, makeFaBottom = makeFaBottom2;
|
|
3475
|
-
const aJa =
|
|
3745
|
+
const aJa = degToRad5(param.Jangle);
|
|
3476
3746
|
const aJn = param.Jneutral / 100;
|
|
3477
3747
|
const aJr = param.Jradius;
|
|
3478
3748
|
const aJm = param.Jmark;
|
|
@@ -3493,7 +3763,7 @@ function pGeom11(t, param, suffix = "") {
|
|
|
3493
3763
|
const aBAC = Math.atan2(param.H2, Lih);
|
|
3494
3764
|
const lAC = Math.sqrt(Lih ** 2 + param.H2 ** 2);
|
|
3495
3765
|
if (param.R2 > lAC) {
|
|
3496
|
-
throw `err141: R2 ${param.R2} is too large comapre to lAC ${
|
|
3766
|
+
throw `err141: R2 ${param.R2} is too large comapre to lAC ${ffix13(lAC)} mm`;
|
|
3497
3767
|
}
|
|
3498
3768
|
const aCAD = Math.asin(param.R2 / lAC);
|
|
3499
3769
|
const lAD = lAC * Math.cos(aCAD);
|
|
@@ -3505,38 +3775,38 @@ function pGeom11(t, param, suffix = "") {
|
|
|
3505
3775
|
const sNy = Math.floor((sHeight + param.smEy) / sStepY);
|
|
3506
3776
|
const sRc = param.shEy * param.shPr / 200;
|
|
3507
3777
|
if (R1 < 0.1) {
|
|
3508
|
-
throw `err087: R1 ${
|
|
3778
|
+
throw `err087: R1 ${ffix13(R1)} is too small because of D1 ${param.D1}`;
|
|
3509
3779
|
}
|
|
3510
3780
|
if (param.R2 < R1 + 0.1) {
|
|
3511
|
-
throw `err150: R2 ${
|
|
3781
|
+
throw `err150: R2 ${ffix13(param.R2)} is too small compare to R1 ${R1} mm`;
|
|
3512
3782
|
}
|
|
3513
3783
|
if (R5b < aJr) {
|
|
3514
|
-
throw `err154: R5b ${
|
|
3784
|
+
throw `err154: R5b ${ffix13(R5b)} is too small because of H2 ${param.D2}, H1 ${param.H1} or Hfoot ${ffix13(Hfoot)}`;
|
|
3515
3785
|
}
|
|
3516
3786
|
if (Li < 0.1) {
|
|
3517
|
-
throw `err158: Li ${
|
|
3787
|
+
throw `err158: Li ${ffix13(Li)} is too small because of aJr ${ffix13(aJr)} radian`;
|
|
3518
3788
|
}
|
|
3519
3789
|
if (W1 < 0.1) {
|
|
3520
|
-
throw `err161: W1 ${
|
|
3790
|
+
throw `err161: W1 ${ffix13(W1)} is too small because of Hfoot ${ffix13(Hfoot)} mm`;
|
|
3521
3791
|
}
|
|
3522
3792
|
if (Li < 3 * D3) {
|
|
3523
|
-
throw `err166: D3 ${
|
|
3793
|
+
throw `err166: D3 ${ffix13(D3)} is too large compare to Li ${ffix13(Li)} mm`;
|
|
3524
3794
|
}
|
|
3525
3795
|
if (param.spring === 1) {
|
|
3526
3796
|
if (sHeight < 0.1) {
|
|
3527
|
-
throw `err189: sHeight ${
|
|
3797
|
+
throw `err189: sHeight ${ffix13(sHeight)} is too small because of E1 ${param.E1} or E2 ${param.E2}`;
|
|
3528
3798
|
}
|
|
3529
3799
|
}
|
|
3530
|
-
rGeome.logstr += `Bearing holder wall: Hwall ${
|
|
3800
|
+
rGeome.logstr += `Bearing holder wall: Hwall ${ffix13(Hwall)}, Hfoot ${ffix13(Hfoot)} mm
|
|
3531
3801
|
`;
|
|
3532
|
-
rGeome.logstr += `Width of one unit: Lii ${
|
|
3802
|
+
rGeome.logstr += `Width of one unit: Lii ${ffix13(Lii)}, Li ${ffix13(Li)} mm
|
|
3533
3803
|
`;
|
|
3534
|
-
rGeome.logstr += `Ratio R2/Li ${
|
|
3804
|
+
rGeome.logstr += `Ratio R2/Li ${ffix13(100 * param.R2 / Lih)} %
|
|
3535
3805
|
`;
|
|
3536
|
-
rGeome.logstr += `Width of bottom: W1 ${
|
|
3806
|
+
rGeome.logstr += `Width of bottom: W1 ${ffix13(W1)}, D3 ${ffix13(D3)} mm
|
|
3537
3807
|
`;
|
|
3538
3808
|
if (param.spring === 1) {
|
|
3539
|
-
rGeome.logstr += `spring: sNy ${sNy}, sRc ${
|
|
3809
|
+
rGeome.logstr += `spring: sNy ${sNy}, sRc ${ffix13(sRc)} mm
|
|
3540
3810
|
`;
|
|
3541
3811
|
} else {
|
|
3542
3812
|
rGeome.logstr += `No spring
|
|
@@ -3605,75 +3875,75 @@ function pGeom11(t, param, suffix = "") {
|
|
|
3605
3875
|
var springIntDef = {
|
|
3606
3876
|
pTitle: "springInt",
|
|
3607
3877
|
pDescription: "bearing-holder in the interior of a ring",
|
|
3608
|
-
pDef:
|
|
3609
|
-
pGeom:
|
|
3878
|
+
pDef: pDef12,
|
|
3879
|
+
pGeom: pGeom12
|
|
3610
3880
|
};
|
|
3611
3881
|
|
|
3612
3882
|
// src/heliostat/heliostat.ts
|
|
3613
3883
|
import {
|
|
3614
3884
|
point as point6,
|
|
3615
|
-
contour as
|
|
3885
|
+
contour as contour14,
|
|
3616
3886
|
contourCircle as contourCircle10,
|
|
3617
|
-
ctrRectangle as
|
|
3618
|
-
figure as
|
|
3619
|
-
degToRad as
|
|
3620
|
-
radToDeg as
|
|
3621
|
-
ffix as
|
|
3622
|
-
pNumber as
|
|
3623
|
-
pDropdown as
|
|
3624
|
-
pSectionSeparator as
|
|
3625
|
-
EExtrude as
|
|
3626
|
-
EBVolume as
|
|
3627
|
-
initGeom as
|
|
3887
|
+
ctrRectangle as ctrRectangle6,
|
|
3888
|
+
figure as figure11,
|
|
3889
|
+
degToRad as degToRad6,
|
|
3890
|
+
radToDeg as radToDeg9,
|
|
3891
|
+
ffix as ffix14,
|
|
3892
|
+
pNumber as pNumber13,
|
|
3893
|
+
pDropdown as pDropdown7,
|
|
3894
|
+
pSectionSeparator as pSectionSeparator13,
|
|
3895
|
+
EExtrude as EExtrude10,
|
|
3896
|
+
EBVolume as EBVolume10,
|
|
3897
|
+
initGeom as initGeom13
|
|
3628
3898
|
} from "geometrix";
|
|
3629
3899
|
import { triLALrL, triLLLrA } from "triangule";
|
|
3630
|
-
var
|
|
3900
|
+
var pDef13 = {
|
|
3631
3901
|
partName: "heliostat",
|
|
3632
3902
|
params: [
|
|
3633
3903
|
//pNumber(name, unit, init, min, max, step)
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3904
|
+
pNumber13("L1", "mm", 4e3, 1e3, 2e4, 1),
|
|
3905
|
+
pNumber13("D1", "mm", 1e3, 100, 4e3, 1),
|
|
3906
|
+
pNumber13("D3", "mm", 600, 100, 2e3, 1),
|
|
3907
|
+
pNumber13("L9", "mm", 8e3, 1e3, 2e4, 1),
|
|
3908
|
+
pSectionSeparator13("Bottom details"),
|
|
3909
|
+
pNumber13("E1", "mm", 10, 1, 100, 1),
|
|
3910
|
+
pNumber13("E2", "mm", 10, 1, 100, 1),
|
|
3911
|
+
pNumber13("E3", "mm", 10, 1, 100, 1),
|
|
3912
|
+
pNumber13("S1", "mm", 100, 1, 500, 1),
|
|
3913
|
+
pNumber13("S3", "mm", 100, 1, 500, 1),
|
|
3914
|
+
pSectionSeparator13("Fixation"),
|
|
3915
|
+
pNumber13("N2", "holes", 24, 1, 500, 1),
|
|
3916
|
+
pNumber13("D2", "mm", 40, 1, 400, 1),
|
|
3917
|
+
pNumber13("W1", "mm", 20, 1, 400, 1),
|
|
3918
|
+
pSectionSeparator13("Door"),
|
|
3919
|
+
pNumber13("H1H", "mm", 1500, 100, 3e3, 1),
|
|
3920
|
+
pNumber13("H1W", "mm", 600, 100, 1e3, 1),
|
|
3921
|
+
pNumber13("H1P", "mm", 300, 100, 2e3, 1),
|
|
3922
|
+
pSectionSeparator13("Junction"),
|
|
3923
|
+
pNumber13("Z3", "mm", 200, 1, 500, 1),
|
|
3924
|
+
pNumber13("Z4", "mm", 200, 1, 500, 1),
|
|
3925
|
+
pDropdown7("gen3D", ["Both", "Top", "Bottom"]),
|
|
3926
|
+
pSectionSeparator13("Top-trunk"),
|
|
3927
|
+
pNumber13("L4", "mm", 2e3, 100, 2e4, 1),
|
|
3928
|
+
pNumber13("E4", "mm", 10, 1, 100, 1),
|
|
3929
|
+
pNumber13("E5", "mm", 10, 1, 100, 1),
|
|
3930
|
+
pNumber13("H6", "mm", 600, 100, 2e3, 1),
|
|
3931
|
+
pNumber13("E7", "mm", 10, 1, 100, 1),
|
|
3932
|
+
pNumber13("D7", "mm", 200, 10, 2e3, 1),
|
|
3933
|
+
pSectionSeparator13("Top-branch"),
|
|
3934
|
+
pNumber13("E6", "mm", 10, 1, 100, 1),
|
|
3935
|
+
pNumber13("D6", "mm", 400, 100, 2e3, 1),
|
|
3936
|
+
pNumber13("W8", "mm", 300, 100, 2e3, 1),
|
|
3937
|
+
pNumber13("L8", "mm", 2e3, 100, 2e4, 1),
|
|
3938
|
+
pNumber13("H8", "mm", 1e3, 100, 3e3, 1),
|
|
3939
|
+
pNumber13("G8", "mm", 500, 100, 2e3, 1),
|
|
3940
|
+
pNumber13("F8", "mm", 200, 10, 1e3, 1),
|
|
3941
|
+
pNumber13("a8", "degre", 140, 30, 200, 1),
|
|
3942
|
+
pSectionSeparator13("Top-diagonal"),
|
|
3943
|
+
pNumber13("D4", "mm", 300, 10, 2e3, 1),
|
|
3944
|
+
pNumber13("EE4", "mm", 10, 1, 100, 1),
|
|
3945
|
+
pNumber13("R4v", "mm", 400, 10, 5e3, 1),
|
|
3946
|
+
pNumber13("R4h", "mm", 400, 10, 5e3, 1)
|
|
3677
3947
|
],
|
|
3678
3948
|
paramSvg: {
|
|
3679
3949
|
L1: "heliostat_bottom.svg",
|
|
@@ -3720,33 +3990,33 @@ var pDef12 = {
|
|
|
3720
3990
|
// every 0.5 second
|
|
3721
3991
|
}
|
|
3722
3992
|
};
|
|
3723
|
-
function
|
|
3724
|
-
const rGeome =
|
|
3725
|
-
const figBottomDisc =
|
|
3726
|
-
const figBottomPole =
|
|
3727
|
-
const figDoor =
|
|
3728
|
-
const figTopPole =
|
|
3729
|
-
const figHorizPole =
|
|
3730
|
-
const figHorizPoleInt =
|
|
3731
|
-
const figDiag3 =
|
|
3732
|
-
const figDiagE =
|
|
3733
|
-
const figDiagI =
|
|
3734
|
-
const figCleanDiag =
|
|
3735
|
-
const figHand =
|
|
3993
|
+
function pGeom13(t, param, suffix = "") {
|
|
3994
|
+
const rGeome = initGeom13(pDef13.partName + suffix);
|
|
3995
|
+
const figBottomDisc = figure11();
|
|
3996
|
+
const figBottomPole = figure11();
|
|
3997
|
+
const figDoor = figure11();
|
|
3998
|
+
const figTopPole = figure11();
|
|
3999
|
+
const figHorizPole = figure11();
|
|
4000
|
+
const figHorizPoleInt = figure11();
|
|
4001
|
+
const figDiag3 = figure11();
|
|
4002
|
+
const figDiagE = figure11();
|
|
4003
|
+
const figDiagI = figure11();
|
|
4004
|
+
const figCleanDiag = figure11();
|
|
4005
|
+
const figHand = figure11();
|
|
3736
4006
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
3737
4007
|
`;
|
|
3738
4008
|
try {
|
|
3739
4009
|
let ctrBottomPole2 = function(sig) {
|
|
3740
|
-
const rCtr =
|
|
4010
|
+
const rCtr = contour14(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
4011
|
return rCtr;
|
|
3742
4012
|
}, ctrTopPole2 = function(sig) {
|
|
3743
|
-
const rCtr =
|
|
4013
|
+
const rCtr = contour14(-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
4014
|
return rCtr;
|
|
3745
4015
|
}, ctrDiag2 = function(posX, RR, AA) {
|
|
3746
|
-
const rCtr =
|
|
4016
|
+
const rCtr = ctrRectangle6(posX - RR, posY4, 2 * RR, diagL).rotate(posX, posY4, AA);
|
|
3747
4017
|
return rCtr;
|
|
3748
4018
|
}, ctrCleanDiag2 = function(sig) {
|
|
3749
|
-
const rCtr =
|
|
4019
|
+
const rCtr = contour14(-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
4020
|
return rCtr;
|
|
3751
4021
|
};
|
|
3752
4022
|
var ctrBottomPole = ctrBottomPole2, ctrTopPole = ctrTopPole2, ctrDiag = ctrDiag2, ctrCleanDiag = ctrCleanDiag2;
|
|
@@ -3804,7 +4074,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
3804
4074
|
const diagL = diagHeight / Math.cos(diagA);
|
|
3805
4075
|
const R8 = param.G8 / 2;
|
|
3806
4076
|
const R82 = R8 + param.F8;
|
|
3807
|
-
const a82 =
|
|
4077
|
+
const a82 = degToRad6(param.a8) / 2;
|
|
3808
4078
|
const posY8 = posY6 + param.H8;
|
|
3809
4079
|
const [t2iL3, triLog3] = triLALrL(param.H8, a82, R82);
|
|
3810
4080
|
const [t2iA31, triLog4] = triLLLrA(param.H8, R82, t2iL3);
|
|
@@ -3815,34 +4085,34 @@ function pGeom12(t, param, suffix = "") {
|
|
|
3815
4085
|
const L82 = param.L8 / 2;
|
|
3816
4086
|
const posX9 = [-L92, -L82 - param.W8, L82, L92 - param.W8];
|
|
3817
4087
|
if (R1 < R3) {
|
|
3818
|
-
throw `err176: D1 ${
|
|
4088
|
+
throw `err176: D1 ${ffix14(param.D1)} is too small compare to D3 ${ffix14(param.D3)} mm`;
|
|
3819
4089
|
}
|
|
3820
4090
|
if (R1b < 0.1) {
|
|
3821
|
-
throw `err183: R1b ${
|
|
4091
|
+
throw `err183: R1b ${ffix14(R1b)} is too small because of ${ffix14(param.E2)} or ${ffix14(param.S1)} mm`;
|
|
3822
4092
|
}
|
|
3823
4093
|
if (param.S1 < 2 * (param.W1 + R2)) {
|
|
3824
|
-
throw `err142: S1 ${
|
|
4094
|
+
throw `err142: S1 ${ffix14(param.S1)} is too small compare to W1 ${ffix14(param.W1)} and D2 ${ffix14(2 * R2)} mm`;
|
|
3825
4095
|
}
|
|
3826
4096
|
if (H1h < 0.1) {
|
|
3827
|
-
throw `err167: H1H ${
|
|
4097
|
+
throw `err167: H1H ${ffix14(param.H1H)} is too small compare to H1W ${ffix14(param.H1W)} mm`;
|
|
3828
4098
|
}
|
|
3829
4099
|
if (param.Z4 < d5b) {
|
|
3830
|
-
throw `err154: Z4 ${
|
|
4100
|
+
throw `err154: Z4 ${ffix14(param.Z4)} is too small compare to d5b ${ffix14(d5b)} mm`;
|
|
3831
4101
|
}
|
|
3832
4102
|
if (R7b < R7i) {
|
|
3833
|
-
throw `err169: R7b ${
|
|
4103
|
+
throw `err169: R7b ${ffix14(2 * R7b)} is too small because to D7 ${ffix14(2 * R7i)} mm`;
|
|
3834
4104
|
}
|
|
3835
4105
|
if (R6i < 0.1) {
|
|
3836
|
-
throw `err185: R6i ${
|
|
4106
|
+
throw `err185: R6i ${ffix14(R6i)} is too small because to E6 ${ffix14(param.E6)} mm`;
|
|
3837
4107
|
}
|
|
3838
4108
|
if (param.H6 < param.D6) {
|
|
3839
|
-
throw `err200: H6 ${
|
|
4109
|
+
throw `err200: H6 ${ffix14(param.H6)} is too small compare to D6 ${ffix14(param.D6)} mm`;
|
|
3840
4110
|
}
|
|
3841
|
-
rGeome.logstr += `Cone inclination ${
|
|
4111
|
+
rGeome.logstr += `Cone inclination ${ffix14(radToDeg9(inclination))}, diagonal ${ffix14(radToDeg9(diagA))} deg
|
|
3842
4112
|
`;
|
|
3843
|
-
rGeome.logstr += `Diameters: D1 ${
|
|
4113
|
+
rGeome.logstr += `Diameters: D1 ${ffix14(2 * R1)}, D1b ${ffix14(2 * R1)}, D3 ${ffix14(2 * R3)}, D5 ${ffix14(2 * R5)} mm
|
|
3844
4114
|
`;
|
|
3845
|
-
rGeome.logstr += `TopPole: posY4 ${
|
|
4115
|
+
rGeome.logstr += `TopPole: posY4 ${ffix14(posY4)}, D4 ${ffix14(2 * R4e)} mm
|
|
3846
4116
|
`;
|
|
3847
4117
|
const fixationHoles = [];
|
|
3848
4118
|
for (let ii = 0; ii < param.N2; ii++) {
|
|
@@ -3859,7 +4129,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
3859
4129
|
figBottomDisc.addSecond(contourCircle10(0, 0, R5));
|
|
3860
4130
|
figBottomPole.addMainO(ctrBottomPole2(-1));
|
|
3861
4131
|
figBottomPole.addSecond(ctrBottomPole2(1));
|
|
3862
|
-
const ctrDoor =
|
|
4132
|
+
const ctrDoor = contour14(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
4133
|
figDoor.addMainO(ctrDoor);
|
|
3864
4134
|
figDoor.addSecond(ctrBottomPole2(1));
|
|
3865
4135
|
figDoor.addSecond(ctrBottomPole2(-1));
|
|
@@ -3881,8 +4151,8 @@ function pGeom12(t, param, suffix = "") {
|
|
|
3881
4151
|
figHorizPoleInt.addSecond(ctrTopPole2(-1));
|
|
3882
4152
|
figHorizPoleInt.addSecond(ctrTopPole2(1));
|
|
3883
4153
|
figDiag3.addMainOI([
|
|
3884
|
-
|
|
3885
|
-
|
|
4154
|
+
ctrRectangle6(-L92, posY6 - R6e, 2 * L92, 2 * R6e),
|
|
4155
|
+
ctrRectangle6(-L92, posY6 - R6i, 2 * L92, 2 * R6i)
|
|
3886
4156
|
]);
|
|
3887
4157
|
figDiag3.addSecond(ctrTopPole2(-1));
|
|
3888
4158
|
figDiag3.addSecond(ctrTopPole2(1));
|
|
@@ -3891,7 +4161,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
3891
4161
|
figDiag3.addSecond(ctrDiag2(-posX4, RR4e, -diagA));
|
|
3892
4162
|
figDiag3.addSecond(ctrDiag2(-posX4, RR4i, -diagA));
|
|
3893
4163
|
for (let ii = 0; ii < 4; ii++) {
|
|
3894
|
-
figDiag3.addSecond(
|
|
4164
|
+
figDiag3.addSecond(ctrRectangle6(posX9[ii], posY6, param.W8, param.H8));
|
|
3895
4165
|
}
|
|
3896
4166
|
const ctrDiagE = contourCircle10(0, 0, RR4e);
|
|
3897
4167
|
const ctrDiagI = contourCircle10(0, 0, RR4i);
|
|
@@ -3907,7 +4177,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
3907
4177
|
const p4 = point6(0, posY8).translatePolar(-a82 - pi2, R82);
|
|
3908
4178
|
const p5 = point6(0, posY6).translatePolar(pi2 + a62, R6e);
|
|
3909
4179
|
const p6 = point6(0, posY6).translatePolar(pi2 - a62, R6e);
|
|
3910
|
-
const ctrHand =
|
|
4180
|
+
const ctrHand = contour14(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
4181
|
figHand.addMainO(ctrHand);
|
|
3912
4182
|
figHand.addSecond(contourCircle10(0, posY6, R6e));
|
|
3913
4183
|
figHand.addSecond(contourCircle10(0, posY6, R6i));
|
|
@@ -3941,14 +4211,14 @@ function pGeom12(t, param, suffix = "") {
|
|
|
3941
4211
|
{
|
|
3942
4212
|
outName: `subpax_${designName}_bottomPole`,
|
|
3943
4213
|
face: `${designName}_faceBottomPole`,
|
|
3944
|
-
extrudeMethod:
|
|
4214
|
+
extrudeMethod: EExtrude10.eRotate,
|
|
3945
4215
|
rotate: [0, 0, 0],
|
|
3946
4216
|
translate: [0, 0, 0]
|
|
3947
4217
|
},
|
|
3948
4218
|
{
|
|
3949
4219
|
outName: `subpax_${designName}_door`,
|
|
3950
4220
|
face: `${designName}_faceDoor`,
|
|
3951
|
-
extrudeMethod:
|
|
4221
|
+
extrudeMethod: EExtrude10.eLinearOrtho,
|
|
3952
4222
|
length: 2 * R1,
|
|
3953
4223
|
rotate: [pi2, 0, 0],
|
|
3954
4224
|
translate: [0, 0, 0]
|
|
@@ -3956,7 +4226,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
3956
4226
|
{
|
|
3957
4227
|
outName: `subpax_${designName}_bottomDisc`,
|
|
3958
4228
|
face: `${designName}_faceBottomDisc`,
|
|
3959
|
-
extrudeMethod:
|
|
4229
|
+
extrudeMethod: EExtrude10.eLinearOrtho,
|
|
3960
4230
|
length: param.E1,
|
|
3961
4231
|
rotate: [0, 0, 0],
|
|
3962
4232
|
translate: [0, 0, 0]
|
|
@@ -3964,14 +4234,14 @@ function pGeom12(t, param, suffix = "") {
|
|
|
3964
4234
|
{
|
|
3965
4235
|
outName: `subpax_${designName}_topPole`,
|
|
3966
4236
|
face: `${designName}_faceTopPole`,
|
|
3967
|
-
extrudeMethod:
|
|
4237
|
+
extrudeMethod: EExtrude10.eRotate,
|
|
3968
4238
|
rotate: [0, 0, 0],
|
|
3969
4239
|
translate: [0, 0, 0]
|
|
3970
4240
|
},
|
|
3971
4241
|
{
|
|
3972
4242
|
outName: `subpax_${designName}_horizPole`,
|
|
3973
4243
|
face: `${designName}_faceHorizPole`,
|
|
3974
|
-
extrudeMethod:
|
|
4244
|
+
extrudeMethod: EExtrude10.eLinearOrtho,
|
|
3975
4245
|
length: param.L9,
|
|
3976
4246
|
rotate: [pi2, 0, 0],
|
|
3977
4247
|
translate: [0, L92, 0]
|
|
@@ -3979,7 +4249,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
3979
4249
|
{
|
|
3980
4250
|
outName: `subpax_${designName}_horizPoleInt`,
|
|
3981
4251
|
face: `${designName}_faceHorizPoleInt`,
|
|
3982
|
-
extrudeMethod:
|
|
4252
|
+
extrudeMethod: EExtrude10.eLinearOrtho,
|
|
3983
4253
|
length: param.L9,
|
|
3984
4254
|
rotate: [pi2, 0, 0],
|
|
3985
4255
|
translate: [0, L92, 0]
|
|
@@ -3987,7 +4257,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
3987
4257
|
{
|
|
3988
4258
|
outName: `subpax_${designName}_diag1e`,
|
|
3989
4259
|
face: `${designName}_faceDiagE`,
|
|
3990
|
-
extrudeMethod:
|
|
4260
|
+
extrudeMethod: EExtrude10.eLinearOrtho,
|
|
3991
4261
|
length: diagL,
|
|
3992
4262
|
rotate: [diagA, 0, 0],
|
|
3993
4263
|
translate: [0, posX4, posY4]
|
|
@@ -3995,7 +4265,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
3995
4265
|
{
|
|
3996
4266
|
outName: `subpax_${designName}_diag1i`,
|
|
3997
4267
|
face: `${designName}_faceDiagI`,
|
|
3998
|
-
extrudeMethod:
|
|
4268
|
+
extrudeMethod: EExtrude10.eLinearOrtho,
|
|
3999
4269
|
length: diagL,
|
|
4000
4270
|
rotate: [diagA, 0, 0],
|
|
4001
4271
|
translate: [0, posX4, posY4]
|
|
@@ -4003,7 +4273,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
4003
4273
|
{
|
|
4004
4274
|
outName: `subpax_${designName}_diag2e`,
|
|
4005
4275
|
face: `${designName}_faceDiagE`,
|
|
4006
|
-
extrudeMethod:
|
|
4276
|
+
extrudeMethod: EExtrude10.eLinearOrtho,
|
|
4007
4277
|
length: diagL,
|
|
4008
4278
|
rotate: [-diagA, 0, 0],
|
|
4009
4279
|
translate: [0, -posX4, posY4]
|
|
@@ -4011,7 +4281,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
4011
4281
|
{
|
|
4012
4282
|
outName: `subpax_${designName}_diag2i`,
|
|
4013
4283
|
face: `${designName}_faceDiagI`,
|
|
4014
|
-
extrudeMethod:
|
|
4284
|
+
extrudeMethod: EExtrude10.eLinearOrtho,
|
|
4015
4285
|
length: diagL,
|
|
4016
4286
|
rotate: [-diagA, 0, 0],
|
|
4017
4287
|
translate: [0, -posX4, posY4]
|
|
@@ -4019,14 +4289,14 @@ function pGeom12(t, param, suffix = "") {
|
|
|
4019
4289
|
{
|
|
4020
4290
|
outName: `subpax_${designName}_cleanDiag`,
|
|
4021
4291
|
face: `${designName}_faceCleanDiag`,
|
|
4022
|
-
extrudeMethod:
|
|
4292
|
+
extrudeMethod: EExtrude10.eRotate,
|
|
4023
4293
|
rotate: [0, 0, 0],
|
|
4024
4294
|
translate: [0, 0, 0]
|
|
4025
4295
|
},
|
|
4026
4296
|
{
|
|
4027
4297
|
outName: `subpax_${designName}_hand1`,
|
|
4028
4298
|
face: `${designName}_faceHand`,
|
|
4029
|
-
extrudeMethod:
|
|
4299
|
+
extrudeMethod: EExtrude10.eLinearOrtho,
|
|
4030
4300
|
length: param.W8,
|
|
4031
4301
|
rotate: [pi2, 0, 0],
|
|
4032
4302
|
translate: [0, posX9[0] + param.W8, 0]
|
|
@@ -4034,7 +4304,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
4034
4304
|
{
|
|
4035
4305
|
outName: `subpax_${designName}_hand2`,
|
|
4036
4306
|
face: `${designName}_faceHand`,
|
|
4037
|
-
extrudeMethod:
|
|
4307
|
+
extrudeMethod: EExtrude10.eLinearOrtho,
|
|
4038
4308
|
length: param.W8,
|
|
4039
4309
|
rotate: [pi2, 0, 0],
|
|
4040
4310
|
translate: [0, posX9[1] + param.W8, 0]
|
|
@@ -4042,7 +4312,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
4042
4312
|
{
|
|
4043
4313
|
outName: `subpax_${designName}_hand3`,
|
|
4044
4314
|
face: `${designName}_faceHand`,
|
|
4045
|
-
extrudeMethod:
|
|
4315
|
+
extrudeMethod: EExtrude10.eLinearOrtho,
|
|
4046
4316
|
length: param.W8,
|
|
4047
4317
|
rotate: [pi2, 0, 0],
|
|
4048
4318
|
translate: [0, posX9[2] + param.W8, 0]
|
|
@@ -4050,7 +4320,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
4050
4320
|
{
|
|
4051
4321
|
outName: `subpax_${designName}_hand4`,
|
|
4052
4322
|
face: `${designName}_faceHand`,
|
|
4053
|
-
extrudeMethod:
|
|
4323
|
+
extrudeMethod: EExtrude10.eLinearOrtho,
|
|
4054
4324
|
length: param.W8,
|
|
4055
4325
|
rotate: [pi2, 0, 0],
|
|
4056
4326
|
translate: [0, posX9[3] + param.W8, 0]
|
|
@@ -4059,17 +4329,17 @@ function pGeom12(t, param, suffix = "") {
|
|
|
4059
4329
|
volumes: [
|
|
4060
4330
|
{
|
|
4061
4331
|
outName: `ipax_${designName}_bottomPolePlus`,
|
|
4062
|
-
boolMethod:
|
|
4332
|
+
boolMethod: EBVolume10.eUnion,
|
|
4063
4333
|
inList: [`subpax_${designName}_bottomDisc`, `subpax_${designName}_bottomPole`]
|
|
4064
4334
|
},
|
|
4065
4335
|
{
|
|
4066
4336
|
outName: `ipax_${designName}_bottomPart`,
|
|
4067
|
-
boolMethod:
|
|
4337
|
+
boolMethod: EBVolume10.eSubstraction,
|
|
4068
4338
|
inList: [`ipax_${designName}_bottomPolePlus`, `subpax_${designName}_door`]
|
|
4069
4339
|
},
|
|
4070
4340
|
{
|
|
4071
4341
|
outName: `ipax_${designName}_topPlus`,
|
|
4072
|
-
boolMethod:
|
|
4342
|
+
boolMethod: EBVolume10.eUnion,
|
|
4073
4343
|
inList: [
|
|
4074
4344
|
`subpax_${designName}_topPole`,
|
|
4075
4345
|
`subpax_${designName}_horizPole`,
|
|
@@ -4083,7 +4353,7 @@ function pGeom12(t, param, suffix = "") {
|
|
|
4083
4353
|
},
|
|
4084
4354
|
{
|
|
4085
4355
|
outName: `ipax_${designName}_topMinus`,
|
|
4086
|
-
boolMethod:
|
|
4356
|
+
boolMethod: EBVolume10.eUnion,
|
|
4087
4357
|
inList: [
|
|
4088
4358
|
`subpax_${designName}_horizPoleInt`,
|
|
4089
4359
|
`subpax_${designName}_diag1i`,
|
|
@@ -4093,12 +4363,12 @@ function pGeom12(t, param, suffix = "") {
|
|
|
4093
4363
|
},
|
|
4094
4364
|
{
|
|
4095
4365
|
outName: `ipax_${designName}_topPart`,
|
|
4096
|
-
boolMethod:
|
|
4366
|
+
boolMethod: EBVolume10.eSubstraction,
|
|
4097
4367
|
inList: [`ipax_${designName}_topPlus`, `ipax_${designName}_topMinus`]
|
|
4098
4368
|
},
|
|
4099
4369
|
{
|
|
4100
4370
|
outName: `pax_${designName}`,
|
|
4101
|
-
boolMethod:
|
|
4371
|
+
boolMethod: EBVolume10.eUnion,
|
|
4102
4372
|
inList: selectedList
|
|
4103
4373
|
}
|
|
4104
4374
|
]
|
|
@@ -4115,8 +4385,8 @@ function pGeom12(t, param, suffix = "") {
|
|
|
4115
4385
|
var heliostatDef = {
|
|
4116
4386
|
pTitle: "heliostat",
|
|
4117
4387
|
pDescription: "the structure of an heliostat",
|
|
4118
|
-
pDef:
|
|
4119
|
-
pGeom:
|
|
4388
|
+
pDef: pDef13,
|
|
4389
|
+
pGeom: pGeom13
|
|
4120
4390
|
};
|
|
4121
4391
|
|
|
4122
4392
|
// src/rccar/rccar.ts
|
|
@@ -4124,62 +4394,62 @@ import {
|
|
|
4124
4394
|
withinHPiHPi,
|
|
4125
4395
|
ShapePoint as ShapePoint2,
|
|
4126
4396
|
point as point7,
|
|
4127
|
-
contour as
|
|
4397
|
+
contour as contour15,
|
|
4128
4398
|
contourCircle as contourCircle11,
|
|
4129
|
-
ctrRectangle as
|
|
4130
|
-
figure as
|
|
4131
|
-
degToRad as
|
|
4132
|
-
ffix as
|
|
4133
|
-
pNumber as
|
|
4134
|
-
pCheckbox as
|
|
4135
|
-
pDropdown as
|
|
4136
|
-
pSectionSeparator as
|
|
4399
|
+
ctrRectangle as ctrRectangle7,
|
|
4400
|
+
figure as figure12,
|
|
4401
|
+
degToRad as degToRad7,
|
|
4402
|
+
ffix as ffix15,
|
|
4403
|
+
pNumber as pNumber14,
|
|
4404
|
+
pCheckbox as pCheckbox9,
|
|
4405
|
+
pDropdown as pDropdown8,
|
|
4406
|
+
pSectionSeparator as pSectionSeparator14,
|
|
4137
4407
|
transform3d,
|
|
4138
|
-
EExtrude as
|
|
4139
|
-
EBVolume as
|
|
4140
|
-
initGeom as
|
|
4408
|
+
EExtrude as EExtrude11,
|
|
4409
|
+
EBVolume as EBVolume11,
|
|
4410
|
+
initGeom as initGeom14
|
|
4141
4411
|
} from "geometrix";
|
|
4142
|
-
var
|
|
4412
|
+
var pDef14 = {
|
|
4143
4413
|
partName: "rccar",
|
|
4144
4414
|
params: [
|
|
4145
4415
|
//pNumber(name, unit, init, min, max, step)
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4416
|
+
pNumber14("N1", "unit", 4, 1, 12, 1),
|
|
4417
|
+
pNumber14("L1", "mm", 300, 10, 2e3, 1),
|
|
4418
|
+
pNumber14("W1", "mm", 1200, 10, 2e3, 1),
|
|
4419
|
+
pSectionSeparator14("General"),
|
|
4420
|
+
pDropdown8("gen3D", ["all", "platform", "bone", "hand", "motor", "wheel"]),
|
|
4421
|
+
pNumber14("T1", "mm", 10, 1, 100, 1),
|
|
4422
|
+
pNumber14("E1", "mm", 10, 1, 100, 1),
|
|
4423
|
+
pNumber14("E2", "mm", 10, 1, 500, 1),
|
|
4424
|
+
pNumber14("E3", "mm", 30, 1, 500, 1),
|
|
4425
|
+
pSectionSeparator14("Platform"),
|
|
4426
|
+
pNumber14("H1", "mm", 230, 10, 2e3, 1),
|
|
4427
|
+
pNumber14("W2", "mm", 100, 10, 2e3, 1),
|
|
4428
|
+
pCheckbox9("triangleInt", true),
|
|
4429
|
+
pCheckbox9("triangleExt", false),
|
|
4430
|
+
pSectionSeparator14("Bone"),
|
|
4431
|
+
pNumber14("D1", "mm", 20, 1, 200, 1),
|
|
4432
|
+
pNumber14("D2", "mm", 40, 1, 200, 1),
|
|
4433
|
+
pNumber14("W3", "mm", 30, 1, 200, 1),
|
|
4434
|
+
pNumber14("L2", "mm", 150, 1, 200, 1),
|
|
4435
|
+
pSectionSeparator14("Unit"),
|
|
4436
|
+
pNumber14("F1", "mm", 180, 1, 1e3, 1),
|
|
4437
|
+
pNumber14("Dwheel", "mm", 250, 10, 2e3, 1),
|
|
4438
|
+
pNumber14("Z1", "mm", 100, 10, 2e3, 1),
|
|
4439
|
+
pNumber14("Z2", "mm", 160, 10, 2e3, 1),
|
|
4440
|
+
pNumber14("Lwheel", "mm", 100, 10, 2e3, 1),
|
|
4441
|
+
pNumber14("Lmotor", "mm", 140, 10, 1e3, 1),
|
|
4442
|
+
pNumber14("Dsteering", "mm", 40, 1, 500, 1),
|
|
4443
|
+
pNumber14("Daxis", "mm", 20, 1, 500, 1),
|
|
4444
|
+
pSectionSeparator14("Angles"),
|
|
4445
|
+
pNumber14("aBoneMin", "degree", -40, -80, 0, 1),
|
|
4446
|
+
pNumber14("aBoneMax", "degree", 20, -80, 80, 1),
|
|
4447
|
+
pNumber14("aBoneLeft", "%", 0, 0, 100, 1),
|
|
4448
|
+
pNumber14("aBoneRight", "%", 0, 0, 100, 1),
|
|
4449
|
+
pDropdown8("wheel", ["straight", "turn"]),
|
|
4450
|
+
pNumber14("ra", "degree", 0, -90, 90, 1),
|
|
4451
|
+
pNumber14("rx", "cm", 0, -1e3, 1e3, 1),
|
|
4452
|
+
pNumber14("ry", "cm", 0, -1e3, 1e3, 1)
|
|
4183
4453
|
],
|
|
4184
4454
|
paramSvg: {
|
|
4185
4455
|
N1: "rccar_all_xy.svg",
|
|
@@ -4222,23 +4492,23 @@ var pDef13 = {
|
|
|
4222
4492
|
// every 0.5 second
|
|
4223
4493
|
}
|
|
4224
4494
|
};
|
|
4225
|
-
function
|
|
4226
|
-
const rGeome =
|
|
4227
|
-
const figPlatform =
|
|
4228
|
-
const figTriangle =
|
|
4229
|
-
const figPFfixation =
|
|
4230
|
-
const figBones =
|
|
4231
|
-
const figHandFixation =
|
|
4232
|
-
const figHandPlateR =
|
|
4233
|
-
const figHandPlateL =
|
|
4234
|
-
const figHandBackR =
|
|
4235
|
-
const figHandBackL =
|
|
4236
|
-
const figMotorBulkR =
|
|
4237
|
-
const figMotorBulkL =
|
|
4238
|
-
const figMFoot =
|
|
4239
|
-
const figWheel =
|
|
4240
|
-
const figTop =
|
|
4241
|
-
const figSide =
|
|
4495
|
+
function pGeom14(t, param, suffix = "") {
|
|
4496
|
+
const rGeome = initGeom14(pDef14.partName + suffix);
|
|
4497
|
+
const figPlatform = figure12();
|
|
4498
|
+
const figTriangle = figure12();
|
|
4499
|
+
const figPFfixation = figure12();
|
|
4500
|
+
const figBones = figure12();
|
|
4501
|
+
const figHandFixation = figure12();
|
|
4502
|
+
const figHandPlateR = figure12();
|
|
4503
|
+
const figHandPlateL = figure12();
|
|
4504
|
+
const figHandBackR = figure12();
|
|
4505
|
+
const figHandBackL = figure12();
|
|
4506
|
+
const figMotorBulkR = figure12();
|
|
4507
|
+
const figMotorBulkL = figure12();
|
|
4508
|
+
const figMFoot = figure12();
|
|
4509
|
+
const figWheel = figure12();
|
|
4510
|
+
const figTop = figure12();
|
|
4511
|
+
const figSide = figure12();
|
|
4242
4512
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
4243
4513
|
`;
|
|
4244
4514
|
try {
|
|
@@ -4258,20 +4528,20 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4258
4528
|
const dx2 = sign * param.T1 + dx1;
|
|
4259
4529
|
const dR2 = sign * R2;
|
|
4260
4530
|
const dW22d = tpL > 0 ? -dW22 - dx2 : dW22 + dx2;
|
|
4261
|
-
const rCtrExt =
|
|
4531
|
+
const rCtrExt = contour15(dW22c, 0, "green").addSegStrokeR(dx2, 0).addPointR(dR2, R2).addPointR(0, 2 * R2).addSegArc2().addSegStrokeR(-dx1, 0).addSegStrokeR(0, Z2b).addSegStrokeR(dx1, 0).addPointR(dR2, R2).addPointR(0, 2 * R2).addSegArc2().addSegStrokeR(-dx2, 0).closeSegStroke().translatePolar(tpA, tpL);
|
|
4262
4532
|
const rCtr1 = contourCircle11(dW22d, R2, R1).translatePolar(tpA, tpL);
|
|
4263
4533
|
const rCtr2 = contourCircle11(dW22d, Z2b + 3 * R2, R1).translatePolar(tpA, tpL);
|
|
4264
4534
|
return [rCtrExt, rCtr1, rCtr2];
|
|
4265
4535
|
}, makeHandPlate2 = function(az, addL, ipX, ipY) {
|
|
4266
|
-
const rCtrExt =
|
|
4536
|
+
const rCtrExt = contour15(ipX, ipY + F12).addPointR(-F12, -F12).addPointR(0, -2 * F12).addSegArc2().addSegStrokeR(F12 + addL, 0).addSegStrokeR(0, 2 * F12).closeSegStroke().rotate(ipX, ipY, az);
|
|
4267
4537
|
const rCtrHole = contourCircle11(ipX, ipY, Rsteering);
|
|
4268
4538
|
return [rCtrExt, rCtrHole];
|
|
4269
4539
|
}, makeMFoot2 = function(itx, ity) {
|
|
4270
|
-
const rCtrExt =
|
|
4540
|
+
const rCtrExt = contour15(itx - mFootR, ity, "green").addPointR(mFootR, -mFootR).addPointR(2 * mFootR, 0).addSegArc2().addSegStrokeR(F12 - mFootR, param.Z1 + param.T1 + param.E1).addSegStrokeR(0, motorHeight).addSegStrokeR(-2 * F12, 0).addSegStrokeR(0, -motorHeight).closeSegStroke();
|
|
4271
4541
|
const rCtrHole = contourCircle11(itx, ity, Raxis + param.E1);
|
|
4272
4542
|
return [rCtrExt, rCtrHole];
|
|
4273
4543
|
}, makeCtrWheel2 = function(xSign, ia, itx, ity) {
|
|
4274
|
-
const rCtr =
|
|
4544
|
+
const rCtr = contour15(itx, ity).addSegStrokeR(xSign * Raxis, 0).addSegStrokeR(0, mFootWidth + param.E3).addSegStrokeR(xSign * dWheelAxis, 0).addCornerRounded(roundedWheel).addSegStrokeR(0, param.Lwheel).addCornerRounded(roundedWheel).addSegStrokeR(-xSign * Rwheel, 0).closeSegStroke().rotate(itx, ity, ia);
|
|
4275
4545
|
return rCtr;
|
|
4276
4546
|
}, makeTopWheel2 = function(itx, ity, ia) {
|
|
4277
4547
|
const tL = param.Lmotor - mFootWidth;
|
|
@@ -4279,14 +4549,14 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4279
4549
|
const tSin = tL * Math.sin(ia);
|
|
4280
4550
|
const ctrWheel1 = makeCtrWheel2(1, -pi2 + ia, itx + tCos, ity + tSin);
|
|
4281
4551
|
const ctrWheel2 = makeCtrWheel2(-1, -pi2 + ia, itx + tCos, ity + tSin);
|
|
4282
|
-
const ctrMFootPre =
|
|
4552
|
+
const ctrMFootPre = ctrRectangle7(itx + tL, ity - F12, mFootWidth, 2 * F12);
|
|
4283
4553
|
const ctrMFoot = ctrMFootPre.rotate(itx, ity, ia);
|
|
4284
4554
|
return [ctrWheel1, ctrWheel2, ctrMFoot];
|
|
4285
4555
|
}, extrudeTriangle2 = function(posZ, idx) {
|
|
4286
4556
|
const rVol = {
|
|
4287
4557
|
outName: `subpax_${designName}_platformTriangle${idx}`,
|
|
4288
4558
|
face: `${designName}_faceTriangle`,
|
|
4289
|
-
extrudeMethod:
|
|
4559
|
+
extrudeMethod: EExtrude11.eLinearOrtho,
|
|
4290
4560
|
length: param.T1,
|
|
4291
4561
|
rotate: [0, 0, 0],
|
|
4292
4562
|
translate: [0, 0, posZ]
|
|
@@ -4296,7 +4566,7 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4296
4566
|
const rVol = {
|
|
4297
4567
|
outName: `subpax_${designName}_PFfixation${idx}`,
|
|
4298
4568
|
face: `${designName}_facePFfixation`,
|
|
4299
|
-
extrudeMethod:
|
|
4569
|
+
extrudeMethod: EExtrude11.eLinearOrtho,
|
|
4300
4570
|
length: param.T1,
|
|
4301
4571
|
rotate: [0, 0, 0],
|
|
4302
4572
|
translate: [0, 0, posZ]
|
|
@@ -4306,7 +4576,7 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4306
4576
|
const rVol = {
|
|
4307
4577
|
outName: `subpax_${designName}_bones${idx}`,
|
|
4308
4578
|
face: `${designName}_faceBones`,
|
|
4309
|
-
extrudeMethod:
|
|
4579
|
+
extrudeMethod: EExtrude11.eLinearOrtho,
|
|
4310
4580
|
length: param.T1,
|
|
4311
4581
|
rotate: [0, 0, 0],
|
|
4312
4582
|
translate: [0, 0, posZ]
|
|
@@ -4316,7 +4586,7 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4316
4586
|
const rVol = {
|
|
4317
4587
|
outName: `subpax_${designName}_handFixation${idx}`,
|
|
4318
4588
|
face: `${designName}_faceHandFixation`,
|
|
4319
|
-
extrudeMethod:
|
|
4589
|
+
extrudeMethod: EExtrude11.eLinearOrtho,
|
|
4320
4590
|
length: param.T1,
|
|
4321
4591
|
rotate: [0, 0, 0],
|
|
4322
4592
|
translate: [0, 0, posZ]
|
|
@@ -4326,7 +4596,7 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4326
4596
|
const rVol = {
|
|
4327
4597
|
outName: `subpax_${designName}_handPlate${iRL}${idx}`,
|
|
4328
4598
|
face: `${designName}_faceHandPlate${iRL}`,
|
|
4329
|
-
extrudeMethod:
|
|
4599
|
+
extrudeMethod: EExtrude11.eLinearOrtho,
|
|
4330
4600
|
length: param.T1,
|
|
4331
4601
|
rotate: [pi2, 0, 0],
|
|
4332
4602
|
translate: [0, posY + param.T1, 0]
|
|
@@ -4336,7 +4606,7 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4336
4606
|
const rVol = {
|
|
4337
4607
|
outName: `subpax_${designName}_handBack${iRL}`,
|
|
4338
4608
|
face: `${designName}_faceHandBack${iRL}`,
|
|
4339
|
-
extrudeMethod:
|
|
4609
|
+
extrudeMethod: EExtrude11.eLinearOrtho,
|
|
4340
4610
|
length: param.Z2,
|
|
4341
4611
|
rotate: [pi2, 0, 0],
|
|
4342
4612
|
translate: [0, posY + param.T1, 0]
|
|
@@ -4346,7 +4616,7 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4346
4616
|
const rVol = {
|
|
4347
4617
|
outName: `subpax_${designName}_motorBulk${iRL}`,
|
|
4348
4618
|
face: `${designName}_faceMotorBulk${iRL}`,
|
|
4349
|
-
extrudeMethod:
|
|
4619
|
+
extrudeMethod: EExtrude11.eLinearOrtho,
|
|
4350
4620
|
length: motorHeight,
|
|
4351
4621
|
rotate: [pi2, 0, 0],
|
|
4352
4622
|
translate: [0, posY - param.E1, 0]
|
|
@@ -4360,7 +4630,7 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4360
4630
|
const rVol = {
|
|
4361
4631
|
outName: `subpax_${designName}_mFoot${idx}`,
|
|
4362
4632
|
face: `${designName}_faceMFoot`,
|
|
4363
|
-
extrudeMethod:
|
|
4633
|
+
extrudeMethod: EExtrude11.eLinearOrtho,
|
|
4364
4634
|
length: mFootWidth,
|
|
4365
4635
|
rotate: tm.getRotation(),
|
|
4366
4636
|
translate: tm.getTranslation()
|
|
@@ -4374,7 +4644,7 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4374
4644
|
const rVol = {
|
|
4375
4645
|
outName: `subpax_${designName}_wheel${idx}`,
|
|
4376
4646
|
face: `${designName}_faceWheel`,
|
|
4377
|
-
extrudeMethod:
|
|
4647
|
+
extrudeMethod: EExtrude11.eRotate,
|
|
4378
4648
|
rotate: tm.getRotation(),
|
|
4379
4649
|
translate: tm.getTranslation()
|
|
4380
4650
|
};
|
|
@@ -4407,13 +4677,13 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4407
4677
|
const Rsteering = param.Dsteering / 2;
|
|
4408
4678
|
const Z2b = param.Z2 - 4 * R2;
|
|
4409
4679
|
const Z2c = param.Z2 - param.T1;
|
|
4410
|
-
const AbMin =
|
|
4411
|
-
const AbMax =
|
|
4680
|
+
const AbMin = degToRad7(param.aBoneMin);
|
|
4681
|
+
const AbMax = degToRad7(param.aBoneMax);
|
|
4412
4682
|
const posZplatform = Rwheel + param.Z1 + param.L2 * Math.sin(AbMin);
|
|
4413
4683
|
const Hplatform = posZplatform + param.H1;
|
|
4414
4684
|
const W32 = param.W3 / 2;
|
|
4415
4685
|
if (R2 < W32) {
|
|
4416
|
-
throw `err152: D2 ${
|
|
4686
|
+
throw `err152: D2 ${ffix15(param.D2)} is too small compare to W3 ${ffix15(param.W3)} mm`;
|
|
4417
4687
|
}
|
|
4418
4688
|
const W32X = Math.sqrt(R2 ** 2 - W32 ** 2);
|
|
4419
4689
|
const L2b = param.L2 - 2 * W32X;
|
|
@@ -4426,7 +4696,7 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4426
4696
|
const boneSideyRs = param.L2 * Math.sin(aBR);
|
|
4427
4697
|
const boneSideyLs = param.L2 * Math.sin(aBL);
|
|
4428
4698
|
const boneSideyR = 2 * R2 * Math.sign(aBR) + boneSideyRs;
|
|
4429
|
-
const ra =
|
|
4699
|
+
const ra = degToRad7(param.ra);
|
|
4430
4700
|
const rx10 = 10 * param.rx;
|
|
4431
4701
|
const ry10 = 10 * param.ry;
|
|
4432
4702
|
const hPlen = 2 * F12 + param.E2 + param.T1;
|
|
@@ -4461,47 +4731,47 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4461
4731
|
const dWheelAxis = Rwheel - Raxis;
|
|
4462
4732
|
const roundedWheel = Math.min(param.Lwheel / 3, dWheelAxis / 2);
|
|
4463
4733
|
if (LF2 < 0.1) {
|
|
4464
|
-
throw `err176: L1 ${
|
|
4734
|
+
throw `err176: L1 ${ffix15(param.L1)} is too small compare to F1 ${ffix15(param.F1)} mm`;
|
|
4465
4735
|
}
|
|
4466
4736
|
if (param.H1 < param.Z2 + param.T1) {
|
|
4467
|
-
throw `err130: H1 ${
|
|
4737
|
+
throw `err130: H1 ${ffix15(param.H1)} is too small compare to Z2 ${ffix15(param.Z2)} and T1 ${ffix15(param.T1)} mm`;
|
|
4468
4738
|
}
|
|
4469
4739
|
if (Z2b < 0.1) {
|
|
4470
|
-
throw `err149: Z2 ${
|
|
4740
|
+
throw `err149: Z2 ${ffix15(param.Z2)} is too small compare to D2 ${ffix15(param.D2)} mm`;
|
|
4471
4741
|
}
|
|
4472
4742
|
if (W2c < 0.1) {
|
|
4473
|
-
throw `err153: W2 ${
|
|
4743
|
+
throw `err153: W2 ${ffix15(param.W2)} is too small compare to T1 ${ffix15(param.T1)} mm`;
|
|
4474
4744
|
}
|
|
4475
4745
|
if (H1c < 0.1) {
|
|
4476
|
-
throw `err156: H1c ${
|
|
4746
|
+
throw `err156: H1c ${ffix15(param.H1)} is too small compare to T1 ${ffix15(param.T1)} mm`;
|
|
4477
4747
|
}
|
|
4478
4748
|
if (F1b < 0.1) {
|
|
4479
|
-
throw `err167: F1 ${
|
|
4749
|
+
throw `err167: F1 ${ffix15(param.F1)} is too small compare to T1 ${ffix15(param.T1)} and E1 ${ffix15(param.E1)} mm`;
|
|
4480
4750
|
}
|
|
4481
4751
|
if (AbMax < AbMin) {
|
|
4482
|
-
throw `err181: aBoneMax ${
|
|
4752
|
+
throw `err181: aBoneMax ${ffix15(param.aBoneMax)} is too small compare to aBoneMin ${ffix15(param.BoneMin)} degree`;
|
|
4483
4753
|
}
|
|
4484
4754
|
if (mFootWidth < param.T1) {
|
|
4485
|
-
throw `err218: Lmotor ${
|
|
4755
|
+
throw `err218: Lmotor ${ffix15(param.Lmotor)} is too small compare to F1 ${ffix15(param.F1)}`;
|
|
4486
4756
|
}
|
|
4487
4757
|
if (motorHeight < param.T1) {
|
|
4488
|
-
throw `err226: Z2 ${
|
|
4758
|
+
throw `err226: Z2 ${ffix15(param.Z2)} is too small compare to T1 ${ffix15(param.T1)} and E1 ${ffix15(param.E1)} mm`;
|
|
4489
4759
|
}
|
|
4490
4760
|
if (param.Z1 < mFootR) {
|
|
4491
|
-
throw `err256: Z1 ${
|
|
4761
|
+
throw `err256: Z1 ${ffix15(param.Z1)} is too small compare to mFootR ${ffix15(mFootR)} mm`;
|
|
4492
4762
|
}
|
|
4493
4763
|
if (Rwheel < mFootR) {
|
|
4494
|
-
throw `err259: Dwheel ${
|
|
4764
|
+
throw `err259: Dwheel ${ffix15(param.Dwheel)} is too small compare to mFootR ${ffix15(mFootR)} mm`;
|
|
4495
4765
|
}
|
|
4496
|
-
rGeome.logstr += `Platform Ltotal ${
|
|
4766
|
+
rGeome.logstr += `Platform Ltotal ${ffix15(Ltotal / 1e3)} m, surface ${ffix15(platSurface)} m2
|
|
4497
4767
|
`;
|
|
4498
|
-
rGeome.logstr += `Hplatform ${
|
|
4768
|
+
rGeome.logstr += `Hplatform ${ffix15(Hplatform)} mm
|
|
4499
4769
|
`;
|
|
4500
|
-
const ctrPlatformMain =
|
|
4501
|
-
const ctrPlatformInt =
|
|
4770
|
+
const ctrPlatformMain = contour15(-W22, 0).addSegStrokeR(param.W2, 0).addSegStrokeR(0, H1b).addSegStrokeR(W22b, 0).addSegStrokeR(0, param.T1).addSegStrokeR(-param.W1, 0).addSegStrokeR(0, -param.T1).addSegStrokeR(W22b, 0).closeSegStroke();
|
|
4771
|
+
const ctrPlatformInt = ctrRectangle7(-W22 + param.T1, param.T1, W2c, H1c);
|
|
4502
4772
|
figPlatform.addMainOI([ctrPlatformMain, ctrPlatformInt]);
|
|
4503
|
-
const ctrTriangleL =
|
|
4504
|
-
const ctrTriangleR =
|
|
4773
|
+
const ctrTriangleL = contour15(-W22, 0).addSegStrokeR(param.T1, 0).addSegStrokeR(0, param.H1).addSegStrokeR(-W22b - param.T1, 0).addSegStrokeR(0, -param.T1).closeSegStroke();
|
|
4774
|
+
const ctrTriangleR = contour15(W22, 0).addSegStrokeR(W22b, H1b).addSegStrokeR(0, param.T1).addSegStrokeR(-W22b - param.T1, 0).addSegStrokeR(0, -param.H1).closeSegStroke();
|
|
4505
4775
|
figTriangle.addMainO(ctrTriangleL);
|
|
4506
4776
|
figTriangle.addMainO(ctrTriangleR);
|
|
4507
4777
|
figPlatform.addSecond(ctrTriangleL);
|
|
@@ -4509,7 +4779,7 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4509
4779
|
figPFfixation.addMainOI(makePFfixExt2(1, 0, 0));
|
|
4510
4780
|
figPFfixation.addMainOI(makePFfixExt2(-1, 0, 0));
|
|
4511
4781
|
figPlatform.mergeFigure(figPFfixation, true);
|
|
4512
|
-
const ctrBone =
|
|
4782
|
+
const ctrBone = contour15(W32X, W32).addPointR(-W32X - R2, -W32).addPointR(0, -2 * W32).addSegArc2().addSegStrokeR(L2b, 0).addPointR(W32X + R2, W32).addPointR(0, 2 * W32).addSegArc2().closeSegStroke();
|
|
4513
4783
|
const ctrBoneR = ctrBone.rotate(0, 0, aBR);
|
|
4514
4784
|
const ctrBoneL = ctrBone.rotate(0, 0, aBL);
|
|
4515
4785
|
const ptR1 = point7(W22 + param.E2 + R2, R2);
|
|
@@ -4549,17 +4819,17 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4549
4819
|
figHandPlateR.addMainOI(makeHandPlate2(pi, param.T1 + param.E2, hPposR, tPosY));
|
|
4550
4820
|
figHandPlateL.addMainOI(makeHandPlate2(0, param.T1 + param.E2, hPposL, tPosY));
|
|
4551
4821
|
}
|
|
4552
|
-
figPlatform.addSecond(
|
|
4553
|
-
figPlatform.addSecond(
|
|
4554
|
-
figPlatform.addSecond(
|
|
4555
|
-
figPlatform.addSecond(
|
|
4822
|
+
figPlatform.addSecond(ctrRectangle7(hBposR, boneSideyRs, hPlen, param.T1));
|
|
4823
|
+
figPlatform.addSecond(ctrRectangle7(hBposR, boneSideyRs + Z2c, hPlen, param.T1));
|
|
4824
|
+
figPlatform.addSecond(ctrRectangle7(hBposL - hPlen, boneSideyLs, hPlen, param.T1));
|
|
4825
|
+
figPlatform.addSecond(ctrRectangle7(hBposL - hPlen, boneSideyLs + Z2c, hPlen, param.T1));
|
|
4556
4826
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
4557
4827
|
const tPosY = ii * (param.L1 + param.T1) + param.T1 + LF2;
|
|
4558
|
-
figHandBackR.addMainO(
|
|
4559
|
-
figHandBackL.addMainO(
|
|
4828
|
+
figHandBackR.addMainO(ctrRectangle7(hBposR, tPosY, param.T1, 2 * F12));
|
|
4829
|
+
figHandBackL.addMainO(ctrRectangle7(hBposL - param.T1, tPosY, param.T1, 2 * F12));
|
|
4560
4830
|
}
|
|
4561
|
-
figPlatform.addSecond(
|
|
4562
|
-
figPlatform.addSecond(
|
|
4831
|
+
figPlatform.addSecond(ctrRectangle7(hBposR, boneSideyRs, param.T1, param.Z2));
|
|
4832
|
+
figPlatform.addSecond(ctrRectangle7(hBposL - param.T1, boneSideyLs, param.T1, param.Z2));
|
|
4563
4833
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
4564
4834
|
const tPosY = ii * (param.L1 + param.T1) + param.T1 + param.L1 / 2;
|
|
4565
4835
|
figMotorBulkR.addMainOI(makeHandPlate2(wheelRA[ii], motorExtraL, hPposR, tPosY));
|
|
@@ -4569,14 +4839,14 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4569
4839
|
const mBRpY = boneSideyRs + param.T1 + param.E1;
|
|
4570
4840
|
const mBLpX = hBposL - param.T1 - param.E2 - motorLen;
|
|
4571
4841
|
const mBLpY = boneSideyLs + param.T1 + param.E1;
|
|
4572
|
-
figPlatform.addSecond(
|
|
4573
|
-
figPlatform.addSecond(
|
|
4842
|
+
figPlatform.addSecond(ctrRectangle7(mBRpX, mBRpY, motorLen, motorHeight));
|
|
4843
|
+
figPlatform.addSecond(ctrRectangle7(mBLpX, mBLpY, motorLen, motorHeight));
|
|
4574
4844
|
const mFRpX = mBRpX + F12 + param.Lmotor - mFootWidth;
|
|
4575
4845
|
const mFRpY = boneSideyRs - param.Z1 - mFootR;
|
|
4576
4846
|
const mFLpX = mBLpX;
|
|
4577
4847
|
const mFLpY = boneSideyLs - param.Z1 - mFootR;
|
|
4578
|
-
figPlatform.addSecond(
|
|
4579
|
-
figPlatform.addSecond(
|
|
4848
|
+
figPlatform.addSecond(ctrRectangle7(mFRpX, mFRpY, mFootWidth, mFootHeight));
|
|
4849
|
+
figPlatform.addSecond(ctrRectangle7(mFLpX, mFLpY, mFootWidth, mFootHeight));
|
|
4580
4850
|
figMFoot.addMainOI(makeMFoot2(0, 0));
|
|
4581
4851
|
figWheel.addMainO(makeCtrWheel2(1, 0, 0, 0));
|
|
4582
4852
|
figWheel.addSecond(makeCtrWheel2(-1, 0, 0, 0));
|
|
@@ -4585,22 +4855,22 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4585
4855
|
figPlatform.addSecond(makeCtrWheel2(1, pi2, mFLpX + mFootWidth, mFLpY + mFootR));
|
|
4586
4856
|
figPlatform.addSecond(makeCtrWheel2(-1, pi2, mFLpX + mFootWidth, mFLpY + mFootR));
|
|
4587
4857
|
figTop.addMainOI([
|
|
4588
|
-
|
|
4589
|
-
|
|
4858
|
+
ctrRectangle7(-W12, 0, param.W1, Ltotal),
|
|
4859
|
+
ctrRectangle7(-W22 + param.T1, 0, W2c, Ltotal)
|
|
4590
4860
|
]);
|
|
4591
|
-
figTop.addSecond(
|
|
4861
|
+
figTop.addSecond(ctrRectangle7(-W22, 0, param.W2, Ltotal));
|
|
4592
4862
|
if (param.triangleExt) {
|
|
4593
4863
|
for (let ii = 0; ii < 2; ii++) {
|
|
4594
4864
|
const tPosY = ii * (param.L1 + param.T1) * param.N1;
|
|
4595
|
-
figTop.addSecond(
|
|
4596
|
-
figTop.addSecond(
|
|
4865
|
+
figTop.addSecond(ctrRectangle7(-W12, tPosY, W22b, param.T1));
|
|
4866
|
+
figTop.addSecond(ctrRectangle7(W22, tPosY, W22b, param.T1));
|
|
4597
4867
|
}
|
|
4598
4868
|
}
|
|
4599
4869
|
if (param.triangleInt) {
|
|
4600
4870
|
for (let ii = 1; ii < param.N1; ii++) {
|
|
4601
4871
|
const tPosY = ii * (param.L1 + param.T1);
|
|
4602
|
-
figTop.addSecond(
|
|
4603
|
-
figTop.addSecond(
|
|
4872
|
+
figTop.addSecond(ctrRectangle7(-W12, tPosY, W22b, param.T1));
|
|
4873
|
+
figTop.addSecond(ctrRectangle7(W22, tPosY, W22b, param.T1));
|
|
4604
4874
|
}
|
|
4605
4875
|
}
|
|
4606
4876
|
const tL2 = param.E2 + 2 * R2;
|
|
@@ -4609,8 +4879,8 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4609
4879
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
4610
4880
|
for (const tPosY2 of [LF2, LF23, LF25, LF28]) {
|
|
4611
4881
|
const tPosY3 = tPosY + tPosY2;
|
|
4612
|
-
figTop.addSecond(
|
|
4613
|
-
figTop.addSecond(
|
|
4882
|
+
figTop.addSecond(ctrRectangle7(W22, tPosY3, tL2, param.T1));
|
|
4883
|
+
figTop.addSecond(ctrRectangle7(tPosX2, tPosY3, tL2, param.T1));
|
|
4614
4884
|
}
|
|
4615
4885
|
}
|
|
4616
4886
|
const tPosX3 = -W22 - param.E2 - boneTopxL;
|
|
@@ -4618,16 +4888,16 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4618
4888
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
4619
4889
|
for (const tPosY2 of [LF2, LF25]) {
|
|
4620
4890
|
const tPosY3 = tPosY + tPosY2 + param.T1 + param.E1;
|
|
4621
|
-
figTop.addSecond(
|
|
4622
|
-
figTop.addSecond(
|
|
4891
|
+
figTop.addSecond(ctrRectangle7(W22 + param.E2, tPosY3, boneTopxR, param.T1));
|
|
4892
|
+
figTop.addSecond(ctrRectangle7(tPosX3, tPosY3, boneTopxL, param.T1));
|
|
4623
4893
|
}
|
|
4624
4894
|
}
|
|
4625
4895
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
4626
4896
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
4627
4897
|
for (const tPosY2 of [LF2, LF23, LF25, LF28]) {
|
|
4628
4898
|
const tPosY3 = tPosY + tPosY2;
|
|
4629
|
-
figTop.addSecond(
|
|
4630
|
-
figTop.addSecond(
|
|
4899
|
+
figTop.addSecond(ctrRectangle7(hFposR, tPosY3, tL2, param.T1));
|
|
4900
|
+
figTop.addSecond(ctrRectangle7(hFposL, tPosY3, tL2, param.T1));
|
|
4631
4901
|
}
|
|
4632
4902
|
}
|
|
4633
4903
|
figTop.mergeFigure(figHandPlateR, true);
|
|
@@ -4646,18 +4916,18 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4646
4916
|
figTop.addSecond(iCtr);
|
|
4647
4917
|
}
|
|
4648
4918
|
}
|
|
4649
|
-
figSide.addMainO(
|
|
4650
|
-
figSide.addSecond(
|
|
4919
|
+
figSide.addMainO(ctrRectangle7(0, 0, Ltotal, param.H1));
|
|
4920
|
+
figSide.addSecond(ctrRectangle7(0, H1b, Ltotal, param.T1));
|
|
4651
4921
|
if (param.triangleExt) {
|
|
4652
4922
|
for (let ii = 0; ii < 2; ii++) {
|
|
4653
4923
|
const tPosY = ii * (param.L1 + param.T1) * param.N1;
|
|
4654
|
-
figSide.addSecond(
|
|
4924
|
+
figSide.addSecond(ctrRectangle7(tPosY, 0, param.T1, H1b));
|
|
4655
4925
|
}
|
|
4656
4926
|
}
|
|
4657
4927
|
if (param.triangleInt) {
|
|
4658
4928
|
for (let ii = 1; ii < param.N1; ii++) {
|
|
4659
4929
|
const tPosY = ii * (param.L1 + param.T1);
|
|
4660
|
-
figSide.addSecond(
|
|
4930
|
+
figSide.addSecond(ctrRectangle7(tPosY, 0, param.T1, H1b));
|
|
4661
4931
|
}
|
|
4662
4932
|
}
|
|
4663
4933
|
const tH2 = 2 * R2;
|
|
@@ -4665,8 +4935,8 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4665
4935
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
4666
4936
|
for (const tPosY2 of [LF2, LF23, LF25, LF28]) {
|
|
4667
4937
|
const tPosY3 = tPosY + tPosY2;
|
|
4668
|
-
figSide.addSecond(
|
|
4669
|
-
figSide.addSecond(
|
|
4938
|
+
figSide.addSecond(ctrRectangle7(tPosY3, 0, param.T1, tH2));
|
|
4939
|
+
figSide.addSecond(ctrRectangle7(tPosY3, tH2 + Z2b, param.T1, tH2));
|
|
4670
4940
|
}
|
|
4671
4941
|
}
|
|
4672
4942
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
@@ -4674,12 +4944,12 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4674
4944
|
for (const tPosY2 of [LF2, LF25]) {
|
|
4675
4945
|
const tPosY3 = tPosY + tPosY2 + param.T1 + param.E1;
|
|
4676
4946
|
if (boneSideyR > 0) {
|
|
4677
|
-
figSide.addSecond(
|
|
4678
|
-
figSide.addSecond(
|
|
4947
|
+
figSide.addSecond(ctrRectangle7(tPosY3, 0, param.T1, boneSideyR));
|
|
4948
|
+
figSide.addSecond(ctrRectangle7(tPosY3, 2 * R2 + Z2b, param.T1, boneSideyR));
|
|
4679
4949
|
} else {
|
|
4680
4950
|
const tLy = -boneSideyR;
|
|
4681
|
-
figSide.addSecond(
|
|
4682
|
-
figSide.addSecond(
|
|
4951
|
+
figSide.addSecond(ctrRectangle7(tPosY3, 2 * R2 - tLy, param.T1, tLy));
|
|
4952
|
+
figSide.addSecond(ctrRectangle7(tPosY3, 4 * R2 + Z2b - tLy, param.T1, tLy));
|
|
4683
4953
|
}
|
|
4684
4954
|
}
|
|
4685
4955
|
}
|
|
@@ -4687,8 +4957,8 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4687
4957
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
4688
4958
|
for (const tPosY2 of [LF2, LF23, LF25, LF28]) {
|
|
4689
4959
|
const tPosY3 = tPosY + tPosY2;
|
|
4690
|
-
figSide.addSecond(
|
|
4691
|
-
figSide.addSecond(
|
|
4960
|
+
figSide.addSecond(ctrRectangle7(tPosY3, boneSideyRs, param.T1, tH2));
|
|
4961
|
+
figSide.addSecond(ctrRectangle7(tPosY3, boneSideyRs + tH2 + Z2b, param.T1, tH2));
|
|
4692
4962
|
}
|
|
4693
4963
|
}
|
|
4694
4964
|
const ZhpR = [boneSideyRs, boneSideyRs + Z2c];
|
|
@@ -4696,10 +4966,10 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4696
4966
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
4697
4967
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
4698
4968
|
const tPosY3 = tPosY + LF2;
|
|
4699
|
-
figSide.addSecond(
|
|
4700
|
-
figSide.addSecond(
|
|
4701
|
-
figSide.addSecond(
|
|
4702
|
-
figSide.addSecond(
|
|
4969
|
+
figSide.addSecond(ctrRectangle7(tPosY3, ZhpR[0], param.F1, param.T1));
|
|
4970
|
+
figSide.addSecond(ctrRectangle7(tPosY3, ZhpR[1], param.F1, param.T1));
|
|
4971
|
+
figSide.addSecond(ctrRectangle7(tPosY3, ZhpR[0], param.F1, param.Z2));
|
|
4972
|
+
figSide.addSecond(ctrRectangle7(tPosY3, mBRpY, param.F1, motorHeight));
|
|
4703
4973
|
const axisX = tPosY + param.L1 / 2;
|
|
4704
4974
|
const axisY = ZhpR[0] - param.Z1;
|
|
4705
4975
|
for (const iCtr of makeMFoot2(axisX, axisY)) {
|
|
@@ -4731,7 +5001,7 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4731
5001
|
const volPlatformMain = {
|
|
4732
5002
|
outName: `subpax_${designName}_platformMain`,
|
|
4733
5003
|
face: `${designName}_facePlatform`,
|
|
4734
|
-
extrudeMethod:
|
|
5004
|
+
extrudeMethod: EExtrude11.eLinearOrtho,
|
|
4735
5005
|
length: Ltotal,
|
|
4736
5006
|
rotate: [0, 0, 0],
|
|
4737
5007
|
translate: [0, 0, 0]
|
|
@@ -4846,7 +5116,7 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4846
5116
|
volumes: [
|
|
4847
5117
|
{
|
|
4848
5118
|
outName: `pax_${designName}`,
|
|
4849
|
-
boolMethod:
|
|
5119
|
+
boolMethod: EBVolume11.eUnion,
|
|
4850
5120
|
inList: list3D
|
|
4851
5121
|
}
|
|
4852
5122
|
]
|
|
@@ -4863,36 +5133,36 @@ function pGeom13(t, param, suffix = "") {
|
|
|
4863
5133
|
var rccarDef = {
|
|
4864
5134
|
pTitle: "rccar",
|
|
4865
5135
|
pDescription: "high-level concept of the RC-car",
|
|
4866
|
-
pDef:
|
|
4867
|
-
pGeom:
|
|
5136
|
+
pDef: pDef14,
|
|
5137
|
+
pGeom: pGeom14
|
|
4868
5138
|
};
|
|
4869
5139
|
|
|
4870
5140
|
// src/rccar/singleBone.ts
|
|
4871
5141
|
import {
|
|
4872
|
-
contour as
|
|
5142
|
+
contour as contour16,
|
|
4873
5143
|
contourCircle as contourCircle12,
|
|
4874
|
-
figure as
|
|
4875
|
-
ffix as
|
|
4876
|
-
pNumber as
|
|
4877
|
-
pSectionSeparator as
|
|
4878
|
-
EExtrude as
|
|
4879
|
-
EBVolume as
|
|
4880
|
-
initGeom as
|
|
5144
|
+
figure as figure13,
|
|
5145
|
+
ffix as ffix16,
|
|
5146
|
+
pNumber as pNumber15,
|
|
5147
|
+
pSectionSeparator as pSectionSeparator15,
|
|
5148
|
+
EExtrude as EExtrude12,
|
|
5149
|
+
EBVolume as EBVolume12,
|
|
5150
|
+
initGeom as initGeom15
|
|
4881
5151
|
} from "geometrix";
|
|
4882
|
-
var
|
|
5152
|
+
var pDef15 = {
|
|
4883
5153
|
partName: "singleBone",
|
|
4884
5154
|
params: [
|
|
4885
5155
|
//pNumber(name, unit, init, min, max, step)
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
5156
|
+
pNumber15("D1", "mm", 30, 1, 500, 1),
|
|
5157
|
+
pNumber15("D2", "mm", 70, 1, 500, 1),
|
|
5158
|
+
pNumber15("L1", "mm", 200, 10, 1e3, 1),
|
|
5159
|
+
pSectionSeparator15("Details"),
|
|
5160
|
+
pNumber15("R3", "mm", 50, 0, 1e3, 1),
|
|
5161
|
+
pNumber15("W1", "mm", 30, 1, 500, 1),
|
|
5162
|
+
pNumber15("T1", "mm", 10, 1, 100, 1),
|
|
5163
|
+
pSectionSeparator15("Holes"),
|
|
5164
|
+
pNumber15("P2", "%", 50, 0, 99, 1),
|
|
5165
|
+
pNumber15("W2", "mm", 10, 1, 500, 1)
|
|
4896
5166
|
],
|
|
4897
5167
|
paramSvg: {
|
|
4898
5168
|
D1: "singleBone_face.svg",
|
|
@@ -4911,9 +5181,9 @@ var pDef14 = {
|
|
|
4911
5181
|
// every 0.5 second
|
|
4912
5182
|
}
|
|
4913
5183
|
};
|
|
4914
|
-
function
|
|
4915
|
-
const rGeome =
|
|
4916
|
-
const figBone =
|
|
5184
|
+
function pGeom15(t, param, suffix = "") {
|
|
5185
|
+
const rGeome = initGeom15(pDef15.partName + suffix);
|
|
5186
|
+
const figBone = figure13();
|
|
4917
5187
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
4918
5188
|
`;
|
|
4919
5189
|
try {
|
|
@@ -4923,7 +5193,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4923
5193
|
const boneLen = param.L1 + 2 * R22;
|
|
4924
5194
|
const dX2 = R22 ** 2 - W12 ** 2;
|
|
4925
5195
|
if (dX2 < 0) {
|
|
4926
|
-
throw `err086: D2 ${
|
|
5196
|
+
throw `err086: D2 ${ffix16(param.D2)} is too small compare to W1 ${ffix16(param.W1)} mm`;
|
|
4927
5197
|
}
|
|
4928
5198
|
const dX = Math.sqrt(dX2);
|
|
4929
5199
|
const L1b = param.L1 - 2 * dX;
|
|
@@ -4934,18 +5204,18 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4934
5204
|
const hX0b = R22 + W2b + Rh;
|
|
4935
5205
|
const hX1b = W2b + 2 * Rh;
|
|
4936
5206
|
if (R22 < R12) {
|
|
4937
|
-
throw `err085: D2 ${
|
|
5207
|
+
throw `err085: D2 ${ffix16(param.D2)} is too small compare to D1 ${ffix16(param.D1)} mm`;
|
|
4938
5208
|
}
|
|
4939
5209
|
if (L1b < 0) {
|
|
4940
|
-
throw `err095: L1 ${
|
|
5210
|
+
throw `err095: L1 ${ffix16(param.L1)} is too small compare to D2 ${ffix16(param.D2)} mm`;
|
|
4941
5211
|
}
|
|
4942
|
-
rGeome.logstr += `Bone length ${
|
|
5212
|
+
rGeome.logstr += `Bone length ${ffix16(boneLen)} mm
|
|
4943
5213
|
`;
|
|
4944
|
-
rGeome.logstr += `Bone with N2 ${N2} holes of diameter ${
|
|
5214
|
+
rGeome.logstr += `Bone with N2 ${N2} holes of diameter ${ffix16(2 * Rh)} mm
|
|
4945
5215
|
`;
|
|
4946
|
-
rGeome.logstr += `Bone W2b ${
|
|
5216
|
+
rGeome.logstr += `Bone W2b ${ffix16(W2b)} mm
|
|
4947
5217
|
`;
|
|
4948
|
-
const ctrBone =
|
|
5218
|
+
const ctrBone = contour16(dX, W12).addCornerRounded(param.R3).addPointR(-dX - R22, -W12).addPointR(0, -2 * W12).addSegArc2().addCornerRounded(param.R3).addSegStrokeR(L1b, 0).addCornerRounded(param.R3).addPointR(dX + R22, W12).addPointR(0, 2 * W12).addSegArc2().addCornerRounded(param.R3).closeSegStroke();
|
|
4949
5219
|
const ctrAxis1 = contourCircle12(0, 0, R12);
|
|
4950
5220
|
const ctrAxis2 = contourCircle12(param.L1, 0, R12);
|
|
4951
5221
|
const ctrMinis = [];
|
|
@@ -4964,7 +5234,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4964
5234
|
{
|
|
4965
5235
|
outName: `subpax_${designName}_bone`,
|
|
4966
5236
|
face: `${designName}_faceBone`,
|
|
4967
|
-
extrudeMethod:
|
|
5237
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
4968
5238
|
length: param.T1,
|
|
4969
5239
|
rotate: [0, 0, 0],
|
|
4970
5240
|
translate: [0, 0, 0]
|
|
@@ -4973,7 +5243,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4973
5243
|
volumes: [
|
|
4974
5244
|
{
|
|
4975
5245
|
outName: `pax_${designName}`,
|
|
4976
|
-
boolMethod:
|
|
5246
|
+
boolMethod: EBVolume12.eIdentity,
|
|
4977
5247
|
inList: [`subpax_${designName}_bone`]
|
|
4978
5248
|
}
|
|
4979
5249
|
]
|
|
@@ -4990,18 +5260,18 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4990
5260
|
var singleBoneDef = {
|
|
4991
5261
|
pTitle: "singleBone",
|
|
4992
5262
|
pDescription: "detailed design of the suspension bone of the rccar",
|
|
4993
|
-
pDef:
|
|
4994
|
-
pGeom:
|
|
5263
|
+
pDef: pDef15,
|
|
5264
|
+
pGeom: pGeom15
|
|
4995
5265
|
};
|
|
4996
5266
|
|
|
4997
5267
|
// src/rccar/doubleBone.ts
|
|
4998
5268
|
import {
|
|
4999
5269
|
contourCircle as contourCircle13,
|
|
5000
|
-
degToRad as
|
|
5001
|
-
ffix as
|
|
5002
|
-
pNumber as
|
|
5003
|
-
pSectionSeparator as
|
|
5004
|
-
initGeom as
|
|
5270
|
+
degToRad as degToRad8,
|
|
5271
|
+
ffix as ffix17,
|
|
5272
|
+
pNumber as pNumber16,
|
|
5273
|
+
pSectionSeparator as pSectionSeparator16,
|
|
5274
|
+
initGeom as initGeom16
|
|
5005
5275
|
} from "geometrix";
|
|
5006
5276
|
import {
|
|
5007
5277
|
tJDir as tJDir4,
|
|
@@ -5010,37 +5280,37 @@ import {
|
|
|
5010
5280
|
facet as facet4,
|
|
5011
5281
|
sheetFold as sheetFold4
|
|
5012
5282
|
} from "sheetfold";
|
|
5013
|
-
var
|
|
5283
|
+
var pDef16 = {
|
|
5014
5284
|
partName: "doubleBone",
|
|
5015
5285
|
params: [
|
|
5016
5286
|
//pNumber(name, unit, init, min, max, step)
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5287
|
+
pNumber16("D1", "mm", 30, 1, 500, 1),
|
|
5288
|
+
pNumber16("D2", "mm", 70, 1, 500, 1),
|
|
5289
|
+
pNumber16("L1", "mm", 300, 10, 1e3, 1),
|
|
5290
|
+
pNumber16("L2", "mm", 200, 10, 1e3, 1),
|
|
5291
|
+
pNumber16("E1", "mm", 40, 1, 1e3, 1),
|
|
5292
|
+
pSectionSeparator16("Side"),
|
|
5293
|
+
pNumber16("W1", "mm", 30, 1, 500, 1),
|
|
5294
|
+
pNumber16("P2", "%", 50, 0, 99, 1),
|
|
5295
|
+
pNumber16("W2", "mm", 10, 1, 500, 1),
|
|
5296
|
+
pSectionSeparator16("Top"),
|
|
5297
|
+
pNumber16("S1", "mm", 20, 1, 100, 1),
|
|
5298
|
+
pNumber16("S2", "mm", 20, 1, 100, 1),
|
|
5299
|
+
pNumber16("S3", "mm", 20, 1, 100, 1),
|
|
5300
|
+
pNumber16("R3", "mm", 10, 0, 1e3, 1),
|
|
5301
|
+
pSectionSeparator16("Wing width"),
|
|
5302
|
+
pNumber16("P11", "%", 8, 0, 90, 1),
|
|
5303
|
+
pNumber16("P12", "%", 20, 0, 90, 1),
|
|
5304
|
+
pNumber16("P21", "%", 18, 0, 90, 1),
|
|
5305
|
+
pNumber16("P22", "%", 20, 0, 90, 1),
|
|
5306
|
+
pSectionSeparator16("Folding"),
|
|
5307
|
+
pNumber16("T1", "mm", 2, 0.5, 10, 0.1),
|
|
5308
|
+
pNumber16("Jangle", "degree", 90, 30, 120, 1),
|
|
5309
|
+
pNumber16("Jradius", "mm", 10, 0.1, 50, 0.1),
|
|
5310
|
+
pNumber16("Jneutral", "%", 50, 0, 100, 1),
|
|
5311
|
+
pNumber16("Jmark", "mm", 2, 0.1, 10, 0.1),
|
|
5312
|
+
pNumber16("Jradius2", "mm", 4, 0.1, 50, 0.1),
|
|
5313
|
+
pNumber16("Jmark2", "mm", 2, 0.1, 10, 0.1)
|
|
5044
5314
|
],
|
|
5045
5315
|
paramSvg: {
|
|
5046
5316
|
D1: "doubleBone_face.svg",
|
|
@@ -5074,8 +5344,8 @@ var pDef15 = {
|
|
|
5074
5344
|
// every 0.5 second
|
|
5075
5345
|
}
|
|
5076
5346
|
};
|
|
5077
|
-
function
|
|
5078
|
-
const rGeome =
|
|
5347
|
+
function pGeom16(t, param, suffix = "") {
|
|
5348
|
+
const rGeome = initGeom16(pDef16.partName + suffix);
|
|
5079
5349
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
5080
5350
|
`;
|
|
5081
5351
|
try {
|
|
@@ -5085,7 +5355,7 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5085
5355
|
return [rA, rInitDist];
|
|
5086
5356
|
}, calcSplitTri2 = function(iL, iP) {
|
|
5087
5357
|
if (iL < 0) {
|
|
5088
|
-
throw `err559: iL ${
|
|
5358
|
+
throw `err559: iL ${ffix17(iL)} is negative mm`;
|
|
5089
5359
|
}
|
|
5090
5360
|
let rLside = iL;
|
|
5091
5361
|
let rLcenter = 0;
|
|
@@ -5138,7 +5408,7 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5138
5408
|
const boneLen = param.L1 + 2 * R22;
|
|
5139
5409
|
const dX2 = R22 ** 2 - W12 ** 2;
|
|
5140
5410
|
if (dX2 < 0) {
|
|
5141
|
-
throw `err086: D2 ${
|
|
5411
|
+
throw `err086: D2 ${ffix17(param.D2)} is too small compare to W1 ${ffix17(param.W1)} mm`;
|
|
5142
5412
|
}
|
|
5143
5413
|
const dX = Math.sqrt(dX2);
|
|
5144
5414
|
const L1b = param.L1 - 2 * dX;
|
|
@@ -5148,7 +5418,7 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5148
5418
|
const W2b = (param.L1 - 2 * R22 - N2 * 2 * Rh) / (N2 + 1);
|
|
5149
5419
|
const hX0b = R22 + W2b + Rh;
|
|
5150
5420
|
const hX1b = W2b + 2 * Rh;
|
|
5151
|
-
const aJa =
|
|
5421
|
+
const aJa = degToRad8(param.Jangle);
|
|
5152
5422
|
const aJn = param.Jneutral / 100;
|
|
5153
5423
|
const aJr = param.Jradius;
|
|
5154
5424
|
const aJm = param.Jmark;
|
|
@@ -5178,22 +5448,22 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5178
5448
|
const [tri22s, tri22c] = calcSplitTri2(tri22L, param.P22);
|
|
5179
5449
|
const wingH = param.W1 / 2 + cornerSizeInt - cornerSizeInt2;
|
|
5180
5450
|
if (R22 < R12) {
|
|
5181
|
-
throw `err085: D2 ${
|
|
5451
|
+
throw `err085: D2 ${ffix17(param.D2)} is too small compare to D1 ${ffix17(param.D1)} mm`;
|
|
5182
5452
|
}
|
|
5183
5453
|
if (L1b < 0) {
|
|
5184
|
-
throw `err095: L1 ${
|
|
5454
|
+
throw `err095: L1 ${ffix17(param.L1)} is too small compare to D2 ${ffix17(param.D2)} mm`;
|
|
5185
5455
|
}
|
|
5186
5456
|
if (param.E1 < cornerSizeInt) {
|
|
5187
|
-
throw `err151: E1 ${
|
|
5457
|
+
throw `err151: E1 ${ffix17(param.E1)} is too small compare to Jradius ${ffix17(param.Jradius)} mm`;
|
|
5188
5458
|
}
|
|
5189
5459
|
if (L2c < 0) {
|
|
5190
|
-
throw `err150: L2 ${
|
|
5460
|
+
throw `err150: L2 ${ffix17(param.L2)} is too small compare to E1 ${ffix17(param.E1)} mm`;
|
|
5191
5461
|
}
|
|
5192
|
-
rGeome.logstr += `Bone length ${
|
|
5462
|
+
rGeome.logstr += `Bone length ${ffix17(boneLen)} mm
|
|
5193
5463
|
`;
|
|
5194
|
-
rGeome.logstr += `Bone with N2 ${N2} holes of diameter ${
|
|
5464
|
+
rGeome.logstr += `Bone with N2 ${N2} holes of diameter ${ffix17(2 * Rh)} and W2b ${ffix17(W2b)} mm
|
|
5195
5465
|
`;
|
|
5196
|
-
rGeome.logstr += `Side with N2c ${N2c} holes of diameter ${
|
|
5466
|
+
rGeome.logstr += `Side with N2c ${N2c} holes of diameter ${ffix17(2 * Rh)} and W2c ${ffix17(W2c)} mm
|
|
5197
5467
|
`;
|
|
5198
5468
|
const ctrAxis1 = contourCircle13(0, 0, R12);
|
|
5199
5469
|
const ctrAxis2 = contourCircle13(param.L1, 0, R12);
|
|
@@ -5292,73 +5562,73 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5292
5562
|
var doubleBoneDef = {
|
|
5293
5563
|
pTitle: "doubleBone",
|
|
5294
5564
|
pDescription: "combined suspension bones of the rccar",
|
|
5295
|
-
pDef:
|
|
5296
|
-
pGeom:
|
|
5565
|
+
pDef: pDef16,
|
|
5566
|
+
pGeom: pGeom16
|
|
5297
5567
|
};
|
|
5298
5568
|
|
|
5299
5569
|
// src/rccar/pcar.ts
|
|
5300
5570
|
import {
|
|
5301
|
-
contour as
|
|
5571
|
+
contour as contour17,
|
|
5302
5572
|
contourCircle as contourCircle14,
|
|
5303
|
-
figure as
|
|
5304
|
-
ffix as
|
|
5305
|
-
pNumber as
|
|
5306
|
-
pSectionSeparator as
|
|
5307
|
-
EExtrude as
|
|
5308
|
-
EBVolume as
|
|
5309
|
-
initGeom as
|
|
5573
|
+
figure as figure14,
|
|
5574
|
+
ffix as ffix18,
|
|
5575
|
+
pNumber as pNumber17,
|
|
5576
|
+
pSectionSeparator as pSectionSeparator17,
|
|
5577
|
+
EExtrude as EExtrude13,
|
|
5578
|
+
EBVolume as EBVolume13,
|
|
5579
|
+
initGeom as initGeom17
|
|
5310
5580
|
} from "geometrix";
|
|
5311
|
-
var
|
|
5581
|
+
var pDef17 = {
|
|
5312
5582
|
partName: "pcar",
|
|
5313
5583
|
params: [
|
|
5314
5584
|
//pNumber(name, unit, init, min, max, step)
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5585
|
+
pNumber17("LB1", "mm", 1e3, 100, 4e3, 1),
|
|
5586
|
+
pNumber17("LB2", "mm", 3e3, 100, 8e3, 1),
|
|
5587
|
+
pNumber17("LB3", "mm", 1e3, 100, 4e3, 1),
|
|
5588
|
+
pNumber17("LT1", "mm", 800, 100, 4e3, 1),
|
|
5589
|
+
pNumber17("LT3", "mm", 1200, 100, 4e3, 1),
|
|
5590
|
+
pNumber17("LT4", "mm", 1600, 100, 4e3, 1),
|
|
5591
|
+
pNumber17("HF1", "mm", 900, 100, 3e3, 1),
|
|
5592
|
+
pNumber17("HF3", "mm", 600, 100, 3e3, 1),
|
|
5593
|
+
pNumber17("HF4", "mm", 300, 100, 3e3, 1),
|
|
5594
|
+
pNumber17("HB1", "mm", 800, 100, 3e3, 1),
|
|
5595
|
+
pSectionSeparator17("Wheels"),
|
|
5596
|
+
pNumber17("HW1", "mm", 200, -1e3, 1e3, 1),
|
|
5597
|
+
pNumber17("DW1", "mm", 100, 1, 500, 1),
|
|
5598
|
+
pNumber17("DW2", "mm", 600, 1, 2e3, 1),
|
|
5599
|
+
pNumber17("DW3", "mm", 800, 1, 2e3, 1),
|
|
5600
|
+
pNumber17("WW1", "mm", 300, 1, 1e3, 1),
|
|
5601
|
+
pNumber17("WW2", "mm", 200, 1, 1e3, 1),
|
|
5602
|
+
pNumber17("RW2", "mm", 50, 1, 1e3, 1),
|
|
5603
|
+
pSectionSeparator17("Side"),
|
|
5604
|
+
pNumber17("C1", "mm", 50, 1, 500, 1),
|
|
5605
|
+
pNumber17("C2", "mm", 100, 1, 500, 1),
|
|
5606
|
+
pNumber17("C3", "mm", 50, 1, 500, 1),
|
|
5607
|
+
pNumber17("C4", "mm", 50, 1, 500, 1),
|
|
5608
|
+
pNumber17("Rs1", "mm", 100, 1, 2e3, 1),
|
|
5609
|
+
pNumber17("Rs2", "mm", 100, 1, 2e3, 1),
|
|
5610
|
+
pNumber17("Rs3", "mm", 100, 1, 2e3, 1),
|
|
5611
|
+
pNumber17("Rs4", "mm", 100, 1, 2e3, 1),
|
|
5612
|
+
pNumber17("Rs5", "mm", 100, 1, 2e3, 1),
|
|
5613
|
+
pNumber17("Rs6", "mm", 500, 1, 2e3, 1),
|
|
5614
|
+
pNumber17("Rs7", "mm", 100, 1, 2e3, 1),
|
|
5615
|
+
pSectionSeparator17("Top"),
|
|
5616
|
+
pNumber17("Wt1", "mm", 600, 1, 2e3, 1),
|
|
5617
|
+
pNumber17("Wt2", "mm", 800, 1, 2e3, 1),
|
|
5618
|
+
pNumber17("Ct1", "mm", 50, 1, 500, 1),
|
|
5619
|
+
pNumber17("Ct2", "mm", 50, 1, 500, 1),
|
|
5620
|
+
pNumber17("Ct3", "mm", 50, 1, 500, 1),
|
|
5621
|
+
pNumber17("Rt1", "mm", 100, 1, 2e3, 1),
|
|
5622
|
+
pNumber17("Rt2", "mm", 400, 1, 2e3, 1),
|
|
5623
|
+
pSectionSeparator17("Front"),
|
|
5624
|
+
pNumber17("Wf1", "mm", 800, 1, 2e3, 1),
|
|
5625
|
+
pNumber17("Wf2", "mm", 300, 1, 1e3, 1),
|
|
5626
|
+
pNumber17("Cf1", "mm", 50, 1, 500, 1),
|
|
5627
|
+
pNumber17("Cf2", "mm", 50, 1, 500, 1),
|
|
5628
|
+
pNumber17("Cf3", "mm", 50, 1, 500, 1),
|
|
5629
|
+
pNumber17("Rf1", "mm", 100, 1, 2e3, 1),
|
|
5630
|
+
pNumber17("Rf2", "mm", 100, 1, 2e3, 1),
|
|
5631
|
+
pNumber17("Rf3", "mm", 100, 1, 2e3, 1)
|
|
5362
5632
|
],
|
|
5363
5633
|
paramSvg: {
|
|
5364
5634
|
LB1: "pcar_side.svg",
|
|
@@ -5413,13 +5683,13 @@ var pDef16 = {
|
|
|
5413
5683
|
// every 0.5 second
|
|
5414
5684
|
}
|
|
5415
5685
|
};
|
|
5416
|
-
function
|
|
5417
|
-
const rGeome =
|
|
5418
|
-
const figSideWiWheels =
|
|
5419
|
-
const figSideWoWheels =
|
|
5420
|
-
const figTop =
|
|
5421
|
-
const figFront =
|
|
5422
|
-
const figWheel =
|
|
5686
|
+
function pGeom17(t, param, suffix = "") {
|
|
5687
|
+
const rGeome = initGeom17(pDef17.partName + suffix);
|
|
5688
|
+
const figSideWiWheels = figure14();
|
|
5689
|
+
const figSideWoWheels = figure14();
|
|
5690
|
+
const figTop = figure14();
|
|
5691
|
+
const figFront = figure14();
|
|
5692
|
+
const figWheel = figure14();
|
|
5423
5693
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
5424
5694
|
`;
|
|
5425
5695
|
try {
|
|
@@ -5432,7 +5702,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5432
5702
|
const rEF = EG / Math.cos(aAED);
|
|
5433
5703
|
return rEF;
|
|
5434
5704
|
}, makeCtrSide2 = function(withWheels) {
|
|
5435
|
-
const rCtr =
|
|
5705
|
+
const rCtr = contour17(-param.LB1, BodyY0).addCornerRounded(param.Rs1);
|
|
5436
5706
|
if (withWheels) {
|
|
5437
5707
|
rCtr.addSegStrokeR(LB1b, 0).addPointR(dXwheel, param.HW1 + RW3).addPointR(2 * dXwheel, 0).addSegArc2().addSegStrokeR(LB2b, 0).addPointR(dXwheel, param.HW1 + RW3).addPointR(2 * dXwheel, 0).addSegArc2().addSegStrokeR(LB3b, 0);
|
|
5438
5708
|
} else {
|
|
@@ -5441,7 +5711,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5441
5711
|
rCtr.addCornerRounded(param.Rs7).addSegStrokeR(0, param.HF1).addCornerRounded(param.Rs6).addPointR(-param.LT4, param.HF4).addSegArc(CR4, false, true).addCornerRounded(param.Rs5).addPointR(-param.LT3, HF3b).addSegArc(CR3, false, true).addCornerRounded(param.Rs4).addPointR(-LT2, 0).addSegArc(CR2, false, true).addCornerRounded(param.Rs3).addPointR(-param.LT1, -HB1b).addSegArc(CR1, false, true).addCornerRounded(param.Rs2).closeSegStroke();
|
|
5442
5712
|
return rCtr;
|
|
5443
5713
|
}, makeCtrWheel2 = function(sX, x0, y0, r0) {
|
|
5444
|
-
const rCtr =
|
|
5714
|
+
const rCtr = contour17(x0, y0).addSegStrokeR(sX * RW1, 0).addSegStrokeR(0, param.WW1).addSegStrokeR(sX * (RW2 - RW1), 0).addCornerRounded(param.RW2).addSegStrokeR(0, param.WW2).addCornerRounded(param.RW2).addSegStrokeR(-sX * RW2, 0).closeSegStroke().rotate(x0, y0, r0);
|
|
5445
5715
|
return rCtr;
|
|
5446
5716
|
};
|
|
5447
5717
|
var calcCR = calcCR2, makeCtrSide = makeCtrSide2, makeCtrWheel = makeCtrWheel2;
|
|
@@ -5467,7 +5737,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5467
5737
|
const Ct3b = param.LB3 - (param.Ct3 + RW3);
|
|
5468
5738
|
const dXwheel2 = RW3 ** 2 - param.HW1 ** 2;
|
|
5469
5739
|
if (dXwheel2 < 0) {
|
|
5470
|
-
throw `err158: dXwheel2 ${
|
|
5740
|
+
throw `err158: dXwheel2 ${ffix18(dXwheel2)} is negative because of HW1 ${ffix18(param.HW1)} and RW3 ${ffix18(RW3)} mm`;
|
|
5471
5741
|
}
|
|
5472
5742
|
const dXwheel = Math.sqrt(RW3 ** 2 - param.HW1 ** 2);
|
|
5473
5743
|
const LB1b = param.LB1 - dXwheel;
|
|
@@ -5484,48 +5754,48 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5484
5754
|
const CRf2 = calcCR2(param.Wf2, Wf1b, param.Cf2);
|
|
5485
5755
|
const CRf3 = calcCR2(Wf2b, 0, param.Cf3);
|
|
5486
5756
|
if (BodyY0 < 0) {
|
|
5487
|
-
throw `err147: DW2 ${
|
|
5757
|
+
throw `err147: DW2 ${ffix18(param.DW2)} is too small comapre to HW1 ${ffix18(param.HW1)} mm`;
|
|
5488
5758
|
}
|
|
5489
5759
|
if (LT2 < 0) {
|
|
5490
|
-
throw `err169: LT2 ${
|
|
5760
|
+
throw `err169: LT2 ${ffix18(LT2)} mm is negative`;
|
|
5491
5761
|
}
|
|
5492
5762
|
if (HF3b < 0) {
|
|
5493
|
-
throw `err174: HF3b ${
|
|
5763
|
+
throw `err174: HF3b ${ffix18(HF3b)} mm is negative`;
|
|
5494
5764
|
}
|
|
5495
5765
|
if (HB1b < 0) {
|
|
5496
|
-
throw `err178: HB1b ${
|
|
5766
|
+
throw `err178: HB1b ${ffix18(HB1b)} mm is negative`;
|
|
5497
5767
|
}
|
|
5498
5768
|
if (HB2 < 0) {
|
|
5499
|
-
throw `err172: HB2 ${
|
|
5769
|
+
throw `err172: HB2 ${ffix18(HB2)} mm is negative`;
|
|
5500
5770
|
}
|
|
5501
5771
|
if (Wf1b < 0) {
|
|
5502
|
-
throw `err161: Wf1b ${
|
|
5772
|
+
throw `err161: Wf1b ${ffix18(Wf1b)} mm is negative`;
|
|
5503
5773
|
}
|
|
5504
5774
|
if (Wf2b < 0) {
|
|
5505
|
-
throw `err164: Wf2b ${
|
|
5775
|
+
throw `err164: Wf2b ${ffix18(Wf2b)} mm is negative`;
|
|
5506
5776
|
}
|
|
5507
5777
|
if (Cf1b < 0) {
|
|
5508
|
-
throw `err167: Cf1b ${
|
|
5778
|
+
throw `err167: Cf1b ${ffix18(Cf1b)} mm is negative`;
|
|
5509
5779
|
}
|
|
5510
5780
|
if (Ct1b < 0) {
|
|
5511
|
-
throw `err170: Ct1b ${
|
|
5781
|
+
throw `err170: Ct1b ${ffix18(Ct1b)} mm is negative`;
|
|
5512
5782
|
}
|
|
5513
5783
|
if (Ct2b < 0) {
|
|
5514
|
-
throw `err173: Ct2b ${
|
|
5784
|
+
throw `err173: Ct2b ${ffix18(Ct2b)} mm is negative`;
|
|
5515
5785
|
}
|
|
5516
5786
|
if (Ct3b < 0) {
|
|
5517
|
-
throw `err176: Ct3b ${
|
|
5787
|
+
throw `err176: Ct3b ${ffix18(Ct3b)} mm is negative`;
|
|
5518
5788
|
}
|
|
5519
5789
|
if (LB1b < 0) {
|
|
5520
|
-
throw `err185: LB1b ${
|
|
5790
|
+
throw `err185: LB1b ${ffix18(LB1b)} mm is negative`;
|
|
5521
5791
|
}
|
|
5522
5792
|
if (LB2b < 0) {
|
|
5523
|
-
throw `err189: LB2b ${
|
|
5793
|
+
throw `err189: LB2b ${ffix18(LB2b)} mm is negative`;
|
|
5524
5794
|
}
|
|
5525
5795
|
if (LB3b < 0) {
|
|
5526
|
-
throw `err193: LB3b ${
|
|
5796
|
+
throw `err193: LB3b ${ffix18(LB3b)} mm is negative`;
|
|
5527
5797
|
}
|
|
5528
|
-
rGeome.logstr += `Body: Y0 ${
|
|
5798
|
+
rGeome.logstr += `Body: Y0 ${ffix18(BodyY0)}, Height ${ffix18(BodyHeight)}, Lenght: ${ffix18(BodyLength)}, Width: ${ffix18(BodyWidth)} mm
|
|
5529
5799
|
`;
|
|
5530
5800
|
figSideWiWheels.addMainO(makeCtrSide2(true));
|
|
5531
5801
|
figSideWiWheels.addSecond(contourCircle14(0, RW2, RW2));
|
|
@@ -5534,9 +5804,9 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5534
5804
|
figSideWiWheels.addSecond(contourCircle14(param.LB2, RW2, RW1));
|
|
5535
5805
|
figSideWoWheels.addMainO(makeCtrSide2(false));
|
|
5536
5806
|
figSideWoWheels.mergeFigure(figSideWiWheels, true);
|
|
5537
|
-
const ctrTop =
|
|
5807
|
+
const ctrTop = contour17(-param.LB1 + param.Ct1, param.Ct2).addCornerRounded(param.Rt1).addPointR(BodyLength - param.Ct1 - param.Ct3, 0).addSegArc(CRt2, false, true).addCornerRounded(param.Rt2).addPointR(0, BodyWidth - 2 * param.Ct2).addSegArc(CRt3, false, true).addCornerRounded(param.Rt2).addPointR(-BodyLength + param.Ct1 + param.Ct3, 0).addSegArc(CRt2, false, true).addCornerRounded(param.Rt1).addPointR(0, -BodyWidth + 2 * param.Ct2).addSegArc(CRt1, false, true);
|
|
5538
5808
|
figTop.addMainO(ctrTop);
|
|
5539
|
-
const ctrFront =
|
|
5809
|
+
const ctrFront = contour17(param.Cf1, BodyY0).addCornerRounded(param.Rf1).addSegStrokeR(Wtb, 0).addCornerRounded(param.Rf1).addPointR(0, param.Wf1).addSegArc(CRf1, false, true).addCornerRounded(param.Rf2).addPointR(-param.Wf2, Wf1b).addSegArc(CRf2, false, true).addCornerRounded(param.Rf3).addPointR(-Wf2b, 0).addSegArc(CRf3, false, true).addCornerRounded(param.Rf3).addPointR(-param.Wf2, -Wf1b).addSegArc(CRf2, false, true).addCornerRounded(param.Rf2).addPointR(0, -param.Wf1).addSegArc(CRf1, false, true);
|
|
5540
5810
|
figFront.addMainO(ctrFront);
|
|
5541
5811
|
figWheel.addMainO(makeCtrWheel2(1, 0, 0, 0));
|
|
5542
5812
|
figWheel.addSecond(makeCtrWheel2(-1, 0, 0, 0));
|
|
@@ -5565,7 +5835,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5565
5835
|
{
|
|
5566
5836
|
outName: `subpax_${designName}_sideWiW1`,
|
|
5567
5837
|
face: `${designName}_faceSideWiWheels`,
|
|
5568
|
-
extrudeMethod:
|
|
5838
|
+
extrudeMethod: EExtrude13.eLinearOrtho,
|
|
5569
5839
|
length: param.Wt1,
|
|
5570
5840
|
rotate: [pi2, 0, 0],
|
|
5571
5841
|
translate: [0, param.Wt1, 0]
|
|
@@ -5573,7 +5843,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5573
5843
|
{
|
|
5574
5844
|
outName: `subpax_${designName}_sideWiW2`,
|
|
5575
5845
|
face: `${designName}_faceSideWiWheels`,
|
|
5576
|
-
extrudeMethod:
|
|
5846
|
+
extrudeMethod: EExtrude13.eLinearOrtho,
|
|
5577
5847
|
length: param.Wt1,
|
|
5578
5848
|
rotate: [pi2, 0, 0],
|
|
5579
5849
|
translate: [0, param.Wt2 + 2 * param.Wt1, 0]
|
|
@@ -5581,7 +5851,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5581
5851
|
{
|
|
5582
5852
|
outName: `subpax_${designName}_sideWoW`,
|
|
5583
5853
|
face: `${designName}_faceSideWoWheels`,
|
|
5584
|
-
extrudeMethod:
|
|
5854
|
+
extrudeMethod: EExtrude13.eLinearOrtho,
|
|
5585
5855
|
length: param.Wt2,
|
|
5586
5856
|
rotate: [pi2, 0, 0],
|
|
5587
5857
|
translate: [0, param.Wt2 + param.Wt1, 0]
|
|
@@ -5589,7 +5859,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5589
5859
|
{
|
|
5590
5860
|
outName: `subpax_${designName}_front`,
|
|
5591
5861
|
face: `${designName}_faceFront`,
|
|
5592
|
-
extrudeMethod:
|
|
5862
|
+
extrudeMethod: EExtrude13.eLinearOrtho,
|
|
5593
5863
|
length: BodyLength,
|
|
5594
5864
|
rotate: [pi2, 0, pi2],
|
|
5595
5865
|
translate: [-param.LB1, 0, 0]
|
|
@@ -5597,7 +5867,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5597
5867
|
{
|
|
5598
5868
|
outName: `subpax_${designName}_top`,
|
|
5599
5869
|
face: `${designName}_faceTop`,
|
|
5600
|
-
extrudeMethod:
|
|
5870
|
+
extrudeMethod: EExtrude13.eLinearOrtho,
|
|
5601
5871
|
length: BodyHeight + BodyY0,
|
|
5602
5872
|
rotate: [0, 0, 0],
|
|
5603
5873
|
translate: [0, 0, 0]
|
|
@@ -5605,28 +5875,28 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5605
5875
|
{
|
|
5606
5876
|
outName: `subpax_${designName}_wheel11`,
|
|
5607
5877
|
face: `${designName}_faceWheel`,
|
|
5608
|
-
extrudeMethod:
|
|
5878
|
+
extrudeMethod: EExtrude13.eRotate,
|
|
5609
5879
|
rotate: [pi2, 0, 0],
|
|
5610
5880
|
translate: [0, param.Wt1, RW2]
|
|
5611
5881
|
},
|
|
5612
5882
|
{
|
|
5613
5883
|
outName: `subpax_${designName}_wheel12`,
|
|
5614
5884
|
face: `${designName}_faceWheel`,
|
|
5615
|
-
extrudeMethod:
|
|
5885
|
+
extrudeMethod: EExtrude13.eRotate,
|
|
5616
5886
|
rotate: [-pi2, 0, 0],
|
|
5617
5887
|
translate: [0, param.Wt1 + param.Wt2, RW2]
|
|
5618
5888
|
},
|
|
5619
5889
|
{
|
|
5620
5890
|
outName: `subpax_${designName}_wheel21`,
|
|
5621
5891
|
face: `${designName}_faceWheel`,
|
|
5622
|
-
extrudeMethod:
|
|
5892
|
+
extrudeMethod: EExtrude13.eRotate,
|
|
5623
5893
|
rotate: [pi2, 0, 0],
|
|
5624
5894
|
translate: [param.LB2, param.Wt1, RW2]
|
|
5625
5895
|
},
|
|
5626
5896
|
{
|
|
5627
5897
|
outName: `subpax_${designName}_wheel22`,
|
|
5628
5898
|
face: `${designName}_faceWheel`,
|
|
5629
|
-
extrudeMethod:
|
|
5899
|
+
extrudeMethod: EExtrude13.eRotate,
|
|
5630
5900
|
rotate: [-pi2, 0, 0],
|
|
5631
5901
|
translate: [param.LB2, param.Wt1 + param.Wt2, RW2]
|
|
5632
5902
|
}
|
|
@@ -5634,7 +5904,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5634
5904
|
volumes: [
|
|
5635
5905
|
{
|
|
5636
5906
|
outName: `ipax_${designName}_side`,
|
|
5637
|
-
boolMethod:
|
|
5907
|
+
boolMethod: EBVolume13.eUnion,
|
|
5638
5908
|
inList: [
|
|
5639
5909
|
`subpax_${designName}_sideWiW1`,
|
|
5640
5910
|
`subpax_${designName}_sideWiW2`,
|
|
@@ -5643,7 +5913,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5643
5913
|
},
|
|
5644
5914
|
{
|
|
5645
5915
|
outName: `ipax_${designName}_body`,
|
|
5646
|
-
boolMethod:
|
|
5916
|
+
boolMethod: EBVolume13.eIntersection,
|
|
5647
5917
|
inList: [
|
|
5648
5918
|
`ipax_${designName}_side`,
|
|
5649
5919
|
`subpax_${designName}_front`,
|
|
@@ -5652,7 +5922,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5652
5922
|
},
|
|
5653
5923
|
{
|
|
5654
5924
|
outName: `pax_${designName}`,
|
|
5655
|
-
boolMethod:
|
|
5925
|
+
boolMethod: EBVolume13.eUnion,
|
|
5656
5926
|
inList: [
|
|
5657
5927
|
`ipax_${designName}_body`,
|
|
5658
5928
|
`subpax_${designName}_wheel11`,
|
|
@@ -5675,82 +5945,82 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5675
5945
|
var pcarDef = {
|
|
5676
5946
|
pTitle: "pcar",
|
|
5677
5947
|
pDescription: "the envelop of a passager car",
|
|
5678
|
-
pDef:
|
|
5679
|
-
pGeom:
|
|
5948
|
+
pDef: pDef17,
|
|
5949
|
+
pGeom: pGeom17
|
|
5680
5950
|
};
|
|
5681
5951
|
|
|
5682
5952
|
// src/capsule/capsule.ts
|
|
5683
5953
|
import {
|
|
5684
5954
|
point as point8,
|
|
5685
|
-
contour as
|
|
5955
|
+
contour as contour18,
|
|
5686
5956
|
contourCircle as contourCircle15,
|
|
5687
|
-
ctrRectangle as
|
|
5688
|
-
figure as
|
|
5689
|
-
ffix as
|
|
5690
|
-
pNumber as
|
|
5691
|
-
pCheckbox as
|
|
5692
|
-
pDropdown as
|
|
5693
|
-
pSectionSeparator as
|
|
5694
|
-
EExtrude as
|
|
5695
|
-
EBVolume as
|
|
5696
|
-
initGeom as
|
|
5957
|
+
ctrRectangle as ctrRectangle8,
|
|
5958
|
+
figure as figure15,
|
|
5959
|
+
ffix as ffix19,
|
|
5960
|
+
pNumber as pNumber18,
|
|
5961
|
+
pCheckbox as pCheckbox10,
|
|
5962
|
+
pDropdown as pDropdown9,
|
|
5963
|
+
pSectionSeparator as pSectionSeparator18,
|
|
5964
|
+
EExtrude as EExtrude14,
|
|
5965
|
+
EBVolume as EBVolume14,
|
|
5966
|
+
initGeom as initGeom18
|
|
5697
5967
|
} from "geometrix";
|
|
5698
|
-
var
|
|
5968
|
+
var pDef18 = {
|
|
5699
5969
|
partName: "capsule",
|
|
5700
5970
|
params: [
|
|
5701
5971
|
//pNumber(name, unit, init, min, max, step)
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5972
|
+
pNumber18("L1", "mm", 5e3, 1e3, 2e4, 1),
|
|
5973
|
+
pNumber18("WW1", "mm", 1800, 100, 4e3, 1),
|
|
5974
|
+
pNumber18("E1", "mm", 10, 1, 100, 1),
|
|
5975
|
+
pSectionSeparator18("Nose"),
|
|
5976
|
+
pNumber18("H1", "mm", 300, 10, 4e3, 1),
|
|
5977
|
+
pNumber18("H2", "mm", 500, 10, 4e3, 1),
|
|
5978
|
+
pNumber18("H3", "mm", 1200, 10, 4e3, 1),
|
|
5979
|
+
pNumber18("W1", "mm", 300, 10, 4e3, 1),
|
|
5980
|
+
pNumber18("W3", "mm", 1500, 10, 4e3, 1),
|
|
5981
|
+
pNumber18("C3", "mm", 200, 1, 1e3, 1),
|
|
5982
|
+
pNumber18("R1", "mm", 100, 0, 500, 1),
|
|
5983
|
+
pNumber18("R2", "mm", 100, 0, 500, 1),
|
|
5984
|
+
pNumber18("R3", "mm", 100, 0, 500, 1),
|
|
5985
|
+
pNumber18("R4", "mm", 100, 0, 500, 1),
|
|
5986
|
+
pSectionSeparator18("Wheels"),
|
|
5987
|
+
pNumber18("H0", "mm", 600, 100, 2e3, 1),
|
|
5988
|
+
pNumber18("D7", "mm", 500, 10, 2e3, 1),
|
|
5989
|
+
pNumber18("D8", "mm", 100, 10, 2e3, 1),
|
|
5990
|
+
pNumber18("WW2", "mm", 1e3, 100, 4e3, 1),
|
|
5991
|
+
pNumber18("WW3", "mm", 100, 1, 500, 1),
|
|
5992
|
+
pSectionSeparator18("Wheels details"),
|
|
5993
|
+
pNumber18("W6", "mm", 500, 10, 2e3, 1),
|
|
5994
|
+
pNumber18("W7", "mm", 600, 10, 2e3, 1),
|
|
5995
|
+
pNumber18("W8", "mm", 300, 10, 2e3, 1),
|
|
5996
|
+
pNumber18("H6", "mm", 300, 10, 2e3, 1),
|
|
5997
|
+
pSectionSeparator18("Front window"),
|
|
5998
|
+
pNumber18("FH1", "mm", 600, 10, 3e3, 1),
|
|
5999
|
+
pNumber18("FW1", "mm", 100, 10, 3e3, 1),
|
|
6000
|
+
pNumber18("FR1", "mm", 100, 0, 500, 1),
|
|
6001
|
+
pNumber18("FH3", "mm", 100, 10, 3e3, 1),
|
|
6002
|
+
pNumber18("FW3", "mm", 300, 10, 3e3, 1),
|
|
6003
|
+
pNumber18("FR3", "mm", 100, 0, 500, 1),
|
|
6004
|
+
pSectionSeparator18("Top"),
|
|
6005
|
+
pDropdown9("topStyle", ["mirador", "sky", "roof"]),
|
|
6006
|
+
pNumber18("H5", "mm", 300, 10, 2e3, 1),
|
|
6007
|
+
pNumber18("W4", "mm", 500, 10, 5e3, 1),
|
|
6008
|
+
pNumber18("W5", "mm", 1e3, 10, 5e3, 1),
|
|
6009
|
+
pNumber18("R5", "mm", 50, 1, 500, 1),
|
|
6010
|
+
pNumber18("S5", "mm", 200, 10, 500, 1),
|
|
6011
|
+
pSectionSeparator18("Wall"),
|
|
6012
|
+
pCheckbox10("sideWall", true),
|
|
6013
|
+
pNumber18("U1", "mm", 100, 10, 1e3, 1),
|
|
6014
|
+
pNumber18("U2", "mm", 500, 10, 3e3, 1),
|
|
6015
|
+
pNumber18("U3", "mm", 400, 10, 3e3, 1),
|
|
6016
|
+
pNumber18("V1", "mm", 600, 10, 3e3, 1),
|
|
6017
|
+
pNumber18("V2", "mm", 400, 10, 3e3, 1),
|
|
6018
|
+
pNumber18("JR1", "mm", 100, 0, 2e3, 1),
|
|
6019
|
+
pNumber18("JR2", "mm", 100, 0, 2e3, 1),
|
|
6020
|
+
pNumber18("JR3", "mm", 100, 0, 2e3, 1),
|
|
6021
|
+
pNumber18("JR4", "mm", 100, 0, 2e3, 1),
|
|
6022
|
+
pNumber18("JR5", "mm", 100, 0, 2e3, 1),
|
|
6023
|
+
pNumber18("JR6", "mm", 100, 0, 2e3, 1)
|
|
5754
6024
|
],
|
|
5755
6025
|
paramSvg: {
|
|
5756
6026
|
L1: "capsule_side.svg",
|
|
@@ -5807,21 +6077,21 @@ var pDef17 = {
|
|
|
5807
6077
|
// every 0.5 second
|
|
5808
6078
|
}
|
|
5809
6079
|
};
|
|
5810
|
-
function
|
|
5811
|
-
const rGeome =
|
|
5812
|
-
const figBody =
|
|
5813
|
-
const figWheels =
|
|
5814
|
-
const figFront =
|
|
5815
|
-
const figTop =
|
|
5816
|
-
const figTopInt =
|
|
5817
|
-
const figTopTop =
|
|
5818
|
-
const figTopLeg =
|
|
5819
|
-
const figWall =
|
|
6080
|
+
function pGeom18(t, param, suffix = "") {
|
|
6081
|
+
const rGeome = initGeom18(pDef18.partName + suffix);
|
|
6082
|
+
const figBody = figure15();
|
|
6083
|
+
const figWheels = figure15();
|
|
6084
|
+
const figFront = figure15();
|
|
6085
|
+
const figTop = figure15();
|
|
6086
|
+
const figTopInt = figure15();
|
|
6087
|
+
const figTopTop = figure15();
|
|
6088
|
+
const figTopLeg = figure15();
|
|
6089
|
+
const figWall = figure15();
|
|
5820
6090
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
5821
6091
|
`;
|
|
5822
6092
|
try {
|
|
5823
6093
|
let ctrBody2 = function(withBat) {
|
|
5824
|
-
const rCtr =
|
|
6094
|
+
const rCtr = contour18(-L12, param.H0);
|
|
5825
6095
|
if (withBat) {
|
|
5826
6096
|
rCtr.addSegStrokeR(Wwheels, 0).addSegStrokeR(0, -Hbatterie).addSegStrokeR(Lbatterie, 0).addSegStrokeR(0, Hbatterie).addSegStrokeR(Wwheels, 0);
|
|
5827
6097
|
} else {
|
|
@@ -5830,21 +6100,21 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5830
6100
|
rCtr.addCornerRounded(param.R1).addSegStrokeR(param.W1, param.H1).addCornerRounded(param.R2).addSegStrokeR(0, param.H2).addCornerRounded(param.R3).addPointR(p1.cx, p1.cy).addPointR(-param.W3, param.H3).addSegArc2().addCornerRounded(param.R4).addSegStrokeR(-Lroof, 0).addCornerRounded(param.R4).addPointR(p2.cx, p2.cy).addPointR(-param.W3, -param.H3).addSegArc2().addCornerRounded(param.R3).addSegStrokeR(0, -param.H2).addCornerRounded(param.R2).closeSegStroke().addCornerRounded(param.R1);
|
|
5831
6101
|
return rCtr;
|
|
5832
6102
|
}, ctrWheels2 = function(sign) {
|
|
5833
|
-
const rCtr =
|
|
6103
|
+
const rCtr = contour18(0, posYwheels).addSegStrokeR(sign * R7, 0).addSegStrokeR(0, param.WW3).addSegStrokeR(sign * (R8 - R7), 0).addSegStrokeR(0, 2 * WW22).addSegStrokeR(-sign * (R8 - R7), 0).addSegStrokeR(0, param.WW3).addSegStrokeR(-sign * R7, 0).closeSegStroke();
|
|
5834
6104
|
return rCtr;
|
|
5835
6105
|
}, makeCtrTop2 = function(radius) {
|
|
5836
|
-
const rCtr =
|
|
6106
|
+
const rCtr = contour18(-L52 + topR - radius, -R52).addPointR(radius, -radius).addSegArc(radius, false, true).addSegStrokeR(L53, 0).addPointR(radius, radius).addSegArc(radius, false, true).addSegStrokeR(0, R53).addPointR(-radius, radius).addSegArc(radius, false, true).addSegStrokeR(-L53, 0).addPointR(-radius, -radius).addSegArc(radius, false, true).closeSegStroke();
|
|
5837
6107
|
return rCtr;
|
|
5838
6108
|
}, ctrSideWindow2 = function(sign) {
|
|
5839
6109
|
const p0x = sign * (Ltotal / 2 - param.U1);
|
|
5840
6110
|
const p0y = param.H0 + param.H1 + param.H2 - UH2dy;
|
|
5841
|
-
const rCtr =
|
|
6111
|
+
const rCtr = contour18(p0x, p0y).addCornerRounded(param.JR1).addPointR(sign * p1ub.cx, p1ub.cy).addPointR(-sign * UW3b, UH3b).addSegArc2().addCornerRounded(param.JR4).addSegStrokeR(-sign * param.U2, 0).addCornerRounded(param.JR3).addSegStrokeR(0, -UH3b).addCornerRounded(param.JR2).closeSegStroke();
|
|
5842
6112
|
return rCtr;
|
|
5843
6113
|
}, volWheel2 = function(posX, idx) {
|
|
5844
6114
|
return {
|
|
5845
6115
|
outName: `subpax_${designName}_wheel${idx}`,
|
|
5846
6116
|
face: `${designName}_faceWheels`,
|
|
5847
|
-
extrudeMethod:
|
|
6117
|
+
extrudeMethod: EExtrude14.eRotate,
|
|
5848
6118
|
rotate: [0, 0, 0],
|
|
5849
6119
|
translate: [posX, R7, 0]
|
|
5850
6120
|
};
|
|
@@ -5852,7 +6122,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5852
6122
|
return {
|
|
5853
6123
|
outName: `subpax_${designName}_topLeg${idx}`,
|
|
5854
6124
|
face: `${designName}_faceTopLeg`,
|
|
5855
|
-
extrudeMethod:
|
|
6125
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
5856
6126
|
length: E1,
|
|
5857
6127
|
rotate: [0, rotY, 0],
|
|
5858
6128
|
translate: [posX, 0, posZ]
|
|
@@ -5924,31 +6194,31 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5924
6194
|
const HfrontWin = Htotal - param.FH1 - param.FH3;
|
|
5925
6195
|
const Ltot2 = Ltotal + 200;
|
|
5926
6196
|
if (param.L1 - 2 * Wwheels < 2 * E1) {
|
|
5927
|
-
throw `err176: L1 ${
|
|
6197
|
+
throw `err176: L1 ${ffix19(param.L1)} is too small compare to W6 ${ffix19(param.W6)}, W7 ${ffix19(param.W7)} and W8 ${ffix19(param.W8)} mm`;
|
|
5928
6198
|
}
|
|
5929
6199
|
if (Hbatterie < E1) {
|
|
5930
|
-
throw `err114: Hbatterie ${
|
|
6200
|
+
throw `err114: Hbatterie ${ffix19(Hbatterie)} is too small compare to E1 ${ffix19(E1)} mm`;
|
|
5931
6201
|
}
|
|
5932
6202
|
if (Lbatterie < 2 * E1) {
|
|
5933
|
-
throw `err118: Lbatterie ${
|
|
6203
|
+
throw `err118: Lbatterie ${ffix19(Lbatterie)} is too small compare to E1 ${ffix19(E1)} mm`;
|
|
5934
6204
|
}
|
|
5935
6205
|
if (L5 < 3 * param.R5 + param.W5) {
|
|
5936
|
-
throw `err122: L5 ${
|
|
6206
|
+
throw `err122: L5 ${ffix19(L5)} is too small compare to W5 ${ffix19(param.W5)} and R5 ${ffix19(param.R5)} mm`;
|
|
5937
6207
|
}
|
|
5938
6208
|
if (H53 < 0.1) {
|
|
5939
|
-
throw `err220: H5 ${
|
|
6209
|
+
throw `err220: H5 ${ffix19(param.H5)} is too small compare to R5 ${ffix19(param.R5)} mm`;
|
|
5940
6210
|
}
|
|
5941
|
-
rGeome.logstr += `Platform surface: ${
|
|
6211
|
+
rGeome.logstr += `Platform surface: ${ffix19(platSurface)} m2, height: ${ffix19(heightTot / 1e3)} m
|
|
5942
6212
|
`;
|
|
5943
|
-
rGeome.logstr += `Lroof: ${
|
|
6213
|
+
rGeome.logstr += `Lroof: ${ffix19(Lroof)}, L5: ${ffix19(L5)} mm
|
|
5944
6214
|
`;
|
|
5945
|
-
rGeome.logstr += `Ltotal: ${
|
|
6215
|
+
rGeome.logstr += `Ltotal: ${ffix19(Ltotal / 1e3)}, Htotal: ${ffix19(Htotal / 1e3)} m
|
|
5946
6216
|
`;
|
|
5947
|
-
rGeome.logstr += `Batterie: LbatInt ${
|
|
6217
|
+
rGeome.logstr += `Batterie: LbatInt ${ffix19(LbatInt)}, HbatInt: ${ffix19(HbatInt)}, WW1 ${ffix19(param.WW1)} mm
|
|
5948
6218
|
`;
|
|
5949
6219
|
const ctrBodyExt = ctrBody2(true);
|
|
5950
|
-
const ctrBodyInt =
|
|
5951
|
-
const ctrBatterie =
|
|
6220
|
+
const ctrBodyInt = contour18(-L12 + L1dx, param.H0 + E1).addSegStrokeR(2 * L12 - 2 * L1dx, 0).addCornerRounded(iR1).addSegStrokeR(param.W1 - E1 + L1dx, param.H1 - E1 + H2dy).addCornerRounded(iR2).addSegStrokeR(0, param.H2 - 2 * H2dy).addCornerRounded(iR3).addPointR(p1b.cx, p1b.cy).addPointR(-W3b, H3b).addSegArc2().addCornerRounded(iR4).addSegStrokeR(-Lroof + 2 * W3dx, 0).addCornerRounded(iR4).addPointR(p2b.cx, p2b.cy).addPointR(-W3b, -H3b).addSegArc2().addCornerRounded(iR3).addSegStrokeR(0, -param.H2 + 2 * H2dy).addCornerRounded(iR2).closeSegStroke().addCornerRounded(iR1);
|
|
6221
|
+
const ctrBatterie = ctrRectangle8(-LbatInt2, posYbatterie, LbatInt, HbatInt);
|
|
5952
6222
|
figBody.addMainOI([ctrBodyExt, ctrBodyInt, ctrBatterie]);
|
|
5953
6223
|
figBody.addSecond(contourCircle15(-posXwheel1, R7, R7));
|
|
5954
6224
|
figBody.addSecond(contourCircle15(-posXwheel1, R7, R8));
|
|
@@ -5958,28 +6228,28 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5958
6228
|
figBody.addSecond(contourCircle15(posXwheel1, R7, R8));
|
|
5959
6229
|
figBody.addSecond(contourCircle15(posXwheel2, R7, R7));
|
|
5960
6230
|
figBody.addSecond(contourCircle15(posXwheel2, R7, R8));
|
|
5961
|
-
figBody.addSecond(
|
|
5962
|
-
figBody.addSecond(
|
|
6231
|
+
figBody.addSecond(ctrRectangle8(-L52, posYtop, L5, param.H5));
|
|
6232
|
+
figBody.addSecond(ctrRectangle8(-L52 - param.S5, posYtop2, L5 + 2 * param.S5, E1));
|
|
5963
6233
|
figWheels.addMainO(ctrWheels2(1));
|
|
5964
6234
|
figWheels.addSecond(ctrWheels2(-1));
|
|
5965
|
-
const ctrFront =
|
|
6235
|
+
const ctrFront = contour18(-FWL1 / 2, param.H0 + param.FH1).addCornerRounded(param.FR1).addSegStrokeR(FWL1, 0).addCornerRounded(param.FR1).addSegStrokeR(param.FW1 - param.FW3, HfrontWin).addCornerRounded(param.FR3).addSegStrokeR(-FWL3, 0).addCornerRounded(param.FR3).closeSegStroke();
|
|
5966
6236
|
figFront.addMainO(ctrFront);
|
|
5967
6237
|
figFront.addSecond(ctrWheels2(1).rotate(0, 0, pi2).translate(WW12, R7));
|
|
5968
6238
|
figFront.addSecond(ctrWheels2(-1).rotate(0, 0, pi2).translate(WW12, R7));
|
|
5969
|
-
figFront.addSecond(
|
|
5970
|
-
figFront.addSecond(
|
|
5971
|
-
figFront.addSecond(
|
|
5972
|
-
figFront.addSecond(
|
|
5973
|
-
figFront.addSecond(
|
|
5974
|
-
figFront.addSecond(
|
|
5975
|
-
figFront.addSecond(
|
|
6239
|
+
figFront.addSecond(ctrRectangle8(-WW12, param.H6, param.WW1, Hbatterie));
|
|
6240
|
+
figFront.addSecond(ctrRectangle8(-WW12, param.H0, param.WW1, param.H1));
|
|
6241
|
+
figFront.addSecond(ctrRectangle8(-WW12, param.H0 + param.H1, param.WW1, param.H2));
|
|
6242
|
+
figFront.addSecond(ctrRectangle8(-WW12, posYH3, param.WW1, param.H3));
|
|
6243
|
+
figFront.addSecond(ctrRectangle8(-W52, posYtop, param.W5, param.H5));
|
|
6244
|
+
figFront.addSecond(ctrRectangle8(-W52 - param.S5, posYtop2, param.W5 + 2 * param.S5, E1));
|
|
6245
|
+
figFront.addSecond(ctrRectangle8(-WW12 + E1, param.H0 + E1, param.WW1 - E12, Htotal - E12));
|
|
5976
6246
|
const ctrTopInt = makeCtrTop2(topR - E1);
|
|
5977
6247
|
const ctrTopExt = makeCtrTop2(topR);
|
|
5978
6248
|
const ctrTopTop = makeCtrTop2(topR + param.S5);
|
|
5979
6249
|
figTop.addMainOI([ctrTopExt, ctrTopInt]);
|
|
5980
6250
|
figTop.addSecond(ctrTopTop);
|
|
5981
|
-
figTop.addSecond(
|
|
5982
|
-
figTop.addSecond(
|
|
6251
|
+
figTop.addSecond(ctrRectangle8(-Lroof / 2, -WW12, Lroof, 2 * WW12));
|
|
6252
|
+
figTop.addSecond(ctrRectangle8(-Ltotal / 2, -WW12, Ltotal, 2 * WW12));
|
|
5983
6253
|
figTop.addSecond(ctrWheels2(1).translate(posXwheels[0], posYwheels2));
|
|
5984
6254
|
figTop.addSecond(ctrWheels2(1).translate(posXwheels[1], posYwheels2));
|
|
5985
6255
|
figTop.addSecond(ctrWheels2(1).translate(posXwheels[2], posYwheels2));
|
|
@@ -5992,10 +6262,10 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5992
6262
|
figTopInt.mergeFigure(figTop, true);
|
|
5993
6263
|
figTopTop.addMainO(ctrTopTop);
|
|
5994
6264
|
figTopTop.mergeFigure(figTop, true);
|
|
5995
|
-
const ctrTopLeg =
|
|
6265
|
+
const ctrTopLeg = contour18(-R52, posYtop).addSegStrokeR(R53, 0).addSegStrokeR(0, param.R5).addPointR(-param.R5, param.R5).addSegArc(param.R5, false, false).addSegStrokeR(0, H53).addPointR(param.R5, param.R5).addSegArc(param.R5, false, false).addSegStrokeR(0, param.R5).addSegStrokeR(-R53, 0).addSegStrokeR(0, -param.R5).addPointR(param.R5, -param.R5).addSegArc(param.R5, false, false).addSegStrokeR(0, -H53).addPointR(-param.R5, -param.R5).addSegArc(param.R5, false, false).closeSegStroke();
|
|
5996
6266
|
figTopLeg.addMainO(ctrTopLeg);
|
|
5997
6267
|
figFront.addSecond(ctrTopLeg);
|
|
5998
|
-
const ctrDoor =
|
|
6268
|
+
const ctrDoor = contour18(-LwallDoor / 2, param.H0 + param.V1).addCornerRounded(param.JR5).addSegStrokeR(LwallDoor, 0).addCornerRounded(param.JR5).addSegStrokeR(0, HwallDoor).addCornerRounded(param.JR6).addSegStrokeR(-LwallDoor, 0).addCornerRounded(param.JR6).closeSegStroke();
|
|
5999
6269
|
figWall.addMainOI([ctrBody2(false), ctrSideWindow2(1), ctrSideWindow2(-1), ctrDoor]);
|
|
6000
6270
|
figWall.mergeFigure(figBody, true);
|
|
6001
6271
|
rGeome.fig = {
|
|
@@ -6038,7 +6308,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6038
6308
|
{
|
|
6039
6309
|
outName: `subpax_${designName}_body`,
|
|
6040
6310
|
face: `${designName}_faceBody`,
|
|
6041
|
-
extrudeMethod:
|
|
6311
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
6042
6312
|
length: param.WW1,
|
|
6043
6313
|
rotate: [0, 0, 0],
|
|
6044
6314
|
translate: [0, 0, 0]
|
|
@@ -6050,7 +6320,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6050
6320
|
{
|
|
6051
6321
|
outName: `subpax_${designName}_frontWin`,
|
|
6052
6322
|
face: `${designName}_faceFront`,
|
|
6053
|
-
extrudeMethod:
|
|
6323
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
6054
6324
|
length: Ltot2,
|
|
6055
6325
|
rotate: [0, pi2, 0],
|
|
6056
6326
|
translate: [-Ltot2 / 2, 0, WW12]
|
|
@@ -6058,7 +6328,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6058
6328
|
{
|
|
6059
6329
|
outName: `subpax_${designName}_topInt`,
|
|
6060
6330
|
face: `${designName}_faceTopInt`,
|
|
6061
|
-
extrudeMethod:
|
|
6331
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
6062
6332
|
length: 3 * E1,
|
|
6063
6333
|
rotate: [-pi2, 0, 0],
|
|
6064
6334
|
translate: [0, posYtop - 2 * E1, WW12]
|
|
@@ -6066,7 +6336,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6066
6336
|
{
|
|
6067
6337
|
outName: `subpax_${designName}_top1`,
|
|
6068
6338
|
face: `${designName}_faceTop`,
|
|
6069
|
-
extrudeMethod:
|
|
6339
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
6070
6340
|
length: param.R5,
|
|
6071
6341
|
rotate: [-pi2, 0, 0],
|
|
6072
6342
|
translate: [0, posYtop, WW12]
|
|
@@ -6074,7 +6344,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6074
6344
|
{
|
|
6075
6345
|
outName: `subpax_${designName}_top2`,
|
|
6076
6346
|
face: `${designName}_faceTop`,
|
|
6077
|
-
extrudeMethod:
|
|
6347
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
6078
6348
|
length: param.R5,
|
|
6079
6349
|
rotate: [-pi2, 0, 0],
|
|
6080
6350
|
translate: [0, posYtop2 - param.R5, WW12]
|
|
@@ -6082,7 +6352,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6082
6352
|
{
|
|
6083
6353
|
outName: `subpax_${designName}_topTop`,
|
|
6084
6354
|
face: `${designName}_faceTopTop`,
|
|
6085
|
-
extrudeMethod:
|
|
6355
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
6086
6356
|
length: E1,
|
|
6087
6357
|
rotate: [-pi2, 0, 0],
|
|
6088
6358
|
translate: [0, posYtop2, WW12]
|
|
@@ -6096,7 +6366,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6096
6366
|
{
|
|
6097
6367
|
outName: `subpax_${designName}_wall1`,
|
|
6098
6368
|
face: `${designName}_faceWall`,
|
|
6099
|
-
extrudeMethod:
|
|
6369
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
6100
6370
|
length: E1,
|
|
6101
6371
|
rotate: [0, 0, 0],
|
|
6102
6372
|
translate: [0, 0, 0]
|
|
@@ -6104,7 +6374,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6104
6374
|
{
|
|
6105
6375
|
outName: `subpax_${designName}_wall2`,
|
|
6106
6376
|
face: `${designName}_faceWall`,
|
|
6107
|
-
extrudeMethod:
|
|
6377
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
6108
6378
|
length: E1,
|
|
6109
6379
|
rotate: [0, 0, 0],
|
|
6110
6380
|
translate: [0, 0, param.WW1 - E1]
|
|
@@ -6113,7 +6383,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6113
6383
|
volumes: [
|
|
6114
6384
|
{
|
|
6115
6385
|
outName: `ipax_${designName}_plus`,
|
|
6116
|
-
boolMethod:
|
|
6386
|
+
boolMethod: EBVolume14.eUnion,
|
|
6117
6387
|
inList: [
|
|
6118
6388
|
`subpax_${designName}_body`,
|
|
6119
6389
|
`subpax_${designName}_wheel1`,
|
|
@@ -6126,12 +6396,12 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6126
6396
|
},
|
|
6127
6397
|
{
|
|
6128
6398
|
outName: `ipax_${designName}_minus`,
|
|
6129
|
-
boolMethod:
|
|
6399
|
+
boolMethod: EBVolume14.eUnion,
|
|
6130
6400
|
inList: [`subpax_${designName}_frontWin`, ...roofHoleList]
|
|
6131
6401
|
},
|
|
6132
6402
|
{
|
|
6133
6403
|
outName: `pax_${designName}`,
|
|
6134
|
-
boolMethod:
|
|
6404
|
+
boolMethod: EBVolume14.eSubstraction,
|
|
6135
6405
|
inList: [`ipax_${designName}_plus`, `ipax_${designName}_minus`]
|
|
6136
6406
|
}
|
|
6137
6407
|
]
|
|
@@ -6148,13 +6418,14 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6148
6418
|
var capsuleDef = {
|
|
6149
6419
|
pTitle: "capsule",
|
|
6150
6420
|
pDescription: "high-level concept of the train-capsule",
|
|
6151
|
-
pDef:
|
|
6152
|
-
pGeom:
|
|
6421
|
+
pDef: pDef18,
|
|
6422
|
+
pGeom: pGeom18
|
|
6153
6423
|
};
|
|
6154
6424
|
export {
|
|
6155
6425
|
capsuleDef,
|
|
6156
6426
|
door1arcDef,
|
|
6157
6427
|
doubleBoneDef,
|
|
6428
|
+
factoryDef,
|
|
6158
6429
|
heliostatDef,
|
|
6159
6430
|
houseDef,
|
|
6160
6431
|
pcarDef,
|