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

Fix incomplete VoxelGrid creation from triangles intersecting multiple voxels #6325

Merged

Conversation

sharon-br
Copy link
Contributor

@sharon-br sharon-br commented Aug 21, 2023

Set all the relevant voxels, since a triangle can span across multiple ones
Currently, we break after the first voxel in the depth axis for some reason, but a single triangle can be relevant to multiple voxels.

Is there any option to release a version including this PR, since I really want to integrate this into a solution I'm building.

Type

  • Bug fix (non-breaking change which fixes an issue): Fixes Strange VoxelGrid result from a TriangleMesh #6324
  • 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

The current voxel grid generated is wrong and contains only the first voxel in the depth axis.

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

Mesh itself I've tested:
image

VoxelGrid before the fix:
image

VoxelGrid after the fix:
image


This change is Reviewable

@update-docs
Copy link

update-docs bot commented Aug 21, 2023

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

@ssheorey
Copy link
Member

Is there any option to release a version including this PR, since I really want to integrate this into a solution I'm building.

Hi @sharon-br thanks for the bug fix. We'll get back with reviews shortly. Once the PR is merged, you can use the devel packages from here:

http://www.open3d.org/docs/latest/getting_started.html

(both C++ binaries and Python wheels are available) till the next release is ready.

@sharon-br
Copy link
Contributor Author

@theNded @reyanshsolis Any chance one of you guys can review this, please?

@reyanshsolis
Copy link
Collaborator

@theNded @reyanshsolis Any chance one of you guys can review this, please?

Thanks for your contribution. Will do it by tonight.

Copy link
Contributor

@theNded theNded left a comment

Choose a reason for hiding this comment

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

LGTM. Please change the PR title to a concise, imperative one, e.g. "Fix incomplete VoxelGrid creation from triangles intersecting multiple voxels."

cpp/open3d/geometry/VoxelGridFactory.cpp Show resolved Hide resolved
@sharon-br sharon-br changed the title Set all the relevant voxels, since a triangle can span across multiple ones Fix incomplete VoxelGrid creation from triangles intersecting multiple voxels Aug 28, 2023
…e voxels.

Since the triangle can span across multiple voxels, we should not break when we find the first relevant voxel.
@sharon-br sharon-br force-pushed the set-triangle-in-all-relevant-voxels branch from a145db1 to 70bcc97 Compare August 28, 2023 06:06
@sharon-br
Copy link
Contributor Author

Done - is there anything else we need in order to merge this?

Copy link
Collaborator

@reyanshsolis reyanshsolis left a comment

Choose a reason for hiding this comment

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

LGTM

@sharon-br
Copy link
Contributor Author

@reyanshsolis Your comment commit broke the style check and therefore the test failed, I pushed another commit that fixes that.

@ssheorey ssheorey merged commit 5ba4a42 into isl-org:master Aug 29, 2023
35 of 36 checks passed
@ssheorey
Copy link
Member

Thanks @sharon-br for the bugfix. Thanks @theNded and @reyanshsolis for reviews!

@sharon-br sharon-br deleted the set-triangle-in-all-relevant-voxels branch August 30, 2023 06:54
@sharon-br sharon-br restored the set-triangle-in-all-relevant-voxels branch August 30, 2023 06:54
@sharon-br sharon-br deleted the set-triangle-in-all-relevant-voxels branch August 30, 2023 06:54
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.

Strange VoxelGrid result from a TriangleMesh
4 participants