Free-form curved surface shell roof is favored by architects, but the openings for daylighting will decline its mechanical properties. In the shell shape optimization under the vertical load, when the outer contour of the openings or the shell changes, the total load of the structure also changes with the changes in its horizontal projection area. This contradicts the premise of structural optimization, that is, to maintain the principle of unchanging total loads. To solve this problem, the invariant horizontal projection area of the shell was taken as constraints in the shell shape optimization in which the objective function was structural strain energy and optimization design variables were internal and external boundary points of the curved surfaces with openings, and the key points on the curved surface which were design variables of the overall shape of the curved surface. The numerical examples verified the validity of the method, and the influence of the invariant horizontal projection area constraint of the curved surface with openings on the optimization results of the minimum strain energy, optimization with the frequency constraint, and the initial surface with the different support distribution were discussed. The results of the numerical examples showed that the invariant horizontal projection area constraint has a greater impact on the results of the curved surface with opening optimization, and its influence should be considered in the engineering design.