The pole profiles of quadrupole magnets are often made circular, with a radius that can be so chosen as to reduce the error in the field due to the 12-pole contribution. In some magnets the pole face consists entirely of a few plane surfaces. We have obtained an analytical procedure which optimizes the lengths and the angles of the straight lines to eliminate the 12-pole, 20-pole and 28-pole contributions to the field error.