algorithmic modeling for Rhino
Dearest Community, I´m having a problem with the equality component.
or this one:
I´m trying to follow the tutorial on think parametric.com and I get stuck at the point where we want to filter out the Points on the edges of the surface. Why isn´t the Equality component setting index 2 on true...
confused greetings and good morning (well it´s lunchtime already)
Flo
The Definition so far..:
Honeycomb%20on%20Surface%20Tut%20from%20parametric%20thinking.gh
p.s. flattening the distances doesn´t help
p.p.s: as you can see the point aren´t projected on the edges correctly. I tried to fix this for hours with several experiments wich all worked only this one doesn´t. Why? No Comprende...
Solution to Problem : decoding the Distance values through an Integegers Component...
Comment
p.s. Floating point Math is something I have heard about in the context of computers using always too many decimal places and therefor being slower than they had to be but that I would ever touch that topic is something I wouldn´t have expected this morning. Well. thank you again
@Valentin. Thanks for the advice, but since the Values in List A and The Value I want them to be compared with are at my screen absolutely identical, I wonder why it didn´t work. But I didn´t knew that function with rounding, so I learned something. Thanks again
Whilst GH is displaying 0.0 for the benefit of the panel the value it is actual storing in memory is probably 0.00000000000001 because of the way a computer handles floating point maths.
The value you supply as a comparison is a string (or text) representing the number 0.0 GH will convert this to a number being 0. The answers you have derived to compare this to have all been subject to calculations and therefore carry "floating point errors" which is why when you ask a computer to add the numbers 0.1 and 0.2 together it gives you the answer 0.30000000000004
You will need to either use the Similarity component which has a tolerance setting allowing you to account for floating point errors or you can do it with Subtracting your two comparison values together and seeing if the absolute value of the answer is less than 0.0000001
Oh, ok. thank you for your answer, I´m new to this Blog and forum stuff. Discussion forum, got it.
No, the Equality Component shloud have compared the values of input A to the Value of the Panel (0.0) and set True if equality is given or false if the condition is nor fulfilled. Then I could have used the pattern (true, false, false, true etc...) as a cull pattern for the next component... But it didn´t compare the numbers correctly unless I put the values through the integers Primitive Component...
PS you need to post this in discussion forums so that the replies are editable after posting.
It should have said 0.1 + 0.2 = ?
It's called Floating Point maths.
Your computer needs to convert everything into binary in order to do anything. Binary and decimal places are not very compatibly (to a certain degree)
the question what is 0.1 + 0.3 = ? is often asked of software developers.
have a look at this site: http://0.30000000000000004.com/
© 2019 Created by Scott Davidson. Powered by
You need to be a member of Grasshopper to add comments!
Join Grasshopper