You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am looking for a function that calculates the closest point between a finite line segment and a mesh. I think it can be implemented similarly to warp.mesh_query_point. The only change may be two components: closest_point_to_triangle and distance_to_aabb_sq.
For the first component, I need to calculate the closest point between a line segment and a triangle. I think it can be easily implemented based on some helpful functions such as closest_point_to_triangle, closest_point_edge_edge, and intersect_ray_tri_woop.
For the second component, I need to calculate the distance between a line segment and an AABB. I am suffering from finding an efficient algorithm to do so. One naive solution can be to calculate the distance between the line segment and all edges and surfaces of AABB, but it is too inefficient and quite unacceptable. I believe there must be some better ways but I can't find any.
Is there anything wrong with my overall thought of my function? Is there any advice or code about the second component? Appreciate any help!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am looking for a function that calculates the closest point between a finite line segment and a mesh. I think it can be implemented similarly to
warp.mesh_query_point
. The only change may be two components:closest_point_to_triangle
anddistance_to_aabb_sq
.For the first component, I need to calculate the closest point between a line segment and a triangle. I think it can be easily implemented based on some helpful functions such as
closest_point_to_triangle
,closest_point_edge_edge
, andintersect_ray_tri_woop
.For the second component, I need to calculate the distance between a line segment and an AABB. I am suffering from finding an efficient algorithm to do so. One naive solution can be to calculate the distance between the line segment and all edges and surfaces of AABB, but it is too inefficient and quite unacceptable. I believe there must be some better ways but I can't find any.
Is there anything wrong with my overall thought of my function? Is there any advice or code about the second component? Appreciate any help!
Beta Was this translation helpful? Give feedback.
All reactions