FEM analysis is becoming an important tool in the metal forming industry. Many structure analysis codes are applied to simulate metal forming processes. In these codes, the treatment of contact between tools and the work-piece is an important problem. The authors have developed a penalty method contact algorithm which can treat the contact problem and the friction problem at the same time. This algorithm is incorporated into a 3-dimensional rigid-plastic FEM code. In this code, the tool surface is expressed by a B-spline patch, which can describe smooth surfaces by few control vertices. Using this 3-dimensional code, a square cup deep drawing process is analyzed. In this analysis, 8-node isoparametric solid elements are used. Reasonable results are obtained.