print crv.GetLength()
print crv.GetLength() == 2.0
print crv.GetLength() < 2.0
print crv.GetLength() > 2.0
Output:
print crv.GetLength()
print crv.GetLength() == 2.0
print crv.GetLength() < 2.0
print crv.GetLength() > 2.0
Output:
I don’t see that here, I just get this output with a line of 2.0 mm:
2.0
True
False
False
edit: ah, not when rotated…
I remember this has to do with floating point rounding errors. Try this instead:
len = round(crv.GetLength(),5)
print len
print len == 2.0
print len < 2.0
print len > 2.0
see also: 15. Floating Point Arithmetic: Issues and Limitations — Python 3.9.2 documentation
Indeed floating point issues, from that floating point topic I love this:
Whenever you’re using floating point numbers (single or double precision, doesn’t matter), you can’t ever be sure a number you give to the computer can be properly represented by the computer.
Ok, that’s it. I’m uninstalling my computer…