We present an approach to scanning tunneling microscopy topographic im
aging which pays special attention to the influence of the geometrical
shape of the tip and sample. Both electrodes are described by spatial
ly restricted two-dimensional square-well potentials of finite height.
Their eigenstates are calculated numerically and their geometry can b
e chosen arbitrarily. The tunneling current is calculated using the tr
ansfer Hamiltonian formalism. We demonstrate the abilities of our appr
oach with the example of constant-current imaging of an idealized nano
meter-trench surface-profile structure by different tips.