Calculates the intersection of two curve objects.
rhinoscriptsyntax.CurveCurveIntersection (curveA, curveB=None, tolerance=-1)
rhinoscript.curve.CurveCurveIntersection (curveA, curveB=None, tolerance=-1)
curveA |
Required. String or Guid. The identifier of the first curve object. |
curveB |
Optional. String or Guid. The identifier of the second curve object. If omitted, the a self-intersection test will be performed on curveA. |
tolerance |
Optional. Number. The absolute tolerance in drawing units. If omitted, the document's current absolute tolerance is used. |
List |
A two-dimensional list of intersection information if successful. The list will contain one or more of the following elements:
|
||||||||||||||||||||||||||||||
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
def ccx():
curve1 = rs.GetObject("Select first curve", rs.filter.curve)
if curve1 is None: return
curve2 = rs.GetObject("Select second curve", rs.filter.curve)
if curve2 is None: return
intersection_list = rs.CurveCurveIntersection(curve1, curve2)
if intersection_list is None:
print "Selected curves do not intersect."
return
for intersection in intersection_list:
if intersection[0] == 1:
print "Point"
print "Intersection point on first curve: ", intersection[1]
print "Intersection point on second curve: ", intersection[3]
print "First curve parameter: ", intersection[5]
print "Second curve parameter: ", intersection[7]
else:
print "Overlap"
print "Intersection start point on first curve: ", intersection[1]
print "Intersection end point on first curve: ", intersection[2]
print "Intersection start point on second curve: ", intersection[3]
print "Intersection end point on second curve: ", intersection[4]
print "First curve parameter range: ", intersection[5], " to ", intersection[6]
print "Second curve parameter range: ", intersection[7], " to ", intersection[8]
ccx()