@bitbybit-dev/base 1.5.0-rc.0 → 1.6.0-rc.0

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 (312) hide show
  1. package/lib/api/GlobalCDNProvider.js +1 -1
  2. package/lib/api/bearings/ansi-bearings.constants.d.ts +2 -0
  3. package/lib/api/bearings/ansi-bearings.constants.js +26 -0
  4. package/lib/api/bearings/ansi-bearings.d.ts +4 -0
  5. package/lib/api/bearings/ansi-bearings.js +14 -0
  6. package/lib/api/bearings/bearing-types.d.ts +25 -0
  7. package/lib/api/bearings/bearing-types.js +1 -0
  8. package/lib/api/bearings/bearings.constants.d.ts +1 -0
  9. package/lib/api/bearings/bearings.constants.js +1 -0
  10. package/lib/api/bearings/iso-bearings.constants.d.ts +2 -0
  11. package/lib/api/bearings/iso-bearings.constants.js +30 -0
  12. package/lib/api/bearings/iso-bearings.d.ts +4 -0
  13. package/lib/api/bearings/iso-bearings.js +14 -0
  14. package/lib/api/color-space.d.ts +2 -0
  15. package/lib/api/color-space.js +5 -8
  16. package/lib/api/fasteners/ansi-fasteners.constants.d.ts +16 -0
  17. package/lib/api/fasteners/ansi-fasteners.constants.js +118 -0
  18. package/lib/api/fasteners/ansi-fasteners.d.ts +8 -0
  19. package/lib/api/fasteners/ansi-fasteners.js +64 -0
  20. package/lib/api/fasteners/fastener-types.d.ts +161 -0
  21. package/lib/api/fasteners/fastener-types.js +1 -0
  22. package/lib/api/fasteners/fasteners.constants.d.ts +5 -0
  23. package/lib/api/fasteners/fasteners.constants.js +5 -0
  24. package/lib/api/fasteners/fasteners.d.ts +2 -0
  25. package/lib/api/fasteners/fasteners.js +9 -0
  26. package/lib/api/fasteners/iso-fasteners.constants.d.ts +23 -0
  27. package/lib/api/fasteners/iso-fasteners.constants.js +110 -0
  28. package/lib/api/fasteners/iso-fasteners.d.ts +9 -0
  29. package/lib/api/fasteners/iso-fasteners.js +61 -0
  30. package/lib/api/gears/bevel-gears.d.ts +6 -0
  31. package/lib/api/gears/bevel-gears.js +69 -0
  32. package/lib/api/gears/gear-checks.d.ts +8 -0
  33. package/lib/api/gears/gear-checks.js +69 -0
  34. package/lib/api/gears/gear-pairs.d.ts +4 -0
  35. package/lib/api/gears/gear-pairs.js +140 -0
  36. package/lib/api/gears/gear-types.d.ts +425 -0
  37. package/lib/api/gears/gear-types.js +1 -0
  38. package/lib/api/gears/gears.constants.d.ts +19 -0
  39. package/lib/api/gears/gears.constants.js +19 -0
  40. package/lib/api/gears/gears.d.ts +10 -0
  41. package/lib/api/gears/gears.js +156 -0
  42. package/lib/api/gears/helical-gears.d.ts +5 -0
  43. package/lib/api/gears/helical-gears.js +33 -0
  44. package/lib/api/gears/involute-flank.d.ts +26 -0
  45. package/lib/api/gears/involute-flank.js +158 -0
  46. package/lib/api/gears/racks.d.ts +3 -0
  47. package/lib/api/gears/racks.js +64 -0
  48. package/lib/api/index.d.ts +10 -1
  49. package/lib/api/index.js +0 -1
  50. package/lib/api/inputs/base-inputs.d.ts +450 -3
  51. package/lib/api/inputs/base-inputs.js +12 -0
  52. package/lib/api/inputs/color-inputs.d.ts +14 -0
  53. package/lib/api/inputs/color-inputs.js +19 -0
  54. package/lib/api/inputs/engineering-inputs.d.ts +1539 -0
  55. package/lib/api/inputs/engineering-inputs.js +2181 -0
  56. package/lib/api/inputs/index.d.ts +2 -0
  57. package/lib/api/inputs/index.js +2 -0
  58. package/lib/api/inputs/io-inputs.d.ts +8 -1
  59. package/lib/api/inputs/io-inputs.js +4 -1
  60. package/lib/api/inputs/math-inputs.d.ts +61 -0
  61. package/lib/api/inputs/math-inputs.js +85 -0
  62. package/lib/api/inputs/mesh-inputs.d.ts +170 -0
  63. package/lib/api/inputs/mesh-inputs.js +206 -0
  64. package/lib/api/inputs/point-inputs.d.ts +4 -4
  65. package/lib/api/inputs/polyline-inputs.d.ts +144 -0
  66. package/lib/api/inputs/polyline-inputs.js +151 -0
  67. package/lib/api/inputs/recipes-inputs.d.ts +76 -0
  68. package/lib/api/inputs/recipes-inputs.js +74 -0
  69. package/lib/api/inputs/transforms-inputs.d.ts +34 -0
  70. package/lib/api/inputs/transforms-inputs.js +35 -0
  71. package/lib/api/keys/ansi-keys.constants.d.ts +3 -0
  72. package/lib/api/keys/ansi-keys.constants.js +16 -0
  73. package/lib/api/keys/ansi-keys.d.ts +3 -0
  74. package/lib/api/keys/ansi-keys.js +14 -0
  75. package/lib/api/keys/din-keys.constants.d.ts +3 -0
  76. package/lib/api/keys/din-keys.constants.js +14 -0
  77. package/lib/api/keys/din-keys.d.ts +3 -0
  78. package/lib/api/keys/din-keys.js +13 -0
  79. package/lib/api/keys/key-types.d.ts +17 -0
  80. package/lib/api/keys/key-types.js +1 -0
  81. package/lib/api/keys/keys.constants.d.ts +1 -0
  82. package/lib/api/keys/keys.constants.js +1 -0
  83. package/lib/api/knurls/ansi-knurls.constants.d.ts +4 -0
  84. package/lib/api/knurls/ansi-knurls.constants.js +8 -0
  85. package/lib/api/knurls/ansi-knurls.d.ts +3 -0
  86. package/lib/api/knurls/ansi-knurls.js +20 -0
  87. package/lib/api/knurls/din-knurls.constants.d.ts +2 -0
  88. package/lib/api/knurls/din-knurls.constants.js +2 -0
  89. package/lib/api/knurls/din-knurls.d.ts +3 -0
  90. package/lib/api/knurls/din-knurls.js +19 -0
  91. package/lib/api/knurls/knurl-types.d.ts +24 -0
  92. package/lib/api/knurls/knurl-types.js +1 -0
  93. package/lib/api/knurls/knurls.constants.d.ts +1 -0
  94. package/lib/api/knurls/knurls.constants.js +1 -0
  95. package/lib/api/knurls/knurls.d.ts +2 -0
  96. package/lib/api/knurls/knurls.js +9 -0
  97. package/lib/api/recipes/checks.d.ts +15 -0
  98. package/lib/api/recipes/checks.js +85 -0
  99. package/lib/api/recipes/limits.constants.d.ts +4 -0
  100. package/lib/api/recipes/limits.constants.js +4 -0
  101. package/lib/api/recipes/sources.d.ts +0 -13
  102. package/lib/api/recipes/sources.js +3 -15
  103. package/lib/api/recipes/surface-mesh.d.ts +0 -14
  104. package/lib/api/recipes/surface-mesh.js +8 -21
  105. package/lib/api/recipes/validate-brep.d.ts +2 -0
  106. package/lib/api/recipes/validate-brep.js +330 -0
  107. package/lib/api/recipes/validate.d.ts +0 -31
  108. package/lib/api/recipes/validate.js +7 -115
  109. package/lib/api/resolved-inputs/index.d.ts +80 -0
  110. package/lib/api/retaining-rings/ansi-retaining-rings.constants.d.ts +4 -0
  111. package/lib/api/retaining-rings/ansi-retaining-rings.constants.js +93 -0
  112. package/lib/api/retaining-rings/ansi-retaining-rings.d.ts +4 -0
  113. package/lib/api/retaining-rings/ansi-retaining-rings.js +20 -0
  114. package/lib/api/retaining-rings/din-retaining-rings.constants.d.ts +3 -0
  115. package/lib/api/retaining-rings/din-retaining-rings.constants.js +115 -0
  116. package/lib/api/retaining-rings/din-retaining-rings.d.ts +4 -0
  117. package/lib/api/retaining-rings/din-retaining-rings.js +20 -0
  118. package/lib/api/retaining-rings/retaining-ring-types.d.ts +30 -0
  119. package/lib/api/retaining-rings/retaining-ring-types.js +1 -0
  120. package/lib/api/retaining-rings/retaining-rings.constants.d.ts +1 -0
  121. package/lib/api/retaining-rings/retaining-rings.constants.js +1 -0
  122. package/lib/api/retaining-rings/retaining-rings.d.ts +2 -0
  123. package/lib/api/retaining-rings/retaining-rings.js +9 -0
  124. package/lib/api/services/base-bitbybit.d.ts +42 -0
  125. package/lib/api/services/base-bitbybit.js +43 -0
  126. package/lib/api/services/color.d.ts +35 -2
  127. package/lib/api/services/color.js +48 -12
  128. package/lib/api/services/engineering/engineering.d.ts +12 -0
  129. package/lib/api/services/engineering/engineering.js +13 -0
  130. package/lib/api/services/engineering/index.d.ts +2 -0
  131. package/lib/api/services/engineering/index.js +2 -0
  132. package/lib/api/services/engineering/mechanical/bearings-ansi.d.ts +40 -0
  133. package/lib/api/services/engineering/mechanical/bearings-ansi.js +47 -0
  134. package/lib/api/services/engineering/mechanical/bearings-iso.d.ts +39 -0
  135. package/lib/api/services/engineering/mechanical/bearings-iso.js +46 -0
  136. package/lib/api/services/engineering/mechanical/bearings.d.ts +14 -0
  137. package/lib/api/services/engineering/mechanical/bearings.js +15 -0
  138. package/lib/api/services/engineering/mechanical/fasteners-ansi.d.ts +109 -0
  139. package/lib/api/services/engineering/mechanical/fasteners-ansi.js +133 -0
  140. package/lib/api/services/engineering/mechanical/fasteners-iso.d.ts +123 -0
  141. package/lib/api/services/engineering/mechanical/fasteners-iso.js +151 -0
  142. package/lib/api/services/engineering/mechanical/fasteners.d.ts +13 -0
  143. package/lib/api/services/engineering/mechanical/fasteners.js +14 -0
  144. package/lib/api/services/engineering/mechanical/gears.d.ts +267 -0
  145. package/lib/api/services/engineering/mechanical/gears.js +318 -0
  146. package/lib/api/services/engineering/mechanical/index.d.ts +24 -0
  147. package/lib/api/services/engineering/mechanical/index.js +24 -0
  148. package/lib/api/services/engineering/mechanical/keys-ansi.d.ts +27 -0
  149. package/lib/api/services/engineering/mechanical/keys-ansi.js +32 -0
  150. package/lib/api/services/engineering/mechanical/keys-din.d.ts +26 -0
  151. package/lib/api/services/engineering/mechanical/keys-din.js +31 -0
  152. package/lib/api/services/engineering/mechanical/keys.d.ts +14 -0
  153. package/lib/api/services/engineering/mechanical/keys.js +15 -0
  154. package/lib/api/services/engineering/mechanical/knurls-ansi.d.ts +26 -0
  155. package/lib/api/services/engineering/mechanical/knurls-ansi.js +31 -0
  156. package/lib/api/services/engineering/mechanical/knurls-din.d.ts +26 -0
  157. package/lib/api/services/engineering/mechanical/knurls-din.js +31 -0
  158. package/lib/api/services/engineering/mechanical/knurls.d.ts +14 -0
  159. package/lib/api/services/engineering/mechanical/knurls.js +15 -0
  160. package/lib/api/services/engineering/mechanical/mechanical.d.ts +29 -0
  161. package/lib/api/services/engineering/mechanical/mechanical.js +30 -0
  162. package/lib/api/services/engineering/mechanical/retaining-rings-ansi.d.ts +43 -0
  163. package/lib/api/services/engineering/mechanical/retaining-rings-ansi.js +51 -0
  164. package/lib/api/services/engineering/mechanical/retaining-rings-din.d.ts +43 -0
  165. package/lib/api/services/engineering/mechanical/retaining-rings-din.js +51 -0
  166. package/lib/api/services/engineering/mechanical/retaining-rings.d.ts +13 -0
  167. package/lib/api/services/engineering/mechanical/retaining-rings.js +14 -0
  168. package/lib/api/services/engineering/mechanical/splines-ansi.d.ts +27 -0
  169. package/lib/api/services/engineering/mechanical/splines-ansi.js +32 -0
  170. package/lib/api/services/engineering/mechanical/splines-din.d.ts +26 -0
  171. package/lib/api/services/engineering/mechanical/splines-din.js +31 -0
  172. package/lib/api/services/engineering/mechanical/splines.d.ts +13 -0
  173. package/lib/api/services/engineering/mechanical/splines.js +14 -0
  174. package/lib/api/services/engineering/mechanical/springs.d.ts +27 -0
  175. package/lib/api/services/engineering/mechanical/springs.js +31 -0
  176. package/lib/api/services/engineering/mechanical/threads-ansi.d.ts +40 -0
  177. package/lib/api/services/engineering/mechanical/threads-ansi.js +48 -0
  178. package/lib/api/services/engineering/mechanical/threads-iso.d.ts +40 -0
  179. package/lib/api/services/engineering/mechanical/threads-iso.js +48 -0
  180. package/lib/api/services/engineering/mechanical/threads.d.ts +13 -0
  181. package/lib/api/services/engineering/mechanical/threads.js +14 -0
  182. package/lib/api/services/frame.js +3 -3
  183. package/lib/api/services/geometry-helper.js +8 -111
  184. package/lib/api/services/helpers/color/color-space.d.ts +2 -0
  185. package/lib/api/services/helpers/color/color-space.js +12 -0
  186. package/lib/api/services/helpers/{nurbs.d.ts → curves/nurbs.d.ts} +1 -1
  187. package/lib/api/services/helpers/{surface-triangulation.d.ts → curves/surface-triangulation.d.ts} +2 -2
  188. package/lib/api/services/helpers/{surface-triangulation.js → curves/surface-triangulation.js} +14 -8
  189. package/lib/api/services/helpers/{dxf → files/dxf}/dxf-generator.d.ts +2 -1
  190. package/lib/api/services/helpers/{dxf → files/dxf}/dxf-generator.js +19 -5
  191. package/lib/api/services/helpers/files/dxf/dxf.constants.d.ts +4 -0
  192. package/lib/api/services/helpers/files/dxf/dxf.constants.js +4 -0
  193. package/lib/api/services/helpers/{dxf → files/dxf}/dxf.d.ts +1 -1
  194. package/lib/api/services/helpers/{dxf → files/dxf}/dxf.js +2 -2
  195. package/lib/api/services/helpers/files/glb.constants.d.ts +11 -0
  196. package/lib/api/services/helpers/files/glb.constants.js +11 -0
  197. package/lib/api/services/helpers/files/glb.d.ts +1 -0
  198. package/lib/api/services/helpers/files/glb.js +69 -0
  199. package/lib/api/services/helpers/files/gzip.constants.d.ts +11 -0
  200. package/lib/api/services/helpers/files/gzip.constants.js +11 -0
  201. package/lib/api/services/helpers/files/gzip.d.ts +2 -0
  202. package/lib/api/services/helpers/files/gzip.js +52 -0
  203. package/lib/api/services/helpers/{inflate.constants.d.ts → files/inflate.constants.d.ts} +1 -0
  204. package/lib/api/services/helpers/{inflate.constants.js → files/inflate.constants.js} +1 -0
  205. package/lib/api/services/helpers/{inflate.d.ts → files/inflate.d.ts} +1 -1
  206. package/lib/api/services/helpers/{inflate.js → files/inflate.js} +5 -4
  207. package/lib/api/services/helpers/{zip.d.ts → files/zip.d.ts} +1 -1
  208. package/lib/api/services/helpers/geometry/arcs.d.ts +9 -0
  209. package/lib/api/services/helpers/{arcs.js → geometry/arcs.js} +7 -0
  210. package/lib/api/services/helpers/{frame-axes.d.ts → geometry/frame-axes.d.ts} +8 -5
  211. package/lib/api/services/helpers/{frame-axes.js → geometry/frame-axes.js} +21 -9
  212. package/lib/api/services/helpers/geometry/lengths.constants.d.ts +4 -0
  213. package/lib/api/services/helpers/geometry/lengths.constants.js +3 -0
  214. package/lib/api/services/helpers/geometry/lengths.d.ts +7 -0
  215. package/lib/api/services/helpers/geometry/lengths.js +20 -0
  216. package/lib/api/services/helpers/geometry/matrices.constants.d.ts +8 -0
  217. package/lib/api/services/helpers/geometry/matrices.constants.js +7 -0
  218. package/lib/api/services/helpers/geometry/matrices.d.ts +17 -0
  219. package/lib/api/services/helpers/{matrices.js → geometry/matrices.js} +28 -17
  220. package/lib/api/services/helpers/{paths.d.ts → geometry/paths.d.ts} +2 -1
  221. package/lib/api/services/helpers/{paths.js → geometry/paths.js} +36 -30
  222. package/lib/api/services/helpers/{polygons.d.ts → geometry/polygons.d.ts} +1 -1
  223. package/lib/api/services/helpers/geometry/polygons.js +111 -0
  224. package/lib/api/services/helpers/geometry/scalars.d.ts +9 -0
  225. package/lib/api/services/helpers/geometry/scalars.js +34 -0
  226. package/lib/api/services/helpers/{triangulation.js → geometry/triangulation.js} +11 -6
  227. package/lib/api/services/helpers/geometry/vector-grid.d.ts +12 -0
  228. package/lib/api/services/helpers/geometry/vector-grid.js +149 -0
  229. package/lib/api/services/helpers/{vectors.d.ts → geometry/vectors.d.ts} +8 -1
  230. package/lib/api/services/helpers/geometry/vectors.js +43 -0
  231. package/lib/api/services/helpers/helper-types.d.ts +57 -0
  232. package/lib/api/services/helpers/mesh/mesh-normals.d.ts +21 -0
  233. package/lib/api/services/helpers/{mesh-normals.js → mesh/mesh-normals.js} +54 -65
  234. package/lib/api/services/helpers/mesh/mesh-orientation.d.ts +24 -0
  235. package/lib/api/services/helpers/mesh/mesh-orientation.js +104 -0
  236. package/lib/api/services/helpers/{mesh-primitives.d.ts → mesh/mesh-primitives.d.ts} +1 -1
  237. package/lib/api/services/helpers/{mesh-primitives.js → mesh/mesh-primitives.js} +6 -5
  238. package/lib/api/services/helpers/mesh/mesh-proximity.constants.d.ts +7 -0
  239. package/lib/api/services/helpers/mesh/mesh-proximity.constants.js +11 -0
  240. package/lib/api/services/helpers/mesh/mesh-proximity.d.ts +11 -0
  241. package/lib/api/services/helpers/mesh/mesh-proximity.js +382 -0
  242. package/lib/api/services/index.d.ts +3 -0
  243. package/lib/api/services/index.js +3 -0
  244. package/lib/api/services/io.d.ts +1 -1
  245. package/lib/api/services/io.js +1 -1
  246. package/lib/api/services/line.js +2 -3
  247. package/lib/api/services/math.d.ts +47 -0
  248. package/lib/api/services/math.js +77 -10
  249. package/lib/api/services/mesh.d.ts +174 -2
  250. package/lib/api/services/mesh.js +305 -7
  251. package/lib/api/services/point.js +4 -10
  252. package/lib/api/services/polyline-types.d.ts +6 -0
  253. package/lib/api/services/polyline-types.js +1 -0
  254. package/lib/api/services/polyline.d.ts +163 -1
  255. package/lib/api/services/polyline.js +270 -13
  256. package/lib/api/services/recipes.d.ts +80 -0
  257. package/lib/api/services/recipes.js +107 -0
  258. package/lib/api/services/transforms.d.ts +74 -2
  259. package/lib/api/services/transforms.js +100 -3
  260. package/lib/api/services/vector.d.ts +4 -3
  261. package/lib/api/services/vector.js +14 -14
  262. package/lib/api/splines/ansi-splines.constants.d.ts +9 -0
  263. package/lib/api/splines/ansi-splines.constants.js +9 -0
  264. package/lib/api/splines/ansi-splines.d.ts +3 -0
  265. package/lib/api/splines/ansi-splines.js +28 -0
  266. package/lib/api/splines/din-splines.constants.d.ts +12 -0
  267. package/lib/api/splines/din-splines.constants.js +12 -0
  268. package/lib/api/splines/din-splines.d.ts +3 -0
  269. package/lib/api/splines/din-splines.js +38 -0
  270. package/lib/api/splines/spline-types.d.ts +32 -0
  271. package/lib/api/splines/spline-types.js +1 -0
  272. package/lib/api/splines/splines.constants.d.ts +1 -0
  273. package/lib/api/splines/splines.constants.js +1 -0
  274. package/lib/api/springs/spring-types.d.ts +26 -0
  275. package/lib/api/springs/spring-types.js +1 -0
  276. package/lib/api/springs/springs.constants.d.ts +9 -0
  277. package/lib/api/springs/springs.constants.js +9 -0
  278. package/lib/api/springs/springs.d.ts +2 -0
  279. package/lib/api/springs/springs.js +50 -0
  280. package/lib/api/threads/ansi-threads.constants.d.ts +6 -0
  281. package/lib/api/threads/ansi-threads.constants.js +27 -0
  282. package/lib/api/threads/ansi-threads.d.ts +4 -0
  283. package/lib/api/threads/ansi-threads.js +50 -0
  284. package/lib/api/threads/iso-threads.constants.d.ts +5 -0
  285. package/lib/api/threads/iso-threads.constants.js +20 -0
  286. package/lib/api/threads/iso-threads.d.ts +4 -0
  287. package/lib/api/threads/iso-threads.js +32 -0
  288. package/lib/api/threads/thread-profile.constants.d.ts +3 -0
  289. package/lib/api/threads/thread-profile.constants.js +3 -0
  290. package/lib/api/threads/thread-types.d.ts +66 -0
  291. package/lib/api/threads/thread-types.js +1 -0
  292. package/package.json +1 -1
  293. package/lib/api/recipes/index.d.ts +0 -4
  294. package/lib/api/recipes/index.js +0 -3
  295. package/lib/api/services/helpers/arcs.d.ts +0 -6
  296. package/lib/api/services/helpers/matrices.constants.d.ts +0 -2
  297. package/lib/api/services/helpers/matrices.constants.js +0 -2
  298. package/lib/api/services/helpers/matrices.d.ts +0 -25
  299. package/lib/api/services/helpers/mesh-normals.d.ts +0 -11
  300. package/lib/api/services/helpers/polygons.js +0 -59
  301. package/lib/api/services/helpers/vectors.js +0 -17
  302. /package/lib/api/services/helpers/{nurbs.js → curves/nurbs.js} +0 -0
  303. /package/lib/api/services/helpers/{crc32.d.ts → files/crc32.d.ts} +0 -0
  304. /package/lib/api/services/helpers/{crc32.js → files/crc32.js} +0 -0
  305. /package/lib/api/services/helpers/{zip.constants.d.ts → files/zip.constants.d.ts} +0 -0
  306. /package/lib/api/services/helpers/{zip.constants.js → files/zip.constants.js} +0 -0
  307. /package/lib/api/services/helpers/{zip.js → files/zip.js} +0 -0
  308. /package/lib/api/services/helpers/{triangulation.d.ts → geometry/triangulation.d.ts} +0 -0
  309. /package/lib/api/services/helpers/{mesh-measures.d.ts → mesh/mesh-measures.d.ts} +0 -0
  310. /package/lib/api/services/helpers/{mesh-measures.js → mesh/mesh-measures.js} +0 -0
  311. /package/lib/api/services/helpers/{mesh-primitives.constants.d.ts → mesh/mesh-primitives.constants.d.ts} +0 -0
  312. /package/lib/api/services/helpers/{mesh-primitives.constants.js → mesh/mesh-primitives.constants.js} +0 -0
@@ -0,0 +1,318 @@
1
+ import * as Inputs from "../../../inputs";
2
+ import { InputError, resolveDto } from "../../../kernel-calls";
3
+ import { checkedUnitOfLength, snappedLength } from "../../helpers/geometry/lengths";
4
+ import { gearOutlinePoints, ringGearOutline, ringGearSizes, spurGearOutline, spurGearSizes } from "../../../gears/gears";
5
+ import { gearPair, internalGearPair, planetarySet } from "../../../gears/gear-pairs";
6
+ import { rackOutline, rackSizes } from "../../../gears/racks";
7
+ import { helicalGearOutline, helicalGearSizes } from "../../../gears/helical-gears";
8
+ import { bevelGearOutline, bevelGearSizes } from "../../../gears/bevel-gears";
9
+ /**
10
+ * Involute gears by their numbers, with no CAD kernel needed: the circles of spur and ring gears,
11
+ * and their outlines as points on the XY plane for any kernel to extrude. `occt.parts.mechanical.gears` builds
12
+ * the same teeth as solids. Gears mesh when they share `module` and `pressureAngle`: two spur gears
13
+ * half the module times their teeth together apart, a spur gear in a ring half the module times the
14
+ * difference.
15
+ * @beta
16
+ */
17
+ export class EngineeringGears {
18
+ /**
19
+ * Works out the circles of an involute spur gear: the pitch circle meshing gears roll on, the
20
+ * base circle its flanks unwind from, the tip and root circles, and half the angle a tooth
21
+ * spans at the pitch circle.
22
+ *
23
+ * Example: module 1, 20 teeth -> pitch radius 10, tip radius 11, root radius 8.75
24
+ * @param inputs - The teeth
25
+ * @returns The four radii in model units and the half tooth angle in radians
26
+ * @group spur
27
+ * @shortname spur gear sizes
28
+ * @drawable false
29
+ * @example
30
+ * ```typescript
31
+ * const pinion = bitbybit.engineering.mechanical.gears.spurGearSizes({ module: 1, teeth: 20 });
32
+ * const wheel = bitbybit.engineering.mechanical.gears.spurGearSizes({ module: 1, teeth: 30 });
33
+ * const centreDistance = pinion.pitchRadius + wheel.pitchRadius;
34
+ * ```
35
+ */
36
+ spurGearSizes(inputs) {
37
+ const resolved = resolveDto(Inputs.Engineering.SpurGearSizesDto, inputs);
38
+ return spurGearSizes(resolved);
39
+ }
40
+ /**
41
+ * Draws the outline of an involute spur gear as points on the XY plane, a closed counterclockwise
42
+ * loop that does not repeat its start, ready to extrude in any kernel.
43
+ *
44
+ * The flanks follow the involute within a ten-thousandth of the module; `segments` sets the
45
+ * points per curve. Tips that reach only inside the base circle are refused.
46
+ * @param inputs - The teeth, the turn and the segments per curve
47
+ * @returns The points of the outline
48
+ * @group spur
49
+ * @shortname spur gear outline
50
+ * @drawable true
51
+ * @example
52
+ * ```typescript
53
+ * const outline = bitbybit.engineering.mechanical.gears.spurGearOutline({ module: 1, teeth: 20 });
54
+ * const gear = await bitbybit.jscad.extrusions.extrudeLinear({ geometry: await bitbybit.jscad.polygon.createFromPoints({ points: outline }), height: 5, twistAngle: 0, twistSteps: 1 });
55
+ * ```
56
+ */
57
+ spurGearOutline(inputs) {
58
+ const resolved = resolveDto(Inputs.Engineering.SpurGearOutlineDto, inputs);
59
+ return gearOutlinePoints(spurGearOutline(resolved, [0, 0], resolved.rotation), resolved.segments);
60
+ }
61
+ /**
62
+ * Works out the circles of an involute ring gear, whose teeth point in toward its centre: the
63
+ * pitch and base circles, the tip circle inside them, the root circle beyond, and half the
64
+ * angle a tooth spans at the pitch circle.
65
+ *
66
+ * Example: module 1, 40 teeth -> pitch radius 20, tip radius 19, root radius 21.25
67
+ * @param inputs - The teeth
68
+ * @returns The four radii in model units and the half tooth angle in radians
69
+ * @group ring
70
+ * @shortname ring gear sizes
71
+ * @drawable false
72
+ * @example
73
+ * ```typescript
74
+ * const ring = bitbybit.engineering.mechanical.gears.ringGearSizes({ module: 1, teeth: 40 });
75
+ * const outsideAtLeast = 2 * ring.rootRadius;
76
+ * ```
77
+ */
78
+ ringGearSizes(inputs) {
79
+ const resolved = resolveDto(Inputs.Engineering.RingGearSizesDto, inputs);
80
+ return ringGearSizes(resolved);
81
+ }
82
+ /**
83
+ * Draws the teeth of an involute ring gear as points on the XY plane around the origin: the edge
84
+ * of the hole inside the ring, a closed loop counterclockwise that does not repeat its start.
85
+ *
86
+ * Cut it from a circle larger than twice the root radius to make the ring; `segments` sets how
87
+ * many points stand for each curve.
88
+ * @param inputs - The teeth, the turn and the segments per curve
89
+ * @returns The points of the outline
90
+ * @group ring
91
+ * @shortname ring gear outline
92
+ * @drawable true
93
+ * @example
94
+ * ```typescript
95
+ * const teeth = bitbybit.engineering.mechanical.gears.ringGearOutline({ module: 1, teeth: 40 });
96
+ * ```
97
+ */
98
+ ringGearOutline(inputs) {
99
+ const resolved = resolveDto(Inputs.Engineering.RingGearOutlineDto, inputs);
100
+ return gearOutlinePoints(ringGearOutline(resolved, [0, 0], resolved.rotation), resolved.segments);
101
+ }
102
+ /**
103
+ * Works out the circles of an involute helical gear's section square to its axis, with that
104
+ * section's module and pressure angle, and how many degrees the teeth turn per model unit along
105
+ * the axis.
106
+ *
107
+ * Example: module 1, 20 teeth, 20 degrees -> pitch radius 10.64, twist 1.96
108
+ * @param inputs - The teeth and their lean
109
+ * @returns The radii, the half tooth angle, the transverse module and pressure angle and the twist
110
+ * @group helical
111
+ * @shortname helical gear sizes
112
+ * @drawable false
113
+ * @example
114
+ * ```typescript
115
+ * const pinion = bitbybit.engineering.mechanical.gears.helicalGearSizes({ module: 1, teeth: 20, helixAngle: 20 });
116
+ * const wheel = bitbybit.engineering.mechanical.gears.helicalGearSizes({ module: 1, teeth: 30, helixAngle: -20 });
117
+ * const centreDistance = pinion.pitchRadius + wheel.pitchRadius;
118
+ * ```
119
+ */
120
+ helicalGearSizes(inputs) {
121
+ const resolved = resolveDto(Inputs.Engineering.HelicalGearSizesDto, inputs);
122
+ return helicalGearSizes(resolved);
123
+ }
124
+ /**
125
+ * Draws a helical gear's section square to its axis as points on the XY plane around the origin, a
126
+ * closed loop counterclockwise that does not repeat its start.
127
+ *
128
+ * Extrude it with a twist of `twist` from `helicalGearSizes` times the height to make the gear.
129
+ * @param inputs - The teeth, their lean, the turn and the segments per curve
130
+ * @returns The points of the outline
131
+ * @group helical
132
+ * @shortname helical gear outline
133
+ * @drawable true
134
+ * @example
135
+ * ```typescript
136
+ * const sizes = bitbybit.engineering.mechanical.gears.helicalGearSizes({ module: 1, teeth: 20 });
137
+ * const outline = bitbybit.engineering.mechanical.gears.helicalGearOutline({ module: 1, teeth: 20 });
138
+ * const section = await bitbybit.jscad.polygon.createFromPoints({ points: outline });
139
+ * const gear = await bitbybit.jscad.extrusions.extrudeLinear({ geometry: section, height: 5, twistAngle: sizes.twist * 5, twistSteps: 10 });
140
+ * ```
141
+ */
142
+ helicalGearOutline(inputs) {
143
+ const resolved = resolveDto(Inputs.Engineering.HelicalGearOutlineDto, inputs);
144
+ return gearOutlinePoints(helicalGearOutline(resolved, [0, 0], resolved.rotation), resolved.segments);
145
+ }
146
+ /**
147
+ * Works out the cones and outer circles of a straight bevel gear meshing a mate at a shaft
148
+ * angle: its pitch, tip and root cones, back radii and apex distance.
149
+ *
150
+ * A tip cone of 90 degrees or more is refused.
151
+ * Example: module 2, 20 teeth meshing 40 at 90 degrees -> pitch cone 26.57 degrees, apex 40 away
152
+ * @param inputs - The teeth, the mate's teeth and the shaft angle
153
+ * @returns The radii and distances in model units and the cone angles in degrees
154
+ * @group bevel
155
+ * @shortname bevel gear sizes
156
+ * @drawable false
157
+ * @example
158
+ * ```typescript
159
+ * const pinion = bitbybit.engineering.mechanical.gears.bevelGearSizes({ module: 2, teeth: 20, mateTeeth: 40 });
160
+ * const wheel = bitbybit.engineering.mechanical.gears.bevelGearSizes({ module: 2, teeth: 40, mateTeeth: 20 });
161
+ * ```
162
+ */
163
+ bevelGearSizes(inputs) {
164
+ const resolved = resolveDto(Inputs.Engineering.BevelGearSizesDto, inputs);
165
+ return bevelGearSizes(resolved);
166
+ }
167
+ /**
168
+ * Draws a straight bevel gear's teeth as points on the XY plane around the origin, as seen from
169
+ * the apex on the plane of the outer pitch circle, by Tredgold's approximation.
170
+ *
171
+ * The flanks run straight to the apex, so the section in a plane nearer it is this outline scaled
172
+ * by its distance over `apexDistance`.
173
+ * @param inputs - The teeth, the mate's teeth, the shaft angle, the turn and the segments per curve
174
+ * @returns The points of the outline
175
+ * @group bevel
176
+ * @shortname bevel gear outline
177
+ * @drawable true
178
+ * @example
179
+ * ```typescript
180
+ * const sizes = bitbybit.engineering.mechanical.gears.bevelGearSizes({ module: 1, teeth: 20, mateTeeth: 30 });
181
+ * const outline = bitbybit.engineering.mechanical.gears.bevelGearOutline({ module: 1, teeth: 20, mateTeeth: 30 });
182
+ * const section = await bitbybit.manifold.crossSection.crossSectionFromPoints({ points: outline, fillRule: Bit.Inputs.Manifold.fillRuleEnum.positive, removeDuplicates: false, tolerance: 1e-7 });
183
+ * const gear = await bitbybit.manifold.crossSection.operations.extrude({ crossSection: section, height: sizes.apexDistance / 4, nDivisions: 1, twistDegrees: 0, scaleTopX: 0.75, scaleTopY: 0.75, center: false });
184
+ * ```
185
+ */
186
+ bevelGearOutline(inputs) {
187
+ const resolved = resolveDto(Inputs.Engineering.BevelGearOutlineDto, inputs);
188
+ return gearOutlinePoints(bevelGearOutline(resolved, [0, 0], resolved.rotation), resolved.segments);
189
+ }
190
+ /**
191
+ * Works out how two external spur gears mesh: centre distance, working pressure angle, contact
192
+ * ratio and ratio, profile shifts included.
193
+ *
194
+ * The contact ratio counts only involute contact, `interferes` flags tips reaching past it, and
195
+ * `tipShortening` and `clearance` show how shifts crowd tips into roots.
196
+ * Example: module 2, 20 and 30 teeth -> 50 apart, contact ratio 1.61
197
+ * @param inputs - The module, the teeth, the pressure angle, the tooth heights and the profile shifts
198
+ * @returns The centre distance, working pressure angle, contact ratio, ratio, interference, tip shortening and clearance
199
+ * @group pairs
200
+ * @shortname gear pair
201
+ * @drawable false
202
+ * @example
203
+ * ```typescript
204
+ * const pair = bitbybit.engineering.mechanical.gears.gearPair({ module: 2, teethA: 12, teethB: 20, profileShiftA: 0.5, profileShiftB: 0.5 });
205
+ * const sound = !pair.interferes && pair.clearance > 0 && pair.contactRatio > 1.2;
206
+ * ```
207
+ */
208
+ gearPair(inputs) {
209
+ const resolved = resolveDto(Inputs.Engineering.GearPairDto, inputs);
210
+ return gearPair(resolved);
211
+ }
212
+ /**
213
+ * Works out a spur gear meshing inside a ring gear: centre distance, contact ratio, ratio and
214
+ * interference.
215
+ *
216
+ * The contact ratio counts only involute contact. `interferes` flags ring tips below the gear's
217
+ * base circle, or gear tips catching ring tips when the two differ by few teeth.
218
+ * Example: module 2, 20 teeth in 60 -> 40 apart, ratio 3
219
+ * @param inputs - The module, the teeth and the pressure angle
220
+ * @returns The centre distance, contact ratio, ratio and interference
221
+ * @group pairs
222
+ * @shortname internal gear pair
223
+ * @drawable false
224
+ * @example
225
+ * ```typescript
226
+ * const pair = bitbybit.engineering.mechanical.gears.internalGearPair({ module: 2, pinionTeeth: 24, ringTeeth: 60 });
227
+ * ```
228
+ */
229
+ internalGearPair(inputs) {
230
+ const resolved = resolveDto(Inputs.Engineering.InternalGearPairDto, inputs);
231
+ return internalGearPair(resolved);
232
+ }
233
+ /**
234
+ * Lays out a planetary gear set around a sun at rotation 0: the ring's teeth, where the planets
235
+ * sit, how far each planet and the ring turn to mesh, the ratio with the ring held, and whether
236
+ * the planets mesh, keep clear of each other and interfere.
237
+ *
238
+ * They mesh when the sun's and ring's teeth together divide by the planets.
239
+ * @param inputs - The module, the sun's and a planet's teeth, the planets and the pressure angle
240
+ * @returns The layout and its checks
241
+ * @group planetary
242
+ * @shortname planetary set
243
+ * @drawable false
244
+ * @example
245
+ * ```typescript
246
+ * const set = bitbybit.engineering.mechanical.gears.planetarySet({ module: 1, sunTeeth: 24, planetTeeth: 24, planets: 4 });
247
+ * const ringTeeth = set.ringTeeth;
248
+ * ```
249
+ */
250
+ planetarySet(inputs) {
251
+ const resolved = resolveDto(Inputs.Engineering.PlanetarySetDto, inputs);
252
+ return planetarySet(resolved);
253
+ }
254
+ /**
255
+ * Works out the lines of an involute rack: its pitch, its length, how far its tips stand above
256
+ * the pitch line, how deep its gaps reach below it and how thick each tooth is on it.
257
+ *
258
+ * Example: module 2, 10 teeth -> pitch 6.28, 62.8 long
259
+ * @param inputs - The teeth and the height
260
+ * @returns The sizes in model units
261
+ * @group racks
262
+ * @shortname rack sizes
263
+ * @drawable false
264
+ * @example
265
+ * ```typescript
266
+ * const rack = bitbybit.engineering.mechanical.gears.rackSizes({ module: 2, teeth: 10, height: 6 });
267
+ * ```
268
+ */
269
+ rackSizes(inputs) {
270
+ const resolved = resolveDto(Inputs.Engineering.RackSizesDto, inputs);
271
+ return rackSizes(resolved);
272
+ }
273
+ /**
274
+ * Draws an involute rack's outline as points on the XY plane, a closed counterclockwise loop not
275
+ * repeating its start: pitch line on the x axis, teeth along +y, the first tooth's middle on the
276
+ * origin.
277
+ *
278
+ * A spur gear of the same module meshes with its centre its pitch radius, plus its profile shift
279
+ * times the module, above the pitch line.
280
+ * @param inputs - The teeth, the height and the segments per curve
281
+ * @returns The points of the outline
282
+ * @group racks
283
+ * @shortname rack outline
284
+ * @drawable true
285
+ * @example
286
+ * ```typescript
287
+ * const outline = bitbybit.engineering.mechanical.gears.rackOutline({ module: 2, teeth: 10, height: 6 });
288
+ * ```
289
+ */
290
+ rackOutline(inputs) {
291
+ const resolved = resolveDto(Inputs.Engineering.RackOutlineDto, inputs);
292
+ return gearOutlinePoints(rackOutline(resolved), resolved.segments);
293
+ }
294
+ /**
295
+ * Gives the module of an inch gear from its diametral pitch, in the model's unit, so the gear
296
+ * methods can size it.
297
+ *
298
+ * The module is the pitch diameter over the teeth, the inverse of the diametral pitch: 1 / DP
299
+ * inches, or 25.4 / DP millimetres. Example: 10 DP -> 0.1 inches, or 2.54 millimetres
300
+ * @param inputs - The diametral pitch and the unit
301
+ * @returns The module in `unit`
302
+ * @group spur
303
+ * @shortname module from diametral pitch
304
+ * @drawable false
305
+ * @example
306
+ * ```typescript
307
+ * const gearModule = bitbybit.engineering.mechanical.gears.moduleFromDiametralPitch({ diametralPitch: 12, unit: Bit.Inputs.Base.unitOfLengthEnum.inch });
308
+ * const pinion = bitbybit.engineering.mechanical.gears.spurGearSizes({ module: gearModule, teeth: 24 });
309
+ * ```
310
+ */
311
+ moduleFromDiametralPitch(inputs) {
312
+ const resolved = resolveDto(Inputs.Engineering.ModuleFromDiametralPitchDto, inputs);
313
+ if (!(resolved.diametralPitch > 0) || !Number.isFinite(resolved.diametralPitch)) {
314
+ throw new InputError("`diametralPitch` is not a finite number more than 0.", "diametralPitch");
315
+ }
316
+ return snappedLength(1 / resolved.diametralPitch, "in", checkedUnitOfLength(resolved.unit, "unit"));
317
+ }
318
+ }
@@ -0,0 +1,24 @@
1
+ export * from "./mechanical";
2
+ export * from "./gears";
3
+ export * from "./threads";
4
+ export * from "./threads-iso";
5
+ export * from "./threads-ansi";
6
+ export * from "./fasteners";
7
+ export * from "./fasteners-iso";
8
+ export * from "./fasteners-ansi";
9
+ export * from "./bearings";
10
+ export * from "./bearings-ansi";
11
+ export * from "./bearings-iso";
12
+ export * from "./keys";
13
+ export * from "./keys-ansi";
14
+ export * from "./keys-din";
15
+ export * from "./springs";
16
+ export * from "./retaining-rings";
17
+ export * from "./retaining-rings-ansi";
18
+ export * from "./retaining-rings-din";
19
+ export * from "./splines";
20
+ export * from "./splines-ansi";
21
+ export * from "./splines-din";
22
+ export * from "./knurls";
23
+ export * from "./knurls-ansi";
24
+ export * from "./knurls-din";
@@ -0,0 +1,24 @@
1
+ export * from "./mechanical";
2
+ export * from "./gears";
3
+ export * from "./threads";
4
+ export * from "./threads-iso";
5
+ export * from "./threads-ansi";
6
+ export * from "./fasteners";
7
+ export * from "./fasteners-iso";
8
+ export * from "./fasteners-ansi";
9
+ export * from "./bearings";
10
+ export * from "./bearings-ansi";
11
+ export * from "./bearings-iso";
12
+ export * from "./keys";
13
+ export * from "./keys-ansi";
14
+ export * from "./keys-din";
15
+ export * from "./springs";
16
+ export * from "./retaining-rings";
17
+ export * from "./retaining-rings-ansi";
18
+ export * from "./retaining-rings-din";
19
+ export * from "./splines";
20
+ export * from "./splines-ansi";
21
+ export * from "./splines-din";
22
+ export * from "./knurls";
23
+ export * from "./knurls-ansi";
24
+ export * from "./knurls-din";
@@ -0,0 +1,27 @@
1
+ import * as Inputs from "../../../inputs";
2
+ import type { ParallelKeySizes } from "../../../keys/key-types";
3
+ /**
4
+ * The sizes of ANSI B17.1 square parallel keys and their keyseats, with no CAD kernel needed, in the
5
+ * unit asked for. `occt.parts.mechanical.keys.ansi` builds the keys as solids and
6
+ * `occt.parts.mechanical.machining.ansi` cuts their keyseats.
7
+ * @beta
8
+ */
9
+ export declare class EngineeringKeysAnsi {
10
+ /**
11
+ * Gives the ANSI B17.1 square key for a shaft: the key's width and height, and how deep its
12
+ * keyseat goes into the shaft and into the hub.
13
+ *
14
+ * Depths are from the top of the round, half the key standing at each keyseat's side. Example: a 1
15
+ * inch shaft -> a 1/4 square key, 0.141 deep in the shaft
16
+ * @param inputs - The shaft's diameter and the unit
17
+ * @returns The key's and keyseat's sizes in `unit`
18
+ * @group parallel keys
19
+ * @shortname ansi parallel key sizes
20
+ * @drawable false
21
+ * @example
22
+ * ```typescript
23
+ * const key = bitbybit.engineering.mechanical.keys.ansi.parallelKeySizes({ shaftDiameter: 1 });
24
+ * ```
25
+ */
26
+ parallelKeySizes(inputs: Inputs.Engineering.AnsiParallelKeySizesDto): ParallelKeySizes;
27
+ }
@@ -0,0 +1,32 @@
1
+ import * as Inputs from "../../../inputs";
2
+ import { resolveDto } from "../../../kernel-calls";
3
+ import { ansiParallelKeySizes } from "../../../keys/ansi-keys";
4
+ import { checkedUnitOfLength } from "../../helpers/geometry/lengths";
5
+ /**
6
+ * The sizes of ANSI B17.1 square parallel keys and their keyseats, with no CAD kernel needed, in the
7
+ * unit asked for. `occt.parts.mechanical.keys.ansi` builds the keys as solids and
8
+ * `occt.parts.mechanical.machining.ansi` cuts their keyseats.
9
+ * @beta
10
+ */
11
+ export class EngineeringKeysAnsi {
12
+ /**
13
+ * Gives the ANSI B17.1 square key for a shaft: the key's width and height, and how deep its
14
+ * keyseat goes into the shaft and into the hub.
15
+ *
16
+ * Depths are from the top of the round, half the key standing at each keyseat's side. Example: a 1
17
+ * inch shaft -> a 1/4 square key, 0.141 deep in the shaft
18
+ * @param inputs - The shaft's diameter and the unit
19
+ * @returns The key's and keyseat's sizes in `unit`
20
+ * @group parallel keys
21
+ * @shortname ansi parallel key sizes
22
+ * @drawable false
23
+ * @example
24
+ * ```typescript
25
+ * const key = bitbybit.engineering.mechanical.keys.ansi.parallelKeySizes({ shaftDiameter: 1 });
26
+ * ```
27
+ */
28
+ parallelKeySizes(inputs) {
29
+ const resolved = resolveDto(Inputs.Engineering.AnsiParallelKeySizesDto, inputs);
30
+ return ansiParallelKeySizes(resolved.shaftDiameter, checkedUnitOfLength(resolved.unit, "unit"));
31
+ }
32
+ }
@@ -0,0 +1,26 @@
1
+ import * as Inputs from "../../../inputs";
2
+ import type { ParallelKeySizes } from "../../../keys/key-types";
3
+ /**
4
+ * The sizes of DIN 6885 form A parallel keys and their keyways, with no CAD kernel needed, in the
5
+ * unit asked for. `occt.parts.mechanical.keys.din` builds the keys as solids and
6
+ * `occt.parts.mechanical.machining.din` cuts their keyways.
7
+ * @beta
8
+ */
9
+ export declare class EngineeringKeysDin {
10
+ /**
11
+ * Gives the DIN 6885 parallel key for a shaft: the key's width and height, and how deep its
12
+ * keyway goes into the shaft and into the hub.
13
+ *
14
+ * Example: a 20 mm shaft -> a 6 by 6 key, 3.5 deep in the shaft, 2.8 in the hub
15
+ * @param inputs - The shaft's diameter and the unit
16
+ * @returns The key's and keyway's sizes in `unit`
17
+ * @group parallel keys
18
+ * @shortname din parallel key sizes
19
+ * @drawable false
20
+ * @example
21
+ * ```typescript
22
+ * const key = bitbybit.engineering.mechanical.keys.din.parallelKeySizes({ shaftDiameter: 20 });
23
+ * ```
24
+ */
25
+ parallelKeySizes(inputs: Inputs.Engineering.DinParallelKeySizesDto): ParallelKeySizes;
26
+ }
@@ -0,0 +1,31 @@
1
+ import * as Inputs from "../../../inputs";
2
+ import { resolveDto } from "../../../kernel-calls";
3
+ import { dinParallelKeySizes } from "../../../keys/din-keys";
4
+ import { checkedUnitOfLength } from "../../helpers/geometry/lengths";
5
+ /**
6
+ * The sizes of DIN 6885 form A parallel keys and their keyways, with no CAD kernel needed, in the
7
+ * unit asked for. `occt.parts.mechanical.keys.din` builds the keys as solids and
8
+ * `occt.parts.mechanical.machining.din` cuts their keyways.
9
+ * @beta
10
+ */
11
+ export class EngineeringKeysDin {
12
+ /**
13
+ * Gives the DIN 6885 parallel key for a shaft: the key's width and height, and how deep its
14
+ * keyway goes into the shaft and into the hub.
15
+ *
16
+ * Example: a 20 mm shaft -> a 6 by 6 key, 3.5 deep in the shaft, 2.8 in the hub
17
+ * @param inputs - The shaft's diameter and the unit
18
+ * @returns The key's and keyway's sizes in `unit`
19
+ * @group parallel keys
20
+ * @shortname din parallel key sizes
21
+ * @drawable false
22
+ * @example
23
+ * ```typescript
24
+ * const key = bitbybit.engineering.mechanical.keys.din.parallelKeySizes({ shaftDiameter: 20 });
25
+ * ```
26
+ */
27
+ parallelKeySizes(inputs) {
28
+ const resolved = resolveDto(Inputs.Engineering.DinParallelKeySizesDto, inputs);
29
+ return dinParallelKeySizes(resolved.shaftDiameter, checkedUnitOfLength(resolved.unit, "unit"));
30
+ }
31
+ }
@@ -0,0 +1,14 @@
1
+ import { EngineeringKeysDin } from "./keys-din";
2
+ import { EngineeringKeysAnsi } from "./keys-ansi";
3
+ /**
4
+ * The sizes of parallel keys and their keyways by the standard that sets them, with no CAD kernel
5
+ * needed: `din` holds the metric DIN 6885 form A keys, `ansi` the ANSI B17.1 square keys, each in
6
+ * the unit asked for.
7
+ * `occt.parts.mechanical.keys` builds the keys as solids.
8
+ * @beta
9
+ */
10
+ export declare class EngineeringKeys {
11
+ readonly din: EngineeringKeysDin;
12
+ readonly ansi: EngineeringKeysAnsi;
13
+ constructor();
14
+ }
@@ -0,0 +1,15 @@
1
+ import { EngineeringKeysDin } from "./keys-din";
2
+ import { EngineeringKeysAnsi } from "./keys-ansi";
3
+ /**
4
+ * The sizes of parallel keys and their keyways by the standard that sets them, with no CAD kernel
5
+ * needed: `din` holds the metric DIN 6885 form A keys, `ansi` the ANSI B17.1 square keys, each in
6
+ * the unit asked for.
7
+ * `occt.parts.mechanical.keys` builds the keys as solids.
8
+ * @beta
9
+ */
10
+ export class EngineeringKeys {
11
+ constructor() {
12
+ this.din = new EngineeringKeysDin();
13
+ this.ansi = new EngineeringKeysAnsi();
14
+ }
15
+ }
@@ -0,0 +1,26 @@
1
+ import * as Inputs from "../../../inputs";
2
+ import type { KnurlSizes } from "../../../knurls/knurl-types";
3
+ /**
4
+ * The grooves of ASME B94.6 diametral pitch knurls on a cylinder, with no CAD kernel needed, in the
5
+ * unit asked for. `occt.parts.mechanical.machining.ansi` cuts them into a body.
6
+ * @beta
7
+ */
8
+ export declare class EngineeringKnurlsAnsi {
9
+ /**
10
+ * Works out a diametral pitch knurl's grooves on a cylinder: how many, the diameter they track on,
11
+ * how deep B94.6 presses them and their angle to the axis.
12
+ *
13
+ * A blank needs 24 teeth round it at 64 and 96 DP, 18 at 128 and 15 at 160. Example: 0.5 at 96 DP
14
+ * -> 48 grooves, 0.016 deep
15
+ * @param inputs - The diameter, the diametral pitch, the pattern and the unit
16
+ * @returns The grooves, the diameter that tracks and the depth in `unit`, and the helix angle
17
+ * @group knurls
18
+ * @shortname ansi knurl sizes
19
+ * @drawable false
20
+ * @example
21
+ * ```typescript
22
+ * const knurl = bitbybit.engineering.mechanical.knurls.ansi.knurlSizes({ diameter: 0.5, diametralPitch: 96, pattern: Bit.Inputs.Engineering.knurlPatternEnum.diamond });
23
+ * ```
24
+ */
25
+ knurlSizes(inputs: Inputs.Engineering.AnsiKnurlSizesDto): KnurlSizes;
26
+ }
@@ -0,0 +1,31 @@
1
+ import * as Inputs from "../../../inputs";
2
+ import { resolveDto } from "../../../kernel-calls";
3
+ import { ansiKnurlSizes } from "../../../knurls/ansi-knurls";
4
+ import { checkedUnitOfLength } from "../../helpers/geometry/lengths";
5
+ /**
6
+ * The grooves of ASME B94.6 diametral pitch knurls on a cylinder, with no CAD kernel needed, in the
7
+ * unit asked for. `occt.parts.mechanical.machining.ansi` cuts them into a body.
8
+ * @beta
9
+ */
10
+ export class EngineeringKnurlsAnsi {
11
+ /**
12
+ * Works out a diametral pitch knurl's grooves on a cylinder: how many, the diameter they track on,
13
+ * how deep B94.6 presses them and their angle to the axis.
14
+ *
15
+ * A blank needs 24 teeth round it at 64 and 96 DP, 18 at 128 and 15 at 160. Example: 0.5 at 96 DP
16
+ * -> 48 grooves, 0.016 deep
17
+ * @param inputs - The diameter, the diametral pitch, the pattern and the unit
18
+ * @returns The grooves, the diameter that tracks and the depth in `unit`, and the helix angle
19
+ * @group knurls
20
+ * @shortname ansi knurl sizes
21
+ * @drawable false
22
+ * @example
23
+ * ```typescript
24
+ * const knurl = bitbybit.engineering.mechanical.knurls.ansi.knurlSizes({ diameter: 0.5, diametralPitch: 96, pattern: Bit.Inputs.Engineering.knurlPatternEnum.diamond });
25
+ * ```
26
+ */
27
+ knurlSizes(inputs) {
28
+ const resolved = resolveDto(Inputs.Engineering.AnsiKnurlSizesDto, inputs);
29
+ return ansiKnurlSizes(resolved.diameter, resolved.diametralPitch, resolved.pattern, checkedUnitOfLength(resolved.unit, "unit"));
30
+ }
31
+ }
@@ -0,0 +1,26 @@
1
+ import * as Inputs from "../../../inputs";
2
+ import type { KnurlSizes } from "../../../knurls/knurl-types";
3
+ /**
4
+ * The grooves of DIN 82 knurls on a cylinder, with no CAD kernel needed, in the unit asked for.
5
+ * `occt.parts.mechanical.machining.din` cuts them into a body.
6
+ * @beta
7
+ */
8
+ export declare class EngineeringKnurlsDin {
9
+ /**
10
+ * Works out a knurl's grooves on a cylinder: how many fit at the pitch, the diameter that
11
+ * makes them divide it evenly, their depth and their angle to the axis.
12
+ *
13
+ * Turn the cylinder to the corrected diameter before knurling; the pitch is in millimetres as
14
+ * DIN 82 names it. Example: 19.6 at pitch 0.8 -> 77 grooves on 19.608
15
+ * @param inputs - The diameter, the pitch, the pattern and the unit
16
+ * @returns The grooves, the corrected diameter and the depth in `unit`, and the helix angle
17
+ * @group knurls
18
+ * @shortname din knurl sizes
19
+ * @drawable false
20
+ * @example
21
+ * ```typescript
22
+ * const knurl = bitbybit.engineering.mechanical.knurls.din.knurlSizes({ diameter: 19.6, pitch: 0.8, pattern: Bit.Inputs.Engineering.knurlPatternEnum.diamond });
23
+ * ```
24
+ */
25
+ knurlSizes(inputs: Inputs.Engineering.DinKnurlSizesDto): KnurlSizes;
26
+ }
@@ -0,0 +1,31 @@
1
+ import * as Inputs from "../../../inputs";
2
+ import { resolveDto } from "../../../kernel-calls";
3
+ import { dinKnurlSizes } from "../../../knurls/din-knurls";
4
+ import { checkedUnitOfLength } from "../../helpers/geometry/lengths";
5
+ /**
6
+ * The grooves of DIN 82 knurls on a cylinder, with no CAD kernel needed, in the unit asked for.
7
+ * `occt.parts.mechanical.machining.din` cuts them into a body.
8
+ * @beta
9
+ */
10
+ export class EngineeringKnurlsDin {
11
+ /**
12
+ * Works out a knurl's grooves on a cylinder: how many fit at the pitch, the diameter that
13
+ * makes them divide it evenly, their depth and their angle to the axis.
14
+ *
15
+ * Turn the cylinder to the corrected diameter before knurling; the pitch is in millimetres as
16
+ * DIN 82 names it. Example: 19.6 at pitch 0.8 -> 77 grooves on 19.608
17
+ * @param inputs - The diameter, the pitch, the pattern and the unit
18
+ * @returns The grooves, the corrected diameter and the depth in `unit`, and the helix angle
19
+ * @group knurls
20
+ * @shortname din knurl sizes
21
+ * @drawable false
22
+ * @example
23
+ * ```typescript
24
+ * const knurl = bitbybit.engineering.mechanical.knurls.din.knurlSizes({ diameter: 19.6, pitch: 0.8, pattern: Bit.Inputs.Engineering.knurlPatternEnum.diamond });
25
+ * ```
26
+ */
27
+ knurlSizes(inputs) {
28
+ const resolved = resolveDto(Inputs.Engineering.DinKnurlSizesDto, inputs);
29
+ return dinKnurlSizes(resolved.diameter, resolved.pitch, resolved.pattern, checkedUnitOfLength(resolved.unit, "unit"));
30
+ }
31
+ }
@@ -0,0 +1,14 @@
1
+ import { EngineeringKnurlsDin } from "./knurls-din";
2
+ import { EngineeringKnurlsAnsi } from "./knurls-ansi";
3
+ /**
4
+ * The grooves of knurls on a cylinder by the standard that sets them, with no CAD kernel needed:
5
+ * `din` holds the metric DIN 82 knurls, `ansi` the ASME B94.6 diametral pitch ones, each in the unit
6
+ * asked for. `occt.parts.mechanical.machining`
7
+ * cuts them into a body.
8
+ * @beta
9
+ */
10
+ export declare class EngineeringKnurls {
11
+ readonly din: EngineeringKnurlsDin;
12
+ readonly ansi: EngineeringKnurlsAnsi;
13
+ constructor();
14
+ }