designix 0.5.11 → 0.5.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +6 -1
  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,409 +0,0 @@
1
- // rake_stopper.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
- designParam,
15
- checkGeom,
16
- prefixLog,
17
- contour,
18
- contourCircle,
19
- figure,
20
- //degToRad,
21
- radToDeg,
22
- ffix,
23
- pNumber,
24
- //pCheckbox,
25
- //pDropdown,
26
- initGeom,
27
- EExtrude,
28
- EBVolume
29
- } from 'geometrix';
30
-
31
- // design import
32
- import { rakeDef } from './rake';
33
-
34
- const pDef: tParamDef = {
35
- partName: 'rake_stopper',
36
- params: [
37
- //pNumber(name, unit, init, min, max, step)
38
- pNumber('D1', 'mm', 600, 100, 4000, 10),
39
- pNumber('D2', 'mm', 400, 100, 4000, 10),
40
- pNumber('D3', 'mm', 400, 100, 4000, 10),
41
- pNumber('H1', 'mm', 800, 100, 4000, 10),
42
- pNumber('H2', 'mm', 3000, 100, 6000, 10),
43
- pNumber('H3', 'mm', 400, 0, 4000, 10),
44
- pNumber('E1', 'mm', 20, 1, 80, 1),
45
- pNumber('E3', 'mm', 30, 1, 80, 1),
46
- pNumber('H4', 'mm', 200, 100, 1000, 10),
47
- pNumber('D4', 'mm', 300, 100, 1000, 10),
48
- pNumber('E4', 'mm', 20, 1, 80, 1),
49
- pNumber('H5', 'mm', 400, 100, 2000, 10),
50
- pNumber('D5', 'mm', 200, 10, 1000, 10),
51
- pNumber('L4', 'mm', 300, 10, 1000, 10),
52
- pNumber('L5', 'mm', 2000, 100, 4000, 10),
53
- pNumber('L6', 'mm', 2000, 100, 4000, 10),
54
- pNumber('D6', 'mm', 100, 10, 600, 10),
55
- pNumber('E6', 'mm', 10, 1, 80, 1),
56
- pNumber('L7', 'mm', 100, 10, 1000, 1),
57
- pNumber('L8', 'mm', 200, 10, 1000, 1),
58
- pNumber('N1', '', 24, 3, 100, 1),
59
- pNumber('D7', 'mm', 40, 1, 100, 1),
60
- pNumber('L1', 'mm', 30, 1, 300, 1),
61
- pNumber('D8', 'mm', 400, 100, 1000, 10),
62
- pNumber('H6', 'mm', 100, 50, 1000, 10),
63
- pNumber('H7', 'mm', 600, 100, 2000, 10),
64
- pNumber('L9', 'mm', 300, 100, 1000, 10),
65
- pNumber('R9', 'mm', 50, 0, 300, 1),
66
- pNumber('S1', 'mm', 100, 10, 300, 1),
67
- pNumber('S2', 'mm', 2000, 100, 8000, 10),
68
- pNumber('E7', 'mm', 5, 1, 80, 1)
69
- ],
70
- paramSvg: {
71
- D1: 'rake_face.svg',
72
- D2: 'rake_face.svg',
73
- D3: 'rake_face.svg',
74
- H1: 'rake_face.svg',
75
- H2: 'rake_face.svg',
76
- H3: 'rake_face.svg',
77
- E1: 'rake_face.svg',
78
- E3: 'rake_face.svg',
79
- H4: 'rake_side.svg',
80
- D4: 'rake_side.svg',
81
- E4: 'rake_side.svg',
82
- H5: 'rake_side.svg',
83
- D5: 'rake_side.svg',
84
- L4: 'rake_face.svg',
85
- L5: 'rake_face.svg',
86
- L6: 'rake_face.svg',
87
- D6: 'rake_face.svg',
88
- E6: 'rake_face.svg',
89
- L7: 'rake_face.svg',
90
- L8: 'rake_face.svg',
91
- N1: 'rake_top.svg',
92
- D7: 'rake_top.svg',
93
- L1: 'rake_top.svg',
94
- D8: 'rake_side.svg',
95
- H6: 'rake_door.svg',
96
- H7: 'rake_door.svg',
97
- L9: 'rake_door.svg',
98
- R9: 'rake_door.svg',
99
- S1: 'rake_side_stopper.svg',
100
- S2: 'rake_top_stopper.svg',
101
- E7: 'rake_side_stopper.svg'
102
- },
103
- sim: {
104
- tMax: 180,
105
- tStep: 0.5,
106
- tUpdate: 500 // every 0.5 second
107
- }
108
- };
109
-
110
- type tCtr2 = (width: number, height: number, xpos: number, ypos: number, angle: number) => tContour;
111
-
112
- function pGeom(t: number, param: tParamVal): tGeom {
113
- let ctrRect: tCtr2;
114
- const rGeome = initGeom(pDef.partName);
115
- const figCone = figure();
116
- const figBeam = figure();
117
- const figBeamHollow = figure();
118
- const figDisc = figure();
119
- const figHand = figure();
120
- const figWing = figure();
121
- const figWingHollow = figure();
122
- const figDoor = figure();
123
- const figStopperTop = figure();
124
- const figStopperSide = figure();
125
- const figStopperSideH = figure();
126
- const figStopperFaceT = figure();
127
- const figStopperFaceTH = figure();
128
- const figStopperFaceB = figure();
129
- const figStopperFaceBH = figure();
130
- rGeome.logstr += `${rGeome.partName} simTime: ${t}\n`;
131
- try {
132
- const R1 = param.D1 / 2;
133
- const H1H2 = param.H1 + param.H2;
134
- const H1H5 = H1H2 - param.H4 + param.H5;
135
- rGeome.logstr += `cone-height: ${ffix(H1H2)} mm\n`;
136
- rGeome.logstr += `cone-height total: ${ffix(H1H5)} mm\n`;
137
- if (2 * param.E7 >= param.S1) {
138
- throw `err135: E7 ${param.E7} too large compare to S1 ${param.S1}`;
139
- }
140
- if (param.L5 < param.D1 + 4 * param.S1) {
141
- throw `err138: L5 ${param.L5} too small compare to D1 ${param.D1} and S1 ${param.S1}`;
142
- }
143
- const stopper1H = H1H5 - param.S2;
144
- if (stopper1H < 0) {
145
- throw `err143: S2 ${param.S2} too large compare to H1H5 ${ffix(H1H5)}`;
146
- }
147
- const stopper2H = param.H1 + param.H2 - param.H4 + param.D4 / 2;
148
- const stopper3H = param.H1 + param.L8 - param.S1;
149
- ctrRect = function (
150
- width: number,
151
- height: number,
152
- xpos: number,
153
- ypos: number,
154
- angle: number
155
- ): tContour {
156
- const xWidth = width * Math.cos(angle);
157
- const yWidth = width * Math.sin(angle);
158
- const xHeight = -height * Math.sin(angle);
159
- const yHeight = height * Math.cos(angle);
160
- const rCtr = contour(xpos, ypos)
161
- .addSegStrokeA(xpos + xWidth, ypos + yWidth)
162
- .addSegStrokeA(xpos + xWidth + xHeight, ypos + yWidth + yHeight)
163
- .addSegStrokeA(xpos + xHeight, ypos + yHeight)
164
- .closeSegStroke();
165
- return rCtr;
166
- };
167
- // sub-design rake
168
- const rakeParam = designParam(rakeDef.pDef);
169
- rakeParam.setVal('D1', param.D1);
170
- rakeParam.setVal('D2', param.D2);
171
- rakeParam.setVal('D3', param.D3);
172
- rakeParam.setVal('H1', param.H1);
173
- rakeParam.setVal('H2', param.H2);
174
- rakeParam.setVal('H3', param.H3);
175
- rakeParam.setVal('E1', param.E1);
176
- rakeParam.setVal('E3', param.E3);
177
- rakeParam.setVal('H4', param.H4);
178
- rakeParam.setVal('D4', param.D4);
179
- rakeParam.setVal('E4', param.E4);
180
- rakeParam.setVal('H5', param.H5);
181
- rakeParam.setVal('D5', param.D5);
182
- rakeParam.setVal('L4', param.L4);
183
- rakeParam.setVal('L5', param.L5);
184
- rakeParam.setVal('L6', param.L6);
185
- rakeParam.setVal('D6', param.D6);
186
- rakeParam.setVal('E6', param.E6);
187
- rakeParam.setVal('L7', param.L7);
188
- rakeParam.setVal('L8', param.L8);
189
- rakeParam.setVal('N1', param.N1);
190
- rakeParam.setVal('D7', param.D7);
191
- rakeParam.setVal('L1', param.L1);
192
- rakeParam.setVal('D8', param.D8);
193
- rakeParam.setVal('H6', param.H6);
194
- rakeParam.setVal('H7', param.H7);
195
- rakeParam.setVal('L9', param.L9);
196
- rakeParam.setVal('R9', param.R9);
197
- const rakeGeom = rakeDef.pGeom(0, rakeParam.getParamVal());
198
- checkGeom(rakeGeom);
199
- rGeome.logstr += prefixLog(rakeGeom.logstr, rakeParam.partName);
200
- // figures
201
- figCone.mergeFigure(rakeGeom.fig.faceCone);
202
- figBeam.mergeFigure(rakeGeom.fig.faceBeam);
203
- figBeamHollow.mergeFigure(rakeGeom.fig.faceBeamHollow);
204
- figDisc.mergeFigure(rakeGeom.fig.faceDisc);
205
- figHand.mergeFigure(rakeGeom.fig.faceHand);
206
- figWing.mergeFigure(rakeGeom.fig.faceWing);
207
- figWingHollow.mergeFigure(rakeGeom.fig.faceWingHollow);
208
- figDoor.mergeFigure(rakeGeom.fig.faceDoor);
209
- // figStopperTop
210
- figStopperTop.mergeFigure(rakeGeom.fig.faceDisc, true);
211
- const L5h = param.L5 / 2;
212
- const S1r = param.S1 / 2;
213
- const S1h = param.S1 - 2 * param.E7;
214
- const S1hr = S1h / 2;
215
- figStopperTop.addMain(ctrRect(param.S1, param.L5, -R1 - param.S1, -L5h, 0));
216
- figStopperTop.addMain(ctrRect(S1h, param.L5, -R1 - param.E7 - S1h, -L5h, 0));
217
- figStopperTop.addMain(ctrRect(param.S1, param.L5, param.S2 - param.S1, -L5h, 0));
218
- figStopperTop.addMain(ctrRect(S1h, param.L5, param.S2 - param.E7 - S1h, -L5h, 0));
219
- const S2s = param.S2 - param.S1 / 2;
220
- figStopperTop.addMain(ctrRect(S2s, param.S1, 0, -L5h, 0));
221
- figStopperTop.addMain(ctrRect(S2s, S1h, 0, -L5h + param.E7, 0));
222
- figStopperTop.addMain(ctrRect(S2s, param.S1, 0, L5h - param.S1, 0));
223
- figStopperTop.addMain(ctrRect(S2s, S1h, 0, L5h - param.S1 + param.E7, 0));
224
- figStopperTop.addMain(ctrRect(S2s, param.S1, 0, -R1 - param.S1, 0));
225
- figStopperTop.addMain(ctrRect(S2s, S1h, 0, -R1 - param.S1 + param.E7, 0));
226
- figStopperTop.addMain(ctrRect(S2s, param.S1, 0, R1, 0));
227
- figStopperTop.addMain(ctrRect(S2s, S1h, 0, R1 + param.E7, 0));
228
- // figStopperSide
229
- figStopperSide.mergeFigure(rakeGeom.fig.faceBeam, true);
230
- figStopperSide.addMain(contourCircle(-R1 - S1r, stopper1H + S1r, S1r));
231
- figStopperSide.addMain(contourCircle(-R1 - S1r, stopper1H + S1r, S1hr));
232
- figStopperSide.addMain(contourCircle(param.S2 - S1r, stopper2H + S1r, S1r));
233
- figStopperSide.addMain(contourCircle(param.S2 - S1r, stopper2H + S1r, S1hr));
234
- figStopperSide.addSecond(ctrRect(S2s, param.S1, 0, stopper2H, 0));
235
- figStopperSide.addSecond(ctrRect(S2s, S1h, 0, stopper2H + param.E7, 0));
236
- const stopper3Ly = stopper2H + param.S1 / 2 - stopper3H;
237
- const stopper3L = Math.sqrt(S2s ** 2 + stopper3Ly ** 2);
238
- const stopper3A = Math.atan2(stopper3Ly, S2s);
239
- rGeome.logstr += `stopper-rod: L ${ffix(stopper3L)} mm, A ${ffix(
240
- radToDeg(stopper3A)
241
- )} degree\n`;
242
- const stp3posdX = S1r * Math.sin(stopper3A);
243
- const stp3posdY = S1r * Math.cos(stopper3A);
244
- const stp3posY = stopper3H - stp3posdY;
245
- figStopperSide.addSecond(ctrRect(stopper3L, param.S1, stp3posdX, stp3posY, stopper3A));
246
- const stp3posdX2 = S1hr * Math.sin(stopper3A);
247
- const stp3posdY2 = S1hr * Math.cos(stopper3A);
248
- const stp3posY2 = stopper3H - stp3posdY2;
249
- figStopperSide.addSecond(ctrRect(stopper3L, S1h, stp3posdX2, stp3posY2, stopper3A));
250
- // figStopperSideH
251
- figStopperSideH.mergeFigure(rakeGeom.fig.faceBeam, true);
252
- figStopperSideH.addSecond(contourCircle(-R1 - S1r, stopper1H + S1r, S1r));
253
- figStopperSideH.addMain(contourCircle(-R1 - S1r, stopper1H + S1r, S1hr));
254
- figStopperSideH.addSecond(contourCircle(param.S2 - S1r, stopper2H + S1r, S1r));
255
- figStopperSideH.addMain(contourCircle(param.S2 - S1r, stopper2H + S1r, S1hr));
256
- // figStopperFaceT
257
- figStopperFaceT.mergeFigure(rakeGeom.fig.faceCone, true);
258
- figStopperFaceT.addMain(contourCircle(-param.L5 / 2 + S1r, stopper2H + S1r, S1r));
259
- figStopperFaceT.addMain(contourCircle(-param.L5 / 2 + S1r, stopper2H + S1r, S1hr));
260
- figStopperFaceT.addMain(contourCircle(param.L5 / 2 - S1r, stopper2H + S1r, S1r));
261
- figStopperFaceT.addMain(contourCircle(param.L5 / 2 - S1r, stopper2H + S1r, S1hr));
262
- // figStopperFaceTH
263
- figStopperFaceTH.mergeFigure(rakeGeom.fig.faceCone, true);
264
- figStopperFaceTH.addSecond(contourCircle(-param.L5 / 2 + S1r, stopper2H + S1r, S1r));
265
- figStopperFaceTH.addMain(contourCircle(-param.L5 / 2 + S1r, stopper2H + S1r, S1hr));
266
- figStopperFaceTH.addSecond(contourCircle(param.L5 / 2 - S1r, stopper2H + S1r, S1r));
267
- figStopperFaceTH.addMain(contourCircle(param.L5 / 2 - S1r, stopper2H + S1r, S1hr));
268
- // figStopperFaceB
269
- figStopperFaceB.mergeFigure(rakeGeom.fig.faceCone, true);
270
- figStopperFaceB.addMain(contourCircle(-R1 - S1r, 0, S1r));
271
- figStopperFaceB.addMain(contourCircle(-R1 - S1r, 0, S1hr));
272
- figStopperFaceB.addMain(contourCircle(R1 + S1r, 0, S1r));
273
- figStopperFaceB.addMain(contourCircle(R1 + S1r, 0, S1hr));
274
- // figStopperFaceBH
275
- figStopperFaceBH.mergeFigure(rakeGeom.fig.faceCone, true);
276
- figStopperFaceBH.addSecond(contourCircle(-R1 - S1r, 0, S1r));
277
- figStopperFaceBH.addMain(contourCircle(-R1 - S1r, 0, S1hr));
278
- figStopperFaceBH.addSecond(contourCircle(R1 + S1r, 0, S1r));
279
- figStopperFaceBH.addMain(contourCircle(R1 + S1r, 0, S1hr));
280
- // final figure list
281
- rGeome.fig = {
282
- faceCone: figCone,
283
- faceBeam: figBeam,
284
- faceBeamHollow: figBeamHollow,
285
- faceDisc: figDisc,
286
- faceHand: figHand,
287
- faceWing: figWing,
288
- faceWingHollow: figWingHollow,
289
- faceDoor: figDoor,
290
- faceStopperTop: figStopperTop,
291
- faceStopperSide: figStopperSide,
292
- faceStopperSideH: figStopperSideH,
293
- faceStopperFaceT: figStopperFaceT,
294
- faceStopperFaceTH: figStopperFaceTH,
295
- faceStopperFaceB: figStopperFaceB,
296
- faceStopperFaceBH: figStopperFaceBH
297
- };
298
- const designName = rGeome.partName;
299
- rGeome.vol = {
300
- inherits: [
301
- {
302
- outName: `inpax_${designName}_rake`,
303
- subdesign: 'pax_rake',
304
- subgeom: rakeGeom,
305
- rotate: [0, 0, 0],
306
- translate: [0, 0, 0]
307
- }
308
- ],
309
- extrudes: [
310
- {
311
- outName: `subpax_${designName}_stpSide`,
312
- face: `${designName}_faceStopperSide`,
313
- extrudeMethod: EExtrude.eLinearOrtho,
314
- length: param.L5,
315
- rotate: [Math.PI / 2, 0, 0],
316
- translate: [0, param.L5 / 2, 0]
317
- },
318
- {
319
- outName: `subpax_${designName}_stpSideH`,
320
- face: `${designName}_faceStopperSideH`,
321
- extrudeMethod: EExtrude.eLinearOrtho,
322
- length: param.L5,
323
- rotate: [Math.PI / 2, 0, 0],
324
- translate: [0, param.L5 / 2, 0]
325
- },
326
- {
327
- outName: `subpax_${designName}_stpFaceT`,
328
- face: `${designName}_faceStopperFaceT`,
329
- extrudeMethod: EExtrude.eLinearOrtho,
330
- length: S2s,
331
- rotate: [Math.PI / 2, 0, Math.PI / 2],
332
- translate: [0, 0, 0]
333
- },
334
- {
335
- outName: `subpax_${designName}_stpFaceTH`,
336
- face: `${designName}_faceStopperFaceTH`,
337
- extrudeMethod: EExtrude.eLinearOrtho,
338
- length: S2s,
339
- rotate: [Math.PI / 2, 0, Math.PI / 2],
340
- translate: [0, 0, 0]
341
- },
342
- {
343
- outName: `subpax_${designName}_stpFaceB`,
344
- face: `${designName}_faceStopperFaceB`,
345
- extrudeMethod: EExtrude.eLinearOrtho,
346
- length: stopper3L,
347
- rotate: [Math.PI / 2 - stopper3A, 0, Math.PI / 2],
348
- translate: [0, 0, stopper3H]
349
- },
350
- {
351
- outName: `subpax_${designName}_stpFaceBH`,
352
- face: `${designName}_faceStopperFaceBH`,
353
- extrudeMethod: EExtrude.eLinearOrtho,
354
- length: stopper3L,
355
- rotate: [Math.PI / 2 - stopper3A, 0, Math.PI / 2],
356
- translate: [0, 0, stopper3H]
357
- }
358
- ],
359
- volumes: [
360
- {
361
- outName: `ipax_${designName}_plus`,
362
- boolMethod: EBVolume.eUnion,
363
- inList: [
364
- `subpax_${designName}_stpSide`,
365
- `subpax_${designName}_stpFaceT`,
366
- `subpax_${designName}_stpFaceB`
367
- ]
368
- },
369
- {
370
- outName: `ipax_${designName}_hollow`,
371
- boolMethod: EBVolume.eUnion,
372
- inList: [
373
- `subpax_${designName}_stpSideH`,
374
- `subpax_${designName}_stpFaceTH`,
375
- `subpax_${designName}_stpFaceBH`
376
- ]
377
- },
378
- {
379
- outName: `ipax_${designName}_stopper`,
380
- boolMethod: EBVolume.eSubstraction,
381
- inList: [`ipax_${designName}_plus`, `ipax_${designName}_hollow`]
382
- },
383
- {
384
- outName: `pax_${designName}`,
385
- boolMethod: EBVolume.eUnion,
386
- inList: [`inpax_${designName}_rake`, `ipax_${designName}_stopper`]
387
- }
388
- ]
389
- };
390
- // sub-design
391
- rGeome.sub = {};
392
- // finalize
393
- rGeome.logstr += 'heliostat-rake draw successfully!\n';
394
- rGeome.calcErr = false;
395
- } catch (emsg) {
396
- rGeome.logstr += emsg as string;
397
- console.log(emsg as string);
398
- }
399
- return rGeome;
400
- }
401
-
402
- const rakeStopperDef: tPageDef = {
403
- pTitle: 'Heliostat rake with stopper',
404
- pDescription: 'The rake-stopper on top of the pole-rotor of the heliostat',
405
- pDef: pDef,
406
- pGeom: pGeom
407
- };
408
-
409
- export { rakeStopperDef };
@@ -1,200 +0,0 @@
1
- // rod.ts
2
-
3
- import type {
4
- tContour,
5
- tParamDef,
6
- tParamVal,
7
- tGeom,
8
- tPageDef
9
- //tSubInst
10
- //tSubDesign
11
- } from 'geometrix';
12
- import {
13
- contour,
14
- contourCircle,
15
- figure,
16
- //degToRad,
17
- //radToDeg,
18
- ffix,
19
- pNumber,
20
- //pCheckbox,
21
- //pDropdown,
22
- initGeom,
23
- EExtrude,
24
- EBVolume
25
- } from 'geometrix';
26
-
27
- const pDef: tParamDef = {
28
- partName: 'rod',
29
- params: [
30
- //pNumber(name, unit, init, min, max, step)
31
- pNumber('L1', 'mm', 10000, 1000, 40000, 10),
32
- pNumber('L2', 'mm', 100, 10, 400, 1),
33
- pNumber('L3', 'mm', 400, 100, 1000, 1),
34
- pNumber('L4', 'mm', 600, 100, 1000, 1),
35
- pNumber('H1', 'mm', 200, 10, 4000, 1),
36
- pNumber('E1', 'mm', 2, 1, 80, 1),
37
- pNumber('E2', 'mm', 10, 1, 80, 1),
38
- pNumber('N1', '', 10, 2, 50, 1),
39
- pNumber('N3', '', 2, 1, 20, 1),
40
- pNumber('N4', '', 4, 1, 20, 1),
41
- pNumber('R3', 'mm', 100, 1, 500, 1),
42
- pNumber('D2', 'mm', 10, 5, 100, 1),
43
- pNumber('L7', 'mm', 10, 1, 300, 1)
44
- ],
45
- paramSvg: {
46
- L1: 'rod_top.svg',
47
- L2: 'rod_top.svg',
48
- L3: 'rod_top.svg',
49
- L4: 'rod_top.svg',
50
- H1: 'rod_cut.svg',
51
- E1: 'rod_cut.svg',
52
- E2: 'rod_cut.svg',
53
- N1: 'rod_top.svg',
54
- N3: 'rod_top.svg',
55
- N4: 'rod_top.svg',
56
- R3: 'rod_top.svg',
57
- D2: 'rod_plate.svg',
58
- L7: 'rod_plate.svg'
59
- },
60
- sim: {
61
- tMax: 180,
62
- tStep: 0.5,
63
- tUpdate: 500 // every 0.5 second
64
- }
65
- };
66
-
67
- type tCtr1 = (py: number) => tContour[];
68
- type tCtr2 = (py: number, ly: number) => tContour;
69
-
70
- function pGeom(t: number, param: tParamVal): tGeom {
71
- let ctrPlate: tCtr1;
72
- let ctrRod: tCtr2;
73
- const rGeome = initGeom(pDef.partName);
74
- const figCut = figure();
75
- const figPlate = figure();
76
- const figTop = figure();
77
- rGeome.logstr += `${rGeome.partName} simTime: ${t}\n`;
78
- try {
79
- const R2 = param.D2 / 2;
80
- const n3step = param.L3 / (param.N3 + 1);
81
- const n4step = param.L4 / (param.N4 + 1);
82
- rGeome.logstr += `rod-length: ${ffix(param.L1)} mm\n`;
83
- ctrPlate = function (py: number): tContour[] {
84
- const rPlate: tContour[] = [];
85
- const plateExt = contour(param.L4 / 2, py)
86
- .addCornerRounded(param.R3)
87
- .addSegStrokeA(param.L4 / 2, py + param.L3)
88
- .addCornerRounded(param.R3)
89
- .addSegStrokeA(-param.L4 / 2, py + param.L3)
90
- .addCornerRounded(param.R3)
91
- .addSegStrokeA(-param.L4 / 2, py)
92
- .addCornerRounded(param.R3)
93
- .closeSegStroke();
94
- rPlate.push(plateExt);
95
- for (let i = 1; i < param.N3 + 1; i++) {
96
- rPlate.push(contourCircle(param.L4 / 2 - param.L7, py + i * n3step, R2));
97
- rPlate.push(contourCircle(-param.L4 / 2 + param.L7, py + i * n3step, R2));
98
- }
99
- for (let i = 1; i < param.N4 + 1; i++) {
100
- rPlate.push(contourCircle(-param.L4 / 2 + i * n4step, py + param.L7, R2));
101
- rPlate.push(
102
- contourCircle(-param.L4 / 2 + i * n4step, py + param.L3 - param.L7, R2)
103
- );
104
- }
105
- return rPlate;
106
- };
107
- ctrRod = function (py: number, ly: number): tContour {
108
- const rRod = contour(param.L2 / 2, py)
109
- .addSegStrokeA(param.L2 / 2, py + ly)
110
- .addSegStrokeA(-param.L2 / 2, py + ly)
111
- .addSegStrokeA(-param.L2 / 2, py)
112
- .closeSegStroke();
113
- return rRod;
114
- };
115
- // figCut
116
- const L2h = param.L2 / 2;
117
- const L4h = param.L4 / 2;
118
- const L2hi = (param.L2 - 2 * param.E1) / 2;
119
- const H1i = param.H1 - param.E1;
120
- const ctrRodExt = contour(L2h, 0)
121
- .addSegStrokeA(L2h, param.H1)
122
- .addSegStrokeA(-L2h, param.H1)
123
- .addSegStrokeA(-L2h, 0)
124
- .closeSegStroke();
125
- const ctrRodInt = contour(L2hi, param.E1)
126
- .addSegStrokeA(L2hi, H1i)
127
- .addSegStrokeA(-L2hi, H1i)
128
- .addSegStrokeA(-L2h, param.E1)
129
- .closeSegStroke();
130
- const ctrPlateSide = contour(L4h, param.H1)
131
- .addSegStrokeA(L4h, param.H1 + param.E2)
132
- .addSegStrokeA(-L4h, param.H1 + param.E2)
133
- .addSegStrokeA(-L4h, param.H1)
134
- .closeSegStroke();
135
- figCut.addMain(ctrRodExt);
136
- figCut.addMain(ctrRodInt);
137
- figCut.addSecond(ctrPlateSide);
138
- // figPlate
139
- ctrPlate(0).forEach((ctr) => figPlate.addMain(ctr));
140
- figPlate.addSecond(ctrRod(-param.L3 / 2, 2 * param.L3));
141
- // figTop
142
- const plateStep = (param.L1 - param.L3) / (param.N1 - 1);
143
- for (let i = 0; i < param.N1; i++) {
144
- ctrPlate(i * plateStep).forEach((ctr) => figTop.addMain(ctr));
145
- }
146
- figTop.addSecond(ctrRod(0, param.L1));
147
- // final figure list
148
- rGeome.fig = {
149
- faceCut: figCut,
150
- facePlate: figPlate,
151
- faceTop: figTop
152
- };
153
- const designName = rGeome.partName;
154
- rGeome.vol = {
155
- extrudes: [
156
- {
157
- outName: `subpax_${designName}_rod`,
158
- face: `${designName}_faceCut`,
159
- extrudeMethod: EExtrude.eLinearOrtho,
160
- length: param.L1,
161
- rotate: [0, 0, 0],
162
- translate: [0, 0, 0]
163
- },
164
- {
165
- outName: `subpax_${designName}_plates`,
166
- face: `${designName}_faceTop`,
167
- extrudeMethod: EExtrude.eLinearOrtho,
168
- length: param.E2,
169
- rotate: [Math.PI / 2, 0, 0],
170
- translate: [0, param.E2 + param.H1, 0]
171
- }
172
- ],
173
- volumes: [
174
- {
175
- outName: `pax_${designName}`,
176
- boolMethod: EBVolume.eUnion,
177
- inList: [`subpax_${designName}_rod`, `subpax_${designName}_plates`]
178
- }
179
- ]
180
- };
181
- // sub-design
182
- rGeome.sub = {};
183
- // finalize
184
- rGeome.logstr += 'heliostat-rod draw successfully!\n';
185
- rGeome.calcErr = false;
186
- } catch (emsg) {
187
- rGeome.logstr += emsg as string;
188
- console.log(emsg as string);
189
- }
190
- return rGeome;
191
- }
192
-
193
- const rodDef: tPageDef = {
194
- pTitle: 'Heliostat rod',
195
- pDescription: 'The rod of an heliostat-surface',
196
- pDef: pDef,
197
- pGeom: pGeom
198
- };
199
-
200
- export { rodDef };