Repository navigation
geometry: fix point location in meshes over 10,000 elements - #853
Merged
Merged
Conversation
…oundary find_tets_containing_point and find_hexs_containing_point, above 10,000 elements, built the mesh's box by adding one bounding_box per vertex. A box around one point has no volume, so it isNull(), and a sum of null boxes stays null: the box test then rejected every point. Only a point the per-call AABB tree saw lying on the boundary surface skipped that test, so a query anywhere else returned nothing. #808 grew the bunny tet mesh in FindTetsContainingPointPerformanceLargeMesh from 7,440 tets to 289,946, which moved it onto this path. The test asserts only that something was found. Windows found 4 tets and Linux passed too, but macOS found 0. Testing every tet finds 25 of the 100 points, in 94 tets. The box is now compared coordinate by coordinate, for any mesh over 1000 elements, and the per-call surface extraction and CGAL AABB tree, which only fed that test, are gone. Both performance tests now check the result against testing every element.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
package-macos / libcvc-release-grpcand-grpc-static(andlibcvc-release, when it ran) have failedAlgorithmTest.FindTetsContainingPointPerformanceLargeMeshon master since 09fa876, e.g. 40529398170 (jobs 122277740257, 122277741912) and 40486443010. The test name says "Performance", but the failing assertion istotal_found > 0: 100 queries found 0 tets. It is a point-location bug.Root cause
Above 10,000 elements,
find_tets_containing_pointandfind_hexs_containing_pointfirst checked whether the point was inside the mesh's box. They built that box by adding up onebounding_boxper vertex. A box around one point has no volume, so itsisNull()is true, andoperator+=of null boxes stays null.contains()on a null box is false, so the function returned nothing.The only exception was a point that the per-call CGAL AABB tree saw lying on the boundary surface (
do_intersect(Point_3)): it skipped the box test. That skip was the tree's only role, and the tree was rebuilt fromextract_surface()on every call.#808 grew the test's bunny tet mesh from 7,440 tets, on the 1000-10000 path with no mesh-box test, to 289,946. That moved the test onto the broken path. The hex test has been on it all along (64,770 hexes): it found nothing, and passed because it only checked that the mesh had hexes.
Fix
within_bounds), then only the elements whose own box holds it are tested.algorithm.cppused.> 0let the tet bug pass on Windows and Linux.docs/GEOMETRY_API.mdand the libigl roadmap row describe the path as it is now. The persistent locator (P2.4) is still planned.Evidence
Local (Windows, MSVC 14.44 Release, cvcpkg prefix), on the tests' own meshes. "Before" is a build of master with #808 (perf-all tree); "after" is this branch on 9cab98f.
geometry_test --gtest_filter=*Find*Containing*: 3/3 pass. The tet mesh is the solid above the isovalue: for this SDF, the space between the bunny and its box, which the query line crosses at both ends (25 points). The hexes are the voxels inside the bunny (74 points).CI: the required checks passed. At merge, this branch's run 40616350355 had passed package-linux / libcvc-debug, -release and -release-grpc and all three package-windows lanes; the other lanes were still running. The PR lanes skip the heavy suites, so they don't run this test. The push run of all four fixes together on
ci/full/package-lanes, 40615210987, covers package-macos's serial heavy pass, where it runs. That run was still queued at merge.