Nematic elastomers and glasses deform spontaneously when subjected to temperature changes. This property can be exploited in the design of heterogeneously patterned thin sheets that deform into a non-trivial shape when heated or cooled. In this paper, we start from a variational formulation for the entropic elastic energy of liquid crystal elastomers and we derive an effective two-dimensional metric constraint, which links the deformation and the heterogeneous director field. Our main results show that satisfying the metric constraint is both necessary and sufficient for the deformation to be an approximate minimizer of the energy. We include several examples which show that the class of deformations satisfying the metric constraint is quite rich.