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,486 +0,0 @@
1
- // rake.ts
2
-
3
- import type {
4
- tContour,
5
- tParamDef,
6
- tParamVal,
7
- tGeom,
8
- tExtrude,
9
- tPageDef
10
- //tSubInst
11
- //tSubDesign
12
- } from 'geometrix';
13
- import {
14
- contour,
15
- contourCircle,
16
- figure,
17
- //degToRad,
18
- radToDeg,
19
- ffix,
20
- pNumber,
21
- //pCheckbox,
22
- //pDropdown,
23
- initGeom,
24
- EExtrude,
25
- EBVolume
26
- } from 'geometrix';
27
-
28
- const pDef: tParamDef = {
29
- partName: 'rake',
30
- params: [
31
- //pNumber(name, unit, init, min, max, step)
32
- pNumber('D1', 'mm', 600, 100, 4000, 10),
33
- pNumber('D2', 'mm', 400, 100, 4000, 10),
34
- pNumber('D3', 'mm', 400, 100, 4000, 10),
35
- pNumber('H1', 'mm', 800, 100, 4000, 10),
36
- pNumber('H2', 'mm', 3000, 100, 6000, 10),
37
- pNumber('H3', 'mm', 400, 0, 4000, 10),
38
- pNumber('E1', 'mm', 20, 1, 80, 1),
39
- pNumber('E3', 'mm', 30, 1, 80, 1),
40
- pNumber('H4', 'mm', 400, 100, 1000, 10),
41
- pNumber('D4', 'mm', 300, 100, 1000, 10),
42
- pNumber('E4', 'mm', 20, 1, 80, 1),
43
- pNumber('H5', 'mm', 1000, 100, 2000, 10),
44
- pNumber('D5', 'mm', 200, 10, 1000, 10),
45
- pNumber('L4', 'mm', 300, 10, 1000, 10),
46
- pNumber('L5', 'mm', 2000, 100, 4000, 10),
47
- pNumber('L6', 'mm', 2000, 100, 4000, 10),
48
- pNumber('D6', 'mm', 100, 10, 600, 10),
49
- pNumber('E6', 'mm', 10, 1, 80, 1),
50
- pNumber('L7', 'mm', 100, 10, 1000, 1),
51
- pNumber('L8', 'mm', 200, 10, 1000, 1),
52
- pNumber('N1', '', 24, 3, 100, 1),
53
- pNumber('D7', 'mm', 40, 1, 100, 1),
54
- pNumber('L1', 'mm', 30, 1, 300, 1),
55
- pNumber('D8', 'mm', 400, 100, 1000, 10),
56
- pNumber('H6', 'mm', 100, 50, 1000, 10),
57
- pNumber('H7', 'mm', 600, 100, 2000, 10),
58
- pNumber('L9', 'mm', 300, 100, 1000, 10),
59
- pNumber('R9', 'mm', 50, 0, 300, 1)
60
- ],
61
- paramSvg: {
62
- D1: 'rake_face.svg',
63
- D2: 'rake_face.svg',
64
- D3: 'rake_face.svg',
65
- H1: 'rake_face.svg',
66
- H2: 'rake_face.svg',
67
- H3: 'rake_face.svg',
68
- E1: 'rake_face.svg',
69
- E3: 'rake_face.svg',
70
- H4: 'rake_side.svg',
71
- D4: 'rake_side.svg',
72
- E4: 'rake_side.svg',
73
- H5: 'rake_side.svg',
74
- D5: 'rake_side.svg',
75
- L4: 'rake_face.svg',
76
- L5: 'rake_face.svg',
77
- L6: 'rake_face.svg',
78
- D6: 'rake_face.svg',
79
- E6: 'rake_face.svg',
80
- L7: 'rake_face.svg',
81
- L8: 'rake_face.svg',
82
- N1: 'rake_top.svg',
83
- D7: 'rake_top.svg',
84
- L1: 'rake_top.svg',
85
- D8: 'rake_side.svg',
86
- H6: 'rake_door.svg',
87
- H7: 'rake_door.svg',
88
- L9: 'rake_door.svg',
89
- R9: 'rake_door.svg'
90
- },
91
- sim: {
92
- tMax: 180,
93
- tStep: 0.5,
94
- tUpdate: 500 // every 0.5 second
95
- }
96
- };
97
-
98
- type tCtr1 = (orient: number) => tContour;
99
- type tCtr2 = (width: number, height: number, xpos: number, ypos: number, angle: number) => tContour;
100
-
101
- function pGeom(t: number, param: tParamVal): tGeom {
102
- let ctrCone: tCtr1;
103
- let ctrConePlus: tCtr1;
104
- let ctrRect: tCtr2;
105
- const rGeome = initGeom(pDef.partName);
106
- const figCone = figure();
107
- const figBeam = figure();
108
- const figBeamHollow = figure();
109
- const figDisc = figure();
110
- const figHand = figure();
111
- const figWing = figure();
112
- const figWingHollow = figure();
113
- const figDoor = figure();
114
- rGeome.logstr += `${rGeome.partName} simTime: ${t}\n`;
115
- try {
116
- const R1 = param.D1 / 2;
117
- const R2 = param.D2 / 2;
118
- const R3 = param.D3 / 2;
119
- const R4 = param.D4 / 2;
120
- const R5 = param.D5 / 2;
121
- const R6 = param.D6 / 2;
122
- const R7 = param.D7 / 2;
123
- const R8 = param.D8 / 2;
124
- const H1H2 = param.H1 + param.H2;
125
- const H1H5 = H1H2 - param.H4 + param.H5;
126
- rGeome.logstr += `cone-height: ${ffix(H1H2)} mm\n`;
127
- rGeome.logstr += `cone-height total: ${ffix(H1H5)} mm\n`;
128
- if (param.D2 > param.D1) {
129
- throw `err110: D2 ${param.D2} is larger than D1 ${param.D1}`;
130
- }
131
- if (param.D3 + param.E1 > param.D1) {
132
- throw `err113: D3 ${param.D3} is too large compare to D1 ${param.D1} and E1 ${param.E1}`;
133
- }
134
- if (param.H3 + param.E3 > param.H1) {
135
- throw `err116: H3 ${param.H3} is too large compare to H1 ${param.H1} and E3 ${param.E3}`;
136
- }
137
- if (param.H4 + R4 > param.H2) {
138
- throw `err119: H4 ${param.H4} is too large compare to H2 ${param.H2} and D4 ${param.D4}`;
139
- }
140
- if (param.E4 > R4) {
141
- throw `err122: E4 ${param.E4} is too large compare to D4 ${param.D4}`;
142
- }
143
- if (param.D8 <= param.D5) {
144
- throw `err146: D8 ${param.D8} is too small compare to D5 ${param.D5}`;
145
- }
146
- const beamL = 4 * param.L4 + param.L5 + 2 * param.L6;
147
- const beamH = param.H1 + param.H2 - param.H4;
148
- const handLowX = R4 * Math.cos(Math.PI / 6);
149
- const handLowY = R4 * Math.sin(Math.PI / 6);
150
- const handHighXint = R5 * Math.cos(Math.PI / 6);
151
- const handHighYint = R5 * Math.sin(Math.PI / 6);
152
- const handHighXext = R8 * Math.cos(Math.PI / 6);
153
- const handHighYext = R8 * Math.sin(Math.PI / 6);
154
- const handPos = [-beamL / 2, -param.L5 / 2 - param.L4, param.L5 / 2, beamL / 2 - param.L4];
155
- const wingLy = param.H2 - param.L8 - param.H4 - R4;
156
- if (wingLy < 0) {
157
- throw `err140: H2 ${param.H2} too small compare to L8 ${param.L8}, H4 ${param.H4} and D4 ${param.D4}`;
158
- }
159
- const coneAngle = Math.atan2(R1 - R2, param.H2);
160
- rGeome.logstr += `cone-angle: ${ffix(radToDeg(coneAngle))} degree\n`;
161
- const wingLx = beamL / 2 - param.L7 - R1 + param.L8 * Math.tan(coneAngle);
162
- const wingL = Math.sqrt(wingLx ** 2 + wingLy ** 2);
163
- const wingAngle = Math.atan2(wingLx, wingLy);
164
- rGeome.logstr += `wing-angle: ${ffix(radToDeg(wingAngle))} degree\n`;
165
- const wingLPre = param.E1 / Math.sin(wingAngle + coneAngle);
166
- const wingL2 = wingL + param.E4 / Math.cos(wingAngle) + wingLPre;
167
- const wingPosX = R1 - param.L8 * Math.tan(coneAngle) - wingLPre * Math.sin(wingAngle);
168
- const wingPosY = param.H1 + param.L8 - wingLPre * Math.cos(wingAngle);
169
- const wingCPosX = wingPosX - R6 * Math.cos(wingAngle);
170
- const wingCPosY = wingPosY + R6 * Math.sin(wingAngle);
171
- const wingHR = R6 - param.E6;
172
- const wingHPosX = wingPosX - param.E6 * Math.cos(wingAngle);
173
- const wingHPosY = wingPosY + param.E6 * Math.sin(wingAngle);
174
- const wingAngleC = Math.PI / 2 - wingAngle;
175
- const doorLowX = param.L9 / 2;
176
- const doorHighX = doorLowX - param.H7 * Math.tan(coneAngle);
177
- if (doorHighX < param.R9) {
178
- throw `err177: R9 ${param.R9} too large compare to coneAngle and L9 ${param.L9}`;
179
- }
180
- if (param.L9 > param.D1) {
181
- throw `err180: L9 ${param.L9} too large compare to D1 ${param.D1}`;
182
- }
183
- // figCone
184
- const coneSlopeX = param.E1 * Math.cos(coneAngle);
185
- const coneSlopeY = param.E1 * Math.sin(coneAngle);
186
- const coneFC = param.E1 * Math.tan(coneAngle / 2);
187
- ctrCone = function (orient: number): tContour {
188
- const rCtr = contour(orient * R1, 0)
189
- .addSegStrokeA(orient * R1, param.H1)
190
- .addSegStrokeA(orient * R2, H1H2)
191
- .addSegStrokeA(orient * (R2 - coneSlopeX), H1H2 - coneSlopeY)
192
- .addSegStrokeA(orient * (R1 - param.E1), param.H1 - coneFC)
193
- .addSegStrokeA(orient * (R1 - param.E1), 0)
194
- .closeSegStroke();
195
- return rCtr;
196
- };
197
- ctrConePlus = function (orient: number): tContour {
198
- const rCtr = contour(orient * R1, 0)
199
- .addSegStrokeA(orient * R1, param.H1)
200
- .addSegStrokeA(orient * R2, H1H2)
201
- .addSegStrokeA(orient * (R2 - coneSlopeX), H1H2 - coneSlopeY)
202
- .addSegStrokeA(orient * (R1 - param.E1), param.H1 - coneFC)
203
- .addSegStrokeA(orient * (R1 - param.E1), param.H1 - param.H3)
204
- .addSegStrokeA(orient * R3, param.H1 - param.H3)
205
- .addSegStrokeA(orient * R3, param.H1 - param.H3 - param.E3)
206
- .addSegStrokeA(orient * (R1 - param.E1), param.H1 - param.H3 - param.E3)
207
- .addSegStrokeA(orient * (R1 - param.E1), 0)
208
- .closeSegStroke();
209
- return rCtr;
210
- };
211
- ctrRect = function (
212
- width: number,
213
- height: number,
214
- xpos: number,
215
- ypos: number,
216
- angle: number
217
- ): tContour {
218
- const xWidth = width * Math.cos(angle);
219
- const yWidth = width * Math.sin(angle);
220
- const xHeight = -height * Math.sin(angle);
221
- const yHeight = height * Math.cos(angle);
222
- const rCtr = contour(xpos, ypos)
223
- .addSegStrokeA(xpos + xWidth, ypos + yWidth)
224
- .addSegStrokeA(xpos + xWidth + xHeight, ypos + yWidth + yHeight)
225
- .addSegStrokeA(xpos + xHeight, ypos + yHeight)
226
- .closeSegStroke();
227
- return rCtr;
228
- };
229
- const ctrDoor = contour(doorLowX, param.H1 + param.H6)
230
- .addCornerRounded(param.R9)
231
- .addSegStrokeA(doorHighX, param.H1 + param.H6 + param.H7)
232
- .addCornerRounded(param.R9)
233
- .addSegStrokeA(-doorHighX, param.H1 + param.H6 + param.H7)
234
- .addCornerRounded(param.R9)
235
- .addSegStrokeA(-doorLowX, param.H1 + param.H6)
236
- .addCornerRounded(param.R9)
237
- .closeSegStroke();
238
- figCone.addMain(ctrCone(1));
239
- figCone.addSecond(ctrConePlus(1));
240
- figCone.addSecond(ctrConePlus(-1));
241
- //figCone.addSecond(contourCircle(0, beamH, R4));
242
- //figCone.addSecond(contourCircle(0, beamH, R4 - param.E4));
243
- figCone.addSecond(ctrRect(beamL, param.D4, -beamL / 2, beamH - R4, 0)); // beam-ext
244
- figCone.addSecond(
245
- ctrRect(beamL, param.D4 - 2 * param.E4, -beamL / 2, beamH - R4 + param.E4, 0)
246
- ); // beam-int
247
- for (const posX of handPos) {
248
- figCone.addSecond(
249
- ctrRect(param.L4, param.H5 - handLowY - handHighYint, posX, beamH + handLowY, 0)
250
- );
251
- }
252
- figCone.addSecond(ctrRect(wingL2, 2 * R6, wingPosX, wingPosY, wingAngleC)); // wing-right
253
- figCone.addSecond(ctrRect(wingL2, 2 * wingHR, wingHPosX, wingHPosY, wingAngleC));
254
- figCone.addSecond(ctrRect(2 * R6, wingL2, -wingPosX, wingPosY, wingAngle)); // wing-left
255
- figCone.addSecond(ctrRect(2 * wingHR, wingL2, -wingHPosX, wingHPosY, wingAngle));
256
- figCone.addSecond(ctrDoor);
257
- // figBeam
258
- const ctrHand = contour(handLowX, beamH + handLowY)
259
- .addSegStrokeA(handHighXext, beamH + param.H5 - handHighYext)
260
- .addSegStrokeA(handHighXint, beamH + param.H5 - handHighYint)
261
- .addPointA(-handHighXint, beamH + param.H5 - handHighYint)
262
- .addSegArc(R5, false, false)
263
- .addSegStrokeA(-handHighXext, beamH + param.H5 - handHighYext)
264
- .addSegStrokeA(-handLowX, beamH + handLowY)
265
- .closeSegArc(R4, false, false);
266
- figBeam.addMain(contourCircle(0, beamH, R4));
267
- figBeam.addMain(contourCircle(0, beamH, R4 - param.E4));
268
- figBeam.addSecond(ctrConePlus(1));
269
- figBeam.addSecond(ctrConePlus(-1));
270
- figBeam.addSecond(ctrHand);
271
- figBeam.addSecond(contourCircle(0, beamH + param.H5, R5));
272
- figBeam.addSecond(ctrRect(2 * R6, wingLy, -R6, param.H1 + param.L8, 0)); // wing
273
- figBeam.addSecond(ctrRect(2 * wingHR, wingLy, -wingHR, param.H1 + param.L8, 0));
274
- figBeam.addSecond(ctrDoor);
275
- // figBeamHollow
276
- figBeamHollow.addMain(contourCircle(0, beamH, R4 - param.E4));
277
- figBeamHollow.addSecond(contourCircle(0, beamH, R4));
278
- figBeamHollow.addSecond(ctrHand);
279
- // figDisc
280
- figDisc.addMain(contourCircle(0, 0, R1));
281
- figDisc.addMain(contourCircle(0, 0, R3));
282
- const posR = R3 + param.L1;
283
- const posA = (2 * Math.PI) / param.N1;
284
- for (let i = 0; i < param.N1; i++) {
285
- const posX = posR * Math.cos(i * posA);
286
- const posY = posR * Math.sin(i * posA);
287
- figDisc.addMain(contourCircle(posX, posY, R7));
288
- }
289
- figDisc.addSecond(contourCircle(0, 0, R1 - param.E1));
290
- figDisc.addSecond(contourCircle(0, 0, R2));
291
- figDisc.addSecond(ctrRect(param.D4, beamL, -R4, -beamL / 2, 0)); // beam-ext
292
- figDisc.addSecond(ctrRect(param.D4 - 2 * param.E4, beamL, -R4 + param.E4, -beamL / 2, 0)); // beam-int
293
- for (const posX of handPos) {
294
- figDisc.addSecond(ctrRect(2 * handLowX, param.L4, -handLowX, posX, 0));
295
- figDisc.addSecond(ctrRect(2 * handHighXint, param.L4, -handHighXint, posX, 0));
296
- figDisc.addSecond(ctrRect(2 * handHighXext, param.L4, -handHighXext, posX, 0));
297
- }
298
- figDisc.addSecond(ctrRect(2 * R6, wingLx, -R6, R1 - param.L8 * Math.tan(coneAngle), 0)); // wing-right
299
- figDisc.addSecond(
300
- ctrRect(2 * wingHR, wingLx, -wingHR, R1 - param.L8 * Math.tan(coneAngle), 0)
301
- );
302
- figDisc.addSecond(
303
- ctrRect(2 * R6, wingLx, -R6, -R1 + param.L8 * Math.tan(coneAngle) - wingLx, 0)
304
- ); // wing-left
305
- figDisc.addSecond(
306
- ctrRect(2 * wingHR, wingLx, -wingHR, -R1 + param.L8 * Math.tan(coneAngle) - wingLx, 0)
307
- );
308
- // figHand
309
- figHand.addMain(ctrHand);
310
- figHand.addSecond(contourCircle(0, beamH, R4));
311
- figHand.addSecond(contourCircle(0, beamH, R4 - param.E4));
312
- figHand.addSecond(contourCircle(0, beamH + param.H5, R5));
313
- // figWing
314
- figWing.addMain(contourCircle(0, 0, R6));
315
- figWing.addMain(contourCircle(0, 0, wingHR));
316
- // figWingHollow
317
- figWingHollow.addSecond(contourCircle(0, 0, R6));
318
- figWingHollow.addMain(contourCircle(0, 0, wingHR));
319
- // figDoor
320
- figDoor.addMain(ctrDoor);
321
- figDoor.addSecond(ctrConePlus(1));
322
- figDoor.addSecond(ctrConePlus(-1));
323
- figDoor.addSecond(ctrRect(beamL, param.D4, -beamL / 2, beamH - R4, 0)); // beam-ext
324
- figDoor.addSecond(
325
- ctrRect(beamL, param.D4 - 2 * param.E4, -beamL / 2, beamH - R4 + param.E4, 0)
326
- ); // beam-int
327
- for (const posX of handPos) {
328
- figDoor.addSecond(
329
- ctrRect(param.L4, param.H5 - handLowY - handHighYint, posX, beamH + handLowY, 0)
330
- );
331
- }
332
- figDoor.addSecond(ctrRect(wingL2, 2 * R6, wingPosX, wingPosY, wingAngleC)); // wing-right
333
- figDoor.addSecond(ctrRect(wingL2, 2 * wingHR, wingHPosX, wingHPosY, wingAngleC));
334
- figDoor.addSecond(ctrRect(2 * R6, wingL2, -wingPosX, wingPosY, wingAngle)); // wing-left
335
- figDoor.addSecond(ctrRect(2 * wingHR, wingL2, -wingHPosX, wingHPosY, wingAngle));
336
- // final figure list
337
- rGeome.fig = {
338
- faceCone: figCone,
339
- faceBeam: figBeam,
340
- faceBeamHollow: figBeamHollow,
341
- faceDisc: figDisc,
342
- faceHand: figHand,
343
- faceWing: figWing,
344
- faceWingHollow: figWingHollow,
345
- faceDoor: figDoor
346
- };
347
- const designName = rGeome.partName;
348
- const preExtrude = handPos.map((posX, idx) => {
349
- const rHand: tExtrude = {
350
- outName: `subpax_${designName}_hand_${idx}`,
351
- face: `${designName}_faceHand`,
352
- extrudeMethod: EExtrude.eLinearOrtho,
353
- length: param.L4,
354
- rotate: [Math.PI / 2, 0, 0],
355
- translate: [0, -posX, 0]
356
- };
357
- return rHand;
358
- });
359
- rGeome.vol = {
360
- extrudes: [
361
- {
362
- outName: `subpax_${designName}_cone`,
363
- face: `${designName}_faceCone`,
364
- extrudeMethod: EExtrude.eRotate,
365
- rotate: [0, 0, 0],
366
- translate: [0, 0, 0]
367
- },
368
- {
369
- outName: `subpax_${designName}_beam`,
370
- face: `${designName}_faceBeam`,
371
- extrudeMethod: EExtrude.eLinearOrtho,
372
- length: beamL,
373
- rotate: [Math.PI / 2, 0, 0],
374
- translate: [0, beamL / 2, 0]
375
- },
376
- {
377
- outName: `subpax_${designName}_beamHollow`,
378
- face: `${designName}_faceBeamHollow`,
379
- extrudeMethod: EExtrude.eLinearOrtho,
380
- length: beamL,
381
- rotate: [Math.PI / 2, 0, 0],
382
- translate: [0, beamL / 2, 0]
383
- },
384
- {
385
- outName: `subpax_${designName}_disc`,
386
- face: `${designName}_faceDisc`,
387
- extrudeMethod: EExtrude.eLinearOrtho,
388
- length: param.E3,
389
- rotate: [0, 0, 0],
390
- translate: [0, 0, param.H1 - param.H3 - param.E3]
391
- },
392
- {
393
- outName: `subpax_${designName}_wing_right`,
394
- face: `${designName}_faceWing`,
395
- extrudeMethod: EExtrude.eLinearOrtho,
396
- length: wingL2,
397
- rotate: [-wingAngle, 0, 0],
398
- translate: [0, wingCPosX, wingCPosY]
399
- },
400
- {
401
- outName: `subpax_${designName}_wing_left`,
402
- face: `${designName}_faceWing`,
403
- extrudeMethod: EExtrude.eLinearOrtho,
404
- length: wingL2,
405
- rotate: [wingAngle, 0, 0],
406
- translate: [0, -wingCPosX, wingCPosY]
407
- },
408
- {
409
- outName: `subpax_${designName}_wing_hollow_right`,
410
- face: `${designName}_faceWingHollow`,
411
- extrudeMethod: EExtrude.eLinearOrtho,
412
- length: wingL2,
413
- rotate: [-wingAngle, 0, 0],
414
- translate: [0, wingCPosX, wingCPosY]
415
- },
416
- {
417
- outName: `subpax_${designName}_wing_hollow_left`,
418
- face: `${designName}_faceWingHollow`,
419
- extrudeMethod: EExtrude.eLinearOrtho,
420
- length: wingL2,
421
- rotate: [wingAngle, 0, 0],
422
- translate: [0, -wingCPosX, wingCPosY]
423
- },
424
- {
425
- outName: `subpax_${designName}_door`,
426
- face: `${designName}_faceDoor`,
427
- extrudeMethod: EExtrude.eLinearOrtho,
428
- length: param.D1,
429
- rotate: [Math.PI / 2, 0, Math.PI / 2],
430
- translate: [0, 0, 0]
431
- },
432
- ...preExtrude
433
- ],
434
- volumes: [
435
- {
436
- outName: `ipax_${designName}_plus`,
437
- boolMethod: EBVolume.eUnion,
438
- inList: [
439
- `subpax_${designName}_cone`,
440
- `subpax_${designName}_beam`,
441
- `subpax_${designName}_disc`,
442
- `subpax_${designName}_hand_0`,
443
- `subpax_${designName}_hand_1`,
444
- `subpax_${designName}_hand_2`,
445
- `subpax_${designName}_hand_3`,
446
- `subpax_${designName}_wing_right`,
447
- `subpax_${designName}_wing_left`
448
- ]
449
- },
450
- {
451
- outName: `ipax_${designName}_hollow`,
452
- boolMethod: EBVolume.eUnion,
453
- inList: [
454
- `subpax_${designName}_beamHollow`,
455
- `subpax_${designName}_wing_hollow_right`,
456
- `subpax_${designName}_wing_hollow_left`,
457
- `subpax_${designName}_door`
458
- ]
459
- },
460
- {
461
- outName: `pax_${designName}`,
462
- boolMethod: EBVolume.eSubstraction,
463
- inList: [`ipax_${designName}_plus`, `ipax_${designName}_hollow`]
464
- }
465
- ]
466
- };
467
- // sub-design
468
- rGeome.sub = {};
469
- // finalize
470
- rGeome.logstr += 'heliostat-rake draw successfully!\n';
471
- rGeome.calcErr = false;
472
- } catch (emsg) {
473
- rGeome.logstr += emsg as string;
474
- console.log(emsg as string);
475
- }
476
- return rGeome;
477
- }
478
-
479
- const rakeDef: tPageDef = {
480
- pTitle: 'Heliostat rake',
481
- pDescription: 'The rake on top of the pole-rotor of the heliostat',
482
- pDef: pDef,
483
- pGeom: pGeom
484
- };
485
-
486
- export { rakeDef };