diff --git a/readme.md b/readme.md index 23864d5..0e712fe 100644 --- a/readme.md +++ b/readme.md @@ -5254,6 +5254,7 @@ The origin of the rack is the left end of the pitch line and its width is below |:--- |:--- | | ```centre_distance(m, z1, z2, pa = 20)``` | Calculate distance between centres taking profile shift into account | | ```involute(r, u)``` | Involute of circle radius r at angle u in radians | +| ```involute_gear_od(m, z, pa = 20)``` | involute gear outside diameter given modulus, tooth count and pressure angle | | ```involute_rack_tooth_profile(m, pa = 20, clearance = undef)``` | Calculate rack tooth profile given module and pressure angle | | ```involute_worm_profile(m, pa = 20, clearance = undef)``` | Calculate worm profile suitable for passing to thread() | | ```profile_shift(z, pa)``` | Calculate profile shift for small gears | diff --git a/utils/gears.scad b/utils/gears.scad index 0999b03..c3e3328 100644 --- a/utils/gears.scad +++ b/utils/gears.scad @@ -46,6 +46,9 @@ function profile_shift(z, pa) = z ? max(1 - z * sqr(sin(pa)) / 2, 0) : 0; //! Ca function centre_distance(m, z1, z2, pa = 20) = //! Calculate distance between centres taking profile shift into account let(x1 = profile_shift(z1, pa), x2 = profile_shift(z2, pa)) m * (z1/2 + z2/2 + x1 + x2); +function involute_gear_od(m, z, pa = 20) = //! involute gear outside diameter given modulus, tooth count and pressure angle + m * (z + 2 * profile_shift(z, pa) + 2); + module involute_gear_profile(m, z, pa = 20, clearance = undef, steps = 20) { //! Calculate gear profile given module, number of teeth and pressure angle assert(z >= 7, "Gears must have at least 7 teeth."); d = m * z; // Reference pitch circle diameter