Grasshopper

algorithmic modeling for Rhino

Generating Differnt Boolean Patterns base on Condition

Hello everyone,

Im currently struggling to generate different Boolean patterns to dispatch based on a IF condition. 

So for example,

if nr of points=4 True, False, False, True

if nr of points=6 True, False, True, True, False, True

What I want to achieve is symmetry. Thats why in every even number of points the patter must change.

This image shows 6 vertical points, but its not symmetrical.

I have uploaded my def, its quite simple.

Thanks for any help!

Views: 959

Attachments:

Replies to This Discussion

Hi again,

in cases like this, the use of "IF" and booleans is un-handy.

You would have to make an IF for every possible length...

To achieve a symmetrical pattern i did this:

Start repeating the base pattern (true,false) from "both sides", one at start and one at end of you final total length "L" desired pattern.
As sometimes L could be uneven, from one side (A) repeat base pattern until it reaches L/2 rounded up, and from the other side (B) until it reaches L/2 rounded down.

Then simply merge together (pattern A) with (flipped pattern B) to get the full size pattern.

Cya!

Attachments:

Hey thank you so much!

You actually helped me achieve what I wanted. Now everytime the nr of points is odd the true false pattern applies, if its even, the merge method takes place.

And also, I can swap the pattern so that trues become false and false become trues with a double click!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service