desi77 0.1.20 → 0.1.23
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 +9 -1
- package/dist/index.js +2405 -750
- package/dist/pgdsvg/minifoot_side.svg +1 -0
- package/dist/pgdsvg/minifoot_top.svg +1 -0
- package/dist/pgdsvg/minihelio_front.svg +1 -0
- package/dist/pgdsvg/minihelio_mirror.svg +1 -0
- package/dist/pgdsvg/minihelio_side.svg +2 -0
- package/dist/pgdsvg/minimir_top.svg +1 -0
- package/dist/pgdsvg/minimir_wheel.svg +1 -0
- package/dist/pgdsvg/src_castle.svg +1 -0
- package/dist/pgdsvg/src_minifoot.svg +1 -0
- package/dist/pgdsvg/src_minihelio.svg +21 -0
- package/dist/pgdsvg/src_minimir.svg +1 -0
- package/dist/pgdsvg/src_tunnel.svg +11 -0
- package/dist/pgdsvg/tunnel_profile.svg +1 -0
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -1195,22 +1195,22 @@ var pDef4 = {
|
|
|
1195
1195
|
pDropdown2("officeOrientation", ["xdw", "xup", "xal", "ydw", "yup", "yal"]),
|
|
1196
1196
|
pNumber4("ith", "mm", 400, 100, 2e3, 10),
|
|
1197
1197
|
pNumber4("eth", "mm", 400, 100, 2e3, 10),
|
|
1198
|
-
pNumber4("bw", "mm",
|
|
1198
|
+
pNumber4("bw", "mm", 800, 200, 1e4, 10),
|
|
1199
1199
|
pSectionSeparator4("heights and roof"),
|
|
1200
|
-
pNumber4("oh1", "mm",
|
|
1200
|
+
pNumber4("oh1", "mm", 3e3, 2e3, 5e3, 10),
|
|
1201
1201
|
pNumber4("oh2", "mm", 4e3, 2e3, 1e4, 10),
|
|
1202
1202
|
pNumber4("rtn", "triangle", 6, 1, 1e3, 1),
|
|
1203
1203
|
pNumber4("ran", "degree", 49, 20, 90, 0.1),
|
|
1204
1204
|
pNumber4("ram", "degree", 90, 80, 160, 0.1),
|
|
1205
1205
|
pNumber4("rth", "mm", 200, 10, 1e3, 10),
|
|
1206
1206
|
pSectionSeparator4("lateral windows"),
|
|
1207
|
-
pNumber4("swx1", "mm",
|
|
1207
|
+
pNumber4("swx1", "mm", 600, 10, 5e3, 10),
|
|
1208
1208
|
pNumber4("swx2", "mm", 1e3, 10, 5e3, 10),
|
|
1209
1209
|
pNumber4("swh1", "mm", 1e3, 10, 5e3, 10),
|
|
1210
1210
|
pNumber4("swh2", "mm", 1e3, 10, 5e3, 10),
|
|
1211
1211
|
pNumber4("swh3", "mm", 200, 10, 5e3, 10),
|
|
1212
1212
|
pSectionSeparator4("front windows"),
|
|
1213
|
-
pNumber4("fwx1", "mm",
|
|
1213
|
+
pNumber4("fwx1", "mm", 600, 10, 5e3, 10),
|
|
1214
1214
|
pNumber4("fwx2", "mm", 1e3, 10, 5e3, 10),
|
|
1215
1215
|
pNumber4("fwh1", "mm", 1e3, 10, 5e3, 10),
|
|
1216
1216
|
pNumber4("fwh2", "mm", 1e3, 10, 5e3, 10),
|
|
@@ -1219,20 +1219,12 @@ var pDef4 = {
|
|
|
1219
1219
|
pNumber4("fdx2", "mm", 1e3, 10, 5e3, 10),
|
|
1220
1220
|
pNumber4("fdh2", "mm", 2e3, 10, 5e3, 10),
|
|
1221
1221
|
pNumber4("fdh3", "mm", 200, 10, 5e3, 10),
|
|
1222
|
-
pSectionSeparator4("
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
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)
|
|
1222
|
+
pSectionSeparator4("Openings in 3D"),
|
|
1223
|
+
pCheckbox2("d3_roof", true),
|
|
1224
|
+
pCheckbox2("d3_wall", false),
|
|
1225
|
+
pCheckbox2("d3_ground", false),
|
|
1226
|
+
pCheckbox2("d3_officeCeiling", true),
|
|
1227
|
+
pCheckbox2("d3_bridge", true)
|
|
1236
1228
|
],
|
|
1237
1229
|
paramSvg: {
|
|
1238
1230
|
onx: "factory_top.svg",
|
|
@@ -1267,16 +1259,11 @@ var pDef4 = {
|
|
|
1267
1259
|
fdx2: "factory_front_window.svg",
|
|
1268
1260
|
fdh2: "factory_front_window.svg",
|
|
1269
1261
|
fdh3: "factory_front_window.svg",
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
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"
|
|
1262
|
+
d3_roof: "factory_top.svg",
|
|
1263
|
+
d3_wall: "factory_top.svg",
|
|
1264
|
+
d3_ground: "factory_top.svg",
|
|
1265
|
+
d3_officeCeiling: "factory_top.svg",
|
|
1266
|
+
d3_bridge: "factory_top.svg"
|
|
1280
1267
|
},
|
|
1281
1268
|
sim: {
|
|
1282
1269
|
tMax: 180,
|
|
@@ -1289,9 +1276,46 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1289
1276
|
const rGeome = initGeom4(pDef4.partName + suffix);
|
|
1290
1277
|
const figTop = figure4();
|
|
1291
1278
|
const figWest = figure4();
|
|
1279
|
+
const figNorth = figure4();
|
|
1280
|
+
const figRoof = figure4();
|
|
1281
|
+
const figGround = figure4();
|
|
1282
|
+
const figWallEW = figure4();
|
|
1283
|
+
const figWallNS = figure4();
|
|
1284
|
+
const figOCeiling = figure4();
|
|
1285
|
+
const figOWallF = figure4();
|
|
1286
|
+
const figOWallB = figure4();
|
|
1287
|
+
const figOWallS = figure4();
|
|
1288
|
+
const figOWallTop = figure4();
|
|
1289
|
+
const figBridgeW = figure4();
|
|
1290
|
+
const figBridgeN = figure4();
|
|
1292
1291
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
1293
1292
|
`;
|
|
1294
1293
|
try {
|
|
1294
|
+
let rotateOfficeWall2 = function(iOfficeOrientation, iFrontBack) {
|
|
1295
|
+
const rRotate = [pi2, 0, 0];
|
|
1296
|
+
let twoRot = iFrontBack;
|
|
1297
|
+
if (iOfficeOrientation > 2) {
|
|
1298
|
+
twoRot = !twoRot;
|
|
1299
|
+
}
|
|
1300
|
+
if (twoRot) {
|
|
1301
|
+
rRotate[2] = pi2;
|
|
1302
|
+
}
|
|
1303
|
+
return rRotate;
|
|
1304
|
+
}, translateOfficeWall2 = function(iOO, iPos, iTh, iFB) {
|
|
1305
|
+
const rTranslate = [0, 0, 0];
|
|
1306
|
+
let trans1 = iFB;
|
|
1307
|
+
if (iOO > 2) {
|
|
1308
|
+
trans1 = !trans1;
|
|
1309
|
+
}
|
|
1310
|
+
if (trans1) {
|
|
1311
|
+
rTranslate[0] = iPos;
|
|
1312
|
+
} else {
|
|
1313
|
+
rTranslate[1] = iPos + iTh;
|
|
1314
|
+
}
|
|
1315
|
+
return rTranslate;
|
|
1316
|
+
};
|
|
1317
|
+
var rotateOfficeWall = rotateOfficeWall2, translateOfficeWall = translateOfficeWall2;
|
|
1318
|
+
const pi2 = Math.PI / 2;
|
|
1295
1319
|
const llix = param.onx * param.olx + (param.onx - 1) * param.iwx + 2 * param.ewx;
|
|
1296
1320
|
const llex = llix + 2 * param.eth;
|
|
1297
1321
|
const lliy = param.ony * param.oly + (param.ony - 1) * param.iwy + 2 * param.ewy;
|
|
@@ -1320,17 +1344,114 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1320
1344
|
const Rhxp = 100 * Rhx / roofTriLx;
|
|
1321
1345
|
const Rhxsp = 100 * Rhxs / roofTriLx;
|
|
1322
1346
|
const Rhyp = 100 * Rh / roofTriLx;
|
|
1347
|
+
let ofN = param.ony;
|
|
1348
|
+
let ofW = param.oly;
|
|
1349
|
+
let ofiw = param.iwy;
|
|
1350
|
+
let ofew = param.ewy;
|
|
1351
|
+
let osN = param.onx;
|
|
1352
|
+
let osW = param.olx;
|
|
1353
|
+
let osiw = param.iwx;
|
|
1354
|
+
let osew = param.ewx;
|
|
1355
|
+
if (param.officeOrientation > 2) {
|
|
1356
|
+
ofN = param.onx;
|
|
1357
|
+
ofW = param.olx;
|
|
1358
|
+
ofiw = param.iwx;
|
|
1359
|
+
ofew = param.ewx;
|
|
1360
|
+
osN = param.ony;
|
|
1361
|
+
osW = param.oly;
|
|
1362
|
+
osiw = param.iwy;
|
|
1363
|
+
osew = param.ewy;
|
|
1364
|
+
}
|
|
1365
|
+
if (param.officeOrientation > 5) {
|
|
1366
|
+
throw `err189: officeOrientation ${param.officeOrientation} is out of range`;
|
|
1367
|
+
}
|
|
1368
|
+
const ofWmin = 2 * param.ith + param.fwx1 + param.fwx2 + param.fdx1 + param.fdx2;
|
|
1369
|
+
const ofHmin1 = param.ith + param.fwh1 + param.fwh2 + param.fwh3;
|
|
1370
|
+
const ofHmin2 = param.ith + param.fdh1 + param.fdh2;
|
|
1371
|
+
const osWmin = 2 * param.ith + param.swx1 + param.swx2;
|
|
1372
|
+
const osHmin = param.ith + param.swh1 + param.swh2 + param.swh3;
|
|
1373
|
+
const Xidx = [...Array(param.onx).keys()];
|
|
1374
|
+
const owpN = Xidx.map((ii) => param.eth + param.ewx + ii * (param.olx + param.iwx));
|
|
1375
|
+
const owpS = Xidx.map(
|
|
1376
|
+
(ii) => param.eth + param.ewx + ii * (param.olx + param.iwx) + param.olx - param.ith
|
|
1377
|
+
);
|
|
1378
|
+
const Yidx = [...Array(param.ony).keys()];
|
|
1379
|
+
const owpW = Yidx.map((ii) => param.eth + param.ewy + ii * (param.oly + param.iwy));
|
|
1380
|
+
const owpE = Yidx.map(
|
|
1381
|
+
(ii) => param.eth + param.ewy + ii * (param.oly + param.iwy) + param.oly - param.ith
|
|
1382
|
+
);
|
|
1383
|
+
let powF = owpN;
|
|
1384
|
+
let powB = owpS;
|
|
1385
|
+
let powS1 = owpW;
|
|
1386
|
+
let powS2 = owpE;
|
|
1387
|
+
let powFBmin = owpN;
|
|
1388
|
+
if (param.officeOrientation == 1) {
|
|
1389
|
+
powF = owpS;
|
|
1390
|
+
powB = owpN;
|
|
1391
|
+
} else if (param.officeOrientation == 2) {
|
|
1392
|
+
powF = Xidx.map((ii) => ii % 2 === 0 ? owpS[ii] : owpN[ii]);
|
|
1393
|
+
powB = Xidx.map((ii) => ii % 2 === 0 ? owpN[ii] : owpS[ii]);
|
|
1394
|
+
} else if (param.officeOrientation == 3) {
|
|
1395
|
+
powF = owpW;
|
|
1396
|
+
powB = owpE;
|
|
1397
|
+
} else if (param.officeOrientation == 4) {
|
|
1398
|
+
powF = owpE;
|
|
1399
|
+
powB = owpW;
|
|
1400
|
+
} else if (param.officeOrientation == 5) {
|
|
1401
|
+
powF = Yidx.map((ii) => ii % 2 === 0 ? owpE[ii] : owpW[ii]);
|
|
1402
|
+
powB = Yidx.map((ii) => ii % 2 === 0 ? owpW[ii] : owpE[ii]);
|
|
1403
|
+
}
|
|
1404
|
+
if (param.officeOrientation > 2) {
|
|
1405
|
+
powS1 = owpN;
|
|
1406
|
+
powS2 = owpS;
|
|
1407
|
+
powFBmin = owpW;
|
|
1408
|
+
}
|
|
1409
|
+
const powS = [...powS1, ...powS2];
|
|
1410
|
+
const Xidx2 = [...Array(param.onx - 1).keys()];
|
|
1411
|
+
const Yidx2 = [...Array(param.ony - 1).keys()];
|
|
1412
|
+
const brxx = Xidx2.map(
|
|
1413
|
+
(ii) => param.eth + param.ewx + param.olx + ii * (param.olx + param.iwx)
|
|
1414
|
+
);
|
|
1415
|
+
const bryy = Yidx2.map(
|
|
1416
|
+
(ii) => param.eth + param.ewy + param.oly + ii * (param.oly + param.iwy)
|
|
1417
|
+
);
|
|
1418
|
+
const brdx = (param.olx - param.bw) / 2;
|
|
1419
|
+
const brdy = (param.oly - param.bw) / 2;
|
|
1420
|
+
const brxy = Yidx.map((ii) => param.eth + param.ewy + brdy + ii * (param.oly + param.iwy));
|
|
1421
|
+
const bryx = Xidx.map((ii) => param.eth + param.ewx + brdx + ii * (param.olx + param.iwx));
|
|
1422
|
+
const iwx2 = param.iwx / 2;
|
|
1423
|
+
const iwy2 = param.iwy / 2;
|
|
1424
|
+
const brxh = param.ith + iwx2;
|
|
1425
|
+
const bryh = param.ith + iwy2;
|
|
1323
1426
|
if (olix < 0) {
|
|
1324
1427
|
throw `err158: olix ${ffix4(olix)} is too small compare to ith ${param.ith}`;
|
|
1325
1428
|
}
|
|
1326
1429
|
if (oliy < 0) {
|
|
1327
1430
|
throw `err161: oliy ${ffix4(oliy)} is too small compare to ith ${param.ith}`;
|
|
1328
1431
|
}
|
|
1329
|
-
if (
|
|
1330
|
-
throw `
|
|
1432
|
+
if (ofW < ofWmin) {
|
|
1433
|
+
throw `err201: ofW ${ofW} is too small compare to fwx1 ${param.fwx1}, fwx2 ${param.fwx2}, fdx1 ${param.fdx1}, fdx2 ${param.fdx2}`;
|
|
1434
|
+
}
|
|
1435
|
+
if (param.oh1 < ofHmin1) {
|
|
1436
|
+
throw `err204: oh1 ${param.oh1} is too small compare to fwh1 ${param.fwh1}, fwh2 ${param.fwh2}, fwh3 ${param.fwh3}`;
|
|
1437
|
+
}
|
|
1438
|
+
if (param.oh1 < ofHmin2) {
|
|
1439
|
+
throw `err207: oh1 ${param.oh1} is too small compare to fdh1 ${param.fdh1}, fdh2 ${param.fdh2}`;
|
|
1440
|
+
}
|
|
1441
|
+
if (osW < osWmin) {
|
|
1442
|
+
throw `err210: osW ${osW} is too small compare to swx1 ${param.swx1} and swx2 ${param.swx2}`;
|
|
1443
|
+
}
|
|
1444
|
+
if (param.oh1 < osHmin) {
|
|
1445
|
+
throw `err213: oh1 ${param.oh1} is too small compare to swh1 ${param.swh1}, swh2 ${param.swh2}, swh3 ${param.swh3}`;
|
|
1446
|
+
}
|
|
1447
|
+
if (param.fwx2 < 2 * param.fwh3) {
|
|
1448
|
+
throw `err213: fwh3 ${param.fwh3} is too large compare to fwx2 ${param.fwx2}`;
|
|
1331
1449
|
}
|
|
1332
|
-
if (param.
|
|
1333
|
-
throw `
|
|
1450
|
+
if (param.fdx2 < 2 * param.fdh3) {
|
|
1451
|
+
throw `err219: fdh3 ${param.fdh3} is too large compare to fdx2 ${param.fdx2}`;
|
|
1452
|
+
}
|
|
1453
|
+
if (param.swx2 < 2 * param.swh3) {
|
|
1454
|
+
throw `err222: swh3 ${param.swh3} is too large compare to swx2 ${param.swx2}`;
|
|
1334
1455
|
}
|
|
1335
1456
|
if (Math.min(param.olx, param.oly) < param.bw) {
|
|
1336
1457
|
throw `err172: bw ${param.bw} is too large compare to olx ${param.olx} or oly ${param.oly}`;
|
|
@@ -1343,6 +1464,30 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1343
1464
|
`;
|
|
1344
1465
|
rGeome.logstr += `roof north glass length ${ffix4(tr1lBC)} mm, Rhxp ${ffix4(Rhxp)} %, roof south opaque ${ffix4(tr1lCA)} mm, Rhxsp ${ffix4(Rhxsp)} %
|
|
1345
1466
|
`;
|
|
1467
|
+
const ctrOfficeBack = [];
|
|
1468
|
+
const ctrOfficeFront = [];
|
|
1469
|
+
const ctrOfficeFrontW = [];
|
|
1470
|
+
for (let ii = 0; ii < ofN; ii++) {
|
|
1471
|
+
const ox = param.eth + ofew + ii * (ofW + ofiw);
|
|
1472
|
+
const dox = param.ith + param.fwx1 + param.fwx2 + param.fdx1;
|
|
1473
|
+
const dr = ofW - dox - param.fdx2;
|
|
1474
|
+
const ctrOB = ctrRectangle4(ox, 0, ofW, param.oh1);
|
|
1475
|
+
const ctrOF = contour4(ox, 0).addSegStrokeR(dox, 0).addSegStrokeR(0, param.fdh2).addPointR(param.fdx2 / 2, param.fdh3).addPointR(param.fdx2, 0).addSegArc2().addSegStrokeR(0, -param.fdh2).addSegStrokeR(dr, 0).addSegStrokeR(0, param.oh1).addSegStrokeR(-ofW, 0).closeSegStroke();
|
|
1476
|
+
const ctrOFW = contour4(ox + param.ith + param.fwx1, param.fwh1).addSegStrokeR(param.fwx2, 0).addSegStrokeR(0, param.fwh2).addPointR(-param.fwx2 / 2, param.fwh3).addPointR(-param.fwx2, 0).addSegArc2().closeSegStroke();
|
|
1477
|
+
ctrOfficeBack.push(ctrOB);
|
|
1478
|
+
ctrOfficeFront.push(ctrOF);
|
|
1479
|
+
ctrOfficeFrontW.push(ctrOFW);
|
|
1480
|
+
}
|
|
1481
|
+
const ctrOfficeSide = [];
|
|
1482
|
+
const ctrOfficeSideW = [];
|
|
1483
|
+
for (let ii = 0; ii < osN; ii++) {
|
|
1484
|
+
const ox = param.eth + osew + ii * (osW + osiw);
|
|
1485
|
+
const ctrOS = ctrRectangle4(ox, 0, osW, param.oh1);
|
|
1486
|
+
const ctrOSW = contour4(ox + param.ith + param.swx1, param.swh1).addSegStrokeR(param.swx2, 0).addSegStrokeR(0, param.swh2).addPointR(-param.swx2 / 2, param.swh3).addPointR(-param.swx2, 0).addSegArc2().closeSegStroke();
|
|
1487
|
+
ctrOfficeSide.push(ctrOS);
|
|
1488
|
+
ctrOfficeSideW.push(ctrOSW);
|
|
1489
|
+
}
|
|
1490
|
+
const ctrOfficeCeiling = [];
|
|
1346
1491
|
const ctrFext = ctrRectangle4(0, 0, llex, lley);
|
|
1347
1492
|
const ctrFint = ctrRectangle4(param.eth, param.eth, llix, lliy);
|
|
1348
1493
|
figTop.addMainOI([ctrFext, ctrFint]);
|
|
@@ -1353,6 +1498,7 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1353
1498
|
const ctrOext = ctrRectangle4(pox, poy, param.olx, param.oly);
|
|
1354
1499
|
const ctrOint = ctrRectangle4(pox + param.ith, poy + param.ith, olix, oliy);
|
|
1355
1500
|
figTop.addMainOI([ctrOext, ctrOint]);
|
|
1501
|
+
ctrOfficeCeiling.push(ctrOext);
|
|
1356
1502
|
}
|
|
1357
1503
|
}
|
|
1358
1504
|
for (let ii = 0; ii < param.onx - 1; ii++) {
|
|
@@ -1391,27 +1537,269 @@ function pGeom4(t, param, suffix = "") {
|
|
|
1391
1537
|
}
|
|
1392
1538
|
ctrRoof.closeSegStroke();
|
|
1393
1539
|
figWest.addMainO(ctrRoof);
|
|
1540
|
+
const ctrWallEW = contour4(0, 0).addSegStrokeR(llex, 0).addSegStrokeR(0, fh);
|
|
1541
|
+
for (let ii = 0; ii < param.rtn; ii++) {
|
|
1542
|
+
ctrWallEW.addSegStrokeR(-Rhxs, Rh).addSegStrokeR(-Rhx, -Rh);
|
|
1543
|
+
}
|
|
1544
|
+
ctrWallEW.closeSegStroke();
|
|
1545
|
+
figWest.addMainO(ctrWallEW);
|
|
1546
|
+
figNorth.addMainO(ctrRectangle4(0, -param.eth, lley, param.eth));
|
|
1547
|
+
figNorth.addMainO(ctrRectangle4(0, 0, param.eth, fh));
|
|
1548
|
+
figNorth.addMainO(ctrRectangle4(lley - param.eth, 0, param.eth, fh));
|
|
1549
|
+
for (let ii = 0; ii < param.ony; ii++) {
|
|
1550
|
+
const poy = officeOy + ii * (param.oly + param.iwy);
|
|
1551
|
+
figNorth.addMainOI([
|
|
1552
|
+
ctrRectangle4(poy, 0, param.oly, param.oh1),
|
|
1553
|
+
ctrRectangle4(poy + param.ith, 0, oliy, param.oh1 - param.ith)
|
|
1554
|
+
]);
|
|
1555
|
+
}
|
|
1556
|
+
figNorth.addMainOI([
|
|
1557
|
+
ctrRectangle4(0, fh, lley, Rh + param.rth),
|
|
1558
|
+
ctrRectangle4(0, fh, lley, param.rth),
|
|
1559
|
+
ctrRectangle4(0, fh + Rh, lley, param.rth)
|
|
1560
|
+
]);
|
|
1561
|
+
const ctrWallNS = ctrRectangle4(0, 0, lley, fh);
|
|
1562
|
+
figNorth.addMainO(ctrWallNS);
|
|
1563
|
+
if (param.officeOrientation < 3) {
|
|
1564
|
+
for (let ii = 0; ii < ofN; ii++) {
|
|
1565
|
+
figNorth.addMainOI([ctrOfficeFront[ii], ctrOfficeFrontW[ii]]);
|
|
1566
|
+
figNorth.addMainO(ctrOfficeBack[ii]);
|
|
1567
|
+
}
|
|
1568
|
+
for (let ii = 0; ii < osN; ii++) {
|
|
1569
|
+
figWest.addMainOI([ctrOfficeSide[ii], ctrOfficeSideW[ii]]);
|
|
1570
|
+
}
|
|
1571
|
+
} else {
|
|
1572
|
+
for (let ii = 0; ii < ofN; ii++) {
|
|
1573
|
+
figWest.addMainOI([ctrOfficeFront[ii], ctrOfficeFrontW[ii]]);
|
|
1574
|
+
figWest.addMainO(ctrOfficeBack[ii]);
|
|
1575
|
+
}
|
|
1576
|
+
for (let ii = 0; ii < osN; ii++) {
|
|
1577
|
+
figNorth.addMainOI([ctrOfficeSide[ii], ctrOfficeSideW[ii]]);
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
figRoof.mergeFigure(figWest, true);
|
|
1581
|
+
figRoof.addMainO(ctrRoof);
|
|
1582
|
+
figGround.mergeFigure(figTop, true);
|
|
1583
|
+
figGround.addMainO(ctrFext);
|
|
1584
|
+
figWallEW.mergeFigure(figWest, true);
|
|
1585
|
+
figWallEW.addMainO(ctrWallEW);
|
|
1586
|
+
figWallNS.mergeFigure(figNorth, true);
|
|
1587
|
+
figWallNS.addMainO(ctrWallNS);
|
|
1588
|
+
figOCeiling.mergeFigure(figTop, true);
|
|
1589
|
+
for (const iCtr of ctrOfficeCeiling) {
|
|
1590
|
+
figOCeiling.addMainO(iCtr);
|
|
1591
|
+
}
|
|
1592
|
+
if (param.officeOrientation < 3) {
|
|
1593
|
+
figOWallF.mergeFigure(figNorth, true);
|
|
1594
|
+
figOWallB.mergeFigure(figNorth, true);
|
|
1595
|
+
figOWallS.mergeFigure(figWest, true);
|
|
1596
|
+
} else {
|
|
1597
|
+
figOWallF.mergeFigure(figWest, true);
|
|
1598
|
+
figOWallB.mergeFigure(figWest, true);
|
|
1599
|
+
figOWallS.mergeFigure(figNorth, true);
|
|
1600
|
+
}
|
|
1601
|
+
for (let ii = 0; ii < ofN; ii++) {
|
|
1602
|
+
figOWallF.addMainOI([ctrOfficeFront[ii], ctrOfficeFrontW[ii]]);
|
|
1603
|
+
figOWallB.addMainO(ctrOfficeBack[ii]);
|
|
1604
|
+
}
|
|
1605
|
+
for (let ii = 0; ii < osN; ii++) {
|
|
1606
|
+
figOWallS.addMainOI([ctrOfficeSide[ii], ctrOfficeSideW[ii]]);
|
|
1607
|
+
}
|
|
1608
|
+
for (const iPosX of powF) {
|
|
1609
|
+
for (const iPosY of powS1) {
|
|
1610
|
+
figOWallTop.addMainO(ctrRectangle4(iPosX, iPosY, param.ith, ofW));
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
for (const iPosX of powB) {
|
|
1614
|
+
for (const iPosY of powS1) {
|
|
1615
|
+
figOWallTop.addSecond(ctrRectangle4(iPosX, iPosY, param.ith, ofW));
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
for (const iPosY of powS) {
|
|
1619
|
+
for (const iPosX of powFBmin) {
|
|
1620
|
+
figOWallTop.addSecond(ctrRectangle4(iPosX, iPosY, osW, param.ith));
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
figBridgeW.mergeFigure(figWest, true);
|
|
1624
|
+
for (const ox of brxx) {
|
|
1625
|
+
const ctr = contour4(ox, param.oh1).addSegStrokeR(0, -brxh).addPointR(iwx2, iwx2).addPointR(2 * iwx2, 0).addSegArc2().addSegStrokeR(0, brxh).closeSegStroke();
|
|
1626
|
+
figBridgeW.addMainO(ctr);
|
|
1627
|
+
}
|
|
1628
|
+
for (const ox of bryx) {
|
|
1629
|
+
figBridgeW.addSecond(ctrRectangle4(ox, param.oh1 - bryh, param.bw, bryh));
|
|
1630
|
+
}
|
|
1631
|
+
figBridgeN.mergeFigure(figNorth, true);
|
|
1632
|
+
for (const ox of bryy) {
|
|
1633
|
+
const ctr = contour4(ox, param.oh1).addSegStrokeR(0, -bryh).addPointR(iwy2, iwy2).addPointR(2 * iwy2, 0).addSegArc2().addSegStrokeR(0, bryh).closeSegStroke();
|
|
1634
|
+
figBridgeN.addMainO(ctr);
|
|
1635
|
+
}
|
|
1636
|
+
for (const ox of brxy) {
|
|
1637
|
+
figBridgeN.addSecond(ctrRectangle4(ox, param.oh1 - brxh, param.bw, brxh));
|
|
1638
|
+
}
|
|
1394
1639
|
rGeome.fig = {
|
|
1395
1640
|
faceTop: figTop,
|
|
1396
|
-
faceWest: figWest
|
|
1641
|
+
faceWest: figWest,
|
|
1642
|
+
faceNorth: figNorth,
|
|
1643
|
+
faceRoof: figRoof,
|
|
1644
|
+
faceGround: figGround,
|
|
1645
|
+
faceWallEW: figWallEW,
|
|
1646
|
+
faceWallNS: figWallNS,
|
|
1647
|
+
faceOCeiling: figOCeiling,
|
|
1648
|
+
faceOWallF: figOWallF,
|
|
1649
|
+
faceOWallB: figOWallB,
|
|
1650
|
+
faceOWallS: figOWallS,
|
|
1651
|
+
faceOWallTop: figOWallTop,
|
|
1652
|
+
faceBridgeW: figBridgeW,
|
|
1653
|
+
faceBridgeN: figBridgeN
|
|
1397
1654
|
};
|
|
1398
1655
|
const designName = rGeome.partName;
|
|
1656
|
+
const unionList = [];
|
|
1657
|
+
unionList.push(`subpax_${designName}_wallSouth`);
|
|
1658
|
+
unionList.push(`subpax_${designName}_wallEast`);
|
|
1659
|
+
if (param.d3_roof) {
|
|
1660
|
+
unionList.push(`subpax_${designName}_roof`);
|
|
1661
|
+
}
|
|
1662
|
+
if (param.d3_ground) {
|
|
1663
|
+
unionList.push(`subpax_${designName}_ground`);
|
|
1664
|
+
}
|
|
1665
|
+
if (param.d3_wall) {
|
|
1666
|
+
unionList.push(`subpax_${designName}_wallNorth`);
|
|
1667
|
+
unionList.push(`subpax_${designName}_wallWest`);
|
|
1668
|
+
}
|
|
1669
|
+
if (param.d3_officeCeiling) {
|
|
1670
|
+
unionList.push(`subpax_${designName}_officeCeiling`);
|
|
1671
|
+
}
|
|
1672
|
+
const volOWF = powF.map((iPos, idx) => {
|
|
1673
|
+
const rVol = {
|
|
1674
|
+
outName: `subpax_${designName}_OWF${idx}`,
|
|
1675
|
+
face: `${designName}_faceOWallF`,
|
|
1676
|
+
extrudeMethod: EExtrude4.eLinearOrtho,
|
|
1677
|
+
length: param.ith,
|
|
1678
|
+
rotate: rotateOfficeWall2(param.officeOrientation, true),
|
|
1679
|
+
translate: translateOfficeWall2(param.officeOrientation, iPos, param.ith, true)
|
|
1680
|
+
};
|
|
1681
|
+
return rVol;
|
|
1682
|
+
});
|
|
1683
|
+
unionList.push(...powF.map((iPos, idx) => `subpax_${designName}_OWF${idx}`));
|
|
1684
|
+
const volOWB = powB.map((iPos, idx) => {
|
|
1685
|
+
const rVol = {
|
|
1686
|
+
outName: `subpax_${designName}_OWB${idx}`,
|
|
1687
|
+
face: `${designName}_faceOWallB`,
|
|
1688
|
+
extrudeMethod: EExtrude4.eLinearOrtho,
|
|
1689
|
+
length: param.ith,
|
|
1690
|
+
rotate: rotateOfficeWall2(param.officeOrientation, true),
|
|
1691
|
+
translate: translateOfficeWall2(param.officeOrientation, iPos, param.ith, true)
|
|
1692
|
+
};
|
|
1693
|
+
return rVol;
|
|
1694
|
+
});
|
|
1695
|
+
unionList.push(...powB.map((iPos, idx) => `subpax_${designName}_OWB${idx}`));
|
|
1696
|
+
const volOWS = powS.map((iPos, idx) => {
|
|
1697
|
+
const rVol = {
|
|
1698
|
+
outName: `subpax_${designName}_OWS${idx}`,
|
|
1699
|
+
face: `${designName}_faceOWallS`,
|
|
1700
|
+
extrudeMethod: EExtrude4.eLinearOrtho,
|
|
1701
|
+
length: param.ith,
|
|
1702
|
+
rotate: rotateOfficeWall2(param.officeOrientation, false),
|
|
1703
|
+
translate: translateOfficeWall2(param.officeOrientation, iPos, param.ith, false)
|
|
1704
|
+
};
|
|
1705
|
+
return rVol;
|
|
1706
|
+
});
|
|
1707
|
+
unionList.push(...powS.map((iPos, idx) => `subpax_${designName}_OWS${idx}`));
|
|
1708
|
+
const volBW = brxy.map((iPos, idx) => {
|
|
1709
|
+
const rVol = {
|
|
1710
|
+
outName: `subpax_${designName}_BW${idx}`,
|
|
1711
|
+
face: `${designName}_faceBridgeW`,
|
|
1712
|
+
extrudeMethod: EExtrude4.eLinearOrtho,
|
|
1713
|
+
length: param.bw,
|
|
1714
|
+
rotate: [pi2, 0, 0],
|
|
1715
|
+
translate: [0, param.bw + iPos, 0]
|
|
1716
|
+
};
|
|
1717
|
+
return rVol;
|
|
1718
|
+
});
|
|
1719
|
+
const volBN = bryx.map((iPos, idx) => {
|
|
1720
|
+
const rVol = {
|
|
1721
|
+
outName: `subpax_${designName}_BN${idx}`,
|
|
1722
|
+
face: `${designName}_faceBridgeN`,
|
|
1723
|
+
extrudeMethod: EExtrude4.eLinearOrtho,
|
|
1724
|
+
length: param.bw,
|
|
1725
|
+
rotate: [pi2, 0, pi2],
|
|
1726
|
+
translate: [iPos, 0, 0]
|
|
1727
|
+
};
|
|
1728
|
+
return rVol;
|
|
1729
|
+
});
|
|
1730
|
+
if (param.d3_bridge) {
|
|
1731
|
+
unionList.push(...brxy.map((iPos, idx) => `subpax_${designName}_BW${idx}`));
|
|
1732
|
+
unionList.push(...bryx.map((iPos, idx) => `subpax_${designName}_BN${idx}`));
|
|
1733
|
+
}
|
|
1399
1734
|
rGeome.vol = {
|
|
1400
1735
|
extrudes: [
|
|
1401
1736
|
{
|
|
1402
|
-
outName: `subpax_${designName}
|
|
1403
|
-
face: `${designName}
|
|
1737
|
+
outName: `subpax_${designName}_ground`,
|
|
1738
|
+
face: `${designName}_faceGround`,
|
|
1404
1739
|
extrudeMethod: EExtrude4.eLinearOrtho,
|
|
1405
|
-
length:
|
|
1740
|
+
length: param.eth,
|
|
1406
1741
|
rotate: [0, 0, 0],
|
|
1742
|
+
translate: [0, 0, -param.eth]
|
|
1743
|
+
},
|
|
1744
|
+
{
|
|
1745
|
+
outName: `subpax_${designName}_roof`,
|
|
1746
|
+
face: `${designName}_faceRoof`,
|
|
1747
|
+
extrudeMethod: EExtrude4.eLinearOrtho,
|
|
1748
|
+
length: lley,
|
|
1749
|
+
rotate: [pi2, 0, 0],
|
|
1750
|
+
translate: [0, lley, 0]
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
outName: `subpax_${designName}_wallNorth`,
|
|
1754
|
+
face: `${designName}_faceWallNS`,
|
|
1755
|
+
extrudeMethod: EExtrude4.eLinearOrtho,
|
|
1756
|
+
length: param.eth,
|
|
1757
|
+
rotate: [pi2, 0, pi2],
|
|
1407
1758
|
translate: [0, 0, 0]
|
|
1408
|
-
}
|
|
1759
|
+
},
|
|
1760
|
+
{
|
|
1761
|
+
outName: `subpax_${designName}_wallSouth`,
|
|
1762
|
+
face: `${designName}_faceWallNS`,
|
|
1763
|
+
extrudeMethod: EExtrude4.eLinearOrtho,
|
|
1764
|
+
length: param.eth,
|
|
1765
|
+
rotate: [pi2, 0, pi2],
|
|
1766
|
+
translate: [param.eth + llix, 0, 0]
|
|
1767
|
+
},
|
|
1768
|
+
{
|
|
1769
|
+
outName: `subpax_${designName}_wallWest`,
|
|
1770
|
+
face: `${designName}_faceWallEW`,
|
|
1771
|
+
extrudeMethod: EExtrude4.eLinearOrtho,
|
|
1772
|
+
length: param.eth,
|
|
1773
|
+
rotate: [pi2, 0, 0],
|
|
1774
|
+
translate: [0, param.eth, 0]
|
|
1775
|
+
},
|
|
1776
|
+
{
|
|
1777
|
+
outName: `subpax_${designName}_wallEast`,
|
|
1778
|
+
face: `${designName}_faceWallEW`,
|
|
1779
|
+
extrudeMethod: EExtrude4.eLinearOrtho,
|
|
1780
|
+
length: param.eth,
|
|
1781
|
+
rotate: [pi2, 0, 0],
|
|
1782
|
+
translate: [0, 2 * param.eth + lliy, 0]
|
|
1783
|
+
},
|
|
1784
|
+
{
|
|
1785
|
+
outName: `subpax_${designName}_officeCeiling`,
|
|
1786
|
+
face: `${designName}_faceOCeiling`,
|
|
1787
|
+
extrudeMethod: EExtrude4.eLinearOrtho,
|
|
1788
|
+
length: param.ith,
|
|
1789
|
+
rotate: [0, 0, 0],
|
|
1790
|
+
translate: [0, 0, param.oh1 - param.ith]
|
|
1791
|
+
},
|
|
1792
|
+
...volOWF,
|
|
1793
|
+
...volOWB,
|
|
1794
|
+
...volOWS,
|
|
1795
|
+
...volBW,
|
|
1796
|
+
...volBN
|
|
1409
1797
|
],
|
|
1410
1798
|
volumes: [
|
|
1411
1799
|
{
|
|
1412
1800
|
outName: `pax_${designName}`,
|
|
1413
1801
|
boolMethod: EBVolume4.eUnion,
|
|
1414
|
-
inList:
|
|
1802
|
+
inList: unionList
|
|
1415
1803
|
}
|
|
1416
1804
|
]
|
|
1417
1805
|
};
|
|
@@ -4389,104 +4777,51 @@ var heliostatDef = {
|
|
|
4389
4777
|
pGeom: pGeom13
|
|
4390
4778
|
};
|
|
4391
4779
|
|
|
4392
|
-
// src/
|
|
4780
|
+
// src/heliostat/minifoot.ts
|
|
4393
4781
|
import {
|
|
4394
|
-
withinHPiHPi,
|
|
4395
|
-
ShapePoint as ShapePoint2,
|
|
4396
4782
|
point as point7,
|
|
4397
4783
|
contour as contour15,
|
|
4398
4784
|
contourCircle as contourCircle11,
|
|
4399
|
-
ctrRectangle as ctrRectangle7,
|
|
4400
4785
|
figure as figure12,
|
|
4401
|
-
|
|
4786
|
+
radToDeg as radToDeg10,
|
|
4402
4787
|
ffix as ffix15,
|
|
4403
4788
|
pNumber as pNumber14,
|
|
4404
|
-
pCheckbox as pCheckbox9,
|
|
4405
|
-
pDropdown as pDropdown8,
|
|
4406
4789
|
pSectionSeparator as pSectionSeparator14,
|
|
4407
|
-
transform3d,
|
|
4408
4790
|
EExtrude as EExtrude11,
|
|
4409
4791
|
EBVolume as EBVolume11,
|
|
4410
4792
|
initGeom as initGeom14
|
|
4411
4793
|
} from "geometrix";
|
|
4794
|
+
import { triLALrL as triLALrL2, triLLLrA as triLLLrA2 } from "triangule";
|
|
4412
4795
|
var pDef14 = {
|
|
4413
|
-
partName: "
|
|
4796
|
+
partName: "minifoot",
|
|
4414
4797
|
params: [
|
|
4415
4798
|
//pNumber(name, unit, init, min, max, step)
|
|
4416
|
-
pNumber14("
|
|
4417
|
-
pNumber14("
|
|
4418
|
-
pNumber14("
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
pNumber14("
|
|
4423
|
-
pNumber14("
|
|
4424
|
-
pNumber14("
|
|
4425
|
-
|
|
4426
|
-
pNumber14("
|
|
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)
|
|
4799
|
+
pNumber14("D1", "mm", 31, 2, 500, 0.1),
|
|
4800
|
+
pNumber14("D3", "mm", 30, 2, 500, 1),
|
|
4801
|
+
pNumber14("D4", "mm", 200, 2, 500, 1),
|
|
4802
|
+
pNumber14("D5", "mm", 3, 0, 100, 1),
|
|
4803
|
+
pNumber14("N1", "foot", 5, 0, 12, 1),
|
|
4804
|
+
pSectionSeparator14("Heights and details"),
|
|
4805
|
+
pNumber14("S1", "mm", 1, 0.1, 5, 0.1),
|
|
4806
|
+
pNumber14("S5", "mm", 2, 1, 20, 1),
|
|
4807
|
+
pNumber14("R3", "mm", 10, 0, 100, 1),
|
|
4808
|
+
pNumber14("H1", "mm", 2, 0.1, 10, 0.1),
|
|
4809
|
+
pNumber14("H2", "mm", 40, 0, 100, 1)
|
|
4453
4810
|
],
|
|
4454
4811
|
paramSvg: {
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
H1: "
|
|
4464
|
-
|
|
4465
|
-
triangleInt: "rccar_all_xy.svg",
|
|
4466
|
-
triangleExt: "rccar_all_xy.svg",
|
|
4467
|
-
D1: "rccar_bone.svg",
|
|
4468
|
-
D2: "rccar_bone.svg",
|
|
4469
|
-
W3: "rccar_bone.svg",
|
|
4470
|
-
L2: "rccar_bone.svg",
|
|
4471
|
-
F1: "rccar_one_xy.svg",
|
|
4472
|
-
Dwheel: "rccar_motor_xz.svg",
|
|
4473
|
-
Z1: "rccar_motor_xz.svg",
|
|
4474
|
-
Z2: "rccar_motor_xz.svg",
|
|
4475
|
-
Lwheel: "rccar_motor_xz.svg",
|
|
4476
|
-
Lmotor: "rccar_motor_xz.svg",
|
|
4477
|
-
Dsteering: "rccar_motor_xz.svg",
|
|
4478
|
-
Daxis: "rccar_motor_xz.svg",
|
|
4479
|
-
aBoneMin: "rccar_all_xz.svg",
|
|
4480
|
-
aBoneMax: "rccar_all_xz.svg",
|
|
4481
|
-
aBoneLeft: "rccar_all_xz.svg",
|
|
4482
|
-
aBoneRight: "rccar_all_xz.svg",
|
|
4483
|
-
wheel: "rccar_all_xy.svg",
|
|
4484
|
-
ra: "rccar_all_xy.svg",
|
|
4485
|
-
rx: "rccar_all_xy.svg",
|
|
4486
|
-
ry: "rccar_all_xy.svg"
|
|
4812
|
+
D1: "minifoot_top.svg",
|
|
4813
|
+
D3: "minifoot_top.svg",
|
|
4814
|
+
D4: "minifoot_top.svg",
|
|
4815
|
+
D5: "minifoot_top.svg",
|
|
4816
|
+
N1: "minifoot_top.svg",
|
|
4817
|
+
S1: "minifoot_side.svg",
|
|
4818
|
+
S5: "minifoot_top.svg",
|
|
4819
|
+
R3: "minifoot_top.svg",
|
|
4820
|
+
H1: "minifoot_side.svg",
|
|
4821
|
+
H2: "minifoot_side.svg"
|
|
4487
4822
|
},
|
|
4488
4823
|
sim: {
|
|
4489
|
-
tMax:
|
|
4824
|
+
tMax: 180,
|
|
4490
4825
|
tStep: 0.5,
|
|
4491
4826
|
tUpdate: 500
|
|
4492
4827
|
// every 0.5 second
|
|
@@ -4494,157 +4829,1166 @@ var pDef14 = {
|
|
|
4494
4829
|
};
|
|
4495
4830
|
function pGeom14(t, param, suffix = "") {
|
|
4496
4831
|
const rGeome = initGeom14(pDef14.partName + suffix);
|
|
4497
|
-
const
|
|
4498
|
-
const
|
|
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();
|
|
4832
|
+
const figFoot = figure12();
|
|
4833
|
+
const figCylinder = figure12();
|
|
4512
4834
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
4513
4835
|
`;
|
|
4514
4836
|
try {
|
|
4515
|
-
let
|
|
4516
|
-
const
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
const rA = ref + withinHPiHPi(rawA - ref);
|
|
4522
|
-
return rA;
|
|
4523
|
-
}, makePFfixExt2 = function(sign, tpA, tpL) {
|
|
4524
|
-
const dW22 = sign * (W22 - param.T1);
|
|
4525
|
-
const dW22b = -sign * (W22 + 2 * (param.E2 + R2) + param.T1);
|
|
4526
|
-
const dW22c = tpL > 0 ? dW22b : dW22;
|
|
4527
|
-
const dx1 = sign * (param.E2 + R2);
|
|
4528
|
-
const dx2 = sign * param.T1 + dx1;
|
|
4529
|
-
const dR2 = sign * R2;
|
|
4530
|
-
const dW22d = tpL > 0 ? -dW22 - dx2 : dW22 + dx2;
|
|
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);
|
|
4532
|
-
const rCtr1 = contourCircle11(dW22d, R2, R1).translatePolar(tpA, tpL);
|
|
4533
|
-
const rCtr2 = contourCircle11(dW22d, Z2b + 3 * R2, R1).translatePolar(tpA, tpL);
|
|
4534
|
-
return [rCtrExt, rCtr1, rCtr2];
|
|
4535
|
-
}, makeHandPlate2 = function(az, addL, ipX, ipY) {
|
|
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);
|
|
4537
|
-
const rCtrHole = contourCircle11(ipX, ipY, Rsteering);
|
|
4538
|
-
return [rCtrExt, rCtrHole];
|
|
4539
|
-
}, makeMFoot2 = function(itx, ity) {
|
|
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();
|
|
4541
|
-
const rCtrHole = contourCircle11(itx, ity, Raxis + param.E1);
|
|
4542
|
-
return [rCtrExt, rCtrHole];
|
|
4543
|
-
}, makeCtrWheel2 = function(xSign, ia, itx, ity) {
|
|
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);
|
|
4837
|
+
let ctrFoot32 = function() {
|
|
4838
|
+
const rCtr = contour15(r3, 0);
|
|
4839
|
+
for (let ii = 0; ii < param.N1; ii++) {
|
|
4840
|
+
const ai = ii * an * 2;
|
|
4841
|
+
rCtr.addCornerRounded(param.R3).addSegStrokeAP(ai + an - aDCA, lCD).addPointAP(ai + an, R4 + R6).addPointAP(ai + an + aDCA, lCD).addSegArc2().addSegStrokeAP(ai + 2 * an, r3);
|
|
4842
|
+
}
|
|
4545
4843
|
return rCtr;
|
|
4546
|
-
},
|
|
4547
|
-
const
|
|
4548
|
-
const
|
|
4549
|
-
const
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
return
|
|
4555
|
-
}
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
}
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
}
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4844
|
+
}, ctrFoot22 = function() {
|
|
4845
|
+
const aInit = an - aACF;
|
|
4846
|
+
const pt = point7(0, 0).translatePolar(aInit, r3);
|
|
4847
|
+
const rCtr = contour15(pt.cx, pt.cy);
|
|
4848
|
+
for (let ii = 0; ii < param.N1; ii++) {
|
|
4849
|
+
const ai = ii * an * 2 + aInit;
|
|
4850
|
+
rCtr.addSegStrokeAP(ai + aECF, lCE).addPointAP(ai + aACF, R4 + R6).addPointAP(ai + aACF + aACE, lCE).addSegArc2().addSegStrokeAP(ai + 2 * aACF, r3).addPointAP(ai + an + aACF, r3).addPointAP(ai + 2 * an, r3).addSegArc2();
|
|
4851
|
+
}
|
|
4852
|
+
return rCtr;
|
|
4853
|
+
};
|
|
4854
|
+
var ctrFoot3 = ctrFoot32, ctrFoot2 = ctrFoot22;
|
|
4855
|
+
const R1 = param.D1 / 2;
|
|
4856
|
+
const R2 = R1 + param.S1;
|
|
4857
|
+
const r3 = param.D3 / 2;
|
|
4858
|
+
const R4 = param.D4 / 2;
|
|
4859
|
+
const R5 = param.D5 / 2;
|
|
4860
|
+
const R6 = R5 + param.S5;
|
|
4861
|
+
const an = param.N1 > 0 ? Math.PI / param.N1 : 1;
|
|
4862
|
+
const [lAB, triLog1] = triLALrL2(r3, an, R4);
|
|
4863
|
+
const aBAD = Math.acos(R6 / lAB);
|
|
4864
|
+
const [aCAB, triLog2] = triLLLrA2(lAB, r3, R4);
|
|
4865
|
+
const aCAD = aCAB + aBAD;
|
|
4866
|
+
const [lCD, triLog3] = triLALrL2(R4, aCAD, R6);
|
|
4867
|
+
const [aDCA, triLog4] = triLLLrA2(lCD, R6, R4);
|
|
4868
|
+
rGeome.logstr += triLog1 + triLog2 + triLog3 + triLog4;
|
|
4869
|
+
const lCG = r3 - R6;
|
|
4870
|
+
const aCAG = Math.asin(lCG / R4);
|
|
4871
|
+
const aCAE = Math.PI / 2 + aCAG;
|
|
4872
|
+
const [lCE, triLog5] = triLALrL2(R4, aCAE, R6);
|
|
4873
|
+
const [aACE, triLog6] = triLLLrA2(R4, R6, lCE);
|
|
4874
|
+
const lAG = Math.sqrt(R4 ** 2 - lCG ** 2);
|
|
4875
|
+
const [aECF, triLog7] = triLLLrA2(lCE, lAG, r3);
|
|
4876
|
+
const aACF = aACE + aECF;
|
|
4877
|
+
rGeome.logstr += triLog5 + triLog6 + triLog7;
|
|
4878
|
+
const selFoot = param.N1 > 2 || param.N1 === 2 && aACF > Math.PI / 2 - 1e-3;
|
|
4879
|
+
if (R4 < r3) {
|
|
4880
|
+
throw `err101: D4 ${param.D4} is too small compare to D3 ${param.D3}`;
|
|
4881
|
+
}
|
|
4882
|
+
rGeome.logstr += `aCAD ${ffix15(radToDeg10(aCAD))}, aDCA ${ffix15(radToDeg10(aDCA))} degree
|
|
4883
|
+
`;
|
|
4884
|
+
rGeome.logstr += `selFoot: ${selFoot ? "ctrFoot3" : "ctrFoot2"}
|
|
4885
|
+
`;
|
|
4886
|
+
let ctrFoot = contourCircle11(0, 0, r3);
|
|
4887
|
+
if (param.N1 > 0) {
|
|
4888
|
+
if (selFoot) {
|
|
4889
|
+
ctrFoot = ctrFoot32();
|
|
4890
|
+
} else {
|
|
4891
|
+
ctrFoot = ctrFoot22();
|
|
4892
|
+
}
|
|
4893
|
+
}
|
|
4894
|
+
const ctrCircle1 = contourCircle11(0, 0, R1);
|
|
4895
|
+
const ctrCircle2 = contourCircle11(0, 0, R2);
|
|
4896
|
+
const ctrHoles = [];
|
|
4897
|
+
if (R5 > 0) {
|
|
4898
|
+
for (let ii = 0; ii < param.N1; ii++) {
|
|
4899
|
+
const ai = ii * an * 2 + an;
|
|
4900
|
+
const pt = point7(0, 0).translatePolar(ai, R4);
|
|
4901
|
+
ctrHoles.push(contourCircle11(pt.cx, pt.cy, R5));
|
|
4902
|
+
}
|
|
4903
|
+
}
|
|
4904
|
+
figFoot.addMainOI([ctrFoot, ctrCircle1, ...ctrHoles]);
|
|
4905
|
+
figFoot.addSecond(ctrCircle2);
|
|
4906
|
+
figCylinder.addMainOI([ctrCircle2, ctrCircle1]);
|
|
4907
|
+
figCylinder.addSecond(ctrFoot);
|
|
4908
|
+
rGeome.fig = {
|
|
4909
|
+
faceFoot: figFoot,
|
|
4910
|
+
faceCylinder: figCylinder
|
|
4911
|
+
};
|
|
4912
|
+
const designName = rGeome.partName;
|
|
4913
|
+
rGeome.vol = {
|
|
4914
|
+
extrudes: [
|
|
4915
|
+
{
|
|
4916
|
+
outName: `subpax_${designName}_foot`,
|
|
4917
|
+
face: `${designName}_faceFoot`,
|
|
4918
|
+
extrudeMethod: EExtrude11.eLinearOrtho,
|
|
4919
|
+
length: param.H1,
|
|
4920
|
+
rotate: [0, 0, 0],
|
|
4921
|
+
translate: [0, 0, 0]
|
|
4922
|
+
},
|
|
4923
|
+
{
|
|
4924
|
+
outName: `subpax_${designName}_cylinder`,
|
|
4925
|
+
face: `${designName}_faceCylinder`,
|
|
4926
|
+
extrudeMethod: EExtrude11.eLinearOrtho,
|
|
4927
|
+
length: param.H1 + param.H2,
|
|
4928
|
+
rotate: [0, 0, 0],
|
|
4929
|
+
translate: [0, 0, 0]
|
|
4930
|
+
}
|
|
4931
|
+
],
|
|
4932
|
+
volumes: [
|
|
4933
|
+
{
|
|
4934
|
+
outName: `pax_${designName}`,
|
|
4935
|
+
boolMethod: EBVolume11.eUnion,
|
|
4936
|
+
inList: [`subpax_${designName}_foot`, `subpax_${designName}_cylinder`]
|
|
4937
|
+
}
|
|
4938
|
+
]
|
|
4939
|
+
};
|
|
4940
|
+
rGeome.sub = {};
|
|
4941
|
+
rGeome.logstr += "minifoot drawn successfully!\n";
|
|
4942
|
+
rGeome.calcErr = false;
|
|
4943
|
+
} catch (emsg) {
|
|
4944
|
+
rGeome.logstr += emsg;
|
|
4945
|
+
console.log(emsg);
|
|
4946
|
+
}
|
|
4947
|
+
return rGeome;
|
|
4948
|
+
}
|
|
4949
|
+
var minifootDef = {
|
|
4950
|
+
pTitle: "minifoot",
|
|
4951
|
+
pDescription: "holder of the heliostat model",
|
|
4952
|
+
pDef: pDef14,
|
|
4953
|
+
pGeom: pGeom14
|
|
4954
|
+
};
|
|
4955
|
+
|
|
4956
|
+
// src/heliostat/minihelio.ts
|
|
4957
|
+
import {
|
|
4958
|
+
point as point8,
|
|
4959
|
+
contour as contour16,
|
|
4960
|
+
contourCircle as contourCircle12,
|
|
4961
|
+
ctrRectangle as ctrRectangle7,
|
|
4962
|
+
figure as figure13,
|
|
4963
|
+
degToRad as degToRad7,
|
|
4964
|
+
radToDeg as radToDeg11,
|
|
4965
|
+
ffix as ffix16,
|
|
4966
|
+
pNumber as pNumber15,
|
|
4967
|
+
pCheckbox as pCheckbox9,
|
|
4968
|
+
pSectionSeparator as pSectionSeparator15,
|
|
4969
|
+
EExtrude as EExtrude12,
|
|
4970
|
+
EBVolume as EBVolume12,
|
|
4971
|
+
initGeom as initGeom15
|
|
4972
|
+
} from "geometrix";
|
|
4973
|
+
var pDef15 = {
|
|
4974
|
+
partName: "minihelio",
|
|
4975
|
+
params: [
|
|
4976
|
+
//pNumber(name, unit, init, min, max, step)
|
|
4977
|
+
pNumber15("N1", "mirror", 3, 1, 20, 1),
|
|
4978
|
+
pNumber15("W1", "mm", 100, 5, 2e3, 1),
|
|
4979
|
+
pNumber15("W2", "mm", 5, 1, 200, 1),
|
|
4980
|
+
pNumber15("H4", "mm", 30, 1, 2e3, 1),
|
|
4981
|
+
pNumber15("H5", "mm", 10, 1, 2e3, 1),
|
|
4982
|
+
pNumber15("H6", "mm", 70, 5, 2e3, 1),
|
|
4983
|
+
pNumber15("H7", "mm", 10, 1, 2e3, 1),
|
|
4984
|
+
pNumber15("H8", "mm", 32, 1, 2e3, 1),
|
|
4985
|
+
pNumber15("D8", "mm", 3, 1, 50, 1),
|
|
4986
|
+
pSectionSeparator15("Frame side"),
|
|
4987
|
+
pNumber15("T1", "mm", 1, 0.5, 10, 0.1),
|
|
4988
|
+
pNumber15("T2", "mm", 1, 0.5, 10, 0.1),
|
|
4989
|
+
pNumber15("W3", "mm", 50, 1, 500, 1),
|
|
4990
|
+
pNumber15("W4", "mm", 10, 1, 500, 1),
|
|
4991
|
+
pNumber15("W5", "mm", 30, 1, 500, 1),
|
|
4992
|
+
pNumber15("HW3", "mm", 40, 1, 2e3, 1),
|
|
4993
|
+
pNumber15("HW53", "mm", 60, 1, 2e3, 1),
|
|
4994
|
+
pSectionSeparator15("Foot"),
|
|
4995
|
+
pNumber15("D1", "mm", 30, 5, 1e3, 1),
|
|
4996
|
+
pNumber15("D2", "mm", 40, 5, 1e3, 1),
|
|
4997
|
+
pNumber15("D3", "mm", 20, 5, 1e3, 1),
|
|
4998
|
+
pNumber15("H1", "mm", 40, 5, 2e3, 1),
|
|
4999
|
+
pNumber15("H2", "mm", 40, 5, 2e3, 1),
|
|
5000
|
+
pNumber15("H3", "mm", 80, 5, 2e3, 1),
|
|
5001
|
+
pSectionSeparator15("Mirror"),
|
|
5002
|
+
pNumber15("Wm", "mm", 60, 5, 2e3, 1),
|
|
5003
|
+
pNumber15("Hm", "mm", 60, 5, 2e3, 1),
|
|
5004
|
+
pNumber15("Tm", "mm", 1, 0.5, 10, 0.1),
|
|
5005
|
+
pNumber15("Dm", "mm", 2, 0.1, 50, 0.1),
|
|
5006
|
+
pNumber15("Sm", "mm", 5, 1, 200, 1),
|
|
5007
|
+
pNumber15("Em", "mm", 1, 0.5, 5, 0.1),
|
|
5008
|
+
pSectionSeparator15("Simulation"),
|
|
5009
|
+
pNumber15("aSunMin", "degree", 0, -10, 120, 1),
|
|
5010
|
+
pNumber15("aSunMax", "degree", 80, -10, 120, 1),
|
|
5011
|
+
pNumber15("aSolidSun", "degree", 0.54, 0.1, 1, 0.01),
|
|
5012
|
+
pNumber15("Lt", "m", 0.5, 0.1, 200, 0.1),
|
|
5013
|
+
pNumber15("Ht1", "m", 0.2, 0.1, 20, 0.1),
|
|
5014
|
+
pNumber15("Ht2", "m", 0.1, 0.1, 20, 0.1),
|
|
5015
|
+
pSectionSeparator15("3D parts"),
|
|
5016
|
+
pCheckbox9("d3_foot", true),
|
|
5017
|
+
pCheckbox9("d3_frame", true),
|
|
5018
|
+
pCheckbox9("d3_mirrors", false),
|
|
5019
|
+
pCheckbox9("d3_one_mirror", false)
|
|
5020
|
+
],
|
|
5021
|
+
paramSvg: {
|
|
5022
|
+
N1: "minihelio_front.svg",
|
|
5023
|
+
W1: "minihelio_front.svg",
|
|
5024
|
+
W2: "minihelio_front.svg",
|
|
5025
|
+
H4: "minihelio_front.svg",
|
|
5026
|
+
H5: "minihelio_front.svg",
|
|
5027
|
+
H6: "minihelio_front.svg",
|
|
5028
|
+
H7: "minihelio_front.svg",
|
|
5029
|
+
H8: "minihelio_front.svg",
|
|
5030
|
+
D8: "minihelio_front.svg",
|
|
5031
|
+
T1: "minihelio_side.svg",
|
|
5032
|
+
T2: "minihelio_side.svg",
|
|
5033
|
+
W3: "minihelio_side.svg",
|
|
5034
|
+
W4: "minihelio_side.svg",
|
|
5035
|
+
W5: "minihelio_side.svg",
|
|
5036
|
+
HW3: "minihelio_side.svg",
|
|
5037
|
+
HW53: "minihelio_side.svg",
|
|
5038
|
+
D1: "minihelio_front.svg",
|
|
5039
|
+
D2: "minihelio_front.svg",
|
|
5040
|
+
D3: "minihelio_front.svg",
|
|
5041
|
+
H1: "minihelio_front.svg",
|
|
5042
|
+
H2: "minihelio_front.svg",
|
|
5043
|
+
H3: "minihelio_front.svg",
|
|
5044
|
+
Wm: "minihelio_mirror.svg",
|
|
5045
|
+
Hm: "minihelio_mirror.svg",
|
|
5046
|
+
Tm: "minihelio_mirror.svg",
|
|
5047
|
+
Dm: "minihelio_mirror.svg",
|
|
5048
|
+
Sm: "minihelio_mirror.svg",
|
|
5049
|
+
Em: "minihelio_mirror.svg",
|
|
5050
|
+
aSunMin: "minihelio_side.svg",
|
|
5051
|
+
aSunMax: "minihelio_side.svg",
|
|
5052
|
+
aSolidSun: "minihelio_side.svg",
|
|
5053
|
+
Lt: "minihelio_side.svg",
|
|
5054
|
+
Ht1: "minihelio_side.svg",
|
|
5055
|
+
Ht2: "minihelio_side.svg",
|
|
5056
|
+
d3_foot: "minihelio_side.svg",
|
|
5057
|
+
d3_frame: "minihelio_side.svg",
|
|
5058
|
+
d3_mirrors: "minihelio_side.svg",
|
|
5059
|
+
d3_one_mirror: "minihelio_side.svg"
|
|
5060
|
+
},
|
|
5061
|
+
sim: {
|
|
5062
|
+
tMax: 100,
|
|
5063
|
+
tStep: 0.5,
|
|
5064
|
+
tUpdate: 500
|
|
5065
|
+
// every 0.5 second
|
|
5066
|
+
}
|
|
5067
|
+
};
|
|
5068
|
+
function pGeom15(t, param, suffix = "") {
|
|
5069
|
+
const rGeome = initGeom15(pDef15.partName + suffix);
|
|
5070
|
+
const figFoot = figure13();
|
|
5071
|
+
const figFrameBand = figure13();
|
|
5072
|
+
const figFrameBottom = figure13();
|
|
5073
|
+
const figFrameTop = figure13();
|
|
5074
|
+
const figFrameSide = figure13();
|
|
5075
|
+
const figFrameMid = figure13();
|
|
5076
|
+
const figMirrorSide = figure13();
|
|
5077
|
+
const figMirrorAxis = figure13();
|
|
5078
|
+
const figOneMirror = figure13();
|
|
5079
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
5080
|
+
`;
|
|
5081
|
+
try {
|
|
5082
|
+
let ctrFoot2 = function(sign) {
|
|
5083
|
+
const rCtr = contour16(sign * R1, 0).addSegStrokeR(0, param.H1).addSegStrokeR(sign * R12, 0).addSegStrokeR(0, param.H2).addSegStrokeR(-sign * R23, param.H3).addSegStrokeR(-sign * param.T1, 0).addSegStrokeR(sign * R23, -param.H3).addSegStrokeR(0, -param.H2 + param.T1).addSegStrokeR(-sign * R12, 0).addSegStrokeR(0, -param.H1 - param.T1).closeSegStroke();
|
|
5084
|
+
return rCtr;
|
|
5085
|
+
}, ctrOval2 = function(iDelta) {
|
|
5086
|
+
const r4 = param.H4 - iDelta;
|
|
5087
|
+
const r1 = W12 - iDelta;
|
|
5088
|
+
const rCtr = contour16(Wbottom2, H123 + iDelta).addPointR(r4, r4).addSegArc(r4, false, true).addSegStrokeR(0, H567).addPointR(-r1, r1).addPointR(-2 * r1, 0).addSegArc2().addSegStrokeR(0, -H567).addPointR(r4, -r4).addSegArc(r4, false, true).closeSegStroke();
|
|
5089
|
+
return rCtr;
|
|
5090
|
+
}, calcYray2 = function(iYm, iXt, iYt, iRm, ia1, iXd, iaSun) {
|
|
5091
|
+
const a2 = iaSun - ia1;
|
|
5092
|
+
const aReflection = ia1 - a2;
|
|
5093
|
+
const xh1 = iXd * Math.cos(ia1 + Math.PI / 2);
|
|
5094
|
+
const yh1 = iXd * Math.sin(ia1 + Math.PI / 2);
|
|
5095
|
+
const xh2 = iRm * Math.cos(ia1);
|
|
5096
|
+
const yh2 = iRm * Math.sin(ia1);
|
|
5097
|
+
const xh = -xh1 - xh2 + iXt;
|
|
5098
|
+
const yh = yh1 + yh2 + iYm - iYt;
|
|
5099
|
+
const yReflection = xh * Math.tan(aReflection);
|
|
5100
|
+
const yRay = yReflection + yh;
|
|
5101
|
+
const bigYray = 100 + 10 * (iYm + iYt);
|
|
5102
|
+
const rY = a2 < Math.PI / 2 ? yRay : Math.sign(a2) * bigYray;
|
|
5103
|
+
const rXm = xh1 + xh2;
|
|
5104
|
+
const rYm = yh1 + yh2;
|
|
5105
|
+
return [rY, rXm, rYm];
|
|
5106
|
+
}, ctrSunRay2 = function(iYm, iXt, iYt, iRm, ia1, iXd, iaSun, iColor) {
|
|
5107
|
+
const [yRay, xhm, yhm] = calcYray2(iYm, iXt, iYt, iRm, ia1, iXd, iaSun);
|
|
5108
|
+
const pt1 = point8(xhm, iYm + yhm);
|
|
5109
|
+
const pt2 = pt1.translatePolar(iaSun, 20 * iRm);
|
|
5110
|
+
const rCtr = contour16(pt2.cx, pt2.cy, iColor).addSegStrokeA(pt1.cx, pt1.cy);
|
|
5111
|
+
const yRayMax = 2 * (iYm + iYt);
|
|
5112
|
+
if (Math.abs(yRay) < yRayMax) {
|
|
5113
|
+
rCtr.addSegStrokeA(iXt, iYt + yRay);
|
|
5114
|
+
}
|
|
5115
|
+
return rCtr;
|
|
5116
|
+
}, searchA12 = function(iYm, iXt, iYt, iRm, iXd, iaSun) {
|
|
5117
|
+
let rA1 = iaSun / 2;
|
|
5118
|
+
let rCnt = 0;
|
|
5119
|
+
let [tY, xhm, yhm] = calcYray2(iYm, iXt, iYt, iRm, rA1, iXd, iaSun);
|
|
5120
|
+
while (Math.abs(tY) > 0.5 && rCnt < 100) {
|
|
5121
|
+
const aErr = Math.atan((iYm + yhm - iYt + tY) / (iXt - xhm)) - Math.atan((iYm + yhm - iYt) / (iXt - xhm));
|
|
5122
|
+
const a1Step = 0.5 * Math.abs(aErr);
|
|
5123
|
+
rA1 -= Math.sign(tY) * a1Step;
|
|
5124
|
+
rCnt += 1;
|
|
5125
|
+
[tY, xhm, yhm] = calcYray2(iYm, iXt, iYt, iRm, rA1, iXd, iaSun);
|
|
5126
|
+
}
|
|
5127
|
+
return [rA1, rCnt];
|
|
5128
|
+
};
|
|
5129
|
+
var ctrFoot = ctrFoot2, ctrOval = ctrOval2, calcYray = calcYray2, ctrSunRay = ctrSunRay2, searchA1 = searchA12;
|
|
5130
|
+
const pi2 = Math.PI / 2;
|
|
5131
|
+
const aSunMin = degToRad7(param.aSunMin);
|
|
5132
|
+
const aSunMax = degToRad7(param.aSunMax);
|
|
5133
|
+
const aSun = aSunMin + t * (aSunMax - aSunMin) / 100;
|
|
5134
|
+
const R1 = param.D1 / 2;
|
|
5135
|
+
const R2 = param.D2 / 2;
|
|
5136
|
+
const R3 = param.D3 / 2;
|
|
5137
|
+
const R8 = param.D8 / 2;
|
|
5138
|
+
const Rm = param.Dm / 2;
|
|
5139
|
+
const RmE = Rm + param.Em;
|
|
5140
|
+
const R12 = R2 - R1;
|
|
5141
|
+
const R23 = R2 - R3;
|
|
5142
|
+
const Wbottom2 = param.W1 / 2 - param.H4;
|
|
5143
|
+
const H123 = param.H1 + param.H2 + param.H3;
|
|
5144
|
+
const H567 = param.H5 + param.T2 + param.N1 * (param.H6 + param.T2) + param.H7;
|
|
5145
|
+
const W12 = param.W1 / 2;
|
|
5146
|
+
const W1b = param.W1 - 2 * param.T2;
|
|
5147
|
+
const W1b2 = W1b / 2;
|
|
5148
|
+
const H15 = H123 + param.H4 + param.H5;
|
|
5149
|
+
const H6b = param.H6 + param.T2;
|
|
5150
|
+
const H18pre = H15 + param.T2 + param.H8;
|
|
5151
|
+
const H18b = H18pre - Rm;
|
|
5152
|
+
const H18 = H18pre - param.Hm / 2;
|
|
5153
|
+
const L8 = (param.W1 - param.Wm) / 2;
|
|
5154
|
+
const H17 = H15 + param.T2 + param.N1 * (param.H6 + param.T2) + param.H7;
|
|
5155
|
+
const H42 = param.H4 - param.T2;
|
|
5156
|
+
const Hframe = param.H4 + param.H5 + param.T2 + param.N1 * (param.H6 + param.T2) + param.H7 + W12;
|
|
5157
|
+
const H47 = Hframe - 2 * param.T2;
|
|
5158
|
+
const W35 = (param.W3 - param.W5) / 2;
|
|
5159
|
+
const Hside = Hframe - W12 - param.H4;
|
|
5160
|
+
const Hside1 = param.HW3 - param.H4;
|
|
5161
|
+
const Hside2 = Hside - Hside1 - param.HW53;
|
|
5162
|
+
const Lt = param.Lt * 1e3;
|
|
5163
|
+
const Ht1 = param.Ht1 * 1e3;
|
|
5164
|
+
const Ht2 = param.Ht2 * 1e3;
|
|
5165
|
+
const Hm2 = param.Hm / 2 - RmE;
|
|
5166
|
+
const mirrorSurface = param.Hm * param.Wm;
|
|
5167
|
+
const mirrorSurfaceN = param.N1 * mirrorSurface;
|
|
5168
|
+
const mh2 = param.Hm / 2;
|
|
5169
|
+
const aSSun2 = degToRad7(param.aSolidSun) / 2;
|
|
5170
|
+
if (R12 < 0.1) {
|
|
5171
|
+
throw `err134: D2 ${ffix16(param.D2)} is too small compare to D1 ${ffix16(param.D1)} mm`;
|
|
5172
|
+
}
|
|
5173
|
+
if (R23 < 0.1) {
|
|
5174
|
+
throw `err139: D2 ${ffix16(param.D2)} is too small compare to D3 ${ffix16(param.D3)} mm`;
|
|
5175
|
+
}
|
|
5176
|
+
if (param.H2 < param.T1) {
|
|
5177
|
+
throw `err142: H2 ${ffix16(param.H2)} is too small compare to T1 ${ffix16(param.T1)} mm`;
|
|
5178
|
+
}
|
|
5179
|
+
if (Wbottom2 < R3) {
|
|
5180
|
+
throw `err151: W1 ${ffix16(param.W1)} is too small compare to H4 ${ffix16(param.H4)} mm`;
|
|
5181
|
+
}
|
|
5182
|
+
if (W1b < 0) {
|
|
5183
|
+
throw `err158: W1 ${ffix16(param.W1)} is too small compare to T2 ${ffix16(param.T2)} mm`;
|
|
5184
|
+
}
|
|
5185
|
+
if (param.W3 < param.D3) {
|
|
5186
|
+
throw `err172: W3 ${ffix16(param.W3)} is too small compare to D3 ${ffix16(param.D3)} mm`;
|
|
5187
|
+
}
|
|
5188
|
+
if (W35 < 0.1) {
|
|
5189
|
+
throw `err175: W3 ${ffix16(param.W3)} is too small compare to W5 ${ffix16(param.W5)} mm`;
|
|
5190
|
+
}
|
|
5191
|
+
if (param.W5 < param.W4 + 2 * param.T2) {
|
|
5192
|
+
throw `err178: W5 ${ffix16(param.W5)} is too small compare to W4 ${ffix16(param.W4)} mm`;
|
|
5193
|
+
}
|
|
5194
|
+
if (Hside1 < 0.1) {
|
|
5195
|
+
throw `err182: HW3 ${ffix16(param.HW3)} is too small compare to H4 ${ffix16(param.H4)} mm`;
|
|
5196
|
+
}
|
|
5197
|
+
if (Hside2 < 0.1) {
|
|
5198
|
+
throw `err192: Hside2 ${ffix16(Hside2)} is too small because of HW3 ${ffix16(param.HW3)} or HW53 ${ffix16(param.HW53)} mm`;
|
|
5199
|
+
}
|
|
5200
|
+
if (Hm2 < 0) {
|
|
5201
|
+
throw `err096: Hm ${ffix16(param.Hm)} is too small compare to Dm ${ffix16(param.Dm)} and Em ${ffix16(param.Em)} mm`;
|
|
5202
|
+
}
|
|
5203
|
+
if (param.Sm < Rm) {
|
|
5204
|
+
throw `err099: Sm ${ffix16(param.Sm)} is too small compare to Dm ${ffix16(param.Dm)} mm`;
|
|
5205
|
+
}
|
|
5206
|
+
if (param.D8 < param.Dm) {
|
|
5207
|
+
throw `err102: D8 ${ffix16(param.D8)} is too small compare to Dm ${ffix16(param.Dm)} mm`;
|
|
5208
|
+
}
|
|
5209
|
+
rGeome.logstr += `Mirror surface: One: ${ffix16(mirrorSurface)}, N: ${param.N1} : ${ffix16(mirrorSurfaceN)} mm2
|
|
5210
|
+
`;
|
|
5211
|
+
rGeome.logstr += `Height: Foot: ${ffix16(H123)}, Frame: ${ffix16(Hframe)}, Total : ${ffix16(H123 + Hframe)} mm
|
|
5212
|
+
`;
|
|
5213
|
+
rGeome.logstr += `aSun: ${ffix16(radToDeg11(aSun))} degree
|
|
5214
|
+
`;
|
|
5215
|
+
figFoot.addMainO(ctrFoot2(1));
|
|
5216
|
+
figFoot.addSecond(ctrFoot2(-1));
|
|
5217
|
+
figFoot.addSecond(ctrOval2(0));
|
|
5218
|
+
figFoot.addSecond(ctrOval2(param.T2));
|
|
5219
|
+
figFoot.addSecond(ctrOval2(param.T2 + param.W2));
|
|
5220
|
+
figFrameBand.addMainOI([ctrOval2(param.T2), ctrOval2(param.T2 + param.W2)]);
|
|
5221
|
+
figFrameBand.addSecond(ctrOval2(0));
|
|
5222
|
+
figFrameBand.addSecond(ctrFoot2(1));
|
|
5223
|
+
figFrameBand.addSecond(ctrFoot2(-1));
|
|
5224
|
+
figFrameMid.mergeFigure(figFoot, true);
|
|
5225
|
+
for (let ii = 0; ii < param.N1 + 1; ii++) {
|
|
5226
|
+
figFrameMid.addMainO(ctrRectangle7(-W1b / 2, H15 + ii * H6b, W1b, param.T2));
|
|
5227
|
+
}
|
|
5228
|
+
for (let ii = 0; ii < param.N1; ii++) {
|
|
5229
|
+
figFrameMid.addSecond(ctrRectangle7(-param.Wm / 2, H18 + ii * H6b, param.Wm, param.Hm));
|
|
5230
|
+
figFrameMid.addSecond(ctrRectangle7(-param.W1 / 2, H18b + ii * H6b, L8, param.Dm));
|
|
5231
|
+
figFrameMid.addSecond(ctrRectangle7(param.Wm / 2, H18b + ii * H6b, L8, param.Dm));
|
|
5232
|
+
}
|
|
5233
|
+
figFrameTop.mergeFigure(figFrameMid, true);
|
|
5234
|
+
const ctrFrameTop = contour16(-W1b2, H17).addPointR(W1b2, W1b2).addPointR(2 * W1b2, 0).addSegArc2().addSegStrokeR(param.T2, 0).addPointR(-W12, W12).addPointR(-2 * W12, 0).addSegArc2().closeSegStroke();
|
|
5235
|
+
figFrameTop.addMainO(ctrFrameTop);
|
|
5236
|
+
figFrameBottom.mergeFigure(figFrameMid, true);
|
|
5237
|
+
const ctrFrameBottom = contour16(Wbottom2, H123).addPointR(param.H4, param.H4).addSegArc(param.H4, false, true).addSegStrokeR(-param.T2, 0).addPointR(-H42, -H42).addSegArc(H42, false, false).addSegStrokeR(-2 * Wbottom2, 0).addPointR(-H42, H42).addSegArc(H42, false, false).addSegStrokeR(-param.T2, 0).addPointR(param.H4, -param.H4).addSegArc(param.H4, false, true).closeSegStroke();
|
|
5238
|
+
figFrameBottom.addMainO(ctrFrameBottom);
|
|
5239
|
+
figFrameSide.addSecond(ctrFoot2(1));
|
|
5240
|
+
figFrameSide.addSecond(ctrFoot2(-1));
|
|
5241
|
+
figFrameSide.addSecond(ctrRectangle7(-param.W3 / 2, H123, param.W3, param.H4));
|
|
5242
|
+
figFrameSide.addSecond(ctrRectangle7(-param.W3 / 2, H123, param.W3, param.T2));
|
|
5243
|
+
figFrameSide.addSecond(ctrRectangle7(-param.W5 / 2, H17, param.W5, W12));
|
|
5244
|
+
figFrameSide.addSecond(
|
|
5245
|
+
ctrRectangle7(-param.W5 / 2, H17 + W12 - param.T2, param.W5, param.T2)
|
|
5246
|
+
);
|
|
5247
|
+
figFrameSide.addSecond(
|
|
5248
|
+
ctrRectangle7(-param.W4 / 2 - param.T2, H123 + param.T2, param.T2, H47)
|
|
5249
|
+
);
|
|
5250
|
+
figFrameSide.addSecond(ctrRectangle7(param.W4 / 2, H123 + param.T2, param.T2, H47));
|
|
5251
|
+
for (let ii = 0; ii < param.N1 + 1; ii++) {
|
|
5252
|
+
figFrameSide.addSecond(ctrRectangle7(-param.W4 / 2, H15 + ii * H6b, param.W4, param.T2));
|
|
5253
|
+
}
|
|
5254
|
+
const ctrSideHoles = [];
|
|
5255
|
+
for (let ii = 0; ii < param.N1; ii++) {
|
|
5256
|
+
figFrameSide.addSecond(contourCircle12(0, H18pre + ii * H6b, Rm));
|
|
5257
|
+
ctrSideHoles.push(contourCircle12(0, H18pre + ii * H6b, R8));
|
|
5258
|
+
}
|
|
5259
|
+
figFrameSide.addSecond(ctrRectangle7(Lt, Ht1, Ht2 * 0.05, Ht2));
|
|
5260
|
+
const ctrSide = contour16(param.W3 / 2, H123 + param.H4).addSegStrokeR(0, Hside1).addPointR(-W35, param.HW53).addSegArc3(-Math.PI / 2, false).addSegStrokeR(0, Hside2).addSegStrokeR(-param.W5, 0).addSegStrokeR(0, -Hside2).addPointR(-W35, -param.HW53).addSegArc3(-Math.PI / 2, true).addSegStrokeR(0, -Hside1).closeSegStroke();
|
|
5261
|
+
figFrameSide.addMainOI([ctrSide, ...ctrSideHoles]);
|
|
5262
|
+
const ctrMirrorSide = contour16(-RmE, 0).addPointR(RmE, -RmE).addPointR(2 * RmE, 0).addSegArc2().addSegStrokeR(0, param.Sm).addSegStrokeR(Hm2, 0).addSegStrokeR(0, param.Tm).addSegStrokeR(-param.Hm, 0).addSegStrokeR(0, -param.Tm).addSegStrokeR(Hm2, 0).closeSegStroke();
|
|
5263
|
+
const ctrMirrorAxis = contourCircle12(0, 0, Rm);
|
|
5264
|
+
figMirrorSide.mergeFigure(figFrameSide, true);
|
|
5265
|
+
figMirrorAxis.mergeFigure(figFrameSide, true);
|
|
5266
|
+
figOneMirror.addMainOI([ctrMirrorSide, ctrMirrorAxis]);
|
|
5267
|
+
let sunLinearAcc = 0;
|
|
5268
|
+
let tyS1 = 0;
|
|
5269
|
+
let tyS2 = Ht2;
|
|
5270
|
+
let tyS3 = -Ht2;
|
|
5271
|
+
let tyS4 = 0;
|
|
5272
|
+
let a1Min = Math.PI / 2;
|
|
5273
|
+
let a1Max = -Math.PI / 2;
|
|
5274
|
+
for (let ii = 0; ii < param.N1; ii++) {
|
|
5275
|
+
const yM = H18pre + ii * H6b;
|
|
5276
|
+
const yT = Ht1 + Ht2 / 2;
|
|
5277
|
+
const tRm = param.Sm + param.Tm;
|
|
5278
|
+
const [ia, cycleCnt] = searchA12(yM, Lt, yT, tRm, 0, aSun);
|
|
5279
|
+
figFrameSide.addSecond(ctrMirrorSide.rotate(0, 0, ia - Math.PI / 2).translate(0, yM));
|
|
5280
|
+
const [yS] = calcYray2(yM, Lt, yT, tRm, ia, 0, aSun);
|
|
5281
|
+
const [yS1] = calcYray2(yM, Lt, yT, tRm, ia, mh2, aSun - aSSun2);
|
|
5282
|
+
const [yS2] = calcYray2(yM, Lt, yT, tRm, ia, mh2, aSun + aSSun2);
|
|
5283
|
+
const [yS4] = calcYray2(yM, Lt, yT, tRm, ia, -mh2, aSun + aSSun2);
|
|
5284
|
+
const [yS3] = calcYray2(yM, Lt, yT, tRm, ia, -mh2, aSun - aSSun2);
|
|
5285
|
+
figFrameSide.addDynamics(ctrSunRay2(yM, Lt, yT, tRm, ia, 0, aSun, "yellow"));
|
|
5286
|
+
figFrameSide.addDynamics(ctrSunRay2(yM, Lt, yT, tRm, ia, mh2, aSun - aSSun2, "red"));
|
|
5287
|
+
figFrameSide.addDynamics(ctrSunRay2(yM, Lt, yT, tRm, ia, mh2, aSun + aSSun2, "orange"));
|
|
5288
|
+
figFrameSide.addDynamics(ctrSunRay2(yM, Lt, yT, tRm, ia, -mh2, aSun + aSSun2, "red"));
|
|
5289
|
+
figFrameSide.addDynamics(ctrSunRay2(yM, Lt, yT, tRm, ia, -mh2, aSun - aSSun2, "orange"));
|
|
5290
|
+
const sunLinear = 2 * mh2 * Math.cos(aSun - ia);
|
|
5291
|
+
const tHigh = yS2 - yS3;
|
|
5292
|
+
const tLow = yS1 - yS4;
|
|
5293
|
+
rGeome.logstr += `Mirror ${ii + 1}: yS ${ffix16(yS)} mm, ia ${ffix16(radToDeg11(ia))} degree, cycleCnt ${cycleCnt}, linear ${ffix16(sunLinear)} mm, target: ${ffix16(tHigh)} ${ffix16(tLow)} mm ${ffix16(100 * tHigh / tLow)} %
|
|
5294
|
+
`;
|
|
5295
|
+
sunLinearAcc += sunLinear;
|
|
5296
|
+
tyS1 = Math.max(tyS1, yS1);
|
|
5297
|
+
tyS2 = Math.min(tyS2, yS2);
|
|
5298
|
+
tyS3 = Math.max(tyS3, yS3);
|
|
5299
|
+
tyS4 = Math.min(tyS4, yS4);
|
|
5300
|
+
a1Min = Math.min(a1Min, ia);
|
|
5301
|
+
a1Max = Math.max(a1Max, ia);
|
|
5302
|
+
figMirrorSide.addMainO(ctrMirrorSide.rotate(0, 0, ia - Math.PI / 2).translate(0, yM));
|
|
5303
|
+
figMirrorSide.addSecond(ctrMirrorAxis.translate(0, yM));
|
|
5304
|
+
figMirrorAxis.addMainO(ctrMirrorAxis.translate(0, yM));
|
|
5305
|
+
figMirrorAxis.addSecond(ctrMirrorSide.rotate(0, 0, ia - Math.PI / 2).translate(0, yM));
|
|
5306
|
+
}
|
|
5307
|
+
rGeome.logstr += `mirror angles: min ${ffix16(radToDeg11(a1Min))} max ${ffix16(radToDeg11(a1Max))} diff ${ffix16(radToDeg11(a1Max - a1Min))} degree
|
|
5308
|
+
`;
|
|
5309
|
+
const targetHigh = tyS2 - tyS3;
|
|
5310
|
+
const targetLow = tyS1 - tyS4;
|
|
5311
|
+
rGeome.logstr += `sunLinearAcc: ${ffix16(sunLinearAcc)} mm, target: ${ffix16(targetHigh)} ${ffix16(targetLow)} mm ${ffix16(100 * targetHigh / targetLow)} %
|
|
5312
|
+
`;
|
|
5313
|
+
rGeome.logstr += `sun concentration: ${ffix16(100 * sunLinearAcc / targetLow)} %
|
|
5314
|
+
`;
|
|
5315
|
+
rGeome.logstr += `target usage: bottom ${ffix16(tyS4 + Ht2 / 2)} top ${ffix16(Ht2 / 2 - tyS1)} mm, ${ffix16(100 * targetLow / Ht2)} %
|
|
5316
|
+
`;
|
|
5317
|
+
rGeome.fig = {
|
|
5318
|
+
faceFoot: figFoot,
|
|
5319
|
+
faceFrameBand: figFrameBand,
|
|
5320
|
+
faceFrameTop: figFrameTop,
|
|
5321
|
+
faceFrameBottom: figFrameBottom,
|
|
5322
|
+
faceFrameSide: figFrameSide,
|
|
5323
|
+
faceFrameMid: figFrameMid,
|
|
5324
|
+
faceMirrorSide: figMirrorSide,
|
|
5325
|
+
faceMirrorAxis: figMirrorAxis,
|
|
5326
|
+
faceOneMirror: figOneMirror
|
|
5327
|
+
};
|
|
5328
|
+
const designName = rGeome.partName;
|
|
5329
|
+
const d3Foot = [];
|
|
5330
|
+
const d3Frame = [];
|
|
5331
|
+
const d3Mirror = [];
|
|
5332
|
+
const d3OneMirror = [];
|
|
5333
|
+
if (param.d3_foot === 1) {
|
|
5334
|
+
d3Foot.push(`subpax_${designName}_foot`);
|
|
5335
|
+
}
|
|
5336
|
+
if (param.d3_frame === 1) {
|
|
5337
|
+
d3Frame.push(`subpax_${designName}_frameBand1`);
|
|
5338
|
+
d3Frame.push(`subpax_${designName}_frameBand2`);
|
|
5339
|
+
d3Frame.push(`subpax_${designName}_frameTop`);
|
|
5340
|
+
d3Frame.push(`subpax_${designName}_frameBottom`);
|
|
5341
|
+
d3Frame.push(`subpax_${designName}_frameMid`);
|
|
5342
|
+
d3Frame.push(`subpax_${designName}_frameSide1`);
|
|
5343
|
+
d3Frame.push(`subpax_${designName}_frameSide2`);
|
|
5344
|
+
}
|
|
5345
|
+
if (param.d3_mirrors === 1) {
|
|
5346
|
+
d3Mirror.push(`subpax_${designName}_mirrorSide`);
|
|
5347
|
+
d3Mirror.push(`subpax_${designName}_mirrorAxis`);
|
|
5348
|
+
}
|
|
5349
|
+
if (param.d3_one_mirror === 1) {
|
|
5350
|
+
d3OneMirror.push(`subpax_${designName}_oneMirror`);
|
|
5351
|
+
}
|
|
5352
|
+
rGeome.vol = {
|
|
5353
|
+
extrudes: [
|
|
5354
|
+
{
|
|
5355
|
+
outName: `subpax_${designName}_foot`,
|
|
5356
|
+
face: `${designName}_faceFoot`,
|
|
5357
|
+
extrudeMethod: EExtrude12.eRotate,
|
|
5358
|
+
rotate: [0, 0, 0],
|
|
5359
|
+
translate: [0, 0, 0]
|
|
5360
|
+
},
|
|
5361
|
+
{
|
|
5362
|
+
outName: `subpax_${designName}_frameBand1`,
|
|
5363
|
+
face: `${designName}_faceFrameBand`,
|
|
5364
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5365
|
+
length: param.T2,
|
|
5366
|
+
rotate: [pi2, 0, 0],
|
|
5367
|
+
translate: [0, -param.W4 / 2, 0]
|
|
5368
|
+
},
|
|
5369
|
+
{
|
|
5370
|
+
outName: `subpax_${designName}_frameBand2`,
|
|
5371
|
+
face: `${designName}_faceFrameBand`,
|
|
5372
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5373
|
+
length: param.T2,
|
|
5374
|
+
rotate: [pi2, 0, 0],
|
|
5375
|
+
translate: [0, param.W4 / 2 + param.T2, 0]
|
|
5376
|
+
},
|
|
5377
|
+
{
|
|
5378
|
+
outName: `subpax_${designName}_frameTop`,
|
|
5379
|
+
face: `${designName}_faceFrameTop`,
|
|
5380
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5381
|
+
length: param.W5,
|
|
5382
|
+
rotate: [pi2, 0, 0],
|
|
5383
|
+
translate: [0, param.W5 / 2, 0]
|
|
5384
|
+
},
|
|
5385
|
+
{
|
|
5386
|
+
outName: `subpax_${designName}_frameBottom`,
|
|
5387
|
+
face: `${designName}_faceFrameBottom`,
|
|
5388
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5389
|
+
length: param.W3,
|
|
5390
|
+
rotate: [pi2, 0, 0],
|
|
5391
|
+
translate: [0, param.W3 / 2, 0]
|
|
5392
|
+
},
|
|
5393
|
+
{
|
|
5394
|
+
outName: `subpax_${designName}_frameMid`,
|
|
5395
|
+
face: `${designName}_faceFrameMid`,
|
|
5396
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5397
|
+
length: param.W4,
|
|
5398
|
+
rotate: [pi2, 0, 0],
|
|
5399
|
+
translate: [0, param.W4 / 2, 0]
|
|
5400
|
+
},
|
|
5401
|
+
{
|
|
5402
|
+
outName: `subpax_${designName}_frameSide1`,
|
|
5403
|
+
face: `${designName}_faceFrameSide`,
|
|
5404
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5405
|
+
length: param.T2,
|
|
5406
|
+
rotate: [pi2, 0, pi2],
|
|
5407
|
+
translate: [W1b2, 0, 0]
|
|
5408
|
+
},
|
|
5409
|
+
{
|
|
5410
|
+
outName: `subpax_${designName}_frameSide2`,
|
|
5411
|
+
face: `${designName}_faceFrameSide`,
|
|
5412
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5413
|
+
length: param.T2,
|
|
5414
|
+
rotate: [pi2, 0, pi2],
|
|
5415
|
+
translate: [-W1b2 - param.T2, 0, 0]
|
|
5416
|
+
},
|
|
5417
|
+
{
|
|
5418
|
+
outName: `subpax_${designName}_mirrorSide`,
|
|
5419
|
+
face: `${designName}_faceMirrorSide`,
|
|
5420
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5421
|
+
length: param.Wm,
|
|
5422
|
+
rotate: [pi2, 0, pi2],
|
|
5423
|
+
translate: [-param.Wm / 2, 0, 0]
|
|
5424
|
+
},
|
|
5425
|
+
{
|
|
5426
|
+
outName: `subpax_${designName}_mirrorAxis`,
|
|
5427
|
+
face: `${designName}_faceMirrorAxis`,
|
|
5428
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5429
|
+
length: param.W1,
|
|
5430
|
+
rotate: [pi2, 0, pi2],
|
|
5431
|
+
translate: [-param.W1 / 2, 0, 0]
|
|
5432
|
+
},
|
|
5433
|
+
{
|
|
5434
|
+
outName: `subpax_${designName}_oneMirror`,
|
|
5435
|
+
face: `${designName}_faceOneMirror`,
|
|
5436
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5437
|
+
length: param.Wm,
|
|
5438
|
+
rotate: [0, 0, 0],
|
|
5439
|
+
translate: [0, 0, 0]
|
|
5440
|
+
}
|
|
5441
|
+
],
|
|
5442
|
+
volumes: [
|
|
5443
|
+
{
|
|
5444
|
+
outName: `pax_${designName}`,
|
|
5445
|
+
boolMethod: EBVolume12.eUnion,
|
|
5446
|
+
inList: [...d3Foot, ...d3Frame, ...d3Mirror, ...d3OneMirror]
|
|
5447
|
+
}
|
|
5448
|
+
]
|
|
5449
|
+
};
|
|
5450
|
+
rGeome.sub = {};
|
|
5451
|
+
rGeome.logstr += "minihelio drawn successfully!\n";
|
|
5452
|
+
rGeome.calcErr = false;
|
|
5453
|
+
} catch (emsg) {
|
|
5454
|
+
rGeome.logstr += emsg;
|
|
5455
|
+
console.log(emsg);
|
|
5456
|
+
}
|
|
5457
|
+
return rGeome;
|
|
5458
|
+
}
|
|
5459
|
+
var minihelioDef = {
|
|
5460
|
+
pTitle: "minihelio",
|
|
5461
|
+
pDescription: "table-top model of an heliostat",
|
|
5462
|
+
pDef: pDef15,
|
|
5463
|
+
pGeom: pGeom15
|
|
5464
|
+
};
|
|
5465
|
+
|
|
5466
|
+
// src/heliostat/minimir.ts
|
|
5467
|
+
import {
|
|
5468
|
+
point as point9,
|
|
5469
|
+
contour as contour17,
|
|
5470
|
+
contourCircle as contourCircle13,
|
|
5471
|
+
ctrRectangle as ctrRectangle8,
|
|
5472
|
+
figure as figure14,
|
|
5473
|
+
ffix as ffix17,
|
|
5474
|
+
pNumber as pNumber16,
|
|
5475
|
+
pCheckbox as pCheckbox10,
|
|
5476
|
+
pSectionSeparator as pSectionSeparator16,
|
|
5477
|
+
EExtrude as EExtrude13,
|
|
5478
|
+
EBVolume as EBVolume13,
|
|
5479
|
+
initGeom as initGeom16
|
|
5480
|
+
} from "geometrix";
|
|
5481
|
+
var pDef16 = {
|
|
5482
|
+
partName: "minimir",
|
|
5483
|
+
params: [
|
|
5484
|
+
//pNumber(name, unit, init, min, max, step)
|
|
5485
|
+
pNumber16("L1", "mm", 50, 10, 2e3, 1),
|
|
5486
|
+
pNumber16("G1", "mm", 50, 10, 2e3, 1),
|
|
5487
|
+
pNumber16("G2", "mm", 5, 1, 500, 1),
|
|
5488
|
+
pNumber16("G3", "mm", 5, 1, 500, 1),
|
|
5489
|
+
pSectionSeparator16("Wheel"),
|
|
5490
|
+
pNumber16("D1", "mm", 1, 0, 200, 0.5),
|
|
5491
|
+
pNumber16("D2", "mm", 2, 0.5, 200, 0.5),
|
|
5492
|
+
pNumber16("D3", "mm", 5, 1, 2e3, 1),
|
|
5493
|
+
pNumber16("D4", "mm", 40, 1, 2e3, 1),
|
|
5494
|
+
pNumber16("D5", "mm", 50, 1, 2e3, 1),
|
|
5495
|
+
pNumber16("N1", "arms", 6, 0, 20, 1),
|
|
5496
|
+
pNumber16("S1", "mm", 4, 1, 200, 1),
|
|
5497
|
+
pNumber16("R6", "mm", 1, 0, 200, 1),
|
|
5498
|
+
pSectionSeparator16("Frame"),
|
|
5499
|
+
pNumber16("W1", "mm", 5, 1, 200, 1),
|
|
5500
|
+
pNumber16("W2", "mm", 5, 1, 200, 1),
|
|
5501
|
+
pNumber16("W3", "mm", 5, 1, 200, 1),
|
|
5502
|
+
pNumber16("R7", "mm", 5, 0, 200, 1),
|
|
5503
|
+
pNumber16("R8", "mm", 5, 0, 200, 1),
|
|
5504
|
+
pSectionSeparator16("Transversal and thickness"),
|
|
5505
|
+
pNumber16("S2", "mm", 2, 1, 50, 1),
|
|
5506
|
+
pNumber16("S3", "mm", 10, 1, 200, 1),
|
|
5507
|
+
pNumber16("T1", "mm", 1, 1, 50, 1),
|
|
5508
|
+
pNumber16("T2", "mm", 2, 1, 200, 1),
|
|
5509
|
+
pNumber16("T3", "mm", 1, 1, 50, 1),
|
|
5510
|
+
pCheckbox10("d3_rod", true)
|
|
5511
|
+
],
|
|
5512
|
+
paramSvg: {
|
|
5513
|
+
L1: "minimir_top.svg",
|
|
5514
|
+
G1: "minimir_top.svg",
|
|
5515
|
+
G2: "minimir_top.svg",
|
|
5516
|
+
G3: "minimir_top.svg",
|
|
5517
|
+
D1: "minimir_wheel.svg",
|
|
5518
|
+
D2: "minimir_wheel.svg",
|
|
5519
|
+
D3: "minimir_wheel.svg",
|
|
5520
|
+
D4: "minimir_wheel.svg",
|
|
5521
|
+
D5: "minimir_wheel.svg",
|
|
5522
|
+
N1: "minimir_wheel.svg",
|
|
5523
|
+
S1: "minimir_wheel.svg",
|
|
5524
|
+
R6: "minimir_wheel.svg",
|
|
5525
|
+
W1: "minimir_top.svg",
|
|
5526
|
+
W2: "minimir_top.svg",
|
|
5527
|
+
W3: "minimir_top.svg",
|
|
5528
|
+
R7: "minimir_top.svg",
|
|
5529
|
+
R8: "minimir_top.svg",
|
|
5530
|
+
S2: "minimir_wheel.svg",
|
|
5531
|
+
S3: "minimir_wheel.svg",
|
|
5532
|
+
T1: "minimir_wheel.svg",
|
|
5533
|
+
T2: "minimir_wheel.svg",
|
|
5534
|
+
T3: "minimir_wheel.svg",
|
|
5535
|
+
d3_rod: "minimir_wheel.svg"
|
|
5536
|
+
},
|
|
5537
|
+
sim: {
|
|
5538
|
+
tMax: 180,
|
|
5539
|
+
tStep: 0.5,
|
|
5540
|
+
tUpdate: 500
|
|
5541
|
+
// every 0.5 second
|
|
5542
|
+
}
|
|
5543
|
+
};
|
|
5544
|
+
function pGeom16(t, param, suffix = "") {
|
|
5545
|
+
const rGeome = initGeom16(pDef16.partName + suffix);
|
|
5546
|
+
const figWheel = figure14();
|
|
5547
|
+
const figRod = figure14();
|
|
5548
|
+
const figTransversal = figure14();
|
|
5549
|
+
const figFrame = figure14();
|
|
5550
|
+
const figLift = figure14();
|
|
5551
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
5552
|
+
`;
|
|
5553
|
+
try {
|
|
5554
|
+
const pi2 = Math.PI / 2;
|
|
5555
|
+
const R1 = param.D1 / 2;
|
|
5556
|
+
const R2 = param.D2 / 2;
|
|
5557
|
+
const R3 = param.D3 / 2;
|
|
5558
|
+
const R4 = param.D4 / 2;
|
|
5559
|
+
const R5 = param.D5 / 2;
|
|
5560
|
+
const Lww = 2 * param.T1 + 2 * param.G2 + param.G1;
|
|
5561
|
+
const Laxis = Lww + 2 * param.G3;
|
|
5562
|
+
const wha2 = param.N1 > 0 ? Math.PI / param.N1 : 1;
|
|
5563
|
+
const S12 = param.S1 / 2;
|
|
5564
|
+
const S22 = param.S2 / 2;
|
|
5565
|
+
const R3b = R3;
|
|
5566
|
+
const wha3 = Math.asin(S12 / R3b);
|
|
5567
|
+
const wha4 = Math.asin(S12 / R4);
|
|
5568
|
+
const wh3R = S12 / Math.sin(wha2);
|
|
5569
|
+
const wh3Rb = param.R6 / Math.sin(wha2);
|
|
5570
|
+
const wha3b = Math.asin(param.R6 / (wh3R + wh3Rb));
|
|
5571
|
+
const wh3n4 = wha3b > wha2 - wha3;
|
|
5572
|
+
const l34 = R4 - R3;
|
|
5573
|
+
const lFI = param.G1 - 2 * param.W2;
|
|
5574
|
+
const hFI = param.L1 / 2 - param.W1 / 2 - param.W3;
|
|
5575
|
+
const minDiff = 0.1;
|
|
5576
|
+
if (param.D2 < param.D1 + minDiff) {
|
|
5577
|
+
throw `err114: D2 ${param.D2} is too small compare to D1 ${param.D1}`;
|
|
5578
|
+
}
|
|
5579
|
+
if (R3 < S12) {
|
|
5580
|
+
throw `err132: D3 ${param.D3} is too small compare to S1 ${param.S1}`;
|
|
5581
|
+
}
|
|
5582
|
+
if (param.S1 < param.S2) {
|
|
5583
|
+
throw `err141: S1 ${param.S1} is too small compare to S2 ${param.S2}`;
|
|
5584
|
+
}
|
|
5585
|
+
if (l34 < 2 * param.R6) {
|
|
5586
|
+
throw `err145: l34 ${ffix17(l34)} is too small compare to R6 ${param.R6}`;
|
|
5587
|
+
}
|
|
5588
|
+
if (l34 < param.S3) {
|
|
5589
|
+
throw `err148: l34 ${ffix17(l34)} is too small compare to S3 ${param.S3}`;
|
|
5590
|
+
}
|
|
5591
|
+
if (lFI < 2 * param.R8) {
|
|
5592
|
+
throw `err153: lFI ${ffix17(lFI)} is too small compare to R8 ${param.R8}`;
|
|
5593
|
+
}
|
|
5594
|
+
if (hFI < 2 * param.R8) {
|
|
5595
|
+
throw `err156: hFI ${ffix17(hFI)} is too small compare to R8 ${param.R8}`;
|
|
5596
|
+
}
|
|
5597
|
+
rGeome.logstr += `Lww: ${ffix17(Lww)} mm, Laxis: ${ffix17(Laxis)} mm
|
|
5598
|
+
`;
|
|
5599
|
+
const ctrCircle1 = contourCircle13(0, 0, R1);
|
|
5600
|
+
const ctrCircle2 = contourCircle13(0, 0, R2);
|
|
5601
|
+
const ctrCircle3 = contourCircle13(0, 0, R3b);
|
|
5602
|
+
const ctrCircle4 = contourCircle13(0, 0, R4);
|
|
5603
|
+
const ctrCircle5 = contourCircle13(0, 0, R5);
|
|
5604
|
+
const wHollow = [];
|
|
5605
|
+
for (let ii = 0; ii < param.N1; ii++) {
|
|
5606
|
+
const ia = ii * 2 * wha2;
|
|
5607
|
+
const pt = point9(0, 0).translatePolar(ia + wha4, R4);
|
|
5608
|
+
const iCtr = contour17(pt.cx, pt.cy).addCornerRounded(param.R6).addPointAP(ia + wha2, R4).addPointAP(ia + 2 * wha2 - wha4, R4).addSegArc2().addCornerRounded(param.R6);
|
|
5609
|
+
if (wh3n4) {
|
|
5610
|
+
iCtr.addSegStrokeAP(ia + wha2, wh3R).addCornerRounded(param.R6);
|
|
5611
|
+
} else {
|
|
5612
|
+
iCtr.addSegStrokeAP(ia + 2 * wha2 - wha3, R3b).addCornerRounded(param.R6).addPointAP(ia + wha2, R3b).addPointAP(ia + wha3, R3b).addSegArc2().addCornerRounded(param.R6);
|
|
5613
|
+
}
|
|
5614
|
+
iCtr.closeSegStroke();
|
|
5615
|
+
wHollow.push(iCtr);
|
|
5616
|
+
}
|
|
5617
|
+
figWheel.addMainOI([ctrCircle5, ctrCircle2, ...wHollow]);
|
|
5618
|
+
figWheel.addSecond(ctrCircle4);
|
|
5619
|
+
figWheel.addSecond(ctrCircle3);
|
|
5620
|
+
figWheel.addSecond(ctrCircle1);
|
|
5621
|
+
figRod.addMainOI([ctrCircle2, ctrCircle1]);
|
|
5622
|
+
figRod.mergeFigure(figWheel, true);
|
|
5623
|
+
const ctrTransversal1 = ctrRectangle8(-R4, -S22, param.S3, param.S2);
|
|
5624
|
+
const ctrTransversal2 = ctrRectangle8(R4 - param.S3, -S22, param.S3, param.S2);
|
|
5625
|
+
figTransversal.addMainO(ctrTransversal1);
|
|
5626
|
+
figTransversal.addMainO(ctrTransversal2);
|
|
5627
|
+
figTransversal.mergeFigure(figWheel, true);
|
|
5628
|
+
figWheel.addSecond(ctrTransversal1);
|
|
5629
|
+
figWheel.addSecond(ctrTransversal2);
|
|
5630
|
+
const ctrFrameExt = contour17(-param.G1 / 2, -param.L1 / 2).addCornerRounded(param.R7).addSegStrokeR(param.G1, 0).addCornerRounded(param.R7).addSegStrokeR(0, param.L1).addCornerRounded(param.R7).addSegStrokeR(-param.G1, 0).addCornerRounded(param.R7).closeSegStroke();
|
|
5631
|
+
const ctrFrameInt1 = contour17(-param.G1 / 2 + param.W2, -param.L1 / 2 + param.W3).addCornerRounded(param.R8).addSegStrokeR(lFI, 0).addCornerRounded(param.R8).addSegStrokeR(0, hFI).addCornerRounded(param.R8).addSegStrokeR(-lFI, 0).addCornerRounded(param.R8).closeSegStroke();
|
|
5632
|
+
const ctrFrameInt2 = contour17(-param.G1 / 2 + param.W2, param.W1 / 2).addCornerRounded(param.R8).addSegStrokeR(lFI, 0).addCornerRounded(param.R8).addSegStrokeR(0, hFI).addCornerRounded(param.R8).addSegStrokeR(-lFI, 0).addCornerRounded(param.R8).closeSegStroke();
|
|
5633
|
+
figFrame.addMainOI([ctrFrameExt, ctrFrameInt1, ctrFrameInt2]);
|
|
5634
|
+
figLift.mergeFigure(figFrame, true);
|
|
5635
|
+
const ctrLift = [];
|
|
5636
|
+
ctrLift.push(ctrRectangle8(-param.G1 / 2, R4 - param.S3, param.W2, param.S3));
|
|
5637
|
+
ctrLift.push(ctrRectangle8(-param.G1 / 2, -R4, param.W2, param.S3));
|
|
5638
|
+
ctrLift.push(ctrRectangle8(param.G1 / 2 - param.W2, R4 - param.S3, param.W2, param.S3));
|
|
5639
|
+
ctrLift.push(ctrRectangle8(param.G1 / 2 - param.W2, -R4, param.W2, param.S3));
|
|
5640
|
+
for (const iCtr of ctrLift) {
|
|
5641
|
+
figLift.addMainO(iCtr);
|
|
5642
|
+
figFrame.addSecond(iCtr);
|
|
5643
|
+
}
|
|
5644
|
+
rGeome.fig = {
|
|
5645
|
+
faceWheel: figWheel,
|
|
5646
|
+
faceRod: figRod,
|
|
5647
|
+
faceTransversal: figTransversal,
|
|
5648
|
+
faceFrame: figFrame,
|
|
5649
|
+
faceLift: figLift
|
|
5650
|
+
};
|
|
5651
|
+
const designName = rGeome.partName;
|
|
5652
|
+
const volList = [];
|
|
5653
|
+
volList.push(`subpax_${designName}_wheel1`);
|
|
5654
|
+
volList.push(`subpax_${designName}_wheel2`);
|
|
5655
|
+
if (param.d3_rod) {
|
|
5656
|
+
volList.push(`subpax_${designName}_rod`);
|
|
5657
|
+
}
|
|
5658
|
+
volList.push(`subpax_${designName}_transversal`);
|
|
5659
|
+
volList.push(`subpax_${designName}_frame`);
|
|
5660
|
+
volList.push(`subpax_${designName}_lift`);
|
|
5661
|
+
rGeome.vol = {
|
|
5662
|
+
extrudes: [
|
|
5663
|
+
{
|
|
5664
|
+
outName: `subpax_${designName}_wheel1`,
|
|
5665
|
+
face: `${designName}_faceWheel`,
|
|
5666
|
+
extrudeMethod: EExtrude13.eLinearOrtho,
|
|
5667
|
+
length: param.T1,
|
|
5668
|
+
rotate: [0, 0, 0],
|
|
5669
|
+
translate: [0, 0, 0]
|
|
5670
|
+
},
|
|
5671
|
+
{
|
|
5672
|
+
outName: `subpax_${designName}_wheel2`,
|
|
5673
|
+
face: `${designName}_faceWheel`,
|
|
5674
|
+
extrudeMethod: EExtrude13.eLinearOrtho,
|
|
5675
|
+
length: param.T1,
|
|
5676
|
+
rotate: [0, 0, 0],
|
|
5677
|
+
translate: [0, 0, Lww - param.T1]
|
|
5678
|
+
},
|
|
5679
|
+
{
|
|
5680
|
+
outName: `subpax_${designName}_rod`,
|
|
5681
|
+
face: `${designName}_faceRod`,
|
|
5682
|
+
extrudeMethod: EExtrude13.eLinearOrtho,
|
|
5683
|
+
length: Laxis,
|
|
5684
|
+
rotate: [0, 0, 0],
|
|
5685
|
+
translate: [0, 0, -param.G3]
|
|
5686
|
+
},
|
|
5687
|
+
{
|
|
5688
|
+
outName: `subpax_${designName}_transversal`,
|
|
5689
|
+
face: `${designName}_faceTransversal`,
|
|
5690
|
+
extrudeMethod: EExtrude13.eLinearOrtho,
|
|
5691
|
+
length: Lww,
|
|
5692
|
+
rotate: [0, 0, 0],
|
|
5693
|
+
translate: [0, 0, 0]
|
|
5694
|
+
},
|
|
5695
|
+
{
|
|
5696
|
+
outName: `subpax_${designName}_frame`,
|
|
5697
|
+
face: `${designName}_faceFrame`,
|
|
5698
|
+
extrudeMethod: EExtrude13.eLinearOrtho,
|
|
5699
|
+
length: param.T3,
|
|
5700
|
+
rotate: [0, pi2, pi2],
|
|
5701
|
+
translate: [0, S22 + param.T2, Lww / 2]
|
|
5702
|
+
},
|
|
5703
|
+
{
|
|
5704
|
+
outName: `subpax_${designName}_lift`,
|
|
5705
|
+
face: `${designName}_faceLift`,
|
|
5706
|
+
extrudeMethod: EExtrude13.eLinearOrtho,
|
|
5707
|
+
length: param.T2,
|
|
5708
|
+
rotate: [0, pi2, pi2],
|
|
5709
|
+
translate: [0, S22, Lww / 2]
|
|
5710
|
+
}
|
|
5711
|
+
],
|
|
5712
|
+
volumes: [
|
|
5713
|
+
{
|
|
5714
|
+
outName: `pax_${designName}`,
|
|
5715
|
+
boolMethod: EBVolume13.eUnion,
|
|
5716
|
+
inList: volList
|
|
5717
|
+
}
|
|
5718
|
+
]
|
|
5719
|
+
};
|
|
5720
|
+
rGeome.sub = {};
|
|
5721
|
+
rGeome.logstr += "minimir drawn successfully!\n";
|
|
5722
|
+
rGeome.calcErr = false;
|
|
5723
|
+
} catch (emsg) {
|
|
5724
|
+
rGeome.logstr += emsg;
|
|
5725
|
+
console.log(emsg);
|
|
5726
|
+
}
|
|
5727
|
+
return rGeome;
|
|
5728
|
+
}
|
|
5729
|
+
var minimirDef = {
|
|
5730
|
+
pTitle: "minimir",
|
|
5731
|
+
pDescription: "support of mirror of the heliostat-model",
|
|
5732
|
+
pDef: pDef16,
|
|
5733
|
+
pGeom: pGeom16
|
|
5734
|
+
};
|
|
5735
|
+
|
|
5736
|
+
// src/rccar/rccar.ts
|
|
5737
|
+
import {
|
|
5738
|
+
withinHPiHPi,
|
|
5739
|
+
ShapePoint as ShapePoint2,
|
|
5740
|
+
point as point10,
|
|
5741
|
+
contour as contour18,
|
|
5742
|
+
contourCircle as contourCircle14,
|
|
5743
|
+
ctrRectangle as ctrRectangle9,
|
|
5744
|
+
figure as figure15,
|
|
5745
|
+
degToRad as degToRad8,
|
|
5746
|
+
ffix as ffix18,
|
|
5747
|
+
pNumber as pNumber17,
|
|
5748
|
+
pCheckbox as pCheckbox11,
|
|
5749
|
+
pDropdown as pDropdown8,
|
|
5750
|
+
pSectionSeparator as pSectionSeparator17,
|
|
5751
|
+
transform3d,
|
|
5752
|
+
EExtrude as EExtrude14,
|
|
5753
|
+
EBVolume as EBVolume14,
|
|
5754
|
+
initGeom as initGeom17
|
|
5755
|
+
} from "geometrix";
|
|
5756
|
+
var pDef17 = {
|
|
5757
|
+
partName: "rccar",
|
|
5758
|
+
params: [
|
|
5759
|
+
//pNumber(name, unit, init, min, max, step)
|
|
5760
|
+
pNumber17("N1", "unit", 4, 1, 12, 1),
|
|
5761
|
+
pNumber17("L1", "mm", 300, 10, 2e3, 1),
|
|
5762
|
+
pNumber17("W1", "mm", 1200, 10, 2e3, 1),
|
|
5763
|
+
pSectionSeparator17("General"),
|
|
5764
|
+
pDropdown8("gen3D", ["all", "platform", "bone", "hand", "motor", "wheel"]),
|
|
5765
|
+
pNumber17("T1", "mm", 10, 1, 100, 1),
|
|
5766
|
+
pNumber17("E1", "mm", 10, 1, 100, 1),
|
|
5767
|
+
pNumber17("E2", "mm", 10, 1, 500, 1),
|
|
5768
|
+
pNumber17("E3", "mm", 30, 1, 500, 1),
|
|
5769
|
+
pSectionSeparator17("Platform"),
|
|
5770
|
+
pNumber17("H1", "mm", 230, 10, 2e3, 1),
|
|
5771
|
+
pNumber17("W2", "mm", 100, 10, 2e3, 1),
|
|
5772
|
+
pCheckbox11("triangleInt", true),
|
|
5773
|
+
pCheckbox11("triangleExt", false),
|
|
5774
|
+
pSectionSeparator17("Bone"),
|
|
5775
|
+
pNumber17("D1", "mm", 20, 1, 200, 1),
|
|
5776
|
+
pNumber17("D2", "mm", 40, 1, 200, 1),
|
|
5777
|
+
pNumber17("W3", "mm", 30, 1, 200, 1),
|
|
5778
|
+
pNumber17("L2", "mm", 150, 1, 200, 1),
|
|
5779
|
+
pSectionSeparator17("Unit"),
|
|
5780
|
+
pNumber17("F1", "mm", 180, 1, 1e3, 1),
|
|
5781
|
+
pNumber17("Dwheel", "mm", 250, 10, 2e3, 1),
|
|
5782
|
+
pNumber17("Z1", "mm", 100, 10, 2e3, 1),
|
|
5783
|
+
pNumber17("Z2", "mm", 160, 10, 2e3, 1),
|
|
5784
|
+
pNumber17("Lwheel", "mm", 100, 10, 2e3, 1),
|
|
5785
|
+
pNumber17("Lmotor", "mm", 140, 10, 1e3, 1),
|
|
5786
|
+
pNumber17("Dsteering", "mm", 40, 1, 500, 1),
|
|
5787
|
+
pNumber17("Daxis", "mm", 20, 1, 500, 1),
|
|
5788
|
+
pSectionSeparator17("Angles"),
|
|
5789
|
+
pNumber17("aBoneMin", "degree", -40, -80, 0, 1),
|
|
5790
|
+
pNumber17("aBoneMax", "degree", 20, -80, 80, 1),
|
|
5791
|
+
pNumber17("aBoneLeft", "%", 0, 0, 100, 1),
|
|
5792
|
+
pNumber17("aBoneRight", "%", 0, 0, 100, 1),
|
|
5793
|
+
pDropdown8("wheel", ["straight", "turn"]),
|
|
5794
|
+
pNumber17("ra", "degree", 0, -90, 90, 1),
|
|
5795
|
+
pNumber17("rx", "cm", 0, -1e3, 1e3, 1),
|
|
5796
|
+
pNumber17("ry", "cm", 0, -1e3, 1e3, 1)
|
|
5797
|
+
],
|
|
5798
|
+
paramSvg: {
|
|
5799
|
+
N1: "rccar_all_xy.svg",
|
|
5800
|
+
L1: "rccar_all_xy.svg",
|
|
5801
|
+
W1: "rccar_all_xz.svg",
|
|
5802
|
+
gen3D: "rccar_all_xy.svg",
|
|
5803
|
+
T1: "rccar_one_xy.svg",
|
|
5804
|
+
E1: "rccar_one_xy.svg",
|
|
5805
|
+
E2: "rccar_motor_xz.svg",
|
|
5806
|
+
E3: "rccar_motor_xz.svg",
|
|
5807
|
+
H1: "rccar_platform_xz.svg",
|
|
5808
|
+
W2: "rccar_platform_xz.svg",
|
|
5809
|
+
triangleInt: "rccar_all_xy.svg",
|
|
5810
|
+
triangleExt: "rccar_all_xy.svg",
|
|
5811
|
+
D1: "rccar_bone.svg",
|
|
5812
|
+
D2: "rccar_bone.svg",
|
|
5813
|
+
W3: "rccar_bone.svg",
|
|
5814
|
+
L2: "rccar_bone.svg",
|
|
5815
|
+
F1: "rccar_one_xy.svg",
|
|
5816
|
+
Dwheel: "rccar_motor_xz.svg",
|
|
5817
|
+
Z1: "rccar_motor_xz.svg",
|
|
5818
|
+
Z2: "rccar_motor_xz.svg",
|
|
5819
|
+
Lwheel: "rccar_motor_xz.svg",
|
|
5820
|
+
Lmotor: "rccar_motor_xz.svg",
|
|
5821
|
+
Dsteering: "rccar_motor_xz.svg",
|
|
5822
|
+
Daxis: "rccar_motor_xz.svg",
|
|
5823
|
+
aBoneMin: "rccar_all_xz.svg",
|
|
5824
|
+
aBoneMax: "rccar_all_xz.svg",
|
|
5825
|
+
aBoneLeft: "rccar_all_xz.svg",
|
|
5826
|
+
aBoneRight: "rccar_all_xz.svg",
|
|
5827
|
+
wheel: "rccar_all_xy.svg",
|
|
5828
|
+
ra: "rccar_all_xy.svg",
|
|
5829
|
+
rx: "rccar_all_xy.svg",
|
|
5830
|
+
ry: "rccar_all_xy.svg"
|
|
5831
|
+
},
|
|
5832
|
+
sim: {
|
|
5833
|
+
tMax: 200,
|
|
5834
|
+
tStep: 0.5,
|
|
5835
|
+
tUpdate: 500
|
|
5836
|
+
// every 0.5 second
|
|
5837
|
+
}
|
|
5838
|
+
};
|
|
5839
|
+
function pGeom17(t, param, suffix = "") {
|
|
5840
|
+
const rGeome = initGeom17(pDef17.partName + suffix);
|
|
5841
|
+
const figPlatform = figure15();
|
|
5842
|
+
const figTriangle = figure15();
|
|
5843
|
+
const figPFfixation = figure15();
|
|
5844
|
+
const figBones = figure15();
|
|
5845
|
+
const figHandFixation = figure15();
|
|
5846
|
+
const figHandPlateR = figure15();
|
|
5847
|
+
const figHandPlateL = figure15();
|
|
5848
|
+
const figHandBackR = figure15();
|
|
5849
|
+
const figHandBackL = figure15();
|
|
5850
|
+
const figMotorBulkR = figure15();
|
|
5851
|
+
const figMotorBulkL = figure15();
|
|
5852
|
+
const figMFoot = figure15();
|
|
5853
|
+
const figWheel = figure15();
|
|
5854
|
+
const figTop = figure15();
|
|
5855
|
+
const figSide = figure15();
|
|
5856
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
5857
|
+
`;
|
|
5858
|
+
try {
|
|
5859
|
+
let calcPercent2 = function(aInit) {
|
|
5860
|
+
const percent2 = (aInit + t) % 200;
|
|
5861
|
+
const rP = percent2 > 100 ? 200 - percent2 : percent2;
|
|
5862
|
+
return rP / 100;
|
|
5863
|
+
}, adjustWheelAngle2 = function(dY, dX, ref) {
|
|
5864
|
+
const rawA = Math.atan2(dY, dX);
|
|
5865
|
+
const rA = ref + withinHPiHPi(rawA - ref);
|
|
5866
|
+
return rA;
|
|
5867
|
+
}, makePFfixExt2 = function(sign, tpA, tpL) {
|
|
5868
|
+
const dW22 = sign * (W22 - param.T1);
|
|
5869
|
+
const dW22b = -sign * (W22 + 2 * (param.E2 + R2) + param.T1);
|
|
5870
|
+
const dW22c = tpL > 0 ? dW22b : dW22;
|
|
5871
|
+
const dx1 = sign * (param.E2 + R2);
|
|
5872
|
+
const dx2 = sign * param.T1 + dx1;
|
|
5873
|
+
const dR2 = sign * R2;
|
|
5874
|
+
const dW22d = tpL > 0 ? -dW22 - dx2 : dW22 + dx2;
|
|
5875
|
+
const rCtrExt = contour18(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);
|
|
5876
|
+
const rCtr1 = contourCircle14(dW22d, R2, R1).translatePolar(tpA, tpL);
|
|
5877
|
+
const rCtr2 = contourCircle14(dW22d, Z2b + 3 * R2, R1).translatePolar(tpA, tpL);
|
|
5878
|
+
return [rCtrExt, rCtr1, rCtr2];
|
|
5879
|
+
}, makeHandPlate2 = function(az, addL, ipX, ipY) {
|
|
5880
|
+
const rCtrExt = contour18(ipX, ipY + F12).addPointR(-F12, -F12).addPointR(0, -2 * F12).addSegArc2().addSegStrokeR(F12 + addL, 0).addSegStrokeR(0, 2 * F12).closeSegStroke().rotate(ipX, ipY, az);
|
|
5881
|
+
const rCtrHole = contourCircle14(ipX, ipY, Rsteering);
|
|
5882
|
+
return [rCtrExt, rCtrHole];
|
|
5883
|
+
}, makeMFoot2 = function(itx, ity) {
|
|
5884
|
+
const rCtrExt = contour18(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();
|
|
5885
|
+
const rCtrHole = contourCircle14(itx, ity, Raxis + param.E1);
|
|
5886
|
+
return [rCtrExt, rCtrHole];
|
|
5887
|
+
}, makeCtrWheel2 = function(xSign, ia, itx, ity) {
|
|
5888
|
+
const rCtr = contour18(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);
|
|
5889
|
+
return rCtr;
|
|
5890
|
+
}, makeTopWheel2 = function(itx, ity, ia) {
|
|
5891
|
+
const tL = param.Lmotor - mFootWidth;
|
|
5892
|
+
const tCos = tL * Math.cos(ia);
|
|
5893
|
+
const tSin = tL * Math.sin(ia);
|
|
5894
|
+
const ctrWheel1 = makeCtrWheel2(1, -pi2 + ia, itx + tCos, ity + tSin);
|
|
5895
|
+
const ctrWheel2 = makeCtrWheel2(-1, -pi2 + ia, itx + tCos, ity + tSin);
|
|
5896
|
+
const ctrMFootPre = ctrRectangle9(itx + tL, ity - F12, mFootWidth, 2 * F12);
|
|
5897
|
+
const ctrMFoot = ctrMFootPre.rotate(itx, ity, ia);
|
|
5898
|
+
return [ctrWheel1, ctrWheel2, ctrMFoot];
|
|
5899
|
+
}, extrudeTriangle2 = function(posZ, idx) {
|
|
5900
|
+
const rVol = {
|
|
5901
|
+
outName: `subpax_${designName}_platformTriangle${idx}`,
|
|
5902
|
+
face: `${designName}_faceTriangle`,
|
|
5903
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
5904
|
+
length: param.T1,
|
|
5905
|
+
rotate: [0, 0, 0],
|
|
5906
|
+
translate: [0, 0, posZ]
|
|
5907
|
+
};
|
|
5908
|
+
return rVol;
|
|
5909
|
+
}, extrudePFfixation2 = function(posZ, idx) {
|
|
5910
|
+
const rVol = {
|
|
5911
|
+
outName: `subpax_${designName}_PFfixation${idx}`,
|
|
5912
|
+
face: `${designName}_facePFfixation`,
|
|
5913
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
5914
|
+
length: param.T1,
|
|
5915
|
+
rotate: [0, 0, 0],
|
|
5916
|
+
translate: [0, 0, posZ]
|
|
5917
|
+
};
|
|
5918
|
+
return rVol;
|
|
5919
|
+
}, extrudeBones2 = function(posZ, idx) {
|
|
5920
|
+
const rVol = {
|
|
5921
|
+
outName: `subpax_${designName}_bones${idx}`,
|
|
5922
|
+
face: `${designName}_faceBones`,
|
|
5923
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
5924
|
+
length: param.T1,
|
|
5925
|
+
rotate: [0, 0, 0],
|
|
5926
|
+
translate: [0, 0, posZ]
|
|
5927
|
+
};
|
|
5928
|
+
return rVol;
|
|
5929
|
+
}, extrudeHandFixation2 = function(posZ, idx) {
|
|
5930
|
+
const rVol = {
|
|
5931
|
+
outName: `subpax_${designName}_handFixation${idx}`,
|
|
5932
|
+
face: `${designName}_faceHandFixation`,
|
|
5933
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
5934
|
+
length: param.T1,
|
|
5935
|
+
rotate: [0, 0, 0],
|
|
5936
|
+
translate: [0, 0, posZ]
|
|
5937
|
+
};
|
|
5938
|
+
return rVol;
|
|
5939
|
+
}, extrudeHandPlate2 = function(posY, iRL, idx) {
|
|
5940
|
+
const rVol = {
|
|
5941
|
+
outName: `subpax_${designName}_handPlate${iRL}${idx}`,
|
|
5942
|
+
face: `${designName}_faceHandPlate${iRL}`,
|
|
5943
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
5944
|
+
length: param.T1,
|
|
5945
|
+
rotate: [pi2, 0, 0],
|
|
5946
|
+
translate: [0, posY + param.T1, 0]
|
|
5947
|
+
};
|
|
5948
|
+
return rVol;
|
|
5949
|
+
}, extrudeHandBack2 = function(posY, iRL) {
|
|
5950
|
+
const rVol = {
|
|
5951
|
+
outName: `subpax_${designName}_handBack${iRL}`,
|
|
5952
|
+
face: `${designName}_faceHandBack${iRL}`,
|
|
5953
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
5954
|
+
length: param.Z2,
|
|
5955
|
+
rotate: [pi2, 0, 0],
|
|
5956
|
+
translate: [0, posY + param.T1, 0]
|
|
5957
|
+
};
|
|
5958
|
+
return rVol;
|
|
5959
|
+
}, extrudeMotorBulk2 = function(posY, iRL) {
|
|
5960
|
+
const rVol = {
|
|
5961
|
+
outName: `subpax_${designName}_motorBulk${iRL}`,
|
|
5962
|
+
face: `${designName}_faceMotorBulk${iRL}`,
|
|
5963
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
5964
|
+
length: motorHeight,
|
|
5965
|
+
rotate: [pi2, 0, 0],
|
|
5966
|
+
translate: [0, posY - param.E1, 0]
|
|
5967
|
+
};
|
|
5968
|
+
return rVol;
|
|
5969
|
+
}, extrudeMFoot2 = function(posX, posY, posZ, az, idx) {
|
|
5970
|
+
const tL = param.Lmotor - mFootWidth;
|
|
5971
|
+
const tCos = tL * Math.cos(az);
|
|
5972
|
+
const tSin = tL * Math.sin(az);
|
|
5973
|
+
const tm = transform3d().addRotation(0, pi2 - az, 0).addTranslation(posX + tCos, posY, posZ + tSin);
|
|
5974
|
+
const rVol = {
|
|
5975
|
+
outName: `subpax_${designName}_mFoot${idx}`,
|
|
5976
|
+
face: `${designName}_faceMFoot`,
|
|
5977
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
5978
|
+
length: mFootWidth,
|
|
5979
|
+
rotate: tm.getRotation(),
|
|
5980
|
+
translate: tm.getTranslation()
|
|
5981
|
+
};
|
|
5982
|
+
return rVol;
|
|
5983
|
+
}, extrudeWheel2 = function(posX, posY, posZ, az, idx) {
|
|
5984
|
+
const tL = param.Lmotor - mFootWidth;
|
|
5985
|
+
const tCos = tL * Math.cos(az);
|
|
5986
|
+
const tSin = tL * Math.sin(az);
|
|
5987
|
+
const tm = transform3d().addRotation(0, pi2 - az, 0).addTranslation(posX + tCos, posY, posZ + tSin);
|
|
5988
|
+
const rVol = {
|
|
5989
|
+
outName: `subpax_${designName}_wheel${idx}`,
|
|
4646
5990
|
face: `${designName}_faceWheel`,
|
|
4647
|
-
extrudeMethod:
|
|
5991
|
+
extrudeMethod: EExtrude14.eRotate,
|
|
4648
5992
|
rotate: tm.getRotation(),
|
|
4649
5993
|
translate: tm.getTranslation()
|
|
4650
5994
|
};
|
|
@@ -4677,13 +6021,13 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4677
6021
|
const Rsteering = param.Dsteering / 2;
|
|
4678
6022
|
const Z2b = param.Z2 - 4 * R2;
|
|
4679
6023
|
const Z2c = param.Z2 - param.T1;
|
|
4680
|
-
const AbMin =
|
|
4681
|
-
const AbMax =
|
|
6024
|
+
const AbMin = degToRad8(param.aBoneMin);
|
|
6025
|
+
const AbMax = degToRad8(param.aBoneMax);
|
|
4682
6026
|
const posZplatform = Rwheel + param.Z1 + param.L2 * Math.sin(AbMin);
|
|
4683
6027
|
const Hplatform = posZplatform + param.H1;
|
|
4684
6028
|
const W32 = param.W3 / 2;
|
|
4685
6029
|
if (R2 < W32) {
|
|
4686
|
-
throw `err152: D2 ${
|
|
6030
|
+
throw `err152: D2 ${ffix18(param.D2)} is too small compare to W3 ${ffix18(param.W3)} mm`;
|
|
4687
6031
|
}
|
|
4688
6032
|
const W32X = Math.sqrt(R2 ** 2 - W32 ** 2);
|
|
4689
6033
|
const L2b = param.L2 - 2 * W32X;
|
|
@@ -4696,7 +6040,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4696
6040
|
const boneSideyRs = param.L2 * Math.sin(aBR);
|
|
4697
6041
|
const boneSideyLs = param.L2 * Math.sin(aBL);
|
|
4698
6042
|
const boneSideyR = 2 * R2 * Math.sign(aBR) + boneSideyRs;
|
|
4699
|
-
const ra =
|
|
6043
|
+
const ra = degToRad8(param.ra);
|
|
4700
6044
|
const rx10 = 10 * param.rx;
|
|
4701
6045
|
const ry10 = 10 * param.ry;
|
|
4702
6046
|
const hPlen = 2 * F12 + param.E2 + param.T1;
|
|
@@ -4731,47 +6075,47 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4731
6075
|
const dWheelAxis = Rwheel - Raxis;
|
|
4732
6076
|
const roundedWheel = Math.min(param.Lwheel / 3, dWheelAxis / 2);
|
|
4733
6077
|
if (LF2 < 0.1) {
|
|
4734
|
-
throw `err176: L1 ${
|
|
6078
|
+
throw `err176: L1 ${ffix18(param.L1)} is too small compare to F1 ${ffix18(param.F1)} mm`;
|
|
4735
6079
|
}
|
|
4736
6080
|
if (param.H1 < param.Z2 + param.T1) {
|
|
4737
|
-
throw `err130: H1 ${
|
|
6081
|
+
throw `err130: H1 ${ffix18(param.H1)} is too small compare to Z2 ${ffix18(param.Z2)} and T1 ${ffix18(param.T1)} mm`;
|
|
4738
6082
|
}
|
|
4739
6083
|
if (Z2b < 0.1) {
|
|
4740
|
-
throw `err149: Z2 ${
|
|
6084
|
+
throw `err149: Z2 ${ffix18(param.Z2)} is too small compare to D2 ${ffix18(param.D2)} mm`;
|
|
4741
6085
|
}
|
|
4742
6086
|
if (W2c < 0.1) {
|
|
4743
|
-
throw `err153: W2 ${
|
|
6087
|
+
throw `err153: W2 ${ffix18(param.W2)} is too small compare to T1 ${ffix18(param.T1)} mm`;
|
|
4744
6088
|
}
|
|
4745
6089
|
if (H1c < 0.1) {
|
|
4746
|
-
throw `err156: H1c ${
|
|
6090
|
+
throw `err156: H1c ${ffix18(param.H1)} is too small compare to T1 ${ffix18(param.T1)} mm`;
|
|
4747
6091
|
}
|
|
4748
6092
|
if (F1b < 0.1) {
|
|
4749
|
-
throw `err167: F1 ${
|
|
6093
|
+
throw `err167: F1 ${ffix18(param.F1)} is too small compare to T1 ${ffix18(param.T1)} and E1 ${ffix18(param.E1)} mm`;
|
|
4750
6094
|
}
|
|
4751
6095
|
if (AbMax < AbMin) {
|
|
4752
|
-
throw `err181: aBoneMax ${
|
|
6096
|
+
throw `err181: aBoneMax ${ffix18(param.aBoneMax)} is too small compare to aBoneMin ${ffix18(param.BoneMin)} degree`;
|
|
4753
6097
|
}
|
|
4754
6098
|
if (mFootWidth < param.T1) {
|
|
4755
|
-
throw `err218: Lmotor ${
|
|
6099
|
+
throw `err218: Lmotor ${ffix18(param.Lmotor)} is too small compare to F1 ${ffix18(param.F1)}`;
|
|
4756
6100
|
}
|
|
4757
6101
|
if (motorHeight < param.T1) {
|
|
4758
|
-
throw `err226: Z2 ${
|
|
6102
|
+
throw `err226: Z2 ${ffix18(param.Z2)} is too small compare to T1 ${ffix18(param.T1)} and E1 ${ffix18(param.E1)} mm`;
|
|
4759
6103
|
}
|
|
4760
6104
|
if (param.Z1 < mFootR) {
|
|
4761
|
-
throw `err256: Z1 ${
|
|
6105
|
+
throw `err256: Z1 ${ffix18(param.Z1)} is too small compare to mFootR ${ffix18(mFootR)} mm`;
|
|
4762
6106
|
}
|
|
4763
6107
|
if (Rwheel < mFootR) {
|
|
4764
|
-
throw `err259: Dwheel ${
|
|
6108
|
+
throw `err259: Dwheel ${ffix18(param.Dwheel)} is too small compare to mFootR ${ffix18(mFootR)} mm`;
|
|
4765
6109
|
}
|
|
4766
|
-
rGeome.logstr += `Platform Ltotal ${
|
|
6110
|
+
rGeome.logstr += `Platform Ltotal ${ffix18(Ltotal / 1e3)} m, surface ${ffix18(platSurface)} m2
|
|
4767
6111
|
`;
|
|
4768
|
-
rGeome.logstr += `Hplatform ${
|
|
6112
|
+
rGeome.logstr += `Hplatform ${ffix18(Hplatform)} mm
|
|
4769
6113
|
`;
|
|
4770
|
-
const ctrPlatformMain =
|
|
4771
|
-
const ctrPlatformInt =
|
|
6114
|
+
const ctrPlatformMain = contour18(-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();
|
|
6115
|
+
const ctrPlatformInt = ctrRectangle9(-W22 + param.T1, param.T1, W2c, H1c);
|
|
4772
6116
|
figPlatform.addMainOI([ctrPlatformMain, ctrPlatformInt]);
|
|
4773
|
-
const ctrTriangleL =
|
|
4774
|
-
const ctrTriangleR =
|
|
6117
|
+
const ctrTriangleL = contour18(-W22, 0).addSegStrokeR(param.T1, 0).addSegStrokeR(0, param.H1).addSegStrokeR(-W22b - param.T1, 0).addSegStrokeR(0, -param.T1).closeSegStroke();
|
|
6118
|
+
const ctrTriangleR = contour18(W22, 0).addSegStrokeR(W22b, H1b).addSegStrokeR(0, param.T1).addSegStrokeR(-W22b - param.T1, 0).addSegStrokeR(0, -param.H1).closeSegStroke();
|
|
4775
6119
|
figTriangle.addMainO(ctrTriangleL);
|
|
4776
6120
|
figTriangle.addMainO(ctrTriangleR);
|
|
4777
6121
|
figPlatform.addSecond(ctrTriangleL);
|
|
@@ -4779,36 +6123,36 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4779
6123
|
figPFfixation.addMainOI(makePFfixExt2(1, 0, 0));
|
|
4780
6124
|
figPFfixation.addMainOI(makePFfixExt2(-1, 0, 0));
|
|
4781
6125
|
figPlatform.mergeFigure(figPFfixation, true);
|
|
4782
|
-
const ctrBone =
|
|
6126
|
+
const ctrBone = contour18(W32X, W32).addPointR(-W32X - R2, -W32).addPointR(0, -2 * W32).addSegArc2().addSegStrokeR(L2b, 0).addPointR(W32X + R2, W32).addPointR(0, 2 * W32).addSegArc2().closeSegStroke();
|
|
4783
6127
|
const ctrBoneR = ctrBone.rotate(0, 0, aBR);
|
|
4784
6128
|
const ctrBoneL = ctrBone.rotate(0, 0, aBL);
|
|
4785
|
-
const ptR1 =
|
|
6129
|
+
const ptR1 = point10(W22 + param.E2 + R2, R2);
|
|
4786
6130
|
const ptR1b = ptR1.translatePolar(aBR, param.L2);
|
|
4787
|
-
const ptR2 =
|
|
6131
|
+
const ptR2 = point10(W22 + param.E2 + R2, Z2b + 3 * R2);
|
|
4788
6132
|
const ptR2b = ptR2.translatePolar(aBR, param.L2);
|
|
4789
|
-
const ptL1 =
|
|
6133
|
+
const ptL1 = point10(-W22 - param.E2 - R2, R2);
|
|
4790
6134
|
const ptL1b = ptL1.translatePolar(aBL, param.L2);
|
|
4791
|
-
const ptL2 =
|
|
6135
|
+
const ptL2 = point10(-W22 - param.E2 - R2, Z2b + 3 * R2);
|
|
4792
6136
|
const ptL2b = ptL2.translatePolar(aBL, param.L2);
|
|
4793
6137
|
figBones.addMainOI([
|
|
4794
6138
|
ctrBoneR.translate(ptR1.cx, ptR1.cy),
|
|
4795
|
-
|
|
4796
|
-
|
|
6139
|
+
contourCircle14(ptR1.cx, ptR1.cy, R1),
|
|
6140
|
+
contourCircle14(ptR1b.cx, ptR1b.cy, R1)
|
|
4797
6141
|
]);
|
|
4798
6142
|
figBones.addMainOI([
|
|
4799
6143
|
ctrBoneR.translate(ptR2.cx, ptR2.cy),
|
|
4800
|
-
|
|
4801
|
-
|
|
6144
|
+
contourCircle14(ptR2.cx, ptR2.cy, R1),
|
|
6145
|
+
contourCircle14(ptR2b.cx, ptR2b.cy, R1)
|
|
4802
6146
|
]);
|
|
4803
6147
|
figBones.addMainOI([
|
|
4804
6148
|
ctrBoneL.translate(ptL1.cx, ptL1.cy),
|
|
4805
|
-
|
|
4806
|
-
|
|
6149
|
+
contourCircle14(ptL1.cx, ptL1.cy, R1),
|
|
6150
|
+
contourCircle14(ptL1b.cx, ptL1b.cy, R1)
|
|
4807
6151
|
]);
|
|
4808
6152
|
figBones.addMainOI([
|
|
4809
6153
|
ctrBoneL.translate(ptL2.cx, ptL2.cy),
|
|
4810
|
-
|
|
4811
|
-
|
|
6154
|
+
contourCircle14(ptL2.cx, ptL2.cy, R1),
|
|
6155
|
+
contourCircle14(ptL2b.cx, ptL2b.cy, R1)
|
|
4812
6156
|
]);
|
|
4813
6157
|
figPlatform.mergeFigure(figBones, true);
|
|
4814
6158
|
figHandFixation.addMainOI(makePFfixExt2(-1, aBR, param.L2));
|
|
@@ -4819,17 +6163,17 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4819
6163
|
figHandPlateR.addMainOI(makeHandPlate2(pi, param.T1 + param.E2, hPposR, tPosY));
|
|
4820
6164
|
figHandPlateL.addMainOI(makeHandPlate2(0, param.T1 + param.E2, hPposL, tPosY));
|
|
4821
6165
|
}
|
|
4822
|
-
figPlatform.addSecond(
|
|
4823
|
-
figPlatform.addSecond(
|
|
4824
|
-
figPlatform.addSecond(
|
|
4825
|
-
figPlatform.addSecond(
|
|
6166
|
+
figPlatform.addSecond(ctrRectangle9(hBposR, boneSideyRs, hPlen, param.T1));
|
|
6167
|
+
figPlatform.addSecond(ctrRectangle9(hBposR, boneSideyRs + Z2c, hPlen, param.T1));
|
|
6168
|
+
figPlatform.addSecond(ctrRectangle9(hBposL - hPlen, boneSideyLs, hPlen, param.T1));
|
|
6169
|
+
figPlatform.addSecond(ctrRectangle9(hBposL - hPlen, boneSideyLs + Z2c, hPlen, param.T1));
|
|
4826
6170
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
4827
6171
|
const tPosY = ii * (param.L1 + param.T1) + param.T1 + LF2;
|
|
4828
|
-
figHandBackR.addMainO(
|
|
4829
|
-
figHandBackL.addMainO(
|
|
6172
|
+
figHandBackR.addMainO(ctrRectangle9(hBposR, tPosY, param.T1, 2 * F12));
|
|
6173
|
+
figHandBackL.addMainO(ctrRectangle9(hBposL - param.T1, tPosY, param.T1, 2 * F12));
|
|
4830
6174
|
}
|
|
4831
|
-
figPlatform.addSecond(
|
|
4832
|
-
figPlatform.addSecond(
|
|
6175
|
+
figPlatform.addSecond(ctrRectangle9(hBposR, boneSideyRs, param.T1, param.Z2));
|
|
6176
|
+
figPlatform.addSecond(ctrRectangle9(hBposL - param.T1, boneSideyLs, param.T1, param.Z2));
|
|
4833
6177
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
4834
6178
|
const tPosY = ii * (param.L1 + param.T1) + param.T1 + param.L1 / 2;
|
|
4835
6179
|
figMotorBulkR.addMainOI(makeHandPlate2(wheelRA[ii], motorExtraL, hPposR, tPosY));
|
|
@@ -4839,14 +6183,14 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4839
6183
|
const mBRpY = boneSideyRs + param.T1 + param.E1;
|
|
4840
6184
|
const mBLpX = hBposL - param.T1 - param.E2 - motorLen;
|
|
4841
6185
|
const mBLpY = boneSideyLs + param.T1 + param.E1;
|
|
4842
|
-
figPlatform.addSecond(
|
|
4843
|
-
figPlatform.addSecond(
|
|
6186
|
+
figPlatform.addSecond(ctrRectangle9(mBRpX, mBRpY, motorLen, motorHeight));
|
|
6187
|
+
figPlatform.addSecond(ctrRectangle9(mBLpX, mBLpY, motorLen, motorHeight));
|
|
4844
6188
|
const mFRpX = mBRpX + F12 + param.Lmotor - mFootWidth;
|
|
4845
6189
|
const mFRpY = boneSideyRs - param.Z1 - mFootR;
|
|
4846
6190
|
const mFLpX = mBLpX;
|
|
4847
6191
|
const mFLpY = boneSideyLs - param.Z1 - mFootR;
|
|
4848
|
-
figPlatform.addSecond(
|
|
4849
|
-
figPlatform.addSecond(
|
|
6192
|
+
figPlatform.addSecond(ctrRectangle9(mFRpX, mFRpY, mFootWidth, mFootHeight));
|
|
6193
|
+
figPlatform.addSecond(ctrRectangle9(mFLpX, mFLpY, mFootWidth, mFootHeight));
|
|
4850
6194
|
figMFoot.addMainOI(makeMFoot2(0, 0));
|
|
4851
6195
|
figWheel.addMainO(makeCtrWheel2(1, 0, 0, 0));
|
|
4852
6196
|
figWheel.addSecond(makeCtrWheel2(-1, 0, 0, 0));
|
|
@@ -4855,22 +6199,22 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4855
6199
|
figPlatform.addSecond(makeCtrWheel2(1, pi2, mFLpX + mFootWidth, mFLpY + mFootR));
|
|
4856
6200
|
figPlatform.addSecond(makeCtrWheel2(-1, pi2, mFLpX + mFootWidth, mFLpY + mFootR));
|
|
4857
6201
|
figTop.addMainOI([
|
|
4858
|
-
|
|
4859
|
-
|
|
6202
|
+
ctrRectangle9(-W12, 0, param.W1, Ltotal),
|
|
6203
|
+
ctrRectangle9(-W22 + param.T1, 0, W2c, Ltotal)
|
|
4860
6204
|
]);
|
|
4861
|
-
figTop.addSecond(
|
|
6205
|
+
figTop.addSecond(ctrRectangle9(-W22, 0, param.W2, Ltotal));
|
|
4862
6206
|
if (param.triangleExt) {
|
|
4863
6207
|
for (let ii = 0; ii < 2; ii++) {
|
|
4864
6208
|
const tPosY = ii * (param.L1 + param.T1) * param.N1;
|
|
4865
|
-
figTop.addSecond(
|
|
4866
|
-
figTop.addSecond(
|
|
6209
|
+
figTop.addSecond(ctrRectangle9(-W12, tPosY, W22b, param.T1));
|
|
6210
|
+
figTop.addSecond(ctrRectangle9(W22, tPosY, W22b, param.T1));
|
|
4867
6211
|
}
|
|
4868
6212
|
}
|
|
4869
6213
|
if (param.triangleInt) {
|
|
4870
6214
|
for (let ii = 1; ii < param.N1; ii++) {
|
|
4871
6215
|
const tPosY = ii * (param.L1 + param.T1);
|
|
4872
|
-
figTop.addSecond(
|
|
4873
|
-
figTop.addSecond(
|
|
6216
|
+
figTop.addSecond(ctrRectangle9(-W12, tPosY, W22b, param.T1));
|
|
6217
|
+
figTop.addSecond(ctrRectangle9(W22, tPosY, W22b, param.T1));
|
|
4874
6218
|
}
|
|
4875
6219
|
}
|
|
4876
6220
|
const tL2 = param.E2 + 2 * R2;
|
|
@@ -4879,8 +6223,8 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4879
6223
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
4880
6224
|
for (const tPosY2 of [LF2, LF23, LF25, LF28]) {
|
|
4881
6225
|
const tPosY3 = tPosY + tPosY2;
|
|
4882
|
-
figTop.addSecond(
|
|
4883
|
-
figTop.addSecond(
|
|
6226
|
+
figTop.addSecond(ctrRectangle9(W22, tPosY3, tL2, param.T1));
|
|
6227
|
+
figTop.addSecond(ctrRectangle9(tPosX2, tPosY3, tL2, param.T1));
|
|
4884
6228
|
}
|
|
4885
6229
|
}
|
|
4886
6230
|
const tPosX3 = -W22 - param.E2 - boneTopxL;
|
|
@@ -4888,16 +6232,16 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4888
6232
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
4889
6233
|
for (const tPosY2 of [LF2, LF25]) {
|
|
4890
6234
|
const tPosY3 = tPosY + tPosY2 + param.T1 + param.E1;
|
|
4891
|
-
figTop.addSecond(
|
|
4892
|
-
figTop.addSecond(
|
|
6235
|
+
figTop.addSecond(ctrRectangle9(W22 + param.E2, tPosY3, boneTopxR, param.T1));
|
|
6236
|
+
figTop.addSecond(ctrRectangle9(tPosX3, tPosY3, boneTopxL, param.T1));
|
|
4893
6237
|
}
|
|
4894
6238
|
}
|
|
4895
6239
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
4896
6240
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
4897
6241
|
for (const tPosY2 of [LF2, LF23, LF25, LF28]) {
|
|
4898
6242
|
const tPosY3 = tPosY + tPosY2;
|
|
4899
|
-
figTop.addSecond(
|
|
4900
|
-
figTop.addSecond(
|
|
6243
|
+
figTop.addSecond(ctrRectangle9(hFposR, tPosY3, tL2, param.T1));
|
|
6244
|
+
figTop.addSecond(ctrRectangle9(hFposL, tPosY3, tL2, param.T1));
|
|
4901
6245
|
}
|
|
4902
6246
|
}
|
|
4903
6247
|
figTop.mergeFigure(figHandPlateR, true);
|
|
@@ -4906,7 +6250,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4906
6250
|
figTop.mergeFigure(figHandBackL, true);
|
|
4907
6251
|
figTop.mergeFigure(figMotorBulkR, true);
|
|
4908
6252
|
figTop.mergeFigure(figMotorBulkL, true);
|
|
4909
|
-
figTop.addPoint(
|
|
6253
|
+
figTop.addPoint(point10(rx10, ry10, ShapePoint2.eBigSquare));
|
|
4910
6254
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
4911
6255
|
const tPosY = ii * (param.L1 + param.T1) + param.T1 + param.L1 / 2;
|
|
4912
6256
|
for (const iCtr of makeTopWheel2(hPposR, tPosY, wheelRA[ii])) {
|
|
@@ -4916,18 +6260,18 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4916
6260
|
figTop.addSecond(iCtr);
|
|
4917
6261
|
}
|
|
4918
6262
|
}
|
|
4919
|
-
figSide.addMainO(
|
|
4920
|
-
figSide.addSecond(
|
|
6263
|
+
figSide.addMainO(ctrRectangle9(0, 0, Ltotal, param.H1));
|
|
6264
|
+
figSide.addSecond(ctrRectangle9(0, H1b, Ltotal, param.T1));
|
|
4921
6265
|
if (param.triangleExt) {
|
|
4922
6266
|
for (let ii = 0; ii < 2; ii++) {
|
|
4923
6267
|
const tPosY = ii * (param.L1 + param.T1) * param.N1;
|
|
4924
|
-
figSide.addSecond(
|
|
6268
|
+
figSide.addSecond(ctrRectangle9(tPosY, 0, param.T1, H1b));
|
|
4925
6269
|
}
|
|
4926
6270
|
}
|
|
4927
6271
|
if (param.triangleInt) {
|
|
4928
6272
|
for (let ii = 1; ii < param.N1; ii++) {
|
|
4929
6273
|
const tPosY = ii * (param.L1 + param.T1);
|
|
4930
|
-
figSide.addSecond(
|
|
6274
|
+
figSide.addSecond(ctrRectangle9(tPosY, 0, param.T1, H1b));
|
|
4931
6275
|
}
|
|
4932
6276
|
}
|
|
4933
6277
|
const tH2 = 2 * R2;
|
|
@@ -4935,8 +6279,8 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4935
6279
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
4936
6280
|
for (const tPosY2 of [LF2, LF23, LF25, LF28]) {
|
|
4937
6281
|
const tPosY3 = tPosY + tPosY2;
|
|
4938
|
-
figSide.addSecond(
|
|
4939
|
-
figSide.addSecond(
|
|
6282
|
+
figSide.addSecond(ctrRectangle9(tPosY3, 0, param.T1, tH2));
|
|
6283
|
+
figSide.addSecond(ctrRectangle9(tPosY3, tH2 + Z2b, param.T1, tH2));
|
|
4940
6284
|
}
|
|
4941
6285
|
}
|
|
4942
6286
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
@@ -4944,12 +6288,12 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4944
6288
|
for (const tPosY2 of [LF2, LF25]) {
|
|
4945
6289
|
const tPosY3 = tPosY + tPosY2 + param.T1 + param.E1;
|
|
4946
6290
|
if (boneSideyR > 0) {
|
|
4947
|
-
figSide.addSecond(
|
|
4948
|
-
figSide.addSecond(
|
|
6291
|
+
figSide.addSecond(ctrRectangle9(tPosY3, 0, param.T1, boneSideyR));
|
|
6292
|
+
figSide.addSecond(ctrRectangle9(tPosY3, 2 * R2 + Z2b, param.T1, boneSideyR));
|
|
4949
6293
|
} else {
|
|
4950
6294
|
const tLy = -boneSideyR;
|
|
4951
|
-
figSide.addSecond(
|
|
4952
|
-
figSide.addSecond(
|
|
6295
|
+
figSide.addSecond(ctrRectangle9(tPosY3, 2 * R2 - tLy, param.T1, tLy));
|
|
6296
|
+
figSide.addSecond(ctrRectangle9(tPosY3, 4 * R2 + Z2b - tLy, param.T1, tLy));
|
|
4953
6297
|
}
|
|
4954
6298
|
}
|
|
4955
6299
|
}
|
|
@@ -4957,8 +6301,8 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4957
6301
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
4958
6302
|
for (const tPosY2 of [LF2, LF23, LF25, LF28]) {
|
|
4959
6303
|
const tPosY3 = tPosY + tPosY2;
|
|
4960
|
-
figSide.addSecond(
|
|
4961
|
-
figSide.addSecond(
|
|
6304
|
+
figSide.addSecond(ctrRectangle9(tPosY3, boneSideyRs, param.T1, tH2));
|
|
6305
|
+
figSide.addSecond(ctrRectangle9(tPosY3, boneSideyRs + tH2 + Z2b, param.T1, tH2));
|
|
4962
6306
|
}
|
|
4963
6307
|
}
|
|
4964
6308
|
const ZhpR = [boneSideyRs, boneSideyRs + Z2c];
|
|
@@ -4966,17 +6310,17 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4966
6310
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
4967
6311
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
4968
6312
|
const tPosY3 = tPosY + LF2;
|
|
4969
|
-
figSide.addSecond(
|
|
4970
|
-
figSide.addSecond(
|
|
4971
|
-
figSide.addSecond(
|
|
4972
|
-
figSide.addSecond(
|
|
6313
|
+
figSide.addSecond(ctrRectangle9(tPosY3, ZhpR[0], param.F1, param.T1));
|
|
6314
|
+
figSide.addSecond(ctrRectangle9(tPosY3, ZhpR[1], param.F1, param.T1));
|
|
6315
|
+
figSide.addSecond(ctrRectangle9(tPosY3, ZhpR[0], param.F1, param.Z2));
|
|
6316
|
+
figSide.addSecond(ctrRectangle9(tPosY3, mBRpY, param.F1, motorHeight));
|
|
4973
6317
|
const axisX = tPosY + param.L1 / 2;
|
|
4974
6318
|
const axisY = ZhpR[0] - param.Z1;
|
|
4975
6319
|
for (const iCtr of makeMFoot2(axisX, axisY)) {
|
|
4976
6320
|
figSide.addSecond(iCtr);
|
|
4977
6321
|
}
|
|
4978
|
-
figSide.addSecond(
|
|
4979
|
-
figSide.addSecond(
|
|
6322
|
+
figSide.addSecond(contourCircle14(axisX, axisY, Raxis));
|
|
6323
|
+
figSide.addSecond(contourCircle14(axisX, axisY, Rwheel));
|
|
4980
6324
|
}
|
|
4981
6325
|
rGeome.fig = {
|
|
4982
6326
|
facePlatform: figPlatform,
|
|
@@ -5001,7 +6345,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5001
6345
|
const volPlatformMain = {
|
|
5002
6346
|
outName: `subpax_${designName}_platformMain`,
|
|
5003
6347
|
face: `${designName}_facePlatform`,
|
|
5004
|
-
extrudeMethod:
|
|
6348
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
5005
6349
|
length: Ltotal,
|
|
5006
6350
|
rotate: [0, 0, 0],
|
|
5007
6351
|
translate: [0, 0, 0]
|
|
@@ -5116,7 +6460,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5116
6460
|
volumes: [
|
|
5117
6461
|
{
|
|
5118
6462
|
outName: `pax_${designName}`,
|
|
5119
|
-
boolMethod:
|
|
6463
|
+
boolMethod: EBVolume14.eUnion,
|
|
5120
6464
|
inList: list3D
|
|
5121
6465
|
}
|
|
5122
6466
|
]
|
|
@@ -5133,36 +6477,36 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5133
6477
|
var rccarDef = {
|
|
5134
6478
|
pTitle: "rccar",
|
|
5135
6479
|
pDescription: "high-level concept of the RC-car",
|
|
5136
|
-
pDef:
|
|
5137
|
-
pGeom:
|
|
5138
|
-
};
|
|
5139
|
-
|
|
5140
|
-
// src/rccar/singleBone.ts
|
|
5141
|
-
import {
|
|
5142
|
-
contour as
|
|
5143
|
-
contourCircle as
|
|
5144
|
-
figure as
|
|
5145
|
-
ffix as
|
|
5146
|
-
pNumber as
|
|
5147
|
-
pSectionSeparator as
|
|
5148
|
-
EExtrude as
|
|
5149
|
-
EBVolume as
|
|
5150
|
-
initGeom as
|
|
6480
|
+
pDef: pDef17,
|
|
6481
|
+
pGeom: pGeom17
|
|
6482
|
+
};
|
|
6483
|
+
|
|
6484
|
+
// src/rccar/singleBone.ts
|
|
6485
|
+
import {
|
|
6486
|
+
contour as contour19,
|
|
6487
|
+
contourCircle as contourCircle15,
|
|
6488
|
+
figure as figure16,
|
|
6489
|
+
ffix as ffix19,
|
|
6490
|
+
pNumber as pNumber18,
|
|
6491
|
+
pSectionSeparator as pSectionSeparator18,
|
|
6492
|
+
EExtrude as EExtrude15,
|
|
6493
|
+
EBVolume as EBVolume15,
|
|
6494
|
+
initGeom as initGeom18
|
|
5151
6495
|
} from "geometrix";
|
|
5152
|
-
var
|
|
6496
|
+
var pDef18 = {
|
|
5153
6497
|
partName: "singleBone",
|
|
5154
6498
|
params: [
|
|
5155
6499
|
//pNumber(name, unit, init, min, max, step)
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
6500
|
+
pNumber18("D1", "mm", 30, 1, 500, 1),
|
|
6501
|
+
pNumber18("D2", "mm", 70, 1, 500, 1),
|
|
6502
|
+
pNumber18("L1", "mm", 200, 10, 1e3, 1),
|
|
6503
|
+
pSectionSeparator18("Details"),
|
|
6504
|
+
pNumber18("R3", "mm", 50, 0, 1e3, 1),
|
|
6505
|
+
pNumber18("W1", "mm", 30, 1, 500, 1),
|
|
6506
|
+
pNumber18("T1", "mm", 10, 1, 100, 1),
|
|
6507
|
+
pSectionSeparator18("Holes"),
|
|
6508
|
+
pNumber18("P2", "%", 50, 0, 99, 1),
|
|
6509
|
+
pNumber18("W2", "mm", 10, 1, 500, 1)
|
|
5166
6510
|
],
|
|
5167
6511
|
paramSvg: {
|
|
5168
6512
|
D1: "singleBone_face.svg",
|
|
@@ -5181,9 +6525,9 @@ var pDef15 = {
|
|
|
5181
6525
|
// every 0.5 second
|
|
5182
6526
|
}
|
|
5183
6527
|
};
|
|
5184
|
-
function
|
|
5185
|
-
const rGeome =
|
|
5186
|
-
const figBone =
|
|
6528
|
+
function pGeom18(t, param, suffix = "") {
|
|
6529
|
+
const rGeome = initGeom18(pDef18.partName + suffix);
|
|
6530
|
+
const figBone = figure16();
|
|
5187
6531
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
5188
6532
|
`;
|
|
5189
6533
|
try {
|
|
@@ -5193,7 +6537,7 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5193
6537
|
const boneLen = param.L1 + 2 * R22;
|
|
5194
6538
|
const dX2 = R22 ** 2 - W12 ** 2;
|
|
5195
6539
|
if (dX2 < 0) {
|
|
5196
|
-
throw `err086: D2 ${
|
|
6540
|
+
throw `err086: D2 ${ffix19(param.D2)} is too small compare to W1 ${ffix19(param.W1)} mm`;
|
|
5197
6541
|
}
|
|
5198
6542
|
const dX = Math.sqrt(dX2);
|
|
5199
6543
|
const L1b = param.L1 - 2 * dX;
|
|
@@ -5204,24 +6548,24 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5204
6548
|
const hX0b = R22 + W2b + Rh;
|
|
5205
6549
|
const hX1b = W2b + 2 * Rh;
|
|
5206
6550
|
if (R22 < R12) {
|
|
5207
|
-
throw `err085: D2 ${
|
|
6551
|
+
throw `err085: D2 ${ffix19(param.D2)} is too small compare to D1 ${ffix19(param.D1)} mm`;
|
|
5208
6552
|
}
|
|
5209
6553
|
if (L1b < 0) {
|
|
5210
|
-
throw `err095: L1 ${
|
|
6554
|
+
throw `err095: L1 ${ffix19(param.L1)} is too small compare to D2 ${ffix19(param.D2)} mm`;
|
|
5211
6555
|
}
|
|
5212
|
-
rGeome.logstr += `Bone length ${
|
|
6556
|
+
rGeome.logstr += `Bone length ${ffix19(boneLen)} mm
|
|
5213
6557
|
`;
|
|
5214
|
-
rGeome.logstr += `Bone with N2 ${N2} holes of diameter ${
|
|
6558
|
+
rGeome.logstr += `Bone with N2 ${N2} holes of diameter ${ffix19(2 * Rh)} mm
|
|
5215
6559
|
`;
|
|
5216
|
-
rGeome.logstr += `Bone W2b ${
|
|
6560
|
+
rGeome.logstr += `Bone W2b ${ffix19(W2b)} mm
|
|
5217
6561
|
`;
|
|
5218
|
-
const ctrBone =
|
|
5219
|
-
const ctrAxis1 =
|
|
5220
|
-
const ctrAxis2 =
|
|
6562
|
+
const ctrBone = contour19(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();
|
|
6563
|
+
const ctrAxis1 = contourCircle15(0, 0, R12);
|
|
6564
|
+
const ctrAxis2 = contourCircle15(param.L1, 0, R12);
|
|
5221
6565
|
const ctrMinis = [];
|
|
5222
6566
|
if (Rh > 0) {
|
|
5223
6567
|
for (let ii = 0; ii < N2; ii++) {
|
|
5224
|
-
ctrMinis.push(
|
|
6568
|
+
ctrMinis.push(contourCircle15(hX0b + ii * hX1b, 0, Rh));
|
|
5225
6569
|
}
|
|
5226
6570
|
}
|
|
5227
6571
|
figBone.addMainOI([ctrBone, ctrAxis1, ctrAxis2, ...ctrMinis]);
|
|
@@ -5234,7 +6578,7 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5234
6578
|
{
|
|
5235
6579
|
outName: `subpax_${designName}_bone`,
|
|
5236
6580
|
face: `${designName}_faceBone`,
|
|
5237
|
-
extrudeMethod:
|
|
6581
|
+
extrudeMethod: EExtrude15.eLinearOrtho,
|
|
5238
6582
|
length: param.T1,
|
|
5239
6583
|
rotate: [0, 0, 0],
|
|
5240
6584
|
translate: [0, 0, 0]
|
|
@@ -5243,7 +6587,7 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5243
6587
|
volumes: [
|
|
5244
6588
|
{
|
|
5245
6589
|
outName: `pax_${designName}`,
|
|
5246
|
-
boolMethod:
|
|
6590
|
+
boolMethod: EBVolume15.eIdentity,
|
|
5247
6591
|
inList: [`subpax_${designName}_bone`]
|
|
5248
6592
|
}
|
|
5249
6593
|
]
|
|
@@ -5260,18 +6604,18 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5260
6604
|
var singleBoneDef = {
|
|
5261
6605
|
pTitle: "singleBone",
|
|
5262
6606
|
pDescription: "detailed design of the suspension bone of the rccar",
|
|
5263
|
-
pDef:
|
|
5264
|
-
pGeom:
|
|
6607
|
+
pDef: pDef18,
|
|
6608
|
+
pGeom: pGeom18
|
|
5265
6609
|
};
|
|
5266
6610
|
|
|
5267
6611
|
// src/rccar/doubleBone.ts
|
|
5268
6612
|
import {
|
|
5269
|
-
contourCircle as
|
|
5270
|
-
degToRad as
|
|
5271
|
-
ffix as
|
|
5272
|
-
pNumber as
|
|
5273
|
-
pSectionSeparator as
|
|
5274
|
-
initGeom as
|
|
6613
|
+
contourCircle as contourCircle16,
|
|
6614
|
+
degToRad as degToRad9,
|
|
6615
|
+
ffix as ffix20,
|
|
6616
|
+
pNumber as pNumber19,
|
|
6617
|
+
pSectionSeparator as pSectionSeparator19,
|
|
6618
|
+
initGeom as initGeom19
|
|
5275
6619
|
} from "geometrix";
|
|
5276
6620
|
import {
|
|
5277
6621
|
tJDir as tJDir4,
|
|
@@ -5280,37 +6624,37 @@ import {
|
|
|
5280
6624
|
facet as facet4,
|
|
5281
6625
|
sheetFold as sheetFold4
|
|
5282
6626
|
} from "sheetfold";
|
|
5283
|
-
var
|
|
6627
|
+
var pDef19 = {
|
|
5284
6628
|
partName: "doubleBone",
|
|
5285
6629
|
params: [
|
|
5286
6630
|
//pNumber(name, unit, init, min, max, step)
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
6631
|
+
pNumber19("D1", "mm", 30, 1, 500, 1),
|
|
6632
|
+
pNumber19("D2", "mm", 70, 1, 500, 1),
|
|
6633
|
+
pNumber19("L1", "mm", 300, 10, 1e3, 1),
|
|
6634
|
+
pNumber19("L2", "mm", 200, 10, 1e3, 1),
|
|
6635
|
+
pNumber19("E1", "mm", 40, 1, 1e3, 1),
|
|
6636
|
+
pSectionSeparator19("Side"),
|
|
6637
|
+
pNumber19("W1", "mm", 30, 1, 500, 1),
|
|
6638
|
+
pNumber19("P2", "%", 50, 0, 99, 1),
|
|
6639
|
+
pNumber19("W2", "mm", 10, 1, 500, 1),
|
|
6640
|
+
pSectionSeparator19("Top"),
|
|
6641
|
+
pNumber19("S1", "mm", 20, 1, 100, 1),
|
|
6642
|
+
pNumber19("S2", "mm", 20, 1, 100, 1),
|
|
6643
|
+
pNumber19("S3", "mm", 20, 1, 100, 1),
|
|
6644
|
+
pNumber19("R3", "mm", 10, 0, 1e3, 1),
|
|
6645
|
+
pSectionSeparator19("Wing width"),
|
|
6646
|
+
pNumber19("P11", "%", 8, 0, 90, 1),
|
|
6647
|
+
pNumber19("P12", "%", 20, 0, 90, 1),
|
|
6648
|
+
pNumber19("P21", "%", 18, 0, 90, 1),
|
|
6649
|
+
pNumber19("P22", "%", 20, 0, 90, 1),
|
|
6650
|
+
pSectionSeparator19("Folding"),
|
|
6651
|
+
pNumber19("T1", "mm", 2, 0.5, 10, 0.1),
|
|
6652
|
+
pNumber19("Jangle", "degree", 90, 30, 120, 1),
|
|
6653
|
+
pNumber19("Jradius", "mm", 10, 0.1, 50, 0.1),
|
|
6654
|
+
pNumber19("Jneutral", "%", 50, 0, 100, 1),
|
|
6655
|
+
pNumber19("Jmark", "mm", 2, 0.1, 10, 0.1),
|
|
6656
|
+
pNumber19("Jradius2", "mm", 4, 0.1, 50, 0.1),
|
|
6657
|
+
pNumber19("Jmark2", "mm", 2, 0.1, 10, 0.1)
|
|
5314
6658
|
],
|
|
5315
6659
|
paramSvg: {
|
|
5316
6660
|
D1: "doubleBone_face.svg",
|
|
@@ -5344,8 +6688,8 @@ var pDef16 = {
|
|
|
5344
6688
|
// every 0.5 second
|
|
5345
6689
|
}
|
|
5346
6690
|
};
|
|
5347
|
-
function
|
|
5348
|
-
const rGeome =
|
|
6691
|
+
function pGeom19(t, param, suffix = "") {
|
|
6692
|
+
const rGeome = initGeom19(pDef19.partName + suffix);
|
|
5349
6693
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
5350
6694
|
`;
|
|
5351
6695
|
try {
|
|
@@ -5355,7 +6699,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5355
6699
|
return [rA, rInitDist];
|
|
5356
6700
|
}, calcSplitTri2 = function(iL, iP) {
|
|
5357
6701
|
if (iL < 0) {
|
|
5358
|
-
throw `err559: iL ${
|
|
6702
|
+
throw `err559: iL ${ffix20(iL)} is negative mm`;
|
|
5359
6703
|
}
|
|
5360
6704
|
let rLside = iL;
|
|
5361
6705
|
let rLcenter = 0;
|
|
@@ -5408,7 +6752,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5408
6752
|
const boneLen = param.L1 + 2 * R22;
|
|
5409
6753
|
const dX2 = R22 ** 2 - W12 ** 2;
|
|
5410
6754
|
if (dX2 < 0) {
|
|
5411
|
-
throw `err086: D2 ${
|
|
6755
|
+
throw `err086: D2 ${ffix20(param.D2)} is too small compare to W1 ${ffix20(param.W1)} mm`;
|
|
5412
6756
|
}
|
|
5413
6757
|
const dX = Math.sqrt(dX2);
|
|
5414
6758
|
const L1b = param.L1 - 2 * dX;
|
|
@@ -5418,7 +6762,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5418
6762
|
const W2b = (param.L1 - 2 * R22 - N2 * 2 * Rh) / (N2 + 1);
|
|
5419
6763
|
const hX0b = R22 + W2b + Rh;
|
|
5420
6764
|
const hX1b = W2b + 2 * Rh;
|
|
5421
|
-
const aJa =
|
|
6765
|
+
const aJa = degToRad9(param.Jangle);
|
|
5422
6766
|
const aJn = param.Jneutral / 100;
|
|
5423
6767
|
const aJr = param.Jradius;
|
|
5424
6768
|
const aJm = param.Jmark;
|
|
@@ -5448,29 +6792,29 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5448
6792
|
const [tri22s, tri22c] = calcSplitTri2(tri22L, param.P22);
|
|
5449
6793
|
const wingH = param.W1 / 2 + cornerSizeInt - cornerSizeInt2;
|
|
5450
6794
|
if (R22 < R12) {
|
|
5451
|
-
throw `err085: D2 ${
|
|
6795
|
+
throw `err085: D2 ${ffix20(param.D2)} is too small compare to D1 ${ffix20(param.D1)} mm`;
|
|
5452
6796
|
}
|
|
5453
6797
|
if (L1b < 0) {
|
|
5454
|
-
throw `err095: L1 ${
|
|
6798
|
+
throw `err095: L1 ${ffix20(param.L1)} is too small compare to D2 ${ffix20(param.D2)} mm`;
|
|
5455
6799
|
}
|
|
5456
6800
|
if (param.E1 < cornerSizeInt) {
|
|
5457
|
-
throw `err151: E1 ${
|
|
6801
|
+
throw `err151: E1 ${ffix20(param.E1)} is too small compare to Jradius ${ffix20(param.Jradius)} mm`;
|
|
5458
6802
|
}
|
|
5459
6803
|
if (L2c < 0) {
|
|
5460
|
-
throw `err150: L2 ${
|
|
6804
|
+
throw `err150: L2 ${ffix20(param.L2)} is too small compare to E1 ${ffix20(param.E1)} mm`;
|
|
5461
6805
|
}
|
|
5462
|
-
rGeome.logstr += `Bone length ${
|
|
6806
|
+
rGeome.logstr += `Bone length ${ffix20(boneLen)} mm
|
|
5463
6807
|
`;
|
|
5464
|
-
rGeome.logstr += `Bone with N2 ${N2} holes of diameter ${
|
|
6808
|
+
rGeome.logstr += `Bone with N2 ${N2} holes of diameter ${ffix20(2 * Rh)} and W2b ${ffix20(W2b)} mm
|
|
5465
6809
|
`;
|
|
5466
|
-
rGeome.logstr += `Side with N2c ${N2c} holes of diameter ${
|
|
6810
|
+
rGeome.logstr += `Side with N2c ${N2c} holes of diameter ${ffix20(2 * Rh)} and W2c ${ffix20(W2c)} mm
|
|
5467
6811
|
`;
|
|
5468
|
-
const ctrAxis1 =
|
|
5469
|
-
const ctrAxis2 =
|
|
6812
|
+
const ctrAxis1 = contourCircle16(0, 0, R12);
|
|
6813
|
+
const ctrAxis2 = contourCircle16(param.L1, 0, R12);
|
|
5470
6814
|
const ctrMinis = [];
|
|
5471
6815
|
if (Rh > 0) {
|
|
5472
6816
|
for (let ii = 0; ii < N2; ii++) {
|
|
5473
|
-
ctrMinis.push(
|
|
6817
|
+
ctrMinis.push(contourCircle16(hX0b + ii * hX1b, 0, Rh));
|
|
5474
6818
|
}
|
|
5475
6819
|
}
|
|
5476
6820
|
const ctrBone1 = makeCtrBone2("J1", "J2");
|
|
@@ -5500,7 +6844,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5500
6844
|
const ctrMinics = [];
|
|
5501
6845
|
if (Rh > 0) {
|
|
5502
6846
|
for (let ii = 0; ii < N2c; ii++) {
|
|
5503
|
-
ctrMinics.push(
|
|
6847
|
+
ctrMinics.push(contourCircle16(hX0c + ii * hX1c, W12, Rh));
|
|
5504
6848
|
}
|
|
5505
6849
|
}
|
|
5506
6850
|
const faSide1 = facet4([makeCtrSide2("J11"), ...ctrMinics]);
|
|
@@ -5562,73 +6906,73 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5562
6906
|
var doubleBoneDef = {
|
|
5563
6907
|
pTitle: "doubleBone",
|
|
5564
6908
|
pDescription: "combined suspension bones of the rccar",
|
|
5565
|
-
pDef:
|
|
5566
|
-
pGeom:
|
|
6909
|
+
pDef: pDef19,
|
|
6910
|
+
pGeom: pGeom19
|
|
5567
6911
|
};
|
|
5568
6912
|
|
|
5569
6913
|
// src/rccar/pcar.ts
|
|
5570
6914
|
import {
|
|
5571
|
-
contour as
|
|
5572
|
-
contourCircle as
|
|
5573
|
-
figure as
|
|
5574
|
-
ffix as
|
|
5575
|
-
pNumber as
|
|
5576
|
-
pSectionSeparator as
|
|
5577
|
-
EExtrude as
|
|
5578
|
-
EBVolume as
|
|
5579
|
-
initGeom as
|
|
6915
|
+
contour as contour20,
|
|
6916
|
+
contourCircle as contourCircle17,
|
|
6917
|
+
figure as figure17,
|
|
6918
|
+
ffix as ffix21,
|
|
6919
|
+
pNumber as pNumber20,
|
|
6920
|
+
pSectionSeparator as pSectionSeparator20,
|
|
6921
|
+
EExtrude as EExtrude16,
|
|
6922
|
+
EBVolume as EBVolume16,
|
|
6923
|
+
initGeom as initGeom20
|
|
5580
6924
|
} from "geometrix";
|
|
5581
|
-
var
|
|
6925
|
+
var pDef20 = {
|
|
5582
6926
|
partName: "pcar",
|
|
5583
6927
|
params: [
|
|
5584
6928
|
//pNumber(name, unit, init, min, max, step)
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
6929
|
+
pNumber20("LB1", "mm", 1e3, 100, 4e3, 1),
|
|
6930
|
+
pNumber20("LB2", "mm", 3e3, 100, 8e3, 1),
|
|
6931
|
+
pNumber20("LB3", "mm", 1e3, 100, 4e3, 1),
|
|
6932
|
+
pNumber20("LT1", "mm", 800, 100, 4e3, 1),
|
|
6933
|
+
pNumber20("LT3", "mm", 1200, 100, 4e3, 1),
|
|
6934
|
+
pNumber20("LT4", "mm", 1600, 100, 4e3, 1),
|
|
6935
|
+
pNumber20("HF1", "mm", 900, 100, 3e3, 1),
|
|
6936
|
+
pNumber20("HF3", "mm", 600, 100, 3e3, 1),
|
|
6937
|
+
pNumber20("HF4", "mm", 300, 100, 3e3, 1),
|
|
6938
|
+
pNumber20("HB1", "mm", 800, 100, 3e3, 1),
|
|
6939
|
+
pSectionSeparator20("Wheels"),
|
|
6940
|
+
pNumber20("HW1", "mm", 200, -1e3, 1e3, 1),
|
|
6941
|
+
pNumber20("DW1", "mm", 100, 1, 500, 1),
|
|
6942
|
+
pNumber20("DW2", "mm", 600, 1, 2e3, 1),
|
|
6943
|
+
pNumber20("DW3", "mm", 800, 1, 2e3, 1),
|
|
6944
|
+
pNumber20("WW1", "mm", 300, 1, 1e3, 1),
|
|
6945
|
+
pNumber20("WW2", "mm", 200, 1, 1e3, 1),
|
|
6946
|
+
pNumber20("RW2", "mm", 50, 1, 1e3, 1),
|
|
6947
|
+
pSectionSeparator20("Side"),
|
|
6948
|
+
pNumber20("C1", "mm", 50, 1, 500, 1),
|
|
6949
|
+
pNumber20("C2", "mm", 100, 1, 500, 1),
|
|
6950
|
+
pNumber20("C3", "mm", 50, 1, 500, 1),
|
|
6951
|
+
pNumber20("C4", "mm", 50, 1, 500, 1),
|
|
6952
|
+
pNumber20("Rs1", "mm", 100, 1, 2e3, 1),
|
|
6953
|
+
pNumber20("Rs2", "mm", 100, 1, 2e3, 1),
|
|
6954
|
+
pNumber20("Rs3", "mm", 100, 1, 2e3, 1),
|
|
6955
|
+
pNumber20("Rs4", "mm", 100, 1, 2e3, 1),
|
|
6956
|
+
pNumber20("Rs5", "mm", 100, 1, 2e3, 1),
|
|
6957
|
+
pNumber20("Rs6", "mm", 500, 1, 2e3, 1),
|
|
6958
|
+
pNumber20("Rs7", "mm", 100, 1, 2e3, 1),
|
|
6959
|
+
pSectionSeparator20("Top"),
|
|
6960
|
+
pNumber20("Wt1", "mm", 600, 1, 2e3, 1),
|
|
6961
|
+
pNumber20("Wt2", "mm", 800, 1, 2e3, 1),
|
|
6962
|
+
pNumber20("Ct1", "mm", 50, 1, 500, 1),
|
|
6963
|
+
pNumber20("Ct2", "mm", 50, 1, 500, 1),
|
|
6964
|
+
pNumber20("Ct3", "mm", 50, 1, 500, 1),
|
|
6965
|
+
pNumber20("Rt1", "mm", 100, 1, 2e3, 1),
|
|
6966
|
+
pNumber20("Rt2", "mm", 400, 1, 2e3, 1),
|
|
6967
|
+
pSectionSeparator20("Front"),
|
|
6968
|
+
pNumber20("Wf1", "mm", 800, 1, 2e3, 1),
|
|
6969
|
+
pNumber20("Wf2", "mm", 300, 1, 1e3, 1),
|
|
6970
|
+
pNumber20("Cf1", "mm", 50, 1, 500, 1),
|
|
6971
|
+
pNumber20("Cf2", "mm", 50, 1, 500, 1),
|
|
6972
|
+
pNumber20("Cf3", "mm", 50, 1, 500, 1),
|
|
6973
|
+
pNumber20("Rf1", "mm", 100, 1, 2e3, 1),
|
|
6974
|
+
pNumber20("Rf2", "mm", 100, 1, 2e3, 1),
|
|
6975
|
+
pNumber20("Rf3", "mm", 100, 1, 2e3, 1)
|
|
5632
6976
|
],
|
|
5633
6977
|
paramSvg: {
|
|
5634
6978
|
LB1: "pcar_side.svg",
|
|
@@ -5683,13 +7027,13 @@ var pDef17 = {
|
|
|
5683
7027
|
// every 0.5 second
|
|
5684
7028
|
}
|
|
5685
7029
|
};
|
|
5686
|
-
function
|
|
5687
|
-
const rGeome =
|
|
5688
|
-
const figSideWiWheels =
|
|
5689
|
-
const figSideWoWheels =
|
|
5690
|
-
const figTop =
|
|
5691
|
-
const figFront =
|
|
5692
|
-
const figWheel =
|
|
7030
|
+
function pGeom20(t, param, suffix = "") {
|
|
7031
|
+
const rGeome = initGeom20(pDef20.partName + suffix);
|
|
7032
|
+
const figSideWiWheels = figure17();
|
|
7033
|
+
const figSideWoWheels = figure17();
|
|
7034
|
+
const figTop = figure17();
|
|
7035
|
+
const figFront = figure17();
|
|
7036
|
+
const figWheel = figure17();
|
|
5693
7037
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
5694
7038
|
`;
|
|
5695
7039
|
try {
|
|
@@ -5702,7 +7046,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5702
7046
|
const rEF = EG / Math.cos(aAED);
|
|
5703
7047
|
return rEF;
|
|
5704
7048
|
}, makeCtrSide2 = function(withWheels) {
|
|
5705
|
-
const rCtr =
|
|
7049
|
+
const rCtr = contour20(-param.LB1, BodyY0).addCornerRounded(param.Rs1);
|
|
5706
7050
|
if (withWheels) {
|
|
5707
7051
|
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);
|
|
5708
7052
|
} else {
|
|
@@ -5711,7 +7055,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5711
7055
|
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();
|
|
5712
7056
|
return rCtr;
|
|
5713
7057
|
}, makeCtrWheel2 = function(sX, x0, y0, r0) {
|
|
5714
|
-
const rCtr =
|
|
7058
|
+
const rCtr = contour20(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);
|
|
5715
7059
|
return rCtr;
|
|
5716
7060
|
};
|
|
5717
7061
|
var calcCR = calcCR2, makeCtrSide = makeCtrSide2, makeCtrWheel = makeCtrWheel2;
|
|
@@ -5737,7 +7081,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5737
7081
|
const Ct3b = param.LB3 - (param.Ct3 + RW3);
|
|
5738
7082
|
const dXwheel2 = RW3 ** 2 - param.HW1 ** 2;
|
|
5739
7083
|
if (dXwheel2 < 0) {
|
|
5740
|
-
throw `err158: dXwheel2 ${
|
|
7084
|
+
throw `err158: dXwheel2 ${ffix21(dXwheel2)} is negative because of HW1 ${ffix21(param.HW1)} and RW3 ${ffix21(RW3)} mm`;
|
|
5741
7085
|
}
|
|
5742
7086
|
const dXwheel = Math.sqrt(RW3 ** 2 - param.HW1 ** 2);
|
|
5743
7087
|
const LB1b = param.LB1 - dXwheel;
|
|
@@ -5754,59 +7098,59 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5754
7098
|
const CRf2 = calcCR2(param.Wf2, Wf1b, param.Cf2);
|
|
5755
7099
|
const CRf3 = calcCR2(Wf2b, 0, param.Cf3);
|
|
5756
7100
|
if (BodyY0 < 0) {
|
|
5757
|
-
throw `err147: DW2 ${
|
|
7101
|
+
throw `err147: DW2 ${ffix21(param.DW2)} is too small comapre to HW1 ${ffix21(param.HW1)} mm`;
|
|
5758
7102
|
}
|
|
5759
7103
|
if (LT2 < 0) {
|
|
5760
|
-
throw `err169: LT2 ${
|
|
7104
|
+
throw `err169: LT2 ${ffix21(LT2)} mm is negative`;
|
|
5761
7105
|
}
|
|
5762
7106
|
if (HF3b < 0) {
|
|
5763
|
-
throw `err174: HF3b ${
|
|
7107
|
+
throw `err174: HF3b ${ffix21(HF3b)} mm is negative`;
|
|
5764
7108
|
}
|
|
5765
7109
|
if (HB1b < 0) {
|
|
5766
|
-
throw `err178: HB1b ${
|
|
7110
|
+
throw `err178: HB1b ${ffix21(HB1b)} mm is negative`;
|
|
5767
7111
|
}
|
|
5768
7112
|
if (HB2 < 0) {
|
|
5769
|
-
throw `err172: HB2 ${
|
|
7113
|
+
throw `err172: HB2 ${ffix21(HB2)} mm is negative`;
|
|
5770
7114
|
}
|
|
5771
7115
|
if (Wf1b < 0) {
|
|
5772
|
-
throw `err161: Wf1b ${
|
|
7116
|
+
throw `err161: Wf1b ${ffix21(Wf1b)} mm is negative`;
|
|
5773
7117
|
}
|
|
5774
7118
|
if (Wf2b < 0) {
|
|
5775
|
-
throw `err164: Wf2b ${
|
|
7119
|
+
throw `err164: Wf2b ${ffix21(Wf2b)} mm is negative`;
|
|
5776
7120
|
}
|
|
5777
7121
|
if (Cf1b < 0) {
|
|
5778
|
-
throw `err167: Cf1b ${
|
|
7122
|
+
throw `err167: Cf1b ${ffix21(Cf1b)} mm is negative`;
|
|
5779
7123
|
}
|
|
5780
7124
|
if (Ct1b < 0) {
|
|
5781
|
-
throw `err170: Ct1b ${
|
|
7125
|
+
throw `err170: Ct1b ${ffix21(Ct1b)} mm is negative`;
|
|
5782
7126
|
}
|
|
5783
7127
|
if (Ct2b < 0) {
|
|
5784
|
-
throw `err173: Ct2b ${
|
|
7128
|
+
throw `err173: Ct2b ${ffix21(Ct2b)} mm is negative`;
|
|
5785
7129
|
}
|
|
5786
7130
|
if (Ct3b < 0) {
|
|
5787
|
-
throw `err176: Ct3b ${
|
|
7131
|
+
throw `err176: Ct3b ${ffix21(Ct3b)} mm is negative`;
|
|
5788
7132
|
}
|
|
5789
7133
|
if (LB1b < 0) {
|
|
5790
|
-
throw `err185: LB1b ${
|
|
7134
|
+
throw `err185: LB1b ${ffix21(LB1b)} mm is negative`;
|
|
5791
7135
|
}
|
|
5792
7136
|
if (LB2b < 0) {
|
|
5793
|
-
throw `err189: LB2b ${
|
|
7137
|
+
throw `err189: LB2b ${ffix21(LB2b)} mm is negative`;
|
|
5794
7138
|
}
|
|
5795
7139
|
if (LB3b < 0) {
|
|
5796
|
-
throw `err193: LB3b ${
|
|
7140
|
+
throw `err193: LB3b ${ffix21(LB3b)} mm is negative`;
|
|
5797
7141
|
}
|
|
5798
|
-
rGeome.logstr += `Body: Y0 ${
|
|
7142
|
+
rGeome.logstr += `Body: Y0 ${ffix21(BodyY0)}, Height ${ffix21(BodyHeight)}, Lenght: ${ffix21(BodyLength)}, Width: ${ffix21(BodyWidth)} mm
|
|
5799
7143
|
`;
|
|
5800
7144
|
figSideWiWheels.addMainO(makeCtrSide2(true));
|
|
5801
|
-
figSideWiWheels.addSecond(
|
|
5802
|
-
figSideWiWheels.addSecond(
|
|
5803
|
-
figSideWiWheels.addSecond(
|
|
5804
|
-
figSideWiWheels.addSecond(
|
|
7145
|
+
figSideWiWheels.addSecond(contourCircle17(0, RW2, RW2));
|
|
7146
|
+
figSideWiWheels.addSecond(contourCircle17(0, RW2, RW1));
|
|
7147
|
+
figSideWiWheels.addSecond(contourCircle17(param.LB2, RW2, RW2));
|
|
7148
|
+
figSideWiWheels.addSecond(contourCircle17(param.LB2, RW2, RW1));
|
|
5805
7149
|
figSideWoWheels.addMainO(makeCtrSide2(false));
|
|
5806
7150
|
figSideWoWheels.mergeFigure(figSideWiWheels, true);
|
|
5807
|
-
const ctrTop =
|
|
7151
|
+
const ctrTop = contour20(-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);
|
|
5808
7152
|
figTop.addMainO(ctrTop);
|
|
5809
|
-
const ctrFront =
|
|
7153
|
+
const ctrFront = contour20(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);
|
|
5810
7154
|
figFront.addMainO(ctrFront);
|
|
5811
7155
|
figWheel.addMainO(makeCtrWheel2(1, 0, 0, 0));
|
|
5812
7156
|
figWheel.addSecond(makeCtrWheel2(-1, 0, 0, 0));
|
|
@@ -5835,7 +7179,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5835
7179
|
{
|
|
5836
7180
|
outName: `subpax_${designName}_sideWiW1`,
|
|
5837
7181
|
face: `${designName}_faceSideWiWheels`,
|
|
5838
|
-
extrudeMethod:
|
|
7182
|
+
extrudeMethod: EExtrude16.eLinearOrtho,
|
|
5839
7183
|
length: param.Wt1,
|
|
5840
7184
|
rotate: [pi2, 0, 0],
|
|
5841
7185
|
translate: [0, param.Wt1, 0]
|
|
@@ -5843,7 +7187,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5843
7187
|
{
|
|
5844
7188
|
outName: `subpax_${designName}_sideWiW2`,
|
|
5845
7189
|
face: `${designName}_faceSideWiWheels`,
|
|
5846
|
-
extrudeMethod:
|
|
7190
|
+
extrudeMethod: EExtrude16.eLinearOrtho,
|
|
5847
7191
|
length: param.Wt1,
|
|
5848
7192
|
rotate: [pi2, 0, 0],
|
|
5849
7193
|
translate: [0, param.Wt2 + 2 * param.Wt1, 0]
|
|
@@ -5851,7 +7195,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5851
7195
|
{
|
|
5852
7196
|
outName: `subpax_${designName}_sideWoW`,
|
|
5853
7197
|
face: `${designName}_faceSideWoWheels`,
|
|
5854
|
-
extrudeMethod:
|
|
7198
|
+
extrudeMethod: EExtrude16.eLinearOrtho,
|
|
5855
7199
|
length: param.Wt2,
|
|
5856
7200
|
rotate: [pi2, 0, 0],
|
|
5857
7201
|
translate: [0, param.Wt2 + param.Wt1, 0]
|
|
@@ -5859,7 +7203,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5859
7203
|
{
|
|
5860
7204
|
outName: `subpax_${designName}_front`,
|
|
5861
7205
|
face: `${designName}_faceFront`,
|
|
5862
|
-
extrudeMethod:
|
|
7206
|
+
extrudeMethod: EExtrude16.eLinearOrtho,
|
|
5863
7207
|
length: BodyLength,
|
|
5864
7208
|
rotate: [pi2, 0, pi2],
|
|
5865
7209
|
translate: [-param.LB1, 0, 0]
|
|
@@ -5867,7 +7211,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5867
7211
|
{
|
|
5868
7212
|
outName: `subpax_${designName}_top`,
|
|
5869
7213
|
face: `${designName}_faceTop`,
|
|
5870
|
-
extrudeMethod:
|
|
7214
|
+
extrudeMethod: EExtrude16.eLinearOrtho,
|
|
5871
7215
|
length: BodyHeight + BodyY0,
|
|
5872
7216
|
rotate: [0, 0, 0],
|
|
5873
7217
|
translate: [0, 0, 0]
|
|
@@ -5875,28 +7219,28 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5875
7219
|
{
|
|
5876
7220
|
outName: `subpax_${designName}_wheel11`,
|
|
5877
7221
|
face: `${designName}_faceWheel`,
|
|
5878
|
-
extrudeMethod:
|
|
7222
|
+
extrudeMethod: EExtrude16.eRotate,
|
|
5879
7223
|
rotate: [pi2, 0, 0],
|
|
5880
7224
|
translate: [0, param.Wt1, RW2]
|
|
5881
7225
|
},
|
|
5882
7226
|
{
|
|
5883
7227
|
outName: `subpax_${designName}_wheel12`,
|
|
5884
7228
|
face: `${designName}_faceWheel`,
|
|
5885
|
-
extrudeMethod:
|
|
7229
|
+
extrudeMethod: EExtrude16.eRotate,
|
|
5886
7230
|
rotate: [-pi2, 0, 0],
|
|
5887
7231
|
translate: [0, param.Wt1 + param.Wt2, RW2]
|
|
5888
7232
|
},
|
|
5889
7233
|
{
|
|
5890
7234
|
outName: `subpax_${designName}_wheel21`,
|
|
5891
7235
|
face: `${designName}_faceWheel`,
|
|
5892
|
-
extrudeMethod:
|
|
7236
|
+
extrudeMethod: EExtrude16.eRotate,
|
|
5893
7237
|
rotate: [pi2, 0, 0],
|
|
5894
7238
|
translate: [param.LB2, param.Wt1, RW2]
|
|
5895
7239
|
},
|
|
5896
7240
|
{
|
|
5897
7241
|
outName: `subpax_${designName}_wheel22`,
|
|
5898
7242
|
face: `${designName}_faceWheel`,
|
|
5899
|
-
extrudeMethod:
|
|
7243
|
+
extrudeMethod: EExtrude16.eRotate,
|
|
5900
7244
|
rotate: [-pi2, 0, 0],
|
|
5901
7245
|
translate: [param.LB2, param.Wt1 + param.Wt2, RW2]
|
|
5902
7246
|
}
|
|
@@ -5904,7 +7248,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5904
7248
|
volumes: [
|
|
5905
7249
|
{
|
|
5906
7250
|
outName: `ipax_${designName}_side`,
|
|
5907
|
-
boolMethod:
|
|
7251
|
+
boolMethod: EBVolume16.eUnion,
|
|
5908
7252
|
inList: [
|
|
5909
7253
|
`subpax_${designName}_sideWiW1`,
|
|
5910
7254
|
`subpax_${designName}_sideWiW2`,
|
|
@@ -5913,7 +7257,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5913
7257
|
},
|
|
5914
7258
|
{
|
|
5915
7259
|
outName: `ipax_${designName}_body`,
|
|
5916
|
-
boolMethod:
|
|
7260
|
+
boolMethod: EBVolume16.eIntersection,
|
|
5917
7261
|
inList: [
|
|
5918
7262
|
`ipax_${designName}_side`,
|
|
5919
7263
|
`subpax_${designName}_front`,
|
|
@@ -5922,7 +7266,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5922
7266
|
},
|
|
5923
7267
|
{
|
|
5924
7268
|
outName: `pax_${designName}`,
|
|
5925
|
-
boolMethod:
|
|
7269
|
+
boolMethod: EBVolume16.eUnion,
|
|
5926
7270
|
inList: [
|
|
5927
7271
|
`ipax_${designName}_body`,
|
|
5928
7272
|
`subpax_${designName}_wheel11`,
|
|
@@ -5945,82 +7289,82 @@ function pGeom17(t, param, suffix = "") {
|
|
|
5945
7289
|
var pcarDef = {
|
|
5946
7290
|
pTitle: "pcar",
|
|
5947
7291
|
pDescription: "the envelop of a passager car",
|
|
5948
|
-
pDef:
|
|
5949
|
-
pGeom:
|
|
7292
|
+
pDef: pDef20,
|
|
7293
|
+
pGeom: pGeom20
|
|
5950
7294
|
};
|
|
5951
7295
|
|
|
5952
7296
|
// src/capsule/capsule.ts
|
|
5953
7297
|
import {
|
|
5954
|
-
point as
|
|
5955
|
-
contour as
|
|
5956
|
-
contourCircle as
|
|
5957
|
-
ctrRectangle as
|
|
5958
|
-
figure as
|
|
5959
|
-
ffix as
|
|
5960
|
-
pNumber as
|
|
5961
|
-
pCheckbox as
|
|
7298
|
+
point as point11,
|
|
7299
|
+
contour as contour21,
|
|
7300
|
+
contourCircle as contourCircle18,
|
|
7301
|
+
ctrRectangle as ctrRectangle10,
|
|
7302
|
+
figure as figure18,
|
|
7303
|
+
ffix as ffix22,
|
|
7304
|
+
pNumber as pNumber21,
|
|
7305
|
+
pCheckbox as pCheckbox12,
|
|
5962
7306
|
pDropdown as pDropdown9,
|
|
5963
|
-
pSectionSeparator as
|
|
5964
|
-
EExtrude as
|
|
5965
|
-
EBVolume as
|
|
5966
|
-
initGeom as
|
|
7307
|
+
pSectionSeparator as pSectionSeparator21,
|
|
7308
|
+
EExtrude as EExtrude17,
|
|
7309
|
+
EBVolume as EBVolume17,
|
|
7310
|
+
initGeom as initGeom21
|
|
5967
7311
|
} from "geometrix";
|
|
5968
|
-
var
|
|
7312
|
+
var pDef21 = {
|
|
5969
7313
|
partName: "capsule",
|
|
5970
7314
|
params: [
|
|
5971
7315
|
//pNumber(name, unit, init, min, max, step)
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
7316
|
+
pNumber21("L1", "mm", 5e3, 1e3, 2e4, 1),
|
|
7317
|
+
pNumber21("WW1", "mm", 1800, 100, 4e3, 1),
|
|
7318
|
+
pNumber21("E1", "mm", 10, 1, 100, 1),
|
|
7319
|
+
pSectionSeparator21("Nose"),
|
|
7320
|
+
pNumber21("H1", "mm", 300, 10, 4e3, 1),
|
|
7321
|
+
pNumber21("H2", "mm", 500, 10, 4e3, 1),
|
|
7322
|
+
pNumber21("H3", "mm", 1200, 10, 4e3, 1),
|
|
7323
|
+
pNumber21("W1", "mm", 300, 10, 4e3, 1),
|
|
7324
|
+
pNumber21("W3", "mm", 1500, 10, 4e3, 1),
|
|
7325
|
+
pNumber21("C3", "mm", 200, 1, 1e3, 1),
|
|
7326
|
+
pNumber21("R1", "mm", 100, 0, 500, 1),
|
|
7327
|
+
pNumber21("R2", "mm", 100, 0, 500, 1),
|
|
7328
|
+
pNumber21("R3", "mm", 100, 0, 500, 1),
|
|
7329
|
+
pNumber21("R4", "mm", 100, 0, 500, 1),
|
|
7330
|
+
pSectionSeparator21("Wheels"),
|
|
7331
|
+
pNumber21("H0", "mm", 600, 100, 2e3, 1),
|
|
7332
|
+
pNumber21("D7", "mm", 500, 10, 2e3, 1),
|
|
7333
|
+
pNumber21("D8", "mm", 100, 10, 2e3, 1),
|
|
7334
|
+
pNumber21("WW2", "mm", 1e3, 100, 4e3, 1),
|
|
7335
|
+
pNumber21("WW3", "mm", 100, 1, 500, 1),
|
|
7336
|
+
pSectionSeparator21("Wheels details"),
|
|
7337
|
+
pNumber21("W6", "mm", 500, 10, 2e3, 1),
|
|
7338
|
+
pNumber21("W7", "mm", 600, 10, 2e3, 1),
|
|
7339
|
+
pNumber21("W8", "mm", 300, 10, 2e3, 1),
|
|
7340
|
+
pNumber21("H6", "mm", 300, 10, 2e3, 1),
|
|
7341
|
+
pSectionSeparator21("Front window"),
|
|
7342
|
+
pNumber21("FH1", "mm", 600, 10, 3e3, 1),
|
|
7343
|
+
pNumber21("FW1", "mm", 100, 10, 3e3, 1),
|
|
7344
|
+
pNumber21("FR1", "mm", 100, 0, 500, 1),
|
|
7345
|
+
pNumber21("FH3", "mm", 100, 10, 3e3, 1),
|
|
7346
|
+
pNumber21("FW3", "mm", 300, 10, 3e3, 1),
|
|
7347
|
+
pNumber21("FR3", "mm", 100, 0, 500, 1),
|
|
7348
|
+
pSectionSeparator21("Top"),
|
|
6005
7349
|
pDropdown9("topStyle", ["mirador", "sky", "roof"]),
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
7350
|
+
pNumber21("H5", "mm", 300, 10, 2e3, 1),
|
|
7351
|
+
pNumber21("W4", "mm", 500, 10, 5e3, 1),
|
|
7352
|
+
pNumber21("W5", "mm", 1e3, 10, 5e3, 1),
|
|
7353
|
+
pNumber21("R5", "mm", 50, 1, 500, 1),
|
|
7354
|
+
pNumber21("S5", "mm", 200, 10, 500, 1),
|
|
7355
|
+
pSectionSeparator21("Wall"),
|
|
7356
|
+
pCheckbox12("sideWall", true),
|
|
7357
|
+
pNumber21("U1", "mm", 100, 10, 1e3, 1),
|
|
7358
|
+
pNumber21("U2", "mm", 500, 10, 3e3, 1),
|
|
7359
|
+
pNumber21("U3", "mm", 400, 10, 3e3, 1),
|
|
7360
|
+
pNumber21("V1", "mm", 600, 10, 3e3, 1),
|
|
7361
|
+
pNumber21("V2", "mm", 400, 10, 3e3, 1),
|
|
7362
|
+
pNumber21("JR1", "mm", 100, 0, 2e3, 1),
|
|
7363
|
+
pNumber21("JR2", "mm", 100, 0, 2e3, 1),
|
|
7364
|
+
pNumber21("JR3", "mm", 100, 0, 2e3, 1),
|
|
7365
|
+
pNumber21("JR4", "mm", 100, 0, 2e3, 1),
|
|
7366
|
+
pNumber21("JR5", "mm", 100, 0, 2e3, 1),
|
|
7367
|
+
pNumber21("JR6", "mm", 100, 0, 2e3, 1)
|
|
6024
7368
|
],
|
|
6025
7369
|
paramSvg: {
|
|
6026
7370
|
L1: "capsule_side.svg",
|
|
@@ -6077,21 +7421,21 @@ var pDef18 = {
|
|
|
6077
7421
|
// every 0.5 second
|
|
6078
7422
|
}
|
|
6079
7423
|
};
|
|
6080
|
-
function
|
|
6081
|
-
const rGeome =
|
|
6082
|
-
const figBody =
|
|
6083
|
-
const figWheels =
|
|
6084
|
-
const figFront =
|
|
6085
|
-
const figTop =
|
|
6086
|
-
const figTopInt =
|
|
6087
|
-
const figTopTop =
|
|
6088
|
-
const figTopLeg =
|
|
6089
|
-
const figWall =
|
|
7424
|
+
function pGeom21(t, param, suffix = "") {
|
|
7425
|
+
const rGeome = initGeom21(pDef21.partName + suffix);
|
|
7426
|
+
const figBody = figure18();
|
|
7427
|
+
const figWheels = figure18();
|
|
7428
|
+
const figFront = figure18();
|
|
7429
|
+
const figTop = figure18();
|
|
7430
|
+
const figTopInt = figure18();
|
|
7431
|
+
const figTopTop = figure18();
|
|
7432
|
+
const figTopLeg = figure18();
|
|
7433
|
+
const figWall = figure18();
|
|
6090
7434
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
6091
7435
|
`;
|
|
6092
7436
|
try {
|
|
6093
7437
|
let ctrBody2 = function(withBat) {
|
|
6094
|
-
const rCtr =
|
|
7438
|
+
const rCtr = contour21(-L12, param.H0);
|
|
6095
7439
|
if (withBat) {
|
|
6096
7440
|
rCtr.addSegStrokeR(Wwheels, 0).addSegStrokeR(0, -Hbatterie).addSegStrokeR(Lbatterie, 0).addSegStrokeR(0, Hbatterie).addSegStrokeR(Wwheels, 0);
|
|
6097
7441
|
} else {
|
|
@@ -6100,21 +7444,21 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6100
7444
|
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);
|
|
6101
7445
|
return rCtr;
|
|
6102
7446
|
}, ctrWheels2 = function(sign) {
|
|
6103
|
-
const rCtr =
|
|
7447
|
+
const rCtr = contour21(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();
|
|
6104
7448
|
return rCtr;
|
|
6105
7449
|
}, makeCtrTop2 = function(radius) {
|
|
6106
|
-
const rCtr =
|
|
7450
|
+
const rCtr = contour21(-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();
|
|
6107
7451
|
return rCtr;
|
|
6108
7452
|
}, ctrSideWindow2 = function(sign) {
|
|
6109
7453
|
const p0x = sign * (Ltotal / 2 - param.U1);
|
|
6110
7454
|
const p0y = param.H0 + param.H1 + param.H2 - UH2dy;
|
|
6111
|
-
const rCtr =
|
|
7455
|
+
const rCtr = contour21(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();
|
|
6112
7456
|
return rCtr;
|
|
6113
7457
|
}, volWheel2 = function(posX, idx) {
|
|
6114
7458
|
return {
|
|
6115
7459
|
outName: `subpax_${designName}_wheel${idx}`,
|
|
6116
7460
|
face: `${designName}_faceWheels`,
|
|
6117
|
-
extrudeMethod:
|
|
7461
|
+
extrudeMethod: EExtrude17.eRotate,
|
|
6118
7462
|
rotate: [0, 0, 0],
|
|
6119
7463
|
translate: [posX, R7, 0]
|
|
6120
7464
|
};
|
|
@@ -6122,7 +7466,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6122
7466
|
return {
|
|
6123
7467
|
outName: `subpax_${designName}_topLeg${idx}`,
|
|
6124
7468
|
face: `${designName}_faceTopLeg`,
|
|
6125
|
-
extrudeMethod:
|
|
7469
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6126
7470
|
length: E1,
|
|
6127
7471
|
rotate: [0, rotY, 0],
|
|
6128
7472
|
translate: [posX, 0, posZ]
|
|
@@ -6139,9 +7483,9 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6139
7483
|
const Lbatterie = param.L1 - 2 * Wwheels;
|
|
6140
7484
|
const Lroof = param.L1 + 2 * param.W1 - 2 * param.W3;
|
|
6141
7485
|
const aN1 = Math.atan2(param.H3, -param.W3);
|
|
6142
|
-
const p1 =
|
|
7486
|
+
const p1 = point11(0, 0).translate(-param.W3 / 2, param.H3 / 2).translatePolar(aN1 - pi2, param.C3);
|
|
6143
7487
|
const aN2 = Math.atan2(-param.H3, -param.W3);
|
|
6144
|
-
const p2 =
|
|
7488
|
+
const p2 = point11(0, 0).translate(-param.W3 / 2, -param.H3 / 2).translatePolar(aN2 - pi2, param.C3);
|
|
6145
7489
|
const aN3 = Math.atan2(param.H1, -param.W1);
|
|
6146
7490
|
const L1dx = E1 / Math.tan(aN3 / 2);
|
|
6147
7491
|
const H2dy = E1 / Math.tan((3 * pi2 - aN3) / 2);
|
|
@@ -6150,8 +7494,8 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6150
7494
|
const W3dx = E1 / Math.tan((3 * pi2 - aN4) / 2);
|
|
6151
7495
|
const W3b = param.W3 - E1 + W3dx;
|
|
6152
7496
|
const H3b = param.H3 - E1 + H3dy;
|
|
6153
|
-
const p1b =
|
|
6154
|
-
const p2b =
|
|
7497
|
+
const p1b = point11(0, 0).translate(-W3b / 2, H3b / 2).translatePolar(aN1 - pi2, param.C3);
|
|
7498
|
+
const p2b = point11(0, 0).translate(-W3b / 2, -H3b / 2).translatePolar(aN2 - pi2, param.C3);
|
|
6155
7499
|
const iR1 = Math.max(0, param.R1 - E1);
|
|
6156
7500
|
const iR2 = Math.max(0, param.R2 - E1);
|
|
6157
7501
|
const iR3 = Math.max(0, param.R3 - E1);
|
|
@@ -6159,7 +7503,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6159
7503
|
const UH2dy = param.U1 / Math.tan((3 * pi2 - aN3) / 2);
|
|
6160
7504
|
const UW3b = param.W3 - param.U1 + param.U1 / Math.tan((3 * pi2 - aN4) / 2);
|
|
6161
7505
|
const UH3b = param.H3 - param.U1 + param.U1 / Math.tan(aN4 / 2);
|
|
6162
|
-
const p1ub =
|
|
7506
|
+
const p1ub = point11(0, 0).translate(-UW3b / 2, UH3b / 2).translatePolar(aN1 - pi2, param.C3);
|
|
6163
7507
|
const Ltotal = param.L1 + 2 * param.W1;
|
|
6164
7508
|
const Htotal = param.H1 + param.H2 + param.H3;
|
|
6165
7509
|
const LwallDoor = Ltotal - 2 * (param.U1 + UW3b + param.U2 + param.U3);
|
|
@@ -6194,62 +7538,62 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6194
7538
|
const HfrontWin = Htotal - param.FH1 - param.FH3;
|
|
6195
7539
|
const Ltot2 = Ltotal + 200;
|
|
6196
7540
|
if (param.L1 - 2 * Wwheels < 2 * E1) {
|
|
6197
|
-
throw `err176: L1 ${
|
|
7541
|
+
throw `err176: L1 ${ffix22(param.L1)} is too small compare to W6 ${ffix22(param.W6)}, W7 ${ffix22(param.W7)} and W8 ${ffix22(param.W8)} mm`;
|
|
6198
7542
|
}
|
|
6199
7543
|
if (Hbatterie < E1) {
|
|
6200
|
-
throw `err114: Hbatterie ${
|
|
7544
|
+
throw `err114: Hbatterie ${ffix22(Hbatterie)} is too small compare to E1 ${ffix22(E1)} mm`;
|
|
6201
7545
|
}
|
|
6202
7546
|
if (Lbatterie < 2 * E1) {
|
|
6203
|
-
throw `err118: Lbatterie ${
|
|
7547
|
+
throw `err118: Lbatterie ${ffix22(Lbatterie)} is too small compare to E1 ${ffix22(E1)} mm`;
|
|
6204
7548
|
}
|
|
6205
7549
|
if (L5 < 3 * param.R5 + param.W5) {
|
|
6206
|
-
throw `err122: L5 ${
|
|
7550
|
+
throw `err122: L5 ${ffix22(L5)} is too small compare to W5 ${ffix22(param.W5)} and R5 ${ffix22(param.R5)} mm`;
|
|
6207
7551
|
}
|
|
6208
7552
|
if (H53 < 0.1) {
|
|
6209
|
-
throw `err220: H5 ${
|
|
7553
|
+
throw `err220: H5 ${ffix22(param.H5)} is too small compare to R5 ${ffix22(param.R5)} mm`;
|
|
6210
7554
|
}
|
|
6211
|
-
rGeome.logstr += `Platform surface: ${
|
|
7555
|
+
rGeome.logstr += `Platform surface: ${ffix22(platSurface)} m2, height: ${ffix22(heightTot / 1e3)} m
|
|
6212
7556
|
`;
|
|
6213
|
-
rGeome.logstr += `Lroof: ${
|
|
7557
|
+
rGeome.logstr += `Lroof: ${ffix22(Lroof)}, L5: ${ffix22(L5)} mm
|
|
6214
7558
|
`;
|
|
6215
|
-
rGeome.logstr += `Ltotal: ${
|
|
7559
|
+
rGeome.logstr += `Ltotal: ${ffix22(Ltotal / 1e3)}, Htotal: ${ffix22(Htotal / 1e3)} m
|
|
6216
7560
|
`;
|
|
6217
|
-
rGeome.logstr += `Batterie: LbatInt ${
|
|
7561
|
+
rGeome.logstr += `Batterie: LbatInt ${ffix22(LbatInt)}, HbatInt: ${ffix22(HbatInt)}, WW1 ${ffix22(param.WW1)} mm
|
|
6218
7562
|
`;
|
|
6219
7563
|
const ctrBodyExt = ctrBody2(true);
|
|
6220
|
-
const ctrBodyInt =
|
|
6221
|
-
const ctrBatterie =
|
|
7564
|
+
const ctrBodyInt = contour21(-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);
|
|
7565
|
+
const ctrBatterie = ctrRectangle10(-LbatInt2, posYbatterie, LbatInt, HbatInt);
|
|
6222
7566
|
figBody.addMainOI([ctrBodyExt, ctrBodyInt, ctrBatterie]);
|
|
6223
|
-
figBody.addSecond(
|
|
6224
|
-
figBody.addSecond(
|
|
6225
|
-
figBody.addSecond(
|
|
6226
|
-
figBody.addSecond(
|
|
6227
|
-
figBody.addSecond(
|
|
6228
|
-
figBody.addSecond(
|
|
6229
|
-
figBody.addSecond(
|
|
6230
|
-
figBody.addSecond(
|
|
6231
|
-
figBody.addSecond(
|
|
6232
|
-
figBody.addSecond(
|
|
7567
|
+
figBody.addSecond(contourCircle18(-posXwheel1, R7, R7));
|
|
7568
|
+
figBody.addSecond(contourCircle18(-posXwheel1, R7, R8));
|
|
7569
|
+
figBody.addSecond(contourCircle18(-posXwheel2, R7, R7));
|
|
7570
|
+
figBody.addSecond(contourCircle18(-posXwheel2, R7, R8));
|
|
7571
|
+
figBody.addSecond(contourCircle18(posXwheel1, R7, R7));
|
|
7572
|
+
figBody.addSecond(contourCircle18(posXwheel1, R7, R8));
|
|
7573
|
+
figBody.addSecond(contourCircle18(posXwheel2, R7, R7));
|
|
7574
|
+
figBody.addSecond(contourCircle18(posXwheel2, R7, R8));
|
|
7575
|
+
figBody.addSecond(ctrRectangle10(-L52, posYtop, L5, param.H5));
|
|
7576
|
+
figBody.addSecond(ctrRectangle10(-L52 - param.S5, posYtop2, L5 + 2 * param.S5, E1));
|
|
6233
7577
|
figWheels.addMainO(ctrWheels2(1));
|
|
6234
7578
|
figWheels.addSecond(ctrWheels2(-1));
|
|
6235
|
-
const ctrFront =
|
|
7579
|
+
const ctrFront = contour21(-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();
|
|
6236
7580
|
figFront.addMainO(ctrFront);
|
|
6237
7581
|
figFront.addSecond(ctrWheels2(1).rotate(0, 0, pi2).translate(WW12, R7));
|
|
6238
7582
|
figFront.addSecond(ctrWheels2(-1).rotate(0, 0, pi2).translate(WW12, R7));
|
|
6239
|
-
figFront.addSecond(
|
|
6240
|
-
figFront.addSecond(
|
|
6241
|
-
figFront.addSecond(
|
|
6242
|
-
figFront.addSecond(
|
|
6243
|
-
figFront.addSecond(
|
|
6244
|
-
figFront.addSecond(
|
|
6245
|
-
figFront.addSecond(
|
|
7583
|
+
figFront.addSecond(ctrRectangle10(-WW12, param.H6, param.WW1, Hbatterie));
|
|
7584
|
+
figFront.addSecond(ctrRectangle10(-WW12, param.H0, param.WW1, param.H1));
|
|
7585
|
+
figFront.addSecond(ctrRectangle10(-WW12, param.H0 + param.H1, param.WW1, param.H2));
|
|
7586
|
+
figFront.addSecond(ctrRectangle10(-WW12, posYH3, param.WW1, param.H3));
|
|
7587
|
+
figFront.addSecond(ctrRectangle10(-W52, posYtop, param.W5, param.H5));
|
|
7588
|
+
figFront.addSecond(ctrRectangle10(-W52 - param.S5, posYtop2, param.W5 + 2 * param.S5, E1));
|
|
7589
|
+
figFront.addSecond(ctrRectangle10(-WW12 + E1, param.H0 + E1, param.WW1 - E12, Htotal - E12));
|
|
6246
7590
|
const ctrTopInt = makeCtrTop2(topR - E1);
|
|
6247
7591
|
const ctrTopExt = makeCtrTop2(topR);
|
|
6248
7592
|
const ctrTopTop = makeCtrTop2(topR + param.S5);
|
|
6249
7593
|
figTop.addMainOI([ctrTopExt, ctrTopInt]);
|
|
6250
7594
|
figTop.addSecond(ctrTopTop);
|
|
6251
|
-
figTop.addSecond(
|
|
6252
|
-
figTop.addSecond(
|
|
7595
|
+
figTop.addSecond(ctrRectangle10(-Lroof / 2, -WW12, Lroof, 2 * WW12));
|
|
7596
|
+
figTop.addSecond(ctrRectangle10(-Ltotal / 2, -WW12, Ltotal, 2 * WW12));
|
|
6253
7597
|
figTop.addSecond(ctrWheels2(1).translate(posXwheels[0], posYwheels2));
|
|
6254
7598
|
figTop.addSecond(ctrWheels2(1).translate(posXwheels[1], posYwheels2));
|
|
6255
7599
|
figTop.addSecond(ctrWheels2(1).translate(posXwheels[2], posYwheels2));
|
|
@@ -6262,10 +7606,10 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6262
7606
|
figTopInt.mergeFigure(figTop, true);
|
|
6263
7607
|
figTopTop.addMainO(ctrTopTop);
|
|
6264
7608
|
figTopTop.mergeFigure(figTop, true);
|
|
6265
|
-
const ctrTopLeg =
|
|
7609
|
+
const ctrTopLeg = contour21(-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();
|
|
6266
7610
|
figTopLeg.addMainO(ctrTopLeg);
|
|
6267
7611
|
figFront.addSecond(ctrTopLeg);
|
|
6268
|
-
const ctrDoor =
|
|
7612
|
+
const ctrDoor = contour21(-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();
|
|
6269
7613
|
figWall.addMainOI([ctrBody2(false), ctrSideWindow2(1), ctrSideWindow2(-1), ctrDoor]);
|
|
6270
7614
|
figWall.mergeFigure(figBody, true);
|
|
6271
7615
|
rGeome.fig = {
|
|
@@ -6308,7 +7652,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6308
7652
|
{
|
|
6309
7653
|
outName: `subpax_${designName}_body`,
|
|
6310
7654
|
face: `${designName}_faceBody`,
|
|
6311
|
-
extrudeMethod:
|
|
7655
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6312
7656
|
length: param.WW1,
|
|
6313
7657
|
rotate: [0, 0, 0],
|
|
6314
7658
|
translate: [0, 0, 0]
|
|
@@ -6320,7 +7664,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6320
7664
|
{
|
|
6321
7665
|
outName: `subpax_${designName}_frontWin`,
|
|
6322
7666
|
face: `${designName}_faceFront`,
|
|
6323
|
-
extrudeMethod:
|
|
7667
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6324
7668
|
length: Ltot2,
|
|
6325
7669
|
rotate: [0, pi2, 0],
|
|
6326
7670
|
translate: [-Ltot2 / 2, 0, WW12]
|
|
@@ -6328,7 +7672,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6328
7672
|
{
|
|
6329
7673
|
outName: `subpax_${designName}_topInt`,
|
|
6330
7674
|
face: `${designName}_faceTopInt`,
|
|
6331
|
-
extrudeMethod:
|
|
7675
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6332
7676
|
length: 3 * E1,
|
|
6333
7677
|
rotate: [-pi2, 0, 0],
|
|
6334
7678
|
translate: [0, posYtop - 2 * E1, WW12]
|
|
@@ -6336,7 +7680,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6336
7680
|
{
|
|
6337
7681
|
outName: `subpax_${designName}_top1`,
|
|
6338
7682
|
face: `${designName}_faceTop`,
|
|
6339
|
-
extrudeMethod:
|
|
7683
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6340
7684
|
length: param.R5,
|
|
6341
7685
|
rotate: [-pi2, 0, 0],
|
|
6342
7686
|
translate: [0, posYtop, WW12]
|
|
@@ -6344,7 +7688,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6344
7688
|
{
|
|
6345
7689
|
outName: `subpax_${designName}_top2`,
|
|
6346
7690
|
face: `${designName}_faceTop`,
|
|
6347
|
-
extrudeMethod:
|
|
7691
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6348
7692
|
length: param.R5,
|
|
6349
7693
|
rotate: [-pi2, 0, 0],
|
|
6350
7694
|
translate: [0, posYtop2 - param.R5, WW12]
|
|
@@ -6352,7 +7696,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6352
7696
|
{
|
|
6353
7697
|
outName: `subpax_${designName}_topTop`,
|
|
6354
7698
|
face: `${designName}_faceTopTop`,
|
|
6355
|
-
extrudeMethod:
|
|
7699
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6356
7700
|
length: E1,
|
|
6357
7701
|
rotate: [-pi2, 0, 0],
|
|
6358
7702
|
translate: [0, posYtop2, WW12]
|
|
@@ -6366,7 +7710,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6366
7710
|
{
|
|
6367
7711
|
outName: `subpax_${designName}_wall1`,
|
|
6368
7712
|
face: `${designName}_faceWall`,
|
|
6369
|
-
extrudeMethod:
|
|
7713
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6370
7714
|
length: E1,
|
|
6371
7715
|
rotate: [0, 0, 0],
|
|
6372
7716
|
translate: [0, 0, 0]
|
|
@@ -6374,7 +7718,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6374
7718
|
{
|
|
6375
7719
|
outName: `subpax_${designName}_wall2`,
|
|
6376
7720
|
face: `${designName}_faceWall`,
|
|
6377
|
-
extrudeMethod:
|
|
7721
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6378
7722
|
length: E1,
|
|
6379
7723
|
rotate: [0, 0, 0],
|
|
6380
7724
|
translate: [0, 0, param.WW1 - E1]
|
|
@@ -6383,7 +7727,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6383
7727
|
volumes: [
|
|
6384
7728
|
{
|
|
6385
7729
|
outName: `ipax_${designName}_plus`,
|
|
6386
|
-
boolMethod:
|
|
7730
|
+
boolMethod: EBVolume17.eUnion,
|
|
6387
7731
|
inList: [
|
|
6388
7732
|
`subpax_${designName}_body`,
|
|
6389
7733
|
`subpax_${designName}_wheel1`,
|
|
@@ -6396,12 +7740,12 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6396
7740
|
},
|
|
6397
7741
|
{
|
|
6398
7742
|
outName: `ipax_${designName}_minus`,
|
|
6399
|
-
boolMethod:
|
|
7743
|
+
boolMethod: EBVolume17.eUnion,
|
|
6400
7744
|
inList: [`subpax_${designName}_frontWin`, ...roofHoleList]
|
|
6401
7745
|
},
|
|
6402
7746
|
{
|
|
6403
7747
|
outName: `pax_${designName}`,
|
|
6404
|
-
boolMethod:
|
|
7748
|
+
boolMethod: EBVolume17.eSubstraction,
|
|
6405
7749
|
inList: [`ipax_${designName}_plus`, `ipax_${designName}_minus`]
|
|
6406
7750
|
}
|
|
6407
7751
|
]
|
|
@@ -6418,31 +7762,321 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6418
7762
|
var capsuleDef = {
|
|
6419
7763
|
pTitle: "capsule",
|
|
6420
7764
|
pDescription: "high-level concept of the train-capsule",
|
|
6421
|
-
pDef:
|
|
6422
|
-
pGeom:
|
|
7765
|
+
pDef: pDef21,
|
|
7766
|
+
pGeom: pGeom21
|
|
7767
|
+
};
|
|
7768
|
+
|
|
7769
|
+
// src/capsule/tunnel.ts
|
|
7770
|
+
import {
|
|
7771
|
+
point as point12,
|
|
7772
|
+
contour as contour22,
|
|
7773
|
+
contourCircle as contourCircle19,
|
|
7774
|
+
ctrRectangle as ctrRectangle11,
|
|
7775
|
+
figure as figure19,
|
|
7776
|
+
degToRad as degToRad10,
|
|
7777
|
+
ffix as ffix23,
|
|
7778
|
+
pNumber as pNumber22,
|
|
7779
|
+
pSectionSeparator as pSectionSeparator22,
|
|
7780
|
+
EExtrude as EExtrude18,
|
|
7781
|
+
EBVolume as EBVolume18,
|
|
7782
|
+
initGeom as initGeom22
|
|
7783
|
+
} from "geometrix";
|
|
7784
|
+
var pDef22 = {
|
|
7785
|
+
partName: "tunnel",
|
|
7786
|
+
params: [
|
|
7787
|
+
//pNumber(name, unit, init, min, max, step)
|
|
7788
|
+
pNumber22("W1", "mm", 2e3, 500, 1e4, 10),
|
|
7789
|
+
pNumber22("H1", "mm", 4e3, 500, 1e4, 10),
|
|
7790
|
+
pNumber22("a1", "degree", 75, 45, 100, 1),
|
|
7791
|
+
pSectionSeparator22("Stone"),
|
|
7792
|
+
pNumber22("T1", "mm", 400, 100, 1e3, 1),
|
|
7793
|
+
pNumber22("T2", "mm", 200, 100, 1e3, 1),
|
|
7794
|
+
pNumber22("T3Max", "mm", 400, 100, 1e3, 1),
|
|
7795
|
+
pNumber22("E1", "mm", 5, 0, 50, 1)
|
|
7796
|
+
],
|
|
7797
|
+
paramSvg: {
|
|
7798
|
+
W1: "tunnel_profile.svg",
|
|
7799
|
+
H1: "tunnel_profile.svg",
|
|
7800
|
+
a1: "tunnel_profile.svg",
|
|
7801
|
+
T1: "tunnel_profile.svg",
|
|
7802
|
+
T2: "tunnel_profile.svg",
|
|
7803
|
+
T3Max: "tunnel_profile.svg",
|
|
7804
|
+
E1: "tunnel_profile.svg"
|
|
7805
|
+
},
|
|
7806
|
+
sim: {
|
|
7807
|
+
tMax: 180,
|
|
7808
|
+
tStep: 0.5,
|
|
7809
|
+
tUpdate: 500
|
|
7810
|
+
// every 0.5 second
|
|
7811
|
+
}
|
|
7812
|
+
};
|
|
7813
|
+
function pGeom22(t, param, suffix = "") {
|
|
7814
|
+
const rGeome = initGeom22(pDef22.partName + suffix);
|
|
7815
|
+
const figProfile = figure19();
|
|
7816
|
+
const figSlice = figure19();
|
|
7817
|
+
const figStoneA = figure19();
|
|
7818
|
+
const figStoneB = figure19();
|
|
7819
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
7820
|
+
`;
|
|
7821
|
+
try {
|
|
7822
|
+
let calc2 = function(iW12, iH1) {
|
|
7823
|
+
const kA = iW12 * (1 + cos) / sin;
|
|
7824
|
+
const kB = sin ** 2 / (1 + cos);
|
|
7825
|
+
const H2 = (iH1 - kA) * kB;
|
|
7826
|
+
const R1 = (iW12 * sin + H2 * cos) / sin ** 2;
|
|
7827
|
+
const BC = R1 * cos;
|
|
7828
|
+
const AD = H2 / Math.tan(a1);
|
|
7829
|
+
return [H2, R1, BC, AD];
|
|
7830
|
+
}, ctrGroundStone2 = function(iX, iL, iRnL) {
|
|
7831
|
+
const x1 = iX + iRnL * e12;
|
|
7832
|
+
let x2 = x1 + iRnL * (iL - e1);
|
|
7833
|
+
let lastGround = false;
|
|
7834
|
+
if (Math.abs(x2) > x2Max) {
|
|
7835
|
+
x2 = iRnL * x2Max;
|
|
7836
|
+
lastGround = true;
|
|
7837
|
+
}
|
|
7838
|
+
const y1 = Math.min(0, -(iRnL * x1 - W12) * tan);
|
|
7839
|
+
const y2 = Math.min(0, -(iRnL * x2 - W12) * tan);
|
|
7840
|
+
const rCtr = contour22(x1, -T1);
|
|
7841
|
+
if (lastGround) {
|
|
7842
|
+
rCtr.addSegStrokeA(iRnL * W12e, -T1).addSegStrokeA(x2, y2);
|
|
7843
|
+
} else {
|
|
7844
|
+
rCtr.addSegStrokeA(x2, -T1).addSegStrokeA(x2, y2);
|
|
7845
|
+
}
|
|
7846
|
+
if (Math.abs(x1) < W12 && Math.abs(x2) > W12) {
|
|
7847
|
+
rCtr.addSegStrokeA(iRnL * W12, 0);
|
|
7848
|
+
}
|
|
7849
|
+
rCtr.addSegStrokeA(x1, y1).closeSegStroke();
|
|
7850
|
+
return rCtr;
|
|
7851
|
+
}, ctrSideStone2 = function(iD, iL, iRnL) {
|
|
7852
|
+
const aa1 = iRnL === 1 ? a1 : Math.PI - a1;
|
|
7853
|
+
const pt = point12(iRnL * W12, 0).translatePolar(aa1, iD + e12);
|
|
7854
|
+
const rCtr = contour22(pt.cx, pt.cy).addSegStrokeRP(aa1 - iRnL * pi2, T1).addSegStrokeRP(aa1, iL - e1).addSegStrokeRP(aa1 + iRnL * pi2, T1).closeSegStroke();
|
|
7855
|
+
return rCtr;
|
|
7856
|
+
}, ctrCeilingStone2 = function(iD, iL, iRnL) {
|
|
7857
|
+
const a2 = -pi2 + iRnL * (a1 + iD / R1e);
|
|
7858
|
+
const a3 = a2 + iRnL * iL / R1e;
|
|
7859
|
+
const pt1 = point12(0, ccy).translatePolar(a2, R1i).translatePolar(a2 + iRnL * pi2, e12);
|
|
7860
|
+
const pt2 = pt1.translatePolar(a2, T1);
|
|
7861
|
+
const pt4 = point12(0, ccy).translatePolar(a3, R1i).translatePolar(a3 - iRnL * pi2, e12);
|
|
7862
|
+
const pt3 = pt4.translatePolar(a3, T1);
|
|
7863
|
+
const rCtr = contour22(pt1.cx, pt1.cy).addSegStrokeA(pt2.cx, pt2.cy).addSegStrokeA(pt3.cx, pt3.cy).addSegStrokeA(pt4.cx, pt4.cy).closeSegStroke();
|
|
7864
|
+
return rCtr;
|
|
7865
|
+
};
|
|
7866
|
+
var calc = calc2, ctrGroundStone = ctrGroundStone2, ctrSideStone = ctrSideStone2, ctrCeilingStone = ctrCeilingStone2;
|
|
7867
|
+
const pi2 = Math.PI / 2;
|
|
7868
|
+
const W12 = param.W1 / 2;
|
|
7869
|
+
const a1 = degToRad10(param.a1);
|
|
7870
|
+
const sin = Math.sin(a1);
|
|
7871
|
+
const cos = Math.cos(a1);
|
|
7872
|
+
const tan = Math.tan(pi2 - a1);
|
|
7873
|
+
const [H2i, R1i, BCi, ADi] = calc2(W12, param.H1);
|
|
7874
|
+
const ccy = H2i + BCi;
|
|
7875
|
+
const H1ib = ccy + R1i;
|
|
7876
|
+
const fsox = param.T2 + param.E1;
|
|
7877
|
+
const W12e = W12 + param.T1 * Math.tan(a1 / 2);
|
|
7878
|
+
const H1e = param.H1 + 2 * param.T1;
|
|
7879
|
+
const [H2e, R1e, BCe, ADe] = calc2(W12e, H1e);
|
|
7880
|
+
const H1eb = H2e + BCe + R1e;
|
|
7881
|
+
const e1 = param.E1;
|
|
7882
|
+
const e12 = e1 / 2;
|
|
7883
|
+
const T1 = param.T1;
|
|
7884
|
+
const T3 = param.T3Max;
|
|
7885
|
+
const x2Max = W12e + (T1 - (W12e - W12) * tan) / (tan + Math.tan(a1));
|
|
7886
|
+
const ABgFirstDx = T1 / Math.tan(a1);
|
|
7887
|
+
const AgStart = W12e + ABgFirstDx;
|
|
7888
|
+
const AgN = Math.floor(AgStart / T3);
|
|
7889
|
+
const AgLast = AgStart - AgN * T3;
|
|
7890
|
+
const BgStart = W12e + ABgFirstDx - T3 / 2;
|
|
7891
|
+
const BgN = Math.floor(BgStart / T3);
|
|
7892
|
+
const BgLast = BgStart - BgN * T3;
|
|
7893
|
+
const ABsLength = H2i / sin;
|
|
7894
|
+
const AsLength = ABsLength - T3 / 2;
|
|
7895
|
+
const AsN = Math.floor(AsLength / T3);
|
|
7896
|
+
const AsLast = AsLength - AsN * T3;
|
|
7897
|
+
const BsN = Math.floor(ABsLength / T3);
|
|
7898
|
+
const BsLast = ABsLength - BsN * T3;
|
|
7899
|
+
const ABcLength = R1e * (Math.PI - a1);
|
|
7900
|
+
const AcN = Math.floor(ABcLength / T3);
|
|
7901
|
+
const AcLast = ABcLength - AcN * T3;
|
|
7902
|
+
const BcLength = ABcLength - T3 / 2;
|
|
7903
|
+
const BcN = Math.floor(BcLength / T3);
|
|
7904
|
+
const BcLast = BcLength - BcN * T3;
|
|
7905
|
+
const surf1 = R1i ** 2 * (Math.PI - a1);
|
|
7906
|
+
const surf2 = ccy * R1i * sin;
|
|
7907
|
+
const surf3 = W12 * H2i;
|
|
7908
|
+
const surfaceM2 = (surf1 + surf2 + surf3) * 10 ** -6;
|
|
7909
|
+
if (Math.abs(param.H1 - H1ib) > 0.1) {
|
|
7910
|
+
throw `err086: H1 ${ffix23(param.H1)} and H1ib ${ffix23(H1ib)} are not equal`;
|
|
7911
|
+
}
|
|
7912
|
+
if (Math.abs(H1e - H1eb) > 0.1) {
|
|
7913
|
+
throw `err102: H1e ${ffix23(H1e)} and H1eb ${ffix23(H1eb)} are not equal`;
|
|
7914
|
+
}
|
|
7915
|
+
if (Math.abs(H2e + BCe - param.T1 - ccy) > 0.1) {
|
|
7916
|
+
throw `err106: H2e ${ffix23(H2e)} and BCe ${ffix23(BCe)} not match the other circle center`;
|
|
7917
|
+
}
|
|
7918
|
+
rGeome.logstr += `Surface ${ffix23(surfaceM2)} m2
|
|
7919
|
+
`;
|
|
7920
|
+
rGeome.logstr += `dbg131: AsN ${ffix23(AsN)} stones
|
|
7921
|
+
`;
|
|
7922
|
+
const ctrProfileI = contour22(-W12, 0).addSegStrokeR(2 * W12, 0).addSegStrokeR(ADi, H2i).addPointR(-ADi - W12, BCi + R1i).addPointR(-2 * (ADi + W12), 0).addSegArc2().closeSegStroke();
|
|
7923
|
+
const ctrProfileE = contour22(-W12e, -param.T1).addSegStrokeR(2 * W12e, 0).addSegStrokeR(ADe, H2e).addPointR(-ADe - W12e, BCe + R1e).addPointR(-2 * (ADe + W12e), 0).addSegArc2().closeSegStroke();
|
|
7924
|
+
figProfile.addMainOI([ctrProfileE, ctrProfileI]);
|
|
7925
|
+
figProfile.addSecond(contourCircle19(0, ccy, R1i));
|
|
7926
|
+
figSlice.addMainOI([
|
|
7927
|
+
ctrRectangle11(0, -param.T1, param.T2, param.H1 + 2 * param.T1),
|
|
7928
|
+
ctrRectangle11(0, 0, param.T2, param.H1)
|
|
7929
|
+
]);
|
|
7930
|
+
figSlice.addMainOI([
|
|
7931
|
+
ctrRectangle11(fsox, -param.T1, param.T2, param.H1 + 2 * param.T1),
|
|
7932
|
+
ctrRectangle11(fsox, 0, param.T2, param.H1)
|
|
7933
|
+
]);
|
|
7934
|
+
for (let ii = 0; ii < AgN; ii++) {
|
|
7935
|
+
const ox = AgLast + ii * T3;
|
|
7936
|
+
figStoneA.addMainO(ctrGroundStone2(ox, T3, 1));
|
|
7937
|
+
figStoneA.addMainO(ctrGroundStone2(-ox, T3, -1));
|
|
7938
|
+
}
|
|
7939
|
+
if (AgLast > e12) {
|
|
7940
|
+
if (2 * AgLast < T3) {
|
|
7941
|
+
figStoneA.addMainO(ctrGroundStone2(-AgLast, 2 * AgLast, 1));
|
|
7942
|
+
} else {
|
|
7943
|
+
figStoneA.addMainO(ctrGroundStone2(0, AgLast, -1));
|
|
7944
|
+
figStoneA.addMainO(ctrGroundStone2(0, AgLast, 1));
|
|
7945
|
+
}
|
|
7946
|
+
}
|
|
7947
|
+
figStoneB.addMainO(ctrGroundStone2(BgLast + BgN * T3, T3 / 2, 1));
|
|
7948
|
+
figStoneB.addMainO(ctrGroundStone2(-BgLast - BgN * T3, T3 / 2, -1));
|
|
7949
|
+
for (let ii = 0; ii < BgN; ii++) {
|
|
7950
|
+
const ox = BgLast + ii * T3;
|
|
7951
|
+
figStoneB.addMainO(ctrGroundStone2(ox, T3, 1));
|
|
7952
|
+
figStoneB.addMainO(ctrGroundStone2(-ox, T3, -1));
|
|
7953
|
+
}
|
|
7954
|
+
if (BgLast > e12) {
|
|
7955
|
+
if (2 * BgLast < T3) {
|
|
7956
|
+
figStoneB.addMainO(ctrGroundStone2(-BgLast, 2 * BgLast, 1));
|
|
7957
|
+
} else {
|
|
7958
|
+
figStoneB.addMainO(ctrGroundStone2(0, BgLast, 1));
|
|
7959
|
+
figStoneB.addMainO(ctrGroundStone2(0, BgLast, -1));
|
|
7960
|
+
}
|
|
7961
|
+
}
|
|
7962
|
+
figStoneA.addMainO(ctrSideStone2(0, T3 / 2, 1));
|
|
7963
|
+
figStoneA.addMainO(ctrSideStone2(0, T3 / 2, -1));
|
|
7964
|
+
for (let ii = 0; ii < AsN; ii++) {
|
|
7965
|
+
figStoneA.addMainO(ctrSideStone2(T3 / 2 + ii * T3, T3, 1));
|
|
7966
|
+
figStoneA.addMainO(ctrSideStone2(T3 / 2 + ii * T3, T3, -1));
|
|
7967
|
+
}
|
|
7968
|
+
if (AsLast > e1) {
|
|
7969
|
+
figStoneA.addMainO(ctrSideStone2(T3 / 2 + AsN * T3, AsLast, 1));
|
|
7970
|
+
figStoneA.addMainO(ctrSideStone2(T3 / 2 + AsN * T3, AsLast, -1));
|
|
7971
|
+
}
|
|
7972
|
+
for (let ii = 0; ii < BsN; ii++) {
|
|
7973
|
+
figStoneB.addMainO(ctrSideStone2(ii * T3, T3, 1));
|
|
7974
|
+
figStoneB.addMainO(ctrSideStone2(ii * T3, T3, -1));
|
|
7975
|
+
}
|
|
7976
|
+
if (BsLast > e1) {
|
|
7977
|
+
figStoneB.addMainO(ctrSideStone2(BsN * T3, BsLast, 1));
|
|
7978
|
+
figStoneB.addMainO(ctrSideStone2(BsN * T3, BsLast, -1));
|
|
7979
|
+
}
|
|
7980
|
+
for (let ii = 0; ii < AcN; ii++) {
|
|
7981
|
+
figStoneA.addMainO(ctrCeilingStone2(ii * T3, T3, 1));
|
|
7982
|
+
figStoneA.addMainO(ctrCeilingStone2(ii * T3, T3, -1));
|
|
7983
|
+
}
|
|
7984
|
+
if (AcLast > e1) {
|
|
7985
|
+
if (AcLast < T3 / 2) {
|
|
7986
|
+
figStoneA.addMainO(ctrCeilingStone2(AcN * T3, 2 * AcLast, 1));
|
|
7987
|
+
} else {
|
|
7988
|
+
figStoneA.addMainO(ctrCeilingStone2(AcN * T3, AcLast, 1));
|
|
7989
|
+
figStoneA.addMainO(ctrCeilingStone2(AcN * T3, AcLast, -1));
|
|
7990
|
+
}
|
|
7991
|
+
}
|
|
7992
|
+
figStoneB.addMainO(ctrCeilingStone2(0, T3 / 2, 1));
|
|
7993
|
+
figStoneB.addMainO(ctrCeilingStone2(0, T3 / 2, -1));
|
|
7994
|
+
for (let ii = 0; ii < BcN; ii++) {
|
|
7995
|
+
figStoneB.addMainO(ctrCeilingStone2(T3 / 2 + ii * T3, T3, 1));
|
|
7996
|
+
figStoneB.addMainO(ctrCeilingStone2(T3 / 2 + ii * T3, T3, -1));
|
|
7997
|
+
}
|
|
7998
|
+
if (BcLast > e1) {
|
|
7999
|
+
if (BcLast < T3 / 2) {
|
|
8000
|
+
figStoneB.addMainO(ctrCeilingStone2(T3 / 2 + BcN * T3, 2 * BcLast, 1));
|
|
8001
|
+
} else {
|
|
8002
|
+
figStoneB.addMainO(ctrCeilingStone2(T3 / 2 + BcN * T3, BcLast, 1));
|
|
8003
|
+
figStoneB.addMainO(ctrCeilingStone2(T3 / 2 + BcN * T3, BcLast, -1));
|
|
8004
|
+
}
|
|
8005
|
+
}
|
|
8006
|
+
figStoneA.mergeFigure(figProfile, true);
|
|
8007
|
+
figStoneB.mergeFigure(figStoneA, true);
|
|
8008
|
+
rGeome.fig = {
|
|
8009
|
+
faceProfile: figProfile,
|
|
8010
|
+
faceSlice: figSlice,
|
|
8011
|
+
faceStoneA: figStoneA,
|
|
8012
|
+
faceStoneB: figStoneB
|
|
8013
|
+
};
|
|
8014
|
+
const designName = rGeome.partName;
|
|
8015
|
+
rGeome.vol = {
|
|
8016
|
+
extrudes: [
|
|
8017
|
+
{
|
|
8018
|
+
outName: `subpax_${designName}_A`,
|
|
8019
|
+
face: `${designName}_faceStoneA`,
|
|
8020
|
+
extrudeMethod: EExtrude18.eLinearOrtho,
|
|
8021
|
+
length: param.T2,
|
|
8022
|
+
rotate: [0, 0, 0],
|
|
8023
|
+
translate: [0, 0, 0]
|
|
8024
|
+
},
|
|
8025
|
+
{
|
|
8026
|
+
outName: `subpax_${designName}_B`,
|
|
8027
|
+
face: `${designName}_faceStoneB`,
|
|
8028
|
+
extrudeMethod: EExtrude18.eLinearOrtho,
|
|
8029
|
+
length: param.T2,
|
|
8030
|
+
rotate: [0, 0, 0],
|
|
8031
|
+
translate: [0, 0, fsox]
|
|
8032
|
+
}
|
|
8033
|
+
],
|
|
8034
|
+
volumes: [
|
|
8035
|
+
{
|
|
8036
|
+
outName: `pax_${designName}`,
|
|
8037
|
+
boolMethod: EBVolume18.eUnion,
|
|
8038
|
+
inList: [`subpax_${designName}_A`, `subpax_${designName}_B`]
|
|
8039
|
+
}
|
|
8040
|
+
]
|
|
8041
|
+
};
|
|
8042
|
+
rGeome.sub = {};
|
|
8043
|
+
rGeome.logstr += "tunnel drawn successfully!\n";
|
|
8044
|
+
rGeome.calcErr = false;
|
|
8045
|
+
} catch (emsg) {
|
|
8046
|
+
rGeome.logstr += emsg;
|
|
8047
|
+
console.log(emsg);
|
|
8048
|
+
}
|
|
8049
|
+
return rGeome;
|
|
8050
|
+
}
|
|
8051
|
+
var tunnelDef = {
|
|
8052
|
+
pTitle: "tunnel",
|
|
8053
|
+
pDescription: "tunnel for the train-capsule",
|
|
8054
|
+
pDef: pDef22,
|
|
8055
|
+
pGeom: pGeom22
|
|
6423
8056
|
};
|
|
6424
8057
|
|
|
6425
8058
|
// src/sysmix/square.ts
|
|
6426
8059
|
import {
|
|
6427
|
-
contour as
|
|
6428
|
-
contourCircle as
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
8060
|
+
contour as contour23,
|
|
8061
|
+
contourCircle as contourCircle20,
|
|
8062
|
+
ctrRectangle as ctrRectangle12,
|
|
8063
|
+
figure as figure20,
|
|
8064
|
+
ffix as ffix24,
|
|
8065
|
+
pNumber as pNumber23,
|
|
8066
|
+
pSectionSeparator as pSectionSeparator23,
|
|
8067
|
+
EExtrude as EExtrude19,
|
|
8068
|
+
EBVolume as EBVolume19,
|
|
8069
|
+
initGeom as initGeom23
|
|
6436
8070
|
} from "geometrix";
|
|
6437
|
-
var
|
|
8071
|
+
var pDef23 = {
|
|
6438
8072
|
partName: "square",
|
|
6439
8073
|
params: [
|
|
6440
8074
|
//pNumber(name, unit, init, min, max, step)
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
8075
|
+
pNumber23("W1", "mm", 100, 5, 500, 1),
|
|
8076
|
+
pNumber23("Di", "mm", 50, 2, 500, 1),
|
|
8077
|
+
pSectionSeparator23("Details and thickness"),
|
|
8078
|
+
pNumber23("R1", "mm", 0, 0, 50, 1),
|
|
8079
|
+
pNumber23("T1", "mm", 30, 1, 500, 1)
|
|
6446
8080
|
],
|
|
6447
8081
|
paramSvg: {
|
|
6448
8082
|
W1: "square_top.svg",
|
|
@@ -6457,9 +8091,10 @@ var pDef19 = {
|
|
|
6457
8091
|
// every 0.5 second
|
|
6458
8092
|
}
|
|
6459
8093
|
};
|
|
6460
|
-
function
|
|
6461
|
-
const rGeome =
|
|
6462
|
-
const figSquare =
|
|
8094
|
+
function pGeom23(t, param, suffix = "") {
|
|
8095
|
+
const rGeome = initGeom23(pDef23.partName + suffix);
|
|
8096
|
+
const figSquare = figure20();
|
|
8097
|
+
const figHeight = figure20();
|
|
6463
8098
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
6464
8099
|
`;
|
|
6465
8100
|
try {
|
|
@@ -6470,13 +8105,16 @@ function pGeom19(t, param, suffix = "") {
|
|
|
6470
8105
|
if (param.W1 < param.Di) {
|
|
6471
8106
|
throw `err069: W1 ${param.W1} is too small compare to Di ${param.Di}`;
|
|
6472
8107
|
}
|
|
6473
|
-
rGeome.logstr += `Surface ${
|
|
8108
|
+
rGeome.logstr += `Surface ${ffix24(surface)} mm2, volume ${ffix24(volume)} mm3
|
|
6474
8109
|
`;
|
|
6475
|
-
const ctrSquare =
|
|
6476
|
-
const ctrHole =
|
|
8110
|
+
const ctrSquare = contour23(-W12, -W12).addCornerRounded(param.R1).addSegStrokeR(param.W1, 0).addCornerRounded(param.R1).addSegStrokeR(0, param.W1).addCornerRounded(param.R1).addSegStrokeR(-param.W1, 0).addCornerRounded(param.R1).closeSegStroke();
|
|
8111
|
+
const ctrHole = contourCircle20(0, 0, Ri);
|
|
6477
8112
|
figSquare.addMainOI([ctrSquare, ctrHole]);
|
|
8113
|
+
figHeight.addMainO(ctrRectangle12(-W12, 0, 2 * W12, param.T1));
|
|
8114
|
+
figHeight.addSecond(ctrRectangle12(-Ri, 0, 2 * Ri, param.T1));
|
|
6478
8115
|
rGeome.fig = {
|
|
6479
|
-
faceSquare: figSquare
|
|
8116
|
+
faceSquare: figSquare,
|
|
8117
|
+
faceHeight: figHeight
|
|
6480
8118
|
};
|
|
6481
8119
|
const designName = rGeome.partName;
|
|
6482
8120
|
rGeome.vol = {
|
|
@@ -6484,7 +8122,7 @@ function pGeom19(t, param, suffix = "") {
|
|
|
6484
8122
|
{
|
|
6485
8123
|
outName: `subpax_${designName}_square`,
|
|
6486
8124
|
face: `${designName}_faceSquare`,
|
|
6487
|
-
extrudeMethod:
|
|
8125
|
+
extrudeMethod: EExtrude19.eLinearOrtho,
|
|
6488
8126
|
length: param.T1,
|
|
6489
8127
|
rotate: [0, 0, 0],
|
|
6490
8128
|
translate: [0, 0, 0]
|
|
@@ -6493,7 +8131,7 @@ function pGeom19(t, param, suffix = "") {
|
|
|
6493
8131
|
volumes: [
|
|
6494
8132
|
{
|
|
6495
8133
|
outName: `pax_${designName}`,
|
|
6496
|
-
boolMethod:
|
|
8134
|
+
boolMethod: EBVolume19.eUnion,
|
|
6497
8135
|
inList: [`subpax_${designName}_square`]
|
|
6498
8136
|
}
|
|
6499
8137
|
]
|
|
@@ -6510,33 +8148,34 @@ function pGeom19(t, param, suffix = "") {
|
|
|
6510
8148
|
var squareDef = {
|
|
6511
8149
|
pTitle: "square",
|
|
6512
8150
|
pDescription: "simple square shape for experimenting systemix",
|
|
6513
|
-
pDef:
|
|
6514
|
-
pGeom:
|
|
8151
|
+
pDef: pDef23,
|
|
8152
|
+
pGeom: pGeom23
|
|
6515
8153
|
};
|
|
6516
8154
|
|
|
6517
8155
|
// src/sysmix/triangle.ts
|
|
6518
8156
|
import {
|
|
6519
|
-
contour as
|
|
6520
|
-
contourCircle as
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
8157
|
+
contour as contour24,
|
|
8158
|
+
contourCircle as contourCircle21,
|
|
8159
|
+
ctrRectangle as ctrRectangle13,
|
|
8160
|
+
figure as figure21,
|
|
8161
|
+
ffix as ffix25,
|
|
8162
|
+
pNumber as pNumber24,
|
|
8163
|
+
pSectionSeparator as pSectionSeparator24,
|
|
8164
|
+
EExtrude as EExtrude20,
|
|
8165
|
+
EBVolume as EBVolume20,
|
|
8166
|
+
initGeom as initGeom24
|
|
6528
8167
|
} from "geometrix";
|
|
6529
|
-
var
|
|
8168
|
+
var pDef24 = {
|
|
6530
8169
|
partName: "triangle",
|
|
6531
8170
|
params: [
|
|
6532
8171
|
//pNumber(name, unit, init, min, max, step)
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
8172
|
+
pNumber24("W1", "mm", 100, 5, 500, 1),
|
|
8173
|
+
pNumber24("T1", "mm", 20, 1, 500, 1),
|
|
8174
|
+
pNumber24("E1", "mm", 10, 1, 500, 1),
|
|
8175
|
+
pNumber24("N1", "triangles", 3, 1, 20, 1),
|
|
8176
|
+
pSectionSeparator24("Details and hole"),
|
|
8177
|
+
pNumber24("R1", "mm", 0, 0, 50, 1),
|
|
8178
|
+
pNumber24("Di", "mm", 50, 2, 500, 1)
|
|
6540
8179
|
],
|
|
6541
8180
|
paramSvg: {
|
|
6542
8181
|
W1: "triangle_top.svg",
|
|
@@ -6553,9 +8192,10 @@ var pDef20 = {
|
|
|
6553
8192
|
// every 0.5 second
|
|
6554
8193
|
}
|
|
6555
8194
|
};
|
|
6556
|
-
function
|
|
6557
|
-
const rGeome =
|
|
6558
|
-
const figTriangle =
|
|
8195
|
+
function pGeom24(t, param, suffix = "") {
|
|
8196
|
+
const rGeome = initGeom24(pDef24.partName + suffix);
|
|
8197
|
+
const figTriangle = figure21();
|
|
8198
|
+
const figHeight = figure21();
|
|
6559
8199
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
6560
8200
|
`;
|
|
6561
8201
|
try {
|
|
@@ -6569,13 +8209,19 @@ function pGeom20(t, param, suffix = "") {
|
|
|
6569
8209
|
if (W12h < Ri) {
|
|
6570
8210
|
throw `err077: W1 ${param.W1} is too small compare to Di ${param.Di}`;
|
|
6571
8211
|
}
|
|
6572
|
-
rGeome.logstr += `Surface ${
|
|
8212
|
+
rGeome.logstr += `Surface ${ffix25(surface)} mm2, volume ${ffix25(volume)} mm3
|
|
6573
8213
|
`;
|
|
6574
|
-
const ctrTriangle =
|
|
6575
|
-
const ctrHole =
|
|
8214
|
+
const ctrTriangle = contour24(-W12, -W12h).addCornerRounded(param.R1).addSegStrokeR(param.W1, 0).addCornerRounded(param.R1).addSegStrokeRP(2 * Math.PI / 3, param.W1).addCornerRounded(param.R1).closeSegStroke();
|
|
8215
|
+
const ctrHole = contourCircle21(0, 0, Ri);
|
|
6576
8216
|
figTriangle.addMainOI([ctrTriangle, ctrHole]);
|
|
8217
|
+
for (let ii = 0; ii < param.N1; ii++) {
|
|
8218
|
+
const Zpos = ii * Zoffset;
|
|
8219
|
+
figHeight.addMainO(ctrRectangle13(-W12h, Zpos, W1h, param.T1));
|
|
8220
|
+
figHeight.addSecond(ctrRectangle13(-Ri, Zpos, 2 * Ri, param.T1));
|
|
8221
|
+
}
|
|
6577
8222
|
rGeome.fig = {
|
|
6578
|
-
faceTriangle: figTriangle
|
|
8223
|
+
faceTriangle: figTriangle,
|
|
8224
|
+
faceHeight: figHeight
|
|
6579
8225
|
};
|
|
6580
8226
|
const designName = rGeome.partName;
|
|
6581
8227
|
const Vidx = [...Array(param.N1).keys()];
|
|
@@ -6583,7 +8229,7 @@ function pGeom20(t, param, suffix = "") {
|
|
|
6583
8229
|
extrudes: Vidx.map((ii) => ({
|
|
6584
8230
|
outName: `subpax_${designName}_tri${ii}`,
|
|
6585
8231
|
face: `${designName}_faceTriangle`,
|
|
6586
|
-
extrudeMethod:
|
|
8232
|
+
extrudeMethod: EExtrude20.eLinearOrtho,
|
|
6587
8233
|
length: param.T1,
|
|
6588
8234
|
rotate: [0, 0, 0],
|
|
6589
8235
|
translate: [0, 0, ii * Zoffset]
|
|
@@ -6591,7 +8237,7 @@ function pGeom20(t, param, suffix = "") {
|
|
|
6591
8237
|
volumes: [
|
|
6592
8238
|
{
|
|
6593
8239
|
outName: `pax_${designName}`,
|
|
6594
|
-
boolMethod:
|
|
8240
|
+
boolMethod: EBVolume20.eUnion,
|
|
6595
8241
|
inList: Vidx.map((ii) => `subpax_${designName}_tri${ii}`)
|
|
6596
8242
|
}
|
|
6597
8243
|
]
|
|
@@ -6608,29 +8254,30 @@ function pGeom20(t, param, suffix = "") {
|
|
|
6608
8254
|
var triangleDef = {
|
|
6609
8255
|
pTitle: "triangle",
|
|
6610
8256
|
pDescription: "triangle sandwich shape for experimenting systemix",
|
|
6611
|
-
pDef:
|
|
6612
|
-
pGeom:
|
|
8257
|
+
pDef: pDef24,
|
|
8258
|
+
pGeom: pGeom24
|
|
6613
8259
|
};
|
|
6614
8260
|
|
|
6615
8261
|
// src/sysmix/cylinder.ts
|
|
6616
8262
|
import {
|
|
6617
|
-
contourCircle as
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
8263
|
+
contourCircle as contourCircle22,
|
|
8264
|
+
ctrRectangle as ctrRectangle14,
|
|
8265
|
+
figure as figure22,
|
|
8266
|
+
ffix as ffix26,
|
|
8267
|
+
pNumber as pNumber25,
|
|
8268
|
+
pSectionSeparator as pSectionSeparator25,
|
|
8269
|
+
EExtrude as EExtrude21,
|
|
8270
|
+
EBVolume as EBVolume21,
|
|
8271
|
+
initGeom as initGeom25
|
|
6625
8272
|
} from "geometrix";
|
|
6626
|
-
var
|
|
8273
|
+
var pDef25 = {
|
|
6627
8274
|
partName: "cylinder",
|
|
6628
8275
|
params: [
|
|
6629
8276
|
//pNumber(name, unit, init, min, max, step)
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
8277
|
+
pNumber25("D1", "mm", 100, 5, 500, 1),
|
|
8278
|
+
pNumber25("Di", "mm", 50, 2, 500, 1),
|
|
8279
|
+
pSectionSeparator25("Thickness"),
|
|
8280
|
+
pNumber25("T1", "mm", 30, 1, 500, 1)
|
|
6634
8281
|
],
|
|
6635
8282
|
paramSvg: {
|
|
6636
8283
|
D1: "cylinder_top.svg",
|
|
@@ -6644,9 +8291,10 @@ var pDef21 = {
|
|
|
6644
8291
|
// every 0.5 second
|
|
6645
8292
|
}
|
|
6646
8293
|
};
|
|
6647
|
-
function
|
|
6648
|
-
const rGeome =
|
|
6649
|
-
const figCylinder =
|
|
8294
|
+
function pGeom25(t, param, suffix = "") {
|
|
8295
|
+
const rGeome = initGeom25(pDef25.partName + suffix);
|
|
8296
|
+
const figCylinder = figure22();
|
|
8297
|
+
const figHeight = figure22();
|
|
6650
8298
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
6651
8299
|
`;
|
|
6652
8300
|
try {
|
|
@@ -6657,13 +8305,16 @@ function pGeom21(t, param, suffix = "") {
|
|
|
6657
8305
|
if (R1 < Ri) {
|
|
6658
8306
|
throw `err071: D1 ${param.D1} is too small compare to Di ${param.Di}`;
|
|
6659
8307
|
}
|
|
6660
|
-
rGeome.logstr += `Surface ${
|
|
8308
|
+
rGeome.logstr += `Surface ${ffix26(surface)} mm2, volume ${ffix26(volume)} mm3
|
|
6661
8309
|
`;
|
|
6662
|
-
const ctrCylinder =
|
|
6663
|
-
const ctrHole =
|
|
8310
|
+
const ctrCylinder = contourCircle22(0, 0, R1);
|
|
8311
|
+
const ctrHole = contourCircle22(0, 0, Ri);
|
|
6664
8312
|
figCylinder.addMainOI([ctrCylinder, ctrHole]);
|
|
8313
|
+
figHeight.addMainO(ctrRectangle14(-R1, 0, 2 * R1, param.T1));
|
|
8314
|
+
figHeight.addSecond(ctrRectangle14(-Ri, 0, 2 * Ri, param.T1));
|
|
6665
8315
|
rGeome.fig = {
|
|
6666
|
-
faceCylinder: figCylinder
|
|
8316
|
+
faceCylinder: figCylinder,
|
|
8317
|
+
faceHeight: figHeight
|
|
6667
8318
|
};
|
|
6668
8319
|
const designName = rGeome.partName;
|
|
6669
8320
|
rGeome.vol = {
|
|
@@ -6671,7 +8322,7 @@ function pGeom21(t, param, suffix = "") {
|
|
|
6671
8322
|
{
|
|
6672
8323
|
outName: `subpax_${designName}_cyl`,
|
|
6673
8324
|
face: `${designName}_faceCylinder`,
|
|
6674
|
-
extrudeMethod:
|
|
8325
|
+
extrudeMethod: EExtrude21.eLinearOrtho,
|
|
6675
8326
|
length: param.T1,
|
|
6676
8327
|
rotate: [0, 0, 0],
|
|
6677
8328
|
translate: [0, 0, 0]
|
|
@@ -6680,7 +8331,7 @@ function pGeom21(t, param, suffix = "") {
|
|
|
6680
8331
|
volumes: [
|
|
6681
8332
|
{
|
|
6682
8333
|
outName: `pax_${designName}`,
|
|
6683
|
-
boolMethod:
|
|
8334
|
+
boolMethod: EBVolume21.eIdentity,
|
|
6684
8335
|
inList: [`subpax_${designName}_cyl`]
|
|
6685
8336
|
}
|
|
6686
8337
|
]
|
|
@@ -6697,8 +8348,8 @@ function pGeom21(t, param, suffix = "") {
|
|
|
6697
8348
|
var cylinderDef = {
|
|
6698
8349
|
pTitle: "cylinder",
|
|
6699
8350
|
pDescription: "simple cylinder shape for experimenting systemix",
|
|
6700
|
-
pDef:
|
|
6701
|
-
pGeom:
|
|
8351
|
+
pDef: pDef25,
|
|
8352
|
+
pGeom: pGeom25
|
|
6702
8353
|
};
|
|
6703
8354
|
export {
|
|
6704
8355
|
capsuleDef,
|
|
@@ -6708,6 +8359,9 @@ export {
|
|
|
6708
8359
|
factoryDef,
|
|
6709
8360
|
heliostatDef,
|
|
6710
8361
|
houseDef,
|
|
8362
|
+
minifootDef,
|
|
8363
|
+
minihelioDef,
|
|
8364
|
+
minimirDef,
|
|
6711
8365
|
pcarDef,
|
|
6712
8366
|
plugTorqueDef,
|
|
6713
8367
|
rccarDef,
|
|
@@ -6721,6 +8375,7 @@ export {
|
|
|
6721
8375
|
springWormDef,
|
|
6722
8376
|
squareDef,
|
|
6723
8377
|
stoneTowerDef,
|
|
6724
|
-
triangleDef
|
|
8378
|
+
triangleDef,
|
|
8379
|
+
tunnelDef
|
|
6725
8380
|
};
|
|
6726
8381
|
//# sourceMappingURL=index.js.map
|