From Cubes to Twisted Cubes via Graph Morphisms in Type Theory