Electron-beam welding or cutting