desi76 0.1.13 → 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 +720 -1
- package/dist/pgdsvg/long2d_back.svg +1 -0
- package/dist/pgdsvg/long2d_joint.svg +1 -0
- package/dist/pgdsvg/long2d_side.svg +1 -0
- package/dist/pgdsvg/long2d_top.svg +2 -0
- package/dist/pgdsvg/scara_side2.svg +1 -0
- package/dist/pgdsvg/scarabase_cut.svg +1 -0
- package/dist/pgdsvg/scarabase_double.svg +1 -0
- package/dist/pgdsvg/scarabase_heights.svg +1 -0
- package/dist/pgdsvg/scarabase_single.svg +1 -0
- package/dist/pgdsvg/src_long2d.svg +2 -0
- package/dist/pgdsvg/src_scara.svg +2 -2
- package/dist/pgdsvg/src_scarabase.svg +1 -0
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -2450,7 +2450,7 @@ var pDef6 = {
|
|
|
2450
2450
|
T3: "scara_top.svg",
|
|
2451
2451
|
R2i: "scara_top.svg",
|
|
2452
2452
|
R2e: "scara_top.svg",
|
|
2453
|
-
H1: "
|
|
2453
|
+
H1: "scara_side2.svg",
|
|
2454
2454
|
H2: "scara_side.svg",
|
|
2455
2455
|
H3: "scara_side.svg",
|
|
2456
2456
|
H41: "scara_side.svg",
|
|
@@ -2821,11 +2821,730 @@ var scaraDef = {
|
|
|
2821
2821
|
pDef: pDef6,
|
|
2822
2822
|
pGeom: pGeom6
|
|
2823
2823
|
};
|
|
2824
|
+
|
|
2825
|
+
// src/bot/scarabase.ts
|
|
2826
|
+
import {
|
|
2827
|
+
point as point4,
|
|
2828
|
+
contour as contour7,
|
|
2829
|
+
contourCircle as contourCircle6,
|
|
2830
|
+
ctrRectangle as ctrRectangle6,
|
|
2831
|
+
figure as figure7,
|
|
2832
|
+
degToRad as degToRad4,
|
|
2833
|
+
radToDeg as radToDeg5,
|
|
2834
|
+
ffix as ffix6,
|
|
2835
|
+
pNumber as pNumber7,
|
|
2836
|
+
pDropdown as pDropdown4,
|
|
2837
|
+
pSectionSeparator as pSectionSeparator7,
|
|
2838
|
+
initGeom as initGeom7,
|
|
2839
|
+
EExtrude as EExtrude7,
|
|
2840
|
+
EBVolume as EBVolume7
|
|
2841
|
+
} from "geometrix";
|
|
2842
|
+
var pDef7 = {
|
|
2843
|
+
// partName is used in URL. Choose a name without slash, backslash and space.
|
|
2844
|
+
partName: "scarabase",
|
|
2845
|
+
params: [
|
|
2846
|
+
//pNumber(name, unit, init, min, max, step)
|
|
2847
|
+
pNumber7("D1", "mm", 20, 1, 1e3, 1),
|
|
2848
|
+
pNumber7("D2", "mm", 60, 1, 1e3, 1),
|
|
2849
|
+
pNumber7("L3", "mm", 30, 0, 1e3, 1),
|
|
2850
|
+
pNumber7("L4", "mm", 20, 1, 100, 1),
|
|
2851
|
+
pNumber7("W5", "mm", 40, 1, 1e3, 1),
|
|
2852
|
+
pDropdown4("Nac", ["single", "double"]),
|
|
2853
|
+
pSectionSeparator7("Plate details"),
|
|
2854
|
+
pNumber7("R34", "mm", 2, 0, 10, 0.1),
|
|
2855
|
+
pNumber7("A5", "degree", 90, 0, 180, 1),
|
|
2856
|
+
pNumber7("W6", "mm", 10, 0, 1e3, 1),
|
|
2857
|
+
pNumber7("T3", "mm", 3, 1, 100, 1),
|
|
2858
|
+
pNumber7("T4", "mm", 10, 1, 100, 1),
|
|
2859
|
+
pSectionSeparator7("Heights and back"),
|
|
2860
|
+
pNumber7("H1", "mm", 50, 1, 1e3, 1),
|
|
2861
|
+
pNumber7("H2", "mm", 10, 1, 1e3, 1),
|
|
2862
|
+
pNumber7("H3", "mm", 10, 0, 1e3, 1),
|
|
2863
|
+
pNumber7("W8", "mm", 20, 1, 1e3, 1),
|
|
2864
|
+
pNumber7("H8", "mm", 30, 1, 1e3, 1),
|
|
2865
|
+
pNumber7("D8", "mm", 5, 1, 1e3, 1)
|
|
2866
|
+
],
|
|
2867
|
+
paramSvg: {
|
|
2868
|
+
D1: "scarabase_single.svg",
|
|
2869
|
+
D2: "scarabase_single.svg",
|
|
2870
|
+
L3: "scarabase_single.svg",
|
|
2871
|
+
L4: "scarabase_single.svg",
|
|
2872
|
+
W5: "scarabase_single.svg",
|
|
2873
|
+
Nac: "scarabase_double.svg",
|
|
2874
|
+
R34: "scarabase_single.svg",
|
|
2875
|
+
A5: "scarabase_double.svg",
|
|
2876
|
+
W6: "scarabase_double.svg",
|
|
2877
|
+
T3: "scarabase_single.svg",
|
|
2878
|
+
T4: "scarabase_single.svg",
|
|
2879
|
+
H1: "scarabase_cut.svg",
|
|
2880
|
+
H2: "scarabase_heights.svg",
|
|
2881
|
+
H3: "scarabase_heights.svg",
|
|
2882
|
+
W8: "scarabase_heights.svg",
|
|
2883
|
+
H8: "scarabase_heights.svg",
|
|
2884
|
+
D8: "scarabase_heights.svg"
|
|
2885
|
+
},
|
|
2886
|
+
sim: {
|
|
2887
|
+
tMax: 100,
|
|
2888
|
+
tStep: 0.5,
|
|
2889
|
+
tUpdate: 500
|
|
2890
|
+
// every 0.5 second
|
|
2891
|
+
}
|
|
2892
|
+
};
|
|
2893
|
+
function pGeom7(t, param, suffix = "") {
|
|
2894
|
+
const rGeome = initGeom7(pDef7.partName + suffix);
|
|
2895
|
+
const figPlate = figure7();
|
|
2896
|
+
const figBack = figure7();
|
|
2897
|
+
const figT3 = figure7();
|
|
2898
|
+
const figSide = figure7();
|
|
2899
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
2900
|
+
`;
|
|
2901
|
+
try {
|
|
2902
|
+
let ctrSingle2 = function(iT3nPlate) {
|
|
2903
|
+
const rCtr = contour7(0, 0);
|
|
2904
|
+
if (iT3nPlate === 1) {
|
|
2905
|
+
rCtr.addSegStrokeA(param.T3, 0).addSegStrokeA(param.T3, Y4).addCornerRounded(param.R34).addSegStrokeA(p22i.cx, p22i.cy).addPointA(W52, L432 + R2 - param.T3).addPointA(p21i.cx, p21i.cy).addSegArc2().addSegStrokeA(2 * W52 - param.T3, Y4).addCornerRounded(param.R34).addSegStrokeA(2 * W52 - param.T3, 0);
|
|
2906
|
+
}
|
|
2907
|
+
rCtr.addSegStrokeA(2 * W52, 0).addSegStrokeA(2 * W52, param.L4).addCornerRounded(param.R34).addSegStrokeA(p21.cx, p21.cy).addPointA(W52, L432 + R2).addPointA(p22.cx, p22.cy).addSegArc2().addSegStrokeA(0, param.L4).addCornerRounded(param.R34).closeSegStroke();
|
|
2908
|
+
return rCtr;
|
|
2909
|
+
}, ctrDouble2 = function(iT3nPlate) {
|
|
2910
|
+
const rCtr = contour7(0, 0);
|
|
2911
|
+
if (iT3nPlate === 1) {
|
|
2912
|
+
rCtr.addSegStrokeA(param.T3, 0).addSegStrokeA(param.T3, Y41).addCornerRounded(param.R34).addSegStrokeA(p33i.cx, p33i.cy).addPointA(p32i.cx, p32i.cy).addPointA(p31i.cx, p31i.cy).addSegArc2().addSegStrokeA(X42, Y42).addCornerRounded(param.R34).addSegStrokeA(X43, Y43).addCornerRounded(param.R34).addSegStrokeA(p43i.cx, p43i.cy).addPointA(p42i.cx, p42i.cy).addPointA(p41i.cx, p41i.cy).addSegArc2().addSegStrokeA(W7 - param.T3, Y44).addCornerRounded(param.R34).addSegStrokeA(W7 - param.T3, 0);
|
|
2913
|
+
}
|
|
2914
|
+
rCtr.addSegStrokeA(W7, 0).addSegStrokeA(W7, param.L4).addCornerRounded(param.R34).addSegStrokeA(p41.cx, p41.cy).addPointA(p42.cx, p42.cy).addPointA(p43.cx, p43.cy).addSegArc2().addSegStrokeA(W7 - X5, param.L4 + Y5).addCornerRounded(param.R34).addSegStrokeA(X5, param.L4 + Y5).addCornerRounded(param.R34).addSegStrokeA(p31.cx, p31.cy).addPointA(p32.cx, p32.cy).addPointA(p33.cx, p33.cy).addSegArc2().addSegStrokeA(0, param.L4).addCornerRounded(param.R34).closeSegStroke();
|
|
2915
|
+
return rCtr;
|
|
2916
|
+
};
|
|
2917
|
+
var ctrSingle = ctrSingle2, ctrDouble = ctrDouble2;
|
|
2918
|
+
const a5 = degToRad4(param.A5) / 2;
|
|
2919
|
+
const R1 = param.D1 / 2;
|
|
2920
|
+
const R2 = param.D2 / 2;
|
|
2921
|
+
const R8 = param.D8 / 2;
|
|
2922
|
+
const W52 = param.W5 / 2;
|
|
2923
|
+
const L32 = param.L3 + R2;
|
|
2924
|
+
const a21 = Math.atan(W52 / L32);
|
|
2925
|
+
const L21 = Math.sqrt(W52 ** 2 + L32 ** 2);
|
|
2926
|
+
const a22 = Math.acos(R2 / L21);
|
|
2927
|
+
const a2 = a21 + a22;
|
|
2928
|
+
const L432 = param.L4 + param.L3 + R2;
|
|
2929
|
+
const Ltot = 2 * R2 + param.L3 + param.L4;
|
|
2930
|
+
const Htot = param.H1 + 2 * (param.H2 + param.H3);
|
|
2931
|
+
const H23 = param.H2 + param.H3;
|
|
2932
|
+
const H123 = param.H1 + H23;
|
|
2933
|
+
const pi2 = Math.PI / 2;
|
|
2934
|
+
const Y4 = param.L4 + param.T3 * Math.tan((pi2 - a2) / 2);
|
|
2935
|
+
const X5 = param.W5 * Math.cos(a5);
|
|
2936
|
+
const Y5 = param.W5 * Math.sin(a5);
|
|
2937
|
+
const W7 = param.Nac === 0 ? param.W5 : param.W6 + 2 * X5;
|
|
2938
|
+
const X8 = (W7 - param.W8) / 2;
|
|
2939
|
+
const Y8 = (param.H1 - param.H8) / 2;
|
|
2940
|
+
if (R2 < R1 + 2 * param.T3) {
|
|
2941
|
+
throw `err132: D2 ${ffix6(2 * R2)} is too small compare to D1 ${ffix6(2 * R1)} and T3 ${ffix6(param.T3)}`;
|
|
2942
|
+
}
|
|
2943
|
+
if (X8 < R8) {
|
|
2944
|
+
throw `err124: W5 ${ffix6(2 * W52)} is too small compare to D8 ${ffix6(2 * R8)} and W8 ${ffix6(param.W8)}`;
|
|
2945
|
+
}
|
|
2946
|
+
if (Y8 < R8) {
|
|
2947
|
+
throw `err127: H1 ${ffix6(param.H1)} is too small compare to D8 ${ffix6(2 * R8)} and H8 ${ffix6(param.H8)}`;
|
|
2948
|
+
}
|
|
2949
|
+
if (param.H3 === 0) {
|
|
2950
|
+
rGeome.logstr += "warn125: Warning H3 is zero\n";
|
|
2951
|
+
}
|
|
2952
|
+
rGeome.logstr += `length ${ffix6(Ltot)} height ${ffix6(Htot)}
|
|
2953
|
+
`;
|
|
2954
|
+
if (param.Nac === 1) {
|
|
2955
|
+
rGeome.logstr += `angle between holders: ${ffix6(radToDeg5(2 * a5))}
|
|
2956
|
+
`;
|
|
2957
|
+
}
|
|
2958
|
+
rGeome.logstr += `W7 ${ffix6(W7)}
|
|
2959
|
+
`;
|
|
2960
|
+
const p21 = point4(W52, L432).translatePolar(-pi2 + a2, R2);
|
|
2961
|
+
const p22 = point4(W52, L432).translatePolar(-pi2 - a2, R2);
|
|
2962
|
+
const p21i = point4(W52, L432).translatePolar(-pi2 + a2, R2 - param.T3);
|
|
2963
|
+
const p22i = point4(W52, L432).translatePolar(-pi2 - a2, R2 - param.T3);
|
|
2964
|
+
const p30 = point4(X5 / 2, param.L4 + Y5 / 2).translatePolar(a5 + pi2, param.L3 + R2);
|
|
2965
|
+
const p31 = p30.translatePolar(a5 - pi2 + a2, R2);
|
|
2966
|
+
const p32 = p30.translatePolar(a5 + pi2, R2);
|
|
2967
|
+
const p33 = p30.translatePolar(a5 - pi2 - a2, R2);
|
|
2968
|
+
const p31i = p30.translatePolar(a5 - pi2 + a2, R2 - param.T3);
|
|
2969
|
+
const p32i = p30.translatePolar(a5 + pi2, R2 - param.T3);
|
|
2970
|
+
const p33i = p30.translatePolar(a5 - pi2 - a2, R2 - param.T3);
|
|
2971
|
+
const p40 = point4(W7 - X5 / 2, param.L4 + Y5 / 2).translatePolar(pi2 - a5, param.L3 + R2);
|
|
2972
|
+
const p41 = p40.translatePolar(-a5 - pi2 + a2, R2);
|
|
2973
|
+
const p42 = p40.translatePolar(-a5 + pi2, R2);
|
|
2974
|
+
const p43 = p40.translatePolar(-a5 - pi2 - a2, R2);
|
|
2975
|
+
const p41i = p40.translatePolar(-a5 - pi2 + a2, R2 - param.T3);
|
|
2976
|
+
const p42i = p40.translatePolar(-a5 + pi2, R2 - param.T3);
|
|
2977
|
+
const p43i = p40.translatePolar(-a5 - pi2 - a2, R2 - param.T3);
|
|
2978
|
+
const Y41 = param.L4 + param.T3 * Math.tan((a5 + (pi2 - a2)) / 2);
|
|
2979
|
+
const Y42 = param.L4 + Y5 - param.T3;
|
|
2980
|
+
const Y43 = Y42;
|
|
2981
|
+
const Y44 = Y41;
|
|
2982
|
+
const a42 = pi2 - a5 + (pi2 - a2);
|
|
2983
|
+
const X42 = X5 - param.T3 * Math.tan(a42 / 2);
|
|
2984
|
+
const X43 = W7 - X42;
|
|
2985
|
+
if (param.Nac === 0) {
|
|
2986
|
+
figPlate.addMainOI([ctrSingle2(0), contourCircle6(W52, L432, R1)]);
|
|
2987
|
+
} else {
|
|
2988
|
+
figPlate.addMainOI([
|
|
2989
|
+
ctrDouble2(0),
|
|
2990
|
+
contourCircle6(p30.cx, p30.cy, R1),
|
|
2991
|
+
contourCircle6(p40.cx, p40.cy, R1)
|
|
2992
|
+
]);
|
|
2993
|
+
}
|
|
2994
|
+
figPlate.addSecond(ctrRectangle6(0, 0, W7, param.T4));
|
|
2995
|
+
figPlate.addSecond(ctrRectangle6(X8 - R8, 0, 2 * R8, param.T4));
|
|
2996
|
+
figPlate.addSecond(ctrRectangle6(W7 - X8 - R8, 0, 2 * R8, param.T4));
|
|
2997
|
+
figBack.addMainOI([
|
|
2998
|
+
ctrRectangle6(0, H23, W7, param.H1),
|
|
2999
|
+
contourCircle6(X8, H23 + Y8, R8),
|
|
3000
|
+
contourCircle6(W7 - X8, H23 + Y8, R8),
|
|
3001
|
+
contourCircle6(X8, H123 - Y8, R8),
|
|
3002
|
+
contourCircle6(W7 - X8, H123 - Y8, R8)
|
|
3003
|
+
]);
|
|
3004
|
+
if (param.Nac === 0) {
|
|
3005
|
+
figBack.addSecond(ctrRectangle6(W52 - R1, 0, 2 * R1, H23));
|
|
3006
|
+
figBack.addSecond(ctrRectangle6(W52 - R2, 0, 2 * R2, H23));
|
|
3007
|
+
figBack.addSecond(ctrRectangle6(W52 - R1, H123, 2 * R1, H23));
|
|
3008
|
+
figBack.addSecond(ctrRectangle6(W52 - R2, H123, 2 * R2, H23));
|
|
3009
|
+
} else {
|
|
3010
|
+
figBack.addSecond(ctrRectangle6(p30.cx - R1, 0, 2 * R1, H23));
|
|
3011
|
+
figBack.addSecond(ctrRectangle6(p30.cx - R2, 0, 2 * R2, H23));
|
|
3012
|
+
figBack.addSecond(ctrRectangle6(p40.cx - R1, 0, 2 * R1, H23));
|
|
3013
|
+
figBack.addSecond(ctrRectangle6(p40.cx - R2, 0, 2 * R2, H23));
|
|
3014
|
+
figBack.addSecond(ctrRectangle6(p30.cx - R1, H123, 2 * R1, H23));
|
|
3015
|
+
figBack.addSecond(ctrRectangle6(p30.cx - R2, H123, 2 * R2, H23));
|
|
3016
|
+
figBack.addSecond(ctrRectangle6(p40.cx - R1, H123, 2 * R1, H23));
|
|
3017
|
+
figBack.addSecond(ctrRectangle6(p40.cx - R2, H123, 2 * R2, H23));
|
|
3018
|
+
}
|
|
3019
|
+
if (param.Nac === 0) {
|
|
3020
|
+
figT3.addMainO(ctrSingle2(1));
|
|
3021
|
+
figT3.addMainOI([
|
|
3022
|
+
contourCircle6(W52, L432, R1 + param.T3),
|
|
3023
|
+
contourCircle6(W52, L432, R1)
|
|
3024
|
+
]);
|
|
3025
|
+
} else {
|
|
3026
|
+
figT3.addMainO(ctrDouble2(1));
|
|
3027
|
+
figT3.addMainOI([
|
|
3028
|
+
contourCircle6(p30.cx, p30.cy, R1 + param.T3),
|
|
3029
|
+
contourCircle6(p30.cx, p30.cy, R1)
|
|
3030
|
+
]);
|
|
3031
|
+
figT3.addMainOI([
|
|
3032
|
+
contourCircle6(p40.cx, p40.cy, R1 + param.T3),
|
|
3033
|
+
contourCircle6(p40.cx, p40.cy, R1)
|
|
3034
|
+
]);
|
|
3035
|
+
}
|
|
3036
|
+
figT3.mergeFigure(figPlate, true);
|
|
3037
|
+
const ctrSide1 = contour7(0, param.H3).addSegStrokeR(L432 - R1 - param.T3, 0).addSegStrokeR(0, -param.H3).addSegStrokeR(param.T3, 0).addSegStrokeR(0, param.H3 + param.H2).addSegStrokeR(-L432 + R1 + param.T4, 0).addSegStrokeR(0, param.H1).addSegStrokeR(L432 - R1 - param.T4, 0).addSegStrokeR(0, param.H3 + param.H2).addSegStrokeR(-param.T3, 0).addSegStrokeR(0, -param.H3).addSegStrokeR(-L432 + R1 + param.T3, 0).closeSegStroke();
|
|
3038
|
+
const ctrSide2 = contour7(L432 + R1, 0).addSegStrokeR(param.T3, 0).addSegStrokeR(0, param.H3).addSegStrokeR(R2 - R1 - 2 * param.T3, 0).addSegStrokeR(0, -param.H3).addSegStrokeR(param.T3, 0).addSegStrokeR(0, param.H3 + param.H2).addSegStrokeR(-R2 + R1, 0).closeSegStroke();
|
|
3039
|
+
const ctrSide3 = contour7(L432 + R1, H123).addSegStrokeR(R2 - R1, 0).addSegStrokeR(0, param.H3 + param.H2).addSegStrokeR(-param.T3, 0).addSegStrokeR(0, -param.H3).addSegStrokeR(-R2 + R1 + 2 * param.T3, 0).addSegStrokeR(0, param.H3).addSegStrokeR(-param.T3, 0).closeSegStroke();
|
|
3040
|
+
figSide.addMainO(ctrSide1);
|
|
3041
|
+
figSide.addMainO(ctrSide2);
|
|
3042
|
+
figSide.addMainO(ctrSide3);
|
|
3043
|
+
rGeome.fig = {
|
|
3044
|
+
facePlate: figPlate,
|
|
3045
|
+
faceBack: figBack,
|
|
3046
|
+
faceT3: figT3,
|
|
3047
|
+
faceSide: figSide
|
|
3048
|
+
};
|
|
3049
|
+
const designName = rGeome.partName;
|
|
3050
|
+
const lExtrudes = [];
|
|
3051
|
+
const lUnion = [];
|
|
3052
|
+
if (param.H3 > 0) {
|
|
3053
|
+
lExtrudes.push({
|
|
3054
|
+
outName: `subpax_${designName}_t31`,
|
|
3055
|
+
face: `${designName}_faceT3`,
|
|
3056
|
+
extrudeMethod: EExtrude7.eLinearOrtho,
|
|
3057
|
+
length: param.H3,
|
|
3058
|
+
rotate: [0, 0, 0],
|
|
3059
|
+
translate: [0, 0, 0]
|
|
3060
|
+
});
|
|
3061
|
+
lUnion.push(`subpax_${designName}_t31`);
|
|
3062
|
+
lExtrudes.push({
|
|
3063
|
+
outName: `subpax_${designName}_t35`,
|
|
3064
|
+
face: `${designName}_faceT3`,
|
|
3065
|
+
extrudeMethod: EExtrude7.eLinearOrtho,
|
|
3066
|
+
length: param.H3,
|
|
3067
|
+
rotate: [0, 0, 0],
|
|
3068
|
+
translate: [0, 0, H123 + param.H2]
|
|
3069
|
+
});
|
|
3070
|
+
lUnion.push(`subpax_${designName}_t35`);
|
|
3071
|
+
}
|
|
3072
|
+
rGeome.vol = {
|
|
3073
|
+
extrudes: [
|
|
3074
|
+
{
|
|
3075
|
+
outName: `subpax_${designName}_plate2`,
|
|
3076
|
+
face: `${designName}_facePlate`,
|
|
3077
|
+
extrudeMethod: EExtrude7.eLinearOrtho,
|
|
3078
|
+
length: param.H2,
|
|
3079
|
+
rotate: [0, 0, 0],
|
|
3080
|
+
translate: [0, 0, param.H3]
|
|
3081
|
+
},
|
|
3082
|
+
{
|
|
3083
|
+
outName: `subpax_${designName}_plate4`,
|
|
3084
|
+
face: `${designName}_facePlate`,
|
|
3085
|
+
extrudeMethod: EExtrude7.eLinearOrtho,
|
|
3086
|
+
length: param.H2,
|
|
3087
|
+
rotate: [0, 0, 0],
|
|
3088
|
+
translate: [0, 0, H123]
|
|
3089
|
+
},
|
|
3090
|
+
{
|
|
3091
|
+
outName: `subpax_${designName}_back`,
|
|
3092
|
+
face: `${designName}_faceBack`,
|
|
3093
|
+
extrudeMethod: EExtrude7.eLinearOrtho,
|
|
3094
|
+
length: param.T4,
|
|
3095
|
+
rotate: [pi2, 0, 0],
|
|
3096
|
+
translate: [0, param.T4, 0]
|
|
3097
|
+
},
|
|
3098
|
+
...lExtrudes
|
|
3099
|
+
],
|
|
3100
|
+
volumes: [
|
|
3101
|
+
{
|
|
3102
|
+
outName: `pax_${designName}`,
|
|
3103
|
+
boolMethod: EBVolume7.eUnion,
|
|
3104
|
+
inList: [
|
|
3105
|
+
`subpax_${designName}_plate2`,
|
|
3106
|
+
`subpax_${designName}_plate4`,
|
|
3107
|
+
`subpax_${designName}_back`,
|
|
3108
|
+
...lUnion
|
|
3109
|
+
]
|
|
3110
|
+
}
|
|
3111
|
+
]
|
|
3112
|
+
};
|
|
3113
|
+
rGeome.sub = {};
|
|
3114
|
+
rGeome.logstr += "ScaraBase drawn successfully!\n";
|
|
3115
|
+
rGeome.calcErr = false;
|
|
3116
|
+
} catch (emsg) {
|
|
3117
|
+
rGeome.logstr += emsg;
|
|
3118
|
+
console.log(emsg);
|
|
3119
|
+
}
|
|
3120
|
+
return rGeome;
|
|
3121
|
+
}
|
|
3122
|
+
var scarabaseDef = {
|
|
3123
|
+
pTitle: "scarabase",
|
|
3124
|
+
pDescription: "The base of a Scara arm",
|
|
3125
|
+
pDef: pDef7,
|
|
3126
|
+
pGeom: pGeom7
|
|
3127
|
+
};
|
|
3128
|
+
|
|
3129
|
+
// src/bot/long2d.ts
|
|
3130
|
+
import {
|
|
3131
|
+
designParam,
|
|
3132
|
+
checkGeom,
|
|
3133
|
+
prefixLog,
|
|
3134
|
+
contourCircle as contourCircle7,
|
|
3135
|
+
ctrRectangle as ctrRectangle7,
|
|
3136
|
+
figure as figure8,
|
|
3137
|
+
degToRad as degToRad5,
|
|
3138
|
+
radToDeg as radToDeg6,
|
|
3139
|
+
ffix as ffix7,
|
|
3140
|
+
pNumber as pNumber8,
|
|
3141
|
+
pDropdown as pDropdown5,
|
|
3142
|
+
pSectionSeparator as pSectionSeparator8,
|
|
3143
|
+
initGeom as initGeom8,
|
|
3144
|
+
transform2d,
|
|
3145
|
+
transform3d,
|
|
3146
|
+
EExtrude as EExtrude8,
|
|
3147
|
+
EBVolume as EBVolume8
|
|
3148
|
+
} from "geometrix";
|
|
3149
|
+
var pDef8 = {
|
|
3150
|
+
// partName is used in URL. Choose a name without slash, backslash and space.
|
|
3151
|
+
partName: "long2d",
|
|
3152
|
+
params: [
|
|
3153
|
+
//pNumber(name, unit, init, min, max, step)
|
|
3154
|
+
pNumber8("NB", "leg", 3, 1, 10, 1),
|
|
3155
|
+
pNumber8("LA", "L-factor", 1, 0.1, 10, 0.1),
|
|
3156
|
+
pNumber8("LB", "L-add", 0, -10, 100, 0.1),
|
|
3157
|
+
pNumber8("DA", "D-factor", 1, 0.1, 10, 0.1),
|
|
3158
|
+
pNumber8("DB", "D-add", 0, -10, 100, 0.1),
|
|
3159
|
+
pNumber8("HA", "L-factor", 1, 0.1, 10, 0.1),
|
|
3160
|
+
pNumber8("HB", "L-add", 0, -10, 100, 0.1),
|
|
3161
|
+
pSectionSeparator8("Ending parameters"),
|
|
3162
|
+
pNumber8("EL", "mm", 100, 1, 1e3, 1),
|
|
3163
|
+
pNumber8("ED2", "mm", 60, 1, 1e3, 1),
|
|
3164
|
+
pNumber8("EH1", "mm", 50, 1, 1e3, 1),
|
|
3165
|
+
pSectionSeparator8("Constant parameters"),
|
|
3166
|
+
pNumber8("EH2", "mm", 10, 1, 1e3, 1),
|
|
3167
|
+
pNumber8("EH3", "mm", 10, 0, 1e3, 1),
|
|
3168
|
+
pNumber8("ED1", "mm", 20, 1, 1e3, 1),
|
|
3169
|
+
pNumber8("T1", "mm", 5, 1, 100, 1),
|
|
3170
|
+
pNumber8("T3", "mm", 3, 1, 100, 1),
|
|
3171
|
+
pNumber8("E1", "mm", 0.5, -10, 10, 0.1),
|
|
3172
|
+
pNumber8("E2", "mm", 0.5, -10, 10, 0.1),
|
|
3173
|
+
pNumber8("E3", "mm", 0.5, -10, 10, 0.1),
|
|
3174
|
+
pSectionSeparator8("Base"),
|
|
3175
|
+
pNumber8("L3", "mm", 30, 0, 1e3, 1),
|
|
3176
|
+
pNumber8("L4", "mm", 20, 1, 100, 1),
|
|
3177
|
+
pNumber8("W5", "mm", 40, 1, 1e3, 1),
|
|
3178
|
+
pNumber8("R34", "mm", 2, 0, 10, 0.1),
|
|
3179
|
+
pNumber8("T4", "mm", 10, 1, 100, 1),
|
|
3180
|
+
pSectionSeparator8("Base back"),
|
|
3181
|
+
pNumber8("W8", "mm", 20, 1, 1e3, 1),
|
|
3182
|
+
pNumber8("H8", "mm", 30, 1, 1e3, 1),
|
|
3183
|
+
pNumber8("D8", "mm", 5, 1, 1e3, 1),
|
|
3184
|
+
pSectionSeparator8("Leg details"),
|
|
3185
|
+
pNumber8("S12", "mm", 1, 0, 100, 1),
|
|
3186
|
+
pNumber8("Ri", "mm", 1, 0, 10, 0.1),
|
|
3187
|
+
pNumber8("Re", "mm", 0.4, 0, 10, 0.1),
|
|
3188
|
+
pSectionSeparator8("Angles and 3D parts"),
|
|
3189
|
+
pNumber8("PA1", "degree", 0, -120, 120, 1),
|
|
3190
|
+
pNumber8("PA2", "degree", 0, -120, 120, 1),
|
|
3191
|
+
pNumber8("PA3", "degree", 0, -120, 120, 1),
|
|
3192
|
+
pNumber8("PA4", "degree", 0, -120, 120, 1),
|
|
3193
|
+
pNumber8("PA5", "degree", 0, -120, 120, 1),
|
|
3194
|
+
pNumber8("PA6", "degree", 0, -120, 120, 1),
|
|
3195
|
+
pNumber8("PA7", "degree", 0, -120, 120, 1),
|
|
3196
|
+
pNumber8("PA8", "degree", 0, -120, 120, 1),
|
|
3197
|
+
pNumber8("PA9", "degree", 0, -120, 120, 1),
|
|
3198
|
+
pNumber8("PA10", "degree", 0, -120, 120, 1),
|
|
3199
|
+
pDropdown5("D3Enable", [
|
|
3200
|
+
"assembly",
|
|
3201
|
+
"parts",
|
|
3202
|
+
"axisall",
|
|
3203
|
+
"base",
|
|
3204
|
+
"leg1",
|
|
3205
|
+
"leg2",
|
|
3206
|
+
"leg3",
|
|
3207
|
+
"leg4",
|
|
3208
|
+
"leg5",
|
|
3209
|
+
"leg6",
|
|
3210
|
+
"leg7",
|
|
3211
|
+
"leg8",
|
|
3212
|
+
"leg9",
|
|
3213
|
+
"leg10"
|
|
3214
|
+
])
|
|
3215
|
+
],
|
|
3216
|
+
paramSvg: {
|
|
3217
|
+
NB: "long2d_top.svg",
|
|
3218
|
+
LA: "long2d_top.svg",
|
|
3219
|
+
LB: "long2d_top.svg",
|
|
3220
|
+
DA: "long2d_top.svg",
|
|
3221
|
+
DB: "long2d_top.svg",
|
|
3222
|
+
HA: "long2d_side.svg",
|
|
3223
|
+
HB: "long2d_side.svg",
|
|
3224
|
+
EL: "long2d_top.svg",
|
|
3225
|
+
ED2: "long2d_top.svg",
|
|
3226
|
+
EH1: "long2d_side.svg",
|
|
3227
|
+
EH2: "long2d_side.svg",
|
|
3228
|
+
EH3: "long2d_side.svg",
|
|
3229
|
+
ED1: "long2d_top.svg",
|
|
3230
|
+
T1: "long2d_joint.svg",
|
|
3231
|
+
T3: "long2d_top.svg",
|
|
3232
|
+
E1: "long2d_side.svg",
|
|
3233
|
+
E2: "long2d_joint.svg",
|
|
3234
|
+
E3: "long2d_joint.svg",
|
|
3235
|
+
L3: "long2d_top.svg",
|
|
3236
|
+
L4: "long2d_top.svg",
|
|
3237
|
+
W5: "long2d_top.svg",
|
|
3238
|
+
R34: "long2d_top.svg",
|
|
3239
|
+
T4: "long2d_top.svg",
|
|
3240
|
+
W8: "long2d_back.svg",
|
|
3241
|
+
H8: "long2d_back.svg",
|
|
3242
|
+
D8: "long2d_back.svg",
|
|
3243
|
+
S12: "long2d_top.svg",
|
|
3244
|
+
Ri: "long2d_top.svg",
|
|
3245
|
+
Re: "long2d_top.svg",
|
|
3246
|
+
PA1: "long2d_top.svg",
|
|
3247
|
+
PA2: "long2d_top.svg",
|
|
3248
|
+
PA3: "long2d_top.svg",
|
|
3249
|
+
PA4: "long2d_top.svg",
|
|
3250
|
+
PA5: "long2d_top.svg",
|
|
3251
|
+
PA6: "long2d_top.svg",
|
|
3252
|
+
PA7: "long2d_top.svg",
|
|
3253
|
+
PA8: "long2d_top.svg",
|
|
3254
|
+
PA9: "long2d_top.svg",
|
|
3255
|
+
PA10: "long2d_top.svg",
|
|
3256
|
+
D3Enable: "long2d_top.svg"
|
|
3257
|
+
},
|
|
3258
|
+
sim: {
|
|
3259
|
+
tMax: 100,
|
|
3260
|
+
tStep: 0.5,
|
|
3261
|
+
tUpdate: 500
|
|
3262
|
+
// every 0.5 second
|
|
3263
|
+
}
|
|
3264
|
+
};
|
|
3265
|
+
function pGeom8(t, param, suffix = "") {
|
|
3266
|
+
const rGeome = initGeom8(pDef8.partName + suffix);
|
|
3267
|
+
const figTop = figure8();
|
|
3268
|
+
const figSide = figure8();
|
|
3269
|
+
const figBack = figure8();
|
|
3270
|
+
const figAxis = figure8();
|
|
3271
|
+
rGeome.logstr += `${rGeome.partName} simTime: ${t}
|
|
3272
|
+
`;
|
|
3273
|
+
try {
|
|
3274
|
+
let figAxisCut2 = function(ix, iy, ih) {
|
|
3275
|
+
const rFig = figure8();
|
|
3276
|
+
rFig.addMainO(ctrRectangle7(ix, iy, param.T1, ih));
|
|
3277
|
+
rFig.addMainO(ctrRectangle7(ix + 2 * ER1 - param.T1, iy, param.T1, ih));
|
|
3278
|
+
return rFig;
|
|
3279
|
+
};
|
|
3280
|
+
var figAxisCut = figAxisCut2;
|
|
3281
|
+
const ER1 = param.ED1 / 2;
|
|
3282
|
+
const ER2 = param.ED2 / 2;
|
|
3283
|
+
const ER1i = ER1 - param.T1;
|
|
3284
|
+
const R8 = param.D8 / 2;
|
|
3285
|
+
const PAall = [
|
|
3286
|
+
param.PA1,
|
|
3287
|
+
param.PA2,
|
|
3288
|
+
param.PA3,
|
|
3289
|
+
param.PA4,
|
|
3290
|
+
param.PA5,
|
|
3291
|
+
param.PA6,
|
|
3292
|
+
param.PA7,
|
|
3293
|
+
param.PA8,
|
|
3294
|
+
param.PA9,
|
|
3295
|
+
param.PA10
|
|
3296
|
+
];
|
|
3297
|
+
const PA = PAall.slice(0, param.NB).map((iAngle) => degToRad5(iAngle));
|
|
3298
|
+
const BL = Array(param.NB).fill(param.EL);
|
|
3299
|
+
const BD2 = Array(param.NB + 1).fill(param.ED2);
|
|
3300
|
+
const BH1 = Array(param.NB + 1).fill(param.EH1);
|
|
3301
|
+
for (let ii = param.NB - 2; ii >= 0; ii--) {
|
|
3302
|
+
BL[ii] = BL[ii + 1] * param.LA + param.LB;
|
|
3303
|
+
}
|
|
3304
|
+
const EH23 = 2 * (param.EH2 + param.EH3);
|
|
3305
|
+
for (let ii = param.NB - 1; ii >= 0; ii--) {
|
|
3306
|
+
BD2[ii] = BD2[ii + 1] * param.DA + param.DB;
|
|
3307
|
+
BH1[ii] = BH1[ii + 1] * param.HA + param.HB + 2 * (param.EH2 + param.E1);
|
|
3308
|
+
}
|
|
3309
|
+
const BR2 = BD2.map((aD1) => aD1 / 2);
|
|
3310
|
+
const CH1 = BH1[0];
|
|
3311
|
+
const BLtot = BL.reduce((acc, val) => acc + val, 0);
|
|
3312
|
+
const L432 = param.L4 + param.L3 + BR2[0];
|
|
3313
|
+
const Ltot = L432 + BLtot + BR2[param.NB];
|
|
3314
|
+
const Htot = CH1 + param.EH23;
|
|
3315
|
+
const lastOrientation = PA.reduce((acc, val) => acc + val, 0);
|
|
3316
|
+
const W52 = param.W5 / 2;
|
|
3317
|
+
const X8 = (param.W5 - param.W8) / 2;
|
|
3318
|
+
const Y8 = (CH1 - param.H8) / 2;
|
|
3319
|
+
const pi2 = Math.PI / 2;
|
|
3320
|
+
const fabStepX = 1.2 * Math.max(2 * W52, 2 * BR2[0]);
|
|
3321
|
+
if (ER2 < ER1 + 2 * param.T3) {
|
|
3322
|
+
throw `err192: ED2 ${ffix7(2 * ER2)} is too small compare to ED1 ${ffix7(2 * ER1)} and T3 ${ffix7(param.T3)}`;
|
|
3323
|
+
}
|
|
3324
|
+
if (ER1i < 0) {
|
|
3325
|
+
throw `err216: ED1 ${ffix7(2 * ER1)} is too small compare to T1 ${ffix7(param.T1)}`;
|
|
3326
|
+
}
|
|
3327
|
+
if (X8 < R8) {
|
|
3328
|
+
throw `err195: W5 ${ffix7(param.W5)} is too small compare to D8 ${ffix7(2 * R8)} and W8 ${ffix7(param.W8)}`;
|
|
3329
|
+
}
|
|
3330
|
+
if (Y8 < R8) {
|
|
3331
|
+
throw `err198: H1 ${ffix7(CH1)} is too small compare to D8 ${ffix7(2 * R8)} and H8 ${ffix7(param.H8)}`;
|
|
3332
|
+
}
|
|
3333
|
+
if (param.H3 === 0) {
|
|
3334
|
+
rGeome.logstr += "warn125: Warning H3 is zero\n";
|
|
3335
|
+
}
|
|
3336
|
+
if (param.D3Enable > param.NB + 3) {
|
|
3337
|
+
rGeome.logstr += `warn238: Warning D3Enable ${param.D3Enable} select a not existing part for 3D
|
|
3338
|
+
`;
|
|
3339
|
+
}
|
|
3340
|
+
rGeome.logstr += `length ${ffix7(Ltot)} height ${ffix7(Htot)}
|
|
3341
|
+
`;
|
|
3342
|
+
rGeome.logstr += `lastOrientation ${ffix7(radToDeg6(lastOrientation))}
|
|
3343
|
+
`;
|
|
3344
|
+
for (let ii = 0; ii < param.NB; ii++) {
|
|
3345
|
+
rGeome.logstr += `leg-${ii + 1} : BL ${ffix7(BL[ii])}, D12 ${ffix7(BD2[ii])}, D22 ${ffix7(BD2[ii + 1])},`;
|
|
3346
|
+
rGeome.logstr += ` BH1 ${ffix7(BH1[ii + 1])}
|
|
3347
|
+
`;
|
|
3348
|
+
}
|
|
3349
|
+
const scarabaseParam = designParam(scarabaseDef.pDef, "");
|
|
3350
|
+
scarabaseParam.setVal("D1", 2 * ER1 + param.E3);
|
|
3351
|
+
scarabaseParam.setVal("D2", 2 * BR2[0]);
|
|
3352
|
+
scarabaseParam.setVal("L3", param.L3);
|
|
3353
|
+
scarabaseParam.setVal("L4", param.L4);
|
|
3354
|
+
scarabaseParam.setVal("W5", param.W5);
|
|
3355
|
+
scarabaseParam.setVal("Nac", 0);
|
|
3356
|
+
scarabaseParam.setVal("R34", param.R34);
|
|
3357
|
+
scarabaseParam.setVal("A5", 0);
|
|
3358
|
+
scarabaseParam.setVal("W6", 10);
|
|
3359
|
+
scarabaseParam.setVal("T3", param.T3);
|
|
3360
|
+
scarabaseParam.setVal("T4", param.T4);
|
|
3361
|
+
scarabaseParam.setVal("H1", CH1);
|
|
3362
|
+
scarabaseParam.setVal("H2", param.EH2);
|
|
3363
|
+
scarabaseParam.setVal("H3", param.EH3);
|
|
3364
|
+
scarabaseParam.setVal("W8", param.W8);
|
|
3365
|
+
scarabaseParam.setVal("H8", param.H8);
|
|
3366
|
+
scarabaseParam.setVal("D8", param.D8);
|
|
3367
|
+
const scarabaseGeom = scarabaseDef.pGeom(
|
|
3368
|
+
0,
|
|
3369
|
+
scarabaseParam.getParamVal(),
|
|
3370
|
+
scarabaseParam.getSuffix()
|
|
3371
|
+
);
|
|
3372
|
+
checkGeom(scarabaseGeom);
|
|
3373
|
+
rGeome.logstr += prefixLog(scarabaseGeom.logstr, scarabaseParam.getPartNameSuffix());
|
|
3374
|
+
const scaraLegParam = [];
|
|
3375
|
+
const scaraLegGeom = [];
|
|
3376
|
+
for (let ii = 0; ii < param.NB; ii++) {
|
|
3377
|
+
const iiParam = designParam(scaraDef.pDef, (ii + 1).toString());
|
|
3378
|
+
iiParam.setVal("L1", BL[ii]);
|
|
3379
|
+
iiParam.setVal("D11", param.ED1 + param.E2);
|
|
3380
|
+
iiParam.setVal("D12", BD2[ii]);
|
|
3381
|
+
iiParam.setVal("D21", 2 * ER1 + param.E3);
|
|
3382
|
+
iiParam.setVal("D22", BD2[ii + 1]);
|
|
3383
|
+
iiParam.setVal("firstEnd", 0);
|
|
3384
|
+
iiParam.setVal("secondEnd", 0);
|
|
3385
|
+
iiParam.setVal("A1", 90);
|
|
3386
|
+
iiParam.setVal("T1", param.T3);
|
|
3387
|
+
iiParam.setVal("T2", param.T3);
|
|
3388
|
+
iiParam.setVal("S2", BR2[ii + 1] + param.S12);
|
|
3389
|
+
iiParam.setVal("R1i", param.Ri);
|
|
3390
|
+
iiParam.setVal("R1e", param.Re);
|
|
3391
|
+
iiParam.setVal("iiEn", 1);
|
|
3392
|
+
iiParam.setVal("N2", 2);
|
|
3393
|
+
iiParam.setVal("S1", BR2[ii] + param.S12);
|
|
3394
|
+
iiParam.setVal("T3", param.T3);
|
|
3395
|
+
iiParam.setVal("R2i", param.Ri);
|
|
3396
|
+
iiParam.setVal("R2e", param.Re);
|
|
3397
|
+
iiParam.setVal("H1", BH1[ii + 1]);
|
|
3398
|
+
iiParam.setVal("H2", param.EH2);
|
|
3399
|
+
iiParam.setVal("H3", param.EH3);
|
|
3400
|
+
iiParam.setVal("H41", 0);
|
|
3401
|
+
iiParam.setVal("H42", 0);
|
|
3402
|
+
const iiGeom = scaraDef.pGeom(0, iiParam.getParamVal(), iiParam.getSuffix());
|
|
3403
|
+
checkGeom(iiGeom);
|
|
3404
|
+
rGeome.logstr += prefixLog(iiGeom.logstr, iiParam.getPartNameSuffix());
|
|
3405
|
+
scaraLegParam.push(iiParam);
|
|
3406
|
+
scaraLegGeom.push(iiGeom);
|
|
3407
|
+
}
|
|
3408
|
+
figTop.mergeFigure(scarabaseGeom.fig.faceT3);
|
|
3409
|
+
const legT3d = [];
|
|
3410
|
+
const axisT3d = [];
|
|
3411
|
+
for (let ii = 0; ii < param.NB; ii++) {
|
|
3412
|
+
const iiT2d = transform2d().addRotation(pi2 + PA[ii]);
|
|
3413
|
+
for (let jj = ii; jj > 0; jj--) {
|
|
3414
|
+
iiT2d.addTranslation(0, BL[jj - 1]).addRotation(PA[jj - 1]);
|
|
3415
|
+
}
|
|
3416
|
+
iiT2d.addTranslation(W52, L432);
|
|
3417
|
+
const iiTa = iiT2d.getRotation();
|
|
3418
|
+
const [iiTx, iiTy] = iiT2d.getTranslation();
|
|
3419
|
+
legT3d.push(
|
|
3420
|
+
transform3d().addTranslation(-BR2[ii], 0, 0).addRotation(0, 0, iiTa).addTranslation(iiTx, iiTy, 0)
|
|
3421
|
+
);
|
|
3422
|
+
axisT3d.push(transform3d().addRotation(0, 0, iiTa).addTranslation(iiTx, iiTy, 0));
|
|
3423
|
+
figTop.mergeFigure(
|
|
3424
|
+
scaraLegGeom[ii].fig.faceExtern.translate(-BR2[ii], 0).rotate(0, 0, iiTa).translate(iiTx, iiTy)
|
|
3425
|
+
);
|
|
3426
|
+
}
|
|
3427
|
+
figSide.mergeFigure(scarabaseGeom.fig.faceSide);
|
|
3428
|
+
let posX = param.L4 + param.L3;
|
|
3429
|
+
let posY = 0;
|
|
3430
|
+
for (let ii = 0; ii < param.NB; ii++) {
|
|
3431
|
+
if (ii > 0) {
|
|
3432
|
+
posX += BR2[ii - 1] + BL[ii - 1] - BR2[ii];
|
|
3433
|
+
}
|
|
3434
|
+
figSide.mergeFigure(figAxisCut2(posX + BR2[ii] - ER1, posY, BH1[ii] + EH23));
|
|
3435
|
+
axisT3d[ii].addTranslation(0, 0, posY);
|
|
3436
|
+
posY += param.EH2 + param.E1;
|
|
3437
|
+
legT3d[ii].addTranslation(0, 0, posY);
|
|
3438
|
+
figSide.mergeFigure(scaraLegGeom[ii].fig.faceSide.translate(posX, posY));
|
|
3439
|
+
}
|
|
3440
|
+
figBack.mergeFigure(scarabaseGeom.fig.faceBack);
|
|
3441
|
+
figAxis.addMainOI([contourCircle7(0, 0, ER1), contourCircle7(0, 0, ER1i)]);
|
|
3442
|
+
figAxis.addSecond(contourCircle7(0, 0, ER1 + param.T3));
|
|
3443
|
+
rGeome.fig = {
|
|
3444
|
+
faceTop: figTop,
|
|
3445
|
+
faceSide: figSide,
|
|
3446
|
+
faceBack: figBack,
|
|
3447
|
+
faceAxis: figAxis
|
|
3448
|
+
};
|
|
3449
|
+
const designName = rGeome.partName;
|
|
3450
|
+
const partInherit = [];
|
|
3451
|
+
const partExtrude = [];
|
|
3452
|
+
const partList = [];
|
|
3453
|
+
if ([0, 1, 3].includes(param.D3Enable)) {
|
|
3454
|
+
const fabStepY2 = param.D3Enable === 0 ? 0 : 4 * ER1;
|
|
3455
|
+
const partScarabase = {
|
|
3456
|
+
outName: `inpax_${designName}_base`,
|
|
3457
|
+
subdesign: "pax_scarabase",
|
|
3458
|
+
subgeom: scarabaseGeom,
|
|
3459
|
+
rotate: [0, 0, 0],
|
|
3460
|
+
translate: [0, fabStepY2, 0]
|
|
3461
|
+
};
|
|
3462
|
+
partInherit.push(partScarabase);
|
|
3463
|
+
partList.push(`inpax_${designName}_base`);
|
|
3464
|
+
}
|
|
3465
|
+
for (let ii = 0; ii < param.NB; ii++) {
|
|
3466
|
+
if ([0, 1].includes(param.D3Enable) || ii - param.D3Enable === -4) {
|
|
3467
|
+
const iiName = `inpax_${designName}_leg_${ii + 1}`;
|
|
3468
|
+
const iiLegT3d2 = transform3d().addRotation(0, 0, pi2).addTranslation((ii + 1.5) * fabStepX, 4 * ER1, 0);
|
|
3469
|
+
const iiLegT3d = param.D3Enable === 0 ? legT3d[ii] : iiLegT3d2;
|
|
3470
|
+
const iiPartScaraLeg = {
|
|
3471
|
+
outName: iiName,
|
|
3472
|
+
subdesign: `pax_${scaraLegParam[ii].getPartNameSuffix()}`,
|
|
3473
|
+
subgeom: scaraLegGeom[ii],
|
|
3474
|
+
rotate: iiLegT3d.getRotation(),
|
|
3475
|
+
translate: iiLegT3d.getTranslation()
|
|
3476
|
+
};
|
|
3477
|
+
partInherit.push(iiPartScaraLeg);
|
|
3478
|
+
partList.push(iiName);
|
|
3479
|
+
}
|
|
3480
|
+
}
|
|
3481
|
+
if ([0, 1, 2].includes(param.D3Enable)) {
|
|
3482
|
+
for (let ii = 0; ii < param.NB; ii++) {
|
|
3483
|
+
const iiName = `subpax_${designName}_axis_${ii + 1}`;
|
|
3484
|
+
const iiAxisT3d2 = transform3d().addTranslation((ii + 1) * 3 * ER1, 2 * ER1, 0);
|
|
3485
|
+
const iiAxisT3d = param.D3Enable === 0 ? axisT3d[ii] : iiAxisT3d2;
|
|
3486
|
+
const iiPartAxis = {
|
|
3487
|
+
outName: iiName,
|
|
3488
|
+
face: `${designName}_faceAxis`,
|
|
3489
|
+
extrudeMethod: EExtrude8.eLinearOrtho,
|
|
3490
|
+
length: BH1[ii] + EH23,
|
|
3491
|
+
rotate: iiAxisT3d.getRotation(),
|
|
3492
|
+
translate: iiAxisT3d.getTranslation()
|
|
3493
|
+
};
|
|
3494
|
+
partExtrude.push(iiPartAxis);
|
|
3495
|
+
partList.push(iiName);
|
|
3496
|
+
}
|
|
3497
|
+
}
|
|
3498
|
+
rGeome.vol = {
|
|
3499
|
+
inherits: partInherit,
|
|
3500
|
+
extrudes: partExtrude,
|
|
3501
|
+
volumes: [
|
|
3502
|
+
{
|
|
3503
|
+
outName: `pax_${designName}`,
|
|
3504
|
+
boolMethod: EBVolume8.eUnion,
|
|
3505
|
+
inList: partList
|
|
3506
|
+
}
|
|
3507
|
+
]
|
|
3508
|
+
};
|
|
3509
|
+
const subBase = {
|
|
3510
|
+
partName: scarabaseParam.getPartName(),
|
|
3511
|
+
dparam: scarabaseParam.getDesignParamList(),
|
|
3512
|
+
orientation: [0, 0, 0],
|
|
3513
|
+
position: [0, 0, 0]
|
|
3514
|
+
};
|
|
3515
|
+
rGeome.sub = {
|
|
3516
|
+
scaraBase: subBase
|
|
3517
|
+
};
|
|
3518
|
+
for (let ii = 0; ii < param.NB; ii++) {
|
|
3519
|
+
const subLeg = {
|
|
3520
|
+
partName: scaraLegParam[ii].getPartName(),
|
|
3521
|
+
dparam: scaraLegParam[ii].getDesignParamList(),
|
|
3522
|
+
orientation: legT3d[ii].getRotation(),
|
|
3523
|
+
position: legT3d[ii].getTranslation()
|
|
3524
|
+
};
|
|
3525
|
+
rGeome.sub[`scaraLeg_${ii + 1}`] = subLeg;
|
|
3526
|
+
}
|
|
3527
|
+
rGeome.logstr += "Long2D drawn successfully!\n";
|
|
3528
|
+
rGeome.calcErr = false;
|
|
3529
|
+
} catch (emsg) {
|
|
3530
|
+
rGeome.logstr += emsg;
|
|
3531
|
+
console.log(emsg);
|
|
3532
|
+
}
|
|
3533
|
+
return rGeome;
|
|
3534
|
+
}
|
|
3535
|
+
var long2dDef = {
|
|
3536
|
+
pTitle: "long2d",
|
|
3537
|
+
pDescription: "A long arm with many legs moving in one 2D-plan",
|
|
3538
|
+
pDef: pDef8,
|
|
3539
|
+
pGeom: pGeom8
|
|
3540
|
+
};
|
|
2824
3541
|
export {
|
|
2825
3542
|
abriDef,
|
|
2826
3543
|
catamaranDef,
|
|
2827
3544
|
cuisineDef,
|
|
3545
|
+
long2dDef,
|
|
2828
3546
|
scaraDef,
|
|
3547
|
+
scarabaseDef,
|
|
2829
3548
|
stairsDef,
|
|
2830
3549
|
voilaDef
|
|
2831
3550
|
};
|