desi77 0.1.14 → 0.1.15
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 +5 -1
- package/dist/index.js +536 -105
- package/dist/pgdsvg/doubleBone_face.svg +1 -0
- package/dist/pgdsvg/doubleBone_folding.svg +1 -0
- package/dist/pgdsvg/doubleBone_side.svg +1 -0
- package/dist/pgdsvg/doubleBone_top.svg +1 -0
- package/dist/pgdsvg/singleBone_face.svg +1 -0
- package/dist/pgdsvg/src_doubleBone.svg +1 -0
- package/dist/pgdsvg/src_singleBone.svg +1 -0
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -4867,78 +4867,507 @@ var rccarDef = {
|
|
|
4867
4867
|
pGeom: pGeom13
|
|
4868
4868
|
};
|
|
4869
4869
|
|
|
4870
|
-
// src/
|
|
4870
|
+
// src/rccar/singleBone.ts
|
|
4871
4871
|
import {
|
|
4872
|
-
point as point8,
|
|
4873
4872
|
contour as contour15,
|
|
4874
4873
|
contourCircle as contourCircle12,
|
|
4875
|
-
ctrRectangle as ctrRectangle7,
|
|
4876
4874
|
figure as figure12,
|
|
4877
4875
|
ffix as ffix15,
|
|
4878
4876
|
pNumber as pNumber14,
|
|
4879
|
-
pCheckbox as pCheckbox9,
|
|
4880
|
-
pDropdown as pDropdown8,
|
|
4881
4877
|
pSectionSeparator as pSectionSeparator14,
|
|
4882
4878
|
EExtrude as EExtrude11,
|
|
4883
4879
|
EBVolume as EBVolume11,
|
|
4884
4880
|
initGeom as initGeom14
|
|
4885
4881
|
} from "geometrix";
|
|
4886
4882
|
var pDef14 = {
|
|
4883
|
+
partName: "singleBone",
|
|
4884
|
+
params: [
|
|
4885
|
+
//pNumber(name, unit, init, min, max, step)
|
|
4886
|
+
pNumber14("D1", "mm", 30, 1, 500, 1),
|
|
4887
|
+
pNumber14("D2", "mm", 70, 1, 500, 1),
|
|
4888
|
+
pNumber14("L1", "mm", 200, 10, 1e3, 1),
|
|
4889
|
+
pSectionSeparator14("Details"),
|
|
4890
|
+
pNumber14("R3", "mm", 50, 0, 1e3, 1),
|
|
4891
|
+
pNumber14("W1", "mm", 30, 1, 500, 1),
|
|
4892
|
+
pNumber14("T1", "mm", 10, 1, 100, 1),
|
|
4893
|
+
pSectionSeparator14("Holes"),
|
|
4894
|
+
pNumber14("P2", "%", 50, 0, 99, 1),
|
|
4895
|
+
pNumber14("W2", "mm", 10, 1, 500, 1)
|
|
4896
|
+
],
|
|
4897
|
+
paramSvg: {
|
|
4898
|
+
D1: "singleBone_face.svg",
|
|
4899
|
+
D2: "singleBone_face.svg",
|
|
4900
|
+
L1: "singleBone_face.svg",
|
|
4901
|
+
R3: "singleBone_face.svg",
|
|
4902
|
+
W1: "singleBone_face.svg",
|
|
4903
|
+
T1: "singleBone_face.svg",
|
|
4904
|
+
P2: "singleBone_face.svg",
|
|
4905
|
+
W2: "singleBone_face.svg"
|
|
4906
|
+
},
|
|
4907
|
+
sim: {
|
|
4908
|
+
tMax: 200,
|
|
4909
|
+
tStep: 0.5,
|
|
4910
|
+
tUpdate: 500
|
|
4911
|
+
// every 0.5 second
|
|
4912
|
+
}
|
|
4913
|
+
};
|
|
4914
|
+
function pGeom14(t, param, suffix = "") {
|
|
4915
|
+
const rGeome = initGeom14(pDef14.partName + suffix);
|
|
4916
|
+
const figBone = figure12();
|
|
4917
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
4918
|
+
`;
|
|
4919
|
+
try {
|
|
4920
|
+
const W12 = param.W1 / 2;
|
|
4921
|
+
const R12 = param.D1 / 2;
|
|
4922
|
+
const R22 = param.D2 / 2;
|
|
4923
|
+
const boneLen = param.L1 + 2 * R22;
|
|
4924
|
+
const dX2 = R22 ** 2 - W12 ** 2;
|
|
4925
|
+
if (dX2 < 0) {
|
|
4926
|
+
throw `err086: D2 ${ffix15(param.D2)} is too small compare to W1 ${ffix15(param.W1)} mm`;
|
|
4927
|
+
}
|
|
4928
|
+
const dX = Math.sqrt(dX2);
|
|
4929
|
+
const L1b = param.L1 - 2 * dX;
|
|
4930
|
+
const Rh = W12 * param.P2 / 100;
|
|
4931
|
+
const hX1 = param.W2 + 2 * Rh;
|
|
4932
|
+
const N2 = Math.max(Math.floor((param.L1 - 2 * R22 - param.W2) / hX1), 0);
|
|
4933
|
+
const W2b = (param.L1 - 2 * R22 - N2 * 2 * Rh) / (N2 + 1);
|
|
4934
|
+
const hX0b = R22 + W2b + Rh;
|
|
4935
|
+
const hX1b = W2b + 2 * Rh;
|
|
4936
|
+
if (R22 < R12) {
|
|
4937
|
+
throw `err085: D2 ${ffix15(param.D2)} is too small compare to D1 ${ffix15(param.D1)} mm`;
|
|
4938
|
+
}
|
|
4939
|
+
if (L1b < 0) {
|
|
4940
|
+
throw `err095: L1 ${ffix15(param.L1)} is too small compare to D2 ${ffix15(param.D2)} mm`;
|
|
4941
|
+
}
|
|
4942
|
+
rGeome.logstr += `Bone length ${ffix15(boneLen)} mm
|
|
4943
|
+
`;
|
|
4944
|
+
rGeome.logstr += `Bone with N2 ${N2} holes of diameter ${ffix15(2 * Rh)} mm
|
|
4945
|
+
`;
|
|
4946
|
+
rGeome.logstr += `Bone W2b ${ffix15(W2b)} mm
|
|
4947
|
+
`;
|
|
4948
|
+
const ctrBone = contour15(dX, W12).addCornerRounded(param.R3).addPointR(-dX - R22, -W12).addPointR(0, -2 * W12).addSegArc2().addCornerRounded(param.R3).addSegStrokeR(L1b, 0).addCornerRounded(param.R3).addPointR(dX + R22, W12).addPointR(0, 2 * W12).addSegArc2().addCornerRounded(param.R3).closeSegStroke();
|
|
4949
|
+
const ctrAxis1 = contourCircle12(0, 0, R12);
|
|
4950
|
+
const ctrAxis2 = contourCircle12(param.L1, 0, R12);
|
|
4951
|
+
const ctrMinis = [];
|
|
4952
|
+
if (Rh > 0) {
|
|
4953
|
+
for (let ii = 0; ii < N2; ii++) {
|
|
4954
|
+
ctrMinis.push(contourCircle12(hX0b + ii * hX1b, 0, Rh));
|
|
4955
|
+
}
|
|
4956
|
+
}
|
|
4957
|
+
figBone.addMainOI([ctrBone, ctrAxis1, ctrAxis2, ...ctrMinis]);
|
|
4958
|
+
rGeome.fig = {
|
|
4959
|
+
faceBone: figBone
|
|
4960
|
+
};
|
|
4961
|
+
const designName = rGeome.partName;
|
|
4962
|
+
rGeome.vol = {
|
|
4963
|
+
extrudes: [
|
|
4964
|
+
{
|
|
4965
|
+
outName: `subpax_${designName}_bone`,
|
|
4966
|
+
face: `${designName}_faceBone`,
|
|
4967
|
+
extrudeMethod: EExtrude11.eLinearOrtho,
|
|
4968
|
+
length: param.T1,
|
|
4969
|
+
rotate: [0, 0, 0],
|
|
4970
|
+
translate: [0, 0, 0]
|
|
4971
|
+
}
|
|
4972
|
+
],
|
|
4973
|
+
volumes: [
|
|
4974
|
+
{
|
|
4975
|
+
outName: `pax_${designName}`,
|
|
4976
|
+
boolMethod: EBVolume11.eIdentity,
|
|
4977
|
+
inList: [`subpax_${designName}_bone`]
|
|
4978
|
+
}
|
|
4979
|
+
]
|
|
4980
|
+
};
|
|
4981
|
+
rGeome.sub = {};
|
|
4982
|
+
rGeome.logstr += "singleBone drawn successfully!\n";
|
|
4983
|
+
rGeome.calcErr = false;
|
|
4984
|
+
} catch (emsg) {
|
|
4985
|
+
rGeome.logstr += emsg;
|
|
4986
|
+
console.log(emsg);
|
|
4987
|
+
}
|
|
4988
|
+
return rGeome;
|
|
4989
|
+
}
|
|
4990
|
+
var singleBoneDef = {
|
|
4991
|
+
pTitle: "singleBone",
|
|
4992
|
+
pDescription: "detailed design of the suspension bone of the rccar",
|
|
4993
|
+
pDef: pDef14,
|
|
4994
|
+
pGeom: pGeom14
|
|
4995
|
+
};
|
|
4996
|
+
|
|
4997
|
+
// src/rccar/doubleBone.ts
|
|
4998
|
+
import {
|
|
4999
|
+
contourCircle as contourCircle13,
|
|
5000
|
+
degToRad as degToRad7,
|
|
5001
|
+
ffix as ffix16,
|
|
5002
|
+
pNumber as pNumber15,
|
|
5003
|
+
pSectionSeparator as pSectionSeparator15,
|
|
5004
|
+
initGeom as initGeom15
|
|
5005
|
+
} from "geometrix";
|
|
5006
|
+
import {
|
|
5007
|
+
tJDir as tJDir4,
|
|
5008
|
+
tJSide as tJSide4,
|
|
5009
|
+
contourJ as contourJ4,
|
|
5010
|
+
facet as facet4,
|
|
5011
|
+
sheetFold as sheetFold4
|
|
5012
|
+
} from "sheetfold";
|
|
5013
|
+
var pDef15 = {
|
|
5014
|
+
partName: "doubleBone",
|
|
5015
|
+
params: [
|
|
5016
|
+
//pNumber(name, unit, init, min, max, step)
|
|
5017
|
+
pNumber15("D1", "mm", 30, 1, 500, 1),
|
|
5018
|
+
pNumber15("D2", "mm", 70, 1, 500, 1),
|
|
5019
|
+
pNumber15("L1", "mm", 300, 10, 1e3, 1),
|
|
5020
|
+
pNumber15("L2", "mm", 200, 10, 1e3, 1),
|
|
5021
|
+
pNumber15("E1", "mm", 40, 1, 1e3, 1),
|
|
5022
|
+
pSectionSeparator15("Side"),
|
|
5023
|
+
pNumber15("W1", "mm", 30, 1, 500, 1),
|
|
5024
|
+
pNumber15("P2", "%", 50, 0, 99, 1),
|
|
5025
|
+
pNumber15("W2", "mm", 10, 1, 500, 1),
|
|
5026
|
+
pSectionSeparator15("Top"),
|
|
5027
|
+
pNumber15("S1", "mm", 20, 1, 100, 1),
|
|
5028
|
+
pNumber15("S2", "mm", 20, 1, 100, 1),
|
|
5029
|
+
pNumber15("S3", "mm", 20, 1, 100, 1),
|
|
5030
|
+
pNumber15("R3", "mm", 10, 0, 1e3, 1),
|
|
5031
|
+
pSectionSeparator15("Wing width"),
|
|
5032
|
+
pNumber15("P11", "%", 8, 0, 90, 1),
|
|
5033
|
+
pNumber15("P12", "%", 20, 0, 90, 1),
|
|
5034
|
+
pNumber15("P21", "%", 18, 0, 90, 1),
|
|
5035
|
+
pNumber15("P22", "%", 20, 0, 90, 1),
|
|
5036
|
+
pSectionSeparator15("Folding"),
|
|
5037
|
+
pNumber15("T1", "mm", 2, 0.5, 10, 0.1),
|
|
5038
|
+
pNumber15("Jangle", "degree", 90, 30, 120, 1),
|
|
5039
|
+
pNumber15("Jradius", "mm", 10, 0.1, 50, 0.1),
|
|
5040
|
+
pNumber15("Jneutral", "%", 50, 0, 100, 1),
|
|
5041
|
+
pNumber15("Jmark", "mm", 2, 0.1, 10, 0.1),
|
|
5042
|
+
pNumber15("Jradius2", "mm", 4, 0.1, 50, 0.1),
|
|
5043
|
+
pNumber15("Jmark2", "mm", 2, 0.1, 10, 0.1)
|
|
5044
|
+
],
|
|
5045
|
+
paramSvg: {
|
|
5046
|
+
D1: "doubleBone_face.svg",
|
|
5047
|
+
D2: "doubleBone_face.svg",
|
|
5048
|
+
L1: "doubleBone_face.svg",
|
|
5049
|
+
L2: "doubleBone_top.svg",
|
|
5050
|
+
E1: "doubleBone_top.svg",
|
|
5051
|
+
W1: "doubleBone_face.svg",
|
|
5052
|
+
P2: "doubleBone_side.svg",
|
|
5053
|
+
W2: "doubleBone_side.svg",
|
|
5054
|
+
S1: "doubleBone_top.svg",
|
|
5055
|
+
S2: "doubleBone_top.svg",
|
|
5056
|
+
S3: "doubleBone_top.svg",
|
|
5057
|
+
R3: "doubleBone_side.svg",
|
|
5058
|
+
P11: "doubleBone_top.svg",
|
|
5059
|
+
P12: "doubleBone_top.svg",
|
|
5060
|
+
P21: "doubleBone_top.svg",
|
|
5061
|
+
P22: "doubleBone_top.svg",
|
|
5062
|
+
T1: "doubleBone_folding.svg",
|
|
5063
|
+
Jangle: "doubleBone_folding.svg",
|
|
5064
|
+
Jradius: "doubleBone_folding.svg",
|
|
5065
|
+
Jneutral: "doubleBone_folding.svg",
|
|
5066
|
+
Jmark: "doubleBone_folding.svg",
|
|
5067
|
+
Jradius2: "doubleBone_folding.svg",
|
|
5068
|
+
Jmark2: "doubleBone_folding.svg"
|
|
5069
|
+
},
|
|
5070
|
+
sim: {
|
|
5071
|
+
tMax: 200,
|
|
5072
|
+
tStep: 0.5,
|
|
5073
|
+
tUpdate: 500
|
|
5074
|
+
// every 0.5 second
|
|
5075
|
+
}
|
|
5076
|
+
};
|
|
5077
|
+
function pGeom15(t, param, suffix = "") {
|
|
5078
|
+
const rGeome = initGeom15(pDef15.partName + suffix);
|
|
5079
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
5080
|
+
`;
|
|
5081
|
+
try {
|
|
5082
|
+
let calcInnerTri2 = function(iW, iH, iDW) {
|
|
5083
|
+
const rA = Math.atan2(iH, iW);
|
|
5084
|
+
const rInitDist = iDW / Math.sin(rA);
|
|
5085
|
+
return [rA, rInitDist];
|
|
5086
|
+
}, calcSplitTri2 = function(iL, iP) {
|
|
5087
|
+
if (iL < 0) {
|
|
5088
|
+
throw `err559: iL ${ffix16(iL)} is negative mm`;
|
|
5089
|
+
}
|
|
5090
|
+
let rLside = iL;
|
|
5091
|
+
let rLcenter = 0;
|
|
5092
|
+
if (iP > 0) {
|
|
5093
|
+
const pr = iP / 100;
|
|
5094
|
+
rLcenter = pr * iL;
|
|
5095
|
+
rLside = (iL - rLcenter) / 2;
|
|
5096
|
+
}
|
|
5097
|
+
return [rLside, rLcenter];
|
|
5098
|
+
}, makeCtrBone2 = function(iJ1, iJ2) {
|
|
5099
|
+
const rCtr = contourJ4(dX, W12).addPointR(-dX - R22, -W12).addPointR(0, -2 * W12).addSegArc2().startJunction(iJ1, tJDir4.eA, tJSide4.eABLeft).addSegStrokeR(L1b, 0).addPointR(dX + R22, W12).addPointR(0, 2 * W12).addSegArc2().startJunction(iJ2, tJDir4.eB, tJSide4.eABRight).closeSegStroke();
|
|
5100
|
+
return rCtr;
|
|
5101
|
+
}, makeCtrPlate2 = function(iJ1, iJ2, idx) {
|
|
5102
|
+
const tJ1 = `J${idx}1`;
|
|
5103
|
+
const tJ2 = `J${idx}2`;
|
|
5104
|
+
const rCtr = contourJ4(0, 0).addSegStrokeR(L2d, 0).startJunction(tJ1, tJDir4.eA, tJSide4.eABLeft).addSegStrokeR(L2c, 0).addSegStrokeR(L2d, 0);
|
|
5105
|
+
if (iJ2 !== "") {
|
|
5106
|
+
rCtr.startJunction(iJ2, tJDir4.eA, tJSide4.eABLeft);
|
|
5107
|
+
}
|
|
5108
|
+
rCtr.addSegStrokeR(0, L1b).addSegStrokeR(-L2d, 0).startJunction(tJ2, tJDir4.eA, tJSide4.eABLeft).addSegStrokeR(-L2c, 0).addSegStrokeR(-L2d, 0).startJunction(iJ1, tJDir4.eB, tJSide4.eABRight).closeSegStroke();
|
|
5109
|
+
return rCtr;
|
|
5110
|
+
}, makeCtrTri2 = function(jn, x0, y0, r0, ia, t1s, t1c, t2s, t2c) {
|
|
5111
|
+
const ctr = contourJ4(x0, y0).addCornerRounded(param.R3).addSegStrokeR(t1s, 0);
|
|
5112
|
+
if (t1c > 0) {
|
|
5113
|
+
ctr.startJunction(`${jn}1`, tJDir4.eA, tJSide4.eABRight).addSegStrokeR(t1c, 0).addSegStrokeR(t1s, 0);
|
|
5114
|
+
}
|
|
5115
|
+
const a2 = pi - ia;
|
|
5116
|
+
ctr.addCornerRounded(param.R3).addSegStrokeRP(a2, t2s);
|
|
5117
|
+
if (t2c > 0) {
|
|
5118
|
+
ctr.startJunction(`${jn}2`, tJDir4.eA, tJSide4.eABRight).addSegStrokeRP(a2, t2c).addSegStrokeRP(a2, t2s);
|
|
5119
|
+
}
|
|
5120
|
+
const a3 = pi + ia;
|
|
5121
|
+
ctr.addCornerRounded(param.R3).addSegStrokeRP(a3, t2s);
|
|
5122
|
+
if (t2c > 0) {
|
|
5123
|
+
ctr.startJunction(`${jn}3`, tJDir4.eA, tJSide4.eABRight).addSegStrokeRP(a3, t2c).addSegStrokeRP(a3, t2s);
|
|
5124
|
+
}
|
|
5125
|
+
const rCtr = ctr.rotate(x0, y0, r0);
|
|
5126
|
+
return rCtr;
|
|
5127
|
+
}, makeCtrSide2 = function(iJ1) {
|
|
5128
|
+
const rCtr = contourJ4(0, 0).addSegStrokeR(L2c, 0).addSegStrokeR(0, param.W1).startJunction(iJ1, tJDir4.eB, tJSide4.eABRight).addSegStrokeR(-L2c, 0).closeSegStroke();
|
|
5129
|
+
return rCtr;
|
|
5130
|
+
};
|
|
5131
|
+
var calcInnerTri = calcInnerTri2, calcSplitTri = calcSplitTri2, makeCtrBone = makeCtrBone2, makeCtrPlate = makeCtrPlate2, makeCtrTri = makeCtrTri2, makeCtrSide = makeCtrSide2;
|
|
5132
|
+
const pi = Math.PI;
|
|
5133
|
+
const pi2 = pi / 2;
|
|
5134
|
+
const W1 = param.W1;
|
|
5135
|
+
const W12 = W1 / 2;
|
|
5136
|
+
const R12 = param.D1 / 2;
|
|
5137
|
+
const R22 = param.D2 / 2;
|
|
5138
|
+
const boneLen = param.L1 + 2 * R22;
|
|
5139
|
+
const dX2 = R22 ** 2 - W12 ** 2;
|
|
5140
|
+
if (dX2 < 0) {
|
|
5141
|
+
throw `err086: D2 ${ffix16(param.D2)} is too small compare to W1 ${ffix16(param.W1)} mm`;
|
|
5142
|
+
}
|
|
5143
|
+
const dX = Math.sqrt(dX2);
|
|
5144
|
+
const L1b = param.L1 - 2 * dX;
|
|
5145
|
+
const Rh = W12 * param.P2 / 100;
|
|
5146
|
+
const hX1 = param.W2 + 2 * Rh;
|
|
5147
|
+
const N2 = Math.max(Math.floor((param.L1 - 2 * R22 - param.W2) / hX1), 0);
|
|
5148
|
+
const W2b = (param.L1 - 2 * R22 - N2 * 2 * Rh) / (N2 + 1);
|
|
5149
|
+
const hX0b = R22 + W2b + Rh;
|
|
5150
|
+
const hX1b = W2b + 2 * Rh;
|
|
5151
|
+
const aJa = degToRad7(param.Jangle);
|
|
5152
|
+
const aJn = param.Jneutral / 100;
|
|
5153
|
+
const aJr = param.Jradius;
|
|
5154
|
+
const aJm = param.Jmark;
|
|
5155
|
+
const aJr2 = param.Jradius2;
|
|
5156
|
+
const aJm2 = param.Jmark2;
|
|
5157
|
+
const cornerSizeExt = aJr + param.T1 * (1 - aJa);
|
|
5158
|
+
const cornerSizeInt = aJr - param.T1 * aJa;
|
|
5159
|
+
const cornerSizeInt2 = aJr2 - param.T1 * aJa;
|
|
5160
|
+
const L2b = param.L2 - 2 * cornerSizeExt;
|
|
5161
|
+
const L2c = L2b + 2 * cornerSizeInt - 2 * param.E1;
|
|
5162
|
+
const L2d = (L2b - L2c) / 2;
|
|
5163
|
+
const N2c = Math.max(Math.floor((L2c - param.W2) / hX1), 0);
|
|
5164
|
+
const W2c = (L2c - N2c * 2 * Rh) / (N2c + 1);
|
|
5165
|
+
const hX0c = W2c + Rh;
|
|
5166
|
+
const hX1c = W2c + 2 * Rh;
|
|
5167
|
+
const L1i = L1b - 2 * param.S2;
|
|
5168
|
+
const L2i = L2b - 2 * param.S1;
|
|
5169
|
+
const [tri1a, tri1d0] = calcInnerTri2(L2i, L1i, param.S3 / 2);
|
|
5170
|
+
const tri11L = L2i - 2 * tri1d0;
|
|
5171
|
+
const [tri2a, tri2d0] = calcInnerTri2(L1i, L2i, param.S3 / 2);
|
|
5172
|
+
const tri21L = L1i - 2 * tri2d0;
|
|
5173
|
+
const [tri11s, tri11c] = calcSplitTri2(tri11L, param.P11);
|
|
5174
|
+
const tri12L = tri11L / (2 * Math.cos(tri1a));
|
|
5175
|
+
const [tri12s, tri12c] = calcSplitTri2(tri12L, param.P12);
|
|
5176
|
+
const [tri21s, tri21c] = calcSplitTri2(tri21L, param.P21);
|
|
5177
|
+
const tri22L = tri21L / (2 * Math.cos(tri2a));
|
|
5178
|
+
const [tri22s, tri22c] = calcSplitTri2(tri22L, param.P22);
|
|
5179
|
+
const wingH = param.W1 / 2 + cornerSizeInt - cornerSizeInt2;
|
|
5180
|
+
if (R22 < R12) {
|
|
5181
|
+
throw `err085: D2 ${ffix16(param.D2)} is too small compare to D1 ${ffix16(param.D1)} mm`;
|
|
5182
|
+
}
|
|
5183
|
+
if (L1b < 0) {
|
|
5184
|
+
throw `err095: L1 ${ffix16(param.L1)} is too small compare to D2 ${ffix16(param.D2)} mm`;
|
|
5185
|
+
}
|
|
5186
|
+
if (param.E1 < cornerSizeInt) {
|
|
5187
|
+
throw `err151: E1 ${ffix16(param.E1)} is too small compare to Jradius ${ffix16(param.Jradius)} mm`;
|
|
5188
|
+
}
|
|
5189
|
+
if (L2c < 0) {
|
|
5190
|
+
throw `err150: L2 ${ffix16(param.L2)} is too small compare to E1 ${ffix16(param.E1)} mm`;
|
|
5191
|
+
}
|
|
5192
|
+
rGeome.logstr += `Bone length ${ffix16(boneLen)} mm
|
|
5193
|
+
`;
|
|
5194
|
+
rGeome.logstr += `Bone with N2 ${N2} holes of diameter ${ffix16(2 * Rh)} and W2b ${ffix16(W2b)} mm
|
|
5195
|
+
`;
|
|
5196
|
+
rGeome.logstr += `Side with N2c ${N2c} holes of diameter ${ffix16(2 * Rh)} and W2c ${ffix16(W2c)} mm
|
|
5197
|
+
`;
|
|
5198
|
+
const ctrAxis1 = contourCircle13(0, 0, R12);
|
|
5199
|
+
const ctrAxis2 = contourCircle13(param.L1, 0, R12);
|
|
5200
|
+
const ctrMinis = [];
|
|
5201
|
+
if (Rh > 0) {
|
|
5202
|
+
for (let ii = 0; ii < N2; ii++) {
|
|
5203
|
+
ctrMinis.push(contourCircle13(hX0b + ii * hX1b, 0, Rh));
|
|
5204
|
+
}
|
|
5205
|
+
}
|
|
5206
|
+
const ctrBone1 = makeCtrBone2("J1", "J2");
|
|
5207
|
+
const ctrBone2 = makeCtrBone2("J3", "J4");
|
|
5208
|
+
const faBone1 = facet4([ctrBone1, ctrAxis1, ctrAxis2, ...ctrMinis]);
|
|
5209
|
+
const faBone2 = facet4([ctrBone2, ctrAxis1, ctrAxis2, ...ctrMinis]);
|
|
5210
|
+
const ctrPlate1 = makeCtrPlate2("J1", "", 1);
|
|
5211
|
+
const ctrPlate2 = makeCtrPlate2("J3", "J2", 2);
|
|
5212
|
+
const x04 = param.S1 + tri1d0;
|
|
5213
|
+
const y04 = param.S2;
|
|
5214
|
+
const ctrTri14 = makeCtrTri2("J14", x04, y04, 0, tri1a, tri11s, tri11c, tri12s, tri12c);
|
|
5215
|
+
const ctrTri24 = makeCtrTri2("J24", x04, y04, 0, tri1a, tri11s, tri11c, tri12s, tri12c);
|
|
5216
|
+
const x02 = L2b - param.S1 - tri1d0;
|
|
5217
|
+
const y02 = L1b - param.S2;
|
|
5218
|
+
const ctrTri12 = makeCtrTri2("J12", x02, y02, pi, tri1a, tri11s, tri11c, tri12s, tri12c);
|
|
5219
|
+
const ctrTri22 = makeCtrTri2("J22", x02, y02, pi, tri1a, tri11s, tri11c, tri12s, tri12c);
|
|
5220
|
+
const x01 = L2b - param.S1;
|
|
5221
|
+
const y01 = param.S2 + tri2d0;
|
|
5222
|
+
const ctrTri11 = makeCtrTri2("J11", x01, y01, pi2, tri2a, tri21s, tri21c, tri22s, tri22c);
|
|
5223
|
+
const ctrTri21 = makeCtrTri2("J21", x01, y01, pi2, tri2a, tri21s, tri21c, tri22s, tri22c);
|
|
5224
|
+
const x03 = param.S1;
|
|
5225
|
+
const y03 = L1b - param.S2 - tri2d0;
|
|
5226
|
+
const ctrTri13 = makeCtrTri2("J13", x03, y03, -pi2, tri2a, tri21s, tri21c, tri22s, tri22c);
|
|
5227
|
+
const ctrTri23 = makeCtrTri2("J23", x03, y03, -pi2, tri2a, tri21s, tri21c, tri22s, tri22c);
|
|
5228
|
+
const faPlate1 = facet4([ctrPlate1, ctrTri14, ctrTri12, ctrTri11, ctrTri13]);
|
|
5229
|
+
const faPlate2 = facet4([ctrPlate2, ctrTri24, ctrTri22, ctrTri21, ctrTri23]);
|
|
5230
|
+
const ctrMinics = [];
|
|
5231
|
+
if (Rh > 0) {
|
|
5232
|
+
for (let ii = 0; ii < N2c; ii++) {
|
|
5233
|
+
ctrMinics.push(contourCircle13(hX0c + ii * hX1c, W12, Rh));
|
|
5234
|
+
}
|
|
5235
|
+
}
|
|
5236
|
+
const faSide1 = facet4([makeCtrSide2("J11"), ...ctrMinics]);
|
|
5237
|
+
const faSide2 = facet4([makeCtrSide2("J12"), ...ctrMinics]);
|
|
5238
|
+
const Jwings = [];
|
|
5239
|
+
const faWings = [];
|
|
5240
|
+
const tri13 = [tri21c, tri22c, tri22c];
|
|
5241
|
+
const tri24 = [tri11c, tri12c, tri12c];
|
|
5242
|
+
for (let i1 = 0; i1 < 2; i1++) {
|
|
5243
|
+
for (let i2 = 0; i2 < 4; i2++) {
|
|
5244
|
+
for (let i3 = 0; i3 < 3; i3++) {
|
|
5245
|
+
const jN = `J${i1 + 1}${i2 + 1}${i3 + 1}`;
|
|
5246
|
+
Jwings.push(jN);
|
|
5247
|
+
const triParity = i2 % 2;
|
|
5248
|
+
const triC = triParity === 1 ? tri24 : tri13;
|
|
5249
|
+
const lc = triC[i3];
|
|
5250
|
+
if (lc > 0) {
|
|
5251
|
+
const ctrJ = contourJ4(0, 0).addSegStrokeR(lc, 0).addSegStrokeR(0, wingH).startJunction(jN, tJDir4.eA, tJSide4.eABLeft).addSegStrokeR(-lc, 0).closeSegStroke();
|
|
5252
|
+
faWings.push(facet4([ctrJ]));
|
|
5253
|
+
}
|
|
5254
|
+
}
|
|
5255
|
+
}
|
|
5256
|
+
}
|
|
5257
|
+
const Jbase = ["J1", "J2", "J3", "J4", "J11", "J12", "J21", "J22"];
|
|
5258
|
+
const Jdef = { angle: aJa, radius: aJr, neutral: aJn, mark: aJm };
|
|
5259
|
+
const Jdef2 = { angle: aJa, radius: aJr2, neutral: aJn, mark: aJm2 };
|
|
5260
|
+
const juncs = {};
|
|
5261
|
+
for (const iJ of Jbase) {
|
|
5262
|
+
juncs[iJ] = Jdef;
|
|
5263
|
+
}
|
|
5264
|
+
for (const iJ of Jwings) {
|
|
5265
|
+
juncs[iJ] = Jdef2;
|
|
5266
|
+
}
|
|
5267
|
+
const half1A = ["J1", L2b, "J2", W1, "J3", L2b];
|
|
5268
|
+
const half2A = ["J11", W1, "J21", L1b];
|
|
5269
|
+
const half2P = ["J12", W1, "J22"];
|
|
5270
|
+
const sFold = sheetFold4(
|
|
5271
|
+
[faBone1, faPlate1, faPlate2, faBone2, faSide1, faSide2, ...faWings],
|
|
5272
|
+
juncs,
|
|
5273
|
+
[
|
|
5274
|
+
{ x1: 0, y1: 0, a1: 0, l1: W1, ante: half1A, post: ["J4"] },
|
|
5275
|
+
//{ x1: 2 * W1, y1: 0, a1: 0, l1: W1, ante: half3A, post: half3P },
|
|
5276
|
+
{ x1: 4 * W1, y1: 0, a1: 0, l1: L1b, ante: half2A, post: half2P }
|
|
5277
|
+
],
|
|
5278
|
+
param.T1,
|
|
5279
|
+
rGeome.partName
|
|
5280
|
+
);
|
|
5281
|
+
rGeome.fig = sFold.makeFigures();
|
|
5282
|
+
rGeome.vol = sFold.makeVolume();
|
|
5283
|
+
rGeome.sub = {};
|
|
5284
|
+
rGeome.logstr += "doubleBone drawn successfully!\n";
|
|
5285
|
+
rGeome.calcErr = false;
|
|
5286
|
+
} catch (emsg) {
|
|
5287
|
+
rGeome.logstr += emsg;
|
|
5288
|
+
console.log(emsg);
|
|
5289
|
+
}
|
|
5290
|
+
return rGeome;
|
|
5291
|
+
}
|
|
5292
|
+
var doubleBoneDef = {
|
|
5293
|
+
pTitle: "doubleBone",
|
|
5294
|
+
pDescription: "combined suspension bones of the rccar",
|
|
5295
|
+
pDef: pDef15,
|
|
5296
|
+
pGeom: pGeom15
|
|
5297
|
+
};
|
|
5298
|
+
|
|
5299
|
+
// src/capsule/capsule.ts
|
|
5300
|
+
import {
|
|
5301
|
+
point as point8,
|
|
5302
|
+
contour as contour16,
|
|
5303
|
+
contourCircle as contourCircle14,
|
|
5304
|
+
ctrRectangle as ctrRectangle7,
|
|
5305
|
+
figure as figure13,
|
|
5306
|
+
ffix as ffix17,
|
|
5307
|
+
pNumber as pNumber16,
|
|
5308
|
+
pCheckbox as pCheckbox9,
|
|
5309
|
+
pDropdown as pDropdown8,
|
|
5310
|
+
pSectionSeparator as pSectionSeparator16,
|
|
5311
|
+
EExtrude as EExtrude12,
|
|
5312
|
+
EBVolume as EBVolume12,
|
|
5313
|
+
initGeom as initGeom16
|
|
5314
|
+
} from "geometrix";
|
|
5315
|
+
var pDef16 = {
|
|
4887
5316
|
partName: "capsule",
|
|
4888
5317
|
params: [
|
|
4889
5318
|
//pNumber(name, unit, init, min, max, step)
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
5319
|
+
pNumber16("L1", "mm", 5e3, 1e3, 2e4, 1),
|
|
5320
|
+
pNumber16("WW1", "mm", 1800, 100, 4e3, 1),
|
|
5321
|
+
pNumber16("E1", "mm", 10, 1, 100, 1),
|
|
5322
|
+
pSectionSeparator16("Nose"),
|
|
5323
|
+
pNumber16("H1", "mm", 300, 10, 4e3, 1),
|
|
5324
|
+
pNumber16("H2", "mm", 500, 10, 4e3, 1),
|
|
5325
|
+
pNumber16("H3", "mm", 1200, 10, 4e3, 1),
|
|
5326
|
+
pNumber16("W1", "mm", 300, 10, 4e3, 1),
|
|
5327
|
+
pNumber16("W3", "mm", 1500, 10, 4e3, 1),
|
|
5328
|
+
pNumber16("C3", "mm", 200, 1, 1e3, 1),
|
|
5329
|
+
pNumber16("R1", "mm", 100, 0, 500, 1),
|
|
5330
|
+
pNumber16("R2", "mm", 100, 0, 500, 1),
|
|
5331
|
+
pNumber16("R3", "mm", 100, 0, 500, 1),
|
|
5332
|
+
pNumber16("R4", "mm", 100, 0, 500, 1),
|
|
5333
|
+
pSectionSeparator16("Wheels"),
|
|
5334
|
+
pNumber16("H0", "mm", 600, 100, 2e3, 1),
|
|
5335
|
+
pNumber16("D7", "mm", 500, 10, 2e3, 1),
|
|
5336
|
+
pNumber16("D8", "mm", 100, 10, 2e3, 1),
|
|
5337
|
+
pNumber16("WW2", "mm", 1e3, 100, 4e3, 1),
|
|
5338
|
+
pNumber16("WW3", "mm", 100, 1, 500, 1),
|
|
5339
|
+
pSectionSeparator16("Wheels details"),
|
|
5340
|
+
pNumber16("W6", "mm", 500, 10, 2e3, 1),
|
|
5341
|
+
pNumber16("W7", "mm", 600, 10, 2e3, 1),
|
|
5342
|
+
pNumber16("W8", "mm", 300, 10, 2e3, 1),
|
|
5343
|
+
pNumber16("H6", "mm", 300, 10, 2e3, 1),
|
|
5344
|
+
pSectionSeparator16("Front window"),
|
|
5345
|
+
pNumber16("FH1", "mm", 600, 10, 3e3, 1),
|
|
5346
|
+
pNumber16("FW1", "mm", 100, 10, 3e3, 1),
|
|
5347
|
+
pNumber16("FR1", "mm", 100, 0, 500, 1),
|
|
5348
|
+
pNumber16("FH3", "mm", 100, 10, 3e3, 1),
|
|
5349
|
+
pNumber16("FW3", "mm", 300, 10, 3e3, 1),
|
|
5350
|
+
pNumber16("FR3", "mm", 100, 0, 500, 1),
|
|
5351
|
+
pSectionSeparator16("Top"),
|
|
4923
5352
|
pDropdown8("topStyle", ["mirador", "sky", "roof"]),
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
5353
|
+
pNumber16("H5", "mm", 300, 10, 2e3, 1),
|
|
5354
|
+
pNumber16("W4", "mm", 500, 10, 5e3, 1),
|
|
5355
|
+
pNumber16("W5", "mm", 1e3, 10, 5e3, 1),
|
|
5356
|
+
pNumber16("R5", "mm", 50, 1, 500, 1),
|
|
5357
|
+
pNumber16("S5", "mm", 200, 10, 500, 1),
|
|
5358
|
+
pSectionSeparator16("Wall"),
|
|
4930
5359
|
pCheckbox9("sideWall", true),
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
5360
|
+
pNumber16("U1", "mm", 100, 10, 1e3, 1),
|
|
5361
|
+
pNumber16("U2", "mm", 500, 10, 3e3, 1),
|
|
5362
|
+
pNumber16("U3", "mm", 400, 10, 3e3, 1),
|
|
5363
|
+
pNumber16("V1", "mm", 600, 10, 3e3, 1),
|
|
5364
|
+
pNumber16("V2", "mm", 400, 10, 3e3, 1),
|
|
5365
|
+
pNumber16("JR1", "mm", 100, 0, 2e3, 1),
|
|
5366
|
+
pNumber16("JR2", "mm", 100, 0, 2e3, 1),
|
|
5367
|
+
pNumber16("JR3", "mm", 100, 0, 2e3, 1),
|
|
5368
|
+
pNumber16("JR4", "mm", 100, 0, 2e3, 1),
|
|
5369
|
+
pNumber16("JR5", "mm", 100, 0, 2e3, 1),
|
|
5370
|
+
pNumber16("JR6", "mm", 100, 0, 2e3, 1)
|
|
4942
5371
|
],
|
|
4943
5372
|
paramSvg: {
|
|
4944
5373
|
L1: "capsule_side.svg",
|
|
@@ -4995,21 +5424,21 @@ var pDef14 = {
|
|
|
4995
5424
|
// every 0.5 second
|
|
4996
5425
|
}
|
|
4997
5426
|
};
|
|
4998
|
-
function
|
|
4999
|
-
const rGeome =
|
|
5000
|
-
const figBody =
|
|
5001
|
-
const figWheels =
|
|
5002
|
-
const figFront =
|
|
5003
|
-
const figTop =
|
|
5004
|
-
const figTopInt =
|
|
5005
|
-
const figTopTop =
|
|
5006
|
-
const figTopLeg =
|
|
5007
|
-
const figWall =
|
|
5427
|
+
function pGeom16(t, param, suffix = "") {
|
|
5428
|
+
const rGeome = initGeom16(pDef16.partName + suffix);
|
|
5429
|
+
const figBody = figure13();
|
|
5430
|
+
const figWheels = figure13();
|
|
5431
|
+
const figFront = figure13();
|
|
5432
|
+
const figTop = figure13();
|
|
5433
|
+
const figTopInt = figure13();
|
|
5434
|
+
const figTopTop = figure13();
|
|
5435
|
+
const figTopLeg = figure13();
|
|
5436
|
+
const figWall = figure13();
|
|
5008
5437
|
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
5009
5438
|
`;
|
|
5010
5439
|
try {
|
|
5011
5440
|
let ctrBody2 = function(withBat) {
|
|
5012
|
-
const rCtr =
|
|
5441
|
+
const rCtr = contour16(-L12, param.H0);
|
|
5013
5442
|
if (withBat) {
|
|
5014
5443
|
rCtr.addSegStrokeR(Wwheels, 0).addSegStrokeR(0, -Hbatterie).addSegStrokeR(Lbatterie, 0).addSegStrokeR(0, Hbatterie).addSegStrokeR(Wwheels, 0);
|
|
5015
5444
|
} else {
|
|
@@ -5018,21 +5447,21 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5018
5447
|
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);
|
|
5019
5448
|
return rCtr;
|
|
5020
5449
|
}, ctrWheels2 = function(sign) {
|
|
5021
|
-
const rCtr =
|
|
5450
|
+
const rCtr = contour16(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();
|
|
5022
5451
|
return rCtr;
|
|
5023
5452
|
}, makeCtrTop2 = function(radius) {
|
|
5024
|
-
const rCtr =
|
|
5453
|
+
const rCtr = contour16(-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();
|
|
5025
5454
|
return rCtr;
|
|
5026
5455
|
}, ctrSideWindow2 = function(sign) {
|
|
5027
5456
|
const p0x = sign * (Ltotal / 2 - param.U1);
|
|
5028
5457
|
const p0y = param.H0 + param.H1 + param.H2 - UH2dy;
|
|
5029
|
-
const rCtr =
|
|
5458
|
+
const rCtr = contour16(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();
|
|
5030
5459
|
return rCtr;
|
|
5031
5460
|
}, volWheel2 = function(posX, idx) {
|
|
5032
5461
|
return {
|
|
5033
5462
|
outName: `subpax_${designName}_wheel${idx}`,
|
|
5034
5463
|
face: `${designName}_faceWheels`,
|
|
5035
|
-
extrudeMethod:
|
|
5464
|
+
extrudeMethod: EExtrude12.eRotate,
|
|
5036
5465
|
rotate: [0, 0, 0],
|
|
5037
5466
|
translate: [posX, R7, 0]
|
|
5038
5467
|
};
|
|
@@ -5040,7 +5469,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5040
5469
|
return {
|
|
5041
5470
|
outName: `subpax_${designName}_topLeg${idx}`,
|
|
5042
5471
|
face: `${designName}_faceTopLeg`,
|
|
5043
|
-
extrudeMethod:
|
|
5472
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5044
5473
|
length: E1,
|
|
5045
5474
|
rotate: [0, rotY, 0],
|
|
5046
5475
|
translate: [posX, 0, posZ]
|
|
@@ -5112,45 +5541,45 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5112
5541
|
const HfrontWin = Htotal - param.FH1 - param.FH3;
|
|
5113
5542
|
const Ltot2 = Ltotal + 200;
|
|
5114
5543
|
if (param.L1 - 2 * Wwheels < 2 * E1) {
|
|
5115
|
-
throw `err176: L1 ${
|
|
5544
|
+
throw `err176: L1 ${ffix17(param.L1)} is too small compare to W6 ${ffix17(param.W6)}, W7 ${ffix17(param.W7)} and W8 ${ffix17(param.W8)} mm`;
|
|
5116
5545
|
}
|
|
5117
5546
|
if (Hbatterie < E1) {
|
|
5118
|
-
throw `err114: Hbatterie ${
|
|
5547
|
+
throw `err114: Hbatterie ${ffix17(Hbatterie)} is too small compare to E1 ${ffix17(E1)} mm`;
|
|
5119
5548
|
}
|
|
5120
5549
|
if (Lbatterie < 2 * E1) {
|
|
5121
|
-
throw `err118: Lbatterie ${
|
|
5550
|
+
throw `err118: Lbatterie ${ffix17(Lbatterie)} is too small compare to E1 ${ffix17(E1)} mm`;
|
|
5122
5551
|
}
|
|
5123
5552
|
if (L5 < 3 * param.R5 + param.W5) {
|
|
5124
|
-
throw `err122: L5 ${
|
|
5553
|
+
throw `err122: L5 ${ffix17(L5)} is too small compare to W5 ${ffix17(param.W5)} and R5 ${ffix17(param.R5)} mm`;
|
|
5125
5554
|
}
|
|
5126
5555
|
if (H53 < 0.1) {
|
|
5127
|
-
throw `err220: H5 ${
|
|
5556
|
+
throw `err220: H5 ${ffix17(param.H5)} is too small compare to R5 ${ffix17(param.R5)} mm`;
|
|
5128
5557
|
}
|
|
5129
|
-
rGeome.logstr += `Platform surface: ${
|
|
5558
|
+
rGeome.logstr += `Platform surface: ${ffix17(platSurface)} m2, height: ${ffix17(heightTot / 1e3)} m
|
|
5130
5559
|
`;
|
|
5131
|
-
rGeome.logstr += `Lroof: ${
|
|
5560
|
+
rGeome.logstr += `Lroof: ${ffix17(Lroof)}, L5: ${ffix17(L5)} mm
|
|
5132
5561
|
`;
|
|
5133
|
-
rGeome.logstr += `Ltotal: ${
|
|
5562
|
+
rGeome.logstr += `Ltotal: ${ffix17(Ltotal / 1e3)}, Htotal: ${ffix17(Htotal / 1e3)} m
|
|
5134
5563
|
`;
|
|
5135
|
-
rGeome.logstr += `Batterie: LbatInt ${
|
|
5564
|
+
rGeome.logstr += `Batterie: LbatInt ${ffix17(LbatInt)}, HbatInt: ${ffix17(HbatInt)}, WW1 ${ffix17(param.WW1)} mm
|
|
5136
5565
|
`;
|
|
5137
5566
|
const ctrBodyExt = ctrBody2(true);
|
|
5138
|
-
const ctrBodyInt =
|
|
5567
|
+
const ctrBodyInt = contour16(-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);
|
|
5139
5568
|
const ctrBatterie = ctrRectangle7(-LbatInt2, posYbatterie, LbatInt, HbatInt);
|
|
5140
5569
|
figBody.addMainOI([ctrBodyExt, ctrBodyInt, ctrBatterie]);
|
|
5141
|
-
figBody.addSecond(
|
|
5142
|
-
figBody.addSecond(
|
|
5143
|
-
figBody.addSecond(
|
|
5144
|
-
figBody.addSecond(
|
|
5145
|
-
figBody.addSecond(
|
|
5146
|
-
figBody.addSecond(
|
|
5147
|
-
figBody.addSecond(
|
|
5148
|
-
figBody.addSecond(
|
|
5570
|
+
figBody.addSecond(contourCircle14(-posXwheel1, R7, R7));
|
|
5571
|
+
figBody.addSecond(contourCircle14(-posXwheel1, R7, R8));
|
|
5572
|
+
figBody.addSecond(contourCircle14(-posXwheel2, R7, R7));
|
|
5573
|
+
figBody.addSecond(contourCircle14(-posXwheel2, R7, R8));
|
|
5574
|
+
figBody.addSecond(contourCircle14(posXwheel1, R7, R7));
|
|
5575
|
+
figBody.addSecond(contourCircle14(posXwheel1, R7, R8));
|
|
5576
|
+
figBody.addSecond(contourCircle14(posXwheel2, R7, R7));
|
|
5577
|
+
figBody.addSecond(contourCircle14(posXwheel2, R7, R8));
|
|
5149
5578
|
figBody.addSecond(ctrRectangle7(-L52, posYtop, L5, param.H5));
|
|
5150
5579
|
figBody.addSecond(ctrRectangle7(-L52 - param.S5, posYtop2, L5 + 2 * param.S5, E1));
|
|
5151
5580
|
figWheels.addMainO(ctrWheels2(1));
|
|
5152
5581
|
figWheels.addSecond(ctrWheels2(-1));
|
|
5153
|
-
const ctrFront =
|
|
5582
|
+
const ctrFront = contour16(-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();
|
|
5154
5583
|
figFront.addMainO(ctrFront);
|
|
5155
5584
|
figFront.addSecond(ctrWheels2(1).rotate(0, 0, pi2).translate(WW12, R7));
|
|
5156
5585
|
figFront.addSecond(ctrWheels2(-1).rotate(0, 0, pi2).translate(WW12, R7));
|
|
@@ -5180,10 +5609,10 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5180
5609
|
figTopInt.mergeFigure(figTop, true);
|
|
5181
5610
|
figTopTop.addMainO(ctrTopTop);
|
|
5182
5611
|
figTopTop.mergeFigure(figTop, true);
|
|
5183
|
-
const ctrTopLeg =
|
|
5612
|
+
const ctrTopLeg = contour16(-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();
|
|
5184
5613
|
figTopLeg.addMainO(ctrTopLeg);
|
|
5185
5614
|
figFront.addSecond(ctrTopLeg);
|
|
5186
|
-
const ctrDoor =
|
|
5615
|
+
const ctrDoor = contour16(-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();
|
|
5187
5616
|
figWall.addMainOI([ctrBody2(false), ctrSideWindow2(1), ctrSideWindow2(-1), ctrDoor]);
|
|
5188
5617
|
figWall.mergeFigure(figBody, true);
|
|
5189
5618
|
rGeome.fig = {
|
|
@@ -5226,7 +5655,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5226
5655
|
{
|
|
5227
5656
|
outName: `subpax_${designName}_body`,
|
|
5228
5657
|
face: `${designName}_faceBody`,
|
|
5229
|
-
extrudeMethod:
|
|
5658
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5230
5659
|
length: param.WW1,
|
|
5231
5660
|
rotate: [0, 0, 0],
|
|
5232
5661
|
translate: [0, 0, 0]
|
|
@@ -5238,7 +5667,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5238
5667
|
{
|
|
5239
5668
|
outName: `subpax_${designName}_frontWin`,
|
|
5240
5669
|
face: `${designName}_faceFront`,
|
|
5241
|
-
extrudeMethod:
|
|
5670
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5242
5671
|
length: Ltot2,
|
|
5243
5672
|
rotate: [0, pi2, 0],
|
|
5244
5673
|
translate: [-Ltot2 / 2, 0, WW12]
|
|
@@ -5246,7 +5675,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5246
5675
|
{
|
|
5247
5676
|
outName: `subpax_${designName}_topInt`,
|
|
5248
5677
|
face: `${designName}_faceTopInt`,
|
|
5249
|
-
extrudeMethod:
|
|
5678
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5250
5679
|
length: 3 * E1,
|
|
5251
5680
|
rotate: [-pi2, 0, 0],
|
|
5252
5681
|
translate: [0, posYtop - 2 * E1, WW12]
|
|
@@ -5254,7 +5683,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5254
5683
|
{
|
|
5255
5684
|
outName: `subpax_${designName}_top1`,
|
|
5256
5685
|
face: `${designName}_faceTop`,
|
|
5257
|
-
extrudeMethod:
|
|
5686
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5258
5687
|
length: param.R5,
|
|
5259
5688
|
rotate: [-pi2, 0, 0],
|
|
5260
5689
|
translate: [0, posYtop, WW12]
|
|
@@ -5262,7 +5691,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5262
5691
|
{
|
|
5263
5692
|
outName: `subpax_${designName}_top2`,
|
|
5264
5693
|
face: `${designName}_faceTop`,
|
|
5265
|
-
extrudeMethod:
|
|
5694
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5266
5695
|
length: param.R5,
|
|
5267
5696
|
rotate: [-pi2, 0, 0],
|
|
5268
5697
|
translate: [0, posYtop2 - param.R5, WW12]
|
|
@@ -5270,7 +5699,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5270
5699
|
{
|
|
5271
5700
|
outName: `subpax_${designName}_topTop`,
|
|
5272
5701
|
face: `${designName}_faceTopTop`,
|
|
5273
|
-
extrudeMethod:
|
|
5702
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5274
5703
|
length: E1,
|
|
5275
5704
|
rotate: [-pi2, 0, 0],
|
|
5276
5705
|
translate: [0, posYtop2, WW12]
|
|
@@ -5284,7 +5713,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5284
5713
|
{
|
|
5285
5714
|
outName: `subpax_${designName}_wall1`,
|
|
5286
5715
|
face: `${designName}_faceWall`,
|
|
5287
|
-
extrudeMethod:
|
|
5716
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5288
5717
|
length: E1,
|
|
5289
5718
|
rotate: [0, 0, 0],
|
|
5290
5719
|
translate: [0, 0, 0]
|
|
@@ -5292,7 +5721,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5292
5721
|
{
|
|
5293
5722
|
outName: `subpax_${designName}_wall2`,
|
|
5294
5723
|
face: `${designName}_faceWall`,
|
|
5295
|
-
extrudeMethod:
|
|
5724
|
+
extrudeMethod: EExtrude12.eLinearOrtho,
|
|
5296
5725
|
length: E1,
|
|
5297
5726
|
rotate: [0, 0, 0],
|
|
5298
5727
|
translate: [0, 0, param.WW1 - E1]
|
|
@@ -5301,7 +5730,7 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5301
5730
|
volumes: [
|
|
5302
5731
|
{
|
|
5303
5732
|
outName: `ipax_${designName}_plus`,
|
|
5304
|
-
boolMethod:
|
|
5733
|
+
boolMethod: EBVolume12.eUnion,
|
|
5305
5734
|
inList: [
|
|
5306
5735
|
`subpax_${designName}_body`,
|
|
5307
5736
|
`subpax_${designName}_wheel1`,
|
|
@@ -5314,12 +5743,12 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5314
5743
|
},
|
|
5315
5744
|
{
|
|
5316
5745
|
outName: `ipax_${designName}_minus`,
|
|
5317
|
-
boolMethod:
|
|
5746
|
+
boolMethod: EBVolume12.eUnion,
|
|
5318
5747
|
inList: [`subpax_${designName}_frontWin`, ...roofHoleList]
|
|
5319
5748
|
},
|
|
5320
5749
|
{
|
|
5321
5750
|
outName: `pax_${designName}`,
|
|
5322
|
-
boolMethod:
|
|
5751
|
+
boolMethod: EBVolume12.eSubstraction,
|
|
5323
5752
|
inList: [`ipax_${designName}_plus`, `ipax_${designName}_minus`]
|
|
5324
5753
|
}
|
|
5325
5754
|
]
|
|
@@ -5336,16 +5765,18 @@ function pGeom14(t, param, suffix = "") {
|
|
|
5336
5765
|
var capsuleDef = {
|
|
5337
5766
|
pTitle: "capsule",
|
|
5338
5767
|
pDescription: "high-level concept of the train-capsule",
|
|
5339
|
-
pDef:
|
|
5340
|
-
pGeom:
|
|
5768
|
+
pDef: pDef16,
|
|
5769
|
+
pGeom: pGeom16
|
|
5341
5770
|
};
|
|
5342
5771
|
export {
|
|
5343
5772
|
capsuleDef,
|
|
5344
5773
|
door1arcDef,
|
|
5774
|
+
doubleBoneDef,
|
|
5345
5775
|
heliostatDef,
|
|
5346
5776
|
houseDef,
|
|
5347
5777
|
plugTorqueDef,
|
|
5348
5778
|
rccarDef,
|
|
5779
|
+
singleBoneDef,
|
|
5349
5780
|
springIntDef,
|
|
5350
5781
|
springOneDef,
|
|
5351
5782
|
springSideDef,
|