Grasshopper

algorithmic modeling for Rhino

Hello,

I'm making a def with a set of distances that I've remapped between 50-100. Is it possible to take these values and round them up or down to say, 3 different numbers? So, for example, the first subset would be rounded down to 50, the next to 75, and the next to 100? I've been trying to figure out how to split a list into three or more equal parts but with no success so far.

Views: 3050

Replies to This Discussion

This is one way you could go about it. Remap your numbers to a 0 To 1 range, multiply the output by the amount of values you want on the other side minus 1 (if you multiply by 3, your rounding will produce 0.0,1.0,2.0, and 3.0), and then you can you can use replace numbers to put any value in there which you might want.

Attachments:

Attachments:

No remap, rounding to list of arbitrary values:

Attachments:

Thanks guys this is great!

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