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

Triangle::contains_point gives false-positives #75

Closed
wlinna opened this issue Apr 18, 2022 · 2 comments
Closed

Triangle::contains_point gives false-positives #75

wlinna opened this issue Apr 18, 2022 · 2 comments

Comments

@wlinna
Copy link
Contributor

wlinna commented Apr 18, 2022

Triangle::contains_point gives false-positives. I have a point and a triangle pair for which rapier3d::parry::query::PointQuery::distance_to_local_point returns 0.15627049. When I check the point and the triangle visually, the point is clearly NOT at/in the triangle. However, Triangle::contains_point returns true for the pair. Here's the code to reproduce.

        let p = na::Point3::new(22.01,3.7,-0.291);
        let tri = rapier3d::prelude::Triangle::new(
            na::Point3::new(21.94, 3.7, 0.0), 
            na::Point3::new(22.255, 3.7, -0.315),
            na::Point3::new(22.255, 3.5, -0.315)
        );
        let dist = rapier3d::parry::query::PointQuery::distance_to_local_point(&tri, &p, true);
        dbg!(dist); // 0.15627049
        assert!(!tri.contains_point(&p)); // FAILS

I'm using rapier3d 0.11.1, which still installs the old parry3d 0.7.1.

@wlinna
Copy link
Contributor Author

wlinna commented May 3, 2022

Just tested this on parry3d 0.9, and the bug remains. The numbers haven't changed

ugodiggi pushed a commit to ugodiggi/parry that referenced this issue May 14, 2022
ugodiggi pushed a commit to ugodiggi/parry that referenced this issue May 14, 2022
ugodiggi pushed a commit to ugodiggi/parry that referenced this issue May 14, 2022
sebcrozet pushed a commit that referenced this issue Dec 7, 2022
sebcrozet pushed a commit to ugodiggi/parry that referenced this issue Dec 7, 2022
@wlinna
Copy link
Contributor Author

wlinna commented May 1, 2024

I tested this with parry 0.14, and the bug is gone
Fixed by #78

@wlinna wlinna closed this as completed May 1, 2024
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