Robust imposition of Dirichlet boundary conditions on embedded surfaces