Open3D
Open3D copied to clipboard
Consistent orientation of mesh hole-filled triangles.
Type
- [x] Bug fix (non-breaking change which fixes an issue): Fixes #
- [ ] New feature (non-breaking change which adds functionality). Resolves #
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) Resolves #
Motivation and Context
Checklist:
- [ ] I have run
python util/check_style.py --applyto apply Open3D code style to my code. - [ ] This PR changes Open3D behavior or adds new functionality.
- [ ] Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is updated accordingly.
- [ ] I have added or updated C++ and / or Python unit tests OR included test results (e.g. screenshots or numbers) here.
- [x] I will follow up and update the code if CI fails.
- [ ] For fork PRs, I have selected Allow edits from maintainers.
Description
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.
@stormboy Thanks for this PR! I think it would be very good to get consistent orientation for the newly created triangles. However, the proposed solution affects all triangles. This could change the orientation of the existing triangles which is an unexpected side effect. Do you want to give a solution a try that only affect the hole triangles?
@stormboy Thanks for this PR! I think it would be very good to get consistent orientation for the newly created triangles. However, the proposed solution affects all triangles. This could change the orientation of the existing triangles which is an unexpected side effect. Do you want to give a solution a try that only affect the hole triangles?
I agree that this change adds a dirty way to try solve the problem. I have in fact found a few cases where this solution results in opposing normals in much of an original almost closed volume mesh.
I am in fact planning to have another look at this problem in the coming month. This is the first time I have looked at VTK, which is what is being used, so it might take me a while to understand approaches that can be taken here.
This may require to directly manipulate the mesh arrays. Something like this
- Identify the new triangles
- Identify all edges connecting existing and new triangles
- Count number of edges for which the triangle orientations disagree between existing and new triangles
- Change orientation of new triangles if the majority in step 3 disagrees