Grasshopper

algorithmic modeling for Rhino

if so, why do i get "false"? (see image)

does it actually check the object id instead of the coordinates?

Thanks!

version 0.9.0075

Views: 678

Attachments:

Replies to This Discussion

Points are value types, the equality is comparing the actual numbers that make up the points, but it's likely they are not exactly the same.

The best approach to check if two floating point numbers are the same (a 3d point is 3 floating point numbers), is to measure if their difference is smaller than a tolerance value.

For example, check if the distance between the two points is smaller than 0.01. If it is, assume that they are the same point.

true...so simple, thanks!

Ps: yeah, it needs the Similarity component instead of Equality, and it works with a tolerance as low as 0.000001

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service