Topology-based crystal strusture generator