Sign in with STEVE

Compare versions

3 files changed, +63 −8 1.1.0: Real teeth. detail = simple keeps them filled in.

part.py +43 −3
@@ -1,9 +1,14 @@
1"""Straight miter gear (ratio 1:1), KHK SM series: an envelope for assemblies, the solid of revolution of the published outline with the teeth filled in:
2hub of diameter B and width H on the XY plane, the back cone out to the outside diameter D at G above the back (the crown), and the tip cone at 45 degrees
3up to the total length F, with the bore A through. Axis along Z; the back is on the XY plane. The teeth aren't modelled."""
1"""Straight miter gear (ratio 1:1), KHK SM series. The outline is the published one: hub of diameter B and width H on the XY plane, the back cone out to the outside diameter D
2at G above the back (the crown), a 45 degree tip cone up to the total length F, and the bore A through. detail = "full" cuts the teeth into it: each gap runs along the pitch cone
3to the apex, its section computed with Tredgold's approximation (the involute of the equivalent spur gear of z / cos 45 degrees teeth, ISO 53 proportions). This is close for looks and
4fits, not a tooth-contact model. detail = "simple" keeps the teeth filled in. Axis along Z; the back is on the XY plane."""
5import math
6
47from steve import Model
58
9
610designation = "SM1-20" # Catalogue number
11detail = "full" # full: real teeth; simple: the outline with the teeth filled in
712
813# number: (module, teeth, bore A, hub diameter B, outside diameter D, total length F, crown to back G, hub width H).
914# KHK Gears catalogue 2025, Miter Gears, SM table, PDF p. 26, https://khkgears.us/media/lblpmezm/catalog-2025-miter-gears.pdf
@@ -37,6 +42,41 @@
3742with model.sketch("outline", on="XZ", name="Outline") as sk:
3843 sk.polyline("profile", [(A / 2, 0), (B / 2, 0), (B / 2, H), (D / 2, G), (tip_radius, F), (A / 2, F)], closed=True)
3944model.revolve("gear", "outline", axis="Z", name="Gear")
45if detail == "full":
46 pressure = math.radians(20)
47 cone = math.radians(45)
48 pitch_r = module * teeth / 2
49 equivalent = pitch_r / math.cos(cone)
50 base = equivalent * math.cos(pressure)
51 root_r = pitch_r - 1.25 * module * math.cos(cone)
52 apex = G + D / 2
53
54
55 def involute(angle):
56 return math.tan(angle) - angle
57
58
59 def half_gap(r):
60 rho = equivalent + (r - pitch_r) / math.cos(cone)
61 angle = math.acos(base / rho) if rho > base else 0
62 half_tooth = (math.pi / (2 * teeth / math.cos(cone)) + involute(pressure) - involute(angle)) * rho / r
63 return math.pi / teeth - half_tooth
64
65
66 top_r = D / 2
67 radii = [root_r + (top_r - root_r) * i / 4 for i in range(5)]
68 section = [(r, half_gap(r)) for r in radii]
69 section.append((top_r * 1.3, half_gap(top_r)))
70 planes = (("gap_low", H), ("gap_high", F + 0.5))
71 for name, z in planes:
72 scale = (apex - z) / (apex - G)
73 model.plane(f"{name}_plane", on="XY", offset=z, name="Gap section")
74 points = [(r * scale * math.sin(-g), r * scale * math.cos(g)) for r, g in section]
75 points += [(r * scale * math.sin(g), r * scale * math.cos(g)) for r, g in reversed(section)]
76 with model.sketch(f"{name}_sketch", on=f"{name}_plane", name="Gap section") as sk:
77 sk.polyline(f"{name}_outline", points, closed=True)
78 model.loft("gap", ["gap_low_sketch", "gap_high_sketch"], ruled=True, op="cut", name="Tooth gap")
79 model.circular_pattern("gaps", axis="Z", count=teeth, features=["gap"], name="Tooth gaps")
4080model.material("steel-generic", color="#b4b8bd")
4181result = model.result()
4282
pypart.toml +17 −3
@@ -1,17 +1,24 @@
11name = "steve/miter-gear"
2version = "1.0.0"
2version = "1.1.0"
33runtime = "steve"
44license = "MIT"
55summary = "Straight miter gear (1:1 bevel, 90 degree) envelope, modules 1 to 3, with catalogue numbers as presets."
6description = """Straight miter gear (1:1 bevel gears at 90 degrees) as an envelope for assemblies: the solid of revolution of the published outline with the teeth \
7filled in. Axis along Z, back on the XY plane. Dimensions from a maker's public catalogue (see the README); not affiliated with any maker."""
6description = """Straight miter gear (1:1 bevel gears at 90 degrees) with teeth cut along the pitch cone, on a maker's published outline. The tooth sections use Tredgold's approximation of the involute: close for looks and fits, not a tooth-contact model. detail = simple keeps the teeth filled in. Axis along Z, back on the XY plane. See the README; not affiliated with any maker."""
87tags = ["gear", "bevel-gear", "miter-gear", "metric", "power-transmission"]
8changes = "Real teeth. detail = simple keeps them filled in."
99
1010[parameters.designation]
1111type = "choice"
1212default = "SM1-20"
1313choices = ["SM1-20", "SM1-25", "SM1-30", "SM1.25-20", "SM1.25-25", "SM1.25-30", "SM1.5-20", "SM1.5-25", "SM1.5-30", "SM2-16", "SM2-20", "SM2-25", "SM2-30", "SM2.5-16", "SM2.5-20", "SM2.5-25", "SM2.5-30", "SM3-16", "SM3-20", "SM3-25", "SM3-30"]
1414label = "Catalogue number"
15
16[parameters.detail]
17type = "choice"
18default = "full"
19choices = ["full", "simple"]
20label = "Detail"
21description = "full: real teeth. simple: the outline with the teeth filled in, for big assemblies."
1522
1623[[presets]]
1724id = "SM1-20"
@@ -160,3 +167,10 @@
160167aliases = ["miter gear M3 30T", "KHK SM3-30"]
161168standard = "KHK SM"
162169
170[[presets]]
171id = "SM1-20-simple"
172title = "SM1-20, simple (teeth filled in)"
173params = { designation = "SM1-20", detail = "simple" }
174aliases = ["SM1-20 simple"]
175standard = "KHK SM"
176
README.md +3 −2
@@ -4,8 +4,9 @@
44
55## Geometry
66
7A solid of revolution with the teeth filled in: the hub, the back cone out to the outside diameter D at the crown (G above the back), a 45° cone up to the
8total length F, and the bore. Teeth aren't modelled: this part is for layouts and fits, not tooth contact.
7The published outline: the hub, the back cone out to the outside diameter D at the crown (G above the back), a 45° cone up to the total length F, and the bore. `detail = "full"`
8cuts the teeth into it, each gap running along the pitch cone to the apex. Tooth sections use Tredgold's approximation: the involute of the equivalent spur gear of z / cos 45° teeth,
9with ISO 53 proportions (20°, addendum 1.0 m, dedendum 1.25 m). This is close for looks and fits; it isn't a tooth-contact model. `detail = "simple"` keeps the teeth filled in.
910
1011## Source
1112