Returns the UV parameter of the point on a surface that is closest to a test point.
rhinoscriptsyntax.SurfaceClosestPoint (surface_id, test_point)
rhinoscript.surface.SurfaceClosestPoint (surface_id, test_point)
surface_id |
Required. String or Guid. The object's identifier. |
test_point |
Required. list of 3 numbers or Point3d. The test, or sampling, point. |
List |
A list containing the U,V parameters of the closest point on the surface if successful. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select a surface", rs.filter.surface)
if rs.IsSurface(obj):
point = rs.GetPointOnSurface(obj, "Pick a test point")
if point:
param = rs.SurfaceClosestPoint(obj, point)
if param:
print "Surface U parameter: ", str(param[0])
print "Surface V parameter: ", str(param[1])