LineBoxIntersection

Intersect an infinite line and an axis-aligned bounding box.  

Syntax

Rhino.LineBoxIntersection (arrLine, arrMin, arrMax [, dblTolerance])

Parameters

arrLine

Required.  Array.  Two 3-D points identifying the starting and ending points of the line.

arrMin

Required.  Array.  The minimum bounding box point.

arrMax

Required.  Array.  The maximum bounding box point.

dblTolerance

Optional.  Number.  If specified and greater than 0.0, then the intersection is performed against a box that has each side moved out by dblTolerance.

Returns

Array

An array containing the 3-D intersection points if successful.

Null

If not successful, or on error.

Example

Dim arrLine, arrLineB, arrPoints

arrLine = Array(Array(-6,2,0), Array(-3,3,1))

arrMin = Array(0,0,0)

arrMax = Array(10,10,10)

arrPoints = Rhino.LineBoxIntersection(arrLine, arrMin, arrMax)

If IsArray(arrPoints) Then

  Rhino.AddPoints arrPoints

End If

Also See

LineArcIntersection

LineCircleIntersection

LineCylinderIntersection

LineLineIntersection

LinePlaneIntersection

LineSphereIntersection