This code presents a method for automated extraction of rock discontinuities from a point cloud by identifying all triangular mesh units belonging to discontinuity surface. The method directly avoids the interferences of outliers or noise in the point clouds and obviates the defect of a constant window size facing to a varied distribution of rock discontinuity which is a weakness in many other methods. A sensitive analysis indicates that the accuracy of the proposed method is controlled by the clustering parameter h but not highly sensitive.