Grasshopper

algorithmic modeling for Rhino

Hey,

Im having problems with the equality function trying to compare vector angles, and I still can't understand what Im doing wrong. It almost seems to me as the equality (and actually <> functions too) are broken!? Clearly, index 1 in the marked paths in the picture should show "TRUE" as they are equal to index 1 in the list I am comparing the angles to? Im trying to single out path 0;1;24 in the picture, which is not aligned with either X or Y...



Seem really awkward that these simple math functions should be, but I simply can't see what Im doing wrong here..? Any help sorting this mess out would be greatly appriciated!!

Views: 912

Attachments:

Replies to This Discussion

Just solved this issue by using similarity instead of equality... given the circumstances its weird equality didn't work though, because the points that I draw the vectors from were taken from a rectangle in XY orientation, so most of them should be dead aligned with X or Y axis, but clearly they were not :S? Is there a way to make Grasshopper type all the decimals of a number or signal when something is not actually zero?

The panels really leave you in the dark here, especially when you can and should expect the numbers to be dead on...

To be fair, it might be a bug but I cannot test without the data. What you can do is is use the format component to turn your numbers into exact (not rounded) textual representations. You'll need the formatting mask {0:R} and plug the numbers into the [0] input. (The 'R' flag stands for 'roundtrip', meaning the text can be converted back into the exact same number if need be, ie. the formatting is lossless).

Hey David, thanks for your swift reply

Indeed, some of the numbers were rounded as can be seen in the picture, though I can't understand how, as all come from the same line intersection event, intersecting a rect in XY orientation with multiple curves. Anyway, good to learn how to reveal the real numbers in the panel!

Floating point number mathematics is almost never exact. Whenever you add, multiply, subtract, or divide floating point numbers the result will be close to but not exactly what the answer in an ideal world would have been. Over time, these discrepancies add up and in some cases amplify.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service