Verifies that a point is inside a closed surface or polysurface.
rhinoscriptsyntax.IsPointInSurface ( object_id, point, strictly_in=False, tolerance=None )
rhinoscript.surface.IsPointInSurface ( object_id, point, strictly_in=False, tolerance=None )
object_id |
Required. String or Guid. The object's identifier. |
point |
Required. List of three numbers or Point3d. The test, or sampling, point. |
strictly_in |
Optional. Boolean. If False (Default), then the test point is considered inside if it is truly inside or within tolerance of boundary. If True, then the test point must be inside by at least the tolerance. |
tolerance |
Optional. Number. The distance tolerance used for intersection and determining strict inclusion. If omitted, then Rhino's internal tolerance is used. |
Boolean |
True if successful, otherwise False. |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select a polysurface", rs.filter.polysurface)
if rs.IsPolysurfaceClosed(obj):
point = rs.GetPoint("Pick a test point")
if point:
if rs.IsPointInSurface(obj, point):
print "The point is inside the polysurface."
else:
print "The point is not inside the polysurface."