The new NodeBox forum is live! Everything from support.nodebox.net moved here: sign in with the same email to pick up your old posts. Something not working? Write to forum-support@nodebox.net.

NodeBox 3From the old forum

Filtering math nodes?

2 replies Last reply

  1. Does anyone know if it's possible to filter the results of a math node using the filter node? I've seen there are undocumented properties to look up (https://forum.nodebox.net/t/14772154/property-nodes) but I'm wondering if there are others.

    For example, if I have two lists of points and I use the distance node to find the distance between each, how would I use the filter node to only output nodes less than a certain number? I'm not sure what to put in the "key" field of the filter node.

    Copy link
  2. Rougeux,

    The filter node needs a table key to work with, so the easiest way to solve this is to give it one, by simply making a table.

    See example network and screenshot. I use the make_table node to make a table with three columns: node A, node B, and distance. Then all you have to do is filter with "distance" as the key.

    Since you now have everything in a table, you can do lookups to recover your nodes (e.g. lookup node A). You can also do sorts, eliminate duplicates with the distinct node, etc. Tables make everything easier.

    Another way of doing this would be to hook your distance node to a compare node to generate a list of booleans (e.g. true only if distance greater than 200). You could then feed that list of booleans into a cull node - one cull node for each list of points, both using the same boolean list. One advantage of this approach is that you wouldn't need to do a lookup to recover the points.

    Let me know if that solves your problem.

    Thanks,

    John

    Copy link
  3. Thanks, John. I ended up coming to the same solution with the table node. I love the addition of that node. Using a cull node is another interesting solution I'll keep in mind.

    Copy link

Know something that helps?

Sign in with your email address to reply. No password needed.

Sign in to reply