Determines the relationship between the regions bounded by two coplanar simple closed curves.
rhinoscriptsyntax.PlanarClosedCurveContainment (curve_a, curve_b, plane=None, tolerance=None)
rhinoscript.curve.PlanarClosedCurveContainment (curve_a, curve_b, plane=None, tolerance=None)
curve_a |
Required. String or Guid. The object identifier of the first planar, closed curve. |
curve_b |
Required. String or Guid. The object identifier of the second planar, closed curve. |
plane |
Optional. The new construction plane. 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 relationship if successful. The possible values are as follows:
|
||||||||||
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
curve1 = rs.GetObject("Select first curve", rs.filter.curve )
curve2 = rs.GetObject("Select second curve", rs.filter.curve )
if rs.IsCurvePlanar(curve1) and rs.IsCurvePlanar(curve2):
if rs.IsCurveClosed(curve1) and rs.IsCurveClosed(curve2):
if rs.IsCurveInPlane(curve1) and rs.IsCurveInPlane(curve2):
result = rs.PlanarClosedCurveContainment(curve1, curve2)
if result==0: print "The regions bounded by the curves are disjoint."
elif result==1: print "The two curves intersect.."
elif result==2: print "The region bounded by Curve1 is inside of Curve2."
else: print "The region bounded by Curve2 is inside of Curve1."