The scientists developed structures that can be used to harvest water from desert air, capture carbon dioxide or store toxic gases.