The porosity of rocks is an important parameter used in rock mechanics and underground mining. It affects the movement of fluids in the rock mass and the internal processes taking place (the ability to store water or gases), allowing us to characterize the type of rock and determine possible future applications. Conventional porosity testing methods (e.g., test drill cores in the laboratory) are complex and time-consuming. On the other hand, more modern technologies, such as computed tomography, are high-cost. In the presented study, a core sample with karst and porous structures inside was used. This core sample was poured with resin to reinforce the outer surfaces of the core and make it easier to cut with a rock saw. It was then cut into 3 mm thickness slices in preparation for the next step—the 3D optical scanning. Measurements were made with the ATOS CORE 500 optical scanner. Data processing was then performed in open-source software using popular and commonly used modeling methods. The 3D model of the core reconstructing the actual shape (with internal voids) and the standard model (without internal voids) were created. Based on these, the total porosity of the core was assessed. The presented solution ensures obtaining results with high accuracy at an adequate computational cost using cheap and easily available tools.