As you can see in the image, I have a series of points, some of them are on a curve (made of 2 segments). I want to identify the points which are belonging to each segment and create a tree structure of points for each segment. For instance all the points on one segment will be in a branch. I tried to graft the segments but it is not working… What am I missing? Thanks
Thank you Inno,
I think “=” component is bugged because it is actually working if I round the distances before the “=” component, in both cases the value is “0”. Who knows why…!?
More likely that your understanding is “bugged”. Points that are not on either segment (3 points?) will not have zero distance to either segment. They might “belong” to the segment with the lesser distance?
Actually no, see the image, this looks a bug to me… Highlighted in Red the correct one! And if I round the “0” is working without having funny numbers like <0,00001.
it’s not a bug, you can use the forum search to find many threads on the topic
as very general and fast explanation, when comparing floats you can’t just use the Equal Component, but need to use something like Smaller Then epsilon, where epsilon is a tiny amount
if you are drawing something in Rhino with Unit -for instance- millimeters, it usually doesn’t really mean anything to go beyond the second, maybe third decimal
regardless of that, if you are not rounding both your values at a given decimal, they will not be equal if compared directly like in your initial post
like in this example, those are for sure not the very same number, so Equal is correctly returning False
but if you were comparing Distances, you would be happy to consider those distances equal to zero, as they are a trillionth of a trillionth of a millimeter or so
let’s put it this way, floats carry info to the “atomic level”, lots of decimals, while you only need to compare the magnitude of their thousandth of mm, let’s say 3 decimals, so you either have to trim/round numbers to be compared with Equal, or even better just usel smaller/larger than a tiny amount