Inspired by biological systems, materials scientists have long sought to harness self-assembly to build nanomaterials. The challenge: the process seemed random and notoriously difficult to predict.