Calculates the intersection of a line and a cylinder.
Rhino.LineCylinderIntersection (arrLine, arrCylinderPlane, dblCylinderHeight, dblCylinderRadius)
arrLine |
Required. Array. Two 3-D points identifying the starting and ending points of the line. |
arrCylinderPlane |
Required. Array. The base plane of the cylinder. |
dblCylinderHeight |
Required. Number. The height of the cylinder. |
dblCylinderRadius |
Required. Number. The radius of the cylinder. |
Array |
An array of intersection points, either one or two, if successful. |
Null |
If not successful, or on error. |
Dim arrLine, arrPlane, dblHeight, dblRadius
Dim arrPoints, i
arrPlane = Rhino.WorldXYPlane
dblHeight = 10
dblRadius = 5
arrLine = Array(Array(-10,0,0), Array(10,0,10))
arrPoints = Rhino.LineCylinderIntersection(arrLine, arrPlane, dblHeight, dblRadius)
If IsArray(arrPoints) Then
For i = 0 To UBound(arrPoints)
Rhino.AddPoint arrPoints(i)
Next
End If