Created
December 3, 2025 22:00
-
-
Save ednisley/b958ed086f509a253f4d0bb0de4432d7 to your computer and use it in GitHub Desktop.
OpenSCAD source code: Stacked change gear generator for mini-lathe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // LMS Mini-Lathe | |
| // Change gears with stacking | |
| // Ed Nisley - KE4ZNU | |
| // 2020-05 use Inkscape SVG gears | |
| // 2025-12 use BOSL2 gear generator | |
| include <BOSL2/std.scad> | |
| include <BOSL2/gears.scad> | |
| /* [Gears] */ | |
| TopGear = 0; // zero for single gear | |
| BottomGear = 28; | |
| /* [Hidden] */ | |
| ThreadThick = 0.20; | |
| HoleWindage = 0.2; | |
| Protrusion = 0.1; // make holes end cleanly | |
| /* [Dimensions] */ | |
| ShaftOD = 12.0; | |
| GearThick = 7.75; | |
| Keyway = [3.5,3.0,3*GearThick]; // x on radius, y on perim | |
| LegendEnable = (TopGear == 0 && BottomGear > 27) || (TopGear > 27); | |
| LegendThick = 2*ThreadThick; | |
| LegendZ = (TopGear ? 2*GearThick : GearThick) - LegendThick; | |
| LegendSize = 5; | |
| LegendRecess = [8,6,LegendThick]; | |
| LegendOffset = [0,LegendRecess.y/2 + ShaftOD/2 + HoleWindage,LegendZ + LegendRecess.z/2]; | |
| //----------------------- | |
| // Build it! | |
| union() { | |
| difference() { | |
| union() { | |
| spur_gear(mod=1,teeth=BottomGear,thickness=GearThick,shaft_diam=ShaftOD + HoleWindage,anchor=BOTTOM); | |
| if (TopGear) | |
| spur_gear(mod=1,teeth=TopGear,thickness=2*GearThick,shaft_diam=ShaftOD + HoleWindage,anchor=BOTTOM); | |
| } | |
| right(ShaftOD/2) | |
| down(Protrusion) | |
| cube(Keyway,anchor=CENTER+BOTTOM); | |
| if (LegendEnable) { | |
| translate(LegendOffset) | |
| cube(LegendRecess + [0,0,Protrusion],anchor=CENTER); | |
| if (TopGear) | |
| zrot(180) | |
| translate(LegendOffset) | |
| cube(LegendRecess + [0,0,Protrusion],anchor=CENTER); | |
| } | |
| } | |
| if (LegendEnable) | |
| translate([0,0,LegendZ - Protrusion]) | |
| linear_extrude(height=LegendThick + Protrusion,convexity=10) { | |
| translate([LegendOffset.x,LegendOffset.y]) | |
| text(text=str(BottomGear),size=LegendSize,font="Arial:style:Bold",halign="center",valign="center"); | |
| if (TopGear) | |
| zrot(180) | |
| translate([LegendOffset.x,LegendOffset.y]) | |
| text(text=str(TopGear),size=LegendSize,font="Arial:style:Bold",halign="center",valign="center"); | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More details on my blog at https://softsolder.com/2025/12/04/mini-lathe-change-gear-generator-redux/