Grasshopper

algorithmic modeling for Rhino

# path mapper help

so what i have is a horizontal louver system.  i divided a surface then drew horizontal curves from those points.   to manipulate the louvers i moved the points in the +z and -z direction randomly for now.  since i had to flatten the move command it messed up the tree structure and i dont quite understand the path mapper.  i attached all the files and a picture.  and is there a way to get the path mapper to continuously update?  if i increase or decrease uv divisions the path mapper would need to update as well.  any suggestions?

Views: 2953

Attachments:

### Replies to This Discussion

here you go!
Attachments:

Pathmapper informations:

or ask Danny Boyes (the pathmapper hero :-))

http://www.grasshopper3d.com/forum/topics/sort-mesh?xg_source=activ...

I wouldn't go that far!

Here's something I sent to L]G about my understanding of pathmapper. (This is where I open my mouth and show my ignorance)

In GH v0.5 you where unable to handle multiple items in the same way. Lofting was particularly difficult, you had to have a separate loft component for every lofted surface that you wanted to generate because the component would/could only see one large list of inputs. Then came along the data structures in GH v0.6 which allowed for the segregation of multiple input sets.

If you go to Section 8: The Garden of Forking Paths of the Grasshopper Primer 2nd Edition you will find the image above describing the storing of data.

Here you will notice a similarity between the path {0;0;0;0}(N=6) and the pathmapper Mask {A;B;C;D}(i). A is a placeholder for all of the first Branch structures (in this case just 0). B is a place holder for all the second branch structures possibly either 0, 1 or 2 in this case. And so forth.

(i) is a place holder for the index of N. If you think of it like a for loop the i plays the same role. For the example {A;B;C;D}(i) --> {i\3}

{0;0;0;0}(0) --> {0\3} = {0}

{0;0;0;0}(1) --> {1\3} = {0}

{0;0;0;0}(2) --> {2\3} = {0}

{0;0;0;0}(3) --> {3\3} = {1}

{0;0;0;0}(4) --> {4\3} = {1}

{0;0;0;0}(5) --> {5\3} = {1}

{0;0;0;1}(0) --> {0\3} = {0}

{0;0;0;1}(1) --> {1\3} = {0}

{0;0;0;1}(2) --> {2\3} = {0}

{0;0;0;1}(3) --> {3\3} = {1}

{0;0;0;1}(4) --> {4\3} = {1}

{0;0;0;1}(5) --> {5\3} = {1}

{0;0;0;1}(6) --> {6\3} = {2}

{0;0;0;1}(7) --> {7\3} = {2}

{0;0;0;1}(8) --> {8\3} = {2}

...

{0;2;1;1}(8) --> {8\3} = {2}

I'm not entirely sure why you want to do this particular exercise but it goes some way towards describing the process.

The reason for the tidy up: every time the data stream passes through a component that influences the path structure it adds a branch. This can get very unwieldy if you let it go to far. some times I've ended up with structures like {0;0;1;0;0;0;3;0;0;0;14}(N=1) and by remapping the structure to {A;B;C} you get {0;0;1}(N=15) and is much neater to deal with.

If you ever need to see what the structure is there is a component called Param Viewer on the first Tab Param>Special Icon is a tree. It has two modes text and visual double click to switch between the two.

Have a look at this example of three scenarios in three situations to see how the data structure changes depending on what components are doing.

dear danny,

is it possible for you to create a detailed tutorial with some solution examples
for path mapper? who could do this better than you?

it's easter soon, as one looks forward to gifts.
in any case you have a pre-order from us.

not true, guys?

Of course its possible, anythings possible :).

I will try and fit in something soon. But I can't promise anything as my personal life is sure to get in the way. I've just moved house and we are frantically trying to get it decorated before our fourth child arrives, due Easter Saturday! At work I have a huge amount to do before they'll let me leave on paternity leave, and my wife thinks the baby is imminent.

congratulations, you will get your gift if it is not an April joke.

-not true, guys?-

totally true!

And to continue...

The only input to the pathmapper is the List itself, there is no other means of getting external data into the component from the rest of the GH definition. Having said that there are three constants available to you in the Pathmapper.

You can use the following constants:
item_count = number of items in the current branch

path_count = number of paths (branches) in the tree

path_index = index of current path

So unless you can use these values there is no other way to influence the division of points into separate branches using \ and % without user interaction for each case. It is best to avoid flattening in the first place.

Here instead of flattening your list I've grafted both entries therefore creating two lists of 567 paths that GH can data match easily. Then you can use the pathmapper to collapse the individual points back into a group for input into the Crv component.

hey thanks for the explanation, i went back through the primer to freshen up on editing tree structure.  however my problem is that the path mapper does not update in real-time.  with the file that Dedackelzucht attached it works fine and the path mapper looks like {A;B} (i) - {i%27} where 27 is the number divisions in the u direction.  when i try to change the uv divisions it kills the mapper so is there a way around it for the mapper to keep updating as i increase or decrease UV divisions?  and for some reason the path mapper doesnt fix the way the curves are drawn.  the path mapper makes it look like the structure is right but when i go to draw the bottom curves for the louvers it is just one continuous curve through all the points.  instead, i need one separate curve for each horizontal row of points.  in the definition i have it working fine before i add the random component, but once i add that and flatten the move component, it messes it up

Go back to your U V sliders and add 1 to each before multiplying. 521 should be 567.

and the definition
Attachments:
ahhhh, the solution can be soooo easy.... ( i was fighting with the pathmapper. sometimes rethinking helps:-))