Grasshopper

algorithmic modeling for Rhino

Sweeping a curve between two rails with changing distance in between

Hello everyone,

I'm still a beginner at Grasshopper and I was hoping for a piece of advice on how I can sweep a curve along two rails when the horizontal distance between them is changing, which means that the curve would need to shrink and expand. 

I was thinking of generating a graph mapper and specifying the points along the upper and the lower level curves as the start and the end points but I'm not sure what is the bay way to do so.

Would it be easier to interpolate the bottom base polyline up while smoothing its curvature until it reaches the top base shape and then shifting the lower level so I get the vertical curvature in the interpolation? 

Thank you so so much in advance! 

Views: 1769

Replies to This Discussion

I was thinking of generating a graph mapper and specifying the points along the upper and the lower level curves as the start and the end points but I'm not sure what is the bay way to do so.

I think this is a great place to start. If I understand you correctly, what I might try is the following:

1. Divide your top rail and bottom rail by equal distances, so you have points sitting along your curves.

2. Find the midpoint between each line drawn from top points to bottom points. 

3. Use the midpoint to find the closest point on the red (loft-looking) surface in your photo.

4. This will also give you the normal direction of the surface at that location. 

5. Take the midpoints you found earlier, and move them in the direction of the surface normal (or just along some fixed axis, like Y)

6. have the amount you move each point be affected by the graph mapper, so you can go from a little displacement to a lot (if you want)

7. then take these 3 sets of points (top rail pts, moved mid pts, and bottom rail pts) and interpolate curves through them

8. loft

That's just one way to do it. I'm sure there are more elegant ways but this one will give you a lot of control over the outcome.

Best,

Brian

Brian,

Thank you so so so so much! 

Came up exactly as I needed it! 

Regards

Viktoria

Brian, 

Thank you for the help again but I have one more small query if you can help by any chance. 

I have been trying to leave the edges of the surface straight, so I culled the first and the last items of the generated lines (before moving the middle point and converting them to arcs), and then I tried to loft between all the curves and the first and the last straight lines but the loft function didn't like it and it just lofted along the curves and did a separate straight surface between the straight edges from both sides. 

Is there an alternative surface generating function I can use? 

Thank you in advance! 

Viktoria

Can you upload the GH and Rhino file so I can take a look?

I think that what you tried should work fine, but the problem is probably either that the order of the curves is wrong or maybe the path structures of the curves are not all the same. Usually when you modify geometry in GH the path structure will change a bit, so the straight curves might have a path structure of {0;0} and the modified/bendy curves have a structure of {0;0;0} (for example). So when you go to try to loft them all, it will loft all the curves with {0;0} together, and the ones with {0;0;0} together, creating two separate lofted surfaces. 

So if you can ensure all the curves are on the same path (you could even just flatten the entire list, since you are only trying to make 1 surface) that would help.

If that doesn't fix it I would suspect the curves are out of order. If this is the case there are 2 options I would consider.

1. Use the replace list component to replace the first and last bendy-curves with the straight ones, ensuring that you insert the straight lines in the first and last position in the list.

2. Sort the list of curves using the sort component. Sort takes a list of values, and a list of geometry (or whatever). It sorts the list of values, small to big, and sorts the geometry (or whatever) in the same manner. So you could get the endpoints of the curves, decompose them, and use the X component as your list of keys to sort, and plug in the curves. The curves will come out the other end sorted in the X direction.

If your curves cannot be easily sorted along an axis, you can look into the sort along curve component.

Best,

Brian

Actually if you upload your files I can also show you how to also get the graph mapper working with your definition

Brian,

Thank you so so much for the help! I did manage to apply the graph mapper correctly along the length of the structure so I can control the curvature in elevation. 

However, now I'm facing a much more difficult for me issue with optimising the form of the structure for a best wind load performance.

I have not modelled the columns and the slabs of the building so to achieve bending stiffness I've modelled truss-like internal bracings connecting the two faces together. 

However, when I run it in Kangaroo the structure behaves as if it does not have any bending stiffness and is just a hollow box, so I'm guessing I haven't introduced the trusses to kangaroo the way i need to... Could you please give me any advice on where you think I might have gone wrong? 

Thank you in advance!

Viktoria

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service