{"id":26280715,"url":"https://github.com/mattiamontanari/opengjk","last_synced_at":"2025-10-08T13:27:38.196Z","repository":{"id":44369627,"uuid":"146979600","full_name":"MattiaMontanari/openGJK","owner":"MattiaMontanari","description":"Fast and reliable implementation of the Gilbert-Johnson-Keerthi (GJK) algorithm for C, C++, C#, Go, Matlab, Octave, Python and Zig","archived":false,"fork":false,"pushed_at":"2025-02-16T21:21:00.000Z","size":512,"stargazers_count":157,"open_issues_count":1,"forks_count":39,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-05T02:04:12.588Z","etag":null,"topics":["algorithm","c","collision","convex-polytopes","cython","gilbert-johnson-keerthi","gjk","golang","octave","python","python-ctypes","unity3d","zip"],"latest_commit_sha":null,"homepage":"https://www.mattiamontanari.com/opengjk/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MattiaMontanari.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-01T07:56:17.000Z","updated_at":"2025-03-26T06:18:15.000Z","dependencies_parsed_at":"2023-12-28T13:30:07.004Z","dependency_job_id":"2d37e46a-3fd0-4a9d-a978-2f2a3ed4475f","html_url":"https://github.com/MattiaMontanari/openGJK","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattiaMontanari%2FopenGJK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattiaMontanari%2FopenGJK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattiaMontanari%2FopenGJK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattiaMontanari%2FopenGJK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MattiaMontanari","download_url":"https://codeload.github.com/MattiaMontanari/openGJK/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276163,"owners_count":20912288,"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":["algorithm","c","collision","convex-polytopes","cython","gilbert-johnson-keerthi","gjk","golang","octave","python","python-ctypes","unity3d","zip"],"created_at":"2025-03-14T15:17:18.266Z","updated_at":"2025-10-08T13:27:38.188Z","avatar_url":"https://github.com/MattiaMontanari.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--                        _____      _ _  __                                      \u003e\n\u003c                          / ____|    | | |/ /                                      \u003e\n\u003c    ___  _ __   ___ _ __ | |  __     | | ' /                                       \u003e\n\u003c   / _ \\| '_ \\ / _ \\ '_ \\| | |_ |_   | |  \u003c                                        \u003e\n\u003c  | (_) | |_) |  __/ | | | |__| | |__| | . \\                                       \u003e\n\u003c   \\___/| .__/ \\___|_| |_|\\_____|\\____/|_|\\_\\                                      \u003e\n\u003c        | |                                                                        \u003e\n\u003c        |_|                                                                        \u003e\n\u003c                                                                                   \u003e\n\u003c Copyright 2022 Mattia Montanari, University of Oxford                             \u003e\n\u003c                                                                                   \u003e\n\u003c This program is free software: you can redistribute it and/or modify it under     \u003e\n\u003c the terms of the GNU General Public License as published by the Free Software     \u003e\n\u003c Foundation, either version 3 of the License. You should have received a copy      \u003e\n\u003c of the GNU General Public License along with this program. If not, visit          \u003e\n\u003c                                                                                   \u003e\n\u003c     https://www.gnu.org/licenses/                                                 \u003e\n\u003c                                                                                   \u003e\n\u003c This program is distributed in the hope that it will be useful, but WITHOUT       \u003e\n\u003c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS     \u003e\n\u003c FOR A PARTICULAR PURPOSE. See GNU General Public License for details.           --\u003e\n\n[![Run all demos](https://github.com/MattiaMontanari/openGJK/actions/workflows/github-opengjk-examples.yml/badge.svg)](https://github.com/MattiaMontanari/openGJK/actions/workflows/github-opengjk-examples.yml)\n\n# OpenGJK\n\nA fast and robust C implementation of the Gilbert-Johnson-Keerthi (GJK) algorithm with interfaces for C#, Go, Matlab and Python. A Unity Plug-in [is also available in another repository](https://github.com/MattiaMontanari/urban-couscous).\n\nUseful links: [API references](https://www.mattiamontanari.com/opengjk/docsapi/), [documentation](https://www.mattiamontanari.com/opengjk/docs/) and [automated benchmarks](https://www.mattiamontanari.com/opengjk/docs/benchmarks/).\n\n## Getting started\n\nOn Linux, Mac or Windows, install a basic C/C++ toolchain - for example: git, compiler and cmake.\n\n### Prerequisites\n\n**Required:**\n- Git\n- C/C++ compiler (GCC, Clang, or MSVC)\n- CMake (version 3.5 or higher)\n\n**Recommended for faster builds:**\n- Ninja build system (provides ~60% faster compilation)\n\n```bash\n# Install Ninja (if not already installed)\n# Ubuntu/Debian: sudo apt install ninja-build\n# macOS: brew install ninja\n# Windows: choco install ninja\n```\n\nNext, clone this repo:\n\n``` bash\ngit clone https://github.com/MattiaMontanari/openGJK\n```\n\nThen use these commands to build and run an example:\n\n``` bash\ncmake -E make_directory build\ncmake -E chdir build cmake -DCMAKE_BUILD_TYPE=Release -G Ninja .. \ncmake --build build \ncmake -E chdir build/examples/c ./example_lib_opengjk_ce\n```\n\nThe successful output should be:\n\n\u003e\n\u003e `Distance between bodies 3.653650`\n\u003e \n\nHowever, if you do get an error - any error - please file a bug. Support requests are welcome.\n\n## Build Options\n\nOpenGJK supports several CMake options to customize the build:\n\n- `BUILD_EXAMPLE` (default: ON) - Build the C demo example\n- `BUILD_MONO` (default: OFF) - Build C# example (requires Mono)\n- `BUILD_CTYPES` (default: OFF) - Expose symbols for Python ctypes\n- `FORCE_CXX_COMPILER` (default: OFF) - Force C++ compiler for C files (useful for cross-compilation)\n- `SINGLE_PRECISION` (default: OFF) - Use 32-bit floating point instead of 64-bit\n\nExample with custom options:\n```bash\ncmake -E chdir build cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MONO=ON -DFORCE_CXX_COMPILER=ON -G Ninja ..\n```\n\n## Use OpenGJK in your project\n\nThe best source to learn how to use OpenGJK are the examples. They are listed [here](https://www.mattiamontanari.com/opengjk/docs/examples/) for C, C#, Go, Matlab, ZIg and Python. I aim to publish few more for Julia.\n\nTake a look at the `examples` folder in this repo and have fun. File a request if you wish to see more!\n\n## Contribute\n\nYou are very welcome to:\n\n- Create pull requests of any kind\n- Let me know if you are using this library and find it useful\n- Open issues with request for support because they will help you and many others\n- Cite this repository ([a sweet GitHub feature](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files#about-citation-files)) or my paper: Montanari, M. et at, *Improving the GJK Algorithm for Faster and More Reliable Distance Queries Between Convex Objects* (2017). ACM Trans. Graph.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattiamontanari%2Fopengjk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattiamontanari%2Fopengjk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattiamontanari%2Fopengjk/lists"}