On the fracture of brittle and quasi-brittle materials subject to uniaxial compression and the interaction of voids on cracking