Exact semi-separation of variables in waveguides with non-planar boundaries