Control the direction of plane while doing sweep+reorder the sequance of point to form curve

hi
I have two questions. the first one is I want to control the direction of the plane inside a rectangle sweep so that the two ends of the rectangle are perfectly matched to each other.


and the second one is to I try to form interpolate by points and sweep it in a rectangle, but the order is wrong and i don’t know how to fix it. thanksssss

0407.gh (36.6 KB)
0407.3dm (72.6 KB)