Grasshopper

algorithmic modeling for Rhino

Hi, 

I am having trouble understanding index wrapping of the replace button. Please see the image below.

With index wrapping on, I assume if I insert 5 elements at the position 20 of 20-element long list, the items will be automatically wrapped to position 0-4, but it didn't and instead added five more elements at the end of the original list.

How can I correct this problem? Thanks. 

Views: 1352

Attachments:

Replies to This Discussion

Notice that the Range component outputs one item more than you might think. So you can correct it by decreasing the number of steps for the Range components by one (so 19 & 4). Or add an xpression to the Range N input: x-1

Hi Pieter,

I guess I haven't explained my question correctly. Please see the screenshot below. I input four numbers as a list to replace four zeros in the original list. I was expecting that with index wrapping on, if I started with position 8 (or 9th element) in the original list, the last "100" of the replacement list will have a replacement index 11 and should be wrapped to position 0 of the original index, but instead it gives an error. Is there a trick to fix this? Thanks a lot!! 

This could be a workaround.

Thanks. 

Ah, I think now I see what you meant Wendong. Here's how I would circumvent trouble (minor edit of what Hyungsoo did):I think there might be a bug in the ReplaceItems component: the wrap option seems to only work as expected if you replace a single item. If someone could confirm my suspicion, I'll report it.
Because of this I left out the Toggle on the Wrap option, since it doesn't make any difference for the result in this case.

Thanks, Pieter. Looks neater. 

yeah, I think it is bug too. 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service