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

closest_points panics when a Cylinder & Trimesh are not within max_dist #79

Open
mijalk0 opened this issue May 17, 2022 · 1 comment
Open

Comments

@mijalk0
Copy link

mijalk0 commented May 17, 2022

closest_points panics when a Cylinder and Trimesh are tested and the objects are not within max_dist of each other. I believe the function is actually supposed to return Disjoint instead. Here is a specific example I've found:

use parry3d::{math::*, query, shape::*};

fn main() {
    let cylinder = Cylinder::new(0.5, 1.0);

    let vertices = vec![
        Point::new(1.0, -1.0, 0.0),
        Point::new(-1.0, -1.0, 0.0),
        Point::new(0.0, -1.0, 1.0),
    ];
    let indices = vec![[0, 1, 2]];
    let trimesh = TriMesh::new(vertices, indices);

    // let max_dist = 0.5; // Fine
    let max_dist = 0.49; // Panics

    let _ = query::closest_points(
        &Isometry::identity(),
        cylinder.clone_box().as_ref(),
        &Isometry::identity(),
        trimesh.clone_box().as_ref(),
        max_dist,
    );
}
@hunterZh37
Copy link

hunterZh37 commented May 22, 2022

Same error here. For me, closest_points panics when two shapes are not within 1.0 unit distance of each other. I have gotten a "Composite shapes must not be empty" error. I have double-checked that my inputs are not indeed empty, but still getting the same error.

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

2 participants