Comparing first and second item in branch

Hi,

I am trying to check the direction of two curves to ensure they are the same. My goal is to flip each curve if X0 > X1, so that they will both be oriented “left to right” with 0 on the left. I am then hoping to check the Z values to ensure the list descends in order of elevation.

I am trying to create a tree of the endpoints [(start,end),(start,end)] in order to compare the X values. I am not entirely sure how the data needs to be structured.

Thanks for any suggestions.

Sort curves.gh (11.8 KB)


Just a Weave would do so , or Merge

  • You have two curves.
  • You want to check if they have same direction.
  • You want the curves to go from left to right. That is a problem. In this world we only have X, Y and Z. Depending on how you look at your curves, anything can be left or right.. But luckily you say, that you want to flip the curve if the X of the 0 (starting point) is higher then the X of 1.
    So: 0 = startpoint
  • Further I assume it could also be more then 2 curves

    Sort curvesEW.gh (15.1 KB)

@Eef_Weenink
I’m not sure what he actually wants , I assume he wants to make a tree of relative end points :))