Grasshopper

algorithmic modeling for Rhino

I was trying to create an extruded checkerboard pattern on a surface an ran into an interesting (well, for someone who doesn't program) problem. If the board had an odd number of rows/columns, checkerboarding was easy, just cull the evens or the odds. However, if there was an even number of rows or columns, you would have to alternate evens/odds per row.

 

I eventually figured it out in a somewhat roundabout way and figured I'd post it here to see if anyone had a better way of doing it.

 


Views: 2138

Attachments:

Replies to This Discussion

simplest way is to use the modulo operator
(x+y)%2 gives a checkerboard pattern of 1 and 0
Attachments:
Brilliant! I need to work on the whole cross/longest/shortest thing.

You might be interested, I added some similar functionality to StructDrawRhino for arbitrary grids of curves for Arthur and Ognek last year, you'll find the definition here: http://www.grasshopper3d.com/group/geometrygym/forum/topics/request...

nice checkerboard cake definition :) here is another approach:

Attachments:
Ah, SqGrid spits out rows in branches automatically. Half the difficulty in the way I did it was trying to define the rows.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service