3D continuum radiative transfer : A new adaptive grid construction algorithm based on the Monte Carlo method