Grasshopper

algorithmic modeling for Rhino

Anomene Error: Nesting loops to create plank pattern

Hola, 

I am trying to work on nesting loops with anemone and I can't figure this out. I am trying to generate the X vector pattern which works fine. I then assume that I can loop that pattern (which is based on random values) and incrementally translate it in the y direction with another loop. There must be an elegant way to do this. 

btw... I'm trying to make a basic floor plank pattern, but with looping. 

Thanks

Views: 981

Attachments:

Replies to This Discussion

I first got it to work with the nested loop before realizing that only one loop is needed; the nested loop is unnecessary:

P.S.  A low value on the random number seed multiplier seems to work better; "5" vs. "500", for example - but seams are still too close together sometimes?

Attachments:

You are right, thank you Joseph, I appreciate the help. 

It is interesting how you have incremented the y value earlier in the code. I hadn't thought of that. Nor had I thought of shifting the list of x vectors rather than shifting the rectanglular geometry. 

I'll have a closer look tomorrow. 

Thanks. 

Erik

In case this exersize wasn't really about (Anemone) loops, I attached a 'loopless' variation:

Attachments:

Right Pieter, as usual.  I realized that too as my head hit the pillow last night.

There are ways that an Anemone loop could be used here but no loops are needed for the pattern suggested in the OP.

A loop (or two?) might be used, for example, to:

  • fill a given width with random length planks, stopping when the sum of their lengths is less than max plank length (no pun intended), and creating the last plank in each row to fit the remaining space.
  • make sure the seams between plank ends are not too close to a seam in the previous row.

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