# Rectangley by points not working

Ok, So Ive tried 5different ways to get around this error but I keep having to come back to this problem and I would like an answer to why this node never seems to work. Here, I clearly have 4 planar points. Why doesnt this node work, and just put a rectangle through them? what i the world am I doing wrong? thanks!

I think it may be that order of the points matters here based on an issue I had today. That is if your points are in order from lower left, lower right, upper left, upper right then the node may fail as the rectangle would try to fold in on itself, but if they are in lower left, lower right, upper right, upper left they may work. Try grouping by the points Y value, then sorting the groups by Y value, and then sorting each subgroup by the X value, and finally flattening the list.

How do I “Group by Y value”? Do you mean extract the Y values and then sort them? Or are you thinking of something, hopefully cooler and simpler than that?
Thanks!

Do you mean something like this? i could never get anything to work as a function. I guess I just dont understand it. In my mind this should group the points together that have the same Y value. However, (basically) just demotes every point by one level in the list. (creates 4 new sublists)

Hi Kulku,
That looks helpful, but I am not getting the same results as you. Why wont the GroupbyKey node, group the points that have the same X value together. What am I doing wrong? thanks!