Carbon foam — a stiff, porous structure formed from a web of carbon atoms — is the stuff of manufacturers’ dreams.