Creating a hexagonal diamond pattern skin - issues with u v distribution

Hi everyone,

I’ve been really struggling to get this definition to work a more “universal” approach, across a variety of surfaces, but with no luck.

Essentially, I would like this to create all the cellular elements from the base surface and extrude/offset them, creating the frame and the inner panel. This is my final version of the definition, trying to get it to work on any surface, but at the moment it only fully works with a specific u/v ratio, taken from the initial surface I developed it on, which is V=(U*x)-2. Now that isn’t really satisfactory, I would really like to be able to either manually adjust the U and V numbers, or better yet, take the average length from the U borders and V borders respectively ( see in the definition).

At the moment, with a more stripped down version of the definition, I can get all the inner panels to bake nicely (at least to serve my purposes), but given that there are many such faces adjoining each other, I end up with holes all around.

This has been driving me insane and I am well out of my area of expertise to resolve this further. I would highly appreciate any and all help I could get on here.

Thank you,

Hex Skin - (241.3 KB)