Sweep2, can't connect multiple sections

Hi all!

I’m trying to make a sweep2 form with grasshopper but I can only connect one section to my sweep2 (whether there should be 4 sections that I want to connect to my sweep2).

Here’s a picture of my “gh-code” and the red dotted lines are those that I cannot connect to sweep2 (or I can but only one at time and would like to have all of them).


So these are the sections that I would like to have part of my sweep2.

i would appreciate any help! Thanks :slight_smile:

20191030_Sweep2_problem.gh (11.5 KB)

See white group. Merge and Flip section curves to match the first one.

20191030_Sweep2_problem_2019Oct30a.gh (18.6 KB)

Thank you for answer! It really worked, but can you explain what is the meaning of flipping? Why it must be done? (I’m trying to understand how the code works).

And now I have also second problem, because I can’t get “Same height” working. If I toggle “Same height” whether True or False, the forms stays same as in your picture and nothing happens…

If I do the same form just Rhino, the form changes when i select Maintain height.

Any idea what is the problem in grasshopper?

Thank you!

For loft or sweep, curves all need to have the same direction, with start/end points aligned. The Flip Curve component will swap directions if necessary so that all input curves match the guide curve.

As to the height problem, see this:

This (below) adds just one more section curve in the middle and moves the others around a little bit,

20191030_Sweep2_problem_2019Nov1a.gh (20.8 KB)

Thank you very much Joseph!

Is there any special trick to model curves in Grasshopper in the first place so that they will have same direction? Or some way to check what is the direction of the curve?

Of course I know now (thanks to your explanation) that I can use the Flip Curve component, but I’m just thinking that if I could do the curves in the first plave so that they have same directions, I would be saved from one extra component and the code might be “cleaner”.

You can reverse the list of points used to create the curve, as I did below. Looking at start/end points is the surest way to know direction, or move Point On Curve from zero to one to see which direction the point moves.

Note that Loft can be more forgiving (smoother) than Sweep.

20191030_Sweep2_problem_2019Nov1b.gh (21.6 KB)

P.S. Version ‘c’ below uses section arcs in YZ planes on a divided tween curve.

20191030_Sweep2_problem_2019Nov1c.gh (25.2 KB)