Skip to content
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

High level shape equality testing #863

Open
jdegenstein opened this issue Jan 13, 2025 · 0 comments
Open

High level shape equality testing #863

jdegenstein opened this issue Jan 13, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@jdegenstein
Copy link
Collaborator

Currently, high level shape equality testing is not possible in build123d:

a = Box(3,2,1)
b = Box(3,2,1)
a == b # returns False

Here is my proposal to achieve the higher level __eq__:

  1. Fix shape serialization bug (via patch to OCP or with ocp-addons)
  2. Generate serialization of shape via BinTools (see persistence.py in build123d)
  3. Hash this serialization
  4. a==b compares the hashes of the serialization

@snoyer noted that step 3 may be unnecessary and it may be better to simply compare the shape serializations. It is definitely worth investigating both approaches.

This is related to, but not the same as -- lower level equality testing to wrap TopoDS_Shape.IsEqual for the purposes of comparing equality of underlying OCP shapes:
CadQuery/OCP#161

@jdegenstein jdegenstein added the enhancement New feature or request label Jan 13, 2025
@jdegenstein jdegenstein added this to the Not Gating Release 1.0.0 milestone Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant