Grasshopper

algorithmic modeling for Rhino

Hi everyone,

 

I have a Boolean-list, where I would like to find the middle one of three "TRUE'S

 

for example:

 

{0;0;0;0;0}
0. False
1. True
2. True  <-- this one
3. True
4. False
5. True
6. False
7. True
8. True  <-- this one
9. True
10. False
11. True
12. False
13. True
14. True  <-- this one
15. True
16. False
17. True
18. False
19. True
20. True  <-- this one
21. True
22. False
23. True
24. False
25. True
26. True  <-- this one
27. True
28. False
29. True
30. False
31. True
32. True  <-- this one
33. True

 

Any idea how I can solve this?

 

Thanks!

Views: 409

Replies to This Discussion

Boolean and with shifted lists. This will only leave overlapping sections of true set. This exact definition will only work for maximum set of three consecutive true values.

Attachments:

Great, thanks Hannes, that worked!

If you have repating pattern (it seems so by your example) then it is easy to use Cull Pattern component.

Thanks Kristjan, the repetetive factor was just a coincidence though!

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service