LineCylinderIntersection

Calculates the intersection of a line and a cylinder.   

Syntax

Rhino.LineCylinderIntersection (arrLine, arrCylinderPlane, dblCylinderHeight, dblCylinderRadius)

Parameters

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.

Returns

Array

An array of intersection points, either one or two, if successful.

Null

If not successful, or on error.

Example

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

Also See

LineArcIntersection

LineBoxIntersection

LineCircleIntersection

LineLineIntersection

LinePlaneIntersection

LineSphereIntersection