There has been workwork on Gram matricesGram matrices that appears relevant, see e.g. Theorems 14-5 on p. 24-5.
Also of peripheral interest: there is a hyperbolic generalizationhyperbolic generalization of the Dehn invariantDehn invariant. But as far as I can tell this sort of thing can't really be a generalization of any 2D construction.