Discrete Killing Fields for Pattern Synthesis and Symmetry Detection