algorithmic modeling for Rhino
Tags:
Hi Tomas,
vectors don't have starting points, they are merely directions in space. What you have there are lines. Although if they are all supposed to have the same startpoint, then I guess you can just focus on the direction only...
When you say adjacent, do you mean you want to find the one that points as much as possible in the same direction, or one that is actually pointing in the exact same direction, or the two vectors on either side? If the latter, then it's a strictly 2D problem because 'side' doesn't work in 3D as a concept.
You have to use the vector line, heading out, replacing the [List item] (A), and replaces the [Cull item] with the other vectors (B). The [Subtract] component returns the vector from B to A and [Sort List] receives the length of the vector. That is, simply measures the distance. As the vectors are unitary, the two closest are the surrounding.
Uooops, forget this, the two closest are not necessarily neighbors, sorry! Pieter's method is the correct way.
I should have said: provided all lines start at the mutual point (like you stated in your initial question), or all lines end at the mutual point.
Dear Pieter,
Thank you very much that was what I looking for:)
I tried to use this in 3d and it also works.
Do you know if this works in 3d in all cases or it is a 2d problem?
Hi Tomas, it's a pure 2d solution. I'd say for a reliable method in 3d you'll need to find the two smallest angles.
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by