Returns the point on a surface or polysurface that is closest to a test point. This function works on both untrimmed and trimmed surfaces.
rhinoscriptsyntax.BrepClosestPoint (object_id, point)
rhinoscript.surface.BrepClosestPoint (object_id, point)
object_id |
Required. String or Guid. The object's identifier. |
point |
Required. List of three numbers or Point3d. The test, or sampling, point. |
List |
An array of closest point information if successful. The list will contain the following information:
|
|||||||||||||||
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select a surface", rs.filter.surface)
if obj:
point = rs.GetPoint("Pick a test point")
if point:
arrCP = rs.BrepClosestPoint(obj, point)
if arrCP:
rs.AddPoint(point)
rs.AddPoint( arrCP[0] )