Skip to content

Add bvh for generate_sdf method#75

Merged
Azkellas merged 9 commits into
mainfrom
bvh
Sep 6, 2024
Merged

Add bvh for generate_sdf method#75
Azkellas merged 9 commits into
mainfrom
bvh

Conversation

@Azkellas
Copy link
Copy Markdown
Owner

generate_sdf now takes a AccelerationMethod parameter, that can be either AccelerationMethod::Bvh (default) or AccelerationMethod::None.

Bvh is recommended unless you're really tight on memory or your query is very small (couple hundreds of queries and triangles).

For example, a query of 15k points with 100k triangles is 10 times faster with a bvh, and twice faster for 500 queries and 10k triangles.

Bvh is also optimised for the SignMethod::Raycast sign method.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 95.64103% with 17 lines in your changes missing coverage. Please review.

Project coverage is 97.22%. Comparing base (c2169c6) to head (4deaa91).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
mesh_to_sdf/src/bvh_ext.rs 88.28% 13 Missing ⚠️
mesh_to_sdf/src/lib.rs 98.56% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #75      +/-   ##
==========================================
- Coverage   97.25%   97.22%   -0.04%     
==========================================
  Files          10       11       +1     
  Lines        1421     1979     +558     
==========================================
+ Hits         1382     1924     +542     
- Misses         39       55      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Azkellas
Copy link
Copy Markdown
Owner Author

Azkellas commented Jul 9, 2024

BVH point queries are in the process of being upstreamed here: svenstaro/bvh#108

@Azkellas
Copy link
Copy Markdown
Owner Author

Azkellas commented Sep 6, 2024

As the upstream PR has not been active for the last two monthes, with no update from the maintainer, I'm merging this one to get the benefits of the new BVH in this crate.
This version is slightly less optimized than the one I made upstream, but will do in the meantime.

@Azkellas Azkellas merged commit 8455386 into main Sep 6, 2024
@Azkellas Azkellas deleted the bvh branch September 6, 2024 09:17
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.

1 participant