Grasshopper

algorithmic modeling for Rhino

Hi 

I've been cracking my head over this for some time now but can't seem to find a solution. 

I've got a list of points: 11 branches with variable number of points in each. I would like to group them into new tree, so that branch {0} has points from branch {0} {1} {2} combined, branch {1} has points from {2} {3} {4}... as it shows in the atached image. 

The main problem is that points need to overlap in the new tree.

Any suggestions?

Views: 938

Replies to This Discussion

Never mind, I've got it ;)

I am very interested in this issue.


My solution was sort of a caveman's solution - getting the branches paths from the Param Viewer and then using multiply "Split list" components to split the branches paths by splitting index of 3:


Can somebody post a more correct solution, please?

Attachments:

Here is how I've done it. The key is to set the "branch" component in "renumber" mode - it then duplicates branches in the way you supplies the "P" with Paths you like, and then using the "replace" component sort them in the groups of 3. This would work equally well if the groups wouldn't be same size, and that said is more flexible than "split list". 

Thank you for the reply Maciej,

I am using older version of grasshopper than 0.9+ so I do not have the "renumber" mode at "Branch" component.


Can you explain what does that "{"&x&"}" expression do in function?

changes numbers supplied to "x" into strings. anything you put into " " is taken as string (text) and use "&" as "and/+"

try putting this "{"&x&";"&y&"}" in function with x and y as numbers

You said "&" means "and/+"?
Why are there two "&" characters ("&x&")?

you can read it like this:

string/text "{" and variable x and string/text "}"

"{"      &     x     &      "}"

so that when you connect number stream to the equation you get

{1} {2} {3} .... {x}

x doest need " "

Thank you.

Just one more thing Maciej:

Is there some expression which can be used for reversed thing:

To remove the "{" and "}" instead of adding it?

Thank you.

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