The present work deals with the development of a three-dimensional mesh generation algorithm using the principles of FEM with special emphasis on the computational efficiency and the memory requirement. The algorithm makes use of a basic mesh that defines the total number of elements and nodes. Wavefront technique is used to renumber the nodes in order to reduce the bandwidth. By elastic distortion of the basic mesh, it is redefined to map onto actual geometry to be discretized. Later a finer distribution of mesh is done in the zones of interest to suit the nature of the problem. The same Finite Element code meant for stress analysis is adopted with necessary modifications. The algorithm has been extended to three-dimensional geometries. The current methodology is used to discretize a straight bevel gear and an hourglass worm to study their stress patterns.