This paper provides a mathematical framework and its implementation for calculating the tooth geometry of
arbitrary gear types, based on the basic law of gear kinematics. The rack or gear geometry can be generated
in two different ways: by calculating the conjugate geometry and the line of contact of a gear to the given
geometric shape of a known geometry (e.g., a cutting hob), or by prescribing the surface of action of two gears in contact and calculating the correspondent flank shapes.
Tooth contact analysis (TCA) is an important tool directed to the determination of contact patterns, contact paths, and transmission errors in gear drives. In this work, a new general approach that is applicable to any kind of gear geometry is proposed.