point texture positioning

I’m making a shader for a terrain, at the moment I’ve done the following - using a script I created data about where what texture should be, in the shader graph I get the position of the terrain vertex, based on the position and texture data I display the desired texture at the required vertices, I also I set the “stretch” required, this is so that the textures do not stretch between the vertices, everything practically works out except for the corners, look at the screenshot, this situation occurs when one vertex has two directions, as you can see it turns out to apply only to one side, is it possible to apply to both?
I don’t know, maybe can get the normal of the pixels, or the polygon…

any ideas?