svenstaro / bvh

A fast BVH using SAH in rust
https://docs.rs/bvh
MIT License
225 stars 37 forks source link

Fix readme example #83

Closed Elabajaba closed 2 years ago

Elabajaba commented 2 years ago

The readme example didn't work. This adds a BHShape impl to the sphere so that it'll work. It also removes the BoundingHierarchy import from the lib.rs docs.

Elabajaba commented 2 years ago

I setup doc-comment, but it's a bit ugly. Since it's essentially just doing an include_str!(README.md) in lib.rs, the line numbers for errors don't line up with where the lines are in README.md (and if you put it in /tests/readme.rs like some crates have, then it never actually gets run).

It also complains about all the benchmark results in the readme unless you remove the rust tag on their code blocks and add a different language (not choosing a language doesn't work either), so if you have a preferred colour scheme for the benchmarks let me know.

codecov-commenter commented 2 years ago

Codecov Report

Merging #83 (afdc9e9) into master (ad4ff29) will decrease coverage by 0.79%. The diff coverage is n/a.

@@            Coverage Diff             @@
##           master      #83      +/-   ##
==========================================
- Coverage   82.67%   81.87%   -0.80%     
==========================================
  Files           9        9              
  Lines        1489     1473      -16     
==========================================
- Hits         1231     1206      -25     
- Misses        258      267       +9     
Impacted Files Coverage Δ
src/axis.rs 44.73% <ø> (ø)
src/testbase.rs 75.89% <0.00%> (-2.97%) :arrow_down:
src/bvh/bvh_impl.rs 71.96% <0.00%> (-1.25%) :arrow_down:
src/bvh/iter.rs 85.22% <0.00%> (-0.95%) :arrow_down:
src/aabb.rs 92.99% <0.00%> (-0.30%) :arrow_down:
src/ray.rs 94.70% <0.00%> (+0.66%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ad4ff29...afdc9e9. Read the comment docs.

svenstaro commented 2 years ago

Thanks, this is good stuff!