Point3 c = vertices.get(indices[decomp[tri + 2]]);
Vector3 ab = a.vectorTo(b);
Vector3 ac = a.vectorTo(c);
Vector2 tab = ta.vectorTo(tb);
Vector2 tac = ta.vectorTo(tc);
double r = 1.0 / (tab.x() * tac.y() - tab.y() * tac.x());
Vector3 n = plane.normal();
Vector3 u = new Vector3(
r * (tac.y() * ab.x() - tab.y() * ac.x()),
r * (tac.y() * ab.y() - tab.y() * ac.y()),
r * (tac.y() * ab.z() - tab.y() * ac.z()));
Vector3 v = new Vector3(
r * (tab.x() * ac.x() - tac.x() * ab.x()),
r * (tab.x() * ac.y() - tac.x() * ab.y()),
r * (tab.x() * ac.z() - tac.x() * ab.z()));
return Basis3.fromWUV(n, u, v);
}