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
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
// pole_rotor.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: 'pole_rotor',
|
|
29
|
-
params: [
|
|
30
|
-
//pNumber(name, unit, init, min, max, step)
|
|
31
|
-
pNumber('D1', 'mm', 600, 100, 4000, 10),
|
|
32
|
-
pNumber('D2', 'mm', 400, 100, 4000, 10),
|
|
33
|
-
pNumber('H1', 'mm', 8000, 100, 40000, 10),
|
|
34
|
-
pNumber('E1', 'mm', 5, 1, 80, 1),
|
|
35
|
-
pNumber('E2', 'mm', 30, 1, 80, 1),
|
|
36
|
-
pNumber('N1', '', 24, 3, 100, 1),
|
|
37
|
-
pNumber('D3', 'mm', 40, 1, 100, 1),
|
|
38
|
-
pNumber('L1', 'mm', 45, 1, 300, 1)
|
|
39
|
-
],
|
|
40
|
-
paramSvg: {
|
|
41
|
-
D1: 'pole_rotor_cut.svg',
|
|
42
|
-
D2: 'pole_rotor_cut.svg',
|
|
43
|
-
H1: 'pole_rotor_cut.svg',
|
|
44
|
-
E1: 'pole_rotor_cut.svg',
|
|
45
|
-
E2: 'pole_rotor_cut.svg',
|
|
46
|
-
N1: 'pole_rotor_ends.svg',
|
|
47
|
-
D3: 'pole_rotor_ends.svg',
|
|
48
|
-
L1: 'pole_rotor_ends.svg'
|
|
49
|
-
},
|
|
50
|
-
sim: {
|
|
51
|
-
tMax: 180,
|
|
52
|
-
tStep: 0.5,
|
|
53
|
-
tUpdate: 500 // every 0.5 second
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
type tCtr1 = (orient: number) => tContour;
|
|
58
|
-
|
|
59
|
-
function pGeom(t: number, param: tParamVal): tGeom {
|
|
60
|
-
let ctrPoleProfile: tCtr1;
|
|
61
|
-
const rGeome = initGeom(pDef.partName);
|
|
62
|
-
const figCut = figure();
|
|
63
|
-
const figBottom = figure();
|
|
64
|
-
rGeome.logstr += `${rGeome.partName} simTime: ${t}\n`;
|
|
65
|
-
try {
|
|
66
|
-
const R1 = param.D1 / 2;
|
|
67
|
-
const R2 = param.D2 / 2;
|
|
68
|
-
const R3 = param.D3 / 2;
|
|
69
|
-
rGeome.logstr += `pole-height: ${ffix(param.H1)} mm\n`;
|
|
70
|
-
// figCut
|
|
71
|
-
const ctrCylinder = contour(R1, 0)
|
|
72
|
-
.addSegStrokeA(R1, param.H1)
|
|
73
|
-
.addSegStrokeA(R1 - param.E1, param.H1)
|
|
74
|
-
.addSegStrokeA(R1 - param.E1, 0)
|
|
75
|
-
.closeSegStroke();
|
|
76
|
-
figCut.addMain(ctrCylinder);
|
|
77
|
-
ctrPoleProfile = function (orient: number): tContour {
|
|
78
|
-
const rPoleProfile = contour(orient * R1, 0)
|
|
79
|
-
.addSegStrokeA(orient * R1, param.H1)
|
|
80
|
-
.addSegStrokeA(orient * R2, param.H1)
|
|
81
|
-
.addSegStrokeA(orient * R2, param.H1 - param.E2)
|
|
82
|
-
.addSegStrokeA(orient * (R1 - param.E1), param.H1 - param.E2)
|
|
83
|
-
.addSegStrokeA(orient * (R1 - param.E1), param.E2)
|
|
84
|
-
.addSegStrokeA(orient * R2, param.E2)
|
|
85
|
-
.addSegStrokeA(orient * R2, 0)
|
|
86
|
-
.closeSegStroke();
|
|
87
|
-
return rPoleProfile;
|
|
88
|
-
};
|
|
89
|
-
figCut.addSecond(ctrPoleProfile(1));
|
|
90
|
-
figCut.addSecond(ctrPoleProfile(-1));
|
|
91
|
-
// figBottom
|
|
92
|
-
figBottom.addMain(contourCircle(0, 0, R1));
|
|
93
|
-
figBottom.addMain(contourCircle(0, 0, R2));
|
|
94
|
-
const posR = R2 + param.L1;
|
|
95
|
-
const posA = (2 * Math.PI) / param.N1;
|
|
96
|
-
for (let i = 0; i < param.N1; i++) {
|
|
97
|
-
const posX = posR * Math.cos(i * posA);
|
|
98
|
-
const posY = posR * Math.sin(i * posA);
|
|
99
|
-
figBottom.addMain(contourCircle(posX, posY, R3));
|
|
100
|
-
}
|
|
101
|
-
figBottom.addSecond(contourCircle(0, 0, R1 - param.E1));
|
|
102
|
-
// final figure list
|
|
103
|
-
rGeome.fig = {
|
|
104
|
-
faceCut: figCut,
|
|
105
|
-
faceBottom: figBottom
|
|
106
|
-
};
|
|
107
|
-
const designName = rGeome.partName;
|
|
108
|
-
rGeome.vol = {
|
|
109
|
-
extrudes: [
|
|
110
|
-
{
|
|
111
|
-
outName: `subpax_${designName}_pole`,
|
|
112
|
-
face: `${designName}_faceCut`,
|
|
113
|
-
extrudeMethod: EExtrude.eRotate,
|
|
114
|
-
rotate: [0, 0, 0],
|
|
115
|
-
translate: [0, 0, 0]
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
outName: `subpax_${designName}_bottom`,
|
|
119
|
-
face: `${designName}_faceBottom`,
|
|
120
|
-
extrudeMethod: EExtrude.eLinearOrtho,
|
|
121
|
-
length: param.E2,
|
|
122
|
-
rotate: [0, 0, 0],
|
|
123
|
-
translate: [0, 0, 0]
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
outName: `subpax_${designName}_top`,
|
|
127
|
-
face: `${designName}_faceBottom`,
|
|
128
|
-
extrudeMethod: EExtrude.eLinearOrtho,
|
|
129
|
-
length: param.E2,
|
|
130
|
-
rotate: [0, 0, 0],
|
|
131
|
-
translate: [0, 0, param.H1 - param.E2]
|
|
132
|
-
}
|
|
133
|
-
],
|
|
134
|
-
volumes: [
|
|
135
|
-
{
|
|
136
|
-
outName: `pax_${designName}`,
|
|
137
|
-
boolMethod: EBVolume.eUnion,
|
|
138
|
-
inList: [
|
|
139
|
-
`subpax_${designName}_pole`,
|
|
140
|
-
`subpax_${designName}_bottom`,
|
|
141
|
-
`subpax_${designName}_top`
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
};
|
|
146
|
-
// sub-design
|
|
147
|
-
rGeome.sub = {};
|
|
148
|
-
// finalize
|
|
149
|
-
rGeome.logstr += 'pole_rotor draw successfully!\n';
|
|
150
|
-
rGeome.calcErr = false;
|
|
151
|
-
} catch (emsg) {
|
|
152
|
-
rGeome.logstr += emsg as string;
|
|
153
|
-
console.log(emsg as string);
|
|
154
|
-
}
|
|
155
|
-
return rGeome;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const poleRotorDef: tPageDef = {
|
|
159
|
-
pTitle: 'Heliostat pole rotor',
|
|
160
|
-
pDescription: 'The vertical axis inside the pole of an heliostat',
|
|
161
|
-
pDef: pDef,
|
|
162
|
-
pGeom: pGeom
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
export { poleRotorDef };
|
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
// pole_static.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: 'pole_static',
|
|
29
|
-
params: [
|
|
30
|
-
//pNumber(name, unit, init, min, max, step)
|
|
31
|
-
pNumber('D1', 'mm', 1000, 100, 4000, 10),
|
|
32
|
-
pNumber('D2', 'mm', 700, 100, 4000, 10),
|
|
33
|
-
pNumber('D3', 'mm', 800, 100, 4000, 10),
|
|
34
|
-
pNumber('H1', 'mm', 3000, 100, 40000, 10),
|
|
35
|
-
pNumber('H2', 'mm', 7000, 100, 40000, 10),
|
|
36
|
-
pNumber('E1', 'mm', 30, 1, 80, 1),
|
|
37
|
-
pNumber('E2', 'mm', 5, 1, 80, 1),
|
|
38
|
-
pNumber('N1', '', 32, 3, 100, 1),
|
|
39
|
-
pNumber('D5', 'mm', 40, 1, 100, 1),
|
|
40
|
-
pNumber('L1', 'mm', 45, 1, 300, 1),
|
|
41
|
-
pNumber('D4', 'mm', 600, 200, 1200, 1),
|
|
42
|
-
pNumber('H3', 'mm', 300, 50, 1200, 1),
|
|
43
|
-
pNumber('H4', 'mm', 1800, 200, 2500, 1),
|
|
44
|
-
pNumber('L2', 'mm', 30, 1, 100, 1),
|
|
45
|
-
pNumber('E3', 'mm', 40, 1, 100, 1)
|
|
46
|
-
],
|
|
47
|
-
paramSvg: {
|
|
48
|
-
D1: 'pole_stator_cut.svg',
|
|
49
|
-
D2: 'pole_stator_cut.svg',
|
|
50
|
-
D3: 'pole_stator_cut.svg',
|
|
51
|
-
H1: 'pole_stator_cut.svg',
|
|
52
|
-
H2: 'pole_stator_cut.svg',
|
|
53
|
-
E1: 'pole_stator_cut.svg',
|
|
54
|
-
E2: 'pole_stator_E2.svg',
|
|
55
|
-
N1: 'pole_stator_bottom.svg',
|
|
56
|
-
D5: 'pole_stator_bottom.svg',
|
|
57
|
-
L1: 'pole_stator_bottom.svg',
|
|
58
|
-
D4: 'pole_stator_face.svg',
|
|
59
|
-
H3: 'pole_stator_face.svg',
|
|
60
|
-
H4: 'pole_stator_face.svg',
|
|
61
|
-
L2: 'pole_stator_face.svg',
|
|
62
|
-
E3: 'pole_stator_right.svg'
|
|
63
|
-
},
|
|
64
|
-
sim: {
|
|
65
|
-
tMax: 180,
|
|
66
|
-
tStep: 0.5,
|
|
67
|
-
tUpdate: 500 // every 0.5 second
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
type tCtr1 = (orient: number, withR3: boolean) => tContour;
|
|
72
|
-
type tCtr2 = (pL2: number) => tContour;
|
|
73
|
-
|
|
74
|
-
function pGeom(t: number, param: tParamVal): tGeom {
|
|
75
|
-
let ctrPoleProfile: tCtr1;
|
|
76
|
-
let ctrDoorFace: tCtr2;
|
|
77
|
-
const rGeome = initGeom(pDef.partName);
|
|
78
|
-
const figCut = figure();
|
|
79
|
-
const figFace = figure();
|
|
80
|
-
const figBottom = figure();
|
|
81
|
-
const figEmptyPole = figure();
|
|
82
|
-
const figEmptyDoor = figure();
|
|
83
|
-
rGeome.logstr += `${rGeome.partName} simTime: ${t}\n`;
|
|
84
|
-
try {
|
|
85
|
-
const R1 = param.D1 / 2;
|
|
86
|
-
const R2 = param.D2 / 2;
|
|
87
|
-
const R3 = param.D3 / 2;
|
|
88
|
-
if (R2 > R1) {
|
|
89
|
-
throw `err091: D2 ${param.D2} is larger than D1 ${param.D1}`;
|
|
90
|
-
}
|
|
91
|
-
if (R3 + param.E2 > R1) {
|
|
92
|
-
throw `err095: D3 ${param.D3} and E2 ${param.E2} are too large compare to D1 ${param.D1}`;
|
|
93
|
-
}
|
|
94
|
-
const poleHeight = param.H1 + param.H2;
|
|
95
|
-
rGeome.logstr += `pole-height: ${ffix(poleHeight)} mm\n`;
|
|
96
|
-
const coneAngle = Math.atan2(R1 - R2, param.H2);
|
|
97
|
-
rGeome.logstr += `cone-half-angle: ${ffix(radToDeg(coneAngle))} degree\n`;
|
|
98
|
-
const H1bminus = param.E2 * Math.tan(coneAngle / 2);
|
|
99
|
-
const H1b = param.H1 - H1bminus;
|
|
100
|
-
// figCut
|
|
101
|
-
ctrPoleProfile = function (orient: number, withR3: boolean): tContour {
|
|
102
|
-
const rPoleProfile = contour(orient * R1, 0)
|
|
103
|
-
.addSegStrokeA(orient * R1, param.H1)
|
|
104
|
-
.addSegStrokeA(orient * R2, poleHeight)
|
|
105
|
-
.addSegStrokeR(
|
|
106
|
-
-orient * param.E2 * Math.cos(coneAngle),
|
|
107
|
-
-param.E2 * Math.sin(coneAngle)
|
|
108
|
-
)
|
|
109
|
-
.addSegStrokeA(orient * (R1 - param.E2), H1b);
|
|
110
|
-
if (withR3) {
|
|
111
|
-
rPoleProfile
|
|
112
|
-
.addSegStrokeA(orient * (R1 - param.E2), param.E1)
|
|
113
|
-
.addSegStrokeA(orient * R3, param.E1)
|
|
114
|
-
.addSegStrokeA(orient * R3, 0);
|
|
115
|
-
} else {
|
|
116
|
-
rPoleProfile.addSegStrokeA(orient * (R1 - param.E2), 0);
|
|
117
|
-
}
|
|
118
|
-
rPoleProfile.closeSegStroke();
|
|
119
|
-
return rPoleProfile;
|
|
120
|
-
};
|
|
121
|
-
figCut.addMain(ctrPoleProfile(1, false));
|
|
122
|
-
figCut.addSecond(ctrPoleProfile(1, true));
|
|
123
|
-
figCut.addSecond(ctrPoleProfile(-1, true));
|
|
124
|
-
// figFace
|
|
125
|
-
const R4 = param.D4 / 2;
|
|
126
|
-
const doorStraightLenght = param.H4 - 2 * R4;
|
|
127
|
-
if (doorStraightLenght < 0) {
|
|
128
|
-
throw `err121: H4 ${param.H4} is too small compare to D4 ${param.D4}`;
|
|
129
|
-
}
|
|
130
|
-
if (R4 - param.L2 < 0) {
|
|
131
|
-
throw `err121: D4 ${param.D4} is too small compare to L2 ${param.L2}`;
|
|
132
|
-
}
|
|
133
|
-
ctrDoorFace = function (pL2: number): tContour {
|
|
134
|
-
const R4b = R4 - pL2;
|
|
135
|
-
const H3b = param.H3 + R4;
|
|
136
|
-
const rCtrDoorFace = contour(R4b, H3b + doorStraightLenght)
|
|
137
|
-
.addPointR(-R4b, R4b)
|
|
138
|
-
.addSegArc(R4b, false, true)
|
|
139
|
-
.addPointR(-R4b, -R4b)
|
|
140
|
-
.addSegArc(R4b, false, true)
|
|
141
|
-
.addSegStrokeR(0, -doorStraightLenght)
|
|
142
|
-
.addPointR(R4b, -R4b)
|
|
143
|
-
.addSegArc(R4b, false, true)
|
|
144
|
-
.addPointR(R4b, R4b)
|
|
145
|
-
.addSegArc(R4b, false, true)
|
|
146
|
-
.closeSegStroke();
|
|
147
|
-
return rCtrDoorFace;
|
|
148
|
-
};
|
|
149
|
-
figFace.addMain(ctrDoorFace(0));
|
|
150
|
-
figFace.addMain(ctrDoorFace(param.L2));
|
|
151
|
-
const ctrPoleFace = contour(R1, 0)
|
|
152
|
-
.addSegStrokeA(R1, param.H1)
|
|
153
|
-
.addSegStrokeA(R2, poleHeight)
|
|
154
|
-
.addSegStrokeA(-R2, poleHeight)
|
|
155
|
-
.addSegStrokeA(-R1, param.H1)
|
|
156
|
-
.addSegStrokeA(-R1, 0)
|
|
157
|
-
.closeSegStroke();
|
|
158
|
-
figFace.addSecond(ctrPoleFace);
|
|
159
|
-
const ctrDoorSide = contour(-R1, param.H3)
|
|
160
|
-
.addSegStrokeR(0, param.H4)
|
|
161
|
-
.addSegStrokeR(-param.E3, 0)
|
|
162
|
-
.addSegStrokeR(0, -param.H4)
|
|
163
|
-
.closeSegStroke();
|
|
164
|
-
figFace.addSecond(ctrDoorSide);
|
|
165
|
-
// figBottom
|
|
166
|
-
figBottom.addMain(contourCircle(0, 0, R1));
|
|
167
|
-
figBottom.addMain(contourCircle(0, 0, R3));
|
|
168
|
-
const posR = R3 + param.L1;
|
|
169
|
-
const posA = (2 * Math.PI) / param.N1;
|
|
170
|
-
for (let i = 0; i < param.N1; i++) {
|
|
171
|
-
const posX = posR * Math.cos(i * posA);
|
|
172
|
-
const posY = posR * Math.sin(i * posA);
|
|
173
|
-
figBottom.addMain(contourCircle(posX, posY, param.D5 / 2));
|
|
174
|
-
}
|
|
175
|
-
figBottom.addSecond(contourCircle(0, 0, R2));
|
|
176
|
-
figBottom.addSecond(contourCircle(0, 0, R1 - param.E2));
|
|
177
|
-
// figEmptyPole
|
|
178
|
-
figEmptyPole.addMain(contourCircle(0, 0, R1 + param.E3));
|
|
179
|
-
figEmptyPole.addMain(contourCircle(0, 0, R1 - param.E2));
|
|
180
|
-
// figEmptyDoor
|
|
181
|
-
figEmptyDoor.addMain(ctrDoorFace(param.L2));
|
|
182
|
-
// final figure list
|
|
183
|
-
rGeome.fig = {
|
|
184
|
-
poleCut: figCut,
|
|
185
|
-
poleFace: figFace,
|
|
186
|
-
poleBottom: figBottom,
|
|
187
|
-
emptyPole: figEmptyPole,
|
|
188
|
-
emptyDoor: figEmptyDoor
|
|
189
|
-
};
|
|
190
|
-
const designName = rGeome.partName;
|
|
191
|
-
rGeome.vol = {
|
|
192
|
-
extrudes: [
|
|
193
|
-
{
|
|
194
|
-
outName: `subpax_${designName}_pole`,
|
|
195
|
-
face: `${designName}_poleCut`,
|
|
196
|
-
extrudeMethod: EExtrude.eRotate,
|
|
197
|
-
rotate: [0, 0, 0],
|
|
198
|
-
translate: [0, 0, 0]
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
outName: `subpax_${designName}_bottom`,
|
|
202
|
-
face: `${designName}_poleBottom`,
|
|
203
|
-
extrudeMethod: EExtrude.eLinearOrtho,
|
|
204
|
-
length: param.E1,
|
|
205
|
-
rotate: [0, 0, 0],
|
|
206
|
-
translate: [0, 0, 0]
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
outName: `subpax_${designName}_door`,
|
|
210
|
-
face: `${designName}_poleFace`,
|
|
211
|
-
extrudeMethod: EExtrude.eLinearOrtho,
|
|
212
|
-
length: R1 + param.E3,
|
|
213
|
-
rotate: [Math.PI / 2, 0, 0],
|
|
214
|
-
translate: [0, 0, 0]
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
outName: `subpax_${designName}_emptyPole`,
|
|
218
|
-
face: `${designName}_emptyPole`,
|
|
219
|
-
extrudeMethod: EExtrude.eLinearOrtho,
|
|
220
|
-
length: param.H1,
|
|
221
|
-
rotate: [0, 0, 0],
|
|
222
|
-
translate: [0, 0, 0]
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
outName: `subpax_${designName}_emptyDoor`,
|
|
226
|
-
face: `${designName}_emptyDoor`,
|
|
227
|
-
extrudeMethod: EExtrude.eLinearOrtho,
|
|
228
|
-
length: R1 + param.E3 + 10,
|
|
229
|
-
rotate: [Math.PI / 2, 0, 0],
|
|
230
|
-
translate: [0, 0, 0]
|
|
231
|
-
}
|
|
232
|
-
],
|
|
233
|
-
volumes: [
|
|
234
|
-
{
|
|
235
|
-
outName: `ipax_${designName}_door`,
|
|
236
|
-
//boolMethod: EBVolume.eSubstraction,
|
|
237
|
-
boolMethod: EBVolume.eIntersection,
|
|
238
|
-
inList: [`subpax_${designName}_door`, `subpax_${designName}_emptyPole`]
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
outName: `ipax_${designName}_pole`,
|
|
242
|
-
boolMethod: EBVolume.eSubstraction,
|
|
243
|
-
inList: [`subpax_${designName}_pole`, `subpax_${designName}_emptyDoor`]
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
outName: `pax_${designName}`,
|
|
247
|
-
boolMethod: EBVolume.eUnion,
|
|
248
|
-
inList: [
|
|
249
|
-
`ipax_${designName}_pole`,
|
|
250
|
-
`subpax_${designName}_bottom`,
|
|
251
|
-
`ipax_${designName}_door`
|
|
252
|
-
]
|
|
253
|
-
}
|
|
254
|
-
]
|
|
255
|
-
};
|
|
256
|
-
// sub-design
|
|
257
|
-
rGeome.sub = {};
|
|
258
|
-
// finalize
|
|
259
|
-
rGeome.logstr += 'pole_static draw successfully!\n';
|
|
260
|
-
rGeome.calcErr = false;
|
|
261
|
-
} catch (emsg) {
|
|
262
|
-
rGeome.logstr += emsg as string;
|
|
263
|
-
console.log(emsg as string);
|
|
264
|
-
}
|
|
265
|
-
return rGeome;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
const poleStaticDef: tPageDef = {
|
|
269
|
-
pTitle: 'Heliostat pole static',
|
|
270
|
-
pDescription: 'The vertical pole of an heliostat',
|
|
271
|
-
pDef: pDef,
|
|
272
|
-
pGeom: pGeom
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
export { poleStaticDef };
|