The gear is one of the most widely used and vital parts having freeform surfaces. Accurate modelling and strength calculation are the basis of gear design and optimization. The traditional gear design and the existing finite element analysis methods cannot effectively solve these problems. Only a simple model can be established and the static strength analysis can be carried out at a certain meshing position. In this study, accurate equations of the tooth surfaces of a spur gear were derived based on the principle of gear shaping. Then, the parametric finite element modelling and simulation of the transient meshing of the spur gear have been realized using ANSYS software, and the stress distribution and variation trends of the gear during the meshing process have been analysed. Finally, the method is verified by simulation and comparison. The analysis results show that the effect of the tooth fillet surface on the strength of the gear is very large, and the bending stress and contact stress of the gear are nonlinear in the meshing process. The proposed method can accurately establish the model including the tooth fillet surface of the spur gear, and accurately analyse the strength of the spur gear pair. This makes up for the shortcomings of the existing method, and can be applied to other gear forms after appropriate modification.