In magnetic resonance imaging and spectroscopy, a highly uniform magnetic field is desired for minimizing image distortions and line broadening, respectively. Typically, shim coils are employed to provide correcting fields for inhomogeneities brought about by magnetic interactions with the sample under study. Flexible field modeling is possible using an array of regularly shaped conducting loops that are independently electrically driven. In this paper, a design method is presented for generating coil winding patterns for shim arrays with irregular geometry elements. These designs are compared theoretically to the use of circular loop arrays and are shown to provide considerable improvements in field accuracy and efficiency for generating low-order correcting fields.