Grasshopper

algorithmic modeling for Rhino

Posted the below question on the grasshopper google group.
Does anybody have a tip on how to write this little script?
Any references to C# for grasshopper?!


Tonsgard -

--------------------------

The best way is to use a C# or a VB component to transpose these
lists. I think in C# you can use transpose directly. You can ask this
on the VB/C# forum on our new website, www.grasshopper3d.com

- Scott

On May 27, 3:56 am, Tonsgaard wrote:
> Being a long time user of Generative Components trying to use
> grasshopper i miss the "transpose" command.
> I have a point list like this:
>
> 0, 1, 2, 3, 4, 5
> 0, 1, 2, 3, 4, 5
> 0, 1, 2, 3, 4, 5
> 0, 1, 2, 3, 4, 5
> 0, 1, 2, 3, 4, 5
>
> and a want to transpose dimensions to:
>
> 1, 1, 1, 1, 1
> 2, 2, 2, 2, 2
> 3, 3, 3, 3, 3
> 4, 4, 4, 4, 4
> 5, 5, 5, 5, 5
>
> Surely I am not the first in need of this...
> how would i go about and do this...? I suppose its quite easy in VB
> script, but being used to GC's C# like language, I kinda dont know how
> to do this...
>
> thanks...
>
> Tonsgaard

Views: 4115

Replies to This Discussion

Tonsgaard,

is your point list multidimensional (a datatree)?
You mean something like this?


This example divides several curves into points, then rearranges this lists into a new set of lists where one contains first point of all the curves, another contains the second point of all the curves, etc.
Yup... exactly like this.

(it is multidimensional as all lines are divided in one go)

any way I could get that script for reference?!
It's not a script, it's done entirely out of components. You should be able to reproduce it from the screenshot. I think the only hidden bits are that the input list of the 'list item' component is flattened out and in the series components +1 is added to the number '4' from the text panel since when you divide a curve in 4 parts it results in 5 points.

There's a discussion about this in the old forum:
http://groups.google.com/group/grasshopper3d/browse_thread/thread/e...
Obviously not script.. definition then.
I recreated it and it works... thanks a lot mate!! :-)

for developers: maybe a transpose list component would be good to have!?!
Hi jes

below the same topic but solved with vb data tree script (script reference from david)

hope it helps
Attachments:

Solved by "Flip Matrix" component.  Adding this comment (many years later) just so folks doing a search now will find this.

The "Path Mapper" is good to transpose list.

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service