Interpolated curve goes in full loop I just want to connect end to end

I have this problem with creating this space frame. I am trying to use the end points on the U grid to interpolate a line to connect the points in one single line (end points picture). However, when i use “Interpolate” it creates this ovals that i do not want (circles picture). Does anyone have any suggestions? I attached the grasshopper script. To simply explain it, the line is perpendicular to the separated surfaces gridded out from the original surface, the “end” is the end point of that line, the partition is the list of end points and then the interpolate command to connect the points in the “U” direction and eventually the “V” as well. I also attached the grasshopper script.

space frame script.gh (14.4 KB)

um…change P input on IntCrv to False