Determines if a point is inside of a closed curve, on a closed curve, or outside of a closed curve.
rhinoscriptsyntax.PointInPlanarClosedCurve (point, curve, plane=None, tolerance=None)
rhinoscript.curve.PointInPlanarClosedCurve (point, curve, plane=None, tolerance=None)
point |
Required. List of 3 numbers or Point3d. A 3-D point to test. |
curve |
Required. String or Guid. The object identifier of the planar, closed curve. |
plane |
Optional. Plane. The plane containing the closed curve and point. If omitted, the currently active construction plane is used. |
tolerance |
Optional. Number. The tolerance. If omitted, the current document absolute tolerance is used. |
Number |
A number identifying the result if successful. The possible values are as follows:
|
||||||||
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
curve = rs.GetObject("Select a planar, closed curve", rs.filter.curve)
if rs.IsCurveClosed(curve) and rs.IsCurvePlanar(curve):
point = rs.GetPoint("Pick a point")
if point:
result = rs.PointInPlanarClosedCurve(point, curve)
if result==0: print "The point is outside of the closed curve."
elif result==1: print "The point is inside of the closed curve."
else: print "The point is on the closed curve."