Gears / cogwheels

gear showcase
click for short animation

Update: ported the script to Blender 2.50 alpha 0. See link section to your right for download. Fully updated tutorial will follow. For now: just put the script in .blender/scripts/op and restart Blender. Add Gears will then show up in Add->Mesh->Gear. If you like, you can join the discussion on Blender Artists

I wanted a way to create mechanical gears (cogwheels) in a fast and flexible way. A couple of years ago, Stefano Selleri created a script that is versatile and mechanically accurate. A fine piece of work and a great inspiration, but for me there were some additional design criteria : The mesh should be

The first 3 boiled down to generating a quad only mesh: triangles often give a less desirable result when a subsurface modifier is applied and without triangles edgeloops are easier to select (e.g. to apply a different crease weight ) and to add (with ctrl-R). Additionally, similar vertices should be easy to select. This can be achieved by using vertex groups.

Making a more maintainable script was more of a challenge but greatly simplified by the huge advances in the Blender Python API since version 2.45 . In the end the script is only about a 200 lines of code, GUI included.


The script should now be available in the menu Add->Mesh->Gears and will work both in Edit mode and in Object mode.


On running the script you're presented with the following popup:
gear menu popup

The default settings generate a gear like this:
default settings

Many aspects can be altered however:

Teeth the number of teeth, equally spaced along the radius of the gear. Less than 5 is treated special: this will create a wormwheel. See below for details.

Radius The radius of the gear. Gears that interact should be tangent (= touching each other) on their radii. See the section on animation for details. Usually if two gears are touching, then the ratio between the radii is same as the ratio between the number of teeth. This guarantees that the teeth on both gears are equal in size (neccessary for smooth running )

A negative radius creates an inverted gear (a gear with teeth on the inside).

Addendum The amount the tip of a tooth extends above the radius

Dedendum The amount the through between two teeth extends below the radius

Base The thickness of the rim of the gear

Width The thickness of the gear

Pressure angle The slope of the tip of the teeth

Helical angle Teeth don't have to be perpendicular to the face of the gear. This angle determines the skew.

Conical angle Conical gears can be used to link non parallel axes. This angle determines the taper. E.g. 45 degrees can be used for perpendicular axes.

Rack Toggle this to get a single tooth that can be extended to a rack by an array modifier.

Crown A nonzero value creates a crownwheel (a gear with teeth that point downward)

The next few parameters control the way the inner part of the gear is modelled. This is mainly a matter of taste and these parameters should be considered experimental. They might not work, actually, I guarantee them NOT to work :-)

Teeth per Spoke

Spoke Bevel

Spoke Width

Spoke Length

To get a better idea of all those parameters, here's a schematic:
gear parameters

Vertex Groups

To facilitate tweaking the generated mesh a number of vertex groups are predefined. That way it is easy to select similar but unconnected edges, e.g. to crease them.
valley vertexgroup
tips vertexgroup


A number of teeth less than 5 creates a single turn of a wormwheel. (which can be simply extended by an array modifier): wormwheel

Internal gears

Negative radii create internal gears. An example : internal gear


Crownwheels are possible as well. An example : crownwheel


Racks are basically straight strips of teeth. If you select the 'Rack' toggle a single tooth is created that may be repeated by applying an array modifier in the y direction. rackscreenshot rack array




External Links


This work is licenced as GNU GPL v3.