Symmetry detection and approximation