我正在寻找一种简单的方法来使用 matlab 计算点到 nurbs 表面的最小距离。我正在寻找最近的点 => 不是正交投影。我已经阅读了采样的概念以开始,然后进行牛顿迭代,但当时这超出了我的 matlab 能力。感谢帮助。
1 回答
I am looking for the closest point => not an orthogonal projection.
The closest point on the surface is an orthogonal projection of your point in space onto the surface. Orthogonal in the sense that the line connecting point and projection is perpendicular to the tangent plane of the surface at the projected point.
A NURBS surface is parametrized by two parameters u and v. You can also compute how the position changes as u resp. v changes. To do this you compute the partial differentials. You should get a pair of tangent vectors which span the tangent plane. Now you want the difference between point on the plane and point in space to be orthogonal to both these vectors, i.e. have dot product zero. Which means you'll obtain two equations, one for the u direction and one for the v direction, which will help you find the u and v parameters you need.
Note however that this system of equations is likely highly non-linear. So get some good computer algebra or numerics software to find all the solutions, then compute the distance for each of them to pick the minimal one.