{"id":26689491,"url":"https://github.com/risteon/voxel-traversal","last_synced_at":"2025-04-12T20:24:20.691Z","repository":{"id":43054184,"uuid":"463690590","full_name":"risteon/voxel-traversal","owner":"risteon","description":"Simple and fast voxel traversal with C++17 and Eigen","archived":false,"fork":false,"pushed_at":"2022-10-05T13:03:39.000Z","size":562,"stargazers_count":16,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T14:44:17.520Z","etag":null,"topics":["cpp","eigen-library","python-bindings","voxel","voxelization"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/risteon.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}},"created_at":"2022-02-25T22:18:51.000Z","updated_at":"2024-02-20T20:26:11.000Z","dependencies_parsed_at":"2022-09-19T10:30:34.728Z","dependency_job_id":null,"html_url":"https://github.com/risteon/voxel-traversal","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/risteon%2Fvoxel-traversal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/risteon%2Fvoxel-traversal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/risteon%2Fvoxel-traversal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/risteon%2Fvoxel-traversal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/risteon","download_url":"https://codeload.github.com/risteon/voxel-traversal/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248626905,"owners_count":21135758,"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":["cpp","eigen-library","python-bindings","voxel","voxelization"],"created_at":"2025-03-26T14:36:43.370Z","updated_at":"2025-04-12T20:24:20.669Z","avatar_url":"https://github.com/risteon.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Voxel Traversal\n\n[![Build Status](https://github.com/risteon/voxel-traversal/actions/workflows/test.yml/badge.svg)](https://github.com/risteon/voxel-traversal/actions/workflows/test.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n![voxel traversal cover image](voxel_traversal.png?raw=true)\n\nA small library to compute voxel traversal on the CPU.\nThe implemented algorithm is J. Amanatides, A. Woo: \n[\"A Fast Voxel Traversal Algorithm\"](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.42.3443\u0026rep=rep1\u0026type=pdf).\nIt is based on the code prototype of Chris Gyurgyik\n[Fast-Voxel-Traversal-Algorithm](https://github.com/cgyurgyik/fast-voxel-traversal-algorithm).\n\nThe contributions of this repository are:\n* **Tests!**\n* Python bindings (in progress...)\n* Installation and cmake packaging\n* Use Eigen for readability, vectorization, and grid counting.\n* Execution and timing on real LiDAR data from the [nuScenes dataset](https://www.nuscenes.org/). The demonstration data files are bundled with git lfs.\n\n## Requirements and Dependencies\n* Eigen3\n* C++17 compiler\n\n## Python bindings\n\n```bash\n# setup python environment, make cmake \u003e= 3.21 available, e.g. with conda install cmake=3.22\n$ python setup.py install\n# or\n$ python setup.py develop\n$ pytest tests\n```\n\n## Run the Tests and Install\n```bash\n$ git clone https://github.com/risteon/voxel-traversal.git\n$ mkdir build \u0026\u0026 cd build\n# set CMAKE_INSTALL_PREFIX to your liking\n# specify python version with -DPYTHON_EXECUTABLE=\u003cpath/to/python\u003e or -DPYBIND11_PYTHON_VERSION=3.XX\n$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install ..\n# build and install\n$ cmake --build . --target install -- -j 4\n# run tests\n$ ctest\n```\n\n## Find with cmake \u0026 Usage \n\nYour project's CMakeLists.txt:\n```cmake\ncmake_minimum_required(VERSION 3.21)\nproject(your_project)\nset(CMAKE_CXX_STANDARD 17)\n\nfind_package(Eigen3 3.3 REQUIRED NO_MODULE)\nfind_package(VoxelTraversal REQUIRED)\n\nadd_executable(your_executable main.cpp)\ntarget_link_libraries(your_executable VoxelTraversal::VoxelTraversal)\n```\nWhen configuring, set `CMAKE_PREFIX_PATH` to this project's install directory.\n\nCode example:\n```c++\n#include \u003cVoxelTraversal/voxel_traversal.h\u003e\n\nusing namespace voxel_traversal;\n\n// types for vectors and indices\nusing V3 = typename Grid3DSpatialDef\u003cdouble\u003e::Vector3d;\nusing C3 = typename Grid3DSpatialDef\u003cdouble\u003e::Index3d;\nusing R = Ray\u003cdouble\u003e;\n\nconst V3 bound_min(0.0, 0.0, 0.0);\nconst V3 bound_max(2.0, 2.0, 2.0);\nconst C3 voxel_count(2, 2, 2);\nGrid3DSpatialDef\u003cdouble\u003e grid(bound_min, bound_max, voxel_count);\n// use this subclass to count traversed voxels\nGrid3DTraversalCounter\u003cdouble\u003e grid_counter(bound_min, bound_max, voxel_count);\n\n// Ray\nconst auto ray = R::fromOriginDir({.5, .5, .5}, {1., 0., 0.});\n\n// determine which voxels are traversed (in order from origin to end)\nTraversedVoxels\u003cTypeParam\u003e traversed{};\nconst auto does_intersect = traverseVoxelGrid(ray, grid, traversed);\n// count traversed voxels\ntraverseVoxelGrid(ray, grid_counter);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fristeon%2Fvoxel-traversal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fristeon%2Fvoxel-traversal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fristeon%2Fvoxel-traversal/lists"}