[vtkusers] How to find the point on the mesh closest to a specified point
David Doria
daviddoria at gmail.com
Thu Nov 21 08:02:07 EST 2013
On Thu, Nov 21, 2013 at 7:35 AM, Green Hedgehog <yy198903 at 163.com> wrote:
> Hi all,
> There's a point outside or inside a closed surface, and I want to find a
> point on the surface which is closest to the specified point. The solution
> may not be a vertex, but just a point lying on the triangle. Currently I
> have no idea. Has anyone got any suggestions? Thanks in advance.
>
> Regards,
> Yue
I believe the FindClosestPoint function of vtkCellLocator does what
you're looking for:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/CellLocator
If you can confirm that this works directly and let me know, I'll add
notes and keywords to that example to the effect of "projecting a
point onto a mesh" and "closest point on a mesh" as this is a very
reasonable operation that has a not-so-intuitive name in VTK.
David
More information about the vtkusers
mailing list