判断一个点是否在一个网格上。
rhinoscriptsyntax.IsPointOnMesh (object_id, point)
rhinoscript.mesh.IsPointOnMesh (object_id, point)
object_id |
必须参数。字符串或 Guid。物件的 ID 。 |
point |
必须参数。三个数字组成的列表或 Point3d 对象。要计算的点或采样点。 |
布尔值 |
如果执行成功,返回 True,如果执行不成功返回 False。 |
None |
出错返回空值。 |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select a mesh")
if rs.IsMesh(obj):
point = rs.GetPointOnMesh(strObject, "Pick a test point")
if point:
if rs.IsPointOnMesh(obj, point):
print "The point is on the mesh"
else:
print "The point is not on the mesh"