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.

Comments

If all you're trying to do,

Bodysoulspirit's picture
Submitted by

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.

Yeah I tried x < 0 ? x : 0

Bodysoulspirit's picture
Submitted by

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.