Grasshopper

algorithmic modeling for Rhino

hi, I've a question, maybe very simple...

I have a list of numeric data and i want to semplify it in discrete values. Values of my list are between an interval from 0 to 25 and each value is different from the others. I need to get a new list, with the same data tree structure, in wich, for example, for every value from 0 to 5 of the original list, the corresponding value is always 5, or for every value from 5.001 to 10, corresponds always with the value 10.. an so on. Is there a component or a small definition that does this job? 

If anyone has any suggestion it would be very precious for me. thank you

Views: 605

Replies to This Discussion

Attachments:

Chris thank you so much!! your def is exactly what i needed. 

Unfortunately when i try to apply it in my original def it doesn't works. I think this is because my data list is not flat. I attach my def, if you have some more time for me, can you take a look and try to tell me what's wrong?

i'll be thankfull for ever!!!!!!!

p.s. i'm working with the latest version of GH for Rhino 4

It seems that you forgot to post the definition.

..ops, sorry!

anyway.. i've found out a solution that seems to work. Not so pretty and much more complicated than your's, but it works.

Maybe in few minutes u can rewrite it in a simpler way. Otherwise, please just send me a comment whith any suggestion to semplify it. As you see i'm not skilled with data tree management and any suggestion would be precious for me.

Here you can find the file with both solutions applied to my original def. 

Thank you again, it's always a great thing when someone in some part of the world helps you whithout anything in return!! you're great! thank you!!!

bye

It seems you forgot to attach the file again.

Upload files -> Browse -> find your .gh file -> Open -> Add reply.

i

i retry

Attachments:

rhino file

Attachments:

Is this what you want (see the attached file)?
Bear in mind that my solution is far more complicated and less sophisticated than Chris's solution.

Attachments:

It is beyond my skill level to do this by list paths alone so I used the Recorder Component to get the full listing while maintaining the tree structure.  The flow of the definition is to sort the branch entries (low to high) and then associate the results with the replacement values after which the replacement value list is resorted to recover the indice-value correspondence of the original input list.  I left all of the panels in the definition so that you can see the intermediate results should you have the interest.

Attachments:
maybe it's helped.

this file

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