-
Notifications
You must be signed in to change notification settings - Fork 359
fix Vector.__eq__() #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@justbuchanan Maybe add a test to https://github.com/CadQuery/cadquery/blob/master/tests/TestCadObjects.py ? 😇 @adam-urbanczyk It seems there is a |
@justbuchanan good catch. Did you consider using the IsEqual method of the underlying OCC object (gp_Vec)? @Peque indeed. This is a fork of my repo, that is why. Anyhow, I added it to travis and appveyor. |
@adam-urbanczyk thanks, I thought I checked for a builtin function, but somehow I missed |
@justbuchanan looks good to me. Maybe change the tolerance from 1e-5 to 1e-6? |
this seems fine to me. i think hard-coding the tolerance is probably a mistake,though. The implications of tolerance and equals run very deep, especially when you get into things like geometry fixing and stuff like that. I think the ideal would be to test for equality, but then have a way to reference a single defined geometric tolerance, which can be changed one place. But i'm not sure the best way to accomplish that |
OK merging and will add an issue about the tolerance handling. @justbuchanan thanks for your contribution! |
I think the previous implementation was just doing a pointer comparison so two unique vectors with the same contents would not be considered equal.