This way of generating it means that the points will always have the same orientation (clockwise if I haven't messed up again). You should change it so that both orientations are checked.