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

re-enabled reordering #171

Merged
merged 2 commits into from
Aug 14, 2022
Merged

re-enabled reordering #171

merged 2 commits into from
Aug 14, 2022

Conversation

pca006132
Copy link
Collaborator

This reverts ecd9329 and make BatchUnion use BatchBoolean instead of Compose, as there are additional issues with Compose. Will finally close #114 after the triangulation problem is resolved.

Currently, the Samples.Sponge4 test fails with

Triangulation failed! Precision = 1e-05
Error in file: /home/pca006132/code/manifold/src/polygon/src/polygon.cpp (1019): 'std::all_of(triangles.begin(), triangles.end(), [&vertPos, precision](const glm::ivec3 &tri) { return CCW(vertPos[tri[0]], vertPos[tri[1]], vertPos[tri[2]], precision) >= 0; })' is false: triangulation is not entirely CCW!

@pca006132
Copy link
Collaborator Author

Ah and interestingly the Boolean.Close is causing some problem. Will look into that.

@pca006132
Copy link
Collaborator Author

It seems that it is stuck in an infinite loop in FormLoop in the 7th iteration.

@elalish
Copy link
Owner

elalish commented Aug 4, 2022

I upgraded our debug mode, so you should be able to run ./manifold_test --gtest_filter=Sponge4 -v to get some more details; would probably be interesting to look at the difference between your branch and master. How much does it rearrange the three ops? Is it still three differences, or is it a difference of unions now?

@elalish
Copy link
Owner

elalish commented Aug 6, 2022

Well, I was hoping #179 would solve this problem, but it seems to still exist after merging. It's definitely a related issue though - I'll keeping looking into it.

@elalish
Copy link
Owner

elalish commented Aug 8, 2022

Okay, it looks like we've made progress with #180 and #182; we no longer have any infinite loops or bad triangulations. Now it's just that Sponge4 has 38k degenerate triangles, which is not great. Any thoughts as to why that might be?

@pca006132
Copy link
Collaborator Author

pca006132 commented Aug 9, 2022

Not sure if this is an issue with the f3d viewer or something, I see some weird lines in the triangulation which might explain the degenerate triangles:
image

We have 433308 triangles when reordering is enabled, comparing with 396896 triangles when it is disabled. Perhaps the triangulator forgot to perform simplification in some cases?

@elalish elalish mentioned this pull request Aug 9, 2022
@elalish
Copy link
Owner

elalish commented Aug 9, 2022

Okay, I've got a repro on master now, #183. I must say, this has been a great PR for testing!

@pca006132
Copy link
Collaborator Author

Indeed. After this is merged we can try to enable usinf compose for union which also need some fixes. Also, I can start working on the fuzzing/property-based testing, which will probably expose more subtle bugs.

@elalish elalish mentioned this pull request Aug 11, 2022
@elalish
Copy link
Owner

elalish commented Aug 14, 2022

It looks like this PR isn't breaking anything, but just exposing some degenerate triangle removal difficulties already present on master. That's fine, but before we start reordering the operations, can you think of a way that we can cache intermediate results that are reused? We don't have any great examples of this in the samples right now, but it's pretty common in design. I really don't want to force users to trigger intermediate evaluation manually.

@pca006132
Copy link
Collaborator Author

I think intermediate results are already cached? Users only need to trigger intermediate evaluation manually if they want to debug or need to do some benchmarking.

Btw, should we modify the NumDegenerateTris values for Boolean.Gyroid and Samples.Sponge4 to fix the broken tests? And then open an issue to track the degenerate triangle removal issue.

@elalish
Copy link
Owner

elalish commented Aug 14, 2022

Interesting; I was referring to this, but I guess I'm not quite sure how common that behavior is. Maybe it's not a big deal; I should really write some more samples.

Yes, let's go ahead and update the tests and merge this. 👍

@pca006132
Copy link
Collaborator Author

Oh, because we are not using compose for now, that behavior will not occur. For compose, it may be beneficial because we may be able to get more non-intersecting manifolds, but it is not beneficial when we do boolean directly.

@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.15%. Comparing base (747dcd9) to head (ea721db).
Report is 389 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #171      +/-   ##
==========================================
+ Coverage   96.55%   98.15%   +1.60%     
==========================================
  Files          30       30              
  Lines        2611     2602       -9     
==========================================
+ Hits         2521     2554      +33     
+ Misses         90       48      -42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@elalish elalish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage is looking good 👍

@elalish elalish merged commit 08598c0 into elalish:master Aug 14, 2022
@pca006132 pca006132 deleted the reordering branch August 15, 2023 12:54
cartesian-theatrics pushed a commit to SovereignShop/manifold that referenced this pull request Mar 11, 2024
* re-enabled reordering

* fix test failures
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.

feature request: lazy boolean operations
3 participants