Grasshopper

algorithmic modeling for Rhino

Can someone please help me resolve Grasshopper destination for the following required out.

1.Line

2.Divide line (odd/even divisions)

3.Move points in series along z-axis but from the center.. such that the center point (in case of even) is displaced max as compared to the rest.

4.On changing the the divisions of the line (odd/even division) the out of moved points should be as shown.

Views: 969

Replies to This Discussion

There's probably a more elegant way to do this, but I tested for even or odd and divided the number of points by 2. If odd, for example 5 points (0, 1, 2, 3, 4), you'll get 2.5, round down to get the middle index, and choose that point with List Item. If even, for example 4 points (0, 1, 2, 3), you'll get 2, so subtract one and choose those two indices, 1 and 2. I only had a few minutes to play with this, so it isn't a fully-baked solution, but it should take you a little further.

Attachments:

Thank You. So Much.Works just Great. 

This would be my approach

Attachments:

Wonderfully Done. Thank you So Much

Take the list length and divide by 2.

Round the number and use the "Ceiling". On the round component that's the C

Build a series or a Range based on that number then reverse it and merge them into one

Use the "Delete Consecutive" component so you have one that it doubled up in the middle and one that isn't.

Plug in the two lists (one with consecutives deleted, one with repeats) into a stream gate and use a modulus-2 of the original list length to pick which gate. 0 for even 1 for odd

Attachments:

Thank You. Andy

I am New to GH.

Will look at the definition,

It's a nice approach but just be wary of the stream filter not lending itself to multiple gate numbers. e.g. if you had two curves, one odd, one even, the filter wouldn't work.

here as example:

I am looking for only one curve for an example i am working on.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service