Grasshopper-like Remap Node

Hello everyone, I have an issue regarding a definition conversion from GH to Dynamo. More precisely, it is about the fact that the Remap Node needs to be flatten in order the script to work, but in Dynamo there is no source input to flatten(like in GH) so I need to flatten the Values, but in the end it won’t work because the data list structure is flatten and everything is mixed up. So is there anyway to do this without flattening or there is any node with similar inputs as the GH Remap?

What is this screenshot? The solution, or where you are at now?

With Dynamo you don’t need to flatten your data to get a proper min/max range. As you can see the remap component in Dynamo doesn’t have a source range, it figures that much out on its own, based on lacing/source input. Take for example a flat list of numbers. It will internally create the range from that list and then re-map it to target range.

Now if you input a nested list (data tree) it will perform that same operation on each sublist (branch) individually. Example:

Both ranges get remaped to exactly the same range, but individually for each list hence the two result in the same exact output. It doesn’t ask for min/max that is shared across the whole domain of the input list, instead it creates min/max for each sublist individually. If you don’t like that behavior you can use this method:

This would simulate what you did in Grasshopper because you flatten the input numbers to get min/max for the WHOLE data range, and then remap those into new range without losing the structure of data.

Good luck!

4 Likes

Thank you, Konrad! It works as show in the last picture! Thanks a lot!