This gives you each edge’s length and from there you might get to what you want.
I don’t get what you’re trying to do, sorry But it seems to go in the right direction.
What I was doing is to instance a giant grid and remove what is outside the base mesh using geometry proximity. But as said, it’s not that simple in the end…
Here a some retrieved posts where I show a bit of that technique, that might give you some hints !