Sweep method is one of the most robust techniques to generate hexahedral meshes in extrusion volumes. One of the main issues to be dealt by any sweep algorithm is the projection of a source surface mesh onto the target surface. This paper presents a new algorithm to map a given mesh over the source surface onto the target surface. This projection is carried out by means of a least-squares approximation of an affine mapping defined between the parametric spaces of the surfaces. Once the new mesh is obtained on the parametric space of the target surface, it is mapped up according to the target surface parameterization. Therefore, the developed algorithm does not require to solve any root finding problem to ensure that the projected nodes are on the target surface. Afterwards, this projection algorithm is extended to three dimensional cases and it is used to generate the inner layers of elements in the physical space.