With Ludovico Sforza overthrown at the dawn of the Second Italian War, Leonardo, with his assistant Salaì and friend, the mathematician Luca Pacioli, fled Milan for Venice.
There, he was employed as a military architect and engineer, devising methods to defend the city from naval attack.