Added some debug code to diagnose TriangleMesh issues.