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

Fixed duplicate edge handling #179

Merged
merged 2 commits into from
Aug 6, 2022
Merged

Fixed duplicate edge handling #179

merged 2 commits into from
Aug 6, 2022

Conversation

elalish
Copy link
Owner

@elalish elalish commented Aug 6, 2022

Fixes #176

In pairing halfedges to construct the manifold, in the case of a duplicate edge (not a 2-manifold, which is occasionally caused by the triangulation), it was possible that I would pair the two forward edges together and the two backward edges together, which doesn't work. Now I've adjusted the way I sort to ensure I always pair a forward edge with a backward edge.

I've also separated the internal IsManifold check into two: IsManifold now only checks for data structure sanity (the problem we had here, and something that should be true at every step of the algorithm), while the new Is2Manifold also checks for edge duplication. The public IsManifold's behavior is unchanged. I've added asserts for IsManifold to catch this kind of problem in the future more quickly, but they only get triggered in verbose mode.

@elalish elalish self-assigned this Aug 6, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #179 (6c0fc3f) into master (bf2a9a8) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #179      +/-   ##
==========================================
+ Coverage   96.53%   96.57%   +0.04%     
==========================================
  Files          30       30              
  Lines        2624     2630       +6     
==========================================
+ Hits         2533     2540       +7     
+ Misses         91       90       -1     
Impacted Files Coverage Δ
src/manifold/src/impl.h 100.00% <ø> (ø)
src/manifold/src/boolean_result.cpp 100.00% <100.00%> (ø)
src/manifold/src/impl.cpp 99.47% <100.00%> (+<0.01%) ⬆️
src/manifold/src/manifold.cpp 89.65% <100.00%> (+0.68%) ⬆️
src/manifold/src/properties.cpp 90.90% <100.00%> (+0.18%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@elalish elalish merged commit a08a9e7 into master Aug 6, 2022
@elalish elalish deleted the manifoldBug branch August 6, 2022 16:26
@elalish elalish mentioned this pull request Aug 6, 2022
cartesian-theatrics pushed a commit to SovereignShop/manifold that referenced this pull request Mar 11, 2024
* better manifold checks

* fixed duplicate edge handling
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

Successfully merging this pull request may close these issues.

Non-manifold input to SimplifyTopology in Boolean.Close test
2 participants