Skip to content

Introduce threading for collision detection#4123

Open
jorgensd wants to merge 7 commits intomainfrom
dokken/gjk-threading
Open

Introduce threading for collision detection#4123
jorgensd wants to merge 7 commits intomainfrom
dokken/gjk-threading

Conversation

@jorgensd
Copy link
Member

@jorgensd jorgensd commented Mar 12, 2026

Following the way of implementation #4083, introduce threading for GJK, in the case where you have
N bodies $b_0, b_1, \dots, b_N$, which you would like to compute the distance to another body q for all bodies b_i.

This PR makes it possible to control the threading for this new interface, compute_distances_gjk.

GJK improvements:
Introduce monotonicity criteria for distance norm v. If v starts increasing we have hit machine tolerance and therefore exit.

Test improvements:
Removes alot of looping from the bounding box tests, in favor of a numpy/vectorized construction.
Tests num_threads=1 and num_threads=2 for the new algorithm.

Bugs fixes:
The tolerances used inside GJK was wrong not , causing the bounding box tests to fail if you refined the grid even slightly (the tolerance should use as we have cast all data into that format).

jorgensd and others added 2 commits March 12, 2026 15:58
Co-authored-by: Jørgen Schartum Dokken <dokken92@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants