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

Consistent orientation of mesh hole-filled triangles. #6816

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stormboy
Copy link

@stormboy stormboy commented Jun 5, 2024

Type

  • 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 --apply to 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.
  • I will follow up and update the code if CI fails.
  • For fork PRs, I have selected Allow edits from maintainers.

Description

Copy link

update-docs bot commented Jun 5, 2024

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

@benjaminum
Copy link
Contributor

@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
Copy link
Author

stormboy commented Sep 5, 2024

@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.

@benjaminum
Copy link
Contributor

This may require to directly manipulate the mesh arrays. Something like this

  1. Identify the new triangles
  2. Identify all edges connecting existing and new triangles
  3. Count number of edges for which the triangle orientations disagree between existing and new triangles
  4. Change orientation of new triangles if the majority in step 3 disagrees

@ssheorey ssheorey added the status / redo PR needs a rewrite. label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status / redo PR needs a rewrite.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants