Calculates the intersection of a curve object and a mesh object.
rhinoscriptsyntax.CurveMeshIntersection (curve_id, mesh_id, return_faces=False)
rhinoscript.mesh.CurveMeshIntersection (curve_id, mesh_id, return_faces=False)
curve_id |
Required. String or Guid. The identifier of the curve to intersect. |
mesh_id |
Required. String or Guid. The identifier of the mesh to intersect. |
return_faces |
Optional. Boolean. Return both intersection points and face indices. If omitted or False, then just the intersection points are returned. |
List |
If return_faces is either omitted or False, then a list of intersection points, if successful. |
|||||||||
List |
If return_faces is True, then a one-dimensional list containing information about each intersection if successful. Each list element contains the following two elements:
|
|||||||||
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
curve = rs.GetObject("Select curve to intersect", rs.filter.curve)
if curve:
mesh = rs.GetObject("Select mesh to intersect", rs.filter.mesh)
if mesh:
cmx = rs.CurveMeshIntersection(curve, mesh, True)
if cmx:
for element in cmx:
print element[0], ", Face index = ", element[1]
rs.AddPoint(element[0])