PlaneSphereIntersection

Calculates the intersection of a plane and a sphere.   

Syntax

Rhino.PlaneSphereIntersection (arrPlane, arrSpherePlane, dblSphereRadius)

Parameters

arrPlane

Required.  Array.  The plane to intersect.

arrSpherePlane

Required.  Array.  An equatorial plane of the sphere.  The origin of the plane will be the center point of the sphere.

dblSphereRadius

Required.  Number.  The radius of the sphere.

Returns

Array

An array of intersection results, if successful. The results are as follows:

Element

Type

Description

0

Number

The type of intersection, where 0 = point and 1 = circle.

1

Array

If a point intersection, then an array identifying the 3-D intersection location.

If a circle intersection, then the circle's plane. The origin of the plane will be the center point of the circle.

2 (circle intersection only)

Number

If a circle intersection, then the radius of the circle.

Null

If not successful, or on error.

Example

Dim arrLine, arrPlane, dblHeight, dblRadius

Dim arrResults, i

arrPlane = Rhino.WorldXYPlane

dblRadius = 10

arrResults = Rhino.PlaneSphereIntersection(arrPlane, arrPlane, dblRadius)

If IsArray(arrResults) Then

  If arrResults(0) = 0 Then

    Rhino.AddPoint arrResults(1)

  Else

    Rhino.AddCircle arrResults(1), arrResults(2)

  End If

End If

Also See

IntersectPlanes

PlaneArcIntersection

PlaneCircleIntersection

PlanePlaneIntersection