A small bounding volume hierarchy implementation
Project description
LBVH
An implementation of the LBVH algorithm for performing fast bounding-box intersections. NVIDIA has a great series of blog posts that describes, in detail, the algorithm for LBVH construction/traversal:
- https://developer.nvidia.com/blog/thinking-parallel-part-i-collision-detection-gpu/
- https://developer.nvidia.com/blog/thinking-parallel-part-ii-tree-traversal-gpu/
- https://developer.nvidia.com/blog/thinking-parallel-part-iii-tree-construction-gpu/
This repo's implementation is CPU-only for now, but it does include python and Mathematica bindings.
Python
Precompiled binaries are available for many versions of python on mac, linux and windows.
To install python bindings for use with jax
or numpy
, do
pip3 install lbvh
The python bindings expect arrays of bounding boxes to be specified in one of the following formats:
# list of 2D bounding boxes, as arrays with shape (*, 4)
[[min_x, min_y, max_x, max_y], ... ]
# list of 2D bounding boxes, as arrays with shape (*, 2, 2)
[[[min_x, min_y], [max_x, max_y]], ... ]
# list of 3D bounding boxes, as arrays with shape (*, 6)
[[min_x, min_y, min_z, max_x, max_y, max_z], ... ]
# list of 3D bounding boxes, as arrays with shape (*, 2, 3)
[[[min_x, min_y, min_z], [max_x, max_y, max_z]], ... ]
See https://github.com/samuelpmish/LBVH/tree/main/python for some basic examples of bounding box queries.
C++
To build from source:
1. clone the repo
git clone git@github.com:samuelpmish/LBVH.git
2. configure CMake
cd LBVH
cmake . -Bbuild -DCMAKE_BUILD_TYPE=Release
This project has a few (off by default) configure arguments that control which targets get built, including
LBVH_ENABLE_PYTHON_BINDINGS
LBVH_ENABLE_MATHEMATICA_BINDINGS
LBVH_ENABLE_TESTS
3. build
cmake --build build
To use LBVH in another CMake project, you can use FetchContent
to automatically build it along with the parent CMake project
...
# fetch and build LBVH
include(FetchContent)
FetchContent_Declare(
LBVH
GIT_REPOSITORY https://github.com/samuelpmish/LBVH.git
GIT_TAG main
)
set(LBVH_ENABLE_PYTHON_BINDINGS OFF CACHE INTERNAL "")
set(LBVH_ENABLE_MATHEMATICA_BINDINGS OFF CACHE INTERNAL "")
set(LBVH_ENABLE_TESTING OFF CACHE INTERNAL "")
FetchContent_MakeAvailable(LBVH)
...
# link it against any targets in the parent project
target_link_libraries(my_project PUBLIC LBVH)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for lbvh-0.0.13-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5385f28b2015e5e067e347044a8c77cf22e82e875d0b281c193cd78a3ed6ed7a |
|
MD5 | a701eab76edb56c27881a8e9caa43ca1 |
|
BLAKE2b-256 | 011bec94b68910ec9520503f0e432189c4e43200009777ec1763db08ab56980a |
Hashes for lbvh-0.0.13-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65eba15234f091e0e9852614ac903ec67daaae145b61045b07d7fc2845f488ac |
|
MD5 | 58be3f258ee8c3531f7966766d9a07ef |
|
BLAKE2b-256 | 06d6e6ded2ecd20a806fc8a7e5d0ec76219798461b02fc6075bfb08a812995f2 |
Hashes for lbvh-0.0.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09381192e946c12e87bf5316c0234d144f318a8506729686af387b380eb506b5 |
|
MD5 | d3ab56d2b199eda5eb18600b5371a74e |
|
BLAKE2b-256 | c9f98aa4a0dfcc6ced6c1e79eb5a0a8f7bc35f31351df74b05b1db9341fc9927 |
Hashes for lbvh-0.0.13-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f0aaa099a530e1d0ff7aa7ed3c7fab0e4c1e87250bc4d36e2e899bd5590bd48 |
|
MD5 | 7060cf097b0a4c410768eade2c647689 |
|
BLAKE2b-256 | 0711e1ece2535cd503e9833d78c404ec670d2b10f9c3950364f976d911e7d5f6 |
Hashes for lbvh-0.0.13-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c27b5652259a8dea44fd7301a9fc3124792aa8f216a477c5b87175f226d63c83 |
|
MD5 | d0e90f202d853ddb44cda8d12b05c29d |
|
BLAKE2b-256 | dec06d8edef5d1b8d0f4abbab5c9478dede586fde2c1a81f49e28dd72eb0043a |
Hashes for lbvh-0.0.13-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e99853b19625f2b5f4f74f236c53b888cc6b49397027cf87e7e60e7b815b9615 |
|
MD5 | 3f7667ff623845dda1601cc158c5878a |
|
BLAKE2b-256 | 3733ed2fe91bc84af8322e2dce92ef972d4e28834c3e1a46913bf51f9e7d86ee |
Hashes for lbvh-0.0.13-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c5626b47b7f36b53e6cc9d0fe223891bb5beb75abd7f2971c9284931dca8ad8 |
|
MD5 | 221c6f9fec3f796b6e9a2e30768b8de2 |
|
BLAKE2b-256 | 26b755d5384e8348b0e0339de258b1fa6c02eb7dc0457f30b302b0f8e71f3062 |
Hashes for lbvh-0.0.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e82cb09caab67f8235efa4605c3943b2a5bedbe9f85f1f586d19716b2f0477f |
|
MD5 | 15fca0d2c34fe7dee9daad00b99702d2 |
|
BLAKE2b-256 | 32e501059127ba83bfe35117f81cbc04a9e63d8fd3d6e4edc6c9985a8a865528 |
Hashes for lbvh-0.0.13-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 900fde4b22edc76133da2496ef0275297e2f558584998ce62d2e64e04295f74f |
|
MD5 | 0babc657016a1e3e00415459b2d00a49 |
|
BLAKE2b-256 | d2abbea5550def63479599941c97004fb24e1676dbdce3135f03e3784d566f2a |
Hashes for lbvh-0.0.13-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dba625ef0df74de462a67e44415f2f0ba54d3f838e0ad607e8b62ffc71ff6ee |
|
MD5 | 76eeb883592663124774349dafa70727 |
|
BLAKE2b-256 | 82eb0e5b3ba05b7b9cf31a1b5d4b3b2a39f456203289a544305e26534de6cf8a |
Hashes for lbvh-0.0.13-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbebaeb7867255146dcb6881408ff8c13850acae2718aadc0e0ab2296e18ec73 |
|
MD5 | 88df538755b150162b87d72516bd2606 |
|
BLAKE2b-256 | 5cf983e7c2db21ec17a2d014cbafd7a7e8a2d5c7a8e95f62a09201445333cb23 |
Hashes for lbvh-0.0.13-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d2da393a7647025950acf6bd1b160faa6133219912e07aa7bfbc1e53fe42f4d |
|
MD5 | 271cb207c02811e33a889bff838c415d |
|
BLAKE2b-256 | 5a1c44c41e29d8bb2986346c1ae8a170d2ea8ea71c9391a69c4d9bda1e081726 |
Hashes for lbvh-0.0.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5d47dd2003cbecf6ba9bed2b775edf07cf7c2b2c223a8009bb04d639d578412 |
|
MD5 | a511547b09f7bb8ad212d12c4d6522eb |
|
BLAKE2b-256 | af7245f942edd224cd2fde297621fe226cc66ed3c9567e76d782023f945aab04 |
Hashes for lbvh-0.0.13-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 573fa0708d8ca91de8c9ce7d379d89145da45715dd60682add188a9670a3533e |
|
MD5 | e47c0fb004a2f5884878e647e99efaf2 |
|
BLAKE2b-256 | ab78b278c9db4b3445c7792da6c23aba34b5957ae9823fc559e0e2670c134900 |
Hashes for lbvh-0.0.13-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | caa9266c76d8e1ccfe31f3c14721dd87780717cd57116ba4fec239fdebe6a32e |
|
MD5 | e4c2804575b6dba0c0a39383eb1ad435 |
|
BLAKE2b-256 | 8a95a50f75e1aedb275244123c4b141755ed6c4a5964be9b2ef21ce1079b2740 |
Hashes for lbvh-0.0.13-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93c4f67ff1fe7095a3c0a7ba2d03c16dddbb3cea93a08a8c69d2274bdfdbe2ea |
|
MD5 | ed8219f40c3592aef7c9b806a7747ea1 |
|
BLAKE2b-256 | c632ff426e783e7082366da1f48343b02000daf28a531ce8fc52bcea0a1f2707 |
Hashes for lbvh-0.0.13-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bc9a8351b491de6c38aa8c9be004508426a17363627445450d33b3b8f5b48c7 |
|
MD5 | bd39eb84e47c378aab6ed7b29a55416c |
|
BLAKE2b-256 | f2c4e8ff22aa2075be4d8f7085f6fa68eb0f43588219aa688d17a3f4129173d8 |
Hashes for lbvh-0.0.13-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5915fccefd5710b11957a0d525c12c87beeab0a7b6b14ac95c4d058077cec332 |
|
MD5 | 09d43a8518e5327ece7da72d1c970a5e |
|
BLAKE2b-256 | 8f998e10c157f6ecdcea134dee94e1eb8a00f8dcea6b2bc280930f74c0d48b2d |
Hashes for lbvh-0.0.13-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91a1a5fcc39f59e8315fa90b9f4b93c55c5b5a38f88738a7eec43defe249c80e |
|
MD5 | cca20bff932f9623cc86bee03206e5a3 |
|
BLAKE2b-256 | c7fca8a74946f766ac10f92e6e9253ad11758111f30e8a747bec3e4569467cb5 |
Hashes for lbvh-0.0.13-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b74c2ada8bb71e906ca943540b9ca3547406bf056fd735e8e60bc19e95c7f1bd |
|
MD5 | 55c02485f570834f54e57b6286d4d833 |
|
BLAKE2b-256 | 0d50fe8444d74b37ff5ed3199428809987bcd05e7d6978c19a71dea459176a53 |