Abstract. This study employs numerical simulations based on the limit analysis (LA) method to calculate the stress distribution in a model that includes a basal detachment, featuring the lateral termination of a generic fault under compression. We conduct 2500 2D and 500 3D simulations with varying basement and fault friction angles to analyze and classify the results into clusters representing similar failure patterns to understand the stress fields. Automatic fault detection methods are employed to identify the number and positions of fault lines in 2D and fault surfaces in 3D. Clustering approaches are utilized to group the models based on the detected failure patterns. For the 2D models, the analysis reveals three primary clusters and five transitional ones, qualitatively consistent with the critical Coulomb wedge theory and the influence of inherited structural and geometric aspects over rupture localization. In the 3D models, four different clusters portray the lateral prolongation of the inherited fault. High stress magnitudes are detected between the compressive boundary and the activated or created faults and at the root of the inherited active fault. Tension zones appear near the outcropping surface relief, while stress decreases with depth at the footwall of the created back thrusts. A statistical cluster-based stress field analysis indicates that for a given cluster, the stress field mainly conserves the same orientations, while the magnitude varies with changes in friction angles and compressive field intensity, except in failure zones where variations are sparse. Small parametric variations could lead to significantly different stress fields, while larger deviations might result in similar configurations. The comparison between 2D and 3D models shows the importance of lateral stresses and their influence on rupture patterns, distinguishing between 3D analysis and 2D cross-sections. Lastly, despite using small-scale models, stress field variations over a span of a couple of kilometers are quite large.