3
$\begingroup$

I have rectangular matrix of 3d points sampled from a parametric surface. In my program this matrix provides base points for bilinear interpolation of surface (In any (u,v) point it returns 3d point interpolated from neighboring sampled values). Now I want to find closest point on surface from any other point in 3d space, considering values "between" sampled points of grid.

I'll attach picture with example on 2d curve. Here yellow points are sampled points, red point - point to which we want to find closest, and green - point which we need to find as closest (witness point). enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

This is only a rough idea, though I hope it may inspire better answers.

The closest point on a surface is as far as I know always forms together with the red point a line that is orthogonal to the surface.

If you know which yellow vertices form the surface that the green point lies on, this is easy. You could just formulate the normal form of the surface (which is piecewise linear so it works out) formulate the orthogonal line to the surface that goes through the red point and solve for the intersection point. Though I don't have the exact math here, this step should be easy to look up.

Now the problem is: Which linear piece of your surface is the closest one. Either you calculate the green-point candidates for all linear pieces and also the distance and take the closest one, or you find some other possibly faster way for this. For that I don't have a more clever idea.

$\endgroup$
1
  • $\begingroup$ Yes, normal at witness point P must have same direction as vector S-P (where S is slave point, or red one on the picture above), but surface can have several such points (If it's folded, and point is inside), and we will have to choose closest from ones with "good" normal. Anyway thanks for answer. $\endgroup$ Commented Aug 3, 2016 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.