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

what's the difference between pcu.RayMeshIntersector and pcu.ray_mesh_intersection? I seemed to get different results using them both. #101

Open
zhangzc19 opened this issue Nov 6, 2024 · 1 comment

Comments

@zhangzc19
Copy link

I ran the code below, but i got two different fid results.
One result is -1 and the other is 663153. Is it possible that passing only one ray leads to this problem?

ply_area = trimesh.load(ply_path)
ray_origin = start_point
vector = end_point - start_point
ray_direction = vector / np.linalg.norm(vector)
v = treatment_area.vertices
f = treatment_area.faces
fid, bc, t = pcu.ray_mesh_intersection(v,f,ray_origin.reshape(1,3),ray_direction.reshape(1,3))
print(fid)
intersector = pcu.RayMeshIntersector(v, f)
fid, bc, t = intersector.intersect_rays(ray_origin.reshape(1,3),ray_direction.reshape(1,3))
print(fid)
@zhangzc19
Copy link
Author

I visualize intersection result and find the latter fid is right.

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