Grasshopper

algorithmic modeling for Rhino

Hello,

I can't seem to simplify a list with only one item... I want my list to transform from {0;0;0;0} to {0}.

I tried simplify tree but this doesnt work.

Any suggestions?

Thanks

Views: 1454

Replies to This Discussion

Ok I fixed it with path mapper... Any reason simplify doesnt work in this case?

As you correctly noticed the Simplify action will only work on trees with multiple Branches. When a path is {0;0;0;0;0} it might seem obvious to you that you just want {0} but what if it was {0;0;1;0;1} should it be {0}, {1} or {1;1} or even {0;0;0}?

This leaves you to simplify it yourself. here are a couple of methods depending on whether you need it to change as your definition changes.

Path Mapper:

Dynamic Last Path:

Oh and here is the Anything But Zeros Method as pondered:

Attachments:

Thanks for the clarification!

Hi Danny,
I am trying to solve the following problem;

I can have one tree with one branch (for example {0;0;0;0;0;0} OR one tree with multiple branches (  {0;0;0}, {1;0;0}, .... {4;0;0}).

I want the output to be a tree with single digits as branch numbers ( {0}, {1}, ... {4})

I tried the following but got unexpected results:

I thought I could use your function if the tree only had 1 branch, and use the standard simplify if the tree had more than 1 branch. Is there an other approach I could use?

Thanks in advance

Replace Paths (Miss out the <reverse> I/O Modifier as you are interested in the First Branch):

Thank you!

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