A novel scheme for three-dimensional mesh generation, termed the carving technique, is proposed with the aid of poly-pyramid elements. Soaking the geometry information of a given model into a regular reference mesh with brick elements, the reference mesh is trimmed by the surface of the model using the marching cube algorithm. The trimmed elements are reconstructed by the proposed elements, which here are termed the poly-pyramid elements. Therefore, the finite element mesh is automatically generated from the surface information. Shape functions of the poly-pyramid elements are constructed by moving least square (MLS) approximation. Numerical results are presented to examine the performance of the poly-pyramid elements and to demonstrate the effectiveness of the proposed scheme. (C) 2011 Elsevier B.V. All rights reserved.