-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Returning Additional Information #12
Comments
This is similar to #2 as the weights are the barycentric coordinates. However, the way to implement this correctly requires more referencing and data cache that I avoided to keep the code faster. Also, the separating vector is in general not unique and this may cause problems in to the applications. For these reasons, I decided not to included this feature. However, you can easily add it: The coordinates are stored here, the paper shows how to link these to the witness points. You'll see that the distance sub-algorithm returns the subset of points whose barycentric coordinates |
Excellent, thank you! I will look into that. |
To the ones previously asking for witness points. |
With commit 'f2871569f529413e55251dc794398ebf58bcd5e5' you can access the lambdas (barycentric coordinates for each vertex) and the points from P & Q that form the simplex. Somehow these are not available in more recent commits.
I haven't tested it too much but works fine for the tutorial sample. And my issue: somehow the code doesn't return the correct witness point when one of the input object is a single point (distance is correct). Any ideas? |
@nyers33 I cannot remember why took that away, but your code seems to be doing the right thing - thanks for sharing! If you've got only one point and GJK exits quickly enough perhaps you end up processing garbage or default values. Can you printout what's in |
@MattiaMontanari All the values from the simplex seem to be valid.
input for dataP:
dataQ:
witness point on P calculated from simplex values: |
I am wondering if you would be able to optionally return additional information from the GJK algorithm. Some useful data includes:
The weights for the vertices are the most important for my current application. By weights, I mean the point between two vertices that is the closest. For example, given a line segment AB and a triangle CDE, let the point C be closest to the halfway point between points A and B. The weights of the vertices returned would then look something like [(0.5, 0.5), (1, 0, 0)]. Similarly, this could happen in 3D, let the triangle ABC be equilateral, with its center on the origin, and whose points all lie on the plane z=0. Let a point D be at (0, 0, 10). It is clear that the minimum distance between the point and the triangle would then be 10. The weights of the vertices returned would then look like [(0.33, 0.33, 0.33), (1)]. Hopefully that makes sense?
I have yet to read through your publication but it is my understanding that the original GJK algorithm utilizes these weights to some degree. If it is easy enough for you to return that information, that would be fantastic. If it is not, could you point me in the right direction to modify your existing code and eventually create a pull request?
Thanks!
The text was updated successfully, but these errors were encountered: