Active contour and active polygon models have been used widely for image segmentation. In some applications, the topology of the object(s) to be detected from an image is known a priori, despite an unknown complex geometry, and it is important that the active contour or polygon maintain the desired topology. In this work, we construct a novel geometric flow that can be added to image based evolutions of active contours and polygons so that the topology of the initial contour or polygon is preserved. Indeed, the proposed geometric flow ensures more than just correct topology; it ensures that the active contour or polygon is, in some sense, kept far away from a topology change. Smoothness properties similar to curvature flow are also guaranteed by the proposed geometric flow. The proposed topology preserving geometric flow is the gradient flow arising from an energy that is based on electrostatic principles. The evolution of a single point on the contour depends on all other points of the contour, which is different from traditional curve evolutions in computer vision literature.