Is there a way to sort and group data from two sets like so?

Each branch has 2 curves:


p.s. Letters just for naming, there is no sequence

Yes.

  1. If you have two objects, Obj1 and Obj2 of the same type (or implicitly castable types, for example integer num and real num) you can compare them and find out which one is greater BUT only if there is defined comparer for that type
  2. Some types already have default comparers (5 > 2.71)
  3. You can define you own comparer for any type of object (in c# component)
  4. For example you can define comparer for Polyline which will analize position of polyline in space and decide which one of them is “greater”, or have defined comparer that will compare lenghts of curves …
  5. If you are able to compare objects, you are able to sort them and group them as well

Hey) Thank you Radovan for your answer :slight_smile:

I am not sure why shuld I find a greter value?

I was hoping I could limit this definition by using native GH components :C
Like Weave, and so on…

So far I could do this, I feel like some sort of “graft” is missing



ches3.gh (30.9 KB)

Oh I think I approximately got what you mean, but I have no idea how to elaborate it in a code :frowning:

Also, I dont think that sorting points is the universal solution for creating surfaces from intersecting curves (alike in my example)

Your points are already sorted along rectangle.
You have to use Anemone to cycle thru left-pairs / right-pairs of curves and find intersections…

But you can do this without Anemone as well. Here is one solution:

ches4.gh (23.7 KB)


Woah, there is some very interesting approach you did!
Thank you for your help!!
I am trying to understand it for now :slight_smile:

Here is small explanation if it helps:

1 Like