Grasshopper

algorithmic modeling for Rhino

Hello!

So in architecture, we have the 9 square diagram, and the 16 square diagram. If we imagine any number of these squares colored either black or white, we get a specific number of iterations depending on the number of white and/or black squares. I've got a script that will generate these iterations for me, but in a random method. I'd like to be able to do this in some sort of numerical order where the first white, or 'subtracted' square starts in the upper left-hand corner and moves left to right, top to bottom as I cycle through these iterations.

For example, in the 9 square problem, if I subtract 2 squares, I would expect my first iteration to be this:

The second:

The Third:

The fourth:

and so on...

I've attached the script...I'm racking my brain whether I should approach this as a binary problem, a boolean problem, or some sort of mathematics that I can't comprehend. 

Views: 1272

Attachments:

Replies to This Discussion

It's possible to be systematic about this a bit more simply. See the attached for the 9-square case, 16 should be easy enough to figure out from there. For the "NxN square" case there's probably a generic solution (that doesn't require adding the right number of inputs to the cross reference component) but I'm having trouble imagining a native solution that doesn't require scripting or some kind of loop. 

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service