Intersect an infinite line and a mesh object.
Rhino.LineMeshIntersection (arrLine, strMesh [, blnReturnFaces])
arrLine |
Required. Array. Two 3-D points identifying the starting and ending points of the line. |
strMesh |
Required. String. The identifier of the mesh object. |
blnReturnFaces |
Optional. Boolean. Return both intersection points and face indices. If omitted or False, then just the intersection points are returned. |
Array |
If blnReturnFaces is either omitted or False, then an array intersection points, if successful. |
|||||||||
Array |
If blnReturnFaces is True, then a one-dimensional array containing information about each intersection if successful. Each array element is a one-dimensional array that contains the following two elements:
|
|||||||||
Null |
If not successful, or on error. |
Sub TestLineMeshIntersection
Dim strMesh, arrStart, arrEnd, arrLMX, arrPt
strMesh = Rhino.GetObject("Select mesh", 32)
If IsNull(strMesh) Then Exit Sub
arrStart = Rhino.GetPoint("Start of line")
If IsNull(arrStart) Then Exit Sub
arrEnd = Rhino.GetPoint("End of line", arrStart)
If IsNull(arrEnd) Then Exit Sub
arrLMX = Rhino.LineMeshIntersection(Array(arrStart, arrEnd), strMesh, False)
If IsArray(arrLMX) Then
For Each arrPt in arrLMX
Rhino.AddPoint arrPt
Next
End If
End Sub