The rock surrounding tunnels typically exhibits rough structural surfaces with complex morphologies, making it difficult to understand their failure mechanisms and mechanical characteristics. In this study, 3D printing was used to create fractured rock specimens with different geometric excavation shapes. Compression tests and digital image correlation (DIC) analyses were conducted to investigate the mechanical properties, fracture patterns, and failure precursors during the loading process. The results indicate that the 3D-printed rock specimens can efficiently represent the failure behaviour of the surrounding rocks. Jointed rock masses with horseshoe-shaped roadways exhibited higher mechanical resistance. The identified fracture patterns showed monoclinic shear damage with a combination of compression and shear, suggesting ductile deformation. A notable, abrupt change in the shear-strain and strain-rate indices during loading corresponds to crack formation, and serves as a precursor to rock fracture. The study revealed that the changes in the shear-strain field aligned with the evolution of rock fractures. Among them, jointed rock masses featuring a horseshoe-shaped roadway exhibited the most prominent correlation, followed by those featuring elliptical and circular roadways. These findings demonstrate the potential of 3D printing and DIC analysis for rock mechanical testing, failure precursors, and forecasting. This highlights the utility of shear-strain indicators for identifying fracture precursors on rough structural surfaces of rocks surrounding roadways.