Finding the Largest X or Y component of a Curves Segments

Hello everyone,

I am having trouble to sort withing a vector the biggest part of the vector to extract that direction. In the file what I want to do is to decompose the vector and whichever be the biggest part of the vector (for other surfaces besides this one from the example) show me which is this biggest direction of the surface that will always be 2 dimensional.

Vector Sorting Daught.gh (12.1 KB)

I am not clear on what it is that you want.

Maybe include a sketch.

What I want is to decompose the vector and use the biggest part of the vector - in this case the Y direction; to select this part of the vector. In this case the solution would retrieve me the Y direction. What I want is to achieve this direction retrieve.

There are many ways to decompose a vector. Are you just looking to get the longest length in the world coordinate system? This is what you have set up so far.

Yes, I want to sort the biggest XY world cordinates from a vector and that it retrieves me the direction vector.

Could you get the longest line and cast that to vector?

that is what I want to do, but i don’t know how could I cast the vector

Are you looking for the longest X or Y component vector out of all the segments, or are you trying to retrieve the longer of the two component vectors for each segment?

You just take the exploded curve segments, run them into a line container, and then run them into a vector container. Obviously, this doesn’t work for curves.

“you trying to retrieve the longer of the two component vectors for each segment?”

This. I am decomposing a singular curve (the edge with the biggest lenght) vector and want to get the biggest part of the vector and extract its direction.

So the longer of of the two X or Y components for each curve section and a signifier of which (X or Y) it is. Got it.

Here you go:


Larger World XY Coordinate Sorting VR.gh (10.1 KB)

What does “Sorting Daught” mean?


Vector Sorting Daught_2026Aug3a.gh (9.0 KB)

P.S.


Vector Sorting Daught_2026Aug3b.gh (10.0 KB)

He meant to write “doubt”. As far as I can tell it’s a word that Spanish or Portuguese speakers have trouble translating to the word “problem”.


@Joseph_Oster Reading what the OP has written again, I think you might (?) have interpeted what he wanted correctly and I did not.

@Leo13, you were on the right track with the Deconstruct Vector; and I had fun trying to guess what you meant to use the Strean Filter for.

  1. Ultra lean*:
    Vector Sorting Daught_base.gh (31.1 KB)

*ignores absolute values.

  1. For-fun ‘overkill’ guess (with absolutes option):
    Vector Sorting Daught_absolutes.gh (34.1 KB)



Larger World XY Coordinate Sorting VR2.gh (12.4 KB)

:smirking_face:
love you…

good thing I said ‘ultra’ and not ‘non plus ultra’ lol

mega lean :stuck_out_tongue:

We’re just being silly now. Next person is going to come around and hide all the work in a coding component. Actually, I might just try to do that to try to learn to apply my very beginning coding knowlege into practice… It’s very bad beginning knowledge.

@Fabio_Franchetti Your code just finds the whether X or Y is larger for all the segments if I read that right? Curved segments won’t cast to vectors.

yes, but if they are not straight lines in the first place, the question of longer X or Y component makes no sense