Fix CalculateNormals#1724
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1724 +/- ##
==========================================
- Coverage 95.34% 95.13% -0.21%
==========================================
Files 37 37
Lines 8329 8291 -38
==========================================
- Hits 7941 7888 -53
- Misses 388 403 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
Would this have any impact on doing fillets using a chamfer? |
Owner
Author
|
Yes, this and several other of my recent PRs are in pursuit of this goal, but I haven't quite attained it yet. Stay tuned. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed some ugliness near the edges of Booleans when using CalculateNormals (see #1720 (comment)), which ultimately stemmed from my trying to do too much fancy stuff. CalculateTangents(sharpenedEdges) identifies flat faces as sets of three or more neighboring triangles with the same normal and uses this normal instead of the pseudonormal. I tried to do the same thing with CalculateNormals and SmoothByNormals, but it's a poor heuristic because Boolean ops often cut triangles into polygons, which then get stuck as flat faces, breaking with the curving surface around them.
I fixed this by simplifying the logic considerably, which should make it more robust and less surprising. It does loose some of the cool features I was going for, but I think much of that can now come by using the missing normals approach. I also changed the default min sharp angle from 60 degrees to 52.5 (halfway between 60 and 45), since it's annoying to have it right on the edge for relatively common angles.
I still have more work to do in this space, especially around better handling of quads, but first I need better decimation.