parry icon indicating copy to clipboard operation
parry copied to clipboard

intersection_test returns Ok(false) for two overlapping cylinders

Open JulienLavocat opened this issue 1 month ago • 0 comments

Hello, I'm using parry 0.25.3 and and the following snippet returns Ok(false) for two overlapping cylinders:

use parry3d::na::Isometry3;
use parry3d::query::intersection_test;
use parry3d::shape::Cylinder;

fn main() {
    let iso = Isometry3::identity();
    let big = Cylinder::new(50.0, 100.0);
    let small = Cylinder::new(1.5, 1.0);

    let res = intersection_test(&iso, &big, &iso, &small);
    log::info!("direct cylinder test: {res:?}"); // Ok(false)
}

Replacing Cylinder/Cylinder by Ball/Ball or Capsule/Cylinder works so I believe this is a bug in the intersection test between two cylinders but I don't really know how to dig deeper.

Edit: This does not work either:

fn direct_test() {
    use parry3d::na::Isometry3;
    use parry3d::query::intersection_test;
    use parry3d::shape::Cylinder;

    let iso = Isometry3::identity();
    let big = Cylinder::new(50.0, 100.0);
    let small = Capsule::new(
        Point3::new(-0.0, -50.0, -0.0),
        Point3::new(-0.0, 50.0, -0.0),
        10.0,
    );

    let res = intersection_test(&iso, &big, &iso, &small);
    log::info!("direct cylinder test: {res:?}"); // Ok(false)
}

JulienLavocat avatar Nov 16 '25 11:11 JulienLavocat