Skip to content
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

Add minGap function #186

Closed
elalish opened this issue Aug 14, 2022 · 3 comments
Closed

Add minGap function #186

elalish opened this issue Aug 14, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@elalish
Copy link
Owner

elalish commented Aug 14, 2022

A convenient function would be to measure the minimum gap between two Manifolds (good for checking that mechanisms have the proper tolerances). The signature would be: float Manifold.MinGap(const Manifold& other, float searchLength) const

It would always return a value between zero and searchLength. It would perform an intersection and if that was non-empty, it returns zero (overlapping). If not, it will collide the triangles of each mesh with the verts of the other, expanded into boxes 2*searchLength wide, then for those collisions, calculate point-to-triangle distances. The minimum is returned.

@elalish elalish added the enhancement New feature or request label Aug 14, 2022
@pca006132
Copy link
Collaborator

@elalish I updated the GSoC description to calculate triangle-to-triangle distance, because it is different from point-to-triangle distance. Consider two triangles where a pair of edges touch each other, but on two orthogonal planes. The point-to-triangle distance from any vertex to the opposite triangle is non-zero, but the triangle-to-triangle distance is zero.

@elalish
Copy link
Owner Author

elalish commented Jan 22, 2024

Good call, thanks!

@elalish
Copy link
Owner Author

elalish commented Apr 2, 2024

Added by #765

@elalish elalish closed this as completed Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants