designix 0.5.3

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 (237) hide show
  1. package/.eslintignore +17 -0
  2. package/.eslintrc.cjs +24 -0
  3. package/.prettierignore +15 -0
  4. package/.prettierrc +8 -0
  5. package/README.md +27 -0
  6. package/export_svg/base.svg +1 -0
  7. package/export_svg/base_cut.svg +1 -0
  8. package/export_svg/base_hollow.svg +1 -0
  9. package/export_svg/base_top.svg +1 -0
  10. package/export_svg/calculation_of_initAngle2.svg +1 -0
  11. package/export_svg/circles.svg +1 -0
  12. package/export_svg/circles_amplitude-offset.svg +1 -0
  13. package/export_svg/circles_amplitude-scale.svg +1 -0
  14. package/export_svg/circles_angle.svg +1 -0
  15. package/export_svg/default_param_blank.svg +1 -0
  16. package/export_svg/dummy_pole_static.svg +1 -0
  17. package/export_svg/dummy_pole_static_face.svg +1 -0
  18. package/export_svg/gear_addendeum_dedendum_sizes.svg +9 -0
  19. package/export_svg/gear_addendum_and_dedendum.svg +1 -0
  20. package/export_svg/gear_adherence_replaced_by_teeth.svg +1 -0
  21. package/export_svg/gear_base_circle_for_involute.svg +2 -0
  22. package/export_svg/gear_base_left_circle_for_involute.svg +2 -0
  23. package/export_svg/gear_base_right_circle_for_involute.svg +2 -0
  24. package/export_svg/gear_inter_axis_maximum_distance.svg +1 -0
  25. package/export_svg/gear_inter_axis_minimum_distance.svg +1 -0
  26. package/export_svg/gear_large_base_radius.svg +5 -0
  27. package/export_svg/gear_module_and_tooth_thickness.svg +3 -0
  28. package/export_svg/gear_optimum_base_radius.svg +5 -0
  29. package/export_svg/gear_optimum_base_radius_with_longer_inter_axis.svg +5 -0
  30. package/export_svg/gear_right_left_base_circles.svg +1 -0
  31. package/export_svg/gear_small_base_radius.svg +5 -0
  32. package/export_svg/gear_wheel_circles.svg +2 -0
  33. package/export_svg/gears.svg +71 -0
  34. package/export_svg/gears_motion_transmission_via_adherence.svg +1 -0
  35. package/export_svg/heliostat.svg +1 -0
  36. package/export_svg/heliostat2_face_sizing.svg +1 -0
  37. package/export_svg/heliostat2_side_sizing.svg +1 -0
  38. package/export_svg/heliostat_face_sizing.svg +1 -0
  39. package/export_svg/heliostat_overview.svg +1 -0
  40. package/export_svg/heliostat_side.svg +1 -0
  41. package/export_svg/heliostat_side_sizing.svg +1 -0
  42. package/export_svg/involute_of_circle.svg +19 -0
  43. package/export_svg/involute_of_circle_R0.svg +1 -0
  44. package/export_svg/involute_of_circle_Ri1_u0.svg +1 -0
  45. package/export_svg/involute_of_circle_Ri2_u2.svg +1 -0
  46. package/export_svg/left_side_angle_kitchen.svg +1 -0
  47. package/export_svg/negative_involute_of_circle_R0.svg +1 -0
  48. package/export_svg/point_c_position_and_speed_negative.svg +1 -0
  49. package/export_svg/point_c_position_and_speed_positive.svg +1 -0
  50. package/export_svg/pole_rotor.svg +1 -0
  51. package/export_svg/pole_rotor_cut.svg +1 -0
  52. package/export_svg/pole_rotor_ends.svg +1 -0
  53. package/export_svg/pole_stator.svg +3 -0
  54. package/export_svg/pole_stator_E2.svg +3 -0
  55. package/export_svg/pole_stator_bottom.svg +1 -0
  56. package/export_svg/pole_stator_cut.svg +1 -0
  57. package/export_svg/pole_stator_face.svg +1 -0
  58. package/export_svg/pole_stator_right.svg +1 -0
  59. package/export_svg/rake.svg +1 -0
  60. package/export_svg/rake_door.svg +1 -0
  61. package/export_svg/rake_face.svg +1 -0
  62. package/export_svg/rake_side.svg +1 -0
  63. package/export_svg/rake_side_stopper.svg +1 -0
  64. package/export_svg/rake_top.svg +1 -0
  65. package/export_svg/rake_top_stopper.svg +1 -0
  66. package/export_svg/rectangle.svg +1 -0
  67. package/export_svg/rectangle_height.svg +1 -0
  68. package/export_svg/rectangle_width.svg +1 -0
  69. package/export_svg/right_side_angle_kitchen.svg +1 -0
  70. package/export_svg/rod.svg +1 -0
  71. package/export_svg/rod_cut.svg +1 -0
  72. package/export_svg/rod_plate.svg +1 -0
  73. package/export_svg/rod_top.svg +1 -0
  74. package/export_svg/spider.svg +1 -0
  75. package/export_svg/spider_lateral.svg +1 -0
  76. package/export_svg/spider_profile.svg +1 -0
  77. package/export_svg/surface.svg +3 -0
  78. package/export_svg/surface_crenel.svg +1 -0
  79. package/export_svg/surface_extremities.svg +2 -0
  80. package/export_svg/surface_lz.svg +1 -0
  81. package/export_svg/surface_main.svg +1 -0
  82. package/export_svg/surface_power.svg +2 -0
  83. package/export_svg/surface_space_evolution.svg +1 -0
  84. package/export_svg/surface_space_shape.svg +1 -0
  85. package/export_svg/swing.svg +1 -0
  86. package/export_svg/swing_face.svg +1 -0
  87. package/export_svg/swing_side.svg +1 -0
  88. package/export_svg/swing_top.svg +1 -0
  89. package/export_svg/swing_with_rod.svg +1 -0
  90. package/export_svg/trapeze.svg +1 -0
  91. package/export_svg/trapeze_rod.svg +1 -0
  92. package/export_svg/trapeze_side.svg +1 -0
  93. package/export_svg/trapeze_top.svg +1 -0
  94. package/export_svg/verify_contour_1.svg +1 -0
  95. package/export_svg/verify_contour_1_l1.svg +1 -0
  96. package/export_svg/verify_contour_1_r1.svg +1 -0
  97. package/export_svg/verify_line.svg +1 -0
  98. package/export_svg/verify_line_2_l1cx.svg +1 -0
  99. package/export_svg/verify_line_p1x.svg +1 -0
  100. package/export_svg/verify_point.svg +1 -0
  101. package/export_svg/verify_point_p1x.svg +1 -0
  102. package/export_svg/verify_vector_p1x.svg +1 -0
  103. package/package.json +76 -0
  104. package/src/dummy/circles.ts +65 -0
  105. package/src/dummy/pole_static.ts +86 -0
  106. package/src/dummy/rectangle.ts +55 -0
  107. package/src/dummy/svg/circles.svg +288 -0
  108. package/src/dummy/svg/circles_amplitude-offset.svg +109 -0
  109. package/src/dummy/svg/circles_amplitude-scale.svg +122 -0
  110. package/src/dummy/svg/circles_angle.svg +110 -0
  111. package/src/dummy/svg/dummy_pole_static.svg +192 -0
  112. package/src/dummy/svg/dummy_pole_static_face.svg +176 -0
  113. package/src/dummy/svg/rectangle.svg +131 -0
  114. package/src/dummy/svg/rectangle_height.svg +82 -0
  115. package/src/dummy/svg/rectangle_width.svg +81 -0
  116. package/src/gears/gearWheelProfile.test.ts +25 -0
  117. package/src/gears/gearWheelProfile.ts +753 -0
  118. package/src/gears/gear_wheel_wheel.ts +335 -0
  119. package/src/gears/involute.test.ts +21 -0
  120. package/src/gears/involute.ts +113 -0
  121. package/src/gears/simplified_gear_wheel.ts +242 -0
  122. package/src/gears/svg/calculation_of_initAngle2.svg +376 -0
  123. package/src/gears/svg/gear_addendeum_dedendum_sizes.svg +471 -0
  124. package/src/gears/svg/gear_addendum_and_dedendum.svg +269 -0
  125. package/src/gears/svg/gear_adherence_replaced_by_teeth.svg +168 -0
  126. package/src/gears/svg/gear_base_circle_for_involute.svg +376 -0
  127. package/src/gears/svg/gear_base_left_circle_for_involute.svg +556 -0
  128. package/src/gears/svg/gear_base_right_circle_for_involute.svg +516 -0
  129. package/src/gears/svg/gear_inter_axis_maximum_distance.svg +218 -0
  130. package/src/gears/svg/gear_inter_axis_minimum_distance.svg +218 -0
  131. package/src/gears/svg/gear_large_base_radius.svg +199 -0
  132. package/src/gears/svg/gear_module_and_tooth_thickness.svg +319 -0
  133. package/src/gears/svg/gear_optimum_base_radius.svg +232 -0
  134. package/src/gears/svg/gear_optimum_base_radius_with_longer_inter_axis.svg +344 -0
  135. package/src/gears/svg/gear_right_left_base_circles.svg +295 -0
  136. package/src/gears/svg/gear_small_base_radius.svg +163 -0
  137. package/src/gears/svg/gear_wheel_circles.svg +348 -0
  138. package/src/gears/svg/gears.svg +4726 -0
  139. package/src/gears/svg/gears_motion_transmission_via_adherence.svg +178 -0
  140. package/src/gears/svg/involute_of_circle.svg +2745 -0
  141. package/src/gears/svg/involute_of_circle_R0.svg +334 -0
  142. package/src/gears/svg/involute_of_circle_Ri1_u0.svg +297 -0
  143. package/src/gears/svg/involute_of_circle_Ri2_u2.svg +386 -0
  144. package/src/gears/svg/left_side_angle_kitchen.svg +207 -0
  145. package/src/gears/svg/negative_involute_of_circle_R0.svg +381 -0
  146. package/src/gears/svg/point_c_position_and_speed_negative.svg +343 -0
  147. package/src/gears/svg/point_c_position_and_speed_positive.svg +339 -0
  148. package/src/gears/svg/right_side_angle_kitchen.svg +201 -0
  149. package/src/gears/wheelElements.test.ts +13 -0
  150. package/src/gears/wheelElements.ts +176 -0
  151. package/src/geometrix_verification/svg/verify_contour_1.svg +320 -0
  152. package/src/geometrix_verification/svg/verify_contour_1_l1.svg +102 -0
  153. package/src/geometrix_verification/svg/verify_contour_1_r1.svg +170 -0
  154. package/src/geometrix_verification/svg/verify_line.svg +845 -0
  155. package/src/geometrix_verification/svg/verify_line_2_l1cx.svg +274 -0
  156. package/src/geometrix_verification/svg/verify_line_p1x.svg +261 -0
  157. package/src/geometrix_verification/svg/verify_point.svg +350 -0
  158. package/src/geometrix_verification/svg/verify_point_p1x.svg +258 -0
  159. package/src/geometrix_verification/svg/verify_vector_p1x.svg +282 -0
  160. package/src/geometrix_verification/verify_contour_1.ts +94 -0
  161. package/src/geometrix_verification/verify_contour_2.ts +267 -0
  162. package/src/geometrix_verification/verify_contour_3.ts +409 -0
  163. package/src/geometrix_verification/verify_contour_4.ts +91 -0
  164. package/src/geometrix_verification/verify_exports_1.ts +95 -0
  165. package/src/geometrix_verification/verify_line.ts +76 -0
  166. package/src/geometrix_verification/verify_line_2.ts +76 -0
  167. package/src/geometrix_verification/verify_line_3.ts +64 -0
  168. package/src/geometrix_verification/verify_point.ts +62 -0
  169. package/src/geometrix_verification/verify_point_2.ts +66 -0
  170. package/src/geometrix_verification/verify_vector.ts +70 -0
  171. package/src/heliostat/base.ts +254 -0
  172. package/src/heliostat/heliostat.ts +317 -0
  173. package/src/heliostat/heliostat_2.ts +284 -0
  174. package/src/heliostat/pole_rotor.ts +165 -0
  175. package/src/heliostat/pole_static.ts +275 -0
  176. package/src/heliostat/rake.ts +486 -0
  177. package/src/heliostat/rake_stopper.ts +409 -0
  178. package/src/heliostat/rod.ts +200 -0
  179. package/src/heliostat/spider.ts +238 -0
  180. package/src/heliostat/surface.ts +320 -0
  181. package/src/heliostat/svg/base.svg +1367 -0
  182. package/src/heliostat/svg/base_cut.svg +459 -0
  183. package/src/heliostat/svg/base_hollow.svg +469 -0
  184. package/src/heliostat/svg/base_top.svg +338 -0
  185. package/src/heliostat/svg/heliostat.svg +8013 -0
  186. package/src/heliostat/svg/heliostat2_face_sizing.svg +1386 -0
  187. package/src/heliostat/svg/heliostat2_side_sizing.svg +984 -0
  188. package/src/heliostat/svg/heliostat_face_sizing.svg +1448 -0
  189. package/src/heliostat/svg/heliostat_overview.svg +1552 -0
  190. package/src/heliostat/svg/heliostat_side.svg +1470 -0
  191. package/src/heliostat/svg/heliostat_side_sizing.svg +1128 -0
  192. package/src/heliostat/svg/pole_rotor.svg +592 -0
  193. package/src/heliostat/svg/pole_rotor_cut.svg +287 -0
  194. package/src/heliostat/svg/pole_rotor_ends.svg +336 -0
  195. package/src/heliostat/svg/pole_stator.svg +1945 -0
  196. package/src/heliostat/svg/pole_stator_E2.svg +410 -0
  197. package/src/heliostat/svg/pole_stator_bottom.svg +330 -0
  198. package/src/heliostat/svg/pole_stator_cut.svg +465 -0
  199. package/src/heliostat/svg/pole_stator_face.svg +457 -0
  200. package/src/heliostat/svg/pole_stator_right.svg +357 -0
  201. package/src/heliostat/svg/rake.svg +4691 -0
  202. package/src/heliostat/svg/rake_door.svg +617 -0
  203. package/src/heliostat/svg/rake_face.svg +1211 -0
  204. package/src/heliostat/svg/rake_side.svg +809 -0
  205. package/src/heliostat/svg/rake_side_stopper.svg +596 -0
  206. package/src/heliostat/svg/rake_top.svg +514 -0
  207. package/src/heliostat/svg/rake_top_stopper.svg +565 -0
  208. package/src/heliostat/svg/rod.svg +1314 -0
  209. package/src/heliostat/svg/rod_cut.svg +265 -0
  210. package/src/heliostat/svg/rod_plate.svg +409 -0
  211. package/src/heliostat/svg/rod_top.svg +577 -0
  212. package/src/heliostat/svg/spider.svg +693 -0
  213. package/src/heliostat/svg/spider_lateral.svg +222 -0
  214. package/src/heliostat/svg/spider_profile.svg +429 -0
  215. package/src/heliostat/svg/surface.svg +3577 -0
  216. package/src/heliostat/svg/surface_crenel.svg +1335 -0
  217. package/src/heliostat/svg/surface_extremities.svg +510 -0
  218. package/src/heliostat/svg/surface_lz.svg +182 -0
  219. package/src/heliostat/svg/surface_main.svg +366 -0
  220. package/src/heliostat/svg/surface_power.svg +331 -0
  221. package/src/heliostat/svg/surface_space_evolution.svg +210 -0
  222. package/src/heliostat/svg/surface_space_shape.svg +98 -0
  223. package/src/heliostat/svg/swing.svg +3310 -0
  224. package/src/heliostat/svg/swing_face.svg +902 -0
  225. package/src/heliostat/svg/swing_side.svg +574 -0
  226. package/src/heliostat/svg/swing_top.svg +923 -0
  227. package/src/heliostat/svg/swing_with_rod.svg +547 -0
  228. package/src/heliostat/svg/trapeze.svg +1711 -0
  229. package/src/heliostat/svg/trapeze_rod.svg +122 -0
  230. package/src/heliostat/svg/trapeze_side.svg +361 -0
  231. package/src/heliostat/svg/trapeze_top.svg +1057 -0
  232. package/src/heliostat/swing.ts +246 -0
  233. package/src/heliostat/trapeze.ts +510 -0
  234. package/src/index.ts +33 -0
  235. package/src/svg/default_param_blank.svg +40 -0
  236. package/tsconfig.json +13 -0
  237. package/vitest.config.ts +7 -0
@@ -0,0 +1,317 @@
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 };
@@ -0,0 +1,284 @@
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 };