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,335 +0,0 @@
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 };
@@ -1,21 +0,0 @@
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
- });
@@ -1,113 +0,0 @@
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 };