Splitting list of curves based on its direction

I have a list of curves in two axes, some curves are in X axis and some are in Y axis and I want to divide the list into two based on it’s direction. like one list should have all the x-axis curves and other should have all the y-axis curves. Can someone help me do it?

Hi,
If all your curves are lines oriented along either X or Y, then you may use their orientations vectors to know which ones are along X and which ones are along Y.
A dot product between the X vector and an (unitized) orientation vector will yield either -1/+1 (in case of orientation along X) or 0 (orientation along Y). Using this you may split the list. See the definition below.

Thank you @Germain_SOSSOU , It worked. This is the exact thing I wanted.



Can you check these also? I am trying to do the set difference of these sets on both axes as shown in the picture but I dont want the intersecting line to get affected by the set difference. I want both the perpendicular lines to get affected by the set difference. Can you please check this? I am attaching my script here
Set difference.gh (22.1 KB)

I want only the marked lines to be affected.

I don’t understand what problem you are having. What do you mean by:

I am trying to do the set difference of these sets on both axes as shown in the picture but I dont want the intersecting line to get affected by the set difference.

And as your initial problem has been solved, I think you should open a new thread for your new problem.

1 Like

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