Skip to content

Detect non 2-manifold meshes in HalfEdgeTopology constructor #1187

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

Open
halleysfifthinc opened this issue Apr 9, 2025 · 2 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@halleysfifthinc
Copy link
Contributor

Background context: I have a non 2-manifold mesh that is happily converted to a HalfEdgeTopology, but calls to loop result in runaway memory usage. It took me a while to discover the root cause (but also spurred the side-quest #1183) since the runaway memory use in loop caused julia to be out-of-memory killed. 🙁

I don't have any alternate design ideas for the loop function, but the unbounded nature is rather unfortunate, since it allows unbounded memory use/growth for poorly behaved meshes.

I don't understand HalfEdge topology conceptually well enough at the moment to know if/how this could be done, but it seems to me that the best solution would be construction time validation of the mesh being 2-manifold.

Of course, this is tangentially related to #354 Repair(2), Repair(4), and Repair(5) which would be great to have but are currently too tangential for me to work on.

@juliohm juliohm added enhancement New feature or request help wanted Extra attention is needed labels Apr 9, 2025
@juliohm
Copy link
Member

juliohm commented Apr 9, 2025

Background context: I have a non 2-manifold mesh that is happily converted to a HalfEdgeTopology

It is an accident that it works. The HalfEdgeTopology is intended for orientable 2-manifold meshes:

"""
HalfEdgeTopology(elements; sort=true)
HalfEdgeTopology(halfedges)
A data structure for orientable 2-manifolds based on
half-edges constructed from a vector of connectivity
`elements` or from a vector of pairs of `halfedges`.

I understand your proposal is to add some sort of check in the HalfEdgeTopology constructor to throw an error when the property is not satisfied.

@halleysfifthinc
Copy link
Contributor Author

Correct, I had seen the docstring and gathered that my badly behaved mesh was not intended to be constructable/convertible to a HalfEdgeTopology. As such, an error at construction time would be a much better user experience compared to mine, where a later operation ultimately resulted in the Julia process getting killed by the system (which is rather inconvenient for debugging).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants