Returns the point on a mesh that is closest to a test point.
rhinoscriptsyntax.MeshClosestPoint (object_id, point, maximum_distance=None)
rhinoscript.mesh.MeshClosestPoint (object_id, point, maximum_distance=None)
object_id |
Required. String or Guid. The identifier of a mesh object. |
point |
Required. List of 3 numbers or Point3d. A 3-D point to test. |
maximum_distance |
Optional. Number. Optional upper bound on the distance from the test point on the mesh. If you are only interested in finding a point Q on the mesh when point.DistanceTo(Q) < maximum_distance, then set maximum_distance to that value. |
List |
A list containing the results of the calculation, if successful. The array elements are as follows:
|
|||||||||
None |
If not successful, or on error. |
import rhinocriptsyntax as rs
obj = rs.GetObject("Select mesh", rs.filter.mesh)
point = rs.GetPoint("Pick test point")
intersect = rs.MeshClosestPoint(obj, point)
if intersect: rs.AddPoint(intersect)