-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Implement ComputeTriangleAreas, GetNonManifoldEdges and RemoveNonManifoldEdges in t::geometry::TriangleMesh #6657
Implement ComputeTriangleAreas, GetNonManifoldEdges and RemoveNonManifoldEdges in t::geometry::TriangleMesh #6657
Conversation
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
188c467
to
3b8f865
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nsaiapova! Some minor comments. Feel free to ignore comments labeled with nit. We can chat about the algorithm....
@@ -1212,5 +1212,84 @@ TEST_P(TriangleMeshPermuteDevices, SelectByIndex) { | |||
box_untouched.GetTriangleIndices())); | |||
} | |||
|
|||
TEST_P(TriangleMeshPermuteDevices, RemoveNonManifoldEdges) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this - looks like we didn't have a test for this in legacy geometry.
3b8f865
to
20782b4
Compare
Hi @nsaiapova can you take a look at the failing CI checks? |
20782b4
to
aa7a3ce
Compare
Split the logic from ComputeSurfaceArea into a helper static function and introduce a new method which computes triangle areas and writes the resulting tensor into attributes of the mesh.
aa7a3ce
to
110aebd
Compare
... and t::geometry::TriangleMesh::GetNonManifoldEdges methods. The methods are defined in geometry::TriangleMesh API. t::geometry::TriangleMesh::GetNonManifoldEdges mimics the logic of the legacy method. t::geometry::TriangleMesh::RemoveNonManifoldEdges follows the logic of the legacy method but there are a few differences: * the main difference is that the outer while-loop is removed. I don't see how after the first iteration any edge can have more than 2 adjacent triangles, which makes the further iterations unnecessary. * I count triangles with non-negative areas immediately and do not rely on the total number of adjacent triangles (which would also include triangles marked for removal). * To choose a triangle with the minimal area out of the existing adjacent triangles I use a heap structure.
110aebd
to
e25faf0
Compare
Update unit tests to unordered comparison, since order of output is platform dependent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nsaiapova ! Looks good!
…pty areas property if there are no triangles.
6f2dd07
to
b008cb7
Compare
…reas property if there are no triangles.
74230d4
to
cf99e70
Compare
Implement a few methods which are available with the geometry::TriangleMesh API.
Type
Motivation and Context
Checklist:
python util/check_style.py --apply
to apply Open3D code styleto my code.
updated accordingly.
results (e.g. screenshots or numbers) here.
Description
In this PR three methods for t::geometry::TriangleMesh are implemented.
t::geometry::TriangleMesh::ComputeTriangleAreas
Split the logic from ComputeSurfaceArea into a helper static function
and introduce a new method which computes triangle areas and writes the
resulting tensor into attributes of the mesh.
IIUC, in geometry::TriangleMesh the corresponding function is GetSurfaceArea(std::vector &areas), where the areas are filled with the triangle areas.
t::geometry::TriangleMesh::GetNonManifoldEdges mimics the logic of the legacy method.
t::geometry::TriangleMesh::RemoveNonManifoldEdges follows the logic of
the legacy method but there are a few differences:
see how after the first iteration any edge can have more than 2
adjucent triangles, which makes the further iterations unnecessary.
on the total number of adjacent triangles (which would also include
triangles marked for removal).
adjacent triangles I use a heap structure.