I have a torus with a contour that cuts through its triangles. this contour represents the levelset $f=0.5$ for a given scalar field $f$ which is defined on mesh vertices. I want to initialize a new wave propagation from this contour without changing the underlying mesh. so my problem is to somehow initialize a field on the nearby vertices to this contour. in the end I expect to see gradient vectors at these vertices to look somewhat orthogonal to this contour. Here's what I've tried so far:
since I already have the field $f$ (which was used to compute the contour) I sample from $f$ at exactly the vertices which are either on my contour or on an edge which is cut (highlighted with orange circles) and set the new field to zero for every other vertex. but this initialization leads to some incorrect gradients as you can see in the picture.
for every edge that the contour cuts through, I use the barycentric coordinates of the intersection to construct an equality constraint ($af_i+(1-a)f_j = 0.5$) and solve a system of linear equations to find initial field values $f_i$ and $f_j$ for every two vertex on an intersected edge. this also gives similar problems as 1. (I think more vertices should be involved in the initialization)
I've already searched for other ways of solving this problem but I'm not sure if I'm on the right track. apparently this relates to solving the Eikonal Equation but usually methods for doing so start from a single mesh vertex and not such a general contour. It would be a great help if you could simply point me in the right direction.
Also this was my first time asking a question here so I hope my question was not off topic or if you need more details please let me know.
