Grasshopper

algorithmic modeling for Rhino

Perform action selectively on a set without losing the rest of items

Hello to all,

I already solved this, but I think I took the very long road to do it. I am going to illustrate it with a more specific example which is where the problem arose:

I have a set of lines which are parallel two by two. However I would also like to align them in the same direction. Hence I perform a dot product which gives me the ones that have the same direction (result equals 1.0) and the ones that are in opposite direction (result equals -1.0). Then basically what I did was select the lines that I wanted to flip with a dispatch, and then merge them with the ones that weren't flip with the "Item index". 

Any easier way of doing it? Thank you all again!

Views: 286

Attachments:

Replies to This Discussion

[Sift Pattern] and [Combine Data] may be of help here. They're useful for splitting a data-stream into two or more separate flows, performing different operations on each one and then putting it all back together again.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thanks again David; works like a charm and it's much simpler!

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service