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
InvalidOperationException in Halfedges.CollapseEdge #17
Comments
Hi Gilles, thanks for raising this issue and for including so much useful information. There's definitely something funny going on... I will add your test case to the project and will investigate what's causing the error. |
Thanks looking at this issue! I played with it a little more and it seems the bug occurs when you try to collapse a edge that's part of a triangle, and that the edge and its NextHalfedge are both adjacent to the same face. I was able to work around the issue by detecting when that situation occurs, and instead collapse the pair edge of the NextHalfedge. This accomplishes essentially the same thing and doesn't hit the bug since that edge will be part of a face with at least 4 sides. Thanks, |
test case provided by @indigo99
Will, I merged your fix #19 into the main branch and I'm not seeing any more issues. The other bugs you found are never triggered in my particular script. Thanks so much for your help! |
Here is my test case:
And the stack trace:
If I catch the exception and dump the state of the mesh, this is was I get:
I believe the
Halfedges.CollapseEdge
should just merge the two faces and leave me with a single face (0, 1, 2, 3). Is that right? Any idea what the issue is?The text was updated successfully, but these errors were encountered: