Stamping and folding of sheets and profiles