Grasshopper

algorithmic modeling for Rhino

Hi guys,

Equality testing for a curve length is not working well ? Refer to the attached image.

Is there a certain tolerance for such operation ?

Views: 404

Attachments:

Replies to This Discussion

It's more likely that the lengths are different, but only at the 12th or 16th decimal, which you can't see when looking at numbers via a panel.

See this FAQ post: http://www.grasshopper3d.com/forum/topics/floating-point-error-why-...

Alright ..

Do you think rounding the length values will solve the issue ?

Thanks David

rounding could be a solution. Better is to build the difference of the 2 curve lengths and check agaist a tolerance value. This can be easy done with c#.

You don't need C# to ignore small differences when testing for equality:

Hi Ibrahim, you could use the Similarity component (in Maths > Operators tab)

Thanks guys, this make sense .. Cheers 

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