Splitting list of curves based on its direction

Yeah also did that. Here is the link, I think this is easier to understand