Geometric visual hallucinations are seen by many observers after taking hallucinogens such as LSD, cannabis, mescaline or psilocybin, on viewing bright flickering lights, on waking up or falling asleep, in ³near death² experiences, and in many other syndromes. The images were organized by Klüver into four groups called ³form constants²: (1) tunnels and funnels, (2) spirals, (3) lattices, including honeycombs and triangles, and (4) cobwebs. In general the images do not move with the eyes. We interpret this to mean that they are generated in the brain. Here we present a theory of their origin in visual cortex (area V1), based on the assumption that the form of the retino-cortical map and the architecture of V1 determine their geometry. We model V1 as the continuum limit of a lattice of interconnected hypercolumns, each of which itself comprises a number of interconnected iso-orientation columns. Based on anatomical evidence we assume that the lateral connectivity between hypercolumns exhibits symmetries rendering it invariant under the action of the Euclidean group E(2), composed of reflections and translations in the plane, and a (novel) shift-twist action. Using this symmetry, we show that the various patterns of activity that spontaneously emerge when V1's spatially uniform resting state becomes unstable, correspond to the form constants when transformed to the visual field using the retino-cortical map. The results are sensitive to the detailed specification of the lateral connectivity and suggest that the cortical mechanisms which generate geometric visual hallucinations are closely related to those used to process edges and contours.