Grasshopper

algorithmic modeling for Rhino

Hi

Im working on file in which I am dividing a curve into even and odd values and using those values as the starting points for new curves.  My question is, How can I use the definition almost exactly like it is working now, (keeping the even and odd division values seperated) but not include the bounding values when drawing the new curves.  For example if a curve is divided into 8 points, I want to use division points 2-7.  If its divided into 100 points I want to use division points 2-99.  I hope this makes sense.  Ive attached the rhino and grasshopper file.  Any help would be greatly appreciated!  Or if you have a more efficient way of writing the definition I have posted I would love to hear some suggestions as well.

g.nice

Views: 359

Attachments:

Replies to This Discussion

You can strip off your bounding values by culling a list or shifting the list around.

TAZ! you're the man! Both of these options worked, and I am using the list shifting technique, but could you explain how the culling technique is working? I mostly curious about the flatten tree operation...
Well, you may or may not need to [Flatten] depending on how the culling indicies are generated. It's a matter of checking that the results are as expected. To obtain 8 values (from an original list of 10) you need to make sure GH is reading the culling indicies as a list of 2 values.

In the above example you can set it up without [Flatten] and see what happens to the results... you'll get a list with 18 values. This is because the branch name coming out of the "0" panel is {0} and the branch name coming out of [Subtraction] is {0;0}. GH considers these two separate tree branches thus separately culls each index from the same list and is lumping the results together. 9 values + 9 values = 18 total.

If you right-click on each component there is also a flatten button. I used the [Flatten] component for illustration, but most of the time if you are trying to get rid of tree data it's easier to use the toggle.

When things don't behave as expected it's usually because of embedded tree data structure. Trees can be a bit tricky to get the hang of, but they are useful for many situations. The WIP nature of GH also means frequently double checking everything.

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