I'm not sure you can calculate the workfunction/affinity of a 2D sheet this way. The method essentially assumes that you can define a "bulk-like" region and compare the potential there to vacuum. In this case, it would mean cutting a surface in the 2D plane. So, in your case, rather, you would repeat the structure many times in B or C (not both), then add vacuum in that direction, and then study the potential in this direction, using the averaged value across the perpendicular plane (and ideally also average in the projection direction to get rid of the atomic variation).
Alternatively, and maybe better, you might try to use Dirichlet/Neumann boundary conditions and use the fact that then the Fermi level represents the work function (for metal); for semiconductors you need to also factor in the band gap.