desi77 0.1.21 → 0.1.24
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 +13 -1
- package/dist/index.js +2326 -626
- package/dist/pgdsvg/bridge_arc.svg +1 -0
- package/dist/pgdsvg/bridge_column.svg +2 -0
- package/dist/pgdsvg/bridge_panorama.svg +1 -0
- 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_bridge.svg +2 -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_trackXY.svg +1 -0
- package/dist/pgdsvg/src_trackXZ.svg +1 -0
- package/dist/pgdsvg/trackXY_midLine.svg +1 -0
- package/dist/pgdsvg/trackXY_section.svg +1 -0
- package/dist/pgdsvg/trackXY_side.svg +1 -0
- package/dist/pgdsvg/trackXY_top.svg +1 -0
- package/dist/pgdsvg/trackXZ_section.svg +1 -0
- package/dist/pgdsvg/trackXZ_side.svg +1 -0
- package/dist/pgdsvg/trackXZ_slope.svg +1 -0
- package/dist/pgdsvg/trackXZ_top.svg +1 -0
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -4777,67 +4777,1023 @@ var heliostatDef = {
|
|
|
4777
4777
|
pGeom: pGeom13
|
|
4778
4778
|
};
|
|
4779
4779
|
|
|
4780
|
-
// src/
|
|
4780
|
+
// src/heliostat/minifoot.ts
|
|
4781
4781
|
import {
|
|
4782
|
-
withinHPiHPi,
|
|
4783
|
-
ShapePoint as ShapePoint2,
|
|
4784
4782
|
point as point7,
|
|
4785
4783
|
contour as contour15,
|
|
4786
4784
|
contourCircle as contourCircle11,
|
|
4787
|
-
ctrRectangle as ctrRectangle7,
|
|
4788
4785
|
figure as figure12,
|
|
4789
|
-
|
|
4786
|
+
radToDeg as radToDeg10,
|
|
4790
4787
|
ffix as ffix15,
|
|
4791
4788
|
pNumber as pNumber14,
|
|
4792
|
-
pCheckbox as pCheckbox9,
|
|
4793
|
-
pDropdown as pDropdown8,
|
|
4794
4789
|
pSectionSeparator as pSectionSeparator14,
|
|
4795
|
-
transform3d,
|
|
4796
4790
|
EExtrude as EExtrude11,
|
|
4797
4791
|
EBVolume as EBVolume11,
|
|
4798
4792
|
initGeom as initGeom14
|
|
4799
4793
|
} from "geometrix";
|
|
4794
|
+
import { triLALrL as triLALrL2, triLLLrA as triLLLrA2 } from "triangule";
|
|
4800
4795
|
var pDef14 = {
|
|
4796
|
+
partName: "minifoot",
|
|
4797
|
+
params: [
|
|
4798
|
+
//pNumber(name, unit, init, min, max, step)
|
|
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)
|
|
4810
|
+
],
|
|
4811
|
+
paramSvg: {
|
|
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"
|
|
4822
|
+
},
|
|
4823
|
+
sim: {
|
|
4824
|
+
tMax: 180,
|
|
4825
|
+
tStep: 0.5,
|
|
4826
|
+
tUpdate: 500
|
|
4827
|
+
// every 0.5 second
|
|
4828
|
+
}
|
|
4829
|
+
};
|
|
4830
|
+
function pGeom14(t, param, suffix = "") {
|
|
4831
|
+
const rGeome = initGeom14(pDef14.partName + suffix);
|
|
4832
|
+
const figFoot = figure12();
|
|
4833
|
+
const figCylinder = figure12();
|
|
4834
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
4835
|
+
`;
|
|
4836
|
+
try {
|
|
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
|
+
}
|
|
4843
|
+
return rCtr;
|
|
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 = {
|
|
4801
5757
|
partName: "rccar",
|
|
4802
5758
|
params: [
|
|
4803
5759
|
//pNumber(name, unit, init, min, max, step)
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
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"),
|
|
4808
5764
|
pDropdown8("gen3D", ["all", "platform", "bone", "hand", "motor", "wheel"]),
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
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),
|
|
4837
5793
|
pDropdown8("wheel", ["straight", "turn"]),
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
5794
|
+
pNumber17("ra", "degree", 0, -90, 90, 1),
|
|
5795
|
+
pNumber17("rx", "cm", 0, -1e3, 1e3, 1),
|
|
5796
|
+
pNumber17("ry", "cm", 0, -1e3, 1e3, 1)
|
|
4841
5797
|
],
|
|
4842
5798
|
paramSvg: {
|
|
4843
5799
|
N1: "rccar_all_xy.svg",
|
|
@@ -4880,23 +5836,23 @@ var pDef14 = {
|
|
|
4880
5836
|
// every 0.5 second
|
|
4881
5837
|
}
|
|
4882
5838
|
};
|
|
4883
|
-
function
|
|
4884
|
-
const rGeome =
|
|
4885
|
-
const figPlatform =
|
|
4886
|
-
const figTriangle =
|
|
4887
|
-
const figPFfixation =
|
|
4888
|
-
const figBones =
|
|
4889
|
-
const figHandFixation =
|
|
4890
|
-
const figHandPlateR =
|
|
4891
|
-
const figHandPlateL =
|
|
4892
|
-
const figHandBackR =
|
|
4893
|
-
const figHandBackL =
|
|
4894
|
-
const figMotorBulkR =
|
|
4895
|
-
const figMotorBulkL =
|
|
4896
|
-
const figMFoot =
|
|
4897
|
-
const figWheel =
|
|
4898
|
-
const figTop =
|
|
4899
|
-
const figSide =
|
|
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();
|
|
4900
5856
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
4901
5857
|
`;
|
|
4902
5858
|
try {
|
|
@@ -4916,20 +5872,20 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4916
5872
|
const dx2 = sign * param.T1 + dx1;
|
|
4917
5873
|
const dR2 = sign * R2;
|
|
4918
5874
|
const dW22d = tpL > 0 ? -dW22 - dx2 : dW22 + dx2;
|
|
4919
|
-
const rCtrExt =
|
|
4920
|
-
const rCtr1 =
|
|
4921
|
-
const rCtr2 =
|
|
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);
|
|
4922
5878
|
return [rCtrExt, rCtr1, rCtr2];
|
|
4923
5879
|
}, makeHandPlate2 = function(az, addL, ipX, ipY) {
|
|
4924
|
-
const rCtrExt =
|
|
4925
|
-
const rCtrHole =
|
|
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);
|
|
4926
5882
|
return [rCtrExt, rCtrHole];
|
|
4927
5883
|
}, makeMFoot2 = function(itx, ity) {
|
|
4928
|
-
const rCtrExt =
|
|
4929
|
-
const rCtrHole =
|
|
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);
|
|
4930
5886
|
return [rCtrExt, rCtrHole];
|
|
4931
5887
|
}, makeCtrWheel2 = function(xSign, ia, itx, ity) {
|
|
4932
|
-
const rCtr =
|
|
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);
|
|
4933
5889
|
return rCtr;
|
|
4934
5890
|
}, makeTopWheel2 = function(itx, ity, ia) {
|
|
4935
5891
|
const tL = param.Lmotor - mFootWidth;
|
|
@@ -4937,14 +5893,14 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4937
5893
|
const tSin = tL * Math.sin(ia);
|
|
4938
5894
|
const ctrWheel1 = makeCtrWheel2(1, -pi2 + ia, itx + tCos, ity + tSin);
|
|
4939
5895
|
const ctrWheel2 = makeCtrWheel2(-1, -pi2 + ia, itx + tCos, ity + tSin);
|
|
4940
|
-
const ctrMFootPre =
|
|
5896
|
+
const ctrMFootPre = ctrRectangle9(itx + tL, ity - F12, mFootWidth, 2 * F12);
|
|
4941
5897
|
const ctrMFoot = ctrMFootPre.rotate(itx, ity, ia);
|
|
4942
5898
|
return [ctrWheel1, ctrWheel2, ctrMFoot];
|
|
4943
5899
|
}, extrudeTriangle2 = function(posZ, idx) {
|
|
4944
5900
|
const rVol = {
|
|
4945
5901
|
outName: `subpax_${designName}_platformTriangle${idx}`,
|
|
4946
5902
|
face: `${designName}_faceTriangle`,
|
|
4947
|
-
extrudeMethod:
|
|
5903
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
4948
5904
|
length: param.T1,
|
|
4949
5905
|
rotate: [0, 0, 0],
|
|
4950
5906
|
translate: [0, 0, posZ]
|
|
@@ -4954,7 +5910,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4954
5910
|
const rVol = {
|
|
4955
5911
|
outName: `subpax_${designName}_PFfixation${idx}`,
|
|
4956
5912
|
face: `${designName}_facePFfixation`,
|
|
4957
|
-
extrudeMethod:
|
|
5913
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
4958
5914
|
length: param.T1,
|
|
4959
5915
|
rotate: [0, 0, 0],
|
|
4960
5916
|
translate: [0, 0, posZ]
|
|
@@ -4964,7 +5920,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4964
5920
|
const rVol = {
|
|
4965
5921
|
outName: `subpax_${designName}_bones${idx}`,
|
|
4966
5922
|
face: `${designName}_faceBones`,
|
|
4967
|
-
extrudeMethod:
|
|
5923
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
4968
5924
|
length: param.T1,
|
|
4969
5925
|
rotate: [0, 0, 0],
|
|
4970
5926
|
translate: [0, 0, posZ]
|
|
@@ -4974,7 +5930,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4974
5930
|
const rVol = {
|
|
4975
5931
|
outName: `subpax_${designName}_handFixation${idx}`,
|
|
4976
5932
|
face: `${designName}_faceHandFixation`,
|
|
4977
|
-
extrudeMethod:
|
|
5933
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
4978
5934
|
length: param.T1,
|
|
4979
5935
|
rotate: [0, 0, 0],
|
|
4980
5936
|
translate: [0, 0, posZ]
|
|
@@ -4984,7 +5940,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4984
5940
|
const rVol = {
|
|
4985
5941
|
outName: `subpax_${designName}_handPlate${iRL}${idx}`,
|
|
4986
5942
|
face: `${designName}_faceHandPlate${iRL}`,
|
|
4987
|
-
extrudeMethod:
|
|
5943
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
4988
5944
|
length: param.T1,
|
|
4989
5945
|
rotate: [pi2, 0, 0],
|
|
4990
5946
|
translate: [0, posY + param.T1, 0]
|
|
@@ -4994,7 +5950,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
4994
5950
|
const rVol = {
|
|
4995
5951
|
outName: `subpax_${designName}_handBack${iRL}`,
|
|
4996
5952
|
face: `${designName}_faceHandBack${iRL}`,
|
|
4997
|
-
extrudeMethod:
|
|
5953
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
4998
5954
|
length: param.Z2,
|
|
4999
5955
|
rotate: [pi2, 0, 0],
|
|
5000
5956
|
translate: [0, posY + param.T1, 0]
|
|
@@ -5004,7 +5960,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5004
5960
|
const rVol = {
|
|
5005
5961
|
outName: `subpax_${designName}_motorBulk${iRL}`,
|
|
5006
5962
|
face: `${designName}_faceMotorBulk${iRL}`,
|
|
5007
|
-
extrudeMethod:
|
|
5963
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
5008
5964
|
length: motorHeight,
|
|
5009
5965
|
rotate: [pi2, 0, 0],
|
|
5010
5966
|
translate: [0, posY - param.E1, 0]
|
|
@@ -5018,7 +5974,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5018
5974
|
const rVol = {
|
|
5019
5975
|
outName: `subpax_${designName}_mFoot${idx}`,
|
|
5020
5976
|
face: `${designName}_faceMFoot`,
|
|
5021
|
-
extrudeMethod:
|
|
5977
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
5022
5978
|
length: mFootWidth,
|
|
5023
5979
|
rotate: tm.getRotation(),
|
|
5024
5980
|
translate: tm.getTranslation()
|
|
@@ -5032,7 +5988,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5032
5988
|
const rVol = {
|
|
5033
5989
|
outName: `subpax_${designName}_wheel${idx}`,
|
|
5034
5990
|
face: `${designName}_faceWheel`,
|
|
5035
|
-
extrudeMethod:
|
|
5991
|
+
extrudeMethod: EExtrude14.eRotate,
|
|
5036
5992
|
rotate: tm.getRotation(),
|
|
5037
5993
|
translate: tm.getTranslation()
|
|
5038
5994
|
};
|
|
@@ -5065,13 +6021,13 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5065
6021
|
const Rsteering = param.Dsteering / 2;
|
|
5066
6022
|
const Z2b = param.Z2 - 4 * R2;
|
|
5067
6023
|
const Z2c = param.Z2 - param.T1;
|
|
5068
|
-
const AbMin =
|
|
5069
|
-
const AbMax =
|
|
6024
|
+
const AbMin = degToRad8(param.aBoneMin);
|
|
6025
|
+
const AbMax = degToRad8(param.aBoneMax);
|
|
5070
6026
|
const posZplatform = Rwheel + param.Z1 + param.L2 * Math.sin(AbMin);
|
|
5071
6027
|
const Hplatform = posZplatform + param.H1;
|
|
5072
6028
|
const W32 = param.W3 / 2;
|
|
5073
6029
|
if (R2 < W32) {
|
|
5074
|
-
throw `err152: D2 ${
|
|
6030
|
+
throw `err152: D2 ${ffix18(param.D2)} is too small compare to W3 ${ffix18(param.W3)} mm`;
|
|
5075
6031
|
}
|
|
5076
6032
|
const W32X = Math.sqrt(R2 ** 2 - W32 ** 2);
|
|
5077
6033
|
const L2b = param.L2 - 2 * W32X;
|
|
@@ -5084,7 +6040,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5084
6040
|
const boneSideyRs = param.L2 * Math.sin(aBR);
|
|
5085
6041
|
const boneSideyLs = param.L2 * Math.sin(aBL);
|
|
5086
6042
|
const boneSideyR = 2 * R2 * Math.sign(aBR) + boneSideyRs;
|
|
5087
|
-
const ra =
|
|
6043
|
+
const ra = degToRad8(param.ra);
|
|
5088
6044
|
const rx10 = 10 * param.rx;
|
|
5089
6045
|
const ry10 = 10 * param.ry;
|
|
5090
6046
|
const hPlen = 2 * F12 + param.E2 + param.T1;
|
|
@@ -5119,47 +6075,47 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5119
6075
|
const dWheelAxis = Rwheel - Raxis;
|
|
5120
6076
|
const roundedWheel = Math.min(param.Lwheel / 3, dWheelAxis / 2);
|
|
5121
6077
|
if (LF2 < 0.1) {
|
|
5122
|
-
throw `err176: L1 ${
|
|
6078
|
+
throw `err176: L1 ${ffix18(param.L1)} is too small compare to F1 ${ffix18(param.F1)} mm`;
|
|
5123
6079
|
}
|
|
5124
6080
|
if (param.H1 < param.Z2 + param.T1) {
|
|
5125
|
-
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`;
|
|
5126
6082
|
}
|
|
5127
6083
|
if (Z2b < 0.1) {
|
|
5128
|
-
throw `err149: Z2 ${
|
|
6084
|
+
throw `err149: Z2 ${ffix18(param.Z2)} is too small compare to D2 ${ffix18(param.D2)} mm`;
|
|
5129
6085
|
}
|
|
5130
6086
|
if (W2c < 0.1) {
|
|
5131
|
-
throw `err153: W2 ${
|
|
6087
|
+
throw `err153: W2 ${ffix18(param.W2)} is too small compare to T1 ${ffix18(param.T1)} mm`;
|
|
5132
6088
|
}
|
|
5133
6089
|
if (H1c < 0.1) {
|
|
5134
|
-
throw `err156: H1c ${
|
|
6090
|
+
throw `err156: H1c ${ffix18(param.H1)} is too small compare to T1 ${ffix18(param.T1)} mm`;
|
|
5135
6091
|
}
|
|
5136
6092
|
if (F1b < 0.1) {
|
|
5137
|
-
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`;
|
|
5138
6094
|
}
|
|
5139
6095
|
if (AbMax < AbMin) {
|
|
5140
|
-
throw `err181: aBoneMax ${
|
|
6096
|
+
throw `err181: aBoneMax ${ffix18(param.aBoneMax)} is too small compare to aBoneMin ${ffix18(param.BoneMin)} degree`;
|
|
5141
6097
|
}
|
|
5142
6098
|
if (mFootWidth < param.T1) {
|
|
5143
|
-
throw `err218: Lmotor ${
|
|
6099
|
+
throw `err218: Lmotor ${ffix18(param.Lmotor)} is too small compare to F1 ${ffix18(param.F1)}`;
|
|
5144
6100
|
}
|
|
5145
6101
|
if (motorHeight < param.T1) {
|
|
5146
|
-
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`;
|
|
5147
6103
|
}
|
|
5148
6104
|
if (param.Z1 < mFootR) {
|
|
5149
|
-
throw `err256: Z1 ${
|
|
6105
|
+
throw `err256: Z1 ${ffix18(param.Z1)} is too small compare to mFootR ${ffix18(mFootR)} mm`;
|
|
5150
6106
|
}
|
|
5151
6107
|
if (Rwheel < mFootR) {
|
|
5152
|
-
throw `err259: Dwheel ${
|
|
6108
|
+
throw `err259: Dwheel ${ffix18(param.Dwheel)} is too small compare to mFootR ${ffix18(mFootR)} mm`;
|
|
5153
6109
|
}
|
|
5154
|
-
rGeome.logstr += `Platform Ltotal ${
|
|
6110
|
+
rGeome.logstr += `Platform Ltotal ${ffix18(Ltotal / 1e3)} m, surface ${ffix18(platSurface)} m2
|
|
5155
6111
|
`;
|
|
5156
|
-
rGeome.logstr += `Hplatform ${
|
|
6112
|
+
rGeome.logstr += `Hplatform ${ffix18(Hplatform)} mm
|
|
5157
6113
|
`;
|
|
5158
|
-
const ctrPlatformMain =
|
|
5159
|
-
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);
|
|
5160
6116
|
figPlatform.addMainOI([ctrPlatformMain, ctrPlatformInt]);
|
|
5161
|
-
const ctrTriangleL =
|
|
5162
|
-
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();
|
|
5163
6119
|
figTriangle.addMainO(ctrTriangleL);
|
|
5164
6120
|
figTriangle.addMainO(ctrTriangleR);
|
|
5165
6121
|
figPlatform.addSecond(ctrTriangleL);
|
|
@@ -5167,36 +6123,36 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5167
6123
|
figPFfixation.addMainOI(makePFfixExt2(1, 0, 0));
|
|
5168
6124
|
figPFfixation.addMainOI(makePFfixExt2(-1, 0, 0));
|
|
5169
6125
|
figPlatform.mergeFigure(figPFfixation, true);
|
|
5170
|
-
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();
|
|
5171
6127
|
const ctrBoneR = ctrBone.rotate(0, 0, aBR);
|
|
5172
6128
|
const ctrBoneL = ctrBone.rotate(0, 0, aBL);
|
|
5173
|
-
const ptR1 =
|
|
6129
|
+
const ptR1 = point10(W22 + param.E2 + R2, R2);
|
|
5174
6130
|
const ptR1b = ptR1.translatePolar(aBR, param.L2);
|
|
5175
|
-
const ptR2 =
|
|
6131
|
+
const ptR2 = point10(W22 + param.E2 + R2, Z2b + 3 * R2);
|
|
5176
6132
|
const ptR2b = ptR2.translatePolar(aBR, param.L2);
|
|
5177
|
-
const ptL1 =
|
|
6133
|
+
const ptL1 = point10(-W22 - param.E2 - R2, R2);
|
|
5178
6134
|
const ptL1b = ptL1.translatePolar(aBL, param.L2);
|
|
5179
|
-
const ptL2 =
|
|
6135
|
+
const ptL2 = point10(-W22 - param.E2 - R2, Z2b + 3 * R2);
|
|
5180
6136
|
const ptL2b = ptL2.translatePolar(aBL, param.L2);
|
|
5181
6137
|
figBones.addMainOI([
|
|
5182
6138
|
ctrBoneR.translate(ptR1.cx, ptR1.cy),
|
|
5183
|
-
|
|
5184
|
-
|
|
6139
|
+
contourCircle14(ptR1.cx, ptR1.cy, R1),
|
|
6140
|
+
contourCircle14(ptR1b.cx, ptR1b.cy, R1)
|
|
5185
6141
|
]);
|
|
5186
6142
|
figBones.addMainOI([
|
|
5187
6143
|
ctrBoneR.translate(ptR2.cx, ptR2.cy),
|
|
5188
|
-
|
|
5189
|
-
|
|
6144
|
+
contourCircle14(ptR2.cx, ptR2.cy, R1),
|
|
6145
|
+
contourCircle14(ptR2b.cx, ptR2b.cy, R1)
|
|
5190
6146
|
]);
|
|
5191
6147
|
figBones.addMainOI([
|
|
5192
6148
|
ctrBoneL.translate(ptL1.cx, ptL1.cy),
|
|
5193
|
-
|
|
5194
|
-
|
|
6149
|
+
contourCircle14(ptL1.cx, ptL1.cy, R1),
|
|
6150
|
+
contourCircle14(ptL1b.cx, ptL1b.cy, R1)
|
|
5195
6151
|
]);
|
|
5196
6152
|
figBones.addMainOI([
|
|
5197
6153
|
ctrBoneL.translate(ptL2.cx, ptL2.cy),
|
|
5198
|
-
|
|
5199
|
-
|
|
6154
|
+
contourCircle14(ptL2.cx, ptL2.cy, R1),
|
|
6155
|
+
contourCircle14(ptL2b.cx, ptL2b.cy, R1)
|
|
5200
6156
|
]);
|
|
5201
6157
|
figPlatform.mergeFigure(figBones, true);
|
|
5202
6158
|
figHandFixation.addMainOI(makePFfixExt2(-1, aBR, param.L2));
|
|
@@ -5207,17 +6163,17 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5207
6163
|
figHandPlateR.addMainOI(makeHandPlate2(pi, param.T1 + param.E2, hPposR, tPosY));
|
|
5208
6164
|
figHandPlateL.addMainOI(makeHandPlate2(0, param.T1 + param.E2, hPposL, tPosY));
|
|
5209
6165
|
}
|
|
5210
|
-
figPlatform.addSecond(
|
|
5211
|
-
figPlatform.addSecond(
|
|
5212
|
-
figPlatform.addSecond(
|
|
5213
|
-
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));
|
|
5214
6170
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
5215
6171
|
const tPosY = ii * (param.L1 + param.T1) + param.T1 + LF2;
|
|
5216
|
-
figHandBackR.addMainO(
|
|
5217
|
-
figHandBackL.addMainO(
|
|
6172
|
+
figHandBackR.addMainO(ctrRectangle9(hBposR, tPosY, param.T1, 2 * F12));
|
|
6173
|
+
figHandBackL.addMainO(ctrRectangle9(hBposL - param.T1, tPosY, param.T1, 2 * F12));
|
|
5218
6174
|
}
|
|
5219
|
-
figPlatform.addSecond(
|
|
5220
|
-
figPlatform.addSecond(
|
|
6175
|
+
figPlatform.addSecond(ctrRectangle9(hBposR, boneSideyRs, param.T1, param.Z2));
|
|
6176
|
+
figPlatform.addSecond(ctrRectangle9(hBposL - param.T1, boneSideyLs, param.T1, param.Z2));
|
|
5221
6177
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
5222
6178
|
const tPosY = ii * (param.L1 + param.T1) + param.T1 + param.L1 / 2;
|
|
5223
6179
|
figMotorBulkR.addMainOI(makeHandPlate2(wheelRA[ii], motorExtraL, hPposR, tPosY));
|
|
@@ -5227,14 +6183,14 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5227
6183
|
const mBRpY = boneSideyRs + param.T1 + param.E1;
|
|
5228
6184
|
const mBLpX = hBposL - param.T1 - param.E2 - motorLen;
|
|
5229
6185
|
const mBLpY = boneSideyLs + param.T1 + param.E1;
|
|
5230
|
-
figPlatform.addSecond(
|
|
5231
|
-
figPlatform.addSecond(
|
|
6186
|
+
figPlatform.addSecond(ctrRectangle9(mBRpX, mBRpY, motorLen, motorHeight));
|
|
6187
|
+
figPlatform.addSecond(ctrRectangle9(mBLpX, mBLpY, motorLen, motorHeight));
|
|
5232
6188
|
const mFRpX = mBRpX + F12 + param.Lmotor - mFootWidth;
|
|
5233
6189
|
const mFRpY = boneSideyRs - param.Z1 - mFootR;
|
|
5234
6190
|
const mFLpX = mBLpX;
|
|
5235
6191
|
const mFLpY = boneSideyLs - param.Z1 - mFootR;
|
|
5236
|
-
figPlatform.addSecond(
|
|
5237
|
-
figPlatform.addSecond(
|
|
6192
|
+
figPlatform.addSecond(ctrRectangle9(mFRpX, mFRpY, mFootWidth, mFootHeight));
|
|
6193
|
+
figPlatform.addSecond(ctrRectangle9(mFLpX, mFLpY, mFootWidth, mFootHeight));
|
|
5238
6194
|
figMFoot.addMainOI(makeMFoot2(0, 0));
|
|
5239
6195
|
figWheel.addMainO(makeCtrWheel2(1, 0, 0, 0));
|
|
5240
6196
|
figWheel.addSecond(makeCtrWheel2(-1, 0, 0, 0));
|
|
@@ -5243,22 +6199,22 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5243
6199
|
figPlatform.addSecond(makeCtrWheel2(1, pi2, mFLpX + mFootWidth, mFLpY + mFootR));
|
|
5244
6200
|
figPlatform.addSecond(makeCtrWheel2(-1, pi2, mFLpX + mFootWidth, mFLpY + mFootR));
|
|
5245
6201
|
figTop.addMainOI([
|
|
5246
|
-
|
|
5247
|
-
|
|
6202
|
+
ctrRectangle9(-W12, 0, param.W1, Ltotal),
|
|
6203
|
+
ctrRectangle9(-W22 + param.T1, 0, W2c, Ltotal)
|
|
5248
6204
|
]);
|
|
5249
|
-
figTop.addSecond(
|
|
6205
|
+
figTop.addSecond(ctrRectangle9(-W22, 0, param.W2, Ltotal));
|
|
5250
6206
|
if (param.triangleExt) {
|
|
5251
6207
|
for (let ii = 0; ii < 2; ii++) {
|
|
5252
6208
|
const tPosY = ii * (param.L1 + param.T1) * param.N1;
|
|
5253
|
-
figTop.addSecond(
|
|
5254
|
-
figTop.addSecond(
|
|
6209
|
+
figTop.addSecond(ctrRectangle9(-W12, tPosY, W22b, param.T1));
|
|
6210
|
+
figTop.addSecond(ctrRectangle9(W22, tPosY, W22b, param.T1));
|
|
5255
6211
|
}
|
|
5256
6212
|
}
|
|
5257
6213
|
if (param.triangleInt) {
|
|
5258
6214
|
for (let ii = 1; ii < param.N1; ii++) {
|
|
5259
6215
|
const tPosY = ii * (param.L1 + param.T1);
|
|
5260
|
-
figTop.addSecond(
|
|
5261
|
-
figTop.addSecond(
|
|
6216
|
+
figTop.addSecond(ctrRectangle9(-W12, tPosY, W22b, param.T1));
|
|
6217
|
+
figTop.addSecond(ctrRectangle9(W22, tPosY, W22b, param.T1));
|
|
5262
6218
|
}
|
|
5263
6219
|
}
|
|
5264
6220
|
const tL2 = param.E2 + 2 * R2;
|
|
@@ -5267,8 +6223,8 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5267
6223
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
5268
6224
|
for (const tPosY2 of [LF2, LF23, LF25, LF28]) {
|
|
5269
6225
|
const tPosY3 = tPosY + tPosY2;
|
|
5270
|
-
figTop.addSecond(
|
|
5271
|
-
figTop.addSecond(
|
|
6226
|
+
figTop.addSecond(ctrRectangle9(W22, tPosY3, tL2, param.T1));
|
|
6227
|
+
figTop.addSecond(ctrRectangle9(tPosX2, tPosY3, tL2, param.T1));
|
|
5272
6228
|
}
|
|
5273
6229
|
}
|
|
5274
6230
|
const tPosX3 = -W22 - param.E2 - boneTopxL;
|
|
@@ -5276,16 +6232,16 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5276
6232
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
5277
6233
|
for (const tPosY2 of [LF2, LF25]) {
|
|
5278
6234
|
const tPosY3 = tPosY + tPosY2 + param.T1 + param.E1;
|
|
5279
|
-
figTop.addSecond(
|
|
5280
|
-
figTop.addSecond(
|
|
6235
|
+
figTop.addSecond(ctrRectangle9(W22 + param.E2, tPosY3, boneTopxR, param.T1));
|
|
6236
|
+
figTop.addSecond(ctrRectangle9(tPosX3, tPosY3, boneTopxL, param.T1));
|
|
5281
6237
|
}
|
|
5282
6238
|
}
|
|
5283
6239
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
5284
6240
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
5285
6241
|
for (const tPosY2 of [LF2, LF23, LF25, LF28]) {
|
|
5286
6242
|
const tPosY3 = tPosY + tPosY2;
|
|
5287
|
-
figTop.addSecond(
|
|
5288
|
-
figTop.addSecond(
|
|
6243
|
+
figTop.addSecond(ctrRectangle9(hFposR, tPosY3, tL2, param.T1));
|
|
6244
|
+
figTop.addSecond(ctrRectangle9(hFposL, tPosY3, tL2, param.T1));
|
|
5289
6245
|
}
|
|
5290
6246
|
}
|
|
5291
6247
|
figTop.mergeFigure(figHandPlateR, true);
|
|
@@ -5294,7 +6250,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5294
6250
|
figTop.mergeFigure(figHandBackL, true);
|
|
5295
6251
|
figTop.mergeFigure(figMotorBulkR, true);
|
|
5296
6252
|
figTop.mergeFigure(figMotorBulkL, true);
|
|
5297
|
-
figTop.addPoint(
|
|
6253
|
+
figTop.addPoint(point10(rx10, ry10, ShapePoint2.eBigSquare));
|
|
5298
6254
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
5299
6255
|
const tPosY = ii * (param.L1 + param.T1) + param.T1 + param.L1 / 2;
|
|
5300
6256
|
for (const iCtr of makeTopWheel2(hPposR, tPosY, wheelRA[ii])) {
|
|
@@ -5304,18 +6260,18 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5304
6260
|
figTop.addSecond(iCtr);
|
|
5305
6261
|
}
|
|
5306
6262
|
}
|
|
5307
|
-
figSide.addMainO(
|
|
5308
|
-
figSide.addSecond(
|
|
6263
|
+
figSide.addMainO(ctrRectangle9(0, 0, Ltotal, param.H1));
|
|
6264
|
+
figSide.addSecond(ctrRectangle9(0, H1b, Ltotal, param.T1));
|
|
5309
6265
|
if (param.triangleExt) {
|
|
5310
6266
|
for (let ii = 0; ii < 2; ii++) {
|
|
5311
6267
|
const tPosY = ii * (param.L1 + param.T1) * param.N1;
|
|
5312
|
-
figSide.addSecond(
|
|
6268
|
+
figSide.addSecond(ctrRectangle9(tPosY, 0, param.T1, H1b));
|
|
5313
6269
|
}
|
|
5314
6270
|
}
|
|
5315
6271
|
if (param.triangleInt) {
|
|
5316
6272
|
for (let ii = 1; ii < param.N1; ii++) {
|
|
5317
6273
|
const tPosY = ii * (param.L1 + param.T1);
|
|
5318
|
-
figSide.addSecond(
|
|
6274
|
+
figSide.addSecond(ctrRectangle9(tPosY, 0, param.T1, H1b));
|
|
5319
6275
|
}
|
|
5320
6276
|
}
|
|
5321
6277
|
const tH2 = 2 * R2;
|
|
@@ -5323,8 +6279,8 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5323
6279
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
5324
6280
|
for (const tPosY2 of [LF2, LF23, LF25, LF28]) {
|
|
5325
6281
|
const tPosY3 = tPosY + tPosY2;
|
|
5326
|
-
figSide.addSecond(
|
|
5327
|
-
figSide.addSecond(
|
|
6282
|
+
figSide.addSecond(ctrRectangle9(tPosY3, 0, param.T1, tH2));
|
|
6283
|
+
figSide.addSecond(ctrRectangle9(tPosY3, tH2 + Z2b, param.T1, tH2));
|
|
5328
6284
|
}
|
|
5329
6285
|
}
|
|
5330
6286
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
@@ -5332,12 +6288,12 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5332
6288
|
for (const tPosY2 of [LF2, LF25]) {
|
|
5333
6289
|
const tPosY3 = tPosY + tPosY2 + param.T1 + param.E1;
|
|
5334
6290
|
if (boneSideyR > 0) {
|
|
5335
|
-
figSide.addSecond(
|
|
5336
|
-
figSide.addSecond(
|
|
6291
|
+
figSide.addSecond(ctrRectangle9(tPosY3, 0, param.T1, boneSideyR));
|
|
6292
|
+
figSide.addSecond(ctrRectangle9(tPosY3, 2 * R2 + Z2b, param.T1, boneSideyR));
|
|
5337
6293
|
} else {
|
|
5338
6294
|
const tLy = -boneSideyR;
|
|
5339
|
-
figSide.addSecond(
|
|
5340
|
-
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));
|
|
5341
6297
|
}
|
|
5342
6298
|
}
|
|
5343
6299
|
}
|
|
@@ -5345,8 +6301,8 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5345
6301
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
5346
6302
|
for (const tPosY2 of [LF2, LF23, LF25, LF28]) {
|
|
5347
6303
|
const tPosY3 = tPosY + tPosY2;
|
|
5348
|
-
figSide.addSecond(
|
|
5349
|
-
figSide.addSecond(
|
|
6304
|
+
figSide.addSecond(ctrRectangle9(tPosY3, boneSideyRs, param.T1, tH2));
|
|
6305
|
+
figSide.addSecond(ctrRectangle9(tPosY3, boneSideyRs + tH2 + Z2b, param.T1, tH2));
|
|
5350
6306
|
}
|
|
5351
6307
|
}
|
|
5352
6308
|
const ZhpR = [boneSideyRs, boneSideyRs + Z2c];
|
|
@@ -5354,17 +6310,17 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5354
6310
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
5355
6311
|
const tPosY = param.T1 + ii * (param.L1 + param.T1);
|
|
5356
6312
|
const tPosY3 = tPosY + LF2;
|
|
5357
|
-
figSide.addSecond(
|
|
5358
|
-
figSide.addSecond(
|
|
5359
|
-
figSide.addSecond(
|
|
5360
|
-
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));
|
|
5361
6317
|
const axisX = tPosY + param.L1 / 2;
|
|
5362
6318
|
const axisY = ZhpR[0] - param.Z1;
|
|
5363
6319
|
for (const iCtr of makeMFoot2(axisX, axisY)) {
|
|
5364
6320
|
figSide.addSecond(iCtr);
|
|
5365
6321
|
}
|
|
5366
|
-
figSide.addSecond(
|
|
5367
|
-
figSide.addSecond(
|
|
6322
|
+
figSide.addSecond(contourCircle14(axisX, axisY, Raxis));
|
|
6323
|
+
figSide.addSecond(contourCircle14(axisX, axisY, Rwheel));
|
|
5368
6324
|
}
|
|
5369
6325
|
rGeome.fig = {
|
|
5370
6326
|
facePlatform: figPlatform,
|
|
@@ -5389,7 +6345,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5389
6345
|
const volPlatformMain = {
|
|
5390
6346
|
outName: `subpax_${designName}_platformMain`,
|
|
5391
6347
|
face: `${designName}_facePlatform`,
|
|
5392
|
-
extrudeMethod:
|
|
6348
|
+
extrudeMethod: EExtrude14.eLinearOrtho,
|
|
5393
6349
|
length: Ltotal,
|
|
5394
6350
|
rotate: [0, 0, 0],
|
|
5395
6351
|
translate: [0, 0, 0]
|
|
@@ -5504,7 +6460,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5504
6460
|
volumes: [
|
|
5505
6461
|
{
|
|
5506
6462
|
outName: `pax_${designName}`,
|
|
5507
|
-
boolMethod:
|
|
6463
|
+
boolMethod: EBVolume14.eUnion,
|
|
5508
6464
|
inList: list3D
|
|
5509
6465
|
}
|
|
5510
6466
|
]
|
|
@@ -5521,36 +6477,36 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5521
6477
|
var rccarDef = {
|
|
5522
6478
|
pTitle: "rccar",
|
|
5523
6479
|
pDescription: "high-level concept of the RC-car",
|
|
5524
|
-
pDef:
|
|
5525
|
-
pGeom:
|
|
6480
|
+
pDef: pDef17,
|
|
6481
|
+
pGeom: pGeom17
|
|
5526
6482
|
};
|
|
5527
6483
|
|
|
5528
6484
|
// src/rccar/singleBone.ts
|
|
5529
6485
|
import {
|
|
5530
|
-
contour as
|
|
5531
|
-
contourCircle as
|
|
5532
|
-
figure as
|
|
5533
|
-
ffix as
|
|
5534
|
-
pNumber as
|
|
5535
|
-
pSectionSeparator as
|
|
5536
|
-
EExtrude as
|
|
5537
|
-
EBVolume as
|
|
5538
|
-
initGeom as
|
|
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
|
|
5539
6495
|
} from "geometrix";
|
|
5540
|
-
var
|
|
6496
|
+
var pDef18 = {
|
|
5541
6497
|
partName: "singleBone",
|
|
5542
6498
|
params: [
|
|
5543
6499
|
//pNumber(name, unit, init, min, max, step)
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
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)
|
|
5554
6510
|
],
|
|
5555
6511
|
paramSvg: {
|
|
5556
6512
|
D1: "singleBone_face.svg",
|
|
@@ -5569,9 +6525,9 @@ var pDef15 = {
|
|
|
5569
6525
|
// every 0.5 second
|
|
5570
6526
|
}
|
|
5571
6527
|
};
|
|
5572
|
-
function
|
|
5573
|
-
const rGeome =
|
|
5574
|
-
const figBone =
|
|
6528
|
+
function pGeom18(t, param, suffix = "") {
|
|
6529
|
+
const rGeome = initGeom18(pDef18.partName + suffix);
|
|
6530
|
+
const figBone = figure16();
|
|
5575
6531
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
5576
6532
|
`;
|
|
5577
6533
|
try {
|
|
@@ -5581,7 +6537,7 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5581
6537
|
const boneLen = param.L1 + 2 * R22;
|
|
5582
6538
|
const dX2 = R22 ** 2 - W12 ** 2;
|
|
5583
6539
|
if (dX2 < 0) {
|
|
5584
|
-
throw `err086: D2 ${
|
|
6540
|
+
throw `err086: D2 ${ffix19(param.D2)} is too small compare to W1 ${ffix19(param.W1)} mm`;
|
|
5585
6541
|
}
|
|
5586
6542
|
const dX = Math.sqrt(dX2);
|
|
5587
6543
|
const L1b = param.L1 - 2 * dX;
|
|
@@ -5592,24 +6548,24 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5592
6548
|
const hX0b = R22 + W2b + Rh;
|
|
5593
6549
|
const hX1b = W2b + 2 * Rh;
|
|
5594
6550
|
if (R22 < R12) {
|
|
5595
|
-
throw `err085: D2 ${
|
|
6551
|
+
throw `err085: D2 ${ffix19(param.D2)} is too small compare to D1 ${ffix19(param.D1)} mm`;
|
|
5596
6552
|
}
|
|
5597
6553
|
if (L1b < 0) {
|
|
5598
|
-
throw `err095: L1 ${
|
|
6554
|
+
throw `err095: L1 ${ffix19(param.L1)} is too small compare to D2 ${ffix19(param.D2)} mm`;
|
|
5599
6555
|
}
|
|
5600
|
-
rGeome.logstr += `Bone length ${
|
|
6556
|
+
rGeome.logstr += `Bone length ${ffix19(boneLen)} mm
|
|
5601
6557
|
`;
|
|
5602
|
-
rGeome.logstr += `Bone with N2 ${N2} holes of diameter ${
|
|
6558
|
+
rGeome.logstr += `Bone with N2 ${N2} holes of diameter ${ffix19(2 * Rh)} mm
|
|
5603
6559
|
`;
|
|
5604
|
-
rGeome.logstr += `Bone W2b ${
|
|
6560
|
+
rGeome.logstr += `Bone W2b ${ffix19(W2b)} mm
|
|
5605
6561
|
`;
|
|
5606
|
-
const ctrBone =
|
|
5607
|
-
const ctrAxis1 =
|
|
5608
|
-
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);
|
|
5609
6565
|
const ctrMinis = [];
|
|
5610
6566
|
if (Rh > 0) {
|
|
5611
6567
|
for (let ii = 0; ii < N2; ii++) {
|
|
5612
|
-
ctrMinis.push(
|
|
6568
|
+
ctrMinis.push(contourCircle15(hX0b + ii * hX1b, 0, Rh));
|
|
5613
6569
|
}
|
|
5614
6570
|
}
|
|
5615
6571
|
figBone.addMainOI([ctrBone, ctrAxis1, ctrAxis2, ...ctrMinis]);
|
|
@@ -5622,7 +6578,7 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5622
6578
|
{
|
|
5623
6579
|
outName: `subpax_${designName}_bone`,
|
|
5624
6580
|
face: `${designName}_faceBone`,
|
|
5625
|
-
extrudeMethod:
|
|
6581
|
+
extrudeMethod: EExtrude15.eLinearOrtho,
|
|
5626
6582
|
length: param.T1,
|
|
5627
6583
|
rotate: [0, 0, 0],
|
|
5628
6584
|
translate: [0, 0, 0]
|
|
@@ -5631,7 +6587,7 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5631
6587
|
volumes: [
|
|
5632
6588
|
{
|
|
5633
6589
|
outName: `pax_${designName}`,
|
|
5634
|
-
boolMethod:
|
|
6590
|
+
boolMethod: EBVolume15.eIdentity,
|
|
5635
6591
|
inList: [`subpax_${designName}_bone`]
|
|
5636
6592
|
}
|
|
5637
6593
|
]
|
|
@@ -5648,18 +6604,18 @@ function pGeom15(t, param, suffix = "") {
|
|
|
5648
6604
|
var singleBoneDef = {
|
|
5649
6605
|
pTitle: "singleBone",
|
|
5650
6606
|
pDescription: "detailed design of the suspension bone of the rccar",
|
|
5651
|
-
pDef:
|
|
5652
|
-
pGeom:
|
|
6607
|
+
pDef: pDef18,
|
|
6608
|
+
pGeom: pGeom18
|
|
5653
6609
|
};
|
|
5654
6610
|
|
|
5655
6611
|
// src/rccar/doubleBone.ts
|
|
5656
6612
|
import {
|
|
5657
|
-
contourCircle as
|
|
5658
|
-
degToRad as
|
|
5659
|
-
ffix as
|
|
5660
|
-
pNumber as
|
|
5661
|
-
pSectionSeparator as
|
|
5662
|
-
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
|
|
5663
6619
|
} from "geometrix";
|
|
5664
6620
|
import {
|
|
5665
6621
|
tJDir as tJDir4,
|
|
@@ -5668,37 +6624,37 @@ import {
|
|
|
5668
6624
|
facet as facet4,
|
|
5669
6625
|
sheetFold as sheetFold4
|
|
5670
6626
|
} from "sheetfold";
|
|
5671
|
-
var
|
|
6627
|
+
var pDef19 = {
|
|
5672
6628
|
partName: "doubleBone",
|
|
5673
6629
|
params: [
|
|
5674
6630
|
//pNumber(name, unit, init, min, max, step)
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
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)
|
|
5702
6658
|
],
|
|
5703
6659
|
paramSvg: {
|
|
5704
6660
|
D1: "doubleBone_face.svg",
|
|
@@ -5732,8 +6688,8 @@ var pDef16 = {
|
|
|
5732
6688
|
// every 0.5 second
|
|
5733
6689
|
}
|
|
5734
6690
|
};
|
|
5735
|
-
function
|
|
5736
|
-
const rGeome =
|
|
6691
|
+
function pGeom19(t, param, suffix = "") {
|
|
6692
|
+
const rGeome = initGeom19(pDef19.partName + suffix);
|
|
5737
6693
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
5738
6694
|
`;
|
|
5739
6695
|
try {
|
|
@@ -5743,7 +6699,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5743
6699
|
return [rA, rInitDist];
|
|
5744
6700
|
}, calcSplitTri2 = function(iL, iP) {
|
|
5745
6701
|
if (iL < 0) {
|
|
5746
|
-
throw `err559: iL ${
|
|
6702
|
+
throw `err559: iL ${ffix20(iL)} is negative mm`;
|
|
5747
6703
|
}
|
|
5748
6704
|
let rLside = iL;
|
|
5749
6705
|
let rLcenter = 0;
|
|
@@ -5796,7 +6752,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5796
6752
|
const boneLen = param.L1 + 2 * R22;
|
|
5797
6753
|
const dX2 = R22 ** 2 - W12 ** 2;
|
|
5798
6754
|
if (dX2 < 0) {
|
|
5799
|
-
throw `err086: D2 ${
|
|
6755
|
+
throw `err086: D2 ${ffix20(param.D2)} is too small compare to W1 ${ffix20(param.W1)} mm`;
|
|
5800
6756
|
}
|
|
5801
6757
|
const dX = Math.sqrt(dX2);
|
|
5802
6758
|
const L1b = param.L1 - 2 * dX;
|
|
@@ -5806,7 +6762,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5806
6762
|
const W2b = (param.L1 - 2 * R22 - N2 * 2 * Rh) / (N2 + 1);
|
|
5807
6763
|
const hX0b = R22 + W2b + Rh;
|
|
5808
6764
|
const hX1b = W2b + 2 * Rh;
|
|
5809
|
-
const aJa =
|
|
6765
|
+
const aJa = degToRad9(param.Jangle);
|
|
5810
6766
|
const aJn = param.Jneutral / 100;
|
|
5811
6767
|
const aJr = param.Jradius;
|
|
5812
6768
|
const aJm = param.Jmark;
|
|
@@ -5836,29 +6792,29 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5836
6792
|
const [tri22s, tri22c] = calcSplitTri2(tri22L, param.P22);
|
|
5837
6793
|
const wingH = param.W1 / 2 + cornerSizeInt - cornerSizeInt2;
|
|
5838
6794
|
if (R22 < R12) {
|
|
5839
|
-
throw `err085: D2 ${
|
|
6795
|
+
throw `err085: D2 ${ffix20(param.D2)} is too small compare to D1 ${ffix20(param.D1)} mm`;
|
|
5840
6796
|
}
|
|
5841
6797
|
if (L1b < 0) {
|
|
5842
|
-
throw `err095: L1 ${
|
|
6798
|
+
throw `err095: L1 ${ffix20(param.L1)} is too small compare to D2 ${ffix20(param.D2)} mm`;
|
|
5843
6799
|
}
|
|
5844
6800
|
if (param.E1 < cornerSizeInt) {
|
|
5845
|
-
throw `err151: E1 ${
|
|
6801
|
+
throw `err151: E1 ${ffix20(param.E1)} is too small compare to Jradius ${ffix20(param.Jradius)} mm`;
|
|
5846
6802
|
}
|
|
5847
6803
|
if (L2c < 0) {
|
|
5848
|
-
throw `err150: L2 ${
|
|
6804
|
+
throw `err150: L2 ${ffix20(param.L2)} is too small compare to E1 ${ffix20(param.E1)} mm`;
|
|
5849
6805
|
}
|
|
5850
|
-
rGeome.logstr += `Bone length ${
|
|
6806
|
+
rGeome.logstr += `Bone length ${ffix20(boneLen)} mm
|
|
5851
6807
|
`;
|
|
5852
|
-
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
|
|
5853
6809
|
`;
|
|
5854
|
-
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
|
|
5855
6811
|
`;
|
|
5856
|
-
const ctrAxis1 =
|
|
5857
|
-
const ctrAxis2 =
|
|
6812
|
+
const ctrAxis1 = contourCircle16(0, 0, R12);
|
|
6813
|
+
const ctrAxis2 = contourCircle16(param.L1, 0, R12);
|
|
5858
6814
|
const ctrMinis = [];
|
|
5859
6815
|
if (Rh > 0) {
|
|
5860
6816
|
for (let ii = 0; ii < N2; ii++) {
|
|
5861
|
-
ctrMinis.push(
|
|
6817
|
+
ctrMinis.push(contourCircle16(hX0b + ii * hX1b, 0, Rh));
|
|
5862
6818
|
}
|
|
5863
6819
|
}
|
|
5864
6820
|
const ctrBone1 = makeCtrBone2("J1", "J2");
|
|
@@ -5888,7 +6844,7 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5888
6844
|
const ctrMinics = [];
|
|
5889
6845
|
if (Rh > 0) {
|
|
5890
6846
|
for (let ii = 0; ii < N2c; ii++) {
|
|
5891
|
-
ctrMinics.push(
|
|
6847
|
+
ctrMinics.push(contourCircle16(hX0c + ii * hX1c, W12, Rh));
|
|
5892
6848
|
}
|
|
5893
6849
|
}
|
|
5894
6850
|
const faSide1 = facet4([makeCtrSide2("J11"), ...ctrMinics]);
|
|
@@ -5950,73 +6906,73 @@ function pGeom16(t, param, suffix = "") {
|
|
|
5950
6906
|
var doubleBoneDef = {
|
|
5951
6907
|
pTitle: "doubleBone",
|
|
5952
6908
|
pDescription: "combined suspension bones of the rccar",
|
|
5953
|
-
pDef:
|
|
5954
|
-
pGeom:
|
|
6909
|
+
pDef: pDef19,
|
|
6910
|
+
pGeom: pGeom19
|
|
5955
6911
|
};
|
|
5956
6912
|
|
|
5957
6913
|
// src/rccar/pcar.ts
|
|
5958
6914
|
import {
|
|
5959
|
-
contour as
|
|
5960
|
-
contourCircle as
|
|
5961
|
-
figure as
|
|
5962
|
-
ffix as
|
|
5963
|
-
pNumber as
|
|
5964
|
-
pSectionSeparator as
|
|
5965
|
-
EExtrude as
|
|
5966
|
-
EBVolume as
|
|
5967
|
-
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
|
|
5968
6924
|
} from "geometrix";
|
|
5969
|
-
var
|
|
6925
|
+
var pDef20 = {
|
|
5970
6926
|
partName: "pcar",
|
|
5971
6927
|
params: [
|
|
5972
6928
|
//pNumber(name, unit, init, min, max, step)
|
|
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
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
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)
|
|
6020
6976
|
],
|
|
6021
6977
|
paramSvg: {
|
|
6022
6978
|
LB1: "pcar_side.svg",
|
|
@@ -6071,13 +7027,13 @@ var pDef17 = {
|
|
|
6071
7027
|
// every 0.5 second
|
|
6072
7028
|
}
|
|
6073
7029
|
};
|
|
6074
|
-
function
|
|
6075
|
-
const rGeome =
|
|
6076
|
-
const figSideWiWheels =
|
|
6077
|
-
const figSideWoWheels =
|
|
6078
|
-
const figTop =
|
|
6079
|
-
const figFront =
|
|
6080
|
-
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();
|
|
6081
7037
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
6082
7038
|
`;
|
|
6083
7039
|
try {
|
|
@@ -6090,7 +7046,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6090
7046
|
const rEF = EG / Math.cos(aAED);
|
|
6091
7047
|
return rEF;
|
|
6092
7048
|
}, makeCtrSide2 = function(withWheels) {
|
|
6093
|
-
const rCtr =
|
|
7049
|
+
const rCtr = contour20(-param.LB1, BodyY0).addCornerRounded(param.Rs1);
|
|
6094
7050
|
if (withWheels) {
|
|
6095
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);
|
|
6096
7052
|
} else {
|
|
@@ -6099,7 +7055,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6099
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();
|
|
6100
7056
|
return rCtr;
|
|
6101
7057
|
}, makeCtrWheel2 = function(sX, x0, y0, r0) {
|
|
6102
|
-
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);
|
|
6103
7059
|
return rCtr;
|
|
6104
7060
|
};
|
|
6105
7061
|
var calcCR = calcCR2, makeCtrSide = makeCtrSide2, makeCtrWheel = makeCtrWheel2;
|
|
@@ -6125,7 +7081,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6125
7081
|
const Ct3b = param.LB3 - (param.Ct3 + RW3);
|
|
6126
7082
|
const dXwheel2 = RW3 ** 2 - param.HW1 ** 2;
|
|
6127
7083
|
if (dXwheel2 < 0) {
|
|
6128
|
-
throw `err158: dXwheel2 ${
|
|
7084
|
+
throw `err158: dXwheel2 ${ffix21(dXwheel2)} is negative because of HW1 ${ffix21(param.HW1)} and RW3 ${ffix21(RW3)} mm`;
|
|
6129
7085
|
}
|
|
6130
7086
|
const dXwheel = Math.sqrt(RW3 ** 2 - param.HW1 ** 2);
|
|
6131
7087
|
const LB1b = param.LB1 - dXwheel;
|
|
@@ -6142,59 +7098,59 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6142
7098
|
const CRf2 = calcCR2(param.Wf2, Wf1b, param.Cf2);
|
|
6143
7099
|
const CRf3 = calcCR2(Wf2b, 0, param.Cf3);
|
|
6144
7100
|
if (BodyY0 < 0) {
|
|
6145
|
-
throw `err147: DW2 ${
|
|
7101
|
+
throw `err147: DW2 ${ffix21(param.DW2)} is too small comapre to HW1 ${ffix21(param.HW1)} mm`;
|
|
6146
7102
|
}
|
|
6147
7103
|
if (LT2 < 0) {
|
|
6148
|
-
throw `err169: LT2 ${
|
|
7104
|
+
throw `err169: LT2 ${ffix21(LT2)} mm is negative`;
|
|
6149
7105
|
}
|
|
6150
7106
|
if (HF3b < 0) {
|
|
6151
|
-
throw `err174: HF3b ${
|
|
7107
|
+
throw `err174: HF3b ${ffix21(HF3b)} mm is negative`;
|
|
6152
7108
|
}
|
|
6153
7109
|
if (HB1b < 0) {
|
|
6154
|
-
throw `err178: HB1b ${
|
|
7110
|
+
throw `err178: HB1b ${ffix21(HB1b)} mm is negative`;
|
|
6155
7111
|
}
|
|
6156
7112
|
if (HB2 < 0) {
|
|
6157
|
-
throw `err172: HB2 ${
|
|
7113
|
+
throw `err172: HB2 ${ffix21(HB2)} mm is negative`;
|
|
6158
7114
|
}
|
|
6159
7115
|
if (Wf1b < 0) {
|
|
6160
|
-
throw `err161: Wf1b ${
|
|
7116
|
+
throw `err161: Wf1b ${ffix21(Wf1b)} mm is negative`;
|
|
6161
7117
|
}
|
|
6162
7118
|
if (Wf2b < 0) {
|
|
6163
|
-
throw `err164: Wf2b ${
|
|
7119
|
+
throw `err164: Wf2b ${ffix21(Wf2b)} mm is negative`;
|
|
6164
7120
|
}
|
|
6165
7121
|
if (Cf1b < 0) {
|
|
6166
|
-
throw `err167: Cf1b ${
|
|
7122
|
+
throw `err167: Cf1b ${ffix21(Cf1b)} mm is negative`;
|
|
6167
7123
|
}
|
|
6168
7124
|
if (Ct1b < 0) {
|
|
6169
|
-
throw `err170: Ct1b ${
|
|
7125
|
+
throw `err170: Ct1b ${ffix21(Ct1b)} mm is negative`;
|
|
6170
7126
|
}
|
|
6171
7127
|
if (Ct2b < 0) {
|
|
6172
|
-
throw `err173: Ct2b ${
|
|
7128
|
+
throw `err173: Ct2b ${ffix21(Ct2b)} mm is negative`;
|
|
6173
7129
|
}
|
|
6174
7130
|
if (Ct3b < 0) {
|
|
6175
|
-
throw `err176: Ct3b ${
|
|
7131
|
+
throw `err176: Ct3b ${ffix21(Ct3b)} mm is negative`;
|
|
6176
7132
|
}
|
|
6177
7133
|
if (LB1b < 0) {
|
|
6178
|
-
throw `err185: LB1b ${
|
|
7134
|
+
throw `err185: LB1b ${ffix21(LB1b)} mm is negative`;
|
|
6179
7135
|
}
|
|
6180
7136
|
if (LB2b < 0) {
|
|
6181
|
-
throw `err189: LB2b ${
|
|
7137
|
+
throw `err189: LB2b ${ffix21(LB2b)} mm is negative`;
|
|
6182
7138
|
}
|
|
6183
7139
|
if (LB3b < 0) {
|
|
6184
|
-
throw `err193: LB3b ${
|
|
7140
|
+
throw `err193: LB3b ${ffix21(LB3b)} mm is negative`;
|
|
6185
7141
|
}
|
|
6186
|
-
rGeome.logstr += `Body: Y0 ${
|
|
7142
|
+
rGeome.logstr += `Body: Y0 ${ffix21(BodyY0)}, Height ${ffix21(BodyHeight)}, Lenght: ${ffix21(BodyLength)}, Width: ${ffix21(BodyWidth)} mm
|
|
6187
7143
|
`;
|
|
6188
7144
|
figSideWiWheels.addMainO(makeCtrSide2(true));
|
|
6189
|
-
figSideWiWheels.addSecond(
|
|
6190
|
-
figSideWiWheels.addSecond(
|
|
6191
|
-
figSideWiWheels.addSecond(
|
|
6192
|
-
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));
|
|
6193
7149
|
figSideWoWheels.addMainO(makeCtrSide2(false));
|
|
6194
7150
|
figSideWoWheels.mergeFigure(figSideWiWheels, true);
|
|
6195
|
-
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);
|
|
6196
7152
|
figTop.addMainO(ctrTop);
|
|
6197
|
-
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);
|
|
6198
7154
|
figFront.addMainO(ctrFront);
|
|
6199
7155
|
figWheel.addMainO(makeCtrWheel2(1, 0, 0, 0));
|
|
6200
7156
|
figWheel.addSecond(makeCtrWheel2(-1, 0, 0, 0));
|
|
@@ -6223,7 +7179,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6223
7179
|
{
|
|
6224
7180
|
outName: `subpax_${designName}_sideWiW1`,
|
|
6225
7181
|
face: `${designName}_faceSideWiWheels`,
|
|
6226
|
-
extrudeMethod:
|
|
7182
|
+
extrudeMethod: EExtrude16.eLinearOrtho,
|
|
6227
7183
|
length: param.Wt1,
|
|
6228
7184
|
rotate: [pi2, 0, 0],
|
|
6229
7185
|
translate: [0, param.Wt1, 0]
|
|
@@ -6231,7 +7187,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6231
7187
|
{
|
|
6232
7188
|
outName: `subpax_${designName}_sideWiW2`,
|
|
6233
7189
|
face: `${designName}_faceSideWiWheels`,
|
|
6234
|
-
extrudeMethod:
|
|
7190
|
+
extrudeMethod: EExtrude16.eLinearOrtho,
|
|
6235
7191
|
length: param.Wt1,
|
|
6236
7192
|
rotate: [pi2, 0, 0],
|
|
6237
7193
|
translate: [0, param.Wt2 + 2 * param.Wt1, 0]
|
|
@@ -6239,7 +7195,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6239
7195
|
{
|
|
6240
7196
|
outName: `subpax_${designName}_sideWoW`,
|
|
6241
7197
|
face: `${designName}_faceSideWoWheels`,
|
|
6242
|
-
extrudeMethod:
|
|
7198
|
+
extrudeMethod: EExtrude16.eLinearOrtho,
|
|
6243
7199
|
length: param.Wt2,
|
|
6244
7200
|
rotate: [pi2, 0, 0],
|
|
6245
7201
|
translate: [0, param.Wt2 + param.Wt1, 0]
|
|
@@ -6247,7 +7203,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6247
7203
|
{
|
|
6248
7204
|
outName: `subpax_${designName}_front`,
|
|
6249
7205
|
face: `${designName}_faceFront`,
|
|
6250
|
-
extrudeMethod:
|
|
7206
|
+
extrudeMethod: EExtrude16.eLinearOrtho,
|
|
6251
7207
|
length: BodyLength,
|
|
6252
7208
|
rotate: [pi2, 0, pi2],
|
|
6253
7209
|
translate: [-param.LB1, 0, 0]
|
|
@@ -6255,7 +7211,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6255
7211
|
{
|
|
6256
7212
|
outName: `subpax_${designName}_top`,
|
|
6257
7213
|
face: `${designName}_faceTop`,
|
|
6258
|
-
extrudeMethod:
|
|
7214
|
+
extrudeMethod: EExtrude16.eLinearOrtho,
|
|
6259
7215
|
length: BodyHeight + BodyY0,
|
|
6260
7216
|
rotate: [0, 0, 0],
|
|
6261
7217
|
translate: [0, 0, 0]
|
|
@@ -6263,28 +7219,28 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6263
7219
|
{
|
|
6264
7220
|
outName: `subpax_${designName}_wheel11`,
|
|
6265
7221
|
face: `${designName}_faceWheel`,
|
|
6266
|
-
extrudeMethod:
|
|
7222
|
+
extrudeMethod: EExtrude16.eRotate,
|
|
6267
7223
|
rotate: [pi2, 0, 0],
|
|
6268
7224
|
translate: [0, param.Wt1, RW2]
|
|
6269
7225
|
},
|
|
6270
7226
|
{
|
|
6271
7227
|
outName: `subpax_${designName}_wheel12`,
|
|
6272
7228
|
face: `${designName}_faceWheel`,
|
|
6273
|
-
extrudeMethod:
|
|
7229
|
+
extrudeMethod: EExtrude16.eRotate,
|
|
6274
7230
|
rotate: [-pi2, 0, 0],
|
|
6275
7231
|
translate: [0, param.Wt1 + param.Wt2, RW2]
|
|
6276
7232
|
},
|
|
6277
7233
|
{
|
|
6278
7234
|
outName: `subpax_${designName}_wheel21`,
|
|
6279
7235
|
face: `${designName}_faceWheel`,
|
|
6280
|
-
extrudeMethod:
|
|
7236
|
+
extrudeMethod: EExtrude16.eRotate,
|
|
6281
7237
|
rotate: [pi2, 0, 0],
|
|
6282
7238
|
translate: [param.LB2, param.Wt1, RW2]
|
|
6283
7239
|
},
|
|
6284
7240
|
{
|
|
6285
7241
|
outName: `subpax_${designName}_wheel22`,
|
|
6286
7242
|
face: `${designName}_faceWheel`,
|
|
6287
|
-
extrudeMethod:
|
|
7243
|
+
extrudeMethod: EExtrude16.eRotate,
|
|
6288
7244
|
rotate: [-pi2, 0, 0],
|
|
6289
7245
|
translate: [param.LB2, param.Wt1 + param.Wt2, RW2]
|
|
6290
7246
|
}
|
|
@@ -6292,7 +7248,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6292
7248
|
volumes: [
|
|
6293
7249
|
{
|
|
6294
7250
|
outName: `ipax_${designName}_side`,
|
|
6295
|
-
boolMethod:
|
|
7251
|
+
boolMethod: EBVolume16.eUnion,
|
|
6296
7252
|
inList: [
|
|
6297
7253
|
`subpax_${designName}_sideWiW1`,
|
|
6298
7254
|
`subpax_${designName}_sideWiW2`,
|
|
@@ -6301,7 +7257,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6301
7257
|
},
|
|
6302
7258
|
{
|
|
6303
7259
|
outName: `ipax_${designName}_body`,
|
|
6304
|
-
boolMethod:
|
|
7260
|
+
boolMethod: EBVolume16.eIntersection,
|
|
6305
7261
|
inList: [
|
|
6306
7262
|
`ipax_${designName}_side`,
|
|
6307
7263
|
`subpax_${designName}_front`,
|
|
@@ -6310,7 +7266,7 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6310
7266
|
},
|
|
6311
7267
|
{
|
|
6312
7268
|
outName: `pax_${designName}`,
|
|
6313
|
-
boolMethod:
|
|
7269
|
+
boolMethod: EBVolume16.eUnion,
|
|
6314
7270
|
inList: [
|
|
6315
7271
|
`ipax_${designName}_body`,
|
|
6316
7272
|
`subpax_${designName}_wheel11`,
|
|
@@ -6333,82 +7289,82 @@ function pGeom17(t, param, suffix = "") {
|
|
|
6333
7289
|
var pcarDef = {
|
|
6334
7290
|
pTitle: "pcar",
|
|
6335
7291
|
pDescription: "the envelop of a passager car",
|
|
6336
|
-
pDef:
|
|
6337
|
-
pGeom:
|
|
7292
|
+
pDef: pDef20,
|
|
7293
|
+
pGeom: pGeom20
|
|
6338
7294
|
};
|
|
6339
7295
|
|
|
6340
7296
|
// src/capsule/capsule.ts
|
|
6341
7297
|
import {
|
|
6342
|
-
point as
|
|
6343
|
-
contour as
|
|
6344
|
-
contourCircle as
|
|
6345
|
-
ctrRectangle as
|
|
6346
|
-
figure as
|
|
6347
|
-
ffix as
|
|
6348
|
-
pNumber as
|
|
6349
|
-
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,
|
|
6350
7306
|
pDropdown as pDropdown9,
|
|
6351
|
-
pSectionSeparator as
|
|
6352
|
-
EExtrude as
|
|
6353
|
-
EBVolume as
|
|
6354
|
-
initGeom as
|
|
7307
|
+
pSectionSeparator as pSectionSeparator21,
|
|
7308
|
+
EExtrude as EExtrude17,
|
|
7309
|
+
EBVolume as EBVolume17,
|
|
7310
|
+
initGeom as initGeom21
|
|
6355
7311
|
} from "geometrix";
|
|
6356
|
-
var
|
|
7312
|
+
var pDef21 = {
|
|
6357
7313
|
partName: "capsule",
|
|
6358
7314
|
params: [
|
|
6359
7315
|
//pNumber(name, unit, init, min, max, step)
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
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"),
|
|
6393
7349
|
pDropdown9("topStyle", ["mirador", "sky", "roof"]),
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
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)
|
|
6412
7368
|
],
|
|
6413
7369
|
paramSvg: {
|
|
6414
7370
|
L1: "capsule_side.svg",
|
|
@@ -6465,21 +7421,21 @@ var pDef18 = {
|
|
|
6465
7421
|
// every 0.5 second
|
|
6466
7422
|
}
|
|
6467
7423
|
};
|
|
6468
|
-
function
|
|
6469
|
-
const rGeome =
|
|
6470
|
-
const figBody =
|
|
6471
|
-
const figWheels =
|
|
6472
|
-
const figFront =
|
|
6473
|
-
const figTop =
|
|
6474
|
-
const figTopInt =
|
|
6475
|
-
const figTopTop =
|
|
6476
|
-
const figTopLeg =
|
|
6477
|
-
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();
|
|
6478
7434
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
6479
7435
|
`;
|
|
6480
7436
|
try {
|
|
6481
7437
|
let ctrBody2 = function(withBat) {
|
|
6482
|
-
const rCtr =
|
|
7438
|
+
const rCtr = contour21(-L12, param.H0);
|
|
6483
7439
|
if (withBat) {
|
|
6484
7440
|
rCtr.addSegStrokeR(Wwheels, 0).addSegStrokeR(0, -Hbatterie).addSegStrokeR(Lbatterie, 0).addSegStrokeR(0, Hbatterie).addSegStrokeR(Wwheels, 0);
|
|
6485
7441
|
} else {
|
|
@@ -6488,21 +7444,21 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6488
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);
|
|
6489
7445
|
return rCtr;
|
|
6490
7446
|
}, ctrWheels2 = function(sign) {
|
|
6491
|
-
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();
|
|
6492
7448
|
return rCtr;
|
|
6493
7449
|
}, makeCtrTop2 = function(radius) {
|
|
6494
|
-
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();
|
|
6495
7451
|
return rCtr;
|
|
6496
7452
|
}, ctrSideWindow2 = function(sign) {
|
|
6497
7453
|
const p0x = sign * (Ltotal / 2 - param.U1);
|
|
6498
7454
|
const p0y = param.H0 + param.H1 + param.H2 - UH2dy;
|
|
6499
|
-
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();
|
|
6500
7456
|
return rCtr;
|
|
6501
7457
|
}, volWheel2 = function(posX, idx) {
|
|
6502
7458
|
return {
|
|
6503
7459
|
outName: `subpax_${designName}_wheel${idx}`,
|
|
6504
7460
|
face: `${designName}_faceWheels`,
|
|
6505
|
-
extrudeMethod:
|
|
7461
|
+
extrudeMethod: EExtrude17.eRotate,
|
|
6506
7462
|
rotate: [0, 0, 0],
|
|
6507
7463
|
translate: [posX, R7, 0]
|
|
6508
7464
|
};
|
|
@@ -6510,7 +7466,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6510
7466
|
return {
|
|
6511
7467
|
outName: `subpax_${designName}_topLeg${idx}`,
|
|
6512
7468
|
face: `${designName}_faceTopLeg`,
|
|
6513
|
-
extrudeMethod:
|
|
7469
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6514
7470
|
length: E1,
|
|
6515
7471
|
rotate: [0, rotY, 0],
|
|
6516
7472
|
translate: [posX, 0, posZ]
|
|
@@ -6527,9 +7483,9 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6527
7483
|
const Lbatterie = param.L1 - 2 * Wwheels;
|
|
6528
7484
|
const Lroof = param.L1 + 2 * param.W1 - 2 * param.W3;
|
|
6529
7485
|
const aN1 = Math.atan2(param.H3, -param.W3);
|
|
6530
|
-
const p1 =
|
|
7486
|
+
const p1 = point11(0, 0).translate(-param.W3 / 2, param.H3 / 2).translatePolar(aN1 - pi2, param.C3);
|
|
6531
7487
|
const aN2 = Math.atan2(-param.H3, -param.W3);
|
|
6532
|
-
const p2 =
|
|
7488
|
+
const p2 = point11(0, 0).translate(-param.W3 / 2, -param.H3 / 2).translatePolar(aN2 - pi2, param.C3);
|
|
6533
7489
|
const aN3 = Math.atan2(param.H1, -param.W1);
|
|
6534
7490
|
const L1dx = E1 / Math.tan(aN3 / 2);
|
|
6535
7491
|
const H2dy = E1 / Math.tan((3 * pi2 - aN3) / 2);
|
|
@@ -6538,8 +7494,8 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6538
7494
|
const W3dx = E1 / Math.tan((3 * pi2 - aN4) / 2);
|
|
6539
7495
|
const W3b = param.W3 - E1 + W3dx;
|
|
6540
7496
|
const H3b = param.H3 - E1 + H3dy;
|
|
6541
|
-
const p1b =
|
|
6542
|
-
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);
|
|
6543
7499
|
const iR1 = Math.max(0, param.R1 - E1);
|
|
6544
7500
|
const iR2 = Math.max(0, param.R2 - E1);
|
|
6545
7501
|
const iR3 = Math.max(0, param.R3 - E1);
|
|
@@ -6547,7 +7503,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6547
7503
|
const UH2dy = param.U1 / Math.tan((3 * pi2 - aN3) / 2);
|
|
6548
7504
|
const UW3b = param.W3 - param.U1 + param.U1 / Math.tan((3 * pi2 - aN4) / 2);
|
|
6549
7505
|
const UH3b = param.H3 - param.U1 + param.U1 / Math.tan(aN4 / 2);
|
|
6550
|
-
const p1ub =
|
|
7506
|
+
const p1ub = point11(0, 0).translate(-UW3b / 2, UH3b / 2).translatePolar(aN1 - pi2, param.C3);
|
|
6551
7507
|
const Ltotal = param.L1 + 2 * param.W1;
|
|
6552
7508
|
const Htotal = param.H1 + param.H2 + param.H3;
|
|
6553
7509
|
const LwallDoor = Ltotal - 2 * (param.U1 + UW3b + param.U2 + param.U3);
|
|
@@ -6582,62 +7538,62 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6582
7538
|
const HfrontWin = Htotal - param.FH1 - param.FH3;
|
|
6583
7539
|
const Ltot2 = Ltotal + 200;
|
|
6584
7540
|
if (param.L1 - 2 * Wwheels < 2 * E1) {
|
|
6585
|
-
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`;
|
|
6586
7542
|
}
|
|
6587
7543
|
if (Hbatterie < E1) {
|
|
6588
|
-
throw `err114: Hbatterie ${
|
|
7544
|
+
throw `err114: Hbatterie ${ffix22(Hbatterie)} is too small compare to E1 ${ffix22(E1)} mm`;
|
|
6589
7545
|
}
|
|
6590
7546
|
if (Lbatterie < 2 * E1) {
|
|
6591
|
-
throw `err118: Lbatterie ${
|
|
7547
|
+
throw `err118: Lbatterie ${ffix22(Lbatterie)} is too small compare to E1 ${ffix22(E1)} mm`;
|
|
6592
7548
|
}
|
|
6593
7549
|
if (L5 < 3 * param.R5 + param.W5) {
|
|
6594
|
-
throw `err122: L5 ${
|
|
7550
|
+
throw `err122: L5 ${ffix22(L5)} is too small compare to W5 ${ffix22(param.W5)} and R5 ${ffix22(param.R5)} mm`;
|
|
6595
7551
|
}
|
|
6596
7552
|
if (H53 < 0.1) {
|
|
6597
|
-
throw `err220: H5 ${
|
|
7553
|
+
throw `err220: H5 ${ffix22(param.H5)} is too small compare to R5 ${ffix22(param.R5)} mm`;
|
|
6598
7554
|
}
|
|
6599
|
-
rGeome.logstr += `Platform surface: ${
|
|
7555
|
+
rGeome.logstr += `Platform surface: ${ffix22(platSurface)} m2, height: ${ffix22(heightTot / 1e3)} m
|
|
6600
7556
|
`;
|
|
6601
|
-
rGeome.logstr += `Lroof: ${
|
|
7557
|
+
rGeome.logstr += `Lroof: ${ffix22(Lroof)}, L5: ${ffix22(L5)} mm
|
|
6602
7558
|
`;
|
|
6603
|
-
rGeome.logstr += `Ltotal: ${
|
|
7559
|
+
rGeome.logstr += `Ltotal: ${ffix22(Ltotal / 1e3)}, Htotal: ${ffix22(Htotal / 1e3)} m
|
|
6604
7560
|
`;
|
|
6605
|
-
rGeome.logstr += `Batterie: LbatInt ${
|
|
7561
|
+
rGeome.logstr += `Batterie: LbatInt ${ffix22(LbatInt)}, HbatInt: ${ffix22(HbatInt)}, WW1 ${ffix22(param.WW1)} mm
|
|
6606
7562
|
`;
|
|
6607
7563
|
const ctrBodyExt = ctrBody2(true);
|
|
6608
|
-
const ctrBodyInt =
|
|
6609
|
-
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);
|
|
6610
7566
|
figBody.addMainOI([ctrBodyExt, ctrBodyInt, ctrBatterie]);
|
|
6611
|
-
figBody.addSecond(
|
|
6612
|
-
figBody.addSecond(
|
|
6613
|
-
figBody.addSecond(
|
|
6614
|
-
figBody.addSecond(
|
|
6615
|
-
figBody.addSecond(
|
|
6616
|
-
figBody.addSecond(
|
|
6617
|
-
figBody.addSecond(
|
|
6618
|
-
figBody.addSecond(
|
|
6619
|
-
figBody.addSecond(
|
|
6620
|
-
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));
|
|
6621
7577
|
figWheels.addMainO(ctrWheels2(1));
|
|
6622
7578
|
figWheels.addSecond(ctrWheels2(-1));
|
|
6623
|
-
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();
|
|
6624
7580
|
figFront.addMainO(ctrFront);
|
|
6625
7581
|
figFront.addSecond(ctrWheels2(1).rotate(0, 0, pi2).translate(WW12, R7));
|
|
6626
7582
|
figFront.addSecond(ctrWheels2(-1).rotate(0, 0, pi2).translate(WW12, R7));
|
|
6627
|
-
figFront.addSecond(
|
|
6628
|
-
figFront.addSecond(
|
|
6629
|
-
figFront.addSecond(
|
|
6630
|
-
figFront.addSecond(
|
|
6631
|
-
figFront.addSecond(
|
|
6632
|
-
figFront.addSecond(
|
|
6633
|
-
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));
|
|
6634
7590
|
const ctrTopInt = makeCtrTop2(topR - E1);
|
|
6635
7591
|
const ctrTopExt = makeCtrTop2(topR);
|
|
6636
7592
|
const ctrTopTop = makeCtrTop2(topR + param.S5);
|
|
6637
7593
|
figTop.addMainOI([ctrTopExt, ctrTopInt]);
|
|
6638
7594
|
figTop.addSecond(ctrTopTop);
|
|
6639
|
-
figTop.addSecond(
|
|
6640
|
-
figTop.addSecond(
|
|
7595
|
+
figTop.addSecond(ctrRectangle10(-Lroof / 2, -WW12, Lroof, 2 * WW12));
|
|
7596
|
+
figTop.addSecond(ctrRectangle10(-Ltotal / 2, -WW12, Ltotal, 2 * WW12));
|
|
6641
7597
|
figTop.addSecond(ctrWheels2(1).translate(posXwheels[0], posYwheels2));
|
|
6642
7598
|
figTop.addSecond(ctrWheels2(1).translate(posXwheels[1], posYwheels2));
|
|
6643
7599
|
figTop.addSecond(ctrWheels2(1).translate(posXwheels[2], posYwheels2));
|
|
@@ -6650,10 +7606,10 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6650
7606
|
figTopInt.mergeFigure(figTop, true);
|
|
6651
7607
|
figTopTop.addMainO(ctrTopTop);
|
|
6652
7608
|
figTopTop.mergeFigure(figTop, true);
|
|
6653
|
-
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();
|
|
6654
7610
|
figTopLeg.addMainO(ctrTopLeg);
|
|
6655
7611
|
figFront.addSecond(ctrTopLeg);
|
|
6656
|
-
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();
|
|
6657
7613
|
figWall.addMainOI([ctrBody2(false), ctrSideWindow2(1), ctrSideWindow2(-1), ctrDoor]);
|
|
6658
7614
|
figWall.mergeFigure(figBody, true);
|
|
6659
7615
|
rGeome.fig = {
|
|
@@ -6696,7 +7652,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6696
7652
|
{
|
|
6697
7653
|
outName: `subpax_${designName}_body`,
|
|
6698
7654
|
face: `${designName}_faceBody`,
|
|
6699
|
-
extrudeMethod:
|
|
7655
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6700
7656
|
length: param.WW1,
|
|
6701
7657
|
rotate: [0, 0, 0],
|
|
6702
7658
|
translate: [0, 0, 0]
|
|
@@ -6708,7 +7664,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6708
7664
|
{
|
|
6709
7665
|
outName: `subpax_${designName}_frontWin`,
|
|
6710
7666
|
face: `${designName}_faceFront`,
|
|
6711
|
-
extrudeMethod:
|
|
7667
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6712
7668
|
length: Ltot2,
|
|
6713
7669
|
rotate: [0, pi2, 0],
|
|
6714
7670
|
translate: [-Ltot2 / 2, 0, WW12]
|
|
@@ -6716,7 +7672,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6716
7672
|
{
|
|
6717
7673
|
outName: `subpax_${designName}_topInt`,
|
|
6718
7674
|
face: `${designName}_faceTopInt`,
|
|
6719
|
-
extrudeMethod:
|
|
7675
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6720
7676
|
length: 3 * E1,
|
|
6721
7677
|
rotate: [-pi2, 0, 0],
|
|
6722
7678
|
translate: [0, posYtop - 2 * E1, WW12]
|
|
@@ -6724,7 +7680,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6724
7680
|
{
|
|
6725
7681
|
outName: `subpax_${designName}_top1`,
|
|
6726
7682
|
face: `${designName}_faceTop`,
|
|
6727
|
-
extrudeMethod:
|
|
7683
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6728
7684
|
length: param.R5,
|
|
6729
7685
|
rotate: [-pi2, 0, 0],
|
|
6730
7686
|
translate: [0, posYtop, WW12]
|
|
@@ -6732,7 +7688,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6732
7688
|
{
|
|
6733
7689
|
outName: `subpax_${designName}_top2`,
|
|
6734
7690
|
face: `${designName}_faceTop`,
|
|
6735
|
-
extrudeMethod:
|
|
7691
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6736
7692
|
length: param.R5,
|
|
6737
7693
|
rotate: [-pi2, 0, 0],
|
|
6738
7694
|
translate: [0, posYtop2 - param.R5, WW12]
|
|
@@ -6740,7 +7696,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6740
7696
|
{
|
|
6741
7697
|
outName: `subpax_${designName}_topTop`,
|
|
6742
7698
|
face: `${designName}_faceTopTop`,
|
|
6743
|
-
extrudeMethod:
|
|
7699
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6744
7700
|
length: E1,
|
|
6745
7701
|
rotate: [-pi2, 0, 0],
|
|
6746
7702
|
translate: [0, posYtop2, WW12]
|
|
@@ -6754,7 +7710,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6754
7710
|
{
|
|
6755
7711
|
outName: `subpax_${designName}_wall1`,
|
|
6756
7712
|
face: `${designName}_faceWall`,
|
|
6757
|
-
extrudeMethod:
|
|
7713
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6758
7714
|
length: E1,
|
|
6759
7715
|
rotate: [0, 0, 0],
|
|
6760
7716
|
translate: [0, 0, 0]
|
|
@@ -6762,7 +7718,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6762
7718
|
{
|
|
6763
7719
|
outName: `subpax_${designName}_wall2`,
|
|
6764
7720
|
face: `${designName}_faceWall`,
|
|
6765
|
-
extrudeMethod:
|
|
7721
|
+
extrudeMethod: EExtrude17.eLinearOrtho,
|
|
6766
7722
|
length: E1,
|
|
6767
7723
|
rotate: [0, 0, 0],
|
|
6768
7724
|
translate: [0, 0, param.WW1 - E1]
|
|
@@ -6771,7 +7727,7 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6771
7727
|
volumes: [
|
|
6772
7728
|
{
|
|
6773
7729
|
outName: `ipax_${designName}_plus`,
|
|
6774
|
-
boolMethod:
|
|
7730
|
+
boolMethod: EBVolume17.eUnion,
|
|
6775
7731
|
inList: [
|
|
6776
7732
|
`subpax_${designName}_body`,
|
|
6777
7733
|
`subpax_${designName}_wheel1`,
|
|
@@ -6784,12 +7740,12 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6784
7740
|
},
|
|
6785
7741
|
{
|
|
6786
7742
|
outName: `ipax_${designName}_minus`,
|
|
6787
|
-
boolMethod:
|
|
7743
|
+
boolMethod: EBVolume17.eUnion,
|
|
6788
7744
|
inList: [`subpax_${designName}_frontWin`, ...roofHoleList]
|
|
6789
7745
|
},
|
|
6790
7746
|
{
|
|
6791
7747
|
outName: `pax_${designName}`,
|
|
6792
|
-
boolMethod:
|
|
7748
|
+
boolMethod: EBVolume17.eSubstraction,
|
|
6793
7749
|
inList: [`ipax_${designName}_plus`, `ipax_${designName}_minus`]
|
|
6794
7750
|
}
|
|
6795
7751
|
]
|
|
@@ -6804,39 +7760,39 @@ function pGeom18(t, param, suffix = "") {
|
|
|
6804
7760
|
return rGeome;
|
|
6805
7761
|
}
|
|
6806
7762
|
var capsuleDef = {
|
|
6807
|
-
pTitle: "capsule",
|
|
6808
|
-
pDescription: "high-level concept of the train-capsule",
|
|
6809
|
-
pDef:
|
|
6810
|
-
pGeom:
|
|
6811
|
-
};
|
|
6812
|
-
|
|
6813
|
-
// src/capsule/tunnel.ts
|
|
6814
|
-
import {
|
|
6815
|
-
point as
|
|
6816
|
-
contour as
|
|
6817
|
-
contourCircle as
|
|
6818
|
-
ctrRectangle as
|
|
6819
|
-
figure as
|
|
6820
|
-
degToRad as
|
|
6821
|
-
ffix as
|
|
6822
|
-
pNumber as
|
|
6823
|
-
pSectionSeparator as
|
|
6824
|
-
EExtrude as
|
|
6825
|
-
EBVolume as
|
|
6826
|
-
initGeom as
|
|
7763
|
+
pTitle: "capsule",
|
|
7764
|
+
pDescription: "high-level concept of the train-capsule",
|
|
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
|
|
6827
7783
|
} from "geometrix";
|
|
6828
|
-
var
|
|
7784
|
+
var pDef22 = {
|
|
6829
7785
|
partName: "tunnel",
|
|
6830
7786
|
params: [
|
|
6831
7787
|
//pNumber(name, unit, init, min, max, step)
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
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)
|
|
6840
7796
|
],
|
|
6841
7797
|
paramSvg: {
|
|
6842
7798
|
W1: "tunnel_profile.svg",
|
|
@@ -6854,12 +7810,12 @@ var pDef19 = {
|
|
|
6854
7810
|
// every 0.5 second
|
|
6855
7811
|
}
|
|
6856
7812
|
};
|
|
6857
|
-
function
|
|
6858
|
-
const rGeome =
|
|
6859
|
-
const figProfile =
|
|
6860
|
-
const figSlice =
|
|
6861
|
-
const figStoneA =
|
|
6862
|
-
const figStoneB =
|
|
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();
|
|
6863
7819
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
6864
7820
|
`;
|
|
6865
7821
|
try {
|
|
@@ -6881,7 +7837,7 @@ function pGeom19(t, param, suffix = "") {
|
|
|
6881
7837
|
}
|
|
6882
7838
|
const y1 = Math.min(0, -(iRnL * x1 - W12) * tan);
|
|
6883
7839
|
const y2 = Math.min(0, -(iRnL * x2 - W12) * tan);
|
|
6884
|
-
const rCtr =
|
|
7840
|
+
const rCtr = contour22(x1, -T1);
|
|
6885
7841
|
if (lastGround) {
|
|
6886
7842
|
rCtr.addSegStrokeA(iRnL * W12e, -T1).addSegStrokeA(x2, y2);
|
|
6887
7843
|
} else {
|
|
@@ -6894,23 +7850,23 @@ function pGeom19(t, param, suffix = "") {
|
|
|
6894
7850
|
return rCtr;
|
|
6895
7851
|
}, ctrSideStone2 = function(iD, iL, iRnL) {
|
|
6896
7852
|
const aa1 = iRnL === 1 ? a1 : Math.PI - a1;
|
|
6897
|
-
const pt =
|
|
6898
|
-
const rCtr =
|
|
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();
|
|
6899
7855
|
return rCtr;
|
|
6900
7856
|
}, ctrCeilingStone2 = function(iD, iL, iRnL) {
|
|
6901
7857
|
const a2 = -pi2 + iRnL * (a1 + iD / R1e);
|
|
6902
7858
|
const a3 = a2 + iRnL * iL / R1e;
|
|
6903
|
-
const pt1 =
|
|
7859
|
+
const pt1 = point12(0, ccy).translatePolar(a2, R1i).translatePolar(a2 + iRnL * pi2, e12);
|
|
6904
7860
|
const pt2 = pt1.translatePolar(a2, T1);
|
|
6905
|
-
const pt4 =
|
|
7861
|
+
const pt4 = point12(0, ccy).translatePolar(a3, R1i).translatePolar(a3 - iRnL * pi2, e12);
|
|
6906
7862
|
const pt3 = pt4.translatePolar(a3, T1);
|
|
6907
|
-
const rCtr =
|
|
7863
|
+
const rCtr = contour22(pt1.cx, pt1.cy).addSegStrokeA(pt2.cx, pt2.cy).addSegStrokeA(pt3.cx, pt3.cy).addSegStrokeA(pt4.cx, pt4.cy).closeSegStroke();
|
|
6908
7864
|
return rCtr;
|
|
6909
7865
|
};
|
|
6910
7866
|
var calc = calc2, ctrGroundStone = ctrGroundStone2, ctrSideStone = ctrSideStone2, ctrCeilingStone = ctrCeilingStone2;
|
|
6911
7867
|
const pi2 = Math.PI / 2;
|
|
6912
7868
|
const W12 = param.W1 / 2;
|
|
6913
|
-
const a1 =
|
|
7869
|
+
const a1 = degToRad10(param.a1);
|
|
6914
7870
|
const sin = Math.sin(a1);
|
|
6915
7871
|
const cos = Math.cos(a1);
|
|
6916
7872
|
const tan = Math.tan(pi2 - a1);
|
|
@@ -6951,29 +7907,29 @@ function pGeom19(t, param, suffix = "") {
|
|
|
6951
7907
|
const surf3 = W12 * H2i;
|
|
6952
7908
|
const surfaceM2 = (surf1 + surf2 + surf3) * 10 ** -6;
|
|
6953
7909
|
if (Math.abs(param.H1 - H1ib) > 0.1) {
|
|
6954
|
-
throw `err086: H1 ${
|
|
7910
|
+
throw `err086: H1 ${ffix23(param.H1)} and H1ib ${ffix23(H1ib)} are not equal`;
|
|
6955
7911
|
}
|
|
6956
7912
|
if (Math.abs(H1e - H1eb) > 0.1) {
|
|
6957
|
-
throw `err102: H1e ${
|
|
7913
|
+
throw `err102: H1e ${ffix23(H1e)} and H1eb ${ffix23(H1eb)} are not equal`;
|
|
6958
7914
|
}
|
|
6959
7915
|
if (Math.abs(H2e + BCe - param.T1 - ccy) > 0.1) {
|
|
6960
|
-
throw `err106: H2e ${
|
|
7916
|
+
throw `err106: H2e ${ffix23(H2e)} and BCe ${ffix23(BCe)} not match the other circle center`;
|
|
6961
7917
|
}
|
|
6962
|
-
rGeome.logstr += `Surface ${
|
|
7918
|
+
rGeome.logstr += `Surface ${ffix23(surfaceM2)} m2
|
|
6963
7919
|
`;
|
|
6964
|
-
rGeome.logstr += `dbg131: AsN ${
|
|
7920
|
+
rGeome.logstr += `dbg131: AsN ${ffix23(AsN)} stones
|
|
6965
7921
|
`;
|
|
6966
|
-
const ctrProfileI =
|
|
6967
|
-
const ctrProfileE =
|
|
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();
|
|
6968
7924
|
figProfile.addMainOI([ctrProfileE, ctrProfileI]);
|
|
6969
|
-
figProfile.addSecond(
|
|
7925
|
+
figProfile.addSecond(contourCircle19(0, ccy, R1i));
|
|
6970
7926
|
figSlice.addMainOI([
|
|
6971
|
-
|
|
6972
|
-
|
|
7927
|
+
ctrRectangle11(0, -param.T1, param.T2, param.H1 + 2 * param.T1),
|
|
7928
|
+
ctrRectangle11(0, 0, param.T2, param.H1)
|
|
6973
7929
|
]);
|
|
6974
7930
|
figSlice.addMainOI([
|
|
6975
|
-
|
|
6976
|
-
|
|
7931
|
+
ctrRectangle11(fsox, -param.T1, param.T2, param.H1 + 2 * param.T1),
|
|
7932
|
+
ctrRectangle11(fsox, 0, param.T2, param.H1)
|
|
6977
7933
|
]);
|
|
6978
7934
|
for (let ii = 0; ii < AgN; ii++) {
|
|
6979
7935
|
const ox = AgLast + ii * T3;
|
|
@@ -7061,7 +8017,7 @@ function pGeom19(t, param, suffix = "") {
|
|
|
7061
8017
|
{
|
|
7062
8018
|
outName: `subpax_${designName}_A`,
|
|
7063
8019
|
face: `${designName}_faceStoneA`,
|
|
7064
|
-
extrudeMethod:
|
|
8020
|
+
extrudeMethod: EExtrude18.eLinearOrtho,
|
|
7065
8021
|
length: param.T2,
|
|
7066
8022
|
rotate: [0, 0, 0],
|
|
7067
8023
|
translate: [0, 0, 0]
|
|
@@ -7069,7 +8025,7 @@ function pGeom19(t, param, suffix = "") {
|
|
|
7069
8025
|
{
|
|
7070
8026
|
outName: `subpax_${designName}_B`,
|
|
7071
8027
|
face: `${designName}_faceStoneB`,
|
|
7072
|
-
extrudeMethod:
|
|
8028
|
+
extrudeMethod: EExtrude18.eLinearOrtho,
|
|
7073
8029
|
length: param.T2,
|
|
7074
8030
|
rotate: [0, 0, 0],
|
|
7075
8031
|
translate: [0, 0, fsox]
|
|
@@ -7078,7 +8034,7 @@ function pGeom19(t, param, suffix = "") {
|
|
|
7078
8034
|
volumes: [
|
|
7079
8035
|
{
|
|
7080
8036
|
outName: `pax_${designName}`,
|
|
7081
|
-
boolMethod:
|
|
8037
|
+
boolMethod: EBVolume18.eUnion,
|
|
7082
8038
|
inList: [`subpax_${designName}_A`, `subpax_${designName}_B`]
|
|
7083
8039
|
}
|
|
7084
8040
|
]
|
|
@@ -7095,32 +8051,770 @@ function pGeom19(t, param, suffix = "") {
|
|
|
7095
8051
|
var tunnelDef = {
|
|
7096
8052
|
pTitle: "tunnel",
|
|
7097
8053
|
pDescription: "tunnel for the train-capsule",
|
|
7098
|
-
pDef:
|
|
7099
|
-
pGeom:
|
|
8054
|
+
pDef: pDef22,
|
|
8055
|
+
pGeom: pGeom22
|
|
8056
|
+
};
|
|
8057
|
+
|
|
8058
|
+
// src/capsule/bridge.ts
|
|
8059
|
+
import {
|
|
8060
|
+
contour as contour23,
|
|
8061
|
+
ctrRectangle as ctrRectangle12,
|
|
8062
|
+
figure as figure20,
|
|
8063
|
+
ffix as ffix24,
|
|
8064
|
+
pNumber as pNumber23,
|
|
8065
|
+
pDropdown as pDropdown10,
|
|
8066
|
+
pSectionSeparator as pSectionSeparator23,
|
|
8067
|
+
EExtrude as EExtrude19,
|
|
8068
|
+
EBVolume as EBVolume19,
|
|
8069
|
+
initGeom as initGeom23
|
|
8070
|
+
} from "geometrix";
|
|
8071
|
+
var pDef23 = {
|
|
8072
|
+
partName: "bridge",
|
|
8073
|
+
params: [
|
|
8074
|
+
//pNumber(name, unit, init, min, max, step)
|
|
8075
|
+
pNumber23("N1", "arc", 9, 1, 100, 1),
|
|
8076
|
+
pNumber23("W1", "m", 20, 1, 100, 0.1),
|
|
8077
|
+
pNumber23("W2", "m", 2, 1, 100, 0.1),
|
|
8078
|
+
pNumber23("H1", "m", 2, 1, 100, 0.1),
|
|
8079
|
+
pNumber23("H2", "m", 30, 1, 100, 0.1),
|
|
8080
|
+
pDropdown10("arcStyle", ["gothic", "half-circle", "rectangular"]),
|
|
8081
|
+
pNumber23("Ea", "m", 10, 1, 100, 0.1),
|
|
8082
|
+
pSectionSeparator23("Transversal"),
|
|
8083
|
+
pNumber23("W3", "m", 10, 1, 100, 1),
|
|
8084
|
+
pNumber23("W4", "m", 18, 1, 100, 1),
|
|
8085
|
+
pNumber23("H3", "m", 5, 1, 500, 1),
|
|
8086
|
+
pNumber23("H4", "m", 20, 1, 500, 1),
|
|
8087
|
+
pDropdown10("sideStyle", ["straight", "arc"]),
|
|
8088
|
+
pSectionSeparator23("Valley extremity"),
|
|
8089
|
+
pNumber23("Ix1", "m", 5, 0, 50, 0.1),
|
|
8090
|
+
pNumber23("Ih11", "m", 2, 1, 50, 1),
|
|
8091
|
+
pNumber23("Ih12", "m", 2, 1, 50, 1),
|
|
8092
|
+
pNumber23("Ix2", "m", 5, 0, 50, 0.1),
|
|
8093
|
+
pNumber23("Ih21", "m", 2, 1, 50, 1),
|
|
8094
|
+
pNumber23("Ih22", "m", 2, 1, 50, 1),
|
|
8095
|
+
pSectionSeparator23("Valley"),
|
|
8096
|
+
pNumber23("p1x", "%", 20, 1, 99, 1),
|
|
8097
|
+
pNumber23("p1y", "m", -24, -300, 10, 1),
|
|
8098
|
+
pNumber23("p2x", "%", 40, 1, 99, 1),
|
|
8099
|
+
pNumber23("p2y", "m", -18, -300, 10, 1),
|
|
8100
|
+
pNumber23("p3x", "%", 60, 1, 99, 1),
|
|
8101
|
+
pNumber23("p3y", "m", -31, -300, 10, 1),
|
|
8102
|
+
pNumber23("p4x", "%", 80, 1, 99, 1),
|
|
8103
|
+
pNumber23("p4y", "m", -25, -300, 10, 1)
|
|
8104
|
+
],
|
|
8105
|
+
paramSvg: {
|
|
8106
|
+
N1: "bridge_panorama.svg",
|
|
8107
|
+
W1: "bridge_panorama.svg",
|
|
8108
|
+
W2: "bridge_panorama.svg",
|
|
8109
|
+
H1: "bridge_panorama.svg",
|
|
8110
|
+
H2: "bridge_panorama.svg",
|
|
8111
|
+
arcStyle: "bridge_arc.svg",
|
|
8112
|
+
Ea: "bridge_column.svg",
|
|
8113
|
+
W3: "bridge_column.svg",
|
|
8114
|
+
W4: "bridge_column.svg",
|
|
8115
|
+
H3: "bridge_column.svg",
|
|
8116
|
+
H4: "bridge_column.svg",
|
|
8117
|
+
sideStyle: "bridge_column.svg",
|
|
8118
|
+
Ix1: "bridge_panorama.svg",
|
|
8119
|
+
Ih11: "bridge_panorama.svg",
|
|
8120
|
+
Ih12: "bridge_panorama.svg",
|
|
8121
|
+
Ix2: "bridge_panorama.svg",
|
|
8122
|
+
Ih21: "bridge_panorama.svg",
|
|
8123
|
+
Ih22: "bridge_panorama.svg",
|
|
8124
|
+
p1x: "bridge_panorama.svg",
|
|
8125
|
+
p1y: "bridge_panorama.svg",
|
|
8126
|
+
p2x: "bridge_panorama.svg",
|
|
8127
|
+
p2y: "bridge_panorama.svg",
|
|
8128
|
+
p3x: "bridge_panorama.svg",
|
|
8129
|
+
p3y: "bridge_panorama.svg",
|
|
8130
|
+
p4x: "bridge_panorama.svg",
|
|
8131
|
+
p4y: "bridge_panorama.svg"
|
|
8132
|
+
},
|
|
8133
|
+
sim: {
|
|
8134
|
+
tMax: 180,
|
|
8135
|
+
tStep: 0.5,
|
|
8136
|
+
tUpdate: 500
|
|
8137
|
+
// every 0.5 second
|
|
8138
|
+
}
|
|
8139
|
+
};
|
|
8140
|
+
function pGeom23(t, param, suffix = "") {
|
|
8141
|
+
const rGeome = initGeom23(pDef23.partName + suffix);
|
|
8142
|
+
const figArcade = figure20();
|
|
8143
|
+
const figColumn = figure20();
|
|
8144
|
+
const figValley = figure20();
|
|
8145
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
8146
|
+
`;
|
|
8147
|
+
try {
|
|
8148
|
+
const pi2 = Math.PI / 2;
|
|
8149
|
+
const W12 = param.W1 / 2;
|
|
8150
|
+
const W22 = param.W2 / 2;
|
|
8151
|
+
const W32 = param.W3 / 2;
|
|
8152
|
+
const W42 = param.W4 / 2;
|
|
8153
|
+
const Hg = W12 + param.Ea;
|
|
8154
|
+
const H12 = param.H1 + param.H2;
|
|
8155
|
+
const La = param.W2 + param.N1 * (param.W1 + param.W2);
|
|
8156
|
+
const Lb = La - param.Ix1 - param.Ix2;
|
|
8157
|
+
const H34 = H12 - param.H3 - param.H4;
|
|
8158
|
+
const vxp = [param.p1x, param.p2x, param.p3x, param.p4x];
|
|
8159
|
+
const vx = vxp.map((xp) => param.Ix1 + Lb * xp / 100);
|
|
8160
|
+
const vy = [param.p1y, param.p2y, param.p3y, param.p4y];
|
|
8161
|
+
if (param.H2 < W12 && param.arcStyle === 1) {
|
|
8162
|
+
throw `err116: H2 ${param.H2} is too small compare to W1 ${param.W1} m`;
|
|
8163
|
+
}
|
|
8164
|
+
if (param.H2 < Hg && param.arcStyle === 0) {
|
|
8165
|
+
throw `err125: H2 ${param.H2} is too small compare to W1 ${param.W1} and Ea ${param.Ea} m`;
|
|
8166
|
+
}
|
|
8167
|
+
if (param.W4 < param.W3) {
|
|
8168
|
+
throw `err129: W4 ${param.W4} is too small compare to W3 ${param.W3} m`;
|
|
8169
|
+
}
|
|
8170
|
+
if (H34 < 0) {
|
|
8171
|
+
throw `err133: H2 ${param.H2} is too small compare to H3 ${param.H3} or H4 ${param.H4} m`;
|
|
8172
|
+
}
|
|
8173
|
+
if (Lb < 0) {
|
|
8174
|
+
throw `err139: N1 ${param.N1} is too small compare to Ix1 ${param.Ix1} or Ix2 ${param.Ix2} m`;
|
|
8175
|
+
}
|
|
8176
|
+
for (let ii = 0; ii < vx.length - 1; ii++) {
|
|
8177
|
+
if (vx[ii + 1] < vx[ii]) {
|
|
8178
|
+
throw `err145: vx${ii + 1} ${vx[ii + 1]} is smaller than vx${ii} ${vx[ii]} m`;
|
|
8179
|
+
}
|
|
8180
|
+
}
|
|
8181
|
+
rGeome.logstr += `Bridge length: ${ffix24(Lb)} m
|
|
8182
|
+
`;
|
|
8183
|
+
const ctrArcade = contour23(0, 0).addSegStrokeR(0, -H12).addSegStrokeR(param.W2, 0);
|
|
8184
|
+
for (let ii = 0; ii < param.N1; ii++) {
|
|
8185
|
+
switch (param.arcStyle) {
|
|
8186
|
+
case 1:
|
|
8187
|
+
ctrArcade.addSegStrokeR(0, param.H2 - W12).addPointR(W12, W12).addPointR(2 * W12, 0).addSegArc2().addSegStrokeR(0, -param.H2 + W12).addSegStrokeR(param.W2, 0);
|
|
8188
|
+
figColumn.addSecond(ctrRectangle12(-W32, -param.H1 - W12, 2 * W32, W12));
|
|
8189
|
+
break;
|
|
8190
|
+
case 0:
|
|
8191
|
+
ctrArcade.addSegStrokeR(0, param.H2 - Hg).addPointR(W12, Hg).addSegArc3(pi2, true).addPointR(W12, -Hg).addSegArc3(pi2, false).addSegStrokeR(0, -param.H2 + Hg).addSegStrokeR(param.W2, 0);
|
|
8192
|
+
figColumn.addSecond(ctrRectangle12(-W32, -param.H1 - Hg, 2 * W32, Hg));
|
|
8193
|
+
break;
|
|
8194
|
+
default:
|
|
8195
|
+
ctrArcade.addSegStrokeR(0, param.H2).addSegStrokeR(param.W1, 0).addSegStrokeR(0, -param.H2).addSegStrokeR(param.W2, 0);
|
|
8196
|
+
figColumn.addSecond(ctrRectangle12(-W32, -param.H1, 2 * W32, param.H1));
|
|
8197
|
+
}
|
|
8198
|
+
}
|
|
8199
|
+
ctrArcade.addSegStrokeR(0, H12).closeSegStroke();
|
|
8200
|
+
figArcade.addMainO(ctrArcade);
|
|
8201
|
+
for (let ii = 0; ii < param.N1 + 1; ii++) {
|
|
8202
|
+
const px = ii * (param.W2 + param.W1);
|
|
8203
|
+
figArcade.addSecond(ctrRectangle12(px, -param.H3 - H34, param.W2, H34));
|
|
8204
|
+
figArcade.addSecond(ctrRectangle12(px, -H12, param.W2, param.H4));
|
|
8205
|
+
}
|
|
8206
|
+
const ctrColumn = contour23(-W42, -H12).addSegStrokeR(2 * W42, 0).addSegStrokeR(0, param.H4);
|
|
8207
|
+
if (param.sideStyle === 1) {
|
|
8208
|
+
ctrColumn.addPointR(-W42 + W32, H34).addSegArc3(-pi2, false);
|
|
8209
|
+
} else {
|
|
8210
|
+
ctrColumn.addSegStrokeR(-W42 + W32, H34);
|
|
8211
|
+
}
|
|
8212
|
+
ctrColumn.addSegStrokeR(0, param.H3).addSegStrokeR(-param.W3, 0).addSegStrokeR(0, -param.H3);
|
|
8213
|
+
if (param.sideStyle === 1) {
|
|
8214
|
+
ctrColumn.addPointR(W32 - W42, -H34).addSegArc3(-pi2, true);
|
|
8215
|
+
} else {
|
|
8216
|
+
ctrColumn.addSegStrokeR(W32 - W42, -H34);
|
|
8217
|
+
}
|
|
8218
|
+
ctrColumn.closeSegStroke();
|
|
8219
|
+
figColumn.addMainO(ctrColumn);
|
|
8220
|
+
const ctrValley = contour23(-2 * W22, param.Ih11).addSegStrokeR(2 * W22 + param.Ix1, 0).addSegStrokeR(0, -param.Ih11 - param.Ih12);
|
|
8221
|
+
for (let ii = 0; ii < vx.length; ii++) {
|
|
8222
|
+
ctrValley.addSegStrokeA(vx[ii], vy[ii]);
|
|
8223
|
+
}
|
|
8224
|
+
ctrValley.addSegStrokeA(La - param.Ix2, -param.Ih22).addSegStrokeR(0, param.Ih21 + param.Ih22).addSegStrokeR(2 * W22 + param.Ix2, 0).addSegStrokeR(0, -param.Ih21 - H12 - param.H1).addSegStrokeR(-La - 4 * W22, 0).closeSegStroke();
|
|
8225
|
+
figValley.addMainO(ctrValley);
|
|
8226
|
+
figValley.addSecond(ctrArcade);
|
|
8227
|
+
figArcade.addSecond(ctrValley);
|
|
8228
|
+
rGeome.fig = {
|
|
8229
|
+
faceArcade: figArcade,
|
|
8230
|
+
faceColumn: figColumn,
|
|
8231
|
+
faceValley: figValley
|
|
8232
|
+
};
|
|
8233
|
+
const designName = rGeome.partName;
|
|
8234
|
+
const volColumn = [];
|
|
8235
|
+
const volColumnN = [];
|
|
8236
|
+
for (let ii = 0; ii < param.N1 + 1; ii++) {
|
|
8237
|
+
const px = ii * (param.W2 + param.W1);
|
|
8238
|
+
const iVolN = `subpax_${designName}_col${String(ii).padStart(3, "0")}`;
|
|
8239
|
+
const iVol = {
|
|
8240
|
+
outName: iVolN,
|
|
8241
|
+
face: `${designName}_faceColumn`,
|
|
8242
|
+
extrudeMethod: EExtrude19.eLinearOrtho,
|
|
8243
|
+
length: 2 * W22,
|
|
8244
|
+
rotate: [0, pi2, 0],
|
|
8245
|
+
translate: [px, 0, 0]
|
|
8246
|
+
};
|
|
8247
|
+
volColumn.push(iVol);
|
|
8248
|
+
volColumnN.push(iVolN);
|
|
8249
|
+
}
|
|
8250
|
+
rGeome.vol = {
|
|
8251
|
+
extrudes: [
|
|
8252
|
+
{
|
|
8253
|
+
outName: `subpax_${designName}_arcade`,
|
|
8254
|
+
face: `${designName}_faceArcade`,
|
|
8255
|
+
extrudeMethod: EExtrude19.eLinearOrtho,
|
|
8256
|
+
length: 2 * W32,
|
|
8257
|
+
rotate: [0, 0, 0],
|
|
8258
|
+
translate: [0, 0, -W32]
|
|
8259
|
+
},
|
|
8260
|
+
...volColumn,
|
|
8261
|
+
{
|
|
8262
|
+
outName: `subpax_${designName}_valley`,
|
|
8263
|
+
face: `${designName}_faceValley`,
|
|
8264
|
+
extrudeMethod: EExtrude19.eLinearOrtho,
|
|
8265
|
+
length: 4 * W42,
|
|
8266
|
+
rotate: [0, 0, 0],
|
|
8267
|
+
translate: [0, 0, -2 * W42]
|
|
8268
|
+
}
|
|
8269
|
+
],
|
|
8270
|
+
volumes: [
|
|
8271
|
+
{
|
|
8272
|
+
outName: `pax_${designName}`,
|
|
8273
|
+
boolMethod: EBVolume19.eUnion,
|
|
8274
|
+
inList: [
|
|
8275
|
+
`subpax_${designName}_arcade`,
|
|
8276
|
+
...volColumnN,
|
|
8277
|
+
`subpax_${designName}_valley`
|
|
8278
|
+
]
|
|
8279
|
+
}
|
|
8280
|
+
]
|
|
8281
|
+
};
|
|
8282
|
+
rGeome.sub = {};
|
|
8283
|
+
rGeome.logstr += "bridge drawn successfully!\n";
|
|
8284
|
+
rGeome.calcErr = false;
|
|
8285
|
+
} catch (emsg) {
|
|
8286
|
+
rGeome.logstr += emsg;
|
|
8287
|
+
console.log(emsg);
|
|
8288
|
+
}
|
|
8289
|
+
return rGeome;
|
|
8290
|
+
}
|
|
8291
|
+
var bridgeDef = {
|
|
8292
|
+
pTitle: "bridge",
|
|
8293
|
+
pDescription: "bridge for the train-capsule",
|
|
8294
|
+
pDef: pDef23,
|
|
8295
|
+
pGeom: pGeom23
|
|
8296
|
+
};
|
|
8297
|
+
|
|
8298
|
+
// src/capsule/trackXY.ts
|
|
8299
|
+
import {
|
|
8300
|
+
ShapePoint as ShapePoint3,
|
|
8301
|
+
point as point13,
|
|
8302
|
+
contour as contour24,
|
|
8303
|
+
ctrRectangle as ctrRectangle13,
|
|
8304
|
+
figure as figure21,
|
|
8305
|
+
degToRad as degToRad11,
|
|
8306
|
+
radToDeg as radToDeg12,
|
|
8307
|
+
ffix as ffix25,
|
|
8308
|
+
pNumber as pNumber24,
|
|
8309
|
+
pSectionSeparator as pSectionSeparator24,
|
|
8310
|
+
EExtrude as EExtrude20,
|
|
8311
|
+
EBVolume as EBVolume20,
|
|
8312
|
+
initGeom as initGeom24
|
|
8313
|
+
} from "geometrix";
|
|
8314
|
+
import { triLALrL as triLALrL3 } from "triangule";
|
|
8315
|
+
var pDef24 = {
|
|
8316
|
+
partName: "trackXY",
|
|
8317
|
+
params: [
|
|
8318
|
+
//pNumber(name, unit, init, min, max, step)
|
|
8319
|
+
pNumber24("W1", "mm", 1e3, 10, 2e3, 1),
|
|
8320
|
+
pNumber24("T1", "mm", 80, 1, 200, 1),
|
|
8321
|
+
pNumber24("S1", "mm", 200, 1, 500, 1),
|
|
8322
|
+
pNumber24("B1", "mm", 200, 2, 500, 1),
|
|
8323
|
+
pNumber24("B2", "mm", 300, 2, 1e3, 1),
|
|
8324
|
+
pNumber24("H1", "mm", 100, 1, 500, 1),
|
|
8325
|
+
pNumber24("H2", "mm", 200, 1, 500, 1),
|
|
8326
|
+
pSectionSeparator24("Track"),
|
|
8327
|
+
pNumber24("a0", "degree", 30, -180, 180, 1),
|
|
8328
|
+
pNumber24("a1", "degree", -120, -180, 180, 1),
|
|
8329
|
+
pNumber24("a2", "degree", 70, -180, 180, 1),
|
|
8330
|
+
pNumber24("L1", "m", 30, 0.01, 200, 0.01),
|
|
8331
|
+
pNumber24("L2", "m", 1, 0.01, 200, 0.01),
|
|
8332
|
+
pNumber24("L3", "m", 20, 0.01, 200, 0.01),
|
|
8333
|
+
pNumber24("r1", "m", 10, 0.01, 200, 0.01),
|
|
8334
|
+
pNumber24("r2", "m", 20, 0.01, 200, 0.01)
|
|
8335
|
+
],
|
|
8336
|
+
paramSvg: {
|
|
8337
|
+
W1: "trackXY_section.svg",
|
|
8338
|
+
T1: "trackXY_section.svg",
|
|
8339
|
+
S1: "trackXY_top.svg",
|
|
8340
|
+
B1: "trackXY_top.svg",
|
|
8341
|
+
B2: "trackXY_top.svg",
|
|
8342
|
+
H1: "trackXY_side.svg",
|
|
8343
|
+
H2: "trackXY_side.svg",
|
|
8344
|
+
a0: "trackXY_midLine.svg",
|
|
8345
|
+
a1: "trackXY_midLine.svg",
|
|
8346
|
+
a2: "trackXY_midLine.svg",
|
|
8347
|
+
L1: "trackXY_midLine.svg",
|
|
8348
|
+
L2: "trackXY_midLine.svg",
|
|
8349
|
+
L3: "trackXY_midLine.svg",
|
|
8350
|
+
r1: "trackXY_midLine.svg",
|
|
8351
|
+
r2: "trackXY_midLine.svg"
|
|
8352
|
+
},
|
|
8353
|
+
sim: {
|
|
8354
|
+
tMax: 180,
|
|
8355
|
+
tStep: 0.5,
|
|
8356
|
+
tUpdate: 500
|
|
8357
|
+
// every 0.5 second
|
|
8358
|
+
}
|
|
8359
|
+
};
|
|
8360
|
+
function pGeom24(t, param, suffix = "") {
|
|
8361
|
+
const rGeome = initGeom24(pDef24.partName + suffix);
|
|
8362
|
+
const figTop1 = figure21();
|
|
8363
|
+
const figTop2 = figure21();
|
|
8364
|
+
const figSection = figure21();
|
|
8365
|
+
const figSide = figure21();
|
|
8366
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
8367
|
+
`;
|
|
8368
|
+
try {
|
|
8369
|
+
let ctrBeam2 = function(iX, iY, iA) {
|
|
8370
|
+
const ctr1 = ctrRectangle13(iX - Wbeam2, iY - Lbeam2, 2 * Wbeam2, 2 * Lbeam2);
|
|
8371
|
+
const rCtr = ctr1.rotate(iX, iY, iA);
|
|
8372
|
+
return rCtr;
|
|
8373
|
+
}, ctrRail2 = function(iW12, iT1, iSign) {
|
|
8374
|
+
const aR0 = A0 + iSign * pi2;
|
|
8375
|
+
const aR10 = A0 - Math.sign(A1) * pi2;
|
|
8376
|
+
const aR11 = A0 - Math.sign(A1) * pi2 + A1 / 2;
|
|
8377
|
+
const aR12 = A0 - Math.sign(A1) * pi2 + A1;
|
|
8378
|
+
const aR20 = A1b - Math.sign(A2) * pi2;
|
|
8379
|
+
const aR21 = A1b - Math.sign(A2) * pi2 + A2 / 2;
|
|
8380
|
+
const aR22 = A1b - Math.sign(A2) * pi2 + A2;
|
|
8381
|
+
const sR11 = iSign * Math.sign(A1) * iW12;
|
|
8382
|
+
const sR12 = iSign * Math.sign(A1) * (iW12 + iT1);
|
|
8383
|
+
const sR21 = iSign * Math.sign(A2) * iW12;
|
|
8384
|
+
const sR22 = iSign * Math.sign(A2) * (iW12 + iT1);
|
|
8385
|
+
const pR11 = point13(0, 0).translatePolar(aR0, iW12);
|
|
8386
|
+
const pR12 = pt1c.translatePolar(aR11, param.r1 - sR12);
|
|
8387
|
+
const pR13 = pt1c.translatePolar(aR12, param.r1 - sR12);
|
|
8388
|
+
const pR14 = pt2c.translatePolar(aR21, param.r2 - sR22);
|
|
8389
|
+
const pR15 = pt2c.translatePolar(aR22, param.r2 - sR22);
|
|
8390
|
+
const pR16 = pt2c.translatePolar(aR21, param.r2 - sR21);
|
|
8391
|
+
const pR17 = pt2c.translatePolar(aR20, param.r2 - sR21);
|
|
8392
|
+
const pR18 = pt1c.translatePolar(aR11, param.r1 - sR11);
|
|
8393
|
+
const pR19 = pt1c.translatePolar(aR10, param.r1 - sR11);
|
|
8394
|
+
const rCtr = contour24(pR11.cx, pR11.cy).addSegStrokeRP(aR0, iT1).addSegStrokeRP(A0, param.L1).addPointA(pR12.cx, pR12.cy).addPointA(pR13.cx, pR13.cy).addSegArc2().addSegStrokeRP(A1b, param.L2).addPointA(pR14.cx, pR14.cy).addPointA(pR15.cx, pR15.cy).addSegArc2().addSegStrokeRP(A2b, param.L3).addSegStrokeRP(A2b + pi2, iT1).addSegStrokeRP(A2b + Math.PI, param.L3).addPointA(pR16.cx, pR16.cy).addPointA(pR17.cx, pR17.cy).addSegArc2().addSegStrokeRP(A1b + Math.PI, param.L2).addPointA(pR18.cx, pR18.cy).addPointA(pR19.cx, pR18.cy).addSegArc2().closeSegStroke();
|
|
8395
|
+
return rCtr;
|
|
8396
|
+
};
|
|
8397
|
+
var ctrBeam = ctrBeam2, ctrRail = ctrRail2;
|
|
8398
|
+
const pi2 = Math.PI / 2;
|
|
8399
|
+
const A0 = degToRad11(param.a0);
|
|
8400
|
+
const A1 = degToRad11(param.a1);
|
|
8401
|
+
const A2 = degToRad11(param.a2);
|
|
8402
|
+
const Lr1 = Math.abs(A1) * param.r1;
|
|
8403
|
+
const Lr2 = Math.abs(A2) * param.r2;
|
|
8404
|
+
const Ltot = param.L1 + Lr1 + param.L2 + Lr2 + param.L3;
|
|
8405
|
+
const A1b = A0 + A1;
|
|
8406
|
+
const A2b = A1b + A2;
|
|
8407
|
+
const [Lr1c, logTri1] = triLALrL3(param.r1, A1, param.r1);
|
|
8408
|
+
const [Lr2c, logTri2] = triLALrL3(param.r2, A2, param.r2);
|
|
8409
|
+
rGeome.logstr += logTri1 + logTri2;
|
|
8410
|
+
const aLr1c = A1 / 2;
|
|
8411
|
+
const aLr2c = A2 / 2;
|
|
8412
|
+
const H1 = param.H1 / 1e3;
|
|
8413
|
+
const H2 = param.H2 / 1e3;
|
|
8414
|
+
const W12 = param.W1 / 2e3;
|
|
8415
|
+
const T1 = param.T1 / 1e3;
|
|
8416
|
+
const S1 = param.S1 / 1e3;
|
|
8417
|
+
const Wbeam2 = param.B1 / 2e3;
|
|
8418
|
+
const Lbeam2 = W12 + T1 + S1;
|
|
8419
|
+
const Bstep = (param.B1 + param.B2) / 1e3;
|
|
8420
|
+
const Nb1 = Math.floor(param.L1 / Bstep);
|
|
8421
|
+
const Rb1 = param.L1 - Nb1 * Bstep;
|
|
8422
|
+
const Nb1c = Math.floor((Rb1 + Lr1) / Bstep);
|
|
8423
|
+
const Rb1c = Rb1 + Lr1 - Nb1c * Bstep;
|
|
8424
|
+
const a1c = Math.sign(A1) * Bstep / param.r1;
|
|
8425
|
+
const a1ci = Math.sign(A1) * Rb1 / param.r1;
|
|
8426
|
+
const Nb2 = Math.floor((Rb1c + param.L2) / Bstep);
|
|
8427
|
+
const Rb2 = Rb1c + param.L2 - Nb2 * Bstep;
|
|
8428
|
+
const Nb2c = Math.floor((Rb2 + Lr2) / Bstep);
|
|
8429
|
+
const Rb2c = Rb2 + Lr2 - Nb2c * Bstep;
|
|
8430
|
+
const a2c = Math.sign(A2) * Bstep / param.r2;
|
|
8431
|
+
const a2ci = Math.sign(A2) * Rb2 / param.r2;
|
|
8432
|
+
const Nb3 = Math.floor((Rb2c + param.L3) / Bstep);
|
|
8433
|
+
const Nbeam1 = 1 + Math.floor(Ltot / Bstep);
|
|
8434
|
+
const Nbeam2 = 1 + Nb1 + Nb1c + Nb2 + Nb2c + Nb3;
|
|
8435
|
+
if (Math.abs(param.a1) < 0.5) {
|
|
8436
|
+
throw `err102: a1 ${param.a1} degree is too closed to zero`;
|
|
8437
|
+
}
|
|
8438
|
+
if (Math.abs(param.a2) < 0.5) {
|
|
8439
|
+
throw `err112: a2 ${param.a2} degree is too closed to zero`;
|
|
8440
|
+
}
|
|
8441
|
+
rGeome.logstr += `Track-XY length: ${ffix25(Ltot)} m
|
|
8442
|
+
`;
|
|
8443
|
+
rGeome.logstr += `Beam number: ${Nbeam1} ${Nbeam2}, size: ${ffix25(2 * Lbeam2)} x ${ffix25(2 * Wbeam2)} m
|
|
8444
|
+
`;
|
|
8445
|
+
rGeome.logstr += `Final orientation: ${ffix25(radToDeg12(A2b))} degree
|
|
8446
|
+
`;
|
|
8447
|
+
const ctrMidLine = contour24(0, 0).addSegStrokeRP(A0, param.L1).addPointRP(A0 + aLr1c, Lr1c).addSegArc3(A0, true).addSegStrokeRP(A1b, param.L2).addPointRP(A1b + aLr2c, Lr2c).addSegArc3(A1b, true).addSegStrokeRP(A2b, param.L3);
|
|
8448
|
+
figTop1.addSecond(ctrMidLine);
|
|
8449
|
+
const pt0 = point13(0, 0);
|
|
8450
|
+
figTop1.addMainO(ctrBeam2(pt0.cx, pt0.cy, A0));
|
|
8451
|
+
for (let ii = 0; ii < Nb1; ii++) {
|
|
8452
|
+
const pt = pt0.translatePolar(A0, (ii + 1) * Bstep);
|
|
8453
|
+
figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, A0));
|
|
8454
|
+
}
|
|
8455
|
+
const pt1b = pt0.translatePolar(A0, param.L1);
|
|
8456
|
+
const pt1c = pt1b.translatePolar(A0 + Math.sign(A1) * pi2, param.r1);
|
|
8457
|
+
for (let ii = 0; ii < Nb1c; ii++) {
|
|
8458
|
+
const ia = A0 - Math.sign(A1) * pi2 - a1ci + (ii + 1) * a1c;
|
|
8459
|
+
const pt = pt1c.translatePolar(ia, param.r1);
|
|
8460
|
+
figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, ia - pi2));
|
|
8461
|
+
}
|
|
8462
|
+
const pt1e = pt1b.translatePolar(A0 + aLr1c, Lr1c);
|
|
8463
|
+
for (let ii = 0; ii < Nb2; ii++) {
|
|
8464
|
+
const pt = pt1e.translatePolar(A1b, (ii + 1) * Bstep - Rb1c);
|
|
8465
|
+
figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, A1b));
|
|
8466
|
+
}
|
|
8467
|
+
const pt2b = pt1e.translatePolar(A1b, param.L2);
|
|
8468
|
+
const pt2c = pt2b.translatePolar(A1b + Math.sign(A2) * pi2, param.r2);
|
|
8469
|
+
for (let ii = 0; ii < Nb2c; ii++) {
|
|
8470
|
+
const ia = A1b - Math.sign(A2) * pi2 - a2ci + (ii + 1) * a2c;
|
|
8471
|
+
const pt = pt2c.translatePolar(ia, param.r2);
|
|
8472
|
+
figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, ia - pi2));
|
|
8473
|
+
}
|
|
8474
|
+
const pt2e = pt2b.translatePolar(A1b + aLr2c, Lr2c);
|
|
8475
|
+
for (let ii = 0; ii < Nb3; ii++) {
|
|
8476
|
+
const pt = pt2e.translatePolar(A2b, (ii + 1) * Bstep - Rb2c);
|
|
8477
|
+
figTop1.addMainO(ctrBeam2(pt.cx, pt.cy, A2b));
|
|
8478
|
+
}
|
|
8479
|
+
figTop1.addPoint(point13(pt1c.cx, pt1c.cy, ShapePoint3.eTri2));
|
|
8480
|
+
figTop1.addPoint(point13(pt2c.cx, pt2c.cy, ShapePoint3.eTri2));
|
|
8481
|
+
figTop2.mergeFigure(figTop1, true);
|
|
8482
|
+
const ctrRail1 = ctrRail2(W12, T1, -1);
|
|
8483
|
+
const ctrRail22 = ctrRail2(W12, T1, 1);
|
|
8484
|
+
figTop2.addMainO(ctrRail1);
|
|
8485
|
+
figTop2.addMainO(ctrRail22);
|
|
8486
|
+
figTop1.addSecond(ctrRail1);
|
|
8487
|
+
figTop1.addSecond(ctrRail22);
|
|
8488
|
+
figSection.addSecond(ctrRectangle13(-Lbeam2, 0, 2 * Lbeam2, H1));
|
|
8489
|
+
figSection.addMainO(ctrRectangle13(-Lbeam2 + S1, H1, T1, H2));
|
|
8490
|
+
figSection.addMainO(ctrRectangle13(W12, H1, T1, H2));
|
|
8491
|
+
for (let ii = 0; ii < 11; ii++) {
|
|
8492
|
+
figSide.addSecond(ctrRectangle13(ii * Bstep, 0, 2 * Wbeam2, H1));
|
|
8493
|
+
}
|
|
8494
|
+
figSide.addMainO(ctrRectangle13(0, H1, 2 * Wbeam2 + 10 * Bstep, H2));
|
|
8495
|
+
rGeome.fig = {
|
|
8496
|
+
faceTop1: figTop1,
|
|
8497
|
+
faceTop2: figTop2,
|
|
8498
|
+
faceSide: figSide,
|
|
8499
|
+
faceSection: figSection
|
|
8500
|
+
};
|
|
8501
|
+
const designName = rGeome.partName;
|
|
8502
|
+
rGeome.vol = {
|
|
8503
|
+
extrudes: [
|
|
8504
|
+
{
|
|
8505
|
+
outName: `subpax_${designName}_beam`,
|
|
8506
|
+
face: `${designName}_faceTop1`,
|
|
8507
|
+
extrudeMethod: EExtrude20.eLinearOrtho,
|
|
8508
|
+
length: H1,
|
|
8509
|
+
rotate: [0, 0, 0],
|
|
8510
|
+
translate: [0, 0, 0]
|
|
8511
|
+
},
|
|
8512
|
+
{
|
|
8513
|
+
outName: `subpax_${designName}_rail`,
|
|
8514
|
+
face: `${designName}_faceTop2`,
|
|
8515
|
+
extrudeMethod: EExtrude20.eLinearOrtho,
|
|
8516
|
+
length: H2,
|
|
8517
|
+
rotate: [0, 0, 0],
|
|
8518
|
+
translate: [0, 0, H1]
|
|
8519
|
+
}
|
|
8520
|
+
],
|
|
8521
|
+
volumes: [
|
|
8522
|
+
{
|
|
8523
|
+
outName: `pax_${designName}`,
|
|
8524
|
+
boolMethod: EBVolume20.eUnion,
|
|
8525
|
+
inList: [`subpax_${designName}_beam`, `subpax_${designName}_rail`]
|
|
8526
|
+
}
|
|
8527
|
+
]
|
|
8528
|
+
};
|
|
8529
|
+
rGeome.sub = {};
|
|
8530
|
+
rGeome.logstr += "trackXY drawn successfully!\n";
|
|
8531
|
+
rGeome.calcErr = false;
|
|
8532
|
+
} catch (emsg) {
|
|
8533
|
+
rGeome.logstr += emsg;
|
|
8534
|
+
console.log(emsg);
|
|
8535
|
+
}
|
|
8536
|
+
return rGeome;
|
|
8537
|
+
}
|
|
8538
|
+
var trackXYDef = {
|
|
8539
|
+
pTitle: "trackXY",
|
|
8540
|
+
pDescription: "simulation of train-capsule on XY-track",
|
|
8541
|
+
pDef: pDef24,
|
|
8542
|
+
pGeom: pGeom24
|
|
8543
|
+
};
|
|
8544
|
+
|
|
8545
|
+
// src/capsule/trackXZ.ts
|
|
8546
|
+
import {
|
|
8547
|
+
point as point14,
|
|
8548
|
+
contour as contour25,
|
|
8549
|
+
ctrRectangle as ctrRectangle14,
|
|
8550
|
+
figure as figure22,
|
|
8551
|
+
degToRad as degToRad12,
|
|
8552
|
+
radToDeg as radToDeg13,
|
|
8553
|
+
ffix as ffix26,
|
|
8554
|
+
pNumber as pNumber25,
|
|
8555
|
+
pSectionSeparator as pSectionSeparator25,
|
|
8556
|
+
EExtrude as EExtrude21,
|
|
8557
|
+
EBVolume as EBVolume21,
|
|
8558
|
+
initGeom as initGeom25
|
|
8559
|
+
} from "geometrix";
|
|
8560
|
+
var pDef25 = {
|
|
8561
|
+
partName: "trackXZ",
|
|
8562
|
+
params: [
|
|
8563
|
+
//pNumber(name, unit, init, min, max, step)
|
|
8564
|
+
pNumber25("W1", "mm", 1e3, 10, 2e3, 1),
|
|
8565
|
+
pNumber25("T1", "mm", 80, 1, 200, 1),
|
|
8566
|
+
pNumber25("S1", "mm", 200, 1, 500, 1),
|
|
8567
|
+
pNumber25("B1", "mm", 200, 2, 500, 1),
|
|
8568
|
+
pNumber25("B2", "mm", 300, 2, 1e3, 1),
|
|
8569
|
+
pNumber25("H1", "mm", 100, 1, 500, 1),
|
|
8570
|
+
pNumber25("H2", "mm", 200, 1, 500, 1),
|
|
8571
|
+
pSectionSeparator25("Slope"),
|
|
8572
|
+
pNumber25("a1", "%", 5, -90, 90, 1),
|
|
8573
|
+
pNumber25("a3", "%", 20, -90, 90, 1),
|
|
8574
|
+
pNumber25("a5", "%", 2, -90, 90, 1),
|
|
8575
|
+
pNumber25("L1", "m", 30, 0.01, 200, 0.01),
|
|
8576
|
+
pNumber25("L2", "m", 5, 0.01, 200, 0.01),
|
|
8577
|
+
pNumber25("L3", "m", 20, 0.01, 200, 0.01),
|
|
8578
|
+
pNumber25("L4", "m", 3, 0.01, 200, 0.01),
|
|
8579
|
+
pNumber25("L5", "m", 20, 0.01, 200, 0.01)
|
|
8580
|
+
],
|
|
8581
|
+
paramSvg: {
|
|
8582
|
+
W1: "trackXZ_section.svg",
|
|
8583
|
+
T1: "trackXZ_section.svg",
|
|
8584
|
+
S1: "trackXZ_top.svg",
|
|
8585
|
+
B1: "trackXZ_top.svg",
|
|
8586
|
+
B2: "trackXZ_top.svg",
|
|
8587
|
+
H1: "trackXZ_side.svg",
|
|
8588
|
+
H2: "trackXZ_side.svg",
|
|
8589
|
+
a1: "trackXZ_slope.svg",
|
|
8590
|
+
a3: "trackXZ_slope.svg",
|
|
8591
|
+
a5: "trackXZ_slope.svg",
|
|
8592
|
+
L1: "trackXZ_slope.svg",
|
|
8593
|
+
L2: "trackXZ_slope.svg",
|
|
8594
|
+
L3: "trackXZ_slope.svg",
|
|
8595
|
+
L4: "trackXZ_slope.svg",
|
|
8596
|
+
L5: "trackXZ_slope.svg"
|
|
8597
|
+
},
|
|
8598
|
+
sim: {
|
|
8599
|
+
tMax: 180,
|
|
8600
|
+
tStep: 0.5,
|
|
8601
|
+
tUpdate: 500
|
|
8602
|
+
// every 0.5 second
|
|
8603
|
+
}
|
|
8604
|
+
};
|
|
8605
|
+
function pGeom25(t, param, suffix = "") {
|
|
8606
|
+
const rGeome = initGeom25(pDef25.partName + suffix);
|
|
8607
|
+
const figBeam = figure22();
|
|
8608
|
+
const figRail = figure22();
|
|
8609
|
+
const figTop = figure22();
|
|
8610
|
+
const figSection = figure22();
|
|
8611
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
8612
|
+
`;
|
|
8613
|
+
try {
|
|
8614
|
+
let ctrBeam2 = function(ix, iy, ia) {
|
|
8615
|
+
const pt = point14(ix, iy).translatePolar(ia + 2 * pi2, Wbeam2);
|
|
8616
|
+
const rCtr = contour25(pt.cx, pt.cy).addSegStrokeRP(ia, 2 * Wbeam2).addSegStrokeRP(ia + pi2, H1).addSegStrokeRP(ia + 2 * pi2, 2 * Wbeam2).addSegStrokeRP(ia - pi2, H1).closeSegStroke();
|
|
8617
|
+
return rCtr;
|
|
8618
|
+
};
|
|
8619
|
+
var ctrBeam = ctrBeam2;
|
|
8620
|
+
const pi2 = Math.PI / 2;
|
|
8621
|
+
const Ltot = param.L1 + param.L2 + param.L3 + param.L4 + param.L5;
|
|
8622
|
+
const H1 = param.H1 / 1e3;
|
|
8623
|
+
const H2 = param.H2 / 1e3;
|
|
8624
|
+
const W12 = param.W1 / 2e3;
|
|
8625
|
+
const T1 = param.T1 / 1e3;
|
|
8626
|
+
const S1 = param.S1 / 1e3;
|
|
8627
|
+
const Wbeam2 = param.B1 / 2e3;
|
|
8628
|
+
const Lbeam2 = W12 + T1 + S1;
|
|
8629
|
+
const Bstep = (param.B1 + param.B2) / 1e3;
|
|
8630
|
+
const a1 = Math.asin(param.a1 / 100);
|
|
8631
|
+
const a3 = Math.asin(param.a3 / 100);
|
|
8632
|
+
const a5 = Math.asin(param.a5 / 100);
|
|
8633
|
+
const aMin = degToRad12(0.1);
|
|
8634
|
+
const aDiff13 = Math.abs(a3 - a1);
|
|
8635
|
+
const aDiff35 = Math.abs(a5 - a3);
|
|
8636
|
+
const aDiffMax = Math.max(aDiff13, aDiff35);
|
|
8637
|
+
const a2 = a3 - a1;
|
|
8638
|
+
const a4 = a5 - a3;
|
|
8639
|
+
const r2 = Math.abs(param.L2 / a2);
|
|
8640
|
+
const r4 = Math.abs(param.L4 / a4);
|
|
8641
|
+
const pt0 = point14(0, 0);
|
|
8642
|
+
const pt1 = pt0.translatePolar(a1, param.L1);
|
|
8643
|
+
const pt2c = pt1.translatePolar(a1 + Math.sign(a2) * pi2, r2);
|
|
8644
|
+
const pt2m = pt2c.translatePolar(a1 - Math.sign(a2) * pi2 + a2 / 2, r2);
|
|
8645
|
+
const pt2 = pt2c.translatePolar(a1 - Math.sign(a2) * pi2 + a2, r2);
|
|
8646
|
+
const pt3 = pt2.translatePolar(a3, param.L3);
|
|
8647
|
+
const pt4c = pt3.translatePolar(a3 + Math.sign(a4) * pi2, r4);
|
|
8648
|
+
const pt4m = pt4c.translatePolar(a3 - Math.sign(a4) * pi2 + a4 / 2, r4);
|
|
8649
|
+
const pt4 = pt4c.translatePolar(a3 - Math.sign(a4) * pi2 + a4, r4);
|
|
8650
|
+
const pt5 = pt4.translatePolar(a5, param.L5);
|
|
8651
|
+
const ava = Math.atan2(pt5.cy, pt5.cx);
|
|
8652
|
+
const avp = 100 * Math.sin(ava);
|
|
8653
|
+
const N0r = Bstep - Wbeam2;
|
|
8654
|
+
const N1 = Math.floor(N0r + param.L1 / Bstep);
|
|
8655
|
+
const N1r = N0r + param.L1 - N1 * Bstep;
|
|
8656
|
+
const N1ra = N1r / r2;
|
|
8657
|
+
const a2s = Bstep / r2;
|
|
8658
|
+
const N2 = Math.floor((N1r + param.L2) / Bstep);
|
|
8659
|
+
const N2r = N1r + param.L2 - N2 * Bstep;
|
|
8660
|
+
const N3 = Math.floor((N2r + param.L3) / Bstep);
|
|
8661
|
+
const N3r = N2r + param.L3 - N3 * Bstep;
|
|
8662
|
+
const N3ra = N3r / r4;
|
|
8663
|
+
const a4s = Bstep / r4;
|
|
8664
|
+
const N4 = Math.floor((N3r + param.L4) / Bstep);
|
|
8665
|
+
const N4r = N3r + param.L4 - N4 * Bstep;
|
|
8666
|
+
const N5 = Math.floor((N4r + param.L5) / Bstep);
|
|
8667
|
+
const beamNb = N1 + N2 + N3 + N4 + N5;
|
|
8668
|
+
const beamNb2 = Math.floor((N0r + Ltot) / Bstep);
|
|
8669
|
+
const H12 = H1 + H2;
|
|
8670
|
+
if (aDiff13 < aMin) {
|
|
8671
|
+
throw `err107: a1 ${ffix26(param.a1)} and a3 ${ffix26(param.a3)} (degree) are too closed`;
|
|
8672
|
+
}
|
|
8673
|
+
if (aDiff35 < aMin) {
|
|
8674
|
+
throw `err107: a3 ${ffix26(param.a3)} and a5 ${ffix26(param.a5)} (degree) are too closed`;
|
|
8675
|
+
}
|
|
8676
|
+
rGeome.logstr += `Slope length: ${ffix26(Ltot)}, X ${ffix26(pt5.cx)} Y ${ffix26(pt5.cy)} m, average ${ffix26(avp)} % ${ffix26(radToDeg13(ava))} degree
|
|
8677
|
+
`;
|
|
8678
|
+
rGeome.logstr += `Slope max transition: aDiffMax ${ffix26(radToDeg13(aDiffMax))} degree
|
|
8679
|
+
`;
|
|
8680
|
+
rGeome.logstr += `Beam number: ${beamNb} ${beamNb2}, size: ${ffix26(2 * Lbeam2)} x ${ffix26(2 * Wbeam2)} m
|
|
8681
|
+
`;
|
|
8682
|
+
figSection.addSecond(ctrRectangle14(-Lbeam2, 0, 2 * Lbeam2, H1));
|
|
8683
|
+
figSection.addMainO(ctrRectangle14(-Lbeam2 + S1, H1, T1, H2));
|
|
8684
|
+
figSection.addMainO(ctrRectangle14(W12, H1, T1, H2));
|
|
8685
|
+
for (let ii = 0; ii < 11; ii++) {
|
|
8686
|
+
figTop.addSecond(ctrRectangle14(ii * Bstep, -Lbeam2, 2 * Wbeam2, 2 * Lbeam2));
|
|
8687
|
+
}
|
|
8688
|
+
figTop.addMainO(ctrRectangle14(0, W12, 2 * Wbeam2 + 10 * Bstep, T1));
|
|
8689
|
+
figTop.addMainO(ctrRectangle14(0, -W12 - T1, 2 * Wbeam2 + 10 * Bstep, T1));
|
|
8690
|
+
const ctrGround = contour25(pt0.cx, pt0.cy).addSegStrokeA(pt1.cx, pt1.cy).addPointA(pt2m.cx, pt2m.cy).addPointA(pt2.cx, pt2.cy).addSegArc2().addSegStrokeA(pt3.cx, pt3.cy).addPointA(pt4m.cx, pt4m.cy).addPointA(pt4.cx, pt4.cy).addSegArc2().addSegStrokeA(pt5.cx, pt5.cy);
|
|
8691
|
+
figBeam.addSecond(ctrGround);
|
|
8692
|
+
for (let ii = 0; ii < N1; ii++) {
|
|
8693
|
+
const pp = pt0.translatePolar(a1, (ii + 1) * Bstep - N0r);
|
|
8694
|
+
figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, a1));
|
|
8695
|
+
}
|
|
8696
|
+
for (let ii = 0; ii < N2; ii++) {
|
|
8697
|
+
const ai = a1 + Math.sign(a2) * (-pi2 + (ii + 1) * a2s - N1ra);
|
|
8698
|
+
const pp = pt2c.translatePolar(ai, r2);
|
|
8699
|
+
figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, ai + Math.sign(a2) * pi2));
|
|
8700
|
+
}
|
|
8701
|
+
for (let ii = 0; ii < N3; ii++) {
|
|
8702
|
+
const pp = pt2.translatePolar(a3, (ii + 1) * Bstep - N2r);
|
|
8703
|
+
figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, a3));
|
|
8704
|
+
}
|
|
8705
|
+
for (let ii = 0; ii < N4; ii++) {
|
|
8706
|
+
const ai = a3 + Math.sign(a4) * (-pi2 + (ii + 1) * a4s - N3ra);
|
|
8707
|
+
const pp = pt4c.translatePolar(ai, r4);
|
|
8708
|
+
figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, ai + Math.sign(a4) * pi2));
|
|
8709
|
+
}
|
|
8710
|
+
for (let ii = 0; ii < N5; ii++) {
|
|
8711
|
+
const pp = pt4.translatePolar(a5, (ii + 1) * Bstep - N4r);
|
|
8712
|
+
figBeam.addMainO(ctrBeam2(pp.cx, pp.cy, a5));
|
|
8713
|
+
}
|
|
8714
|
+
figRail.mergeFigure(figBeam, true);
|
|
8715
|
+
const pr0 = pt0.translatePolar(a1 + pi2, H1);
|
|
8716
|
+
const pr0b = pt0.translatePolar(a1 + pi2, H12);
|
|
8717
|
+
const pr1 = pt1.translatePolar(a1 + pi2, H1);
|
|
8718
|
+
const pr1b = pt1.translatePolar(a1 + pi2, H12);
|
|
8719
|
+
const pr2m = pt2m.translatePolar((a1 + a3) / 2 + pi2, H1);
|
|
8720
|
+
const pr2mb = pt2m.translatePolar((a1 + a3) / 2 + pi2, H12);
|
|
8721
|
+
const pr2 = pt2.translatePolar(a3 + pi2, H1);
|
|
8722
|
+
const pr2b = pt2.translatePolar(a3 + pi2, H12);
|
|
8723
|
+
const pr3 = pt3.translatePolar(a3 + pi2, H1);
|
|
8724
|
+
const pr3b = pt3.translatePolar(a3 + pi2, H12);
|
|
8725
|
+
const pr4m = pt4m.translatePolar((a3 + a5) / 2 + pi2, H1);
|
|
8726
|
+
const pr4mb = pt4m.translatePolar((a3 + a5) / 2 + pi2, H12);
|
|
8727
|
+
const pr4 = pt4.translatePolar(a5 + pi2, H1);
|
|
8728
|
+
const pr4b = pt4.translatePolar(a5 + pi2, H12);
|
|
8729
|
+
const pr5 = pt5.translatePolar(a5 + pi2, H1);
|
|
8730
|
+
const pr5b = pt5.translatePolar(a5 + pi2, H12);
|
|
8731
|
+
const ctrRail = contour25(pr0.cx, pr0.cy).addSegStrokeA(pr1.cx, pr1.cy).addPointA(pr2m.cx, pr2m.cy).addPointA(pr2.cx, pr2.cy).addSegArc2().addSegStrokeA(pr3.cx, pr3.cy).addPointA(pr4m.cx, pr4m.cy).addPointA(pr4.cx, pr4.cy).addSegArc2().addSegStrokeA(pr5.cx, pr5.cy).addSegStrokeA(pr5b.cx, pr5b.cy).addSegStrokeA(pr4b.cx, pr4b.cy).addPointA(pr4mb.cx, pr4mb.cy).addPointA(pr3b.cx, pr3b.cy).addSegArc2().addSegStrokeA(pr2b.cx, pr2b.cy).addPointA(pr2mb.cx, pr2mb.cy).addPointA(pr1b.cx, pr1b.cy).addSegArc2().addSegStrokeA(pr0b.cx, pr0b.cy).closeSegStroke();
|
|
8732
|
+
figRail.addMainO(ctrRail);
|
|
8733
|
+
figBeam.addSecond(ctrRail);
|
|
8734
|
+
rGeome.fig = {
|
|
8735
|
+
faceBeam: figBeam,
|
|
8736
|
+
faceRail: figRail,
|
|
8737
|
+
faceTop: figTop,
|
|
8738
|
+
faceSection: figSection
|
|
8739
|
+
};
|
|
8740
|
+
const designName = rGeome.partName;
|
|
8741
|
+
rGeome.vol = {
|
|
8742
|
+
extrudes: [
|
|
8743
|
+
{
|
|
8744
|
+
outName: `subpax_${designName}_beam`,
|
|
8745
|
+
face: `${designName}_faceBeam`,
|
|
8746
|
+
extrudeMethod: EExtrude21.eLinearOrtho,
|
|
8747
|
+
length: 2 * Lbeam2,
|
|
8748
|
+
rotate: [0, 0, 0],
|
|
8749
|
+
translate: [0, 0, 0]
|
|
8750
|
+
},
|
|
8751
|
+
{
|
|
8752
|
+
outName: `subpax_${designName}_rail1`,
|
|
8753
|
+
face: `${designName}_faceRail`,
|
|
8754
|
+
extrudeMethod: EExtrude21.eLinearOrtho,
|
|
8755
|
+
length: T1,
|
|
8756
|
+
rotate: [0, 0, 0],
|
|
8757
|
+
translate: [0, 0, S1]
|
|
8758
|
+
},
|
|
8759
|
+
{
|
|
8760
|
+
outName: `subpax_${designName}_rail2`,
|
|
8761
|
+
face: `${designName}_faceRail`,
|
|
8762
|
+
extrudeMethod: EExtrude21.eLinearOrtho,
|
|
8763
|
+
length: T1,
|
|
8764
|
+
rotate: [0, 0, 0],
|
|
8765
|
+
translate: [0, 0, Lbeam2 + W12]
|
|
8766
|
+
}
|
|
8767
|
+
],
|
|
8768
|
+
volumes: [
|
|
8769
|
+
{
|
|
8770
|
+
outName: `pax_${designName}`,
|
|
8771
|
+
boolMethod: EBVolume21.eUnion,
|
|
8772
|
+
inList: [
|
|
8773
|
+
`subpax_${designName}_beam`,
|
|
8774
|
+
`subpax_${designName}_rail1`,
|
|
8775
|
+
`subpax_${designName}_rail2`
|
|
8776
|
+
]
|
|
8777
|
+
}
|
|
8778
|
+
]
|
|
8779
|
+
};
|
|
8780
|
+
rGeome.sub = {};
|
|
8781
|
+
rGeome.logstr += "trackXZ drawn successfully!\n";
|
|
8782
|
+
rGeome.calcErr = false;
|
|
8783
|
+
} catch (emsg) {
|
|
8784
|
+
rGeome.logstr += emsg;
|
|
8785
|
+
console.log(emsg);
|
|
8786
|
+
}
|
|
8787
|
+
return rGeome;
|
|
8788
|
+
}
|
|
8789
|
+
var trackXZDef = {
|
|
8790
|
+
pTitle: "trackXZ",
|
|
8791
|
+
pDescription: "simulation of train-capsule on XZ-track",
|
|
8792
|
+
pDef: pDef25,
|
|
8793
|
+
pGeom: pGeom25
|
|
7100
8794
|
};
|
|
7101
8795
|
|
|
7102
8796
|
// src/sysmix/square.ts
|
|
7103
8797
|
import {
|
|
7104
|
-
contour as
|
|
7105
|
-
contourCircle as
|
|
7106
|
-
ctrRectangle as
|
|
7107
|
-
figure as
|
|
7108
|
-
ffix as
|
|
7109
|
-
pNumber as
|
|
7110
|
-
pSectionSeparator as
|
|
7111
|
-
EExtrude as
|
|
7112
|
-
EBVolume as
|
|
7113
|
-
initGeom as
|
|
8798
|
+
contour as contour26,
|
|
8799
|
+
contourCircle as contourCircle20,
|
|
8800
|
+
ctrRectangle as ctrRectangle15,
|
|
8801
|
+
figure as figure23,
|
|
8802
|
+
ffix as ffix27,
|
|
8803
|
+
pNumber as pNumber26,
|
|
8804
|
+
pSectionSeparator as pSectionSeparator26,
|
|
8805
|
+
EExtrude as EExtrude22,
|
|
8806
|
+
EBVolume as EBVolume22,
|
|
8807
|
+
initGeom as initGeom26
|
|
7114
8808
|
} from "geometrix";
|
|
7115
|
-
var
|
|
8809
|
+
var pDef26 = {
|
|
7116
8810
|
partName: "square",
|
|
7117
8811
|
params: [
|
|
7118
8812
|
//pNumber(name, unit, init, min, max, step)
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
8813
|
+
pNumber26("W1", "mm", 100, 5, 500, 1),
|
|
8814
|
+
pNumber26("Di", "mm", 50, 2, 500, 1),
|
|
8815
|
+
pSectionSeparator26("Details and thickness"),
|
|
8816
|
+
pNumber26("R1", "mm", 0, 0, 50, 1),
|
|
8817
|
+
pNumber26("T1", "mm", 30, 1, 500, 1)
|
|
7124
8818
|
],
|
|
7125
8819
|
paramSvg: {
|
|
7126
8820
|
W1: "square_top.svg",
|
|
@@ -7135,10 +8829,10 @@ var pDef20 = {
|
|
|
7135
8829
|
// every 0.5 second
|
|
7136
8830
|
}
|
|
7137
8831
|
};
|
|
7138
|
-
function
|
|
7139
|
-
const rGeome =
|
|
7140
|
-
const figSquare =
|
|
7141
|
-
const figHeight =
|
|
8832
|
+
function pGeom26(t, param, suffix = "") {
|
|
8833
|
+
const rGeome = initGeom26(pDef26.partName + suffix);
|
|
8834
|
+
const figSquare = figure23();
|
|
8835
|
+
const figHeight = figure23();
|
|
7142
8836
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
7143
8837
|
`;
|
|
7144
8838
|
try {
|
|
@@ -7149,13 +8843,13 @@ function pGeom20(t, param, suffix = "") {
|
|
|
7149
8843
|
if (param.W1 < param.Di) {
|
|
7150
8844
|
throw `err069: W1 ${param.W1} is too small compare to Di ${param.Di}`;
|
|
7151
8845
|
}
|
|
7152
|
-
rGeome.logstr += `Surface ${
|
|
8846
|
+
rGeome.logstr += `Surface ${ffix27(surface)} mm2, volume ${ffix27(volume)} mm3
|
|
7153
8847
|
`;
|
|
7154
|
-
const ctrSquare =
|
|
7155
|
-
const ctrHole =
|
|
8848
|
+
const ctrSquare = contour26(-W12, -W12).addCornerRounded(param.R1).addSegStrokeR(param.W1, 0).addCornerRounded(param.R1).addSegStrokeR(0, param.W1).addCornerRounded(param.R1).addSegStrokeR(-param.W1, 0).addCornerRounded(param.R1).closeSegStroke();
|
|
8849
|
+
const ctrHole = contourCircle20(0, 0, Ri);
|
|
7156
8850
|
figSquare.addMainOI([ctrSquare, ctrHole]);
|
|
7157
|
-
figHeight.addMainO(
|
|
7158
|
-
figHeight.addSecond(
|
|
8851
|
+
figHeight.addMainO(ctrRectangle15(-W12, 0, 2 * W12, param.T1));
|
|
8852
|
+
figHeight.addSecond(ctrRectangle15(-Ri, 0, 2 * Ri, param.T1));
|
|
7159
8853
|
rGeome.fig = {
|
|
7160
8854
|
faceSquare: figSquare,
|
|
7161
8855
|
faceHeight: figHeight
|
|
@@ -7166,7 +8860,7 @@ function pGeom20(t, param, suffix = "") {
|
|
|
7166
8860
|
{
|
|
7167
8861
|
outName: `subpax_${designName}_square`,
|
|
7168
8862
|
face: `${designName}_faceSquare`,
|
|
7169
|
-
extrudeMethod:
|
|
8863
|
+
extrudeMethod: EExtrude22.eLinearOrtho,
|
|
7170
8864
|
length: param.T1,
|
|
7171
8865
|
rotate: [0, 0, 0],
|
|
7172
8866
|
translate: [0, 0, 0]
|
|
@@ -7175,7 +8869,7 @@ function pGeom20(t, param, suffix = "") {
|
|
|
7175
8869
|
volumes: [
|
|
7176
8870
|
{
|
|
7177
8871
|
outName: `pax_${designName}`,
|
|
7178
|
-
boolMethod:
|
|
8872
|
+
boolMethod: EBVolume22.eUnion,
|
|
7179
8873
|
inList: [`subpax_${designName}_square`]
|
|
7180
8874
|
}
|
|
7181
8875
|
]
|
|
@@ -7192,34 +8886,34 @@ function pGeom20(t, param, suffix = "") {
|
|
|
7192
8886
|
var squareDef = {
|
|
7193
8887
|
pTitle: "square",
|
|
7194
8888
|
pDescription: "simple square shape for experimenting systemix",
|
|
7195
|
-
pDef:
|
|
7196
|
-
pGeom:
|
|
8889
|
+
pDef: pDef26,
|
|
8890
|
+
pGeom: pGeom26
|
|
7197
8891
|
};
|
|
7198
8892
|
|
|
7199
8893
|
// src/sysmix/triangle.ts
|
|
7200
8894
|
import {
|
|
7201
|
-
contour as
|
|
7202
|
-
contourCircle as
|
|
7203
|
-
ctrRectangle as
|
|
7204
|
-
figure as
|
|
7205
|
-
ffix as
|
|
7206
|
-
pNumber as
|
|
7207
|
-
pSectionSeparator as
|
|
7208
|
-
EExtrude as
|
|
7209
|
-
EBVolume as
|
|
7210
|
-
initGeom as
|
|
8895
|
+
contour as contour27,
|
|
8896
|
+
contourCircle as contourCircle21,
|
|
8897
|
+
ctrRectangle as ctrRectangle16,
|
|
8898
|
+
figure as figure24,
|
|
8899
|
+
ffix as ffix28,
|
|
8900
|
+
pNumber as pNumber27,
|
|
8901
|
+
pSectionSeparator as pSectionSeparator27,
|
|
8902
|
+
EExtrude as EExtrude23,
|
|
8903
|
+
EBVolume as EBVolume23,
|
|
8904
|
+
initGeom as initGeom27
|
|
7211
8905
|
} from "geometrix";
|
|
7212
|
-
var
|
|
8906
|
+
var pDef27 = {
|
|
7213
8907
|
partName: "triangle",
|
|
7214
8908
|
params: [
|
|
7215
8909
|
//pNumber(name, unit, init, min, max, step)
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
8910
|
+
pNumber27("W1", "mm", 100, 5, 500, 1),
|
|
8911
|
+
pNumber27("T1", "mm", 20, 1, 500, 1),
|
|
8912
|
+
pNumber27("E1", "mm", 10, 1, 500, 1),
|
|
8913
|
+
pNumber27("N1", "triangles", 3, 1, 20, 1),
|
|
8914
|
+
pSectionSeparator27("Details and hole"),
|
|
8915
|
+
pNumber27("R1", "mm", 0, 0, 50, 1),
|
|
8916
|
+
pNumber27("Di", "mm", 50, 2, 500, 1)
|
|
7223
8917
|
],
|
|
7224
8918
|
paramSvg: {
|
|
7225
8919
|
W1: "triangle_top.svg",
|
|
@@ -7236,10 +8930,10 @@ var pDef21 = {
|
|
|
7236
8930
|
// every 0.5 second
|
|
7237
8931
|
}
|
|
7238
8932
|
};
|
|
7239
|
-
function
|
|
7240
|
-
const rGeome =
|
|
7241
|
-
const figTriangle =
|
|
7242
|
-
const figHeight =
|
|
8933
|
+
function pGeom27(t, param, suffix = "") {
|
|
8934
|
+
const rGeome = initGeom27(pDef27.partName + suffix);
|
|
8935
|
+
const figTriangle = figure24();
|
|
8936
|
+
const figHeight = figure24();
|
|
7243
8937
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
7244
8938
|
`;
|
|
7245
8939
|
try {
|
|
@@ -7253,15 +8947,15 @@ function pGeom21(t, param, suffix = "") {
|
|
|
7253
8947
|
if (W12h < Ri) {
|
|
7254
8948
|
throw `err077: W1 ${param.W1} is too small compare to Di ${param.Di}`;
|
|
7255
8949
|
}
|
|
7256
|
-
rGeome.logstr += `Surface ${
|
|
8950
|
+
rGeome.logstr += `Surface ${ffix28(surface)} mm2, volume ${ffix28(volume)} mm3
|
|
7257
8951
|
`;
|
|
7258
|
-
const ctrTriangle =
|
|
7259
|
-
const ctrHole =
|
|
8952
|
+
const ctrTriangle = contour27(-W12, -W12h).addCornerRounded(param.R1).addSegStrokeR(param.W1, 0).addCornerRounded(param.R1).addSegStrokeRP(2 * Math.PI / 3, param.W1).addCornerRounded(param.R1).closeSegStroke();
|
|
8953
|
+
const ctrHole = contourCircle21(0, 0, Ri);
|
|
7260
8954
|
figTriangle.addMainOI([ctrTriangle, ctrHole]);
|
|
7261
8955
|
for (let ii = 0; ii < param.N1; ii++) {
|
|
7262
8956
|
const Zpos = ii * Zoffset;
|
|
7263
|
-
figHeight.addMainO(
|
|
7264
|
-
figHeight.addSecond(
|
|
8957
|
+
figHeight.addMainO(ctrRectangle16(-W12h, Zpos, W1h, param.T1));
|
|
8958
|
+
figHeight.addSecond(ctrRectangle16(-Ri, Zpos, 2 * Ri, param.T1));
|
|
7265
8959
|
}
|
|
7266
8960
|
rGeome.fig = {
|
|
7267
8961
|
faceTriangle: figTriangle,
|
|
@@ -7273,7 +8967,7 @@ function pGeom21(t, param, suffix = "") {
|
|
|
7273
8967
|
extrudes: Vidx.map((ii) => ({
|
|
7274
8968
|
outName: `subpax_${designName}_tri${ii}`,
|
|
7275
8969
|
face: `${designName}_faceTriangle`,
|
|
7276
|
-
extrudeMethod:
|
|
8970
|
+
extrudeMethod: EExtrude23.eLinearOrtho,
|
|
7277
8971
|
length: param.T1,
|
|
7278
8972
|
rotate: [0, 0, 0],
|
|
7279
8973
|
translate: [0, 0, ii * Zoffset]
|
|
@@ -7281,7 +8975,7 @@ function pGeom21(t, param, suffix = "") {
|
|
|
7281
8975
|
volumes: [
|
|
7282
8976
|
{
|
|
7283
8977
|
outName: `pax_${designName}`,
|
|
7284
|
-
boolMethod:
|
|
8978
|
+
boolMethod: EBVolume23.eUnion,
|
|
7285
8979
|
inList: Vidx.map((ii) => `subpax_${designName}_tri${ii}`)
|
|
7286
8980
|
}
|
|
7287
8981
|
]
|
|
@@ -7298,30 +8992,30 @@ function pGeom21(t, param, suffix = "") {
|
|
|
7298
8992
|
var triangleDef = {
|
|
7299
8993
|
pTitle: "triangle",
|
|
7300
8994
|
pDescription: "triangle sandwich shape for experimenting systemix",
|
|
7301
|
-
pDef:
|
|
7302
|
-
pGeom:
|
|
8995
|
+
pDef: pDef27,
|
|
8996
|
+
pGeom: pGeom27
|
|
7303
8997
|
};
|
|
7304
8998
|
|
|
7305
8999
|
// src/sysmix/cylinder.ts
|
|
7306
9000
|
import {
|
|
7307
|
-
contourCircle as
|
|
7308
|
-
ctrRectangle as
|
|
7309
|
-
figure as
|
|
7310
|
-
ffix as
|
|
7311
|
-
pNumber as
|
|
7312
|
-
pSectionSeparator as
|
|
7313
|
-
EExtrude as
|
|
7314
|
-
EBVolume as
|
|
7315
|
-
initGeom as
|
|
9001
|
+
contourCircle as contourCircle22,
|
|
9002
|
+
ctrRectangle as ctrRectangle17,
|
|
9003
|
+
figure as figure25,
|
|
9004
|
+
ffix as ffix29,
|
|
9005
|
+
pNumber as pNumber28,
|
|
9006
|
+
pSectionSeparator as pSectionSeparator28,
|
|
9007
|
+
EExtrude as EExtrude24,
|
|
9008
|
+
EBVolume as EBVolume24,
|
|
9009
|
+
initGeom as initGeom28
|
|
7316
9010
|
} from "geometrix";
|
|
7317
|
-
var
|
|
9011
|
+
var pDef28 = {
|
|
7318
9012
|
partName: "cylinder",
|
|
7319
9013
|
params: [
|
|
7320
9014
|
//pNumber(name, unit, init, min, max, step)
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
9015
|
+
pNumber28("D1", "mm", 100, 5, 500, 1),
|
|
9016
|
+
pNumber28("Di", "mm", 50, 2, 500, 1),
|
|
9017
|
+
pSectionSeparator28("Thickness"),
|
|
9018
|
+
pNumber28("T1", "mm", 30, 1, 500, 1)
|
|
7325
9019
|
],
|
|
7326
9020
|
paramSvg: {
|
|
7327
9021
|
D1: "cylinder_top.svg",
|
|
@@ -7335,10 +9029,10 @@ var pDef22 = {
|
|
|
7335
9029
|
// every 0.5 second
|
|
7336
9030
|
}
|
|
7337
9031
|
};
|
|
7338
|
-
function
|
|
7339
|
-
const rGeome =
|
|
7340
|
-
const figCylinder =
|
|
7341
|
-
const figHeight =
|
|
9032
|
+
function pGeom28(t, param, suffix = "") {
|
|
9033
|
+
const rGeome = initGeom28(pDef28.partName + suffix);
|
|
9034
|
+
const figCylinder = figure25();
|
|
9035
|
+
const figHeight = figure25();
|
|
7342
9036
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
7343
9037
|
`;
|
|
7344
9038
|
try {
|
|
@@ -7349,13 +9043,13 @@ function pGeom22(t, param, suffix = "") {
|
|
|
7349
9043
|
if (R1 < Ri) {
|
|
7350
9044
|
throw `err071: D1 ${param.D1} is too small compare to Di ${param.Di}`;
|
|
7351
9045
|
}
|
|
7352
|
-
rGeome.logstr += `Surface ${
|
|
9046
|
+
rGeome.logstr += `Surface ${ffix29(surface)} mm2, volume ${ffix29(volume)} mm3
|
|
7353
9047
|
`;
|
|
7354
|
-
const ctrCylinder =
|
|
7355
|
-
const ctrHole =
|
|
9048
|
+
const ctrCylinder = contourCircle22(0, 0, R1);
|
|
9049
|
+
const ctrHole = contourCircle22(0, 0, Ri);
|
|
7356
9050
|
figCylinder.addMainOI([ctrCylinder, ctrHole]);
|
|
7357
|
-
figHeight.addMainO(
|
|
7358
|
-
figHeight.addSecond(
|
|
9051
|
+
figHeight.addMainO(ctrRectangle17(-R1, 0, 2 * R1, param.T1));
|
|
9052
|
+
figHeight.addSecond(ctrRectangle17(-Ri, 0, 2 * Ri, param.T1));
|
|
7359
9053
|
rGeome.fig = {
|
|
7360
9054
|
faceCylinder: figCylinder,
|
|
7361
9055
|
faceHeight: figHeight
|
|
@@ -7366,7 +9060,7 @@ function pGeom22(t, param, suffix = "") {
|
|
|
7366
9060
|
{
|
|
7367
9061
|
outName: `subpax_${designName}_cyl`,
|
|
7368
9062
|
face: `${designName}_faceCylinder`,
|
|
7369
|
-
extrudeMethod:
|
|
9063
|
+
extrudeMethod: EExtrude24.eLinearOrtho,
|
|
7370
9064
|
length: param.T1,
|
|
7371
9065
|
rotate: [0, 0, 0],
|
|
7372
9066
|
translate: [0, 0, 0]
|
|
@@ -7375,7 +9069,7 @@ function pGeom22(t, param, suffix = "") {
|
|
|
7375
9069
|
volumes: [
|
|
7376
9070
|
{
|
|
7377
9071
|
outName: `pax_${designName}`,
|
|
7378
|
-
boolMethod:
|
|
9072
|
+
boolMethod: EBVolume24.eIdentity,
|
|
7379
9073
|
inList: [`subpax_${designName}_cyl`]
|
|
7380
9074
|
}
|
|
7381
9075
|
]
|
|
@@ -7392,10 +9086,11 @@ function pGeom22(t, param, suffix = "") {
|
|
|
7392
9086
|
var cylinderDef = {
|
|
7393
9087
|
pTitle: "cylinder",
|
|
7394
9088
|
pDescription: "simple cylinder shape for experimenting systemix",
|
|
7395
|
-
pDef:
|
|
7396
|
-
pGeom:
|
|
9089
|
+
pDef: pDef28,
|
|
9090
|
+
pGeom: pGeom28
|
|
7397
9091
|
};
|
|
7398
9092
|
export {
|
|
9093
|
+
bridgeDef,
|
|
7399
9094
|
capsuleDef,
|
|
7400
9095
|
cylinderDef,
|
|
7401
9096
|
door1arcDef,
|
|
@@ -7403,6 +9098,9 @@ export {
|
|
|
7403
9098
|
factoryDef,
|
|
7404
9099
|
heliostatDef,
|
|
7405
9100
|
houseDef,
|
|
9101
|
+
minifootDef,
|
|
9102
|
+
minihelioDef,
|
|
9103
|
+
minimirDef,
|
|
7406
9104
|
pcarDef,
|
|
7407
9105
|
plugTorqueDef,
|
|
7408
9106
|
rccarDef,
|
|
@@ -7416,6 +9114,8 @@ export {
|
|
|
7416
9114
|
springWormDef,
|
|
7417
9115
|
squareDef,
|
|
7418
9116
|
stoneTowerDef,
|
|
9117
|
+
trackXYDef,
|
|
9118
|
+
trackXZDef,
|
|
7419
9119
|
triangleDef,
|
|
7420
9120
|
tunnelDef
|
|
7421
9121
|
};
|