Grasshopper

algorithmic modeling for Rhino

EDIT UPDATE SOLVED IT: read bellow for all the details. The issue was that the search mask was one item and the replacement pattern was 24 items, so I grafted the input list and then pulled its structure with the param viewer to build a matching search mask. seems to be working.

 

In the past when I solved my questions without any response I deleted the discussion. is that considered bad practice/ frustrating?

 

EDIT original question:

 

I’m having trouble rebuilding a path after flattening it.

I understand the idea of rebuilding a list after it has been flattened but I can’t seem to get that principle to work in a path situation.

I’m certain the solution will have something to do with culling index’s and using graft tree but I can’t seem to figure it out. This image should explain what I’m looking for.

 

 

 

I want the data stream on the right to look like the data stream on left.

There is one caveat, this example is based on edge data from a box so everything clumps neatly in groups of four, my real world data is not based on a box so the srfs could have any number of sides. So using the grouping function in path mapper does not seem viable to me.

 

Thank you

 

Don

 

EDIT UPDATE:

 

I have discovered the replace branch component but it wasn't the amazingly simple solution I was hoping for.

 

so in the top replacement component:

D a list of data I need restructured.

R a list of branch coordinates I need it to be restructured too.

 

that setup results in an error obviously by the picture. GRR

 

in the bottom replacement component I have the same streams only with list item components before the inputs. so I'm sending the same data lists only one index at a time. that works exactly how i need/dreamed it should but I need/dreamed of the entire list being restructured.

 

any ideas on how to get replacement branch to work on the lists? or at least how to replace the entire list?

 

 

Views: 2231

Attachments:

Replies to This Discussion

Try the attached using path mapper with integer division and remainder using the fact you know data was grouped in sets of 4.

 

I personally would say don't delete discussions, even if you self determine the answer, others might benefit from the question/answer.

Attachments:

Hey Jon, thanks for the response. I can't use the mapper grouping because my source doesn't always have four path ends. it just happens to have them in the example because I used a generated the test geometry with a box component, which always has four edges per a srf of course.

 

The solution I managed to figure out uses the replace Branch component. Its a little convoluted at first but, once you see it all play out it all makes sense, I just finished pluging the process into an actual project and it works like charm.

 

Sounds like good advice regarding deleting discussions. To make a amends here is a color coded and annotated version of my solution. in the future I'll leave my questions up. The bright purple stuff are the important data streams that made it all happen. the path mapper is doing something similar to matrix flipping, I don't know if the flip would have worked but {A;B;C;D}(i) -> {A;B;C}(D) seems to get the job done.

Attachments:

I've always wondered if a path mapper that had an input for the mapping string might be useful (so it might be dynamically created), it seems to me perhaps in this case it might be.  I don't know if David has an opinion on this.  The main thing is you have a solution that works so good to hear.

I found a simple way to solve this. I hope it is useful (see attached files).

Alejandro

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