Computation of the signed distance function to a discrete contour on adapted triangulation