bandsaw_basics 0.1.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 (5) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +9 -0
  3. data/README.md +22 -0
  4. data/lib/bandsaw_basics.rb +19 -0
  5. metadata +40 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 024eeda67564f5a8410e23b51a8b1703e52060b20e7646d6fea79da48375037d
4
+ data.tar.gz: b3ff78c88d88f9b17f9cd4b8da0a395d53ddc9e4e31f128d574b3a8f3f7d2482
5
+ SHA512:
6
+ metadata.gz: fb77e77d0de96d1a85eb8454923381de6cef48f9a426406d6fe0b6709cb110ef1f3d3a6e0c2faedc1faa452506070575e019d9745d489060a85369402d037266
7
+ data.tar.gz: 115a51865b2eab7d33d8c9213b08a54d7c7a3e0d8fb3b6b12bde924ce2f9b75bb49b65241da2e88810d29df764048ab241e2d31e36ee2b7b8064d03817cf2266
data/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Stankotorg
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # bandsaw_basics (Ruby)
2
+
3
+ Generic textbook band saw formulas (MIT). / Общие учебные формулы для ленточнопильных станков (MIT).
4
+
5
+ ## English
6
+ - `BandsawBasics.blade_length(d1, d2, c)` — blade length: L = 2C + π(D1+D2)/2 + (D1−D2)²/(4C)
7
+ - `BandsawBasics.cutting_time(height_mm, feed_mm_per_min)` — minutes = height / feed
8
+ - `BandsawBasics.tpi_to_pitch_mm(tpi)` — pitch = 25.4 / TPI
9
+ - `BandsawBasics.suggest_tpi(thickness_mm)` — rule of thumb: at least 3 teeth in the cut (clamped to 2–24 TPI)
10
+
11
+ ```ruby
12
+ require "bandsaw_basics"
13
+ BandsawBasics.blade_length(300, 300, 500) # ≈ 1942.5
14
+ ```
15
+
16
+ ## Русский
17
+ - `BandsawBasics.blade_length(d1, d2, c)` — длина полотна: L = 2C + π(D1+D2)/2 + (D1−D2)²/(4C)
18
+ - `BandsawBasics.cutting_time(height_mm, feed_mm_per_min)` — время реза, мин = высота / подача
19
+ - `BandsawBasics.tpi_to_pitch_mm(tpi)` — шаг зуба, мм = 25,4 / TPI
20
+ - `BandsawBasics.suggest_tpi(thickness_mm)` — эмпирическое правило: не менее 3 зубьев в резе (в пределах 2–24 TPI)
21
+
22
+ Homepage / Сайт: https://stankotorg.ru/kalkulyator-rezhimy-i-vremya-pileniya.htm
@@ -0,0 +1,19 @@
1
+ module BandsawBasics
2
+ module_function
3
+ def blade_length(d1, d2, c)
4
+ raise ArgumentError, "must be positive" unless d1 > 0 && d2 > 0 && c > 0
5
+ 2.0 * c + Math::PI * (d1 + d2) / 2.0 + (d1 - d2)**2 / (4.0 * c)
6
+ end
7
+ def cutting_time(height_mm, feed_mm_per_min)
8
+ raise ArgumentError, "bad input" if height_mm < 0 || feed_mm_per_min <= 0
9
+ height_mm.to_f / feed_mm_per_min
10
+ end
11
+ def tpi_to_pitch_mm(tpi)
12
+ raise ArgumentError, "tpi must be positive" unless tpi > 0
13
+ 25.4 / tpi
14
+ end
15
+ def suggest_tpi(thickness_mm, min_teeth = 3)
16
+ raise ArgumentError, "thickness must be positive" unless thickness_mm > 0
17
+ (min_teeth * 25.4 / thickness_mm).ceil.clamp(2, 24)
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,40 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bandsaw_basics
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Stankotorg
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ executables: []
13
+ extensions: []
14
+ extra_rdoc_files: []
15
+ files:
16
+ - LICENSE
17
+ - README.md
18
+ - lib/bandsaw_basics.rb
19
+ homepage: https://stankotorg.ru/kalkulyator-rezhimy-i-vremya-pileniya.htm
20
+ licenses:
21
+ - MIT
22
+ metadata: {}
23
+ rdoc_options: []
24
+ require_paths:
25
+ - lib
26
+ required_ruby_version: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ version: '2.6'
31
+ required_rubygems_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ requirements: []
37
+ rubygems_version: 4.0.20
38
+ specification_version: 4
39
+ summary: Generic textbook band saw formulas
40
+ test_files: []