Grasshopper

algorithmic modeling for Rhino

Hi,

Im trying to get a metal screen manufactured that uses the image sampler to create the circular perforations that are based on the images colour value.  The manufacturer needs perforation sizes to the nearest .5mm.  What can i add to the definition to make the radius of the perforations round to the nearest .5mm? 

 

My definition currently uses:

 

rec grid>image sampler>divide>circle

Views: 811

Replies to This Discussion

Hi Jesse,

 

you'll need an expression to process the radius values. In order to round to the nearest 0.5 unit, use an expression as follows:

 

CInt(x * 2) / 2

 

where CInt() stands for Convert to Integer and x is the variable name of your parameter. So if you put this expression into the R input of the circle component, then x should be R.

 

I added a component yesterday that allows you to find the nearest value in a list (works for numbers, colours, points, vectors, text and booleans), which would make this easy for a non-logical set of perforation-radii, but you'll have to wait until the next version goes out.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Aaah nice component !

Waiting for the next version you can still use that little def that works on numbers, using closest point.


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