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
add manifold check #1684
add manifold check #1684
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1684 +/- ##
=======================================
Coverage 30.84% 30.84%
=======================================
Files 74 74
Lines 15395 15398 +3
=======================================
+ Hits 4748 4750 +2
- Misses 10647 10648 +1 |
I've been doing |
Turns out that they're identical. I missed |
Semantically, I wouldn't know to use "open edges". The docs don't explain what is is meant by an "open edge" or provide any visuals. When most (if not all) VTK algorithms fail, they do so with an error that the mesh "is not manifold" rather than it having "open edges", or something else. I think it makes more sense to the end user to use the term "manifold" in the property (that's what they're going to be looking for; something that tells them if the mesh is manifold or not). There are also multiple reasons why a mesh might not be manifold (self-intersecting faces, open edges, duplicate vertices, edges, or faces, to name a few). So, it would be good to know not only whether the surface is manifold, but also why it is not manifold, and where the guilty vertices, edges, and faces are. To that end, I think it would be good to have an |
Thank you @akaszynski ! Sorry for dropping the ball on this... |
strongly recommend a more intuitive spelling of this such as edit: how about |
I like this thinking as well. There are several definitions used interchangeably that people in different fields might be more used to. The term "manifold" has a comprehensive mathematical definition, but I have also heard and see the term "water tight" being used. I think all of this could be fleshed out a bit more in the docs. I am still a fan of adding a few "manifoldness/watertightness" properties (i.e. "duplicate vertices", "duplicate edges", "duplicate faces", "self-intersecting faces", "open edges", etc.) in addition to a larger property "is_manifold/is_watertight" that captures all of them. I'm personally a fan of using "is_manifold" because VTK and pymeshfix use the term in its errors, it is a much more comprehensive term (applies to any |
Good point. I was going for "compact manifold" (e.g. a
These checks will involve a bit more logic but it's doable. I know that certain libraries (like tetgen) require a compact manifold. Furthermore, is a compact manifold mesh with duplicate vertices or edges still a compact manifold? Watertight might be a better descriptor, but nonetheless, I'd consider a watertight mesh still a compact manifold. Can we come up with a better name than |
I'm also more of a fan of using As mentioned, I don't think any errors a user will see say anything like "edges were open" or "mesh was not watertight", but rather "mesh is not manifold", so I think it will make more logical sense across multiple libraries if we use the term |
Two suggestions:
Because only looking at the number of open/boundary edges cannot determine if the object is manifold or watertight or any other higher-order property really |
@adamgranthendry do you remember specifically which VTK errors you were thinking of here? I would rather fix them (either upstream or as a wrapper in pyvista if really necessary) rather than propagate an incorrect meaning of 'manifold'. |
I'm not referring to specific errors, but in general. For example, if you smooth a mesh such that it becomes non-manifold and then attempt to decimate or subdivide it, I have seen an error like:
My point is that There is nothing to fix. These sorts of things can be prevented by checking before successive filters whether or not the mesh is manifold, but hence that's why this PR has been created. Currently, one could check for Since this would be a common thing to check for, it is appropriate to add it to the list of properties existing for data sets and |
I'm of the opinion that we should keep the "terminology" of PyVista in concert with VTK, and therefore should use the same general definition of "manifold." Moving to merge this unless there are any significant objections. |
Implement suggestion from @adamgranthendry in pyvista/pyvista-support#510 for a manifold check.