  We derive a closed-form expression of the magnetic field of a finite-size
current sheet and use it to calculate the field of permanent magnets, which are
modeled through their surface current densities. We illustrate the method by
determining the multipoles and the effective length due to fringe fields of a
finite-length dipole constructed of magnetic cubes.
