Today I’m playing a bit with some data to generate lines with a specific precise width.
I have pulled a list of numbers from an output with a domain between 0.2 and 2.0
Now what I want to do with this list is to have all the values that are close to a set of seven values, to be pulled towards those values.
So as an example:
0.4 becomes 0.35
1.7 becomes 2
1.2 becomes 1
0.8 becomes 0.7
etc
etc
Is there a function that can do this and leave the data in the tree intact? I have managed to tackle many challenges, but this is above my knowledge. So the desired end result is a list that only contains values that match values from the list (see image).
To make it easy I have attached the file with the data: pulldata_1.gh (11.3 KB)
I hope someone knows how to achieve this, if anything’s unclear, let me know!
Absolutely works fine, thanks a lot. I chose to go the Heteroptera route. I should’ve searched for a ‘closest[…]’ in the double click menu to add a new component before asking here. I already had Heteroptera installed.
Super useful advice. Thanks again.
Also thanks to everyone else replying in this topic. I had not expected an answer this soon, it’s so wonderful to see how people are helping each other out here. I hope my question can be of use to a future someone as well.
I totally missed this one, thanks. I was already using ‘Round to Decimal Place’ from Pufferfish but I didn’t know ‘Round to Nearest’ could do this as well. Super useful!