A new method for simulating the cutting and grinding process of gears has been developed. The procedure, implemented on a workstation, allows to describe the most general case of spatial motion based on line coordinates. The meshing of two gears is replaced by the motion of two axodes, rolling and sliding on each other about and along the instantaneous screw axis. A general equation of meshing has been developed, also based on line geometry. Velocity, acceleration and jerk can be determined, which are used for calculating the generated surfaces and their derivatives.