Grasshopper

algorithmic modeling for Rhino

Hi all,
i've got a problem. I have a list of which i need to multiply every second item with (-1). A friend of mine sent me the file attached (weave list.ghx) where exactly that happens, but when i include that part in my bigger definition then it all the sudden just gives negative (-1,-1,-1,-1,...) values instead of (1,-1,1,-1, ...).

Any clue? Or any idea how to solve that operation easier?

Thanks a lot, cool new page btw, go on like that!!!

philipp

Views: 1419

Attachments:

Replies to This Discussion

i think now, i got a solution for this, i mean at least, the 1/-1/1/-1 thing works now.
but that doesn't really solve the problem: in the first step, i need a 1/-1/1/-1 pair, but in the second step it should be -1/1/-1/1...the third is like the first, the fourth like the second and so on....

is there a switch-component or anything else which would help here, that i can control that step-wise?
Hi, if i understand correctly you want to multiply a list of numbers by a repeating pattern. This pattern being 1 -1 1 -1 -1 1 -1 1. If it is so then this should do the trick:


You can divide the n input of the duplicate component by 8 to reduce the list size but it's not necessary since the multiply component is set as shortest list.
Hi Vicente, thanks for your thoughts, but they don't work either, i mean they work on an independent pattern like you showed, but not when i include them...

i prepared my definition with some annotations, just draw 2 splines and set them as curves to be lofted in the beginning. then it shows, what it does right away. i also uploaded a picture, which shows, how it is supposed to be....

maybe you have a minute to look over it, thanks, cheers, p
Attachments:
It doesen't work because you are feeding a list of numbers divided into different paths. You have to either flatten everything out, or simply add a graft tree component after the duplicate component (much quicker). If you use this second method you have to flatten the input of the list length component.
hey vincente,
i kind of understand what you mean, but just kind of and not totally...

so i go on using the definition you proposed and then i just add an flatten-tree-component before the list-length and a graft-tree-component after the duplicate and that's it? because then i get from the (in this case) 4 values i have the first three positive and the last one negative.......

i'm confused, but that's what apparently happens with shooot like that...

thanks anyways, p
"so i go on using the definition you proposed and then i just add an flatten-tree-component before the list-length and a graft-tree-component after the duplicate and that's it?"

No, not both at the same time. Right now you have one list of numbers where each number is in an individual path and another list of numbers that are all contained in the same path. You want both lists to be in one of this ways.
The quickest way will be to add ONLY the graft component after the duplicate component. This way there will be one path per item in all lists of numbers. Also, flatten the input of the list length component in this case (right click on top of the input and select 'flatten'.
awesome! now that works, we're getting there...

i had to set up that switch-thing for every of the four points, for the first and the third with the integer (1, -1) for the D of the duplicate, and with a (-1,1) for the second and fourth.

so now that switch works in every row, the one and last problem is, that now every row needs to be offsetted by 1, like the first row starts with an A(1,-1,1,-1) followed by a B(-1,1,-1,1). the second row should start with a B followed by an A.

the picture shows, what's coming out right now, the other picture i posted earlier shows how it should be....

you're a great help, man! thanks a lot, p
Attachments:

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