Orientation preference maps of simple cells in the visual cortex have been studied as part of the process of understanding human vision. Iso-orientation bands arranged in pinwheels having opposite signed spin are the most striking feature of the orientation map. The phenomenon of illusory contours has been modelled by completion field theory which uses a priori probabilities based on a distribution of all possible completion curves. It is hypothesized that the simple cells form a circuit to calculate a distribution corresponding to the most probable contour completions. It is proposed that the embedding of simple cells in the visual cortex minimizes the wirelength of this circuit. A side effect is the formation of pinwheels or singularities in the orientation preference map. Preference maps synthesized using this theory show the existence of pinwheels but the spin of the pinwheels does not vary probably due to the use of a hexagonal sampling pattern which is not two colorable, to sample the visual space.