Foaming in open moulds, followed by closing the moulds