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,510 +0,0 @@
1
- // trapeze.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: 'trapeze',
29
- params: [
30
- //pNumber(name, unit, init, min, max, step)
31
- pNumber('L1', 'mm', 1600, 100, 4000, 10),
32
- pNumber('L2', 'mm', 1000, 100, 4000, 10),
33
- pNumber('L3', 'mm', 400, 100, 800, 10),
34
- pNumber('L4', 'mm', 300, 100, 800, 10),
35
- pNumber('N1', '', 7, 1, 20, 1),
36
- pNumber('N2', '', 4, 1, 20, 1),
37
- pNumber('N3', '', 2, 1, 20, 1),
38
- pNumber('N4', '', 2, 1, 20, 1),
39
- pNumber('L5', 'mm', 100, 1, 400, 1),
40
- pNumber('L6', 'mm', 20, 1, 400, 1),
41
- pNumber('L7', 'mm', 20, 1, 400, 1),
42
- pNumber('D1', 'mm', 10, 1, 40, 10),
43
- pNumber('D2', 'mm', 10, 1, 40, 10),
44
- pNumber('D3', 'mm', 30, 1, 100, 10),
45
- pNumber('D4', 'mm', 26, 1, 100, 10),
46
- pNumber('R1', 'mm', 60, 1, 400, 1),
47
- pNumber('R2', 'mm', 20, 1, 400, 1),
48
- pNumber('R3', 'mm', 20, 1, 400, 1),
49
- pNumber('H1', 'mm', 300, 0.5, 800, 0.5),
50
- pNumber('H2', 'mm', 2, 0.5, 800, 0.5),
51
- pNumber('H3', 'mm', 5, 0.5, 800, 0.5)
52
- ],
53
- paramSvg: {
54
- L1: 'trapeze_top.svg',
55
- L2: 'trapeze_top.svg',
56
- L3: 'trapeze_top.svg',
57
- L4: 'trapeze_top.svg',
58
- N1: 'trapeze_top.svg',
59
- N2: 'trapeze_top.svg',
60
- N3: 'trapeze_top.svg',
61
- N4: 'trapeze_top.svg',
62
- L5: 'trapeze_top.svg',
63
- L6: 'trapeze_top.svg',
64
- L7: 'trapeze_top.svg',
65
- D1: 'trapeze_top.svg',
66
- D2: 'trapeze_top.svg',
67
- D3: 'trapeze_rod.svg',
68
- D4: 'trapeze_rod.svg',
69
- R1: 'trapeze_top.svg',
70
- R2: 'trapeze_top.svg',
71
- R3: 'trapeze_top.svg',
72
- H1: 'trapeze_side.svg',
73
- H2: 'trapeze_side.svg',
74
- H3: 'trapeze_side.svg'
75
- },
76
- sim: {
77
- tMax: 180,
78
- tStep: 0.5,
79
- tUpdate: 500 // every 0.5 second
80
- }
81
- };
82
-
83
- type tCtr1 = (px: number, py: number, angle: number) => tContour;
84
-
85
- function pGeom(t: number, param: tParamVal): tGeom {
86
- let ctrRodFootprint: tCtr1;
87
- let ctrRod: tCtr1;
88
- const rGeome = initGeom(pDef.partName);
89
- const figFrame = figure();
90
- const figPlate = figure();
91
- const figRod = figure();
92
- const figRodHollow = figure();
93
- const figCutRod = figure();
94
- rGeome.logstr += `${rGeome.partName} simTime: ${t}\n`;
95
- try {
96
- if (param.L3 > param.L1 - param.L5) {
97
- throw `err595: L3 ${param.L3} too large compare to L1 ${param.L1} and L5 ${param.L5}`;
98
- }
99
- if (param.L4 > param.L2 - param.L5) {
100
- throw `err596: L4 ${param.L4} too large compare to L2 ${param.L2} and L5 ${param.L5}`;
101
- }
102
- if (param.H1 - param.H2 - param.H3 < 4 * param.D3) {
103
- throw `err597: H1 ${param.H1} too small compare to H2 ${param.H2}, H3 ${param.H3} and D3 ${param.D3}`;
104
- }
105
- const pad1 = param.R1 * (1 - 1 / Math.sqrt(2));
106
- const pad3 = param.R3 * (1 - 1 / Math.sqrt(2));
107
- const rod_x = param.L2 / 2 - pad1 - (param.L4 / 2 - pad3);
108
- const rod_y = param.L1 / 2 - pad1 - (param.L3 / 2 - pad3);
109
- const rod_xy = Math.sqrt(rod_x ** 2 + rod_y ** 2);
110
- const rod_z = param.H1 - param.H2 - param.H3;
111
- const rod_slope_length = Math.sqrt(rod_xy ** 2 + rod_z ** 2);
112
- const rod_slope_angle = Math.atan2(rod_z, rod_xy);
113
- const rod_xy_angle = Math.atan2(rod_y, rod_x);
114
- rGeome.logstr += `rod-slope: length: ${ffix(rod_slope_length)} mm, angle: ${ffix(
115
- radToDeg(rod_slope_angle)
116
- )} degree\n`;
117
- rGeome.logstr += `rod-xy-angle: ${ffix(radToDeg(rod_xy_angle))} degree\n`;
118
- const rodFootprintLength = param.D3 / Math.cos(Math.PI / 2 - rod_slope_angle);
119
- rGeome.logstr += `rod-footprint-length: ${ffix(rodFootprintLength)} mm\n`;
120
- const rodFPl = Math.sqrt((rodFootprintLength / 2) ** 2 + (param.D3 / 2) ** 2);
121
- const rodFPa = Math.atan2(param.D3, rodFootprintLength);
122
- ctrRodFootprint = function (px: number, py: number, angle: number): tContour {
123
- const rCtr = contour(px, py)
124
- .addPointRP(angle + Math.PI - rodFPa, rodFPl)
125
- .addSeg2Arcs(angle + Math.PI / 2, angle)
126
- .addPointRP(angle + Math.PI + rodFPa, rodFPl)
127
- .addSeg2Arcs(angle + Math.PI, angle + Math.PI / 2)
128
- .addPointRP(angle - rodFPa, rodFPl)
129
- .addSeg2Arcs(angle + (3 * Math.PI) / 2, angle + Math.PI)
130
- .addPointRP(angle + rodFPa, rodFPl)
131
- .addSeg2Arcs(angle, angle - Math.PI / 2);
132
- return rCtr;
133
- };
134
- ctrRod = function (px: number, py: number, angle: number): tContour {
135
- const px0 = px + rodFPl * Math.cos(angle + Math.PI - rodFPa);
136
- const py0 = py + rodFPl * Math.sin(angle + Math.PI - rodFPa);
137
- const rCtr = contour(px0, py0)
138
- .addSegStrokeRP(angle + Math.PI, rod_xy)
139
- .addSegStrokeRP(angle - Math.PI / 2, param.D3)
140
- .addSegStrokeRP(angle, rod_xy)
141
- .closeSegStroke();
142
- return rCtr;
143
- };
144
- // figFrame
145
- if (param.R1 > param.L1 / 4 || param.R1 > param.L2 / 4) {
146
- throw `err614: R1 ${param.R1} too large compare to L1 ${param.L1} or L2 ${param.L2}`;
147
- }
148
- const ctrFrameExt = contour(param.L2 / 2, param.L1 / 2)
149
- .addSegStrokeA(-param.L2 / 2, param.L1 / 2)
150
- .addCornerRounded(param.R1)
151
- .addSegStrokeA(-param.L2 / 2, -param.L1 / 2)
152
- .addCornerRounded(param.R1)
153
- .addSegStrokeA(param.L2 / 2, -param.L1 / 2)
154
- .addCornerRounded(param.R1)
155
- .closeSegStroke()
156
- .addCornerRounded(param.R1);
157
- if (param.R2 > (param.L1 - 2 * param.L5) / 4 || param.R2 > (param.L2 - 2 * param.L5) / 4) {
158
- throw `err627: R2 ${param.R2} too large compare to L1 ${param.L1}, L2 ${param.L2} and L5 ${param.L5}`;
159
- }
160
- const ctrFrameInt = contour(param.L2 / 2 - param.L5, param.L1 / 2 - param.L5)
161
- .addSegStrokeA(-param.L2 / 2 + param.L5, param.L1 / 2 - param.L5)
162
- .addCornerRounded(param.R2)
163
- .addSegStrokeA(-param.L2 / 2 + param.L5, -param.L1 / 2 + param.L5)
164
- .addCornerRounded(param.R2)
165
- .addSegStrokeA(param.L2 / 2 - param.L5, -param.L1 / 2 + param.L5)
166
- .addCornerRounded(param.R2)
167
- .closeSegStroke()
168
- .addCornerRounded(param.R2);
169
- if (param.R3 > param.L3 / 4 || param.R3 > param.L4 / 4) {
170
- throw `err639: R3 ${param.R3} too large compare to L3 ${param.L3} or L4 ${param.L4}`;
171
- }
172
- const ctrPlate = contour(param.L4 / 2, param.L3 / 2)
173
- .addSegStrokeA(-param.L4 / 2, param.L3 / 2)
174
- .addCornerRounded(param.R3)
175
- .addSegStrokeA(-param.L4 / 2, -param.L3 / 2)
176
- .addCornerRounded(param.R3)
177
- .addSegStrokeA(param.L4 / 2, -param.L3 / 2)
178
- .addCornerRounded(param.R3)
179
- .closeSegStroke()
180
- .addCornerRounded(param.R3);
181
- figFrame.addMain(ctrFrameExt);
182
- figFrame.addMain(ctrFrameInt);
183
- figFrame.addSecond(ctrPlate);
184
- const step1 = param.L1 / (param.N1 + 1);
185
- const step2 = param.L2 / (param.N2 + 1);
186
- const step3 = param.L3 / (param.N3 + 1);
187
- const step4 = param.L4 / (param.N4 + 1);
188
- if (param.L5 < param.D1 + param.L6) {
189
- throw `err658: L5 ${param.L5} too small compare to D1 ${param.D1} or L6 ${param.L6}`;
190
- }
191
- if (step3 < param.D2 + param.L7) {
192
- throw `err661: D2 ${param.D2} or L7 ${param.L7} too large compare to L3 ${param.l3}`;
193
- }
194
- if (step4 < param.D2 + param.L7) {
195
- throw `err664: D2 ${param.D2} or L7 ${param.L7} too large compare to L4 ${param.l4}`;
196
- }
197
- const lFrameHole: tContour[] = [];
198
- for (let i = 1; i < param.N1 + 1; i++) {
199
- lFrameHole.push(
200
- contourCircle(param.L2 / 2 - param.L6, -param.L1 / 2 + i * step1, param.D1)
201
- );
202
- lFrameHole.push(
203
- contourCircle(-param.L2 / 2 + param.L6, -param.L1 / 2 + i * step1, param.D1)
204
- );
205
- }
206
- for (let i = 1; i < param.N2 + 1; i++) {
207
- lFrameHole.push(
208
- contourCircle(-param.L2 / 2 + i * step2, param.L1 / 2 - param.L6, param.D1)
209
- );
210
- lFrameHole.push(
211
- contourCircle(-param.L2 / 2 + i * step2, -param.L1 / 2 + param.L6, param.D1)
212
- );
213
- }
214
- const lPlateHole: tContour[] = [];
215
- for (let i = 1; i < param.N3 + 1; i++) {
216
- lPlateHole.push(
217
- contourCircle(param.L4 / 2 - param.L7, -param.L3 / 2 + i * step3, param.D2)
218
- );
219
- lPlateHole.push(
220
- contourCircle(-param.L4 / 2 + param.L7, -param.L3 / 2 + i * step3, param.D2)
221
- );
222
- }
223
- for (let i = 1; i < param.N4 + 1; i++) {
224
- lPlateHole.push(
225
- contourCircle(-param.L4 / 2 + i * step4, param.L3 / 2 - param.L7, param.D2)
226
- );
227
- lPlateHole.push(
228
- contourCircle(-param.L4 / 2 + i * step4, -param.L3 / 2 + param.L7, param.D2)
229
- );
230
- }
231
- lFrameHole.forEach((ctr) => {
232
- figFrame.addMain(ctr);
233
- });
234
- lPlateHole.forEach((ctr) => {
235
- figFrame.addSecond(ctr);
236
- });
237
- const lRodFP: tContour[] = [];
238
- lRodFP.push(ctrRodFootprint(param.L2 / 2 - pad1, param.L1 / 2 - pad1, rod_xy_angle));
239
- lRodFP.push(ctrRodFootprint(param.L4 / 2 - pad3, param.L3 / 2 - pad3, rod_xy_angle));
240
- lRodFP.push(
241
- ctrRodFootprint(-param.L2 / 2 + pad1, param.L1 / 2 - pad1, Math.PI - rod_xy_angle)
242
- );
243
- lRodFP.push(
244
- ctrRodFootprint(-param.L4 / 2 + pad3, param.L3 / 2 - pad3, Math.PI - rod_xy_angle)
245
- );
246
- lRodFP.push(
247
- ctrRodFootprint(-param.L2 / 2 + pad1, -param.L1 / 2 + pad1, Math.PI + rod_xy_angle)
248
- );
249
- lRodFP.push(
250
- ctrRodFootprint(-param.L4 / 2 + pad3, -param.L3 / 2 + pad3, Math.PI + rod_xy_angle)
251
- );
252
- lRodFP.push(ctrRodFootprint(param.L2 / 2 - pad1, -param.L1 / 2 + pad1, -rod_xy_angle));
253
- lRodFP.push(ctrRodFootprint(param.L4 / 2 - pad3, -param.L3 / 2 + pad3, -rod_xy_angle));
254
- const lRod: tContour[] = [];
255
- lRod.push(ctrRod(param.L2 / 2 - pad1, param.L1 / 2 - pad1, rod_xy_angle));
256
- lRod.push(ctrRod(-param.L2 / 2 + pad1, param.L1 / 2 - pad1, Math.PI - rod_xy_angle));
257
- lRod.push(ctrRod(-param.L2 / 2 + pad1, -param.L1 / 2 + pad1, Math.PI + rod_xy_angle));
258
- lRod.push(ctrRod(param.L2 / 2 - pad1, -param.L1 / 2 + pad1, -rod_xy_angle));
259
- lRodFP.forEach((ctr) => {
260
- figFrame.addSecond(ctr);
261
- });
262
- lRod.forEach((ctr) => {
263
- figFrame.addSecond(ctr);
264
- });
265
- // figPlate
266
- figPlate.addMain(ctrPlate);
267
- lPlateHole.forEach((ctr) => {
268
- figPlate.addMain(ctr);
269
- });
270
- figPlate.addSecond(ctrFrameExt);
271
- figPlate.addSecond(ctrFrameInt);
272
- lFrameHole.forEach((ctr) => {
273
- figPlate.addSecond(ctr);
274
- });
275
- lRodFP.forEach((ctr) => {
276
- figPlate.addSecond(ctr);
277
- });
278
- lRod.forEach((ctr) => {
279
- figPlate.addSecond(ctr);
280
- });
281
- // figRod
282
- if (param.D4 >= param.D3) {
283
- throw `err218: D4 ${param.D4} larger than D3 ${param.D3}`;
284
- }
285
- figRod.addMain(contourCircle(0, 0, param.D3 / 2));
286
- figRod.addSecond(contourCircle(0, 0, param.D4 / 2));
287
- // figRodHollow
288
- figRodHollow.addMain(contourCircle(0, 0, param.D4 / 2));
289
- figRodHollow.addSecond(contourCircle(0, 0, param.D3 / 2));
290
- // figCutRod
291
- const rodFootprintHeight = param.D3 * Math.cos(rod_slope_angle);
292
- const rodFootprintBack = rodFootprintHeight / Math.tan(rod_slope_angle);
293
- const pad3x = pad3 + (rodFootprintLength / 2 + rodFootprintBack) * Math.cos(rod_xy_angle);
294
- const pad3y = pad3 + (rodFootprintLength / 2 + rodFootprintBack) * Math.sin(rod_xy_angle);
295
- const rodExtrudeLength =
296
- rod_slope_length + 2 * (rodFootprintLength + rodFootprintBack + rodFootprintHeight);
297
- const cutL = rodExtrudeLength + param.L3 + param.L4 + rodFootprintHeight;
298
- const ctrCutRod = contour(cutL, cutL)
299
- .addSegStrokeA(-cutL, cutL)
300
- .addSegStrokeA(-cutL, -cutL)
301
- .addSegStrokeA(cutL, -cutL)
302
- .closeSegStroke();
303
- figCutRod.addMain(ctrCutRod);
304
- // final figure list
305
- rGeome.fig = {
306
- faceFrame: figFrame,
307
- facePlate: figPlate,
308
- faceRod: figRod,
309
- faceRodHollow: figRodHollow,
310
- faceCutRod: figCutRod
311
- };
312
- const designName = rGeome.partName;
313
- rGeome.vol = {
314
- extrudes: [
315
- {
316
- outName: `subpax_${designName}_frame`,
317
- face: `${designName}_faceFrame`,
318
- extrudeMethod: EExtrude.eLinearOrtho,
319
- length: param.H2,
320
- rotate: [0, 0, 0],
321
- translate: [0, 0, param.H1 - param.H2]
322
- },
323
- {
324
- outName: `subpax_${designName}_plate`,
325
- face: `${designName}_facePlate`,
326
- extrudeMethod: EExtrude.eLinearOrtho,
327
- length: param.H3,
328
- rotate: [0, 0, 0],
329
- translate: [0, 0, 0]
330
- },
331
- {
332
- outName: `subpax_${designName}_rod1`,
333
- face: `${designName}_faceRod`,
334
- extrudeMethod: EExtrude.eLinearOrtho,
335
- length: rodExtrudeLength,
336
- rotate: [0, Math.PI / 2 - rod_slope_angle, rod_xy_angle],
337
- translate: [
338
- param.L4 / 2 - pad3x,
339
- param.L3 / 2 - pad3y,
340
- param.H3 - rodFootprintHeight
341
- ]
342
- },
343
- {
344
- outName: `subpax_${designName}_rod2`,
345
- face: `${designName}_faceRod`,
346
- extrudeMethod: EExtrude.eLinearOrtho,
347
- length: rodExtrudeLength,
348
- rotate: [0, Math.PI / 2 - rod_slope_angle, Math.PI - rod_xy_angle],
349
- translate: [
350
- -param.L4 / 2 + pad3x,
351
- param.L3 / 2 - pad3y,
352
- param.H3 - rodFootprintHeight
353
- ]
354
- },
355
- {
356
- outName: `subpax_${designName}_rod3`,
357
- face: `${designName}_faceRod`,
358
- extrudeMethod: EExtrude.eLinearOrtho,
359
- length: rodExtrudeLength,
360
- rotate: [0, Math.PI / 2 - rod_slope_angle, Math.PI + rod_xy_angle],
361
- translate: [
362
- -param.L4 / 2 + pad3x,
363
- -param.L3 / 2 + pad3y,
364
- param.H3 - rodFootprintHeight
365
- ]
366
- },
367
- {
368
- outName: `subpax_${designName}_rod4`,
369
- face: `${designName}_faceRod`,
370
- extrudeMethod: EExtrude.eLinearOrtho,
371
- length: rodExtrudeLength,
372
- rotate: [0, Math.PI / 2 - rod_slope_angle, -rod_xy_angle],
373
- translate: [
374
- param.L4 / 2 - pad3x,
375
- -param.L3 / 2 + pad3y,
376
- param.H3 - rodFootprintHeight
377
- ]
378
- },
379
- {
380
- outName: `subpax_${designName}_rodH1`,
381
- face: `${designName}_faceRodHollow`,
382
- extrudeMethod: EExtrude.eLinearOrtho,
383
- length: rodExtrudeLength,
384
- rotate: [0, Math.PI / 2 - rod_slope_angle, rod_xy_angle],
385
- translate: [
386
- param.L4 / 2 - pad3x,
387
- param.L3 / 2 - pad3y,
388
- param.H3 - rodFootprintHeight
389
- ]
390
- },
391
- {
392
- outName: `subpax_${designName}_rodH2`,
393
- face: `${designName}_faceRodHollow`,
394
- extrudeMethod: EExtrude.eLinearOrtho,
395
- length: rodExtrudeLength,
396
- rotate: [0, Math.PI / 2 - rod_slope_angle, Math.PI - rod_xy_angle],
397
- translate: [
398
- -param.L4 / 2 + pad3x,
399
- param.L3 / 2 - pad3y,
400
- param.H3 - rodFootprintHeight
401
- ]
402
- },
403
- {
404
- outName: `subpax_${designName}_rodH3`,
405
- face: `${designName}_faceRodHollow`,
406
- extrudeMethod: EExtrude.eLinearOrtho,
407
- length: rodExtrudeLength,
408
- rotate: [0, Math.PI / 2 - rod_slope_angle, Math.PI + rod_xy_angle],
409
- translate: [
410
- -param.L4 / 2 + pad3x,
411
- -param.L3 / 2 + pad3y,
412
- param.H3 - rodFootprintHeight
413
- ]
414
- },
415
- {
416
- outName: `subpax_${designName}_rodH4`,
417
- face: `${designName}_faceRodHollow`,
418
- extrudeMethod: EExtrude.eLinearOrtho,
419
- length: rodExtrudeLength,
420
- rotate: [0, Math.PI / 2 - rod_slope_angle, -rod_xy_angle],
421
- translate: [
422
- param.L4 / 2 - pad3x,
423
- -param.L3 / 2 + pad3y,
424
- param.H3 - rodFootprintHeight
425
- ]
426
- },
427
- {
428
- outName: `subpax_${designName}_cut1`,
429
- face: `${designName}_faceCutRod`,
430
- extrudeMethod: EExtrude.eLinearOrtho,
431
- length: cutL,
432
- rotate: [0, 0, 0],
433
- translate: [0, 0, -cutL]
434
- },
435
- {
436
- outName: `subpax_${designName}_cut2`,
437
- face: `${designName}_faceCutRod`,
438
- extrudeMethod: EExtrude.eLinearOrtho,
439
- length: cutL,
440
- rotate: [0, 0, 0],
441
- translate: [0, 0, param.H1]
442
- }
443
- ],
444
- volumes: [
445
- {
446
- outName: `ipax_${designName}_rawRod`,
447
- boolMethod: EBVolume.eUnion,
448
- inList: [
449
- `subpax_${designName}_rod1`,
450
- `subpax_${designName}_rod2`,
451
- `subpax_${designName}_rod3`,
452
- `subpax_${designName}_rod4`
453
- ]
454
- },
455
- {
456
- outName: `ipax_${designName}_rodHollow`,
457
- boolMethod: EBVolume.eUnion,
458
- inList: [
459
- `subpax_${designName}_rodH1`,
460
- `subpax_${designName}_rodH2`,
461
- `subpax_${designName}_rodH3`,
462
- `subpax_${designName}_rodH4`
463
- ]
464
- },
465
- {
466
- outName: `ipax_${designName}_halfRods`,
467
- boolMethod: EBVolume.eSubstraction,
468
- inList: [`ipax_${designName}_rawRod`, `subpax_${designName}_cut1`]
469
- },
470
- {
471
- outName: `ipax_${designName}_rods`,
472
- boolMethod: EBVolume.eSubstraction,
473
- inList: [`ipax_${designName}_halfRods`, `subpax_${designName}_cut2`]
474
- },
475
- {
476
- outName: `ipax_${designName}_plus`,
477
- boolMethod: EBVolume.eUnion,
478
- inList: [
479
- `subpax_${designName}_frame`,
480
- `subpax_${designName}_plate`,
481
- `ipax_${designName}_rods`
482
- ]
483
- },
484
- {
485
- outName: `pax_${designName}`,
486
- boolMethod: EBVolume.eSubstraction,
487
- inList: [`ipax_${designName}_plus`, `ipax_${designName}_rodHollow`]
488
- }
489
- ]
490
- };
491
- // sub-design
492
- rGeome.sub = {};
493
- // finalize
494
- rGeome.logstr += 'trapeze draw successfully!\n';
495
- rGeome.calcErr = false;
496
- } catch (emsg) {
497
- rGeome.logstr += emsg as string;
498
- console.log(emsg as string);
499
- }
500
- return rGeome;
501
- }
502
-
503
- const trapezeDef: tPageDef = {
504
- pTitle: 'Heliostat trapeze',
505
- pDescription: 'The support of one solar panel. Made out of aluminium for lightness and cooling',
506
- pDef: pDef,
507
- pGeom: pGeom
508
- };
509
-
510
- export { trapezeDef };
package/src/index.ts DELETED
@@ -1,33 +0,0 @@
1
- // index.ts : entry point
2
-
3
- export * from './gears/gear_wheel_wheel';
4
- export * from './gears/simplified_gear_wheel';
5
-
6
- export * from './heliostat/heliostat';
7
- export * from './heliostat/heliostat_2';
8
- export * from './heliostat/base';
9
- export * from './heliostat/pole_static';
10
- export * from './heliostat/pole_rotor';
11
- export * from './heliostat/rake';
12
- export * from './heliostat/rake_stopper';
13
- export * from './heliostat/spider';
14
- export * from './heliostat/swing';
15
- export * from './heliostat/rod';
16
- export * from './heliostat/trapeze';
17
- export * from './heliostat/surface';
18
-
19
- export * from './dummy/circles';
20
- export * from './dummy/rectangle';
21
- export * from './dummy/pole_static';
22
-
23
- export * from './geometrix_verification/verify_point';
24
- export * from './geometrix_verification/verify_point_2';
25
- export * from './geometrix_verification/verify_line';
26
- export * from './geometrix_verification/verify_line_2';
27
- export * from './geometrix_verification/verify_line_3';
28
- export * from './geometrix_verification/verify_vector';
29
- export * from './geometrix_verification/verify_contour_1';
30
- export * from './geometrix_verification/verify_contour_2';
31
- export * from './geometrix_verification/verify_contour_3';
32
- export * from './geometrix_verification/verify_contour_4';
33
- export * from './geometrix_verification/verify_exports_1';
@@ -1,40 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
-
4
- <svg
5
- width="199.99997"
6
- height="200.00002"
7
- viewBox="0 0 52.916659 52.91667"
8
- version="1.1"
9
- id="svg5"
10
- xmlns="http://www.w3.org/2000/svg"
11
- xmlns:svg="http://www.w3.org/2000/svg">
12
- <defs
13
- id="defs2">
14
- <rect
15
- x="102.45944"
16
- y="286.96857"
17
- width="176.77415"
18
- height="48.735157"
19
- id="rect1984-5-2-3" />
20
- </defs>
21
- <g
22
- id="layer1"
23
- transform="translate(-33.776882,-224.36675)">
24
- <rect
25
- style="fill:#ffffff;stroke:#ffffff;stroke-width:0.264583;stroke-dasharray:none;stroke-dashoffset:0"
26
- id="rect1448-3"
27
- width="52.652084"
28
- height="52.652084"
29
- x="33.909172"
30
- y="224.49904" />
31
- <text
32
- xml:space="preserve"
33
- transform="matrix(0.26458333,0,0,0.26458333,11.23015,171.5253)"
34
- id="text1982-6-5-6"
35
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1984-5-2-3);display:inline;fill:#ff6600"><tspan
36
- x="102.45898"
37
- y="299.94534"
38
- id="tspan474">default_param_blank</tspan></text>
39
- </g>
40
- </svg>
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "outDir": "./dist",
6
- "esModuleInterop": true,
7
- "moduleResolution": "bundler",
8
- "declaration": true,
9
- "sourceMap": true,
10
- "strict": true
11
- },
12
- "include": ["./src"]
13
- }
package/vitest.config.ts DELETED
@@ -1,7 +0,0 @@
1
- import { defineConfig } from 'vitest/config';
2
-
3
- export default defineConfig({
4
- test: {
5
- include: ['src/**/*.{test,spec}.{js,ts}']
6
- }
7
- });