Grasshopper

algorithmic modeling for Rhino

Hello! I need to generate a definition to put all the data with the {2;x} in a single branch, but it has to be as much flexible as it can in order to perform with different data inputs. I don't know why it divides the tree like that instead of a single branch with multiple items.

Views: 1066

Replies to This Discussion

Try 'PShift (Shift Paths)'?

You could use the shift paths component, or the path mapper. With the path mapper, you could create a null mapping and then set a bunch of mapping rules like:

{A;B} >> {A}

{A;B;C} >> {A}

{A;B;C;D} >> {A}

etc.

Try studying this cluster I made. It works basically on deconstructing and reconstructing paths and is more robust the pshift and path mapper which can break if the path lengths differ from what you're expecting.

(Just to be clear - it is the cluster in the black box within the GH example....everything else around it are just examples

Attachments:

Your cluster is broken - you forgot to connect the 'T (Data)' input to the 'Replace' component:

Ha Ha, yes... I think I corrected it in another post but must have forgot to update this thread.

You're right [T]>[Data] needs to connect to [D] on both Replace components

have a look on this...

somehow flexibel

greets
Mark

Attachments:

This is from a project in another thread that I will post in full there "soon".  Möbius strip logic that incrementally rotates a series of polygons in a circle and connects their vertices with one or more interpolated curves ('IntCrv').  I won't go into the subtle complexities here but I have distilled a sample data set to create this simple demo to explain my data tree problem.

'Original Points' contains a tree of points with five branches, corresponding to the vertices of rotated pentagons.  The 'Tree/List Viewer' can be used to see the points in each path or, when flattened, to see the resulting sequence that generates this 'IntCrv' - note the twisted curve:

'Desired Points' is a flattened list of the same points after re-ordering the sequence of paths (tree "branches"), as indicated in the "Desired" panel.  It can be partitioned into branches the same length as the original points (they are all the same length):

I wrote an Anemone loop to accomplish this because everything else I tried failed.  Is there a better way to get this result without a loop?  It must work for any number of paths in the original list (from triangles up to N point polygons).  The sequence is determined by the "Desired" list of paths.

Attachments:

The red group partitions the 'Desired Points' to match the length of the 'Original Points' branches:

Attachments:

Thanks everyone! I will take some time to study all your answers.

The first reply from Joseph worked very well!

Thanks.

Federico

Argentina.

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