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

Pyembree ray.intersects_location(): Border intersections are not detected #1766

Open
Ludwig-Graef opened this issue Nov 28, 2022 · 1 comment

Comments

@Ludwig-Graef
Copy link

Hi,
I encountered the issue that a ray can pass through two adjacent triangles without being detected by ray.intersects_location(). Using here ray.ray_pyembree.RayMeshIntersector().
Find example below:

def test_between_triangles(self):\n
    mesh = trimesh.Trimesh(vertices=[[-1, -1, 0], [-1, 1, 0], [1, 1, 0], [1, -1, 0]], faces=[(0, 1, 2), (2, 3, 0)])
    ray_origin, ray_direction = np.array([[0, 0, 1]]), np.array([[ 0,  0, -1]])
    pts_xyz, _, _ = mesh.ray.intersects_location(ray_origin, ray_direction, multiple_hits=False)
    assert len(pts_xyz) == 1, 'No intersection found on the edge between the two triangles'

I figured out, that if you do not scale the scene/ray, this error does not occur.

   ray_mesh_intersector = trimesh.ray.ray_pyembree.RayMeshIntersector(mesh, scale_to_box=False)
   pt_xyz, _, _ = ray_mesh_intersector.intersects_location(ray_origin, ray_direction)

Is this issue already solved/adressed?

Thanks for helping out.

Tried versions:

  • Multiple Ubuntu versions: 20.04, 22.04
  • Python 3.8.13
  • Trimesh 3.16.0
  • Pyembree 0.2.11
@mikedh
Copy link
Owner

mikedh commented Nov 29, 2022

Hey, yeah unfortunately I think this is #242 which may be mitigated by finally upgrading to embree3 in the long-neglected #1108

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