Production of metal and plastic gears