In recent years, the application of free-form surface spatial grid structures in large public buildings has become increasingly common. The layouts of grids are important factors that affect both the mechanical performance and aesthetic appeal of such structures. To achieve a triangular grid with good mechanical performance and uniformity on free-form surfaces, this study proposes a new method called the “strain energy gradient optimization method”. The grid topology is optimized to maximize the overall stiffness, by analyzing the sensitivity of nodal coordinates to the overall strain energy. The results indicate that the overall strain energy of the optimized grid has decreased, indicating an improvement in the structural stiffness. Specifically, compared to the initial grid, the optimized grid has a 30% decrease in strain energy and a 43.3% decrease in maximum nodal displacement. To optimize the smoothness of the grid, the study further applies the Laplacian grid smoothing method. Compared to the mechanically adjusted grid, the structural mechanical performance does not significantly change after smoothing, while the geometric indicators are noticeably improved, with smoother lines and regular shapes. On the other hand, compared to the initial grid, the smoothed grid has a 21.4% decrease in strain energy and a 28.3% decrease in maximum nodal displacement.