Returns the point on a surface or polysurface that is closest to a test point. This function works on both untrimmed and trimmed surfaces.
Rhino.BrepClosestPoint (strObject, arrPoint [, blnFaces])
strObject |
Required. String. The object's identifier. |
arrPoint |
Required. Array. The test, or sampling, point. |
blnFaces |
Optional. Boolean. If True, then the closest point calculations will be restricted to faces. Of omitted or False (Default), then all components will be used in the calculation. |
Array |
An array of closest point information if successful. The array will contain the following information:
|
|||||||||||||||||||||||||||
Null |
If not successful, or on error. |
Const rhObjectSurface = 8
Dim strObject, arrPoint, arrCP
strObject = Rhino.GetObject("Select a surface", rhObjectSurface)
If Rhino.IsSurface(strObject) Then
arrPoint = Rhino.GetPoint("Pick a test point")
if IsArray(arrPoint) Then
arrCP = Rhino.BrepClosestPoint(strObject, arrPoint)
If IsArray(arrCP) Then
Rhino.AddPoint arrPoint
Rhino.AddPoint arrCP(0)
End If
End If
End If