Involute spur gear primitive, complete with tooth undercut and all-quad topology. Unencrypted and fully open for further hacking.
For two gears to mesh well, their modules and pressure angles have to be the same. The distance of their centers should be the sum of their extended pitch diameters (i.e. with the profile shift included). There’s also ‘mm per Unit’ spinner in case you work in generic units/different scale.
To learn more about the terminology and basics of gear design, see The ABC’s of Gears (start with page 12, chapters 2, 3 and 4).
Installation: Copy the .ms file to your scripts\startup folder or run as a script if you only want to try it out. The object primitive will be available under Examples in the Create panel.
Acknowledgments: Writing this script would be next to impossible without this book:
Stephen P. Radzevich; Darle W. Dudley (21 October 1994). Handbook of Practical Gear Design. CRC Press. ISBN 978-1-56676-218-2.