A comprehensive FreeCAD workbench for designing all types of parametric gears.
NOTE: This workbench is in heavy development, so will very likely change. Feel free to contribute, but for now, don't rely on it being consistant. Note: This workbench is separate from the built-in "Gear" workbench (freecad.gears). GearWorkbench provides extensive customization options, multiple gear types (spur, helical, rack, bevel, etc)
- Parametric gears with proper mathematical profiles
- Multiple bore types: circular, square, hexagonal, DIN 6885 keyway
Alpha - Many gear types are now functional: Spur gear, Internal Spur gear, Rack gear, Cycloid gear, Cycloid Rack gear, Bevel Gear, Crown Gear, Worm Gear, Globoid Worm Gear, and Double Helical Gear. Development continues on additional types and further refinements.
- FreeCAD v1.0 or higher
- Python 3.9+
cd ~/.local/share/FreeCAD/Mod # or ~/.local/share/FreeCAD/v1-2/Mod
git clone https://github.com/iplayfast/GearWorkbench.gitcd %APPDATA%\FreeCAD\Mod
git clone https://github.com/iplayfast/GearWorkbench.gitRestart FreeCAD after installation.
- Start FreeCAD
- Select GearWorkbench from the Workbench dropdown menu
- Click the Create Spur Gear icon in the toolbar
- A parametric spur gear will be created with default values
- Adjust the values to create the perfect gear for your needs
- delete the parameters. Your gear is now locked, (other then normal freecad operations).
| Parameter | Description | Range | Default |
|---|---|---|---|
| Module | Tooth size (mm). Larger module = larger teeth | 0.3 - 75 mm | 2.0 mm |
| Number of Teeth | Total teeth on gear | 6 - 150 | 20 |
| Pressure Angle | Tooth profile angle (normally 20° or 25°) | 1° - 35° | 20° |
| Profile Shift | Moves cutter to prevent undercutting | -1 to +1 | 0 |
| Height | Gear thickness/length | > 0 mm | 10 mm |
| Parameter | Description | Options |
|---|---|---|
| Bore Type | Center hole style | none, circular, square, hexagonal, keyway |
| Bore Diameter | Diameter of center hole | > 0 mm |
| Square Corner Radius | Corner rounding for square bore | > 0 mm |
| Hex Corner Radius | Corner rounding for hex bore | > 0 mm |
| Keyway Width | Width of DIN 6885 keyway | > 0 mm |
| Keyway Depth | Depth of keyway from bore surface | > 0 mm |
- Pitch Diameter: Where gears mesh (= module × teeth)
- Base Diameter: Involute origin circle
- Outer Diameter: Tip of teeth
- Root Diameter: Bottom of teeth
The module determines tooth size:
- Pitch diameter = Module × Number of teeth
- Tooth height ≈ 2.25 × Module
- Larger module = stronger teeth, bigger gear
- For 3D printing: 1-3mm modules work well
Standard pressure angles:
- 14.5°: Older standard, smoother operation
- 20°: Modern ISO standard, stronger teeth
- 25°: Higher strength, used for small gears
Adjusts tooth position to:
- Positive shift (+): Prevents undercutting on small gears, increases strength
- Negative shift (-): Allows closer center distances (use with caution)
- Zero shift (0): Standard configuration
Undercut Warning: Gears with < 17 teeth at 20° pressure angle may show undercut warning. Use positive profile shift to correct.
To create two gears that mesh:
- Create first gear with desired module and pressure angle
- Create second gear with same module and same pressure angle
- Can have different tooth counts for desired gear ratio
- Center distance = (teeth1 + teeth2) × module / 2
Example - 2:1 ratio:
- Gear 1: 20 teeth, module 2mm, PA 20°
- Gear 2: 40 teeth, module 2mm, PA 20°
- Center distance: (20 + 40) × 2 / 2 = 60mm
- Module selection: 1.5-3mm works well for most desktop printers
- Minimum teeth: Use ≥ 12 teeth to avoid weak tooth bases
- Layer orientation: Print gears flat for strongest teeth
- Clearance: 0.1-0.2mm clearance between meshing gears
- Support material: Usually not needed if printed flat
- Infill: 50-100% for functional gears
cd GearWorkbench
pip install -r requirements-dev.txt
pytest tests/ -v# Format code
black gearMath.py spurGear.py InitGui.py
# Lint
flake8 .
pylint gearMath.py spurGear.py
# Type check
mypy gearMath.py --ignore-missing-importsThe workbench implements proper involute gear mathematics:
- Involute curve: Generated by unwrapping a string from the base circle
- Base circle: db = d × cos(pressure_angle)
- Tooth thickness: Adjusted by profile shift
- Undercut detection: Validates minimum teeth for given pressure angle
For detailed mathematics, see the source code documentation in gearMath.py and CLAUDE.md.
- ✅ Spur gears
- ⬜ Helical gears (with helix angle)
- ⬜ Rack (linear gear)
- ⬜ Internal gears (ring gears)
- ⬜ Bevel gears (90° drive)
- ✅ Double helical/herringbone
- ✅ Worm gears
- ✅ Globoid Worm Gear
- ⬜ Internal Helical Gear
- ⬜ Hypoid Gear
- ⬜ Screw Gear
- ⬜ Non-Circular Gear
- ⬜ Gear train analysis
- ⬜ Strength calculations
- ✅ NEW: Generic Gear Framework (unified spur, helical, herringbone)
This workbench complements the existing CycloidGearBox workbench, which creates cycloidal drives (different from involute gears).
LGPL-2.1 - See LICENSE file
Contributions welcome! Please see CONTRIBUTING.md (if exists) or open an issue.
Please open an issue in this repository's issue queue for bugs, feature requests, or questions.
Based on involute gear mathematics from:
- Dudley's Handbook of Practical Gear Design
- ISO 53:1998 (Cylindrical gears for general engineering)
- STLGears.com for parameter ranges and UI inspiration
Special thanks to the FreeCAD community and the freecad Gears workbench project for the foundational design patterns.
