Text this: Coplanar repeats by energy minimization