How to extract the edges of these surface

hello all
im trying to extract the edges as shown in the 2nd image



edges extraction.gh (86.1 KB)
thank you

This is a hacky solution, but seems to work on this case:
edges extraction.gh (89.6 KB)

?
My interpretation of the image is that you want to separate edges and join them, without the interior edges:
edges extraction-R7.gh (90.2 KB)

here’s a definition that uses curve discontinuities and cull index
edges extraction[fixed].gh (97.5 KB)