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

Allow validation to look at more than the object itself #1697

Closed
A-Walrus opened this issue Mar 19, 2023 · 2 comments
Closed

Allow validation to look at more than the object itself #1697

A-Walrus opened this issue Mar 19, 2023 · 2 comments

Comments

@A-Walrus
Copy link
Contributor

A-Walrus commented Mar 19, 2023

Currently we can validate certain individual objects (Faces, HalfEdges, Cycles, etc...)
Some of the validation checks that we want to do involve looking at more than just the object itself, for example validating that:
All "equal" (up to epsilon) HalfEdges refer to the same global edge. This would involve validating more than just the HalfEdge alone, it needs access to the context which contains the other HalfEdges.
This is required for things like: #1608 #1594
Maybe we need to change how validation works to allow these kind of checks...

@hannobraun
Copy link
Owner

hannobraun commented Mar 19, 2023

Thank you for opening this issue, @A-Walrus!

I actually think validation works as it should right now. You have to consider two things:

  1. The object stores are global. Meaning that the objects of all existing shapes are in the stores.
  2. Objects are immutable, so updating an object will actually create a new one and leave the old one in the store.

Now consider, what happens if we have a cube with side length 1, and translate that by 1 unit to the right? The updated half-edges on the left of the translated cube are now coincident with the half-edges on the right of the original cube. But they don't refer to the same GlobalEdges, and they shouldn't, because they belong to different shapes!

(If they did refer to the same GlobalEdges that wouldn't be correct. We could no longer use GlobalEdges to check for water-tightness of Shells, as you did in #1695.)

So what's the solution? Well, checking for coincident half-edges isn't actually a HalfEdge validation. It's a Shell validation. Because it's the Shell that would be invalid, not the HalfEdges. And we can already write that check, I believe, because we can get all HalfEdges that a Shell refers to (indirectly, through Face and Cycle).

Does that make sense? Those issues you referenced were written sloppily, and should have included that information already. Sorry for that!

@A-Walrus
Copy link
Contributor Author

Makes sense thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants