# Strategy to categorise lines left or right in relation to a test line?

Hi everybody,

I’m currently looking for a strategy to categories lines, connected to a test line, into two groups: the lines on the right (red) and the ones on the left (green) of the test line (blue).

The left and right are defined by the tangential direction of the test line (and the XY plane)!

What would be a good way to achieve this, independent of the line directions, which could vary?

Since lines only have one direction, their tangent, and thus don’t derive clear planes, would it still be possible to achieve this categorisation in tree-dimensional space, meaning when all lines are connected, but not all lie in the XY Plane?

right_left.gh (11.0 KB)

Make the blue line the x axis of a plane. Make the world’s z axis the y axis of that plane. Pull the center point of the red and green lines to the plane (with plane closest point component I think it’s called, don’t have gh atm). That component will give you a positive or negative distance value depending on what side of the plane it is on. Then you can filter by positive or negative to determine side.

2 Likes

This is what @Michael_Pryor said … (i hope )

right_left_re.gh (14.7 KB)

2 Likes

If the lines are just 2d on the world axis you can also easily use the Curve Side component.

Curve Side.gh (11.7 KB)

1 Like