algorithmic modeling for Rhino
Hi I've been stuck on this problem for a few days.
Is there a simple way to group a set of lines according to their parallelity?
Thanks,
James
Tags:
Jesus,
Thank you very much for you quick reply - your solutions are very nice. Can you think of a solution that would work for x,y,z space?
Thanks,
James
If you want it to work in 3D I suggest you used dot-product and/or cross-product operations.
Jesus, are lines only perpendicular if they are in same direction? wouldn't vectors that are reverse of each other also be perpendicular?
Nick the grouping isn't really an issue, it's just arbitrary for graphical purposes (if I understand correctly). You can always create a set which finds all the distinct elements in a group and then do a member index search to find the respective index of each distinct element within the original set.
Don't worry for the "buzz kill", I also wanna learn new things!
Hello Nick,
I don't understand your question. Did you mean parallel as opposed to perpendicular? If so, that is why I did two versions, one for lines and another for vectors. Vectors are grouped if they point to the same direction; lines are group regardless of start-end direction.
Jesus and Nick,
What I've essentially got is a set of lines generated by proximity. I can group them according to their vectors, i.e. direction simply by turning them into vectors, unitizing them and then making a set.
However, would be great if I could have set of lines grouped even if their vectors were in opposite directions. Please see attached file:
Thanks for your help so far :)
Very nice. It seems it works only if the lines are parallel. There is no grouping if they are not completely parallel.
Here is one that groups vectors according to which way they point at. Note however that they are groups are grafted (one group for every vector). Hence if you want to create a singular set (instead of as many sets as vectors), you'll have to work it out some more.
cool. team work. I will think on it.
© 2019 Created by Scott Davidson. Powered by