Over the past few decades, there have been many important achievements on the design, research and development of minimal surface lattice structures. In this work, we propose a modeling method for triply periodic minimal surfaces (TPMS) lattice structures with complex contours. This method is based on moving elements method (MEM) and mainly includes the following parts, such as dividing the model mesh, solving the iso-surface of the TPMS in the model, obtaining the TPMS lattice structure triangular surface of the model outline, integrating the interior of the model and the outline, and finally generating an STL file that can be used for additive manufacturing. Furthermore, the representative femur model, rabbit model and gear model are provided as case studies to verify the validity and correctness of the proposed modeling method. Then, this approach is compared with the distance field method in terms of modeling speed and modeling accuracy. The research results show that the modeling method proposed in this paper has certain advantages in the generation of complex model lattice structures. Moreover, this method provides technical means and simulation data for designing TPMS lattice structures with complex contour, and offers the underlying design ideas for the development and application of the excellent physical properties of TPMS lattice structures in medicine and engineering.