Calculates the intersection of a curve object with a surface object. Note, this function works on the untrimmed portion of the surface.
rhinoscriptsyntax.CurveSurfaceIntersection (curve_id, surface_id, tolerance=-1, angle_tolerance=-1)
rhinoscript.curve.CurveSurfaceIntersection (curve_id, surface_id, tolerance=-1, angle_tolerance=-1)
curve_id |
Required. String or Guid. The identifier of a curve object. |
surface_id |
Required. String or Guid. The identifier of a surface object. |
tolerance |
Optional. Number. The absolute tolerance in drawing units. If omitted, the document's current absolute tolerance is used. |
angle_tolerance |
Optional. Number. The angle tolerance in degrees. The angle tolerance is used to determine when the curve is tangent to the surface. If omitted, the document's current angle 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 csx():
curve = rs.GetObject("Select curve", rs.filter.curve)
if curve is None: return
surface = rs.GetObject("Select surface", rs.filter.surface)
if surface is None: return
intersection_list = rs.CurveSurfaceIntersection(curve, surface)
if intersection_list is None:
print "Curve and surface do not intersect."
return
for intersection in intersection_list:
if intersection[0]==1:
print "Point"
print "Intersection point on curve:", intersection[1]
print "Intersection point on surface:", intersection[3]
print "Curve parameter:", intersection[5]
print "Surface parameter:", intersection[7], ",", intersection[8]
else:
print "Overlap"
print "Intersection start point on curve:", intersection[1]
print "Intersection end point on curve:", intersection[2]
print "Intersection start point on surface:", intersection[3]
print "Intersection end point on surface:", intersection[4]
print "Curve parameter range:", intersection[5], "to", intersection[6]
print "Surface parameter range:", intersection[7], ",", intersection[8], "to", intersection[9], ",", intersection[10]
csx()