You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extremely small changes due to rounding already result in isEqual() and isSame() 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:
You are misinterpreting what those methods are for, see the docstring:
Returns True if other and this shape are same, i.e. if they share the
same TShape with the same Locations. Orientations may differ.
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 tol parameter that might be very useful in your use case.
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: