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,335 @@
1
+ // gear_wheel_wheel.ts
2
+
3
+ import type { tParamDef, tParamVal, tGeom, tPageDef } from 'geometrix';
4
+ //import { contour, contourCircle, figure, degToRad } from 'geometrix';
5
+ import {
6
+ contour,
7
+ figure,
8
+ degToRad,
9
+ ffix,
10
+ pNumber,
11
+ pCheckbox,
12
+ pDropdown,
13
+ initGeom,
14
+ EExtrude,
15
+ EBVolume
16
+ } from 'geometrix';
17
+ import * as gwHelper from './gearWheelProfile';
18
+ import * as welem from './wheelElements';
19
+
20
+ const pDef: tParamDef = {
21
+ partName: 'gear_wheel_wheel',
22
+ params: [
23
+ //pNumber(name, unit, init, min, max, step)
24
+ pNumber('module', 'mm', 10, 0.1, 100, 0.1),
25
+ pNumber('N1', 'scalar', 23, 3, 1000, 1),
26
+ pNumber('N2', 'scalar', 19, 3, 1000, 1),
27
+ pNumber('angleCenterCenter', 'degree', 0, -180, 180, 1),
28
+ pNumber('addInterAxis', 'mm', 0, 0, 100, 0.05),
29
+ pNumber('c1x', 'mm', 0, -200, 200, 1),
30
+ pNumber('c1y', 'mm', 0, -200, 200, 1),
31
+ pNumber('ah1', 'scalar', 1, 0.1, 2, 0.05),
32
+ pNumber('dh1', 'scalar', 1, 0.1, 2, 0.05),
33
+ pNumber('bh1', 'scalar', 0.25, 0.1, 2, 0.05),
34
+ pNumber('bRound1', 'mm', 2, 0, 50, 0.1),
35
+ pNumber('ah2', 'scalar', 1, 0.1, 2, 0.05),
36
+ pNumber('dh2', 'scalar', 1, 0.1, 2, 0.05),
37
+ pNumber('bh2', 'scalar', 0.25, 0.1, 2, 0.05),
38
+ pNumber('bRound2', 'mm', 2, 0, 50, 0.1),
39
+ pNumber('at1', '%', 50, 10, 90, 0.5),
40
+ pNumber('at2', '%', 50, 10, 90, 0.5),
41
+ pCheckbox('involSym', true),
42
+ pDropdown('involROpt', ['Optimum', 'Base-1', 'Base-2', 'PressureAngle', 'FreeBase-12']),
43
+ pDropdown('involLOpt', ['Optimum', 'Base-1', 'Base-2', 'PressureAngle', 'FreeBase-12']),
44
+ pNumber('brr1', 'mm', 50, 10, 2000, 0.05),
45
+ pNumber('brr2', 'mm', 50, 10, 2000, 0.05),
46
+ pNumber('blr1', 'mm', 50, 10, 2000, 0.05),
47
+ pNumber('blr2', 'mm', 50, 10, 2000, 0.05),
48
+ pNumber('involArcPairs1', 'scalar', 2, 1, 40, 1),
49
+ pNumber('involArcPairs2', 'scalar', 2, 1, 40, 1),
50
+ pNumber('skinThickness1', 'mm', 0, -3, 3, 0.01),
51
+ pNumber('skinThickness2', 'mm', 0, -3, 3, 0.01),
52
+ pNumber('initAngle1', 'degree', 0, -180, 180, 1),
53
+ pDropdown('gw2Position', ['right', 'left', 'center']),
54
+ pCheckbox('centralAxis', true),
55
+ pNumber('axisRadius', 'mm', 10, 0.1, 200, 0.1),
56
+ pNumber('ribNb', 'scalar', 5, 0, 32, 1),
57
+ pNumber('ribWidth', 'mm', 8, 1, 100, 0.1),
58
+ pNumber('ribHeight', 'mm', 8, 1, 100, 0.1),
59
+ pNumber('ribRound1', 'mm', 2, 0, 20, 0.1),
60
+ pNumber('ribRound2', 'mm', 2, 0, 20, 0.1),
61
+ pCheckbox('hollow', true),
62
+ pNumber('materialHeightExt', 'mm', 20, 1, 200, 0.5),
63
+ pNumber('materialHeightInt', 'mm', 15, 1, 200, 0.5),
64
+ pNumber('spokeNb', 'scalar', 5, 1, 18, 1),
65
+ pNumber('spokeWidth', 'mm', 15, 1, 200, 0.1),
66
+ pNumber('spokeRound', 'mm', 10, 0, 20, 0.1),
67
+ pCheckbox('wheelAxis', true),
68
+ pNumber('wheelHeight', 'mm', 40, 0.1, 400, 0.1),
69
+ pNumber('wheelMidExtra', 'mm', 6, 0, 10, 0.1),
70
+ pNumber('wheelAxisLength', 'mm', 40, 0, 400, 0.1),
71
+ pNumber('wheelAxisRadius', 'mm', 20, 0, 200, 0.1),
72
+ pNumber('wheelMidRadius', 'mm', 60, 0, 200, 0.1),
73
+ pNumber('wheelRadiusExtra', 'mm', 1, 0, 20, 0.1),
74
+ pNumber('wheelAxisExtRound', 'mm', 4, 0, 20, 0.1),
75
+ pNumber('wheelAxisIntRound', 'mm', 0, 0, 20, 0.1),
76
+ pNumber('wheelExtraRound', 'mm', 4, 0, 20, 0.1)
77
+ ],
78
+ paramSvg: {
79
+ module: 'default_param_blank.svg',
80
+ N1: 'default_param_blank.svg',
81
+ N2: 'default_param_blank.svg',
82
+ angleCenterCenter: 'default_param_blank.svg',
83
+ addInterAxis: 'default_param_blank.svg',
84
+ c1x: 'default_param_blank.svg',
85
+ c1y: 'default_param_blank.svg',
86
+ ah1: 'default_param_blank.svg',
87
+ dh1: 'default_param_blank.svg',
88
+ bh1: 'default_param_blank.svg',
89
+ bRound1: 'default_param_blank.svg',
90
+ ah2: 'default_param_blank.svg',
91
+ dh2: 'default_param_blank.svg',
92
+ bh2: 'default_param_blank.svg',
93
+ bRound2: 'default_param_blank.svg',
94
+ at1: 'default_param_blank.svg',
95
+ at2: 'default_param_blank.svg',
96
+ involSym: 'default_param_blank.svg',
97
+ involROpt: 'default_param_blank.svg',
98
+ involLOpt: 'default_param_blank.svg',
99
+ brr1: 'default_param_blank.svg',
100
+ brr2: 'default_param_blank.svg',
101
+ blr1: 'default_param_blank.svg',
102
+ blr2: 'default_param_blank.svg',
103
+ involArcPairs1: 'default_param_blank.svg',
104
+ skinThickness1: 'default_param_blank.svg',
105
+ involArcPairs2: 'default_param_blank.svg',
106
+ skinThickness2: 'default_param_blank.svg',
107
+ initAngle1: 'default_param_blank.svg',
108
+ gw2Position: 'default_param_blank.svg',
109
+ centralAxis: 'default_param_blank.svg',
110
+ axisRadius: 'default_param_blank.svg',
111
+ ribNb: 'default_param_blank.svg',
112
+ ribWidth: 'default_param_blank.svg',
113
+ ribHeight: 'default_param_blank.svg',
114
+ ribRound1: 'default_param_blank.svg',
115
+ ribRound2: 'default_param_blank.svg',
116
+ hollow: 'default_param_blank.svg',
117
+ materialHeightExt: 'default_param_blank.svg',
118
+ materialHeightInt: 'default_param_blank.svg',
119
+ spokeNb: 'default_param_blank.svg',
120
+ spokeWidth: 'default_param_blank.svg',
121
+ spokeRound: 'default_param_blank.svg',
122
+ wheelAxis: 'default_param_blank.svg',
123
+ wheelHeight: 'default_param_blank.svg',
124
+ wheelMidExtra: 'default_param_blank.svg',
125
+ wheelAxisLength: 'default_param_blank.svg',
126
+ wheelAxisRadius: 'default_param_blank.svg',
127
+ wheelMidRadius: 'default_param_blank.svg',
128
+ wheelRadiusExtra: 'default_param_blank.svg',
129
+ wheelAxisExtRound: 'default_param_blank.svg',
130
+ wheelAxisIntRound: 'default_param_blank.svg',
131
+ wheelExtraRound: 'default_param_blank.svg'
132
+ },
133
+ sim: {
134
+ tMax: 100,
135
+ tStep: 0.5,
136
+ tUpdate: 500 // every 0.5 second
137
+ }
138
+ };
139
+
140
+ function pGeom(t: number, param: tParamVal): tGeom {
141
+ const rGeome = initGeom(pDef.partName);
142
+ const figOne = figure();
143
+ const figTwo = figure();
144
+ rGeome.logstr += `${rGeome.partName} simTime: ${t}\n`;
145
+ try {
146
+ // Figure One
147
+ // re-arrange parameters
148
+ const gp1 = gwHelper.gwProfile();
149
+ const gp2 = gwHelper.gwProfile();
150
+ gp1.set1ModuleToothNumber(param.module, param.N1);
151
+ gp2.set1ModuleToothNumber(param.module, param.N2);
152
+ gp1.set2CenterPosition(param.c1x, param.c1y);
153
+ const acc = degToRad(param.angleCenterCenter);
154
+ const [c2x, c2y, d12] = gwHelper.gw2center(gp1, gp2, acc, param.addInterAxis);
155
+ gp2.set2CenterPosition(c2x, c2y);
156
+ gp1.set3CircleRadius(param.ah1, param.dh1, param.bh1, param.bRound1);
157
+ gp2.set3CircleRadius(param.ah2, param.dh2, param.bh2, param.bRound2);
158
+ // base circles
159
+ const [brr1, blr1, brr2, blr2] = gwHelper.baseCircles(
160
+ gp1,
161
+ gp2,
162
+ param.brr1,
163
+ param.blr1,
164
+ param.brr2,
165
+ param.blr2,
166
+ param.involSym,
167
+ param.involROpt,
168
+ param.involROpt
169
+ );
170
+ gp1.set4BaseCircles(brr1, blr1);
171
+ gp2.set4BaseCircles(brr2, blr2);
172
+ gp1.set5AddendumThickness(param.at1);
173
+ gp2.set5AddendumThickness(param.at2);
174
+ const initAngle1 = degToRad(param.initAngle1) + (t * 3 * gp1.as) / 100; // sim.tMax=100
175
+ gp1.set6Angles(initAngle1, acc);
176
+ const gearAL = gwHelper.actionLine(gp1, gp2, initAngle1, acc, d12, param.gw2Position);
177
+ gearAL.prepare();
178
+ for (const laCtr of gearAL.getContours()) {
179
+ figOne.addDynamics(laCtr);
180
+ }
181
+ figOne.addPoints(gearAL.getContactPoint());
182
+ gp2.set6Angles(gearAL.getInitAngle2(), acc + Math.PI);
183
+ rGeome.logstr += gearAL.getMsg();
184
+ gp1.set7InvoluteDetails(param.involArcPairs1, param.skinThickness1);
185
+ gp2.set7InvoluteDetails(param.involArcPairs2, param.skinThickness2);
186
+ // construction lines and circles
187
+ for (const refCircle of gp1.getRefCircles()) {
188
+ figOne.addDynamics(refCircle);
189
+ }
190
+ for (const refCircle of gp2.getRefCircles()) {
191
+ figOne.addDynamics(refCircle);
192
+ }
193
+ figOne.addDynamics(gp1.getToothRef());
194
+ figOne.addDynamics(gp2.getToothRef());
195
+ // gearwheel-1
196
+ const gp1p = gp1.getProfile();
197
+ rGeome.logstr += gp1.getMsg();
198
+ rGeome.logstr += gp1p.check();
199
+ figOne.addMain(gp1p);
200
+ if (param.centralAxis === 1) {
201
+ const g1axis = welem.axisTorque(
202
+ gp1.cx,
203
+ gp1.cy,
204
+ param.axisRadius,
205
+ param.ribNb,
206
+ param.ribWidth,
207
+ param.ribHeight,
208
+ param.ribRound1,
209
+ param.ribRound2,
210
+ initAngle1
211
+ );
212
+ rGeome.logstr += g1axis.check();
213
+ figOne.addMain(g1axis);
214
+ }
215
+ if (param.hollow === 1) {
216
+ const materialHeightExtMax = gp1.br;
217
+ const materialHeightIntMin = param.axisRadius + param.ribHeight;
218
+ const hollowMaterialExt = materialHeightExtMax - param.materialHeightExt;
219
+ const hollowMaterialInt = materialHeightIntMin + param.materialHeightInt;
220
+ if (hollowMaterialInt > hollowMaterialExt) {
221
+ throw `err902: hollowMaterialInt ${ffix(
222
+ hollowMaterialInt
223
+ )} bigger than hollowMaterialExt ${ffix(hollowMaterialExt)}`;
224
+ }
225
+ const g1hollow = welem.hollowStraight(
226
+ gp1.cx,
227
+ gp1.cy,
228
+ hollowMaterialExt,
229
+ hollowMaterialInt,
230
+ param.spokeNb,
231
+ param.spokeWidth,
232
+ param.spokeRound,
233
+ initAngle1
234
+ );
235
+ for (const g1hollowE of g1hollow) {
236
+ rGeome.logstr += g1hollowE.check();
237
+ figOne.addMain(g1hollowE);
238
+ }
239
+ }
240
+ const gp2p = gp2.getProfile();
241
+ rGeome.logstr += gp2p.check();
242
+ figOne.addSecond(gp2p);
243
+ // Figure Two
244
+ const wheelRadius = gp1.ar + param.wheelRadiusExtra;
245
+ if (param.wheelAxis === 1) {
246
+ const ctrAxisProfile_right = welem.axisProfile(
247
+ param.wheelHeight,
248
+ param.wheelMidExtra,
249
+ param.wheelAxisLength,
250
+ param.wheelAxisRadius,
251
+ param.wheelMidRadius,
252
+ wheelRadius,
253
+ param.wheelAxisExtRound,
254
+ param.wheelAxisIntRound,
255
+ param.wheelExtraRound,
256
+ true
257
+ );
258
+ const ctrAxisProfile_left = welem.axisProfile(
259
+ param.wheelHeight,
260
+ param.wheelMidExtra,
261
+ param.wheelAxisLength,
262
+ param.wheelAxisRadius,
263
+ param.wheelMidRadius,
264
+ wheelRadius,
265
+ param.wheelAxisExtRound,
266
+ param.wheelAxisIntRound,
267
+ param.wheelExtraRound,
268
+ false
269
+ );
270
+ figTwo.addMain(ctrAxisProfile_right);
271
+ figTwo.addSecond(ctrAxisProfile_left);
272
+ } else {
273
+ const ctrAxisProfile_right = contour(0, -param.wheelHeight / 2)
274
+ .addSegStrokeR(0, param.wheelHeight)
275
+ .addSegStrokeR(wheelRadius, 0)
276
+ .addSegStrokeR(0, -param.wheelHeight)
277
+ .closeSegStroke();
278
+ const ctrAxisProfile_left = contour(0, -param.wheelHeight / 2)
279
+ .addSegStrokeR(0, param.wheelHeight)
280
+ .addSegStrokeR(-wheelRadius, 0)
281
+ .addSegStrokeR(0, -param.wheelHeight)
282
+ .closeSegStroke();
283
+ figTwo.addMain(ctrAxisProfile_right);
284
+ figTwo.addSecond(ctrAxisProfile_left);
285
+ }
286
+ rGeome.fig = { teethProfile: figOne, axisProfile: figTwo };
287
+ const designName = rGeome.partName;
288
+ const axisHLength =
289
+ param.wheelHeight / 2 + param.wheelMidExtra + param.wheelAxisLength + 10;
290
+ rGeome.vol = {
291
+ extrudes: [
292
+ {
293
+ outName: `subpax_${designName}_teethProfile`,
294
+ face: `${designName}_teethProfile`,
295
+ extrudeMethod: EExtrude.eLinearOrtho,
296
+ length: 2 * axisHLength,
297
+ rotate: [0, 0, 0],
298
+ translate: [0, 0, -axisHLength]
299
+ },
300
+ {
301
+ outName: `subpax_${designName}_axisProfile`,
302
+ face: `${designName}_axisProfile`,
303
+ extrudeMethod: EExtrude.eRotate,
304
+ rotate: [0, 0, 0],
305
+ translate: [0, 0, 0]
306
+ }
307
+ ],
308
+ volumes: [
309
+ {
310
+ outName: `pax_${designName}`,
311
+ boolMethod: EBVolume.eIntersection,
312
+ inList: [
313
+ `subpax_${designName}_teethProfile`,
314
+ `subpax_${designName}_axisProfile`
315
+ ]
316
+ }
317
+ ]
318
+ };
319
+ rGeome.logstr += 'gear_wheel_wheel draw successfully!\n';
320
+ rGeome.calcErr = false;
321
+ } catch (emsg) {
322
+ rGeome.logstr += emsg as string;
323
+ console.log(emsg as string);
324
+ }
325
+ return rGeome;
326
+ }
327
+
328
+ const gearWheelWheelDef: tPageDef = {
329
+ pTitle: 'Gearwheel-gearwheel',
330
+ pDescription: 'Gear-system with two wheels',
331
+ pDef: pDef,
332
+ pGeom: pGeom
333
+ };
334
+
335
+ export { gearWheelWheelDef };
@@ -0,0 +1,21 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { involute } from './involute';
3
+
4
+ function degToRad(deg: number): number {
5
+ return (deg / 180) * Math.PI;
6
+ }
7
+
8
+ describe('involute module', () => {
9
+ it('lFromU', () => {
10
+ expect(involute(0, 0, 50, degToRad(30), true).lFromU(0)).toBeCloseTo(50);
11
+ expect(involute(0, 0, 50, degToRad(30), true).lFromU(degToRad(10))).toBeCloseTo(50.7558307);
12
+ });
13
+ it('ptcta', () => {
14
+ expect(involute(0, 0, 50, degToRad(20), true).ptcta(degToRad(10))).toBeCloseTo(
15
+ degToRad(30)
16
+ );
17
+ expect(involute(0, 0, 50, degToRad(20), true).ptcta(degToRad(15))).toBeCloseTo(
18
+ degToRad(35)
19
+ );
20
+ });
21
+ });
@@ -0,0 +1,113 @@
1
+ // involute.ts
2
+ // the formula related to involute of circle
3
+
4
+ class Involute {
5
+ base_center_x: number;
6
+ base_center_y: number;
7
+ base_radius: number;
8
+ initial_angle: number;
9
+ right_nleft: boolean;
10
+ constructor(cx: number, cy: number, br: number, ia: number, rnl: boolean) {
11
+ this.base_center_x = cx;
12
+ this.base_center_y = cy;
13
+ this.base_radius = br;
14
+ this.initial_angle = ia;
15
+ this.right_nleft = rnl;
16
+ }
17
+ // local polar coordinates (base circle center sets at x:0,y:0)
18
+ angleSign(): number {
19
+ const sign = this.right_nleft ? 1 : -1;
20
+ return sign;
21
+ }
22
+ lFromU(au: number): number {
23
+ const rl = this.base_radius * Math.sqrt(1 + au ** 2);
24
+ return rl;
25
+ }
26
+ wFromU(au: number): number {
27
+ if (au < 0) {
28
+ throw `err729: involute parameter au ${au} is negative`;
29
+ }
30
+ if (Math.abs(au) > Math.PI / 2) {
31
+ throw `err730: involute parameter au ${au} is larger than PI/2`;
32
+ }
33
+ const sign = this.angleSign();
34
+ const rw = sign * (au - Math.atan(au));
35
+ return rw;
36
+ }
37
+ w2FromU(au: number): number {
38
+ const rw2 = this.initial_angle + this.wFromU(au);
39
+ return rw2;
40
+ }
41
+ // Point C of the involute in cartesian coordinates
42
+ ptc(au: number): number[] {
43
+ const lcl = this.lFromU(au);
44
+ const lcw = this.w2FromU(au);
45
+ const ptcx = this.base_center_x + Math.cos(lcw) * lcl;
46
+ const ptcy = this.base_center_y + Math.sin(lcw) * lcl;
47
+ return [ptcx, ptcy];
48
+ }
49
+ // angle of the tangent inclination of the Point C of the involute
50
+ ptcta(au: number): number {
51
+ const rta = this.initial_angle + this.angleSign() * au;
52
+ return rta;
53
+ }
54
+ // get u from L
55
+ uFromL(ll: number): number {
56
+ const ru = Math.sqrt(ll ** 2 / this.base_radius ** 2 - 1);
57
+ return ru;
58
+ }
59
+ // get u from w
60
+ uFromWslow(lw: number): number {
61
+ const tolerance = 10 ** -4;
62
+ let itu = Math.PI / 3;
63
+ let itdu = itu / 2;
64
+ let itw = this.wFromU(itu);
65
+ let itcnt = 0;
66
+ while (Math.abs(itw - lw) > tolerance) {
67
+ if (itw < lw) {
68
+ itu += itdu;
69
+ } else {
70
+ itu -= itdu;
71
+ }
72
+ itw = this.wFromU(itu);
73
+ itdu = itdu / 2;
74
+ itcnt += 1;
75
+ }
76
+ console.log(`dbg072: uFromWslow itcnt ${itcnt}`);
77
+ return itu;
78
+ }
79
+ // line of action
80
+ // acc: angle of center-center line (rad)
81
+ // ap: angle of pressue relative to the center-center line (rad)
82
+ // aj: angle of rotation from the start of the line of action (rad)
83
+ // sJ: angular speed of rotations (rad/s)
84
+ // return
85
+ // x,y of point C
86
+ // vpx, vpy of speed vector of point C in line of pressure reference
87
+ laptc(acc: number, ap: number, aj: number, sJ: number): number[] {
88
+ if (Math.sign(ap) * this.angleSign() < 0) {
89
+ throw `err904: Invole.laptc angle-of-pressure ${ap} not compatible with right_nleft ${this.right_nleft}`;
90
+ }
91
+ const C0a = acc + ap;
92
+ const C0x = this.base_center_x + Math.cos(C0a) * this.base_radius;
93
+ const C0y = this.base_center_y + Math.sin(C0a) * this.base_radius;
94
+ const C2a = C0a - (this.angleSign() * Math.PI) / 2;
95
+ const lBC = aj * this.base_radius;
96
+ const C2x = C0x + Math.cos(C2a) * lBC;
97
+ const C2y = C0y + Math.sin(C2a) * lBC;
98
+ const lL = this.lFromU(aj);
99
+ const speed = lL * sJ;
100
+ const aspeed = aj;
101
+ const vpx = Math.cos(aspeed) * speed;
102
+ const vpy = Math.sin(aspeed) * speed;
103
+ return [C2x, C2y, vpx, vpy];
104
+ }
105
+ }
106
+
107
+ function involute(cx: number, cy: number, br: number, ia: number, rnl: boolean): Involute {
108
+ const rinvolute = new Involute(cx, cy, br, ia, rnl);
109
+ return rinvolute;
110
+ }
111
+
112
+ export type { Involute };
113
+ export { involute };