Find the shortest distance between two object?
2 次查看(过去 30 天)
显示 更早的评论
My question:
(a) I have two object A and B. (They have some general curvy shape. They are objects in three dimension. They are composed of nodes with fixed coordinates). How can I found the distance on the vertical direction, or say the difference on the z-direction between the two object. I define the distance between two objects to be the shortest vertical distance between two noedes in the two objects. (Assumed that the two object don't intersect).
(b) Imagine now the object A can only move along the vertical direction, but the lateral position is fixed(x, y coordinate are fixed). This time I don't know if the two object intersect or not. I want to change the z position of object A so that the distance (as defined in (a)) between object A and B equals a setted number. Or at least slightly above it. Or you can think that I want A to be some distance above B and find the corresponding z.
Note: The object A can be generated from a mesh, While object B can be more generic. Object A and B can both just be two collections of nodes.
I would like to know if there's a good algorithm that can solve the two problems efficiently. Essentially it is just solving b. A is a definition. This problem have really bother me for a long time.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Elementary Polygons 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!