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

Wrong Results on this testcase #17

Open
karelispanagiotis opened this issue Oct 4, 2022 · 0 comments
Open

Wrong Results on this testcase #17

karelispanagiotis opened this issue Oct 4, 2022 · 0 comments

Comments

@karelispanagiotis
Copy link

I have been using this package for distance calculation between 3D Triangles. I cannot understand why the case fails (I can provide more if anybody requests). Example code, where I get a collision, when clearly there isn't any. If I rearrange the arguments of minimum_distance(), I get the correct answer.

using Meshes
using StaticArrays
using ConvexBodyProximityQueries

t1 = Triangle(Point(-0.37579435f0, 0.014414025f0, 0.3265663f0),
              Point(-0.37263185f0, 0.0108978925f0, 0.36118037f0),
              Point(-0.35647663f0, 0.03625821f0, 0.34328437f0));

t2 = Triangle(Point(0.23884095f0, -1.6477574f0, 0.116889484f0),
              Point(0.26891768f0, -1.6353351f0, 0.10821109f0),
              Point(0.26338503f0, -1.6657706f0, 0.10510237f0));
p = StaticArrays.sacollect(SMatrix{3, 3}, x for v in t1.vertices for x in v.coords);
q = StaticArrays.sacollect(SMatrix{3, 3}, x for v in t2.vertices for x in v.coords);

dir = centroid(t2) - centroid(t1);
dist1 = minimum_distance(p, q, dir)
dist2 = minimum_distance(q, p, dir)

And the output is:

julia> dist1
0.0f0

julia> dist2
1.7844534f0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant