How do I limit a list to a certain range?

Hi I’m a bit of a noob to Vuo so hopefully this is an easy question~!

How do I limit a list so that negative values are excluded and simply become zero? (for example)

I tried doing it with the calculate list but couldn’t get it to work.

There seem to be nodes for limit value for integers but not lists.

If all you’re trying to do, really is to limit the list values to a specified range, Calculate List does work.
As stated on that node info in the node gallery, more available functions are detailed on the regular (not list) Caluclate.

So for example you can use the “If Greather then” function, or the “Clamp” function.

So this limits to a range, and sets negative values to zero, but don’t exclude the zeros from the list.
Joined comp below.

Calculate List.vuo (3.78 KB)

2 Likes

thanks! i did actually try this but i’ll give it another go and write back

I think what I was doing wrong was using the if… then expression wrongly, I was typing x < 0 ? which seems more intuitive.  

Yeah I tried x < 0 ? x : 0 first too.

First I thought it could be a bug, but from the node doc “a ? b : c — if-then-else, for example: Score > 100 ? Bonus : 0” it seems x < 0 is the way to go.
Altough I would prefer the other way around too.