File Exchange

image thumbnail

Involute Spur Gear Profile Calculator

version 1.0.1 (4.09 KB) by umar hasan
Generate exportable Vector Path of involute spur gears using code


Updated 19 Jul 2019

View License

Some time ago, i needed to generate a spur gear profile that i code protrude in Solid Edge and later Laser Cut on Acrylic sheets for a product of mine. Since I was using some commercial gears alongwith my newly designed gears, I needed a solution that could generate DXF/EPS of the mating spur gear with specific number of teeth, addendum, dedendum and pressure angles.

One solution, which, unfortunately, wasn't free, but was extremely useful was to use the calculator on this site: (2USD / day)

So, I took a day out and wrote my own gear calculator.
The method is inspired from a graphical technique used by Soumitra Vadnerker on Youtube at where he teaches how to make an involute spur gear in Autodesk AutoCad. I've converted the same steps to Matlab Code which outputs all the points in sequence to form a graphic path. Some work is still needed in order to use this code for prototypes but it can easily be done in applications like Autodesk AutoCAD, Adobe Illustrator, Freeware InkSpace etc.

Download and extract the files in a single directory and run DrawAll for an animated example.

The main function which does the math is MakeGear1 which asks for:
1: N = Number of teeth required
2: PA = Pressure Angle (in degrees)
3: Pitch = Teeth Pitch (in millimeters/inches or units of similar scale)
4: lRes = linear resolution of the output image (in same units as the Pitch)
5: ACDFac = (default = 2), Addendum Circle Dia factor (A. C. Dia = ToothThickness * 2 * (N + ACDFac) / pi)
6: DCDFac = (default = 2), Dedendum Circle Dia factor (D. C. Dia = ToothThickness * 2 * (N - DCDFac) / pi)
The function returns:
1: tcxAll = xCoordinates of the gear, centered on [0,0]
2: tcyAll = yCoordinates of the gear, centered on [0,0]
3: PCD = Pitch Circle DiaMeter
4: ACDFinal = Addendum Circle Diameter

Cite As

umar hasan (2020). Involute Spur Gear Profile Calculator (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)



Added a screenshot

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags