designix 0.5.11 → 0.5.12
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 +59 -0
- package/dist/index.js +5669 -0
- package/dist/index.js.map +1 -0
- package/package.json +6 -1
- package/.eslintignore +0 -17
- package/.eslintrc.cjs +0 -24
- package/.prettierignore +0 -15
- package/.prettierrc +0 -8
- package/export_svg/base.svg +0 -1
- package/export_svg/base_cut.svg +0 -1
- package/export_svg/base_hollow.svg +0 -1
- package/export_svg/base_top.svg +0 -1
- package/export_svg/calculation_of_initAngle2.svg +0 -1
- package/export_svg/circles.svg +0 -1
- package/export_svg/circles_amplitude-offset.svg +0 -1
- package/export_svg/circles_amplitude-scale.svg +0 -1
- package/export_svg/circles_angle.svg +0 -1
- package/export_svg/default_param_blank.svg +0 -1
- package/export_svg/dummy_pole_static.svg +0 -1
- package/export_svg/dummy_pole_static_face.svg +0 -1
- package/export_svg/gear_addendeum_dedendum_sizes.svg +0 -9
- package/export_svg/gear_addendum_and_dedendum.svg +0 -1
- package/export_svg/gear_adherence_replaced_by_teeth.svg +0 -1
- package/export_svg/gear_base_circle_for_involute.svg +0 -2
- package/export_svg/gear_base_left_circle_for_involute.svg +0 -2
- package/export_svg/gear_base_right_circle_for_involute.svg +0 -2
- package/export_svg/gear_inter_axis_maximum_distance.svg +0 -1
- package/export_svg/gear_inter_axis_minimum_distance.svg +0 -1
- package/export_svg/gear_large_base_radius.svg +0 -5
- package/export_svg/gear_module_and_tooth_thickness.svg +0 -3
- package/export_svg/gear_optimum_base_radius.svg +0 -5
- package/export_svg/gear_optimum_base_radius_with_longer_inter_axis.svg +0 -5
- package/export_svg/gear_right_left_base_circles.svg +0 -1
- package/export_svg/gear_small_base_radius.svg +0 -5
- package/export_svg/gear_wheel_circles.svg +0 -2
- package/export_svg/gears.svg +0 -71
- package/export_svg/gears_motion_transmission_via_adherence.svg +0 -1
- package/export_svg/heliostat.svg +0 -1
- package/export_svg/heliostat2_face_sizing.svg +0 -1
- package/export_svg/heliostat2_side_sizing.svg +0 -1
- package/export_svg/heliostat_face_sizing.svg +0 -1
- package/export_svg/heliostat_overview.svg +0 -1
- package/export_svg/heliostat_side.svg +0 -1
- package/export_svg/heliostat_side_sizing.svg +0 -1
- package/export_svg/involute_of_circle.svg +0 -19
- package/export_svg/involute_of_circle_R0.svg +0 -1
- package/export_svg/involute_of_circle_Ri1_u0.svg +0 -1
- package/export_svg/involute_of_circle_Ri2_u2.svg +0 -1
- package/export_svg/left_side_angle_kitchen.svg +0 -1
- package/export_svg/negative_involute_of_circle_R0.svg +0 -1
- package/export_svg/point_c_position_and_speed_negative.svg +0 -1
- package/export_svg/point_c_position_and_speed_positive.svg +0 -1
- package/export_svg/pole_rotor.svg +0 -1
- package/export_svg/pole_rotor_cut.svg +0 -1
- package/export_svg/pole_rotor_ends.svg +0 -1
- package/export_svg/pole_stator.svg +0 -3
- package/export_svg/pole_stator_E2.svg +0 -3
- package/export_svg/pole_stator_bottom.svg +0 -1
- package/export_svg/pole_stator_cut.svg +0 -1
- package/export_svg/pole_stator_face.svg +0 -1
- package/export_svg/pole_stator_right.svg +0 -1
- package/export_svg/rake.svg +0 -1
- package/export_svg/rake_door.svg +0 -1
- package/export_svg/rake_face.svg +0 -1
- package/export_svg/rake_side.svg +0 -1
- package/export_svg/rake_side_stopper.svg +0 -1
- package/export_svg/rake_top.svg +0 -1
- package/export_svg/rake_top_stopper.svg +0 -1
- package/export_svg/rectangle.svg +0 -1
- package/export_svg/rectangle_height.svg +0 -1
- package/export_svg/rectangle_width.svg +0 -1
- package/export_svg/right_side_angle_kitchen.svg +0 -1
- package/export_svg/rod.svg +0 -1
- package/export_svg/rod_cut.svg +0 -1
- package/export_svg/rod_plate.svg +0 -1
- package/export_svg/rod_top.svg +0 -1
- package/export_svg/spider.svg +0 -1
- package/export_svg/spider_lateral.svg +0 -1
- package/export_svg/spider_profile.svg +0 -1
- package/export_svg/surface.svg +0 -3
- package/export_svg/surface_crenel.svg +0 -1
- package/export_svg/surface_extremities.svg +0 -2
- package/export_svg/surface_lz.svg +0 -1
- package/export_svg/surface_main.svg +0 -1
- package/export_svg/surface_power.svg +0 -2
- package/export_svg/surface_space_evolution.svg +0 -1
- package/export_svg/surface_space_shape.svg +0 -1
- package/export_svg/swing.svg +0 -1
- package/export_svg/swing_face.svg +0 -1
- package/export_svg/swing_side.svg +0 -1
- package/export_svg/swing_top.svg +0 -1
- package/export_svg/swing_with_rod.svg +0 -1
- package/export_svg/trapeze.svg +0 -1
- package/export_svg/trapeze_rod.svg +0 -1
- package/export_svg/trapeze_side.svg +0 -1
- package/export_svg/trapeze_top.svg +0 -1
- package/export_svg/verify_contour_1.svg +0 -1
- package/export_svg/verify_contour_1_l1.svg +0 -1
- package/export_svg/verify_contour_1_r1.svg +0 -1
- package/export_svg/verify_line.svg +0 -1
- package/export_svg/verify_line_2_l1cx.svg +0 -1
- package/export_svg/verify_line_p1x.svg +0 -1
- package/export_svg/verify_point.svg +0 -1
- package/export_svg/verify_point_p1x.svg +0 -1
- package/export_svg/verify_vector_p1x.svg +0 -1
- package/src/dummy/circles.ts +0 -65
- package/src/dummy/pole_static.ts +0 -86
- package/src/dummy/rectangle.ts +0 -55
- package/src/dummy/svg/circles.svg +0 -288
- package/src/dummy/svg/circles_amplitude-offset.svg +0 -109
- package/src/dummy/svg/circles_amplitude-scale.svg +0 -122
- package/src/dummy/svg/circles_angle.svg +0 -110
- package/src/dummy/svg/dummy_pole_static.svg +0 -192
- package/src/dummy/svg/dummy_pole_static_face.svg +0 -176
- package/src/dummy/svg/rectangle.svg +0 -131
- package/src/dummy/svg/rectangle_height.svg +0 -82
- package/src/dummy/svg/rectangle_width.svg +0 -81
- package/src/gears/gearWheelProfile.test.ts +0 -25
- package/src/gears/gearWheelProfile.ts +0 -753
- package/src/gears/gear_wheel_wheel.ts +0 -335
- package/src/gears/involute.test.ts +0 -21
- package/src/gears/involute.ts +0 -113
- package/src/gears/simplified_gear_wheel.ts +0 -242
- package/src/gears/svg/calculation_of_initAngle2.svg +0 -376
- package/src/gears/svg/gear_addendeum_dedendum_sizes.svg +0 -471
- package/src/gears/svg/gear_addendum_and_dedendum.svg +0 -269
- package/src/gears/svg/gear_adherence_replaced_by_teeth.svg +0 -168
- package/src/gears/svg/gear_base_circle_for_involute.svg +0 -376
- package/src/gears/svg/gear_base_left_circle_for_involute.svg +0 -556
- package/src/gears/svg/gear_base_right_circle_for_involute.svg +0 -516
- package/src/gears/svg/gear_inter_axis_maximum_distance.svg +0 -218
- package/src/gears/svg/gear_inter_axis_minimum_distance.svg +0 -218
- package/src/gears/svg/gear_large_base_radius.svg +0 -199
- package/src/gears/svg/gear_module_and_tooth_thickness.svg +0 -319
- package/src/gears/svg/gear_optimum_base_radius.svg +0 -232
- package/src/gears/svg/gear_optimum_base_radius_with_longer_inter_axis.svg +0 -344
- package/src/gears/svg/gear_right_left_base_circles.svg +0 -295
- package/src/gears/svg/gear_small_base_radius.svg +0 -163
- package/src/gears/svg/gear_wheel_circles.svg +0 -348
- package/src/gears/svg/gears.svg +0 -4726
- package/src/gears/svg/gears_motion_transmission_via_adherence.svg +0 -178
- package/src/gears/svg/involute_of_circle.svg +0 -2745
- package/src/gears/svg/involute_of_circle_R0.svg +0 -334
- package/src/gears/svg/involute_of_circle_Ri1_u0.svg +0 -297
- package/src/gears/svg/involute_of_circle_Ri2_u2.svg +0 -386
- package/src/gears/svg/left_side_angle_kitchen.svg +0 -207
- package/src/gears/svg/negative_involute_of_circle_R0.svg +0 -381
- package/src/gears/svg/point_c_position_and_speed_negative.svg +0 -343
- package/src/gears/svg/point_c_position_and_speed_positive.svg +0 -339
- package/src/gears/svg/right_side_angle_kitchen.svg +0 -201
- package/src/gears/wheelElements.test.ts +0 -13
- package/src/gears/wheelElements.ts +0 -176
- package/src/geometrix_verification/svg/verify_contour_1.svg +0 -320
- package/src/geometrix_verification/svg/verify_contour_1_l1.svg +0 -102
- package/src/geometrix_verification/svg/verify_contour_1_r1.svg +0 -170
- package/src/geometrix_verification/svg/verify_line.svg +0 -845
- package/src/geometrix_verification/svg/verify_line_2_l1cx.svg +0 -274
- package/src/geometrix_verification/svg/verify_line_p1x.svg +0 -261
- package/src/geometrix_verification/svg/verify_point.svg +0 -350
- package/src/geometrix_verification/svg/verify_point_p1x.svg +0 -258
- package/src/geometrix_verification/svg/verify_vector_p1x.svg +0 -282
- package/src/geometrix_verification/verify_contour_1.ts +0 -94
- package/src/geometrix_verification/verify_contour_2.ts +0 -267
- package/src/geometrix_verification/verify_contour_3.ts +0 -409
- package/src/geometrix_verification/verify_contour_4.ts +0 -91
- package/src/geometrix_verification/verify_exports_1.ts +0 -95
- package/src/geometrix_verification/verify_line.ts +0 -76
- package/src/geometrix_verification/verify_line_2.ts +0 -76
- package/src/geometrix_verification/verify_line_3.ts +0 -64
- package/src/geometrix_verification/verify_point.ts +0 -62
- package/src/geometrix_verification/verify_point_2.ts +0 -66
- package/src/geometrix_verification/verify_vector.ts +0 -70
- package/src/heliostat/base.ts +0 -254
- package/src/heliostat/heliostat.ts +0 -317
- package/src/heliostat/heliostat_2.ts +0 -284
- package/src/heliostat/pole_rotor.ts +0 -165
- package/src/heliostat/pole_static.ts +0 -275
- package/src/heliostat/rake.ts +0 -486
- package/src/heliostat/rake_stopper.ts +0 -409
- package/src/heliostat/rod.ts +0 -200
- package/src/heliostat/spider.ts +0 -238
- package/src/heliostat/surface.ts +0 -320
- package/src/heliostat/svg/base.svg +0 -1367
- package/src/heliostat/svg/base_cut.svg +0 -459
- package/src/heliostat/svg/base_hollow.svg +0 -469
- package/src/heliostat/svg/base_top.svg +0 -338
- package/src/heliostat/svg/heliostat.svg +0 -8013
- package/src/heliostat/svg/heliostat2_face_sizing.svg +0 -1386
- package/src/heliostat/svg/heliostat2_side_sizing.svg +0 -984
- package/src/heliostat/svg/heliostat_face_sizing.svg +0 -1448
- package/src/heliostat/svg/heliostat_overview.svg +0 -1552
- package/src/heliostat/svg/heliostat_side.svg +0 -1470
- package/src/heliostat/svg/heliostat_side_sizing.svg +0 -1128
- package/src/heliostat/svg/pole_rotor.svg +0 -592
- package/src/heliostat/svg/pole_rotor_cut.svg +0 -287
- package/src/heliostat/svg/pole_rotor_ends.svg +0 -336
- package/src/heliostat/svg/pole_stator.svg +0 -1945
- package/src/heliostat/svg/pole_stator_E2.svg +0 -410
- package/src/heliostat/svg/pole_stator_bottom.svg +0 -330
- package/src/heliostat/svg/pole_stator_cut.svg +0 -465
- package/src/heliostat/svg/pole_stator_face.svg +0 -457
- package/src/heliostat/svg/pole_stator_right.svg +0 -357
- package/src/heliostat/svg/rake.svg +0 -4691
- package/src/heliostat/svg/rake_door.svg +0 -617
- package/src/heliostat/svg/rake_face.svg +0 -1211
- package/src/heliostat/svg/rake_side.svg +0 -809
- package/src/heliostat/svg/rake_side_stopper.svg +0 -596
- package/src/heliostat/svg/rake_top.svg +0 -514
- package/src/heliostat/svg/rake_top_stopper.svg +0 -565
- package/src/heliostat/svg/rod.svg +0 -1314
- package/src/heliostat/svg/rod_cut.svg +0 -265
- package/src/heliostat/svg/rod_plate.svg +0 -409
- package/src/heliostat/svg/rod_top.svg +0 -577
- package/src/heliostat/svg/spider.svg +0 -693
- package/src/heliostat/svg/spider_lateral.svg +0 -222
- package/src/heliostat/svg/spider_profile.svg +0 -429
- package/src/heliostat/svg/surface.svg +0 -3577
- package/src/heliostat/svg/surface_crenel.svg +0 -1335
- package/src/heliostat/svg/surface_extremities.svg +0 -510
- package/src/heliostat/svg/surface_lz.svg +0 -182
- package/src/heliostat/svg/surface_main.svg +0 -366
- package/src/heliostat/svg/surface_power.svg +0 -331
- package/src/heliostat/svg/surface_space_evolution.svg +0 -210
- package/src/heliostat/svg/surface_space_shape.svg +0 -98
- package/src/heliostat/svg/swing.svg +0 -3310
- package/src/heliostat/svg/swing_face.svg +0 -902
- package/src/heliostat/svg/swing_side.svg +0 -574
- package/src/heliostat/svg/swing_top.svg +0 -923
- package/src/heliostat/svg/swing_with_rod.svg +0 -547
- package/src/heliostat/svg/trapeze.svg +0 -1711
- package/src/heliostat/svg/trapeze_rod.svg +0 -122
- package/src/heliostat/svg/trapeze_side.svg +0 -361
- package/src/heliostat/svg/trapeze_top.svg +0 -1057
- package/src/heliostat/swing.ts +0 -246
- package/src/heliostat/trapeze.ts +0 -510
- package/src/index.ts +0 -33
- package/src/svg/default_param_blank.svg +0 -40
- package/tsconfig.json +0 -13
- package/vitest.config.ts +0 -7
package/src/heliostat/swing.ts
DELETED
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
// swing.ts
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
tContour,
|
|
5
|
-
tParamDef,
|
|
6
|
-
tParamVal,
|
|
7
|
-
tGeom,
|
|
8
|
-
tPageDef
|
|
9
|
-
//tSubInst
|
|
10
|
-
//tSubDesign
|
|
11
|
-
} from 'geometrix';
|
|
12
|
-
import {
|
|
13
|
-
contour,
|
|
14
|
-
contourCircle,
|
|
15
|
-
figure,
|
|
16
|
-
//degToRad,
|
|
17
|
-
//radToDeg,
|
|
18
|
-
ffix,
|
|
19
|
-
pNumber,
|
|
20
|
-
//pCheckbox,
|
|
21
|
-
//pDropdown,
|
|
22
|
-
initGeom,
|
|
23
|
-
EExtrude,
|
|
24
|
-
EBVolume
|
|
25
|
-
} from 'geometrix';
|
|
26
|
-
|
|
27
|
-
const pDef: tParamDef = {
|
|
28
|
-
partName: 'swing',
|
|
29
|
-
params: [
|
|
30
|
-
//pNumber(name, unit, init, min, max, step)
|
|
31
|
-
pNumber('L1', 'mm', 12500, 1000, 40000, 10),
|
|
32
|
-
pNumber('L2', 'mm', 6000, 1000, 40000, 10),
|
|
33
|
-
pNumber('L3', 'mm', 500, 100, 4000, 10),
|
|
34
|
-
pNumber('L4', 'mm', 600, 100, 4000, 10),
|
|
35
|
-
pNumber('L5', 'mm', 2000, 100, 10000, 10),
|
|
36
|
-
pNumber('L6', 'mm', 2000, 100, 10000, 10),
|
|
37
|
-
pNumber('D1', 'mm', 400, 50, 1000, 1),
|
|
38
|
-
pNumber('H1', 'mm', 100, 10, 400, 1),
|
|
39
|
-
pNumber('H2', 'mm', 100, 10, 400, 1),
|
|
40
|
-
pNumber('H3', 'mm', 100, 10, 400, 1),
|
|
41
|
-
pNumber('H4', 'mm', 100, 10, 400, 1),
|
|
42
|
-
pNumber('E1', 'mm', 5, 1, 80, 1),
|
|
43
|
-
pNumber('E2', 'mm', 3, 1, 80, 1),
|
|
44
|
-
pNumber('E3', 'mm', 3, 1, 80, 1),
|
|
45
|
-
pNumber('rod1', '', 10, 1, 40, 1),
|
|
46
|
-
pNumber('rod2', 'mm', 1300, 100, 4000, 10),
|
|
47
|
-
pNumber('rod3', 'mm', 400, 50, 1000, 10),
|
|
48
|
-
pNumber('rod4', 'mm', 100, 50, 400, 10)
|
|
49
|
-
],
|
|
50
|
-
paramSvg: {
|
|
51
|
-
L1: 'swing_top.svg',
|
|
52
|
-
L2: 'swing_top.svg',
|
|
53
|
-
L3: 'swing_top.svg',
|
|
54
|
-
L4: 'swing_top.svg',
|
|
55
|
-
L5: 'swing_top.svg',
|
|
56
|
-
L6: 'swing_top.svg',
|
|
57
|
-
D1: 'swing_top.svg',
|
|
58
|
-
H1: 'swing_top.svg',
|
|
59
|
-
H2: 'swing_top.svg',
|
|
60
|
-
H3: 'swing_side.svg',
|
|
61
|
-
H4: 'swing_side.svg',
|
|
62
|
-
E1: 'swing_side.svg',
|
|
63
|
-
E2: 'swing_side.svg',
|
|
64
|
-
E3: 'swing_face.svg',
|
|
65
|
-
rod1: 'swing_with_rod.svg',
|
|
66
|
-
rod2: 'swing_with_rod.svg',
|
|
67
|
-
rod3: 'swing_with_rod.svg',
|
|
68
|
-
rod4: 'swing_with_rod.svg'
|
|
69
|
-
},
|
|
70
|
-
sim: {
|
|
71
|
-
tMax: 180,
|
|
72
|
-
tStep: 0.5,
|
|
73
|
-
tUpdate: 500 // every 0.5 second
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
type tCtr1 = (px: number, py: number, lx: number, ly: number) => tContour;
|
|
78
|
-
type tCtr2 = (px: number, py: number, lx: number, ly: number, round: number) => tContour;
|
|
79
|
-
|
|
80
|
-
function pGeom(t: number, param: tParamVal): tGeom {
|
|
81
|
-
let ctrRectangle: tCtr1;
|
|
82
|
-
let ctrRectRound: tCtr2;
|
|
83
|
-
const rGeome = initGeom(pDef.partName);
|
|
84
|
-
const figSide = figure();
|
|
85
|
-
const figFace = figure();
|
|
86
|
-
const figTop = figure();
|
|
87
|
-
const figTopWithRod = figure();
|
|
88
|
-
rGeome.logstr += `${rGeome.partName} simTime: ${t}\n`;
|
|
89
|
-
try {
|
|
90
|
-
const R1 = param.D1 / 2;
|
|
91
|
-
rGeome.logstr += `swing size: L1 ${ffix(param.L1)} x L2 ${ffix(param.L2)} mm\n`;
|
|
92
|
-
ctrRectangle = function (px: number, py: number, lx: number, ly: number): tContour {
|
|
93
|
-
const rRect = contour(px, py)
|
|
94
|
-
.addSegStrokeA(px + lx, py)
|
|
95
|
-
.addSegStrokeA(px + lx, py + ly)
|
|
96
|
-
.addSegStrokeA(px, py + ly)
|
|
97
|
-
.closeSegStroke();
|
|
98
|
-
return rRect;
|
|
99
|
-
};
|
|
100
|
-
ctrRectRound = function (
|
|
101
|
-
px: number,
|
|
102
|
-
py: number,
|
|
103
|
-
lx: number,
|
|
104
|
-
ly: number,
|
|
105
|
-
round: number
|
|
106
|
-
): tContour {
|
|
107
|
-
const rRect = contour(px, py)
|
|
108
|
-
.addCornerRounded(round)
|
|
109
|
-
.addSegStrokeA(px + lx, py)
|
|
110
|
-
.addCornerRounded(round)
|
|
111
|
-
.addSegStrokeA(px + lx, py + ly)
|
|
112
|
-
.addCornerRounded(round)
|
|
113
|
-
.addSegStrokeA(px, py + ly)
|
|
114
|
-
.addCornerRounded(round)
|
|
115
|
-
.closeSegStroke();
|
|
116
|
-
return rRect;
|
|
117
|
-
};
|
|
118
|
-
// figSide
|
|
119
|
-
figSide.addMain(contourCircle(0, 0, R1));
|
|
120
|
-
figSide.addMain(contourCircle(0, 0, R1 - param.E1));
|
|
121
|
-
const sidePx = [-param.L2 / 2, -param.L3 - param.H2, param.L3, param.L2 / 2 - param.H2];
|
|
122
|
-
for (const px of sidePx) {
|
|
123
|
-
figSide.addMain(ctrRectangle(px, R1 - param.H4, param.H2, param.H4));
|
|
124
|
-
figSide.addMain(
|
|
125
|
-
ctrRectangle(
|
|
126
|
-
px + param.E2,
|
|
127
|
-
R1 - param.H4 + param.E2,
|
|
128
|
-
param.H2 - 2 * param.E2,
|
|
129
|
-
param.H4 - 2 * param.E2
|
|
130
|
-
)
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
figSide.addSecond(ctrRectangle(-param.L2 / 2, R1, param.L2, param.H3));
|
|
134
|
-
// figFace
|
|
135
|
-
const facePx: number[] = [];
|
|
136
|
-
facePx.push(-param.L1 / 2);
|
|
137
|
-
facePx.push(param.L1 / 2 - param.H1);
|
|
138
|
-
for (const px of [
|
|
139
|
-
-param.L5 / 2 - 2 * param.L4 - param.L6,
|
|
140
|
-
-param.L5 / 2 - param.L4,
|
|
141
|
-
param.L5 / 2,
|
|
142
|
-
param.L5 / 2 + param.L4 + param.L6
|
|
143
|
-
]) {
|
|
144
|
-
for (const pxp of [0, param.L4 - param.H1]) {
|
|
145
|
-
facePx.push(px + pxp);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
for (const px of facePx) {
|
|
149
|
-
figFace.addMain(ctrRectangle(px, R1, param.H1, param.H3));
|
|
150
|
-
figFace.addMain(
|
|
151
|
-
ctrRectangle(
|
|
152
|
-
px + param.E3,
|
|
153
|
-
R1 + param.E3,
|
|
154
|
-
param.H1 - 2 * param.E3,
|
|
155
|
-
param.H3 - 2 * param.E3
|
|
156
|
-
)
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
figFace.addSecond(ctrRectangle(-param.L1 / 2, -R1, param.L1, param.D1));
|
|
160
|
-
figFace.addSecond(ctrRectangle(-param.L1 / 2, R1 - param.H4, param.L1, param.H4));
|
|
161
|
-
// figTop
|
|
162
|
-
for (const px of facePx) {
|
|
163
|
-
figTop.addSecond(ctrRectangle(px, -param.L2 / 2, param.H1, param.L2));
|
|
164
|
-
}
|
|
165
|
-
for (const py of sidePx) {
|
|
166
|
-
figTop.addSecond(ctrRectangle(-param.L1 / 2, py, param.L1, param.H2));
|
|
167
|
-
}
|
|
168
|
-
figTop.addSecond(ctrRectangle(-param.L1 / 2, -R1, param.L1, param.D1));
|
|
169
|
-
// figTopWithRod
|
|
170
|
-
for (const px of facePx) {
|
|
171
|
-
figTopWithRod.addMain(ctrRectangle(px, -param.L2 / 2, param.H1, param.L2));
|
|
172
|
-
}
|
|
173
|
-
for (const py of sidePx) {
|
|
174
|
-
figTopWithRod.addMain(ctrRectangle(-param.L1 / 2, py, param.L1, param.H2));
|
|
175
|
-
}
|
|
176
|
-
figTopWithRod.addMain(ctrRectangle(-param.L1 / 2, -R1, param.L1, param.D1));
|
|
177
|
-
const rodPx0 = -((param.rod1 - 1) * param.rod2 + param.rod3) / 2;
|
|
178
|
-
const rodOffset = (param.rod3 - param.rod4) / 2;
|
|
179
|
-
const rodPlateH = param.rod3 / 2;
|
|
180
|
-
const rodLength = 1.2 * param.L2;
|
|
181
|
-
const rodPyStep = (rodLength - rodPlateH) / (4 - 1);
|
|
182
|
-
const rodPy0 = -rodLength / 2;
|
|
183
|
-
for (let i = 0; i < param.rod1; i++) {
|
|
184
|
-
const px = rodPx0 + i * param.rod2;
|
|
185
|
-
figTopWithRod.addSecond(ctrRectangle(px + rodOffset, rodPy0, param.rod4, rodLength));
|
|
186
|
-
for (let j = 0; j < 4; j++) {
|
|
187
|
-
figTopWithRod.addSecond(
|
|
188
|
-
ctrRectRound(px, rodPy0 + j * rodPyStep, param.rod3, rodPlateH, rodPlateH / 4)
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
// final figure list
|
|
193
|
-
rGeome.fig = {
|
|
194
|
-
faceSide: figSide,
|
|
195
|
-
faceFace: figFace,
|
|
196
|
-
faceTop: figTop,
|
|
197
|
-
faceTopWithRods: figTopWithRod
|
|
198
|
-
};
|
|
199
|
-
const designName = rGeome.partName;
|
|
200
|
-
rGeome.vol = {
|
|
201
|
-
extrudes: [
|
|
202
|
-
{
|
|
203
|
-
outName: `subpax_${designName}_side`,
|
|
204
|
-
face: `${designName}_faceSide`,
|
|
205
|
-
extrudeMethod: EExtrude.eLinearOrtho,
|
|
206
|
-
length: param.L1,
|
|
207
|
-
rotate: [0, 0, 0],
|
|
208
|
-
translate: [0, 0, -param.L1 / 2]
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
outName: `subpax_${designName}_face`,
|
|
212
|
-
face: `${designName}_faceFace`,
|
|
213
|
-
extrudeMethod: EExtrude.eLinearOrtho,
|
|
214
|
-
length: param.L2,
|
|
215
|
-
rotate: [0, Math.PI / 2, 0],
|
|
216
|
-
translate: [-param.L2 / 2, 0, 0]
|
|
217
|
-
}
|
|
218
|
-
],
|
|
219
|
-
volumes: [
|
|
220
|
-
{
|
|
221
|
-
outName: `pax_${designName}`,
|
|
222
|
-
boolMethod: EBVolume.eUnion,
|
|
223
|
-
inList: [`subpax_${designName}_side`, `subpax_${designName}_face`]
|
|
224
|
-
}
|
|
225
|
-
]
|
|
226
|
-
};
|
|
227
|
-
// sub-design
|
|
228
|
-
rGeome.sub = {};
|
|
229
|
-
// finalize
|
|
230
|
-
rGeome.logstr += 'heliostat-swing draw successfully!\n';
|
|
231
|
-
rGeome.calcErr = false;
|
|
232
|
-
} catch (emsg) {
|
|
233
|
-
rGeome.logstr += emsg as string;
|
|
234
|
-
console.log(emsg as string);
|
|
235
|
-
}
|
|
236
|
-
return rGeome;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
const swingDef: tPageDef = {
|
|
240
|
-
pTitle: 'Heliostat swing',
|
|
241
|
-
pDescription: 'The swing for the heliostat inclination',
|
|
242
|
-
pDef: pDef,
|
|
243
|
-
pGeom: pGeom
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
export { swingDef };
|