I am trying to adapt the conceptual proof of Gauss-Bonnet's formula due to S.S.Chern, which I learned about here, to the case of a domain with piecewise smooth boundary. For simplicity, let us take a surface and take a domain diffeomorphic to the standard 2-simplex (triangle).
Let $M$ be a Riemannian surface, let $\Delta$ be the embedded 2-simplex, let $K$ be $M$'s scalar curvature times its volume form, and $k$ be the geodesic curvature form, and let $a_1, a_2, a_3$ be exterior angles at the three vertices. Then the formula says $$ \int_\Delta K dV + \int_{\partial \Delta} k_g + \sum_{i=1}^3 a_i = 2\pi $$
The proof proceeds by considering the spherisation $STM$ of the tangent bundle of $M$ and then embedding $\Delta$ into $STM$ by picking some vector field $\xi$ on $\Delta$. One then considers a certain differential form on $STX$, call it $\alpha$, which, as far as I understand, evaluated at unit vector $x$ is the form that returns the scalar product between the projection of a vector $\eta \in T(STM)$ onto $TM$, and $x$. Then it turns out that $d\alpha=p^* K$, where $p$ is the projection $STM \to M$. The main thrust of the proof is to use the Stokes theorem, but before one embeds $\Delta$ into $STM$ by picking a non-vanising vector field.
My question is: how to pick this vector field? Where does the $2\pi$ term come from with this approach? How does one obtain exterior angles with this approach?
Since you're on a simplex, you can take a constant vector field on the triangle and then take the corresponding vector field $\xi$ on the embedded simplex. The point is that on the boundary $\partial\Delta$ we get the geodesic curvature $1$-form $k_g\,ds$ by considering the tangent vector field to the boundary instead of $\xi$. The important calculation is that $\alpha - (-k_g\,ds) = d\theta$ (away from the vertices), where $\theta$ is the angle from $\xi$ to the tangent vector. A standard argument (based on the Hopf Umlaufsatz) will show that $\displaystyle\int_{\partial\Delta} d\theta = 2\pi - \sum_{i=1}^3 a_i$.