Toruses and meshes include graphs of many varieties of topologies, with lines, rings, and hypercubes being special cases. Given a d-dimensional torus or mesh G and a c-dimensional torus or mesh H of the same size, we study the problem of embedding G in H to minimize the dilation cost. For increasing dimension cases (d \u3c c) in which the shapes of G and H satisfy the condition of expansion, the dilation costs of our embeddings are either 1 or 2, depending on the types of graphs of G and H. These embeddings a,re optimal except when G is a torus of even size and H is a mesh. For lowering dimension cases (d \u3e c) in which the shapes of G and H satisfy the condition of reduction, the dilation costs of our embeddings depend on the shapes of G and H. These embeddings, however, are not optimal in general. For the special cases in which G and H are square, the embedding results above can always be used to construct embeddings of G in H: these embeddings are all optimal for increasing dimension cases in which the dimension of H is divisible by the dimension of G, and all optimal to within a constant for fixed values of d and c for lowering dimension cases. Our main analysis technique is based on a generalization of Gray code for radix-2 (binary) numbering system to similar sequences for mixed-radix numbering systems