MattiaMontanari / openGJK

Fast and reliable implementation of the Gilbert-Johnson-Keerthi (GJK) algorithm for C, C#, Go, Matlab and Python
https://www.mattiamontanari.com/opengjk/
GNU General Public License v3.0
135 stars 37 forks source link

Adding Support for Spheres and Cylinders #18

Closed Michael-Equi closed 2 years ago

Michael-Equi commented 3 years ago

I am working on an application that requires being able to check for collisions between polyhedra and spheres/cylinders. I am currently figuring out how to create a bounding polyhedron for these shapes as a temporary way to use this algorithm with them but I am curious as to how hard it would be to add native support for those shapes to this GJK implementation. I have worked with basic implementations of GJK in the past and implementing spheres/cylinders mostly came down to adding support functions for them. It does not look like it would be that easy in this implementation but might it still be worth looking into adding?

Thanks for the library btw, works well and has saved me so much time!

MattiaMontanari commented 3 years ago

Yes you're right, it won't be that easy. Realistically I can't commit to create that, but I can help you or you may want to try other libraries that support spheres and cylinders. If you don't have time tho, you may just create a cloud of points to mimic sphere and cylinders and pass those to this library. Depends on what you need to do and the time you have :)

Michael-Equi commented 3 years ago

Its not super high on my priority list so I may just look into creating a bounding convex polyhedron with a bunch of points. Do you know of a good way of doing that?

MattiaMontanari commented 3 years ago

You can look at Matlab sphere and cylinder commands ;) The function source may be also available

On Sat, Jul 24, 2021 at 8:39 PM Michael Equi @.***> wrote:

Its not super high on my priority list so I may just look into creating a bounding convex polyhedron with a bunch of points. Do you know of a good way of doing that?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MattiaMontanari/openGJK/issues/18#issuecomment-886094679, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJFWWBOKMJDKLTPPZ7J7T3TZMCFDANCNFSM5AHN4GQQ .