Based on the embedded discrete fracture model, an algorithm is implemented and optimized for the key problem of the intersection calculation of the fracture surface and the matrix grid in the preprocessing algorithm. Firstly, the collision detection between the fracture bounding box and the matrix grid is used to quickly determine whether the fracture surface and the matrix grid intersect. Secondly, after determining the intersection, calculate the intersection point to see if the matrix contains fractures. Finally, classify the intersection of the matrix and the grid. Experiments have demonstrated the effectiveness of the method.