Topology and control of self-assembled domain patterns in low-dimensional ferroelectrics