algorithmic modeling for Rhino
Hi all,
I am trying to create a valid set of numbers on a single list, in a single branch. As far as I can tell, the create set component isn't working for floating point values. I can multiply the values by 100 and round them, then create a set, but it doesn't seem to work for the smaller numbers. I am sure I am missing something...
Any insights?
Thanks,
Rob
Tags:
Hi Rob,
sorting certainly won't matter, Create Set doesn't care about the order in which values are specified.
Could it be that your floating point numbers are not actually the same? When displaying floating point numbers Grasshopper rounds to 6 decimal places. These numbers typically support up to 16 decimal places and if there is a tiny difference further down they will register as different numbers.
To test the actual values of your numbers, you can use a Format component with the formatting mask {0:R} (the 'R' stands for Roundtrip, meaning no rounding will be used and the text can be converted back into numbers without any loss of information).
If it turns out the least significant digits do indeed differ, you can round your numbers to N decimal places using an expression:
--
David Rutten
david@mcneel.com
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by