This is a RhinoScript (for V3 or V4) that creates involute gear toothprofiles (including bevel gears) around any circle in any viewport andany orientation.
It will treat the circle you pick as the 'pitch circle' and it will draw the gear teeth around it.
You can specify the gear either by number of teeth, or by its module.