Ecuador's Richard Carapaz attacked his five breakaway companions with just over three kilometres to ride and cruised to his second Tour stage victory, with Swiss Mauro Schmid beating American Matteo Jorgenson to second place.