Returns the UV parameter of the point on a surface that is closest to a test point.
Rhino.SurfaceClosestPoint (strObject, arrPoint [, blnTrimmed])
strObject |
Required. String. The object's identifier. |
arrPoint |
Required. Array. The test, or sampling, point. |
blnTrimmed |
Optional. Boolean. If False (default) and the surface is trimmed, then the calculation is based on the underlying untrimmed surface. If true and the surface is trimmed, then the calculation is based on the trimmed face. |
Array |
An array containing the U,V parameters of the closest point on the surface if successful. |
Null |
If not successful, or on error. |
Const rhObjectSurface = 8
Dim strObject, arrPoint, arrParam
strObject = Rhino.GetObject("Select a surface", rhObjectSurface)
If Rhino.IsSurface(strObject) Then
arrPoint = Rhino.GetPointOnSurface(strObject, "Pick a test point")
if IsArray(arrPoint) Then
arrParam = Rhino.SurfaceClosestPoint(strObject, arrPoint)
If IsArray(arrParam) Then
Rhino.Print "Surface U parameter: " & CStr(arrParam(0))
Rhino.Print "Surface V parameter: " & CStr(arrParam(1))
End If
End If
End If