Sweep curve along multiple rails

Hi there, this is a follow-up to this feed[Reply Deleted - Grasshopper] I am also wondering how to do the exact same thing. Sweep in independent closed curve along multiple rails. I am working in Rhino 5 w grasshopper plugin and whenever I open all attached examples of grasshopper script, they import with some grasshopper commands with an “old” label slapped across, meaning it was done in an older version, as I can see this convo was held five years ago.

Now, when I re-assign the rail curves and the curves to sweep using the script with the “old” labels, the command performs as expected (image labeled 1). When I try and script my own using the updated version of rhino/grasshopper, it seems that the sweeping curves sweep not only their assigned rail, but also follow along the other rails (image labeled 2).

Can someone please tell me what is happening now and how to refine the assigned outputs so that this sweep command goes back to normal?

In Number 2 you are forgetting all the flattens and grafts. Orient B input should be flattened. Sweep R and S input should be grafted.

2 Likes

Michael,

Wonderful. Problem solved, thank you so much!

Rachel

Hey I have a slightly more complex version of this problem that I can’t seem to get working. I’m trying to sweep multiple profiles across multiple rails. Is this something that’s possible? No matter what combinations of grafts/mappings I try, it either sweeps all profiles across all rails (like example #2 at the top) or it matches rail 1 with profile 1, rail 2 with profile 2, etc.

Is there a comprehensive description of how the different levels of the data trees interact with each other in various operations?

-Zoltan

Yes. Try the search feature?

https://discourse.mcneel.com/search?q=data%20trees%20category%3A2

Thanks Joseph for the links. Perusing them I’m still not finding how GH decides when to match two lists element-wise and when it decides to duplicate an item and match it with all other elements.

Intuitively I would assume that for a particular tree level it would try and match entries between two trees if there are multiple in both, otherwise it would duplicate a single entry across the number of instances of the corresponding tree. However this doesn’t seem to be the case, at least with the Sweep1 operation I’m trying.

Without seeing your code, no one has a clue. You want us to write an example from scratch? Not happening from me.

and when it decides to duplicate an item and match it with all other elements.

It never does this unless using cross reference. By default the longest list wins at the tree level (list of lists) and the list level (items). The last element in the short list gets matched to the remaining elements in the long list. This works at the list level and by the item level.

Thanks Michael I’m starting to understand how this works, although this is still vexing to me:

In this case it matches {0;0} from the top with {0;0} from the bottom, then duplicates {1;0} from the top to all remaining items on the bottom list, regardless of their branch. Am I correct in thinking that as these trees go into the Sweep1 operation, they are essentially flattened into two 1-dimensional lists for the purposes of matching?

{0;0} matches with {0;0}
{1;0} matches with {0;1} and the rest of the lists in the 14 branch tree.

Got it. I suppose I will need to duplicate the rails for each sweep profile then in order to make it work. Thanks

Depends what you are trying to do? If you want all those profiles to sweep on both rails then just flatten the S input. Then all the profiles will be matches to each rail.

Or if you want it that each profile sweeps by itself on each rail flatten just the R input

I did try both of those options but neither seemed to function properly. Finally was able to achieve what I wanted by making a copy of each rail for each profile curve:

1 Like