Construction on the ravelins (protective fortifications built in front of the gates) began during the remodelling of the castle by Francesco Sforza, possibly using the Visconti era remains as foundations. The ruins of only three ravelins remain: two are on the eastern walls, one defending Porta del Carmine, and one placed where the medieval walls of the city met the castle; and one to the west, the ravelin of Porta Vercellina. The latter, built in correspondence with the gate of Porta di Santo Spirito, is the only one in which the quadrangular structure typical of Sforza architecture is visible. This, however, is the result of the renovation carried out by the architect Luca Beltrami, who, between 1911 and 1914, rebuilt a part of the battlements, the walls, corridor ceilings and internal spaces demolished at the time of the Spanish domination. To defend the main gate of the castle, Ludovico il Moro commissioned Leonardo to design a more modern pentagonal ravelin, that was eventually built during the French occupation under Louis XII, between 1499 and 1500. The few remaining vestiges of the construction lie forgotten in the castle moat.