NanoCap: A framework for generating capped carbon nanotubes and fullerenes. NanoCap provides both libraries and a standalone application for the construction of capped nanotubes of arbitrary chirality and fullerenes of any radius. Structures are generated by constructing a set of optimal dual graph topologies which are subsequently optimised using a carbon interatomic potential. Combining this approach with a GUI featuring 3D rendering capabilities allows for the rapid inspection of physically sensible structures which can be used as input for molecular simulation.