TBC and PML conditions for 2D and 3D BPM: a comparison