Cutting Lines with surface then connecting cut end points

I’m working on a project where I have many custom surfaces. I want to fill up to this surface with lines then connect those cut lines on that surface.

The issue arises when I don’t know where the cut node locations are and with curves that may be random as well. Is there a way to cut a random selection of lines with a random surface. Then identify the cut node ends of those line and connect them together to form a random surface lattice on the surface?

See images and gh file for more details.

CutLinesWCutSurface (12.7 KB)

This is a very simplified example but the logic should be here. What I’m looking for is to identify the nodes of the cut lines, then connect those nodes through something like a surface Voronoi or any type of connecting lattice.

Any help would be greatly appreciated.

Something like this? (19.4 KB)

HS_Kim you are amazing. This is exactly what I was looking for.

One last question with this. The example that I posted was very simplified and the lines were all uniform. when in my actual problems the cut lines are much more random. Sometimes with this there are location when 3 points are very close to one another and a relatively large distance from the surrounding points. When this happens they connect together everytime rather than spreading out and uniformly connecting to the other points. (See images for examples). I’m trying to implement a band pass filter in the code rather than the maximum edge length that you demonstrated in the code you sent. Is there a better way to make this connection web more uniform?


One thought that came up is, What if we upped the number of connections to say 10. And use a minimum length and a maximum length. Then the connections connect to everything around them. To weed out the extra beams, it would be great to delete the longer of any member that intersects with another. This would remove any members from one connection jumping over another. Is there a way to identify if 2 members are intersecting? then sorting them by the longer of the two in the intersection and removing said longer connection?

Sorry that got very long winded. Any additional help here would be greatly appreciated. Thanks for your help.