Expressions for fields due to a point charge in 3D and due to a line c
harge in 2D are compared. : Extensions to dipoles are made with emphas
is on the relationship between dipole orientation and field component
magnitudes. Differences between the effects on fields of dipole rotati
ons in 2D and in 3D are highlighted and formulas for maximizing indivi
dual field components are given. A final macrogeometry extension is ma
de and a closed-form expression is developed to calculate the field du
e to an arbitrary 3D configuration of permanent magnet (PM) blocks. Th
e field optimization theory is applied to the design of the ALS ellipt
ically polarizing undulator (EPU). Utilizing 3D held enhancement, peak
on-axis field in practical designs can be increased typically by 5% t
o 40% or more over their 2D counterparts. The theory is generally appl
icable to any pure (i.e., no soft magnetic material) PM design.