We address the synthesis of controllers for a swarm of robots to generate a desired two-dimensional geometric pattern specified by a simple closed planar curve with local interactions for avoiding collisions or maintaining specified relative distance constraints. The controllers are decentralized in the sense that the robots do not need to exchange or know each other's state information. Instead, we assume that the robots have sensors allowing them to obtain information about relative positions of neighbors within a known range. We establish stability and convergence properties of the controllers for a certain class of simple closed curves. We illustrate our approach through simulations and consider extensions to more general planar curves.