3D extension of the Monte Carlo code MCSHAPE for photon-matter interactions in heterogeneous media