Fix minimal oriented bounding box of MeshBase derived classes and add new unit tests #6898
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.
Type
Motivation and Context
Fixing the
MeshBase::GetMinimalOrientedBoundingBox
method, which did not return the minimal oriented bounding box. Also adding new unit tests for the derived classesTriangleMesh
andTetraMesh
for the different bounding box generation algorithms, since they were not covered.Checklist:
python util/check_style.py --apply
to apply Open3D code styleto my code.
updated accordingly.
results (e.g. screenshots or numbers) here.
Description
The
MeshBase::GetMinimalOrientedBoundingBox
method was callingOrientedBoundingBox::CreateFromPoints
(so same functionality as MeshBase::GetOrientedBoundingBox) instead ofOrientedBoundingBox::CreateFromPointsMinimal
(as done in PointCloud::GetMinimalOrientedBoundingBox). I have also added new unit tests for the minimal oriented bounding box, oriented bounding box, axis-aligned bounding box, and get center for bothTriangleMesh
andTetraMesh
objects.Testing
Testing code (in the visualization the bounding boxes of the meshes are slightly enlarged for better visibility)
Before the fix
After the fix