designix 0.5.10 → 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.
Files changed (239) hide show
  1. package/dist/index.d.ts +59 -0
  2. package/dist/index.js +5669 -0
  3. package/dist/index.js.map +1 -0
  4. package/package.json +7 -2
  5. package/.eslintignore +0 -17
  6. package/.eslintrc.cjs +0 -24
  7. package/.prettierignore +0 -15
  8. package/.prettierrc +0 -8
  9. package/export_svg/base.svg +0 -1
  10. package/export_svg/base_cut.svg +0 -1
  11. package/export_svg/base_hollow.svg +0 -1
  12. package/export_svg/base_top.svg +0 -1
  13. package/export_svg/calculation_of_initAngle2.svg +0 -1
  14. package/export_svg/circles.svg +0 -1
  15. package/export_svg/circles_amplitude-offset.svg +0 -1
  16. package/export_svg/circles_amplitude-scale.svg +0 -1
  17. package/export_svg/circles_angle.svg +0 -1
  18. package/export_svg/default_param_blank.svg +0 -1
  19. package/export_svg/dummy_pole_static.svg +0 -1
  20. package/export_svg/dummy_pole_static_face.svg +0 -1
  21. package/export_svg/gear_addendeum_dedendum_sizes.svg +0 -9
  22. package/export_svg/gear_addendum_and_dedendum.svg +0 -1
  23. package/export_svg/gear_adherence_replaced_by_teeth.svg +0 -1
  24. package/export_svg/gear_base_circle_for_involute.svg +0 -2
  25. package/export_svg/gear_base_left_circle_for_involute.svg +0 -2
  26. package/export_svg/gear_base_right_circle_for_involute.svg +0 -2
  27. package/export_svg/gear_inter_axis_maximum_distance.svg +0 -1
  28. package/export_svg/gear_inter_axis_minimum_distance.svg +0 -1
  29. package/export_svg/gear_large_base_radius.svg +0 -5
  30. package/export_svg/gear_module_and_tooth_thickness.svg +0 -3
  31. package/export_svg/gear_optimum_base_radius.svg +0 -5
  32. package/export_svg/gear_optimum_base_radius_with_longer_inter_axis.svg +0 -5
  33. package/export_svg/gear_right_left_base_circles.svg +0 -1
  34. package/export_svg/gear_small_base_radius.svg +0 -5
  35. package/export_svg/gear_wheel_circles.svg +0 -2
  36. package/export_svg/gears.svg +0 -71
  37. package/export_svg/gears_motion_transmission_via_adherence.svg +0 -1
  38. package/export_svg/heliostat.svg +0 -1
  39. package/export_svg/heliostat2_face_sizing.svg +0 -1
  40. package/export_svg/heliostat2_side_sizing.svg +0 -1
  41. package/export_svg/heliostat_face_sizing.svg +0 -1
  42. package/export_svg/heliostat_overview.svg +0 -1
  43. package/export_svg/heliostat_side.svg +0 -1
  44. package/export_svg/heliostat_side_sizing.svg +0 -1
  45. package/export_svg/involute_of_circle.svg +0 -19
  46. package/export_svg/involute_of_circle_R0.svg +0 -1
  47. package/export_svg/involute_of_circle_Ri1_u0.svg +0 -1
  48. package/export_svg/involute_of_circle_Ri2_u2.svg +0 -1
  49. package/export_svg/left_side_angle_kitchen.svg +0 -1
  50. package/export_svg/negative_involute_of_circle_R0.svg +0 -1
  51. package/export_svg/point_c_position_and_speed_negative.svg +0 -1
  52. package/export_svg/point_c_position_and_speed_positive.svg +0 -1
  53. package/export_svg/pole_rotor.svg +0 -1
  54. package/export_svg/pole_rotor_cut.svg +0 -1
  55. package/export_svg/pole_rotor_ends.svg +0 -1
  56. package/export_svg/pole_stator.svg +0 -3
  57. package/export_svg/pole_stator_E2.svg +0 -3
  58. package/export_svg/pole_stator_bottom.svg +0 -1
  59. package/export_svg/pole_stator_cut.svg +0 -1
  60. package/export_svg/pole_stator_face.svg +0 -1
  61. package/export_svg/pole_stator_right.svg +0 -1
  62. package/export_svg/rake.svg +0 -1
  63. package/export_svg/rake_door.svg +0 -1
  64. package/export_svg/rake_face.svg +0 -1
  65. package/export_svg/rake_side.svg +0 -1
  66. package/export_svg/rake_side_stopper.svg +0 -1
  67. package/export_svg/rake_top.svg +0 -1
  68. package/export_svg/rake_top_stopper.svg +0 -1
  69. package/export_svg/rectangle.svg +0 -1
  70. package/export_svg/rectangle_height.svg +0 -1
  71. package/export_svg/rectangle_width.svg +0 -1
  72. package/export_svg/right_side_angle_kitchen.svg +0 -1
  73. package/export_svg/rod.svg +0 -1
  74. package/export_svg/rod_cut.svg +0 -1
  75. package/export_svg/rod_plate.svg +0 -1
  76. package/export_svg/rod_top.svg +0 -1
  77. package/export_svg/spider.svg +0 -1
  78. package/export_svg/spider_lateral.svg +0 -1
  79. package/export_svg/spider_profile.svg +0 -1
  80. package/export_svg/surface.svg +0 -3
  81. package/export_svg/surface_crenel.svg +0 -1
  82. package/export_svg/surface_extremities.svg +0 -2
  83. package/export_svg/surface_lz.svg +0 -1
  84. package/export_svg/surface_main.svg +0 -1
  85. package/export_svg/surface_power.svg +0 -2
  86. package/export_svg/surface_space_evolution.svg +0 -1
  87. package/export_svg/surface_space_shape.svg +0 -1
  88. package/export_svg/swing.svg +0 -1
  89. package/export_svg/swing_face.svg +0 -1
  90. package/export_svg/swing_side.svg +0 -1
  91. package/export_svg/swing_top.svg +0 -1
  92. package/export_svg/swing_with_rod.svg +0 -1
  93. package/export_svg/trapeze.svg +0 -1
  94. package/export_svg/trapeze_rod.svg +0 -1
  95. package/export_svg/trapeze_side.svg +0 -1
  96. package/export_svg/trapeze_top.svg +0 -1
  97. package/export_svg/verify_contour_1.svg +0 -1
  98. package/export_svg/verify_contour_1_l1.svg +0 -1
  99. package/export_svg/verify_contour_1_r1.svg +0 -1
  100. package/export_svg/verify_line.svg +0 -1
  101. package/export_svg/verify_line_2_l1cx.svg +0 -1
  102. package/export_svg/verify_line_p1x.svg +0 -1
  103. package/export_svg/verify_point.svg +0 -1
  104. package/export_svg/verify_point_p1x.svg +0 -1
  105. package/export_svg/verify_vector_p1x.svg +0 -1
  106. package/src/dummy/circles.ts +0 -65
  107. package/src/dummy/pole_static.ts +0 -86
  108. package/src/dummy/rectangle.ts +0 -55
  109. package/src/dummy/svg/circles.svg +0 -288
  110. package/src/dummy/svg/circles_amplitude-offset.svg +0 -109
  111. package/src/dummy/svg/circles_amplitude-scale.svg +0 -122
  112. package/src/dummy/svg/circles_angle.svg +0 -110
  113. package/src/dummy/svg/dummy_pole_static.svg +0 -192
  114. package/src/dummy/svg/dummy_pole_static_face.svg +0 -176
  115. package/src/dummy/svg/rectangle.svg +0 -131
  116. package/src/dummy/svg/rectangle_height.svg +0 -82
  117. package/src/dummy/svg/rectangle_width.svg +0 -81
  118. package/src/gears/gearWheelProfile.test.ts +0 -25
  119. package/src/gears/gearWheelProfile.ts +0 -753
  120. package/src/gears/gear_wheel_wheel.ts +0 -335
  121. package/src/gears/involute.test.ts +0 -21
  122. package/src/gears/involute.ts +0 -113
  123. package/src/gears/simplified_gear_wheel.ts +0 -242
  124. package/src/gears/svg/calculation_of_initAngle2.svg +0 -376
  125. package/src/gears/svg/gear_addendeum_dedendum_sizes.svg +0 -471
  126. package/src/gears/svg/gear_addendum_and_dedendum.svg +0 -269
  127. package/src/gears/svg/gear_adherence_replaced_by_teeth.svg +0 -168
  128. package/src/gears/svg/gear_base_circle_for_involute.svg +0 -376
  129. package/src/gears/svg/gear_base_left_circle_for_involute.svg +0 -556
  130. package/src/gears/svg/gear_base_right_circle_for_involute.svg +0 -516
  131. package/src/gears/svg/gear_inter_axis_maximum_distance.svg +0 -218
  132. package/src/gears/svg/gear_inter_axis_minimum_distance.svg +0 -218
  133. package/src/gears/svg/gear_large_base_radius.svg +0 -199
  134. package/src/gears/svg/gear_module_and_tooth_thickness.svg +0 -319
  135. package/src/gears/svg/gear_optimum_base_radius.svg +0 -232
  136. package/src/gears/svg/gear_optimum_base_radius_with_longer_inter_axis.svg +0 -344
  137. package/src/gears/svg/gear_right_left_base_circles.svg +0 -295
  138. package/src/gears/svg/gear_small_base_radius.svg +0 -163
  139. package/src/gears/svg/gear_wheel_circles.svg +0 -348
  140. package/src/gears/svg/gears.svg +0 -4726
  141. package/src/gears/svg/gears_motion_transmission_via_adherence.svg +0 -178
  142. package/src/gears/svg/involute_of_circle.svg +0 -2745
  143. package/src/gears/svg/involute_of_circle_R0.svg +0 -334
  144. package/src/gears/svg/involute_of_circle_Ri1_u0.svg +0 -297
  145. package/src/gears/svg/involute_of_circle_Ri2_u2.svg +0 -386
  146. package/src/gears/svg/left_side_angle_kitchen.svg +0 -207
  147. package/src/gears/svg/negative_involute_of_circle_R0.svg +0 -381
  148. package/src/gears/svg/point_c_position_and_speed_negative.svg +0 -343
  149. package/src/gears/svg/point_c_position_and_speed_positive.svg +0 -339
  150. package/src/gears/svg/right_side_angle_kitchen.svg +0 -201
  151. package/src/gears/wheelElements.test.ts +0 -13
  152. package/src/gears/wheelElements.ts +0 -176
  153. package/src/geometrix_verification/svg/verify_contour_1.svg +0 -320
  154. package/src/geometrix_verification/svg/verify_contour_1_l1.svg +0 -102
  155. package/src/geometrix_verification/svg/verify_contour_1_r1.svg +0 -170
  156. package/src/geometrix_verification/svg/verify_line.svg +0 -845
  157. package/src/geometrix_verification/svg/verify_line_2_l1cx.svg +0 -274
  158. package/src/geometrix_verification/svg/verify_line_p1x.svg +0 -261
  159. package/src/geometrix_verification/svg/verify_point.svg +0 -350
  160. package/src/geometrix_verification/svg/verify_point_p1x.svg +0 -258
  161. package/src/geometrix_verification/svg/verify_vector_p1x.svg +0 -282
  162. package/src/geometrix_verification/verify_contour_1.ts +0 -94
  163. package/src/geometrix_verification/verify_contour_2.ts +0 -267
  164. package/src/geometrix_verification/verify_contour_3.ts +0 -409
  165. package/src/geometrix_verification/verify_contour_4.ts +0 -91
  166. package/src/geometrix_verification/verify_exports_1.ts +0 -95
  167. package/src/geometrix_verification/verify_line.ts +0 -76
  168. package/src/geometrix_verification/verify_line_2.ts +0 -76
  169. package/src/geometrix_verification/verify_line_3.ts +0 -64
  170. package/src/geometrix_verification/verify_point.ts +0 -62
  171. package/src/geometrix_verification/verify_point_2.ts +0 -66
  172. package/src/geometrix_verification/verify_vector.ts +0 -70
  173. package/src/heliostat/base.ts +0 -254
  174. package/src/heliostat/heliostat.ts +0 -317
  175. package/src/heliostat/heliostat_2.ts +0 -284
  176. package/src/heliostat/pole_rotor.ts +0 -165
  177. package/src/heliostat/pole_static.ts +0 -275
  178. package/src/heliostat/rake.ts +0 -486
  179. package/src/heliostat/rake_stopper.ts +0 -409
  180. package/src/heliostat/rod.ts +0 -200
  181. package/src/heliostat/spider.ts +0 -238
  182. package/src/heliostat/surface.ts +0 -320
  183. package/src/heliostat/svg/base.svg +0 -1367
  184. package/src/heliostat/svg/base_cut.svg +0 -459
  185. package/src/heliostat/svg/base_hollow.svg +0 -469
  186. package/src/heliostat/svg/base_top.svg +0 -338
  187. package/src/heliostat/svg/heliostat.svg +0 -8013
  188. package/src/heliostat/svg/heliostat2_face_sizing.svg +0 -1386
  189. package/src/heliostat/svg/heliostat2_side_sizing.svg +0 -984
  190. package/src/heliostat/svg/heliostat_face_sizing.svg +0 -1448
  191. package/src/heliostat/svg/heliostat_overview.svg +0 -1552
  192. package/src/heliostat/svg/heliostat_side.svg +0 -1470
  193. package/src/heliostat/svg/heliostat_side_sizing.svg +0 -1128
  194. package/src/heliostat/svg/pole_rotor.svg +0 -592
  195. package/src/heliostat/svg/pole_rotor_cut.svg +0 -287
  196. package/src/heliostat/svg/pole_rotor_ends.svg +0 -336
  197. package/src/heliostat/svg/pole_stator.svg +0 -1945
  198. package/src/heliostat/svg/pole_stator_E2.svg +0 -410
  199. package/src/heliostat/svg/pole_stator_bottom.svg +0 -330
  200. package/src/heliostat/svg/pole_stator_cut.svg +0 -465
  201. package/src/heliostat/svg/pole_stator_face.svg +0 -457
  202. package/src/heliostat/svg/pole_stator_right.svg +0 -357
  203. package/src/heliostat/svg/rake.svg +0 -4691
  204. package/src/heliostat/svg/rake_door.svg +0 -617
  205. package/src/heliostat/svg/rake_face.svg +0 -1211
  206. package/src/heliostat/svg/rake_side.svg +0 -809
  207. package/src/heliostat/svg/rake_side_stopper.svg +0 -596
  208. package/src/heliostat/svg/rake_top.svg +0 -514
  209. package/src/heliostat/svg/rake_top_stopper.svg +0 -565
  210. package/src/heliostat/svg/rod.svg +0 -1314
  211. package/src/heliostat/svg/rod_cut.svg +0 -265
  212. package/src/heliostat/svg/rod_plate.svg +0 -409
  213. package/src/heliostat/svg/rod_top.svg +0 -577
  214. package/src/heliostat/svg/spider.svg +0 -693
  215. package/src/heliostat/svg/spider_lateral.svg +0 -222
  216. package/src/heliostat/svg/spider_profile.svg +0 -429
  217. package/src/heliostat/svg/surface.svg +0 -3577
  218. package/src/heliostat/svg/surface_crenel.svg +0 -1335
  219. package/src/heliostat/svg/surface_extremities.svg +0 -510
  220. package/src/heliostat/svg/surface_lz.svg +0 -182
  221. package/src/heliostat/svg/surface_main.svg +0 -366
  222. package/src/heliostat/svg/surface_power.svg +0 -331
  223. package/src/heliostat/svg/surface_space_evolution.svg +0 -210
  224. package/src/heliostat/svg/surface_space_shape.svg +0 -98
  225. package/src/heliostat/svg/swing.svg +0 -3310
  226. package/src/heliostat/svg/swing_face.svg +0 -902
  227. package/src/heliostat/svg/swing_side.svg +0 -574
  228. package/src/heliostat/svg/swing_top.svg +0 -923
  229. package/src/heliostat/svg/swing_with_rod.svg +0 -547
  230. package/src/heliostat/svg/trapeze.svg +0 -1711
  231. package/src/heliostat/svg/trapeze_rod.svg +0 -122
  232. package/src/heliostat/svg/trapeze_side.svg +0 -361
  233. package/src/heliostat/svg/trapeze_top.svg +0 -1057
  234. package/src/heliostat/swing.ts +0 -246
  235. package/src/heliostat/trapeze.ts +0 -510
  236. package/src/index.ts +0 -33
  237. package/src/svg/default_param_blank.svg +0 -40
  238. package/tsconfig.json +0 -13
  239. package/vitest.config.ts +0 -7
@@ -1,317 +0,0 @@
1
- // heliostat.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
- designParam,
14
- checkGeom,
15
- prefixLog,
16
- //contour,
17
- //contourCircle,
18
- figure,
19
- degToRad,
20
- radToDeg,
21
- ffix,
22
- pNumber,
23
- //pCheckbox,
24
- //pDropdown,
25
- initGeom,
26
- //EExtrude,
27
- EBVolume
28
- } from 'geometrix';
29
-
30
- // design import
31
- import { poleStaticDef } from './pole_static';
32
- import { rakeDef } from './rake';
33
- import { spiderDef } from './spider';
34
- import { swingDef } from './swing';
35
-
36
- const pDef: tParamDef = {
37
- partName: 'heliostat',
38
- params: [
39
- //pNumber(name, unit, init, min, max, step)
40
- pNumber('H1', 'mm', 3000, 100, 40000, 10),
41
- pNumber('H2', 'mm', 2500, 100, 40000, 10),
42
- pNumber('H3', 'mm', 200, 10, 500, 10),
43
- pNumber('H4', 'mm', 800, 100, 4000, 10),
44
- pNumber('H5', 'mm', 3000, 100, 6000, 10),
45
- pNumber('H6', 'mm', 200, 100, 4000, 10),
46
- pNumber('H7', 'mm', 800, 100, 4000, 10),
47
- pNumber('H8', 'mm', 200, 100, 4000, 10),
48
- pNumber('H9', 'mm', 100, 10, 400, 10),
49
- pNumber('D1', 'mm', 1000, 100, 4000, 10),
50
- pNumber('D2', 'mm', 700, 100, 4000, 10),
51
- pNumber('D3', 'mm', 900, 100, 4000, 10),
52
- pNumber('D4', 'mm', 400, 100, 4000, 10),
53
- pNumber('D5', 'mm', 300, 100, 1000, 10),
54
- pNumber('D6', 'mm', 200, 100, 1000, 10),
55
- pNumber('D7', 'mm', 400, 100, 1000, 10),
56
- pNumber('D8', 'mm', 100, 10, 1000, 10),
57
- pNumber('D9', 'mm', 100, 10, 1000, 10),
58
- pNumber('S1', 'mm', 250, 10, 800, 10),
59
- pNumber('S2', 'mm', 200, 10, 800, 10),
60
- pNumber('E1', 'mm', 30, 1, 80, 1),
61
- pNumber('E2', 'mm', 50, 1, 80, 1),
62
- pNumber('L1', 'mm', 12500, 1000, 40000, 10),
63
- pNumber('L2', 'mm', 6000, 1000, 40000, 10),
64
- pNumber('L3', 'mm', 100, 10, 500, 10),
65
- pNumber('L4', 'mm', 600, 100, 4000, 10),
66
- pNumber('L5', 'mm', 2000, 100, 6000, 10),
67
- pNumber('L6', 'mm', 2000, 100, 6000, 10),
68
- pNumber('L7', 'mm', 100, 10, 1000, 10),
69
- pNumber('L8', 'mm', 200, 10, 1000, 10),
70
- pNumber('al', 'degree', 80, 0, 95, 1),
71
- pNumber('ar', 'degree', 80, 0, 95, 1)
72
- ],
73
- paramSvg: {
74
- H1: 'heliostat_overview.svg',
75
- H2: 'heliostat_side.svg',
76
- H3: 'heliostat_side_sizing.svg',
77
- H4: 'heliostat_side_sizing.svg',
78
- H5: 'heliostat_side_sizing.svg',
79
- H6: 'heliostat_side_sizing.svg',
80
- H7: 'heliostat_side_sizing.svg',
81
- H8: 'heliostat_side_sizing.svg',
82
- H9: 'heliostat_side_sizing.svg',
83
- D1: 'heliostat_side_sizing.svg',
84
- D2: 'heliostat_side_sizing.svg',
85
- D3: 'heliostat_side_sizing.svg',
86
- D4: 'heliostat_side_sizing.svg',
87
- D5: 'heliostat_side_sizing.svg',
88
- D6: 'heliostat_side_sizing.svg',
89
- D7: 'heliostat_side_sizing.svg',
90
- D8: 'heliostat_side_sizing.svg',
91
- D9: 'heliostat_face_sizing.svg',
92
- S1: 'heliostat_side_sizing.svg',
93
- S2: 'heliostat_side_sizing.svg',
94
- E1: 'heliostat_side_sizing.svg',
95
- E2: 'heliostat_side_sizing.svg',
96
- L1: 'heliostat_face_sizing.svg',
97
- L2: 'heliostat_side_sizing.svg',
98
- L3: 'heliostat_face_sizing.svg',
99
- L4: 'heliostat_face_sizing.svg',
100
- L5: 'heliostat_face_sizing.svg',
101
- L6: 'heliostat_face_sizing.svg',
102
- L7: 'heliostat_face_sizing.svg',
103
- L8: 'heliostat_face_sizing.svg',
104
- al: 'heliostat_side_sizing.svg',
105
- ar: 'heliostat_side_sizing.svg'
106
- },
107
- sim: {
108
- tMax: 180,
109
- tStep: 0.5,
110
- tUpdate: 500 // every 0.5 second
111
- }
112
- };
113
-
114
- function pGeom(t: number, param: tParamVal): tGeom {
115
- const rGeome = initGeom(pDef.partName);
116
- const figSide = figure();
117
- const figFace = figure();
118
- rGeome.logstr += `${rGeome.partName} simTime: ${t}\n`;
119
- try {
120
- const helioHeight =
121
- param.H1 + param.H2 - param.H3 + param.H4 + param.H5 - param.H6 + param.H7;
122
- rGeome.logstr += `heliostat-height: ${ffix(helioHeight)}, diameter ${ffix(param.D1)} m\n`;
123
- rGeome.logstr += `heliostat-swing-length: ${ffix(param.L1)}, width ${ffix(param.L2)} m\n`;
124
- const posAngleMid = (param.al - param.ar) / 2;
125
- const posAngleDegree =
126
- posAngleMid - (Math.sin((2 * Math.PI * t) / pDef.sim.tMax) * (param.al + param.ar)) / 2;
127
- const posAngle = degToRad(posAngleDegree);
128
- rGeome.logstr += `swing position angle: ${ffix(radToDeg(posAngle))} degree\n`;
129
- const rakePosY = param.H1 + param.H2 - param.H3;
130
- const spiderPosY = rakePosY + param.H4 + param.H5 - param.H6 + param.H7;
131
- const swingPosY = spiderPosY + param.H8;
132
- // sub-designs
133
- const poleStaticParam = designParam(poleStaticDef.pDef);
134
- const rakeParam = designParam(rakeDef.pDef);
135
- const spiderParam = designParam(spiderDef.pDef);
136
- const swingParam = designParam(swingDef.pDef);
137
- poleStaticParam.setVal('H1', param.H1);
138
- poleStaticParam.setVal('H2', param.H2);
139
- poleStaticParam.setVal('D1', param.D1);
140
- poleStaticParam.setVal('D2', param.D2);
141
- poleStaticParam.setVal('E1', param.E1);
142
- poleStaticParam.setVal('E2', param.E1);
143
- rakeParam.setVal('H1', param.H4);
144
- rakeParam.setVal('H2', param.H5);
145
- rakeParam.setVal('D1', param.D3);
146
- rakeParam.setVal('D2', param.D4);
147
- rakeParam.setVal('L9', param.D3 / 2);
148
- rakeParam.setVal('E1', param.E1);
149
- rakeParam.setVal('E3', param.E1);
150
- rakeParam.setVal('D3', param.D2 * 0.6);
151
- if (param.D2 > param.D3 - 2 * param.E1) {
152
- throw `err153: D2 ${param.D2} too large compare to D3 ${param.D3} and E1 ${param.E1}`;
153
- }
154
- rakeParam.setVal('H4', param.H6);
155
- rakeParam.setVal('D4', param.D5);
156
- rakeParam.setVal('L7', param.L7);
157
- rakeParam.setVal('L8', param.L8);
158
- rakeParam.setVal('D6', param.D9);
159
- rakeParam.setVal('H5', param.H7 + param.H8);
160
- rakeParam.setVal('D5', param.D6);
161
- rakeParam.setVal('D8', param.D7);
162
- if (param.D6 >= param.D7) {
163
- throw `err164: D6 ${param.D6} too large compare to D7 ${param.D7}`;
164
- }
165
- const rakeL4 = param.L4 - 2 * param.L3;
166
- rakeParam.setVal('L4', rakeL4);
167
- if (rakeL4 <= 0) {
168
- throw `err169: L3 ${param.L3} too large compare to L4 ${param.L4}`;
169
- }
170
- rakeParam.setVal('L5', param.L5 + 2 * param.L3);
171
- rakeParam.setVal('L6', param.L6 + 2 * param.L3);
172
- const spiderL5 = param.L5 * 0.96;
173
- spiderParam.setVal('L5', spiderL5);
174
- spiderParam.setVal('D1', param.D8);
175
- spiderParam.setVal('L1', param.S1);
176
- spiderParam.setVal('L2', param.S2);
177
- spiderParam.setVal('E2', param.E2);
178
- spiderParam.setVal('L4', param.L2 / 2 - param.H8);
179
- swingParam.setVal('L2', param.L2);
180
- swingParam.setVal('D1', param.D6);
181
- swingParam.setVal('H4', param.H9);
182
- swingParam.setVal('L1', param.L1);
183
- if (param.L1 < 4 * param.L4 + 2 * param.L6 + param.L5 + 2 * param.L3) {
184
- throw `err185: L1 ${param.L1} too small compare to L4 ${param.L4}, L5 ${param.L5}, L6 ${param.L6}`;
185
- }
186
- swingParam.setVal('H1', param.L3);
187
- swingParam.setVal('H2', param.L3);
188
- swingParam.setVal('L4', param.L4);
189
- swingParam.setVal('L5', param.L5);
190
- swingParam.setVal('L6', param.L6);
191
- swingParam.setVal('L3', param.D7);
192
- const poleStaticGeom = poleStaticDef.pGeom(0, poleStaticParam.getParamVal());
193
- checkGeom(poleStaticGeom);
194
- rGeome.logstr += prefixLog(poleStaticGeom.logstr, poleStaticParam.partName);
195
- const rakeGeom = rakeDef.pGeom(0, rakeParam.getParamVal());
196
- checkGeom(rakeGeom);
197
- rGeome.logstr += prefixLog(rakeGeom.logstr, rakeParam.partName);
198
- const spiderGeom = spiderDef.pGeom(0, spiderParam.getParamVal());
199
- checkGeom(spiderGeom);
200
- rGeome.logstr += prefixLog(spiderGeom.logstr, spiderParam.partName);
201
- const swingGeom = swingDef.pGeom(0, swingParam.getParamVal());
202
- checkGeom(swingGeom);
203
- rGeome.logstr += prefixLog(swingGeom.logstr, swingParam.partName);
204
- // figSide
205
- figSide.mergeFigure(poleStaticGeom.fig.poleCut);
206
- figSide.mergeFigure(rakeGeom.fig.faceBeam.translate(0, rakePosY));
207
- figSide.mergeFigure(
208
- spiderGeom.fig.faceLegs.translate(0, spiderPosY).rotate(0, spiderPosY, posAngle / 2)
209
- );
210
- figSide.mergeFigure(
211
- swingGeom.fig.faceSide.translate(0, swingPosY).rotate(0, swingPosY, posAngle)
212
- );
213
- // figFace
214
- figFace.mergeFigure(poleStaticGeom.fig.poleCut);
215
- figFace.mergeFigure(rakeGeom.fig.faceCone.translate(0, rakePosY));
216
- figFace.mergeFigure(spiderGeom.fig.faceBody.translate(-spiderL5 / 2, spiderPosY));
217
- figFace.mergeFigure(swingGeom.fig.faceFace.translate(0, swingPosY));
218
- // final figure list
219
- rGeome.fig = {
220
- faceSide: figSide,
221
- faceFace: figFace
222
- };
223
- const designName = rGeome.partName;
224
- rGeome.vol = {
225
- inherits: [
226
- {
227
- outName: `inpax_${designName}_poleStatic`,
228
- subdesign: 'pax_pole_static',
229
- subgeom: poleStaticGeom,
230
- rotate: [0, 0, 0],
231
- translate: [0, 0, 0]
232
- },
233
- {
234
- outName: `inpax_${designName}_rake`,
235
- subdesign: 'pax_rake',
236
- subgeom: rakeGeom,
237
- rotate: [0, 0, 0],
238
- translate: [0, 0, rakePosY]
239
- },
240
- {
241
- outName: `inpax_${designName}_swing`,
242
- subdesign: 'pax_swing',
243
- subgeom: swingGeom,
244
- rotate: [Math.PI / 2, 0, 0],
245
- translate: [0, 0, swingPosY]
246
- },
247
- {
248
- outName: `inpax_${designName}_spider`,
249
- subdesign: 'pax_spider',
250
- subgeom: spiderGeom,
251
- rotate: [Math.PI / 2, 0, 0],
252
- translate: [0, spiderL5 / 2, spiderPosY]
253
- }
254
- ],
255
- extrudes: [],
256
- volumes: [
257
- {
258
- outName: `pax_${designName}`,
259
- boolMethod: EBVolume.eUnion,
260
- inList: [
261
- `inpax_${designName}_poleStatic`,
262
- `inpax_${designName}_rake`,
263
- `inpax_${designName}_swing`,
264
- `inpax_${designName}_spider`
265
- ]
266
- }
267
- ]
268
- };
269
- // sub-design
270
- const subPoleStatic: tSubInst = {
271
- partName: poleStaticParam.getPartName(),
272
- dparam: poleStaticParam.getDesignParamList(),
273
- orientation: [0, 0, 0],
274
- position: [0, 0, 0]
275
- };
276
- const subRake: tSubInst = {
277
- partName: rakeParam.getPartName(),
278
- dparam: rakeParam.getDesignParamList(),
279
- orientation: [0, 0, 0],
280
- position: [0, 0, rakePosY]
281
- };
282
- const subSpider: tSubInst = {
283
- partName: rakeParam.getPartName(),
284
- dparam: rakeParam.getDesignParamList(),
285
- orientation: [Math.PI / 2, 0, 0],
286
- position: [0, spiderL5 / 2, spiderPosY]
287
- };
288
- const subSwing: tSubInst = {
289
- partName: swingParam.getPartName(),
290
- dparam: swingParam.getDesignParamList(),
291
- orientation: [Math.PI / 2, 0, 0],
292
- position: [0, 0, swingPosY]
293
- };
294
- rGeome.sub = {
295
- pole_static_1: subPoleStatic,
296
- rake_1: subRake,
297
- spider_1: subSpider,
298
- swing_1: subSwing
299
- };
300
- // finalize
301
- rGeome.logstr += 'heliostat-overview draw successfully!\n';
302
- rGeome.calcErr = false;
303
- } catch (emsg) {
304
- rGeome.logstr += emsg as string;
305
- console.log(emsg as string);
306
- }
307
- return rGeome;
308
- }
309
-
310
- const heliostatDef: tPageDef = {
311
- pTitle: 'Heliostat overview',
312
- pDescription: 'The heliostat inclination mechanism',
313
- pDef: pDef,
314
- pGeom: pGeom
315
- };
316
-
317
- export { heliostatDef };
@@ -1,284 +0,0 @@
1
- // heliostat_2.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
- designParam,
14
- checkGeom,
15
- prefixLog,
16
- //contour,
17
- //contourCircle,
18
- figure,
19
- degToRad,
20
- radToDeg,
21
- ffix,
22
- pNumber,
23
- //pCheckbox,
24
- //pDropdown,
25
- initGeom,
26
- //EExtrude,
27
- EBVolume
28
- //oneDesignParam
29
- } from 'geometrix';
30
-
31
- // design import
32
- import { poleStaticDef } from './pole_static';
33
- import { rakeStopperDef } from './rake_stopper';
34
- import { swingDef } from './swing';
35
-
36
- const pDef: tParamDef = {
37
- partName: 'heliostat_2',
38
- params: [
39
- //pNumber(name, unit, init, min, max, step)
40
- pNumber('H1', 'mm', 3000, 100, 40000, 10),
41
- pNumber('H2', 'mm', 2500, 100, 40000, 10),
42
- pNumber('H3', 'mm', 200, 10, 500, 10),
43
- pNumber('H4', 'mm', 800, 100, 4000, 10),
44
- pNumber('H5', 'mm', 3000, 100, 6000, 10),
45
- pNumber('H6', 'mm', 200, 100, 4000, 10),
46
- pNumber('H7', 'mm', 400, 100, 4000, 10),
47
- pNumber('H9', 'mm', 100, 10, 400, 10),
48
- pNumber('D1', 'mm', 1000, 100, 4000, 10),
49
- pNumber('D2', 'mm', 700, 100, 4000, 10),
50
- pNumber('D3', 'mm', 900, 100, 4000, 10),
51
- pNumber('D4', 'mm', 400, 100, 4000, 10),
52
- pNumber('D5', 'mm', 300, 100, 1000, 10),
53
- pNumber('D6', 'mm', 200, 100, 1000, 10),
54
- pNumber('D7', 'mm', 400, 100, 1000, 10),
55
- pNumber('D9', 'mm', 100, 10, 1000, 10),
56
- pNumber('E1', 'mm', 30, 1, 80, 1),
57
- pNumber('L1', 'mm', 12500, 1000, 40000, 10),
58
- pNumber('L2', 'mm', 6000, 1000, 40000, 10),
59
- pNumber('L3', 'mm', 100, 10, 500, 10),
60
- pNumber('L4', 'mm', 600, 100, 4000, 10),
61
- pNumber('L5', 'mm', 2000, 100, 6000, 10),
62
- pNumber('L6', 'mm', 2000, 100, 6000, 10),
63
- pNumber('L7', 'mm', 100, 10, 1000, 10),
64
- pNumber('L8', 'mm', 200, 10, 1000, 10),
65
- pNumber('al', 'degree', 80, 0, 95, 1),
66
- pNumber('S1', 'mm', 100, 10, 800, 1)
67
- ],
68
- paramSvg: {
69
- H1: 'heliostat_overview.svg',
70
- H2: 'heliostat_side.svg',
71
- H3: 'heliostat2_side_sizing.svg',
72
- H4: 'heliostat2_side_sizing.svg',
73
- H5: 'heliostat2_side_sizing.svg',
74
- H6: 'heliostat2_side_sizing.svg',
75
- H7: 'heliostat2_side_sizing.svg',
76
- H9: 'heliostat2_side_sizing.svg',
77
- D1: 'heliostat2_side_sizing.svg',
78
- D2: 'heliostat2_side_sizing.svg',
79
- D3: 'heliostat2_side_sizing.svg',
80
- D4: 'heliostat2_side_sizing.svg',
81
- D5: 'heliostat2_side_sizing.svg',
82
- D6: 'heliostat2_side_sizing.svg',
83
- D7: 'heliostat2_side_sizing.svg',
84
- D9: 'heliostat2_face_sizing.svg',
85
- E1: 'heliostat2_side_sizing.svg',
86
- L1: 'heliostat2_face_sizing.svg',
87
- L2: 'heliostat2_side_sizing.svg',
88
- L3: 'heliostat2_face_sizing.svg',
89
- L4: 'heliostat2_face_sizing.svg',
90
- L5: 'heliostat2_face_sizing.svg',
91
- L6: 'heliostat2_face_sizing.svg',
92
- L7: 'heliostat2_face_sizing.svg',
93
- L8: 'heliostat2_face_sizing.svg',
94
- al: 'heliostat2_side_sizing.svg',
95
- S1: 'heliostat2_side_sizing.svg'
96
- },
97
- sim: {
98
- tMax: 180,
99
- tStep: 0.5,
100
- tUpdate: 500 // every 0.5 second
101
- }
102
- };
103
-
104
- function pGeom(t: number, param: tParamVal): tGeom {
105
- const rGeome = initGeom(pDef.partName);
106
- const figSide = figure();
107
- const figFace = figure();
108
- const figTop = figure();
109
- rGeome.logstr += `${rGeome.partName} simTime: ${t}\n`;
110
- try {
111
- const helioHeight =
112
- param.H1 + param.H2 - param.H3 + param.H4 + param.H5 - param.H6 + param.H7;
113
- rGeome.logstr += `heliostat-height: ${ffix(helioHeight)}, diameter ${ffix(param.D1)} m\n`;
114
- rGeome.logstr += `heliostat-swing-length: ${ffix(param.L1)}, width ${ffix(param.L2)} m\n`;
115
- const posAngleDegree = (param.al * t) / pDef.sim.tMax;
116
- const posAngle = degToRad(posAngleDegree);
117
- rGeome.logstr += `swing position angle: ${ffix(radToDeg(posAngle))} degree\n`;
118
- const rakePosY = param.H1 + param.H2 - param.H3;
119
- const swingPosY = rakePosY + param.H4 + param.H5 - param.H6 + param.H7;
120
- // sub-designs
121
- const poleStaticParam = designParam(poleStaticDef.pDef);
122
- const rakeParam = designParam(rakeStopperDef.pDef);
123
- const swingParam = designParam(swingDef.pDef);
124
- poleStaticParam.setVal('H1', param.H1);
125
- poleStaticParam.setVal('H2', param.H2);
126
- poleStaticParam.setVal('D1', param.D1);
127
- poleStaticParam.setVal('D2', param.D2);
128
- poleStaticParam.setVal('E1', param.E1);
129
- poleStaticParam.setVal('E2', param.E1);
130
- rakeParam.setVal('H1', param.H4);
131
- rakeParam.setVal('H2', param.H5);
132
- rakeParam.setVal('D1', param.D3);
133
- rakeParam.setVal('D2', param.D4);
134
- rakeParam.setVal('L9', param.D3 / 2);
135
- rakeParam.setVal('E1', param.E1);
136
- rakeParam.setVal('E3', param.E1);
137
- rakeParam.setVal('D3', param.D2 * 0.6);
138
- if (param.D2 > param.D3 - 2 * param.E1) {
139
- throw `err153: D2 ${param.D2} too large compare to D3 ${param.D3} and E1 ${param.E1}`;
140
- }
141
- rakeParam.setVal('H4', param.H6);
142
- rakeParam.setVal('D4', param.D5);
143
- rakeParam.setVal('L7', param.L7);
144
- rakeParam.setVal('L8', param.L8);
145
- rakeParam.setVal('D6', param.D9);
146
- rakeParam.setVal('H5', param.H7);
147
- rakeParam.setVal('D5', param.D6);
148
- rakeParam.setVal('D8', param.D7);
149
- if (param.D6 >= param.D7) {
150
- throw `err164: D6 ${param.D6} too large compare to D7 ${param.D7}`;
151
- }
152
- const rakeL4 = param.L4 - 2 * param.L3;
153
- rakeParam.setVal('L4', rakeL4);
154
- if (rakeL4 <= 0) {
155
- throw `err169: L3 ${param.L3} too large compare to L4 ${param.L4}`;
156
- }
157
- rakeParam.setVal('L5', param.L5 + 2 * param.L3);
158
- rakeParam.setVal('L6', param.L6 + 2 * param.L3);
159
- rakeParam.setVal('S1', param.S1);
160
- rakeParam.setVal('S2', param.L2 / 2);
161
- swingParam.setVal('L2', param.L2);
162
- swingParam.setVal('D1', param.D6);
163
- swingParam.setVal('H4', param.H9);
164
- swingParam.setVal('L1', param.L1);
165
- if (param.L1 < 4 * param.L4 + 2 * param.L6 + param.L5 + 2 * param.L3) {
166
- throw `err185: L1 ${param.L1} too small compare to L4 ${param.L4}, L5 ${param.L5}, L6 ${param.L6}`;
167
- }
168
- swingParam.setVal('H1', param.L3);
169
- swingParam.setVal('H2', param.L3);
170
- swingParam.setVal('L4', param.L4);
171
- swingParam.setVal('L5', param.L5);
172
- swingParam.setVal('L6', param.L6);
173
- swingParam.setVal('L3', param.D7);
174
- const poleStaticGeom = poleStaticDef.pGeom(0, poleStaticParam.getParamVal());
175
- checkGeom(poleStaticGeom);
176
- rGeome.logstr += prefixLog(poleStaticGeom.logstr, poleStaticParam.partName);
177
- const rakeGeom = rakeStopperDef.pGeom(0, rakeParam.getParamVal());
178
- checkGeom(rakeGeom);
179
- rGeome.logstr += prefixLog(rakeGeom.logstr, rakeParam.partName);
180
- const swingGeom = swingDef.pGeom(0, swingParam.getParamVal());
181
- checkGeom(swingGeom);
182
- rGeome.logstr += prefixLog(swingGeom.logstr, swingParam.partName);
183
- // figSide
184
- figSide.mergeFigure(poleStaticGeom.fig.poleCut);
185
- figSide.mergeFigure(rakeGeom.fig.faceStopperSide.translate(0, rakePosY));
186
- figSide.mergeFigure(
187
- swingGeom.fig.faceSide.translate(0, swingPosY).rotate(0, swingPosY, posAngle)
188
- );
189
- // figFace
190
- figFace.mergeFigure(poleStaticGeom.fig.poleCut);
191
- figFace.mergeFigure(rakeGeom.fig.faceStopperFaceT.translate(0, rakePosY));
192
- figFace.mergeFigure(swingGeom.fig.faceFace.translate(0, swingPosY));
193
- // figTop
194
- figTop.mergeFigure(poleStaticGeom.fig.poleBottom.translate(0, 0));
195
- figTop.mergeFigure(rakeGeom.fig.faceStopperTop.translate(0, 0));
196
- figTop.mergeFigure(swingGeom.fig.faceTop.rotate(0, 0, Math.PI / 2));
197
- // final figure list
198
- rGeome.fig = {
199
- faceSide: figSide,
200
- faceFace: figFace,
201
- faceTop: figTop
202
- };
203
- const designName = rGeome.partName;
204
- rGeome.vol = {
205
- inherits: [
206
- {
207
- outName: `inpax_${designName}_poleStatic`,
208
- subdesign: 'pax_pole_static',
209
- subgeom: poleStaticGeom,
210
- rotate: [0, 0, 0],
211
- translate: [0, 0, 0]
212
- },
213
- {
214
- outName: `inpax_${designName}_rake`,
215
- subdesign: 'pax_rake_stopper',
216
- subgeom: rakeGeom,
217
- rotate: [0, 0, 0],
218
- translate: [0, 0, rakePosY]
219
- },
220
- {
221
- outName: `inpax_${designName}_swing`,
222
- subdesign: 'pax_swing',
223
- subgeom: swingGeom,
224
- rotate: [Math.PI / 2, 0, 0],
225
- translate: [0, 0, swingPosY]
226
- }
227
- ],
228
- extrudes: [],
229
- volumes: [
230
- {
231
- outName: `pax_${designName}`,
232
- boolMethod: EBVolume.eUnion,
233
- inList: [
234
- `inpax_${designName}_poleStatic`,
235
- `inpax_${designName}_rake`,
236
- `inpax_${designName}_swing`
237
- ]
238
- }
239
- ]
240
- };
241
- // sub-design
242
- const poleDesignParamList = poleStaticParam.getDesignParamList();
243
- //poleDesignParamList.gaga = oneDesignParam(5, 6, true); // testing adding a wring param
244
- const subPoleStatic: tSubInst = {
245
- partName: poleStaticParam.getPartName(),
246
- dparam: poleDesignParamList,
247
- orientation: [0, 0, 0],
248
- position: [0, 0, 0]
249
- };
250
- const subRake: tSubInst = {
251
- partName: rakeParam.getPartName(),
252
- dparam: rakeParam.getDesignParamList(),
253
- orientation: [0, 0, 0],
254
- position: [0, 0, rakePosY]
255
- };
256
- const subSwing: tSubInst = {
257
- partName: swingParam.getPartName(),
258
- dparam: swingParam.getDesignParamList(),
259
- orientation: [0, 0, 0],
260
- position: [0, 0, swingPosY]
261
- };
262
- rGeome.sub = {
263
- pole_static_1: subPoleStatic,
264
- rake_1: subRake,
265
- swing_1: subSwing
266
- };
267
- // finalize
268
- rGeome.logstr += 'heliostat-2-overview draw successfully!\n';
269
- rGeome.calcErr = false;
270
- } catch (emsg) {
271
- rGeome.logstr += emsg as string;
272
- console.log(emsg as string);
273
- }
274
- return rGeome;
275
- }
276
-
277
- const heliostat_2Def: tPageDef = {
278
- pTitle: 'Heliostat-2 overview',
279
- pDescription: 'The heliostat-2 inclination mechanism',
280
- pDef: pDef,
281
- pGeom: pGeom
282
- };
283
-
284
- export { heliostat_2Def };