{"id":21902528,"url":"https://github.com/dendenxu/bvh-ray-tracing","last_synced_at":"2025-07-28T22:34:07.967Z","repository":{"id":102975580,"uuid":"590299156","full_name":"dendenxu/bvh-ray-tracing","owner":"dendenxu","description":"CUDA Ray Tracing using BVH. Forked and modified from https://github.com/YuliangXiu/bvh-distance-queries","archived":false,"fork":false,"pushed_at":"2024-01-05T10:28:16.000Z","size":1536,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T00:11:15.734Z","etag":null,"topics":["bvh","cuda","pytorch","ray-tracing","ray-triangle-intersection"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dendenxu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-01-18T04:41:56.000Z","updated_at":"2025-01-27T12:58:55.000Z","dependencies_parsed_at":"2024-01-05T11:45:16.719Z","dependency_job_id":"563ba30a-994c-424b-8eed-9de92e6f950e","html_url":"https://github.com/dendenxu/bvh-ray-tracing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dendenxu/bvh-ray-tracing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dendenxu%2Fbvh-ray-tracing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dendenxu%2Fbvh-ray-tracing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dendenxu%2Fbvh-ray-tracing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dendenxu%2Fbvh-ray-tracing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dendenxu","download_url":"https://codeload.github.com/dendenxu/bvh-ray-tracing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dendenxu%2Fbvh-ray-tracing/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260834912,"owners_count":23070180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bvh","cuda","pytorch","ray-tracing","ray-triangle-intersection"],"created_at":"2024-11-28T15:19:31.038Z","updated_at":"2025-06-19T21:32:05.851Z","avatar_url":"https://github.com/dendenxu.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CUDA Ray Tracing using BVH\n\n![teasear](assets/000042.png)\n\n**[WIP] Supporting Ray-Triangle Intersection -\u003e Ray Tracing on CUDA.**\n\nThis is a fork from: https://github.com/YuliangXiu/bvh-distance-queries\n\nThis package provides a PyTorch module that performs ray to surface queries on the GPU\n\n**Please ignore the readme below for now.**\n\n## Table of Contents\n\n- [CUDA Ray Tracing using BVH](#cuda-ray-tracing-using-bvh)\n  - [Table of Contents](#table-of-contents)\n  - [License](#license)\n  - [Description](#description)\n  - [Installation](#installation)\n  - [Examples](#examples)\n  - [Dependencies](#dependencies)\n  - [Example dependencies](#example-dependencies)\n  - [Running on Cluster](#running-on-cluster)\n  - [Citation](#citation)\n  - [Contact](#contact)\n\n## License\n\nSoftware Copyright License for **non-commercial scientific research purposes**.\nBy downloading and/or using the Model \u0026 Software (including downloading, cloning,\ninstalling, and any other use of this github repository), you acknowledge that\nyou have read these terms and conditions, understand them, and agree to be bound\nby them. If you do not agree with these terms and conditions, you must not\ndownload and/or use the Model \u0026 Software. Any infringement of the terms of this\nagreement will automatically terminate your rights under this\n[License](./LICENSE).\n\n## Description\n\nThis repository provides a PyTorch wrapper around a CUDA kernel that implements\nthe method described in [Maximizing parallelism in the construction of BVHs,\noctrees, and k-d trees](https://dl.acm.org/citation.cfm?id=2383801). More\nspecifically, given a batch of meshes it builds a\nBVH tree for each one, which can then be used for distance quries.\n\n## Installation\n\nBefore installing anything please make sure to set the environment variable\n_$CUDA_SAMPLES_INC_ to the path that contains the header `helper_math.h` , which\ncan be found in the [CUDA Samples repository](https://github.com/NVIDIA/cuda-samples).\nTo install the module run the following commands:\n\n**1. Install the dependencies**\n\n```Shell\npip install -r requirements.txt\n```\n\n**2. Run the _setup.py_ script**\n\n```Shell\npython setup.py install\n```\n\nIf you want to modify any part of the code then use the following command:\n\n```Shell\npython setup.py build develop\n```\n\n## Examples\n\n-   [Random points to surface](./examples/random_points_to_surface.py): Generate\n    random points and compute their distance to a mesh. Use:\n    ```Shell\n    python examples/random_points_to_surface.py --mesh-fn MESH_FN --num-query-points 100000\n    ```\n-   [Fit a cube to a cube](./examples/fit_cube_to_cube.py): Randomly translate\n    and rotate a cube then fit it to the original, without using the\n    correspondences by using the point to mesh distances.\n\n    ```Shell\n    python examples/fit_cube_to_cube.py\n    ```\n\n-   [Fit a cube to random points](./examples/fit_cube_to_random_points.py):\n    First generate a set of random points and compute their convex hull, which\n    gives us a dummy scan. We then try to rigidly align a cube to this scan using\n    the provided point-to-mesh residuals.\n    ```Shell\n    python examples/fit_cube_to_random_points.py\n    ```\n\n## Dependencies\n\n1. [PyTorch](https://pytorch.org)\n\n## Example dependencies\n\n1. [open3d](http://www.open3d.org/)\n1. [mesh](https://github.com/MPI-IS/mesh)\n\n## Running on Cluster\n\nIf you want to run this on the cluster you need to build it using the GPU availabe on the cluster. If you use the local build there might be GPU architecture compatibility issue and you can encounter following error message\n\n```\nRuntimeError: parallel_for failed: unrecognized error code: unrecognized error code\n```\n\n## Citation\n\nIf you find this code useful in your research please cite the relevant work(s) of the following list:\n\n```\n@inproceedings{Karras:2012:MPC:2383795.2383801,\n    author = {Karras, Tero},\n    title = {Maximizing Parallelism in the Construction of BVHs, Octrees, and K-d Trees},\n    booktitle = {Proceedings of the Fourth ACM SIGGRAPH / Eurographics Conference on High-Performance Graphics},\n    year = {2012},\n    pages = {33--37},\n    numpages = {5},\n    url = {https://doi.org/10.2312/EGGH/HPG12/033-037},\n    doi = {10.2312/EGGH/HPG12/033-037},\n    publisher = {Eurographics Association}\n}\n```\n\n## Contact\n\nThe code of this repository was implemented by [Vassilis Choutas](vassilis.choutas@tuebingen.mpg.de).\nFor commercial licensing, please contact [ps-licensing@tue.mpg.de](ps-licensing@tue.mpg.de).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdendenxu%2Fbvh-ray-tracing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdendenxu%2Fbvh-ray-tracing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdendenxu%2Fbvh-ray-tracing/lists"}