Simple (?) Problem finding a distance from a B Spline Surface

Hi all,
I’m having a problem with the following code. I have a list of points (conpts) to build a BSpline Surface. I want to find the minimum distance of that surface from a given ponit (test). NArgMin works on the norm of the surface, but not when substracting a vector “test” (last line). Why not? Any help would be welcom!

R

I get the same problem (of course with different data)! I checked the bspline function with ParametricPlot3D to make sure there were no kinks, intersections or such that would spoof NArgMin (NMinimize). Also tried defining/submitting:
func[u_?NumericQ, v_?NumericQ]:= Norm[…]
to NArgMin to no avail.

func[u_?NumericQ, v_?NumericQ] := Norm[srffn[u, v] - test]

Thanks, Frank! Seems like a bug. All I can do is write a manual loop to minimze the distance from a test point to the surface. Back to low level programming! :frowning: