algorithmic modeling for Rhino
The "Test vector" with "angle tolerance" is an interesting wrinkle to filter the lines. I added some visual aids to help me see it better, including the blue "Test vector" in the corner. Looks to me like you miss lines/vectors "aiming toward you", so to speak, within the same angle tolerance.
Chooselinesbydirection_2016July27a.gh
I applied your data to my code, posted earlier. As vectors (preview disabled), all the blue lines point down, the yellow up - selectbyvector_d2_2016July27b.gh:
You could start by providing some internalized data in a GH file.
The one you posted has no internalized data, not even a single point. Better would be to provide a collection of lines to study for their directional vector properties, which can only be determined by assuming a vector between start and end points?
Given that (the 'Random Lines' param in attached code), I would answer your question this way:
Attached selectbyvector_2016July27b.gh shows lines or vectors:
Finally, selectbyvector_2016July27a.gh, the code I wrote to create the 'Random Lines' internalized data:
Both are really great approaches, I still can't believe that you can solve such complex issues so fast.
Many thanks I got it done perfectly :)
I think something even simpler is possible! Whenever you want to compare vectors, Dot Product is your friend - with unitized inputs it will return a 0 for perpendicular vectors, a 1 for parallel vectors, -1 for anti-parallel vectors, and values between 0-1 for "pointing generally the same way." The nice thing is this works if the vector you want to test against ISN'T conveniently one of the cardinal axes. (And Joseph - I think you can generate random vectors a bit more easily as well :) )
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by