I have a function f defined on a triangle mesh, i.e. for each vertex, I have an associated number. For example, f could be the geodesic distance on the mesh, i.e. f(x)=d(a,x) computed for each point in the mesh, from a specific fixed point a. Clearly, it is easy to "plot" this function on the surface, simply by normalizing the values of f and mapping them to colors on the mesh nodes.
But what if I want to draw isolines (also called contour lines or isoclines) on the surface?
How would I go about this? This does not seem doable easily by simply coloring the mesh as above. Especially since the meshes may have sparse areas with few vertices (i.e. large faces). This suggests (perhaps) that I should compute the isoclines directly as 3D curves on the mesh and use e.g. GL-lines. But computing the isocline curves is not so obvious since the naive approach is to fix a set of target values, and then I will have to check every triangle for whether it reaches the target at some point(s) on the triangle via interpolation, which does not seem ideal. Could anyone point me to any resources that address this?
For reference, I am using python OpenGL.