-
Notifications
You must be signed in to change notification settings - Fork 275
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
Work around lacking robustness of isEqual() and isSame() functions #1532
Comments
You are misinterpreting what those methods are for, see the docstring:
They are checking the internal representations of the Shape objects, not geometric equality. If you want geometric approximate equality, you'll have to implement it yourself. You could indeed compare center of mass, volume, area, number of vertices/edges/faces. I do wonder why do you actually need it. |
Thank you for your reply. I need it to evaluate a library that generates CSG trees from step files. So I'm converting step to CSG and back to step to see if it's still the same. |
If you are able to load the model back to CQ, you could use bool cut to compare the original and final. There is a |
You mean I could use a fuzzy boolean operation to subtract one shape from the other and see if anything is left? That's a cool idea! Thank you |
Hi,
extremely small changes due to rounding already result in
isEqual()
andisSame()
returning false. For example when I export a shape as a.step
file and import it again it's not considered the same anymore.I'm hoping for suggestions on how to work around this! One idea was to compare parameters like area and center of mass and consider two shapes equal if the difference between those parameters is very small. If someone has a better idea please suggest it to me. Thanks!
The text was updated successfully, but these errors were encountered: