It was not supposed to be a tutorial on gear’s tooth modeling… but one thing involving the next one, who knows
Of course, there are many gears generators (Free Gear Generator  Design & Create Spur Gears – Evolvent Design), but if you want to know what’s behind the scene…
To define a “standard” gear, you need only a few parameters:
 radius or diameter D, which define the Reference circle
 teeth number Z
 modulus number m = D/Z
 pressure angle alpha : this is standardized to 20° or 25°
The first 3 parameters are not independent, as they are related by the relation m = D/Z. Note that D and m are in the same unit, mm or inch, and that m is a distance. I will use mm.
The modulus number m defines the geometry of the teeth, and for 2 gears to be compatible, they must have:
 the same modulus m, and
 the same pressure angle alpha
Then the shape of the teeth is normalized:
 the teeth extend m mm above the Reference circle, up to the Tip Circle
 the teeth go down 1.25*m mm below the Reference circle, down to the Root circle
 along the Reference circle, the width of the teeth is equal to the space between 2 consecutive teeth
Now, what does the pressure angle alpha mean?
We often think of 2 gears as cylinders rolling without sliding in opposite direction:
But we can also think of 2 smaller pulleys connected by a belt in the shape of 8:
The belt define the angle alpha with the line tangent to both cylinders D1 and D2. This is the pressure angle alpha of the gear. It is normalized to 20° or 25°. I will use 20° which is the most commun value. The direction of the straight portion of the belt is the pressure line.
The diameter of the smaller pulley defines the Base circle that will be used later on, and by construction, the Base circle is tangent to the pressure line.
Now, what should the shape of the teeth be so the gear “works”?
Well, imagine that you glue a pen to the belt, so the pen can draw on the light blue and violet portion of the disk, while everything is in mouvement.
The curve drawn is named involute of the circle of the pulley.
This is the curve traced by a pencil attached to a stretched wire, which is wound around a cylinder.
Well, if the shape of the teeth is equal to the involute of the base circle for each gear, the contact between the teeth of the 2 gears will follow the straight portion of the 8 shape belt.
This curve has a lot of very nice mathematical properties, which are the reason why gears works so well, but it is not the purpose of this post to elaborate on them.
How to draw the involute of a circle?
The equation of the involute of a circle is simple, but if we don’t want to do maths, the easiest way is to approximate the circle by a polygon and to “unfold” the polygon step by step:
 step 1 : disconnect the end of segment 1 of the polygon
 step 2 : “unfold and stretch the wire” means aligning segment 1 with segment 2, or make them tangent; we now have 2 points of the involute of the circle, marked by the small crosses on the figure
 step 3 : “unfold a bit more and stretch the wire” means aligning segment 1 and 2 with segment 3, or make segment 2 and 3 tangent
 repeat the process as long as needed
 connect the crosses to get the curve
So, now we have everything to draw the shape of a tooth
Here is the recipe
We kwow Diameter D, which defines the Reference circle and either the number of teeth Z or the modulus m.

 offset the Reference circle by +m to draw the Tip circle

 offset the Reference circle by 1.25m to draw the Root circle

 draw the Pressure line inclined with an angle of alpha = 20°

 draw the Base circle to be tangent to the Pressure line

 draw the Involute of the Base circle using polygon approximation, until it crosses the Tip circle, and create a nice 3 points control spline to make a smooth curve

 draw a radius from the center of the gear to the intersection point of the Involute of the Base circle and the Reference circle

 draw a radius with an angle of ∆/4 related to the previous radius (ex: Z=20 teeth, ∆=360/20=18°, ∆/4=18/4=4.4°). This is the symmetry line of the tooth.

 mirror the Involute of the Base circle relative to the previous radius to build the second side of the tooth

 draw 2 radius from the center of the gear to the end of the Involute of the Base circle to complete the shape of the tooth

 optionally, as the tooth is slightly rotated by a small angle (this is inherent to the construction method), simply measure this angle and rotate everything to get the construction cleaner
Then, you have the profile of a tooth, ready to be extruded (spur gear) or revolved (helicoidal gear). It is better to add a fillet to the tip and root to avoid sharp angles.
To complete the gear, all you need is to use Circular pattern to create the rest of the teeth and union it with the body of the gear.
Once you have made the first gear, you can reuse the Involute of the Base circle, you just have to scale it relative to the center of the gear with the ratio of diameter of the gears.
Gear is actually way more complex than what I explained, but if you stay in the normal range of diameter and teeth number (more than 16 teeth), you will never encounter issues.
If you want to 3D print gears, it is wise to provision for clearance by simply offsetting the Involute of the base circle by let say 0.2mm. No need to provision clearance for the tip of the tooth, as the Root circle already takes some into account with the *1.25m factor if m is in the range of 1mm or more.
I will post a few videos later on to demonstrate the recipe in action if I can make them small enough.
Good modeling
PEC