Grasshopper

algorithmic modeling for Rhino

I am sure this is extremely easy to solve but I am new

Attached you will find an Image Sampler Definition. 
I have a series of boxes and those boxes extrude based on the grayscale of the image I am sampling.
What I want to have happen is that the boxes extrude in intervals of 5cm, the lowest extrusion being 1cm and the highest extrusion being 30 cm (or 31cm in the case of 5cm intervals).

I tried a few things taking the values of the image sample, multiplying it by a number to get the end domain 30 and then using the range button with a specific number of steps and it would make the file unmanageable and crash everytime.

Any help would be greatly appreciated

Views: 1051

Attachments:

Replies to This Discussion

How about this:

Take your resulting value from your Image sampler and divide it by your intended range 30/5 and converting it into an integer. Thus limiting your values to one between 0 and 5. Multiply by the number of intervals (30/5) to get back to your 0,5,10........30 values and then add 1 for the range 1 to 31.

Definition.png
Results.png

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service