Grasshopper

algorithmic modeling for Rhino

Hi

I have a path tree structure {A;B}

What I want is to flatten all the A path's in {A;B} so I dont get all the different B branches. See example below.

What I have

{0;1} - 2 curves

{0;2} - 2 curves

{0;3} - 2 curves

{1;1} - 2 curves

{1;2} - 2 curves

{1;3} - 2 curves

{1;1} - 2 curves

{2;2} - 2 curves

{2;3}-  2 curves

And what I want.

{0} - 6 curves

{1} - 8 curves

{2} - 4 curves

I have tried some different stuff whit the path mapper tool, but I am not to skilled in using it. I imagine it can do the work for me?.  

If anyone can help me out, I would be glad.

 

 

 

 

Views: 880

Replies to This Discussion

Using path mapper with mapping {A,B} -> {A} should work.

Hi Systemiq

I tried {A,B}(i) -> {A}(i), which does not work,  but not what you just suggested, which work.

 

Thanks

It probably didn't work because the comma should be a semi colon and would normally give an error.

There is a another component that will achieve this now: [Shift Paths] by default is set to -1 which is the same as {A;B} --> {A} on the [Path Mapper] or {A;B;C} --> {A;B} etc.

 

Works too.

Thanks

 

If i type {A;B}(i) -> {A}(i) the (i) messes it up somehow.

Yes it would. Here's why

{A;B}(i) --> {A}(i)

{0;1}(0) --> {0}(0)

{0;1}(1} --> {0}(1) fine so far

{0;2}(0) --> {0}(0) oops same as first

{0;2}(1) --> {0}(1) oops overwrite existing

{0;3}(0) --> {0}(0) overwrite etc

---

{2;2}(1) --> {2}(1)

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

{2;3}(1) --> {2}(1)

 

Correct use of index in this case {A;B}(i) --> {A}

but because you don't need to use the index on the right hand side, don't specify it on the left, as it takes the [Path Mapper] longer to process when the index is used.

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