In this study, the triangle interpolation method for the calculation of mapping functions of plates containing an opening with arbitrary shapes is investigated with an improved method for point adjudgment during iterations. Afterwards, four kinds of openings with typical shapes are considered and the mapping functions for them are calculated, based on which the influence of calculation parameters such as iteration time and the number of terms on the accuracy of mapping function is discussed. Finally, the stress around an inverted U-shaped opening and around an arched opening under different far-field stress conditions is calculated and the effect of opening shape and lateral pressure coefficient on stress distribution and rock mechanical behaviors is further analyzed combined with the discrete element method (DEM) numerical simulation. The result shows that the stability and failure pattern of the rock mass is correlated with the stress around the opening, which is affected by the opening shape. The existence of opening also greatly reduces the enhancing influence of confining stress on rock specimen.