Shaping of the substrate