简体   繁体   English

三角形网格上的最近点

[英]Closest point on a triangular mesh

I've got a triangular mesh description of a surface. 我有一个表面的三角形网格描述。 I also have a point P that lies outside the surface. 我还有一个位于表面之外的点P. How can I find the point on the surface that is closest to P? 如何在表面上找到最接近P的点?

I know how to find the closest vertex, but the closest point is probably between vertices. 我知道如何找到最近的顶点,但最近的点可能在顶点之间。 I also thought about doing a ray trace, but that won't always work since I don't know the direction. 我还想过做一个光线追踪,但由于我不知道方向,所以这并不总是有效。

Finding the minimum distance to each triangle from the point and find the smallest minimum distance from them is the only way. 从该点找到每个三角形的最小距离并找到距离它们最小的最小距离是唯一的方法。 This brute-force method will be very computationally expensive if you have many points to find the closest distance to the triangular mesh (which in turns could contain many many triangles). 如果您有许多点可以找到距离三角形网格最近的距离(这可能包含许多三角形),那么这种强力方法的计算成本非常高。 If you have multiple points, I suggested creating a octree for your triangle mesh first. 如果你有多个点,我建议先为你的三角形网格创建一个八叉树。 This will speed up the minimum distance computation (for multiple points) a lot. 这将加速最小距离计算(对于多个点)很多。

I couldn't find anything built-in to matlab, but I found a description/video that may help you. 我找不到内置于matlab的任何内容,但我发现了一个可能对你有帮助的描述/视频。 Hopefully someone else can find something more useful if this is not enough. 如果这还不够,希望其他人可以找到更有用的东西。 The website is here . 该网站在这里

It looks like it's going to have to be an interative solution. 看起来它必须是一个交互式解决方案。 If the link itself doesn't help, there were some comments left in that link that could be useful. 如果链接本身没有帮助,那么该链接中留下了一些可能有用的评论。

Hope this helps. 希望这可以帮助。

您可以最小化每个三角形的距离,如本问题中所述

One possibility is to use user contributions from the FileExchange: 一种可能性是使用FileExchange中的用户贡献:

  • the function point2trimesh by Daniel Frisch returns the closest point on the mesh as second output. Daniel Frisch的函数point2trimesh返回网格上最近的点作为第二个输出。 It is possible to use parallelization, making it rather fast 可以使用并行化,使其相当快
  • the function pointTriangleDistance by Gwendolyne Fischer processes only the case of a single face, but it is easy to extend to triangular meshes. Gwendolyne Fischer的函数pointTriangleDistance仅处理单个面的情况,但很容易扩展到三角形网格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM